const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["chunks/index-BWkvlZPi.js","chunks/Logo1am-CSacEOt-.js","chunks/cardano_serialization_lib-CCLeBkON.js"])))=>i.map(i=>d[i]);
import { j as At, g as ot, b as mt, k as _t, $ as Rre, v as uE, w as WM, c as he, m as Le, f as Ze, a as M, D as Nre, n as it, l as us, u as ds, e as ai, h as Gi, S as ge, o as $a, i as X, L as Zm, t as se, x as Vre, y as Qt, P as dE, d as ci, z as vv, p as Mt, F as tr, A as Zf, M as Jf, q as fE, B as v2, C as w6, s as gH, E as Bre, G as bH } from "./Logo1am-CSacEOt-.js";
let Nvt, Cvt, yi, hl, nne, sj, Wte, jte, Qct, M2, fte, Y5, Sg, v3t, lxt, Ivt, yn, axt, mH, y3t, wd, $vt, Qvt, vlt, s3t, Yvt, Uvt, fu, $te, r3t, Vvt, Zvt, jvt, e3t, Kvt, p3t, f3t, d3t, c3t, g3t, u3t, mgt, Avt, h3t, l3t, Ovt, _3t, Pvt, Gvt, ygt, Bvt, qvt, m3t, Mvt, Xvt, Dvt, t3t, zvt, Wvt, Fvt, Rvt, Ij, o3t, a3t, i3t, b3t, p9, n3t, uu, wh, Cg, Gd, Qr, x3t, Ig, Ere, Gh, Zh, w3t, Cwt, i1, Dl, _d, o1, Jh, Jvt, Hvt, Lvt, Xte, _p, ke, ir, MO, Pg, Fn, Ks, du, J5, G5, zt, Z5, vn, mh, xie, yo, e1, Zct, of, dj, Hte, Kte, Km, GT;
let __tla = (async ()=>{
    mH = function(t) {
        return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
    };
    axt = 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 A9 = {}, Ab = {}, $M;
    function Dre() {
        if ($M) return Ab;
        $M = 1, Ab.byteLength = a, Ab.toByteArray = l, Ab.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 b = p.indexOf("=");
            b === -1 && (b = h);
            var y = b === h ? 0 : 4 - b % 4;
            return [
                b,
                y
            ];
        }
        function a(p) {
            var h = o(p), b = h[0], y = h[1];
            return (b + y) * 3 / 4 - y;
        }
        function c(p, h, b) {
            return (h + b) * 3 / 4 - b;
        }
        function l(p) {
            var h, b = o(p), y = b[0], _ = b[1], v = new n(c(p, y, _)), w = 0, E = _ > 0 ? y - 4 : y, I;
            for(I = 0; I < E; I += 4)h = e[p.charCodeAt(I)] << 18 | e[p.charCodeAt(I + 1)] << 12 | e[p.charCodeAt(I + 2)] << 6 | e[p.charCodeAt(I + 3)], v[w++] = h >> 16 & 255, v[w++] = h >> 8 & 255, v[w++] = h & 255;
            return _ === 2 && (h = e[p.charCodeAt(I)] << 2 | e[p.charCodeAt(I + 1)] >> 4, v[w++] = h & 255), _ === 1 && (h = e[p.charCodeAt(I)] << 10 | e[p.charCodeAt(I + 1)] << 4 | e[p.charCodeAt(I + 2)] >> 2, v[w++] = h >> 8 & 255, v[w++] = h & 255), v;
        }
        function u(p) {
            return t[p >> 18 & 63] + t[p >> 12 & 63] + t[p >> 6 & 63] + t[p & 63];
        }
        function d(p, h, b) {
            for(var y, _ = [], v = h; v < b; v += 3)y = (p[v] << 16 & 16711680) + (p[v + 1] << 8 & 65280) + (p[v + 2] & 255), _.push(u(y));
            return _.join("");
        }
        function f(p) {
            for(var h, b = p.length, y = b % 3, _ = [], v = 16383, w = 0, E = b - y; w < E; w += v)_.push(d(p, w, w + v > E ? E : w + v));
            return y === 1 ? (h = p[b - 1], _.push(t[h >> 2] + t[h << 4 & 63] + "==")) : y === 2 && (h = (p[b - 2] << 8) + p[b - 1], _.push(t[h >> 10] + t[h >> 4 & 63] + t[h << 2 & 63] + "=")), _.join("");
        }
        return Ab;
    }
    var Nw = {};
    var XM;
    function Fre() {
        return XM || (XM = 1, Nw.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);
        }, Nw.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, b = 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] |= b * 128;
        }), Nw;
    }
    var GM;
    function yH() {
        return GM || (GM = 1, (function(t) {
            const e = Dre(), n = Fre(), r = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
            t.Buffer = a, t.SlowBuffer = v, 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 H = new Uint8Array(1), T = {
                        foo: function() {
                            return 42;
                        }
                    };
                    return Object.setPrototypeOf(T, Uint8Array.prototype), Object.setPrototypeOf(H, T), H.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(H) {
                if (H > s) throw new RangeError('The value "' + H + '" is invalid for option "size"');
                const T = new Uint8Array(H);
                return Object.setPrototypeOf(T, a.prototype), T;
            }
            function a(H, T, P) {
                if (typeof H == "number") {
                    if (typeof T == "string") throw new TypeError('The "string" argument must be of type string. Received type number');
                    return d(H);
                }
                return c(H, T, P);
            }
            a.poolSize = 8192;
            function c(H, T, P) {
                if (typeof H == "string") return f(H, T);
                if (ArrayBuffer.isView(H)) return h(H);
                if (H == null) throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof H);
                if (ut(H, ArrayBuffer) || H && ut(H.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (ut(H, SharedArrayBuffer) || H && ut(H.buffer, SharedArrayBuffer))) return b(H, T, P);
                if (typeof H == "number") throw new TypeError('The "value" argument must not be of type number. Received type number');
                const Z = H.valueOf && H.valueOf();
                if (Z != null && Z !== H) return a.from(Z, T, P);
                const ie = y(H);
                if (ie) return ie;
                if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof H[Symbol.toPrimitive] == "function") return a.from(H[Symbol.toPrimitive]("string"), T, P);
                throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof H);
            }
            a.from = function(H, T, P) {
                return c(H, T, P);
            }, Object.setPrototypeOf(a.prototype, Uint8Array.prototype), Object.setPrototypeOf(a, Uint8Array);
            function l(H) {
                if (typeof H != "number") throw new TypeError('"size" argument must be of type number');
                if (H < 0) throw new RangeError('The value "' + H + '" is invalid for option "size"');
            }
            function u(H, T, P) {
                return l(H), H <= 0 ? o(H) : T !== void 0 ? typeof P == "string" ? o(H).fill(T, P) : o(H).fill(T) : o(H);
            }
            a.alloc = function(H, T, P) {
                return u(H, T, P);
            };
            function d(H) {
                return l(H), o(H < 0 ? 0 : _(H) | 0);
            }
            a.allocUnsafe = function(H) {
                return d(H);
            }, a.allocUnsafeSlow = function(H) {
                return d(H);
            };
            function f(H, T) {
                if ((typeof T != "string" || T === "") && (T = "utf8"), !a.isEncoding(T)) throw new TypeError("Unknown encoding: " + T);
                const P = w(H, T) | 0;
                let Z = o(P);
                const ie = Z.write(H, T);
                return ie !== P && (Z = Z.slice(0, ie)), Z;
            }
            function p(H) {
                const T = H.length < 0 ? 0 : _(H.length) | 0, P = o(T);
                for(let Z = 0; Z < T; Z += 1)P[Z] = H[Z] & 255;
                return P;
            }
            function h(H) {
                if (ut(H, Uint8Array)) {
                    const T = new Uint8Array(H);
                    return b(T.buffer, T.byteOffset, T.byteLength);
                }
                return p(H);
            }
            function b(H, T, P) {
                if (T < 0 || H.byteLength < T) throw new RangeError('"offset" is outside of buffer bounds');
                if (H.byteLength < T + (P || 0)) throw new RangeError('"length" is outside of buffer bounds');
                let Z;
                return T === void 0 && P === void 0 ? Z = new Uint8Array(H) : P === void 0 ? Z = new Uint8Array(H, T) : Z = new Uint8Array(H, T, P), Object.setPrototypeOf(Z, a.prototype), Z;
            }
            function y(H) {
                if (a.isBuffer(H)) {
                    const T = _(H.length) | 0, P = o(T);
                    return P.length === 0 || H.copy(P, 0, 0, T), P;
                }
                if (H.length !== void 0) return typeof H.length != "number" || Ce(H.length) ? o(0) : p(H);
                if (H.type === "Buffer" && Array.isArray(H.data)) return p(H.data);
            }
            function _(H) {
                if (H >= s) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + s.toString(16) + " bytes");
                return H | 0;
            }
            function v(H) {
                return +H != H && (H = 0), a.alloc(+H);
            }
            a.isBuffer = function(T) {
                return T != null && T._isBuffer === !0 && T !== a.prototype;
            }, a.compare = function(T, P) {
                if (ut(T, Uint8Array) && (T = a.from(T, T.offset, T.byteLength)), ut(P, Uint8Array) && (P = a.from(P, P.offset, P.byteLength)), !a.isBuffer(T) || !a.isBuffer(P)) throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');
                if (T === P) return 0;
                let Z = T.length, ie = P.length;
                for(let ce = 0, be = Math.min(Z, ie); ce < be; ++ce)if (T[ce] !== P[ce]) {
                    Z = T[ce], ie = P[ce];
                    break;
                }
                return Z < ie ? -1 : ie < Z ? 1 : 0;
            }, a.isEncoding = function(T) {
                switch(String(T).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(T, P) {
                if (!Array.isArray(T)) throw new TypeError('"list" argument must be an Array of Buffers');
                if (T.length === 0) return a.alloc(0);
                let Z;
                if (P === void 0) for(P = 0, Z = 0; Z < T.length; ++Z)P += T[Z].length;
                const ie = a.allocUnsafe(P);
                let ce = 0;
                for(Z = 0; Z < T.length; ++Z){
                    let be = T[Z];
                    if (ut(be, Uint8Array)) ce + be.length > ie.length ? (a.isBuffer(be) || (be = a.from(be)), be.copy(ie, ce)) : Uint8Array.prototype.set.call(ie, be, ce);
                    else if (a.isBuffer(be)) be.copy(ie, ce);
                    else throw new TypeError('"list" argument must be an Array of Buffers');
                    ce += be.length;
                }
                return ie;
            };
            function w(H, T) {
                if (a.isBuffer(H)) return H.length;
                if (ArrayBuffer.isView(H) || ut(H, ArrayBuffer)) return H.byteLength;
                if (typeof H != "string") throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof H);
                const P = H.length, Z = arguments.length > 2 && arguments[2] === !0;
                if (!Z && P === 0) return 0;
                let ie = !1;
                for(;;)switch(T){
                    case "ascii":
                    case "latin1":
                    case "binary":
                        return P;
                    case "utf8":
                    case "utf-8":
                        return Je(H).length;
                    case "ucs2":
                    case "ucs-2":
                    case "utf16le":
                    case "utf-16le":
                        return P * 2;
                    case "hex":
                        return P >>> 1;
                    case "base64":
                        return qe(H).length;
                    default:
                        if (ie) return Z ? -1 : Je(H).length;
                        T = ("" + T).toLowerCase(), ie = !0;
                }
            }
            a.byteLength = w;
            function E(H, T, P) {
                let Z = !1;
                if ((T === void 0 || T < 0) && (T = 0), T > this.length || ((P === void 0 || P > this.length) && (P = this.length), P <= 0) || (P >>>= 0, T >>>= 0, P <= T)) return "";
                for(H || (H = "utf8");;)switch(H){
                    case "hex":
                        return L(this, T, P);
                    case "utf8":
                    case "utf-8":
                        return g(this, T, P);
                    case "ascii":
                        return R(this, T, P);
                    case "latin1":
                    case "binary":
                        return N(this, T, P);
                    case "base64":
                        return C(this, T, P);
                    case "ucs2":
                    case "ucs-2":
                    case "utf16le":
                    case "utf-16le":
                        return z(this, T, P);
                    default:
                        if (Z) throw new TypeError("Unknown encoding: " + H);
                        H = (H + "").toLowerCase(), Z = !0;
                }
            }
            a.prototype._isBuffer = !0;
            function I(H, T, P) {
                const Z = H[T];
                H[T] = H[P], H[P] = Z;
            }
            a.prototype.swap16 = function() {
                const T = this.length;
                if (T % 2 !== 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
                for(let P = 0; P < T; P += 2)I(this, P, P + 1);
                return this;
            }, a.prototype.swap32 = function() {
                const T = this.length;
                if (T % 4 !== 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
                for(let P = 0; P < T; P += 4)I(this, P, P + 3), I(this, P + 1, P + 2);
                return this;
            }, a.prototype.swap64 = function() {
                const T = this.length;
                if (T % 8 !== 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
                for(let P = 0; P < T; P += 8)I(this, P, P + 7), I(this, P + 1, P + 6), I(this, P + 2, P + 5), I(this, P + 3, P + 4);
                return this;
            }, a.prototype.toString = function() {
                const T = this.length;
                return T === 0 ? "" : arguments.length === 0 ? g(this, 0, T) : E.apply(this, arguments);
            }, a.prototype.toLocaleString = a.prototype.toString, a.prototype.equals = function(T) {
                if (!a.isBuffer(T)) throw new TypeError("Argument must be a Buffer");
                return this === T ? !0 : a.compare(this, T) === 0;
            }, a.prototype.inspect = function() {
                let T = "";
                const P = t.INSPECT_MAX_BYTES;
                return T = this.toString("hex", 0, P).replace(/(.{2})/g, "$1 ").trim(), this.length > P && (T += " ... "), "<Buffer " + T + ">";
            }, r && (a.prototype[r] = a.prototype.inspect), a.prototype.compare = function(T, P, Z, ie, ce) {
                if (ut(T, Uint8Array) && (T = a.from(T, T.offset, T.byteLength)), !a.isBuffer(T)) throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof T);
                if (P === void 0 && (P = 0), Z === void 0 && (Z = T ? T.length : 0), ie === void 0 && (ie = 0), ce === void 0 && (ce = this.length), P < 0 || Z > T.length || ie < 0 || ce > this.length) throw new RangeError("out of range index");
                if (ie >= ce && P >= Z) return 0;
                if (ie >= ce) return -1;
                if (P >= Z) return 1;
                if (P >>>= 0, Z >>>= 0, ie >>>= 0, ce >>>= 0, this === T) return 0;
                let be = ce - ie, yt = Z - P;
                const Et = Math.min(be, yt), dt = this.slice(ie, ce), Kt = T.slice(P, Z);
                for(let tt = 0; tt < Et; ++tt)if (dt[tt] !== Kt[tt]) {
                    be = dt[tt], yt = Kt[tt];
                    break;
                }
                return be < yt ? -1 : yt < be ? 1 : 0;
            };
            function D(H, T, P, Z, ie) {
                if (H.length === 0) return -1;
                if (typeof P == "string" ? (Z = P, P = 0) : P > 2147483647 ? P = 2147483647 : P < -2147483648 && (P = -2147483648), P = +P, Ce(P) && (P = ie ? 0 : H.length - 1), P < 0 && (P = H.length + P), P >= H.length) {
                    if (ie) return -1;
                    P = H.length - 1;
                } else if (P < 0) if (ie) P = 0;
                else return -1;
                if (typeof T == "string" && (T = a.from(T, Z)), a.isBuffer(T)) return T.length === 0 ? -1 : U(H, T, P, Z, ie);
                if (typeof T == "number") return T = T & 255, typeof Uint8Array.prototype.indexOf == "function" ? ie ? Uint8Array.prototype.indexOf.call(H, T, P) : Uint8Array.prototype.lastIndexOf.call(H, T, P) : U(H, [
                    T
                ], P, Z, ie);
                throw new TypeError("val must be string, number or Buffer");
            }
            function U(H, T, P, Z, ie) {
                let ce = 1, be = H.length, yt = T.length;
                if (Z !== void 0 && (Z = String(Z).toLowerCase(), Z === "ucs2" || Z === "ucs-2" || Z === "utf16le" || Z === "utf-16le")) {
                    if (H.length < 2 || T.length < 2) return -1;
                    ce = 2, be /= 2, yt /= 2, P /= 2;
                }
                function Et(Kt, tt) {
                    return ce === 1 ? Kt[tt] : Kt.readUInt16BE(tt * ce);
                }
                let dt;
                if (ie) {
                    let Kt = -1;
                    for(dt = P; dt < be; dt++)if (Et(H, dt) === Et(T, Kt === -1 ? 0 : dt - Kt)) {
                        if (Kt === -1 && (Kt = dt), dt - Kt + 1 === yt) return Kt * ce;
                    } else Kt !== -1 && (dt -= dt - Kt), Kt = -1;
                } else for(P + yt > be && (P = be - yt), dt = P; dt >= 0; dt--){
                    let Kt = !0;
                    for(let tt = 0; tt < yt; tt++)if (Et(H, dt + tt) !== Et(T, tt)) {
                        Kt = !1;
                        break;
                    }
                    if (Kt) return dt;
                }
                return -1;
            }
            a.prototype.includes = function(T, P, Z) {
                return this.indexOf(T, P, Z) !== -1;
            }, a.prototype.indexOf = function(T, P, Z) {
                return D(this, T, P, Z, !0);
            }, a.prototype.lastIndexOf = function(T, P, Z) {
                return D(this, T, P, Z, !1);
            };
            function K(H, T, P, Z) {
                P = Number(P) || 0;
                const ie = H.length - P;
                Z ? (Z = Number(Z), Z > ie && (Z = ie)) : Z = ie;
                const ce = T.length;
                Z > ce / 2 && (Z = ce / 2);
                let be;
                for(be = 0; be < Z; ++be){
                    const yt = parseInt(T.substr(be * 2, 2), 16);
                    if (Ce(yt)) return be;
                    H[P + be] = yt;
                }
                return be;
            }
            function $(H, T, P, Z) {
                return Ye(Je(T, H.length - P), H, P, Z);
            }
            function ne(H, T, P, Z) {
                return Ye(Ee(T), H, P, Z);
            }
            function te(H, T, P, Z) {
                return Ye(qe(T), H, P, Z);
            }
            function J(H, T, P, Z) {
                return Ye(le(T, H.length - P), H, P, Z);
            }
            a.prototype.write = function(T, P, Z, ie) {
                if (P === void 0) ie = "utf8", Z = this.length, P = 0;
                else if (Z === void 0 && typeof P == "string") ie = P, Z = this.length, P = 0;
                else if (isFinite(P)) P = P >>> 0, isFinite(Z) ? (Z = Z >>> 0, ie === void 0 && (ie = "utf8")) : (ie = Z, Z = void 0);
                else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
                const ce = this.length - P;
                if ((Z === void 0 || Z > ce) && (Z = ce), T.length > 0 && (Z < 0 || P < 0) || P > this.length) throw new RangeError("Attempt to write outside buffer bounds");
                ie || (ie = "utf8");
                let be = !1;
                for(;;)switch(ie){
                    case "hex":
                        return K(this, T, P, Z);
                    case "utf8":
                    case "utf-8":
                        return $(this, T, P, Z);
                    case "ascii":
                    case "latin1":
                    case "binary":
                        return ne(this, T, P, Z);
                    case "base64":
                        return te(this, T, P, Z);
                    case "ucs2":
                    case "ucs-2":
                    case "utf16le":
                    case "utf-16le":
                        return J(this, T, P, Z);
                    default:
                        if (be) throw new TypeError("Unknown encoding: " + ie);
                        ie = ("" + ie).toLowerCase(), be = !0;
                }
            }, a.prototype.toJSON = function() {
                return {
                    type: "Buffer",
                    data: Array.prototype.slice.call(this._arr || this, 0)
                };
            };
            function C(H, T, P) {
                return T === 0 && P === H.length ? e.fromByteArray(H) : e.fromByteArray(H.slice(T, P));
            }
            function g(H, T, P) {
                P = Math.min(H.length, P);
                const Z = [];
                let ie = T;
                for(; ie < P;){
                    const ce = H[ie];
                    let be = null, yt = ce > 239 ? 4 : ce > 223 ? 3 : ce > 191 ? 2 : 1;
                    if (ie + yt <= P) {
                        let Et, dt, Kt, tt;
                        switch(yt){
                            case 1:
                                ce < 128 && (be = ce);
                                break;
                            case 2:
                                Et = H[ie + 1], (Et & 192) === 128 && (tt = (ce & 31) << 6 | Et & 63, tt > 127 && (be = tt));
                                break;
                            case 3:
                                Et = H[ie + 1], dt = H[ie + 2], (Et & 192) === 128 && (dt & 192) === 128 && (tt = (ce & 15) << 12 | (Et & 63) << 6 | dt & 63, tt > 2047 && (tt < 55296 || tt > 57343) && (be = tt));
                                break;
                            case 4:
                                Et = H[ie + 1], dt = H[ie + 2], Kt = H[ie + 3], (Et & 192) === 128 && (dt & 192) === 128 && (Kt & 192) === 128 && (tt = (ce & 15) << 18 | (Et & 63) << 12 | (dt & 63) << 6 | Kt & 63, tt > 65535 && tt < 1114112 && (be = tt));
                        }
                    }
                    be === null ? (be = 65533, yt = 1) : be > 65535 && (be -= 65536, Z.push(be >>> 10 & 1023 | 55296), be = 56320 | be & 1023), Z.push(be), ie += yt;
                }
                return A(Z);
            }
            const x = 4096;
            function A(H) {
                const T = H.length;
                if (T <= x) return String.fromCharCode.apply(String, H);
                let P = "", Z = 0;
                for(; Z < T;)P += String.fromCharCode.apply(String, H.slice(Z, Z += x));
                return P;
            }
            function R(H, T, P) {
                let Z = "";
                P = Math.min(H.length, P);
                for(let ie = T; ie < P; ++ie)Z += String.fromCharCode(H[ie] & 127);
                return Z;
            }
            function N(H, T, P) {
                let Z = "";
                P = Math.min(H.length, P);
                for(let ie = T; ie < P; ++ie)Z += String.fromCharCode(H[ie]);
                return Z;
            }
            function L(H, T, P) {
                const Z = H.length;
                (!T || T < 0) && (T = 0), (!P || P < 0 || P > Z) && (P = Z);
                let ie = "";
                for(let ce = T; ce < P; ++ce)ie += oe[H[ce]];
                return ie;
            }
            function z(H, T, P) {
                const Z = H.slice(T, P);
                let ie = "";
                for(let ce = 0; ce < Z.length - 1; ce += 2)ie += String.fromCharCode(Z[ce] + Z[ce + 1] * 256);
                return ie;
            }
            a.prototype.slice = function(T, P) {
                const Z = this.length;
                T = ~~T, P = P === void 0 ? Z : ~~P, T < 0 ? (T += Z, T < 0 && (T = 0)) : T > Z && (T = Z), P < 0 ? (P += Z, P < 0 && (P = 0)) : P > Z && (P = Z), P < T && (P = T);
                const ie = this.subarray(T, P);
                return Object.setPrototypeOf(ie, a.prototype), ie;
            };
            function B(H, T, P) {
                if (H % 1 !== 0 || H < 0) throw new RangeError("offset is not uint");
                if (H + T > P) throw new RangeError("Trying to access beyond buffer length");
            }
            a.prototype.readUintLE = a.prototype.readUIntLE = function(T, P, Z) {
                T = T >>> 0, P = P >>> 0, Z || B(T, P, this.length);
                let ie = this[T], ce = 1, be = 0;
                for(; ++be < P && (ce *= 256);)ie += this[T + be] * ce;
                return ie;
            }, a.prototype.readUintBE = a.prototype.readUIntBE = function(T, P, Z) {
                T = T >>> 0, P = P >>> 0, Z || B(T, P, this.length);
                let ie = this[T + --P], ce = 1;
                for(; P > 0 && (ce *= 256);)ie += this[T + --P] * ce;
                return ie;
            }, a.prototype.readUint8 = a.prototype.readUInt8 = function(T, P) {
                return T = T >>> 0, P || B(T, 1, this.length), this[T];
            }, a.prototype.readUint16LE = a.prototype.readUInt16LE = function(T, P) {
                return T = T >>> 0, P || B(T, 2, this.length), this[T] | this[T + 1] << 8;
            }, a.prototype.readUint16BE = a.prototype.readUInt16BE = function(T, P) {
                return T = T >>> 0, P || B(T, 2, this.length), this[T] << 8 | this[T + 1];
            }, a.prototype.readUint32LE = a.prototype.readUInt32LE = function(T, P) {
                return T = T >>> 0, P || B(T, 4, this.length), (this[T] | this[T + 1] << 8 | this[T + 2] << 16) + this[T + 3] * 16777216;
            }, a.prototype.readUint32BE = a.prototype.readUInt32BE = function(T, P) {
                return T = T >>> 0, P || B(T, 4, this.length), this[T] * 16777216 + (this[T + 1] << 16 | this[T + 2] << 8 | this[T + 3]);
            }, a.prototype.readBigUInt64LE = ue(function(T) {
                T = T >>> 0, Ae(T, "offset");
                const P = this[T], Z = this[T + 7];
                (P === void 0 || Z === void 0) && Oe(T, this.length - 8);
                const ie = P + this[++T] * 2 ** 8 + this[++T] * 2 ** 16 + this[++T] * 2 ** 24, ce = this[++T] + this[++T] * 2 ** 8 + this[++T] * 2 ** 16 + Z * 2 ** 24;
                return BigInt(ie) + (BigInt(ce) << BigInt(32));
            }), a.prototype.readBigUInt64BE = ue(function(T) {
                T = T >>> 0, Ae(T, "offset");
                const P = this[T], Z = this[T + 7];
                (P === void 0 || Z === void 0) && Oe(T, this.length - 8);
                const ie = P * 2 ** 24 + this[++T] * 2 ** 16 + this[++T] * 2 ** 8 + this[++T], ce = this[++T] * 2 ** 24 + this[++T] * 2 ** 16 + this[++T] * 2 ** 8 + Z;
                return (BigInt(ie) << BigInt(32)) + BigInt(ce);
            }), a.prototype.readIntLE = function(T, P, Z) {
                T = T >>> 0, P = P >>> 0, Z || B(T, P, this.length);
                let ie = this[T], ce = 1, be = 0;
                for(; ++be < P && (ce *= 256);)ie += this[T + be] * ce;
                return ce *= 128, ie >= ce && (ie -= Math.pow(2, 8 * P)), ie;
            }, a.prototype.readIntBE = function(T, P, Z) {
                T = T >>> 0, P = P >>> 0, Z || B(T, P, this.length);
                let ie = P, ce = 1, be = this[T + --ie];
                for(; ie > 0 && (ce *= 256);)be += this[T + --ie] * ce;
                return ce *= 128, be >= ce && (be -= Math.pow(2, 8 * P)), be;
            }, a.prototype.readInt8 = function(T, P) {
                return T = T >>> 0, P || B(T, 1, this.length), this[T] & 128 ? (255 - this[T] + 1) * -1 : this[T];
            }, a.prototype.readInt16LE = function(T, P) {
                T = T >>> 0, P || B(T, 2, this.length);
                const Z = this[T] | this[T + 1] << 8;
                return Z & 32768 ? Z | 4294901760 : Z;
            }, a.prototype.readInt16BE = function(T, P) {
                T = T >>> 0, P || B(T, 2, this.length);
                const Z = this[T + 1] | this[T] << 8;
                return Z & 32768 ? Z | 4294901760 : Z;
            }, a.prototype.readInt32LE = function(T, P) {
                return T = T >>> 0, P || B(T, 4, this.length), this[T] | this[T + 1] << 8 | this[T + 2] << 16 | this[T + 3] << 24;
            }, a.prototype.readInt32BE = function(T, P) {
                return T = T >>> 0, P || B(T, 4, this.length), this[T] << 24 | this[T + 1] << 16 | this[T + 2] << 8 | this[T + 3];
            }, a.prototype.readBigInt64LE = ue(function(T) {
                T = T >>> 0, Ae(T, "offset");
                const P = this[T], Z = this[T + 7];
                (P === void 0 || Z === void 0) && Oe(T, this.length - 8);
                const ie = this[T + 4] + this[T + 5] * 2 ** 8 + this[T + 6] * 2 ** 16 + (Z << 24);
                return (BigInt(ie) << BigInt(32)) + BigInt(P + this[++T] * 2 ** 8 + this[++T] * 2 ** 16 + this[++T] * 2 ** 24);
            }), a.prototype.readBigInt64BE = ue(function(T) {
                T = T >>> 0, Ae(T, "offset");
                const P = this[T], Z = this[T + 7];
                (P === void 0 || Z === void 0) && Oe(T, this.length - 8);
                const ie = (P << 24) + this[++T] * 2 ** 16 + this[++T] * 2 ** 8 + this[++T];
                return (BigInt(ie) << BigInt(32)) + BigInt(this[++T] * 2 ** 24 + this[++T] * 2 ** 16 + this[++T] * 2 ** 8 + Z);
            }), a.prototype.readFloatLE = function(T, P) {
                return T = T >>> 0, P || B(T, 4, this.length), n.read(this, T, !0, 23, 4);
            }, a.prototype.readFloatBE = function(T, P) {
                return T = T >>> 0, P || B(T, 4, this.length), n.read(this, T, !1, 23, 4);
            }, a.prototype.readDoubleLE = function(T, P) {
                return T = T >>> 0, P || B(T, 8, this.length), n.read(this, T, !0, 52, 8);
            }, a.prototype.readDoubleBE = function(T, P) {
                return T = T >>> 0, P || B(T, 8, this.length), n.read(this, T, !1, 52, 8);
            };
            function S(H, T, P, Z, ie, ce) {
                if (!a.isBuffer(H)) throw new TypeError('"buffer" argument must be a Buffer instance');
                if (T > ie || T < ce) throw new RangeError('"value" argument is out of bounds');
                if (P + Z > H.length) throw new RangeError("Index out of range");
            }
            a.prototype.writeUintLE = a.prototype.writeUIntLE = function(T, P, Z, ie) {
                if (T = +T, P = P >>> 0, Z = Z >>> 0, !ie) {
                    const yt = Math.pow(2, 8 * Z) - 1;
                    S(this, T, P, Z, yt, 0);
                }
                let ce = 1, be = 0;
                for(this[P] = T & 255; ++be < Z && (ce *= 256);)this[P + be] = T / ce & 255;
                return P + Z;
            }, a.prototype.writeUintBE = a.prototype.writeUIntBE = function(T, P, Z, ie) {
                if (T = +T, P = P >>> 0, Z = Z >>> 0, !ie) {
                    const yt = Math.pow(2, 8 * Z) - 1;
                    S(this, T, P, Z, yt, 0);
                }
                let ce = Z - 1, be = 1;
                for(this[P + ce] = T & 255; --ce >= 0 && (be *= 256);)this[P + ce] = T / be & 255;
                return P + Z;
            }, a.prototype.writeUint8 = a.prototype.writeUInt8 = function(T, P, Z) {
                return T = +T, P = P >>> 0, Z || S(this, T, P, 1, 255, 0), this[P] = T & 255, P + 1;
            }, a.prototype.writeUint16LE = a.prototype.writeUInt16LE = function(T, P, Z) {
                return T = +T, P = P >>> 0, Z || S(this, T, P, 2, 65535, 0), this[P] = T & 255, this[P + 1] = T >>> 8, P + 2;
            }, a.prototype.writeUint16BE = a.prototype.writeUInt16BE = function(T, P, Z) {
                return T = +T, P = P >>> 0, Z || S(this, T, P, 2, 65535, 0), this[P] = T >>> 8, this[P + 1] = T & 255, P + 2;
            }, a.prototype.writeUint32LE = a.prototype.writeUInt32LE = function(T, P, Z) {
                return T = +T, P = P >>> 0, Z || S(this, T, P, 4, 4294967295, 0), this[P + 3] = T >>> 24, this[P + 2] = T >>> 16, this[P + 1] = T >>> 8, this[P] = T & 255, P + 4;
            }, a.prototype.writeUint32BE = a.prototype.writeUInt32BE = function(T, P, Z) {
                return T = +T, P = P >>> 0, Z || S(this, T, P, 4, 4294967295, 0), this[P] = T >>> 24, this[P + 1] = T >>> 16, this[P + 2] = T >>> 8, this[P + 3] = T & 255, P + 4;
            };
            function O(H, T, P, Z, ie) {
                pe(T, Z, ie, H, P, 7);
                let ce = Number(T & BigInt(4294967295));
                H[P++] = ce, ce = ce >> 8, H[P++] = ce, ce = ce >> 8, H[P++] = ce, ce = ce >> 8, H[P++] = ce;
                let be = Number(T >> BigInt(32) & BigInt(4294967295));
                return H[P++] = be, be = be >> 8, H[P++] = be, be = be >> 8, H[P++] = be, be = be >> 8, H[P++] = be, P;
            }
            function W(H, T, P, Z, ie) {
                pe(T, Z, ie, H, P, 7);
                let ce = Number(T & BigInt(4294967295));
                H[P + 7] = ce, ce = ce >> 8, H[P + 6] = ce, ce = ce >> 8, H[P + 5] = ce, ce = ce >> 8, H[P + 4] = ce;
                let be = Number(T >> BigInt(32) & BigInt(4294967295));
                return H[P + 3] = be, be = be >> 8, H[P + 2] = be, be = be >> 8, H[P + 1] = be, be = be >> 8, H[P] = be, P + 8;
            }
            a.prototype.writeBigUInt64LE = ue(function(T, P = 0) {
                return O(this, T, P, BigInt(0), BigInt("0xffffffffffffffff"));
            }), a.prototype.writeBigUInt64BE = ue(function(T, P = 0) {
                return W(this, T, P, BigInt(0), BigInt("0xffffffffffffffff"));
            }), a.prototype.writeIntLE = function(T, P, Z, ie) {
                if (T = +T, P = P >>> 0, !ie) {
                    const Et = Math.pow(2, 8 * Z - 1);
                    S(this, T, P, Z, Et - 1, -Et);
                }
                let ce = 0, be = 1, yt = 0;
                for(this[P] = T & 255; ++ce < Z && (be *= 256);)T < 0 && yt === 0 && this[P + ce - 1] !== 0 && (yt = 1), this[P + ce] = (T / be >> 0) - yt & 255;
                return P + Z;
            }, a.prototype.writeIntBE = function(T, P, Z, ie) {
                if (T = +T, P = P >>> 0, !ie) {
                    const Et = Math.pow(2, 8 * Z - 1);
                    S(this, T, P, Z, Et - 1, -Et);
                }
                let ce = Z - 1, be = 1, yt = 0;
                for(this[P + ce] = T & 255; --ce >= 0 && (be *= 256);)T < 0 && yt === 0 && this[P + ce + 1] !== 0 && (yt = 1), this[P + ce] = (T / be >> 0) - yt & 255;
                return P + Z;
            }, a.prototype.writeInt8 = function(T, P, Z) {
                return T = +T, P = P >>> 0, Z || S(this, T, P, 1, 127, -128), T < 0 && (T = 255 + T + 1), this[P] = T & 255, P + 1;
            }, a.prototype.writeInt16LE = function(T, P, Z) {
                return T = +T, P = P >>> 0, Z || S(this, T, P, 2, 32767, -32768), this[P] = T & 255, this[P + 1] = T >>> 8, P + 2;
            }, a.prototype.writeInt16BE = function(T, P, Z) {
                return T = +T, P = P >>> 0, Z || S(this, T, P, 2, 32767, -32768), this[P] = T >>> 8, this[P + 1] = T & 255, P + 2;
            }, a.prototype.writeInt32LE = function(T, P, Z) {
                return T = +T, P = P >>> 0, Z || S(this, T, P, 4, 2147483647, -2147483648), this[P] = T & 255, this[P + 1] = T >>> 8, this[P + 2] = T >>> 16, this[P + 3] = T >>> 24, P + 4;
            }, a.prototype.writeInt32BE = function(T, P, Z) {
                return T = +T, P = P >>> 0, Z || S(this, T, P, 4, 2147483647, -2147483648), T < 0 && (T = 4294967295 + T + 1), this[P] = T >>> 24, this[P + 1] = T >>> 16, this[P + 2] = T >>> 8, this[P + 3] = T & 255, P + 4;
            }, a.prototype.writeBigInt64LE = ue(function(T, P = 0) {
                return O(this, T, P, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
            }), a.prototype.writeBigInt64BE = ue(function(T, P = 0) {
                return W(this, T, P, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
            });
            function F(H, T, P, Z, ie, ce) {
                if (P + Z > H.length) throw new RangeError("Index out of range");
                if (P < 0) throw new RangeError("Index out of range");
            }
            function G(H, T, P, Z, ie) {
                return T = +T, P = P >>> 0, ie || F(H, T, P, 4), n.write(H, T, P, Z, 23, 4), P + 4;
            }
            a.prototype.writeFloatLE = function(T, P, Z) {
                return G(this, T, P, !0, Z);
            }, a.prototype.writeFloatBE = function(T, P, Z) {
                return G(this, T, P, !1, Z);
            };
            function ee(H, T, P, Z, ie) {
                return T = +T, P = P >>> 0, ie || F(H, T, P, 8), n.write(H, T, P, Z, 52, 8), P + 8;
            }
            a.prototype.writeDoubleLE = function(T, P, Z) {
                return ee(this, T, P, !0, Z);
            }, a.prototype.writeDoubleBE = function(T, P, Z) {
                return ee(this, T, P, !1, Z);
            }, a.prototype.copy = function(T, P, Z, ie) {
                if (!a.isBuffer(T)) throw new TypeError("argument should be a Buffer");
                if (Z || (Z = 0), !ie && ie !== 0 && (ie = this.length), P >= T.length && (P = T.length), P || (P = 0), ie > 0 && ie < Z && (ie = Z), ie === Z || T.length === 0 || this.length === 0) return 0;
                if (P < 0) throw new RangeError("targetStart out of bounds");
                if (Z < 0 || Z >= this.length) throw new RangeError("Index out of range");
                if (ie < 0) throw new RangeError("sourceEnd out of bounds");
                ie > this.length && (ie = this.length), T.length - P < ie - Z && (ie = T.length - P + Z);
                const ce = ie - Z;
                return this === T && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(P, Z, ie) : Uint8Array.prototype.set.call(T, this.subarray(Z, ie), P), ce;
            }, a.prototype.fill = function(T, P, Z, ie) {
                if (typeof T == "string") {
                    if (typeof P == "string" ? (ie = P, P = 0, Z = this.length) : typeof Z == "string" && (ie = Z, Z = this.length), ie !== void 0 && typeof ie != "string") throw new TypeError("encoding must be a string");
                    if (typeof ie == "string" && !a.isEncoding(ie)) throw new TypeError("Unknown encoding: " + ie);
                    if (T.length === 1) {
                        const be = T.charCodeAt(0);
                        (ie === "utf8" && be < 128 || ie === "latin1") && (T = be);
                    }
                } else typeof T == "number" ? T = T & 255 : typeof T == "boolean" && (T = Number(T));
                if (P < 0 || this.length < P || this.length < Z) throw new RangeError("Out of range index");
                if (Z <= P) return this;
                P = P >>> 0, Z = Z === void 0 ? this.length : Z >>> 0, T || (T = 0);
                let ce;
                if (typeof T == "number") for(ce = P; ce < Z; ++ce)this[ce] = T;
                else {
                    const be = a.isBuffer(T) ? T : a.from(T, ie), yt = be.length;
                    if (yt === 0) throw new TypeError('The value "' + T + '" is invalid for argument "value"');
                    for(ce = 0; ce < Z - P; ++ce)this[ce + P] = be[ce % yt];
                }
                return this;
            };
            const Q = {};
            function Y(H, T, P) {
                Q[H] = class extends P {
                    constructor(){
                        super(), Object.defineProperty(this, "message", {
                            value: T.apply(this, arguments),
                            writable: !0,
                            configurable: !0
                        }), this.name = `${this.name} [${H}]`, this.stack, delete this.name;
                    }
                    get code() {
                        return H;
                    }
                    set code(ie) {
                        Object.defineProperty(this, "code", {
                            configurable: !0,
                            enumerable: !0,
                            value: ie,
                            writable: !0
                        });
                    }
                    toString() {
                        return `${this.name} [${H}]: ${this.message}`;
                    }
                };
            }
            Y("ERR_BUFFER_OUT_OF_BOUNDS", function(H) {
                return H ? `${H} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
            }, RangeError), Y("ERR_INVALID_ARG_TYPE", function(H, T) {
                return `The "${H}" argument must be of type number. Received type ${typeof T}`;
            }, TypeError), Y("ERR_OUT_OF_RANGE", function(H, T, P) {
                let Z = `The value of "${H}" is out of range.`, ie = P;
                return Number.isInteger(P) && Math.abs(P) > 2 ** 32 ? ie = ae(String(P)) : typeof P == "bigint" && (ie = String(P), (P > BigInt(2) ** BigInt(32) || P < -(BigInt(2) ** BigInt(32))) && (ie = ae(ie)), ie += "n"), Z += ` It must be ${T}. Received ${ie}`, Z;
            }, RangeError);
            function ae(H) {
                let T = "", P = H.length;
                const Z = H[0] === "-" ? 1 : 0;
                for(; P >= Z + 4; P -= 3)T = `_${H.slice(P - 3, P)}${T}`;
                return `${H.slice(0, P)}${T}`;
            }
            function de(H, T, P) {
                Ae(T, "offset"), (H[T] === void 0 || H[T + P] === void 0) && Oe(T, H.length - (P + 1));
            }
            function pe(H, T, P, Z, ie, ce) {
                if (H > P || H < T) {
                    const be = typeof T == "bigint" ? "n" : "";
                    let yt;
                    throw T === 0 || T === BigInt(0) ? yt = `>= 0${be} and < 2${be} ** ${(ce + 1) * 8}${be}` : yt = `>= -(2${be} ** ${(ce + 1) * 8 - 1}${be}) and < 2 ** ${(ce + 1) * 8 - 1}${be}`, new Q.ERR_OUT_OF_RANGE("value", yt, H);
                }
                de(Z, ie, ce);
            }
            function Ae(H, T) {
                if (typeof H != "number") throw new Q.ERR_INVALID_ARG_TYPE(T, "number", H);
            }
            function Oe(H, T, P) {
                throw Math.floor(H) !== H ? (Ae(H, P), new Q.ERR_OUT_OF_RANGE("offset", "an integer", H)) : T < 0 ? new Q.ERR_BUFFER_OUT_OF_BOUNDS : new Q.ERR_OUT_OF_RANGE("offset", `>= 0 and <= ${T}`, H);
            }
            const Re = /[^+/0-9A-Za-z-_]/g;
            function Me(H) {
                if (H = H.split("=")[0], H = H.trim().replace(Re, ""), H.length < 2) return "";
                for(; H.length % 4 !== 0;)H = H + "=";
                return H;
            }
            function Je(H, T) {
                T = T || 1 / 0;
                let P;
                const Z = H.length;
                let ie = null;
                const ce = [];
                for(let be = 0; be < Z; ++be){
                    if (P = H.charCodeAt(be), P > 55295 && P < 57344) {
                        if (!ie) {
                            if (P > 56319) {
                                (T -= 3) > -1 && ce.push(239, 191, 189);
                                continue;
                            } else if (be + 1 === Z) {
                                (T -= 3) > -1 && ce.push(239, 191, 189);
                                continue;
                            }
                            ie = P;
                            continue;
                        }
                        if (P < 56320) {
                            (T -= 3) > -1 && ce.push(239, 191, 189), ie = P;
                            continue;
                        }
                        P = (ie - 55296 << 10 | P - 56320) + 65536;
                    } else ie && (T -= 3) > -1 && ce.push(239, 191, 189);
                    if (ie = null, P < 128) {
                        if ((T -= 1) < 0) break;
                        ce.push(P);
                    } else if (P < 2048) {
                        if ((T -= 2) < 0) break;
                        ce.push(P >> 6 | 192, P & 63 | 128);
                    } else if (P < 65536) {
                        if ((T -= 3) < 0) break;
                        ce.push(P >> 12 | 224, P >> 6 & 63 | 128, P & 63 | 128);
                    } else if (P < 1114112) {
                        if ((T -= 4) < 0) break;
                        ce.push(P >> 18 | 240, P >> 12 & 63 | 128, P >> 6 & 63 | 128, P & 63 | 128);
                    } else throw new Error("Invalid code point");
                }
                return ce;
            }
            function Ee(H) {
                const T = [];
                for(let P = 0; P < H.length; ++P)T.push(H.charCodeAt(P) & 255);
                return T;
            }
            function le(H, T) {
                let P, Z, ie;
                const ce = [];
                for(let be = 0; be < H.length && !((T -= 2) < 0); ++be)P = H.charCodeAt(be), Z = P >> 8, ie = P % 256, ce.push(ie), ce.push(Z);
                return ce;
            }
            function qe(H) {
                return e.toByteArray(Me(H));
            }
            function Ye(H, T, P, Z) {
                let ie;
                for(ie = 0; ie < Z && !(ie + P >= T.length || ie >= H.length); ++ie)T[ie + P] = H[ie];
                return ie;
            }
            function ut(H, T) {
                return H instanceof T || H != null && H.constructor != null && H.constructor.name != null && H.constructor.name === T.name;
            }
            function Ce(H) {
                return H !== H;
            }
            const oe = (function() {
                const H = "0123456789abcdef", T = new Array(256);
                for(let P = 0; P < 16; ++P){
                    const Z = P * 16;
                    for(let ie = 0; ie < 16; ++ie)T[Z + ie] = H[P] + H[ie];
                }
                return T;
            })();
            function ue(H) {
                return typeof BigInt > "u" ? Ie : H;
            }
            function Ie() {
                throw new Error("BigInt not supported");
            }
        })(A9)), A9;
    }
    lxt = yH();
    let Lre;
    Lre = globalThis.browser?.runtime?.id ? globalThis.browser : globalThis.chrome;
    yo = Lre;
    function hE(t) {
        return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
    }
    function _h(t, e = "") {
        if (!Number.isSafeInteger(t) || t < 0) {
            const n = e && `"${e}" `;
            throw new Error(`${n}expected integer >= 0, got ${t}`);
        }
    }
    function er(t, e, n = "") {
        const r = hE(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 wH(t) {
        if (typeof t != "function" || typeof t.create != "function") throw new Error("Hash must wrapped by utils.createHasher");
        _h(t.outputLen), _h(t.blockLen);
    }
    function S2(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 zre(t, e) {
        er(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 xd(...t) {
        for(let e = 0; e < t.length; e++)t[e].fill(0);
    }
    function n0(t) {
        return new DataView(t.buffer, t.byteOffset, t.byteLength);
    }
    function tc(t, e) {
        return t << 32 - e | t >>> e;
    }
    function Vw(t, e) {
        return t << e | t >>> 32 - e >>> 0;
    }
    const _H = typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", Ure = Array.from({
        length: 256
    }, (t, e)=>e.toString(16).padStart(2, "0"));
    function Sv(t) {
        if (er(t), _H) return t.toHex();
        let e = "";
        for(let n = 0; n < t.length; n++)e += Ure[t[n]];
        return e;
    }
    const nl = {
        _0: 48,
        _9: 57,
        A: 65,
        F: 70,
        a: 97,
        f: 102
    };
    function ZM(t) {
        if (t >= nl._0 && t <= nl._9) return t - nl._0;
        if (t >= nl.A && t <= nl.F) return t - (nl.A - 10);
        if (t >= nl.a && t <= nl.f) return t - (nl.a - 10);
    }
    function k2(t) {
        if (typeof t != "string") throw new Error("hex string expected, got " + typeof t);
        if (_H) 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 = ZM(t.charCodeAt(i)), a = ZM(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 Zo(...t) {
        let e = 0;
        for(let r = 0; r < t.length; r++){
            const s = t[r];
            er(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 pE(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 xH(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 vH = (t)=>({
            oid: Uint8Array.from([
                6,
                9,
                96,
                134,
                72,
                1,
                101,
                3,
                4,
                2,
                t
            ])
        });
    function Hre(t, e, n) {
        return t & e ^ ~t & n;
    }
    function jre(t, e, n) {
        return t & e ^ t & n ^ e & n;
    }
    let gE = 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 = n0(this.buffer);
        }
        update(e) {
            S2(this), er(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 = n0(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) {
            S2(this), zre(e, this), this.finished = !0;
            const { buffer: n, view: r, blockLen: s, isLE: i } = this;
            let { pos: o } = this;
            n[o++] = 128, xd(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 = n0(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 Iu = 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
    ]), Bw = BigInt(2 ** 32 - 1), JM = BigInt(32);
    function qre(t, e = !1) {
        return e ? {
            h: Number(t & Bw),
            l: Number(t >> JM & Bw)
        } : {
            h: Number(t >> JM & Bw) | 0,
            l: Number(t & Bw) | 0
        };
    }
    function Kre(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 } = qre(t[i], e);
            [r[i], s[i]] = [
                o,
                a
            ];
        }
        return [
            r,
            s
        ];
    }
    const YM = (t, e, n)=>t >>> n, QM = (t, e, n)=>t << 32 - n | e >>> n, Cp = (t, e, n)=>t >>> n | e << 32 - n, Ip = (t, e, n)=>t << 32 - n | e >>> n, Dw = (t, e, n)=>t << 64 - n | e >>> n - 32, Fw = (t, e, n)=>t >>> n - 32 | e << 64 - n;
    function rl(t, e, n, r) {
        const s = (e >>> 0) + (r >>> 0);
        return {
            h: t + n + (s / 2 ** 32 | 0) | 0,
            l: s | 0
        };
    }
    const Wre = (t, e, n)=>(t >>> 0) + (e >>> 0) + (n >>> 0), $re = (t, e, n, r)=>e + n + r + (t / 2 ** 32 | 0) | 0, Xre = (t, e, n, r)=>(t >>> 0) + (e >>> 0) + (n >>> 0) + (r >>> 0), Gre = (t, e, n, r, s)=>e + n + r + s + (t / 2 ** 32 | 0) | 0, Zre = (t, e, n, r, s)=>(t >>> 0) + (e >>> 0) + (n >>> 0) + (r >>> 0) + (s >>> 0), Jre = (t, e, n, r, s, i)=>e + n + r + s + i + (t / 2 ** 32 | 0) | 0, Yre = 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
    ]), Au = new Uint32Array(64);
    let Qre = class extends gE {
        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)Au[d] = e.getUint32(n, !1);
            for(let d = 16; d < 64; d++){
                const f = Au[d - 15], p = Au[d - 2], h = tc(f, 7) ^ tc(f, 18) ^ f >>> 3, b = tc(p, 17) ^ tc(p, 19) ^ p >>> 10;
                Au[d] = b + Au[d - 7] + h + Au[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 = tc(a, 6) ^ tc(a, 11) ^ tc(a, 25), p = u + f + Hre(a, c, l) + Yre[d] + Au[d] | 0, b = (tc(r, 2) ^ tc(r, 13) ^ tc(r, 22)) + jre(r, s, i) | 0;
                u = l, l = c, c = a, a = o + p | 0, o = i, i = s, s = r, r = p + b | 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() {
            xd(Au);
        }
        destroy() {
            this.set(0, 0, 0, 0, 0, 0, 0, 0), xd(this.buffer);
        }
    }, ese = class extends Qre {
        A = Iu[0] | 0;
        B = Iu[1] | 0;
        C = Iu[2] | 0;
        D = Iu[3] | 0;
        E = Iu[4] | 0;
        F = Iu[5] | 0;
        G = Iu[6] | 0;
        H = Iu[7] | 0;
        constructor(){
            super(32);
        }
    };
    const SH = Kre([
        "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))), tse = SH[0], nse = SH[1], Pu = new Uint32Array(80), Ou = new Uint32Array(80);
    class rse extends gE {
        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: b, Hl: y } = this;
            return [
                e,
                n,
                r,
                s,
                i,
                o,
                a,
                c,
                l,
                u,
                d,
                f,
                p,
                h,
                b,
                y
            ];
        }
        set(e, n, r, s, i, o, a, c, l, u, d, f, p, h, b, y) {
            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 = b | 0, this.Hl = y | 0;
        }
        process(e, n) {
            for(let w = 0; w < 16; w++, n += 4)Pu[w] = e.getUint32(n), Ou[w] = e.getUint32(n += 4);
            for(let w = 16; w < 80; w++){
                const E = Pu[w - 15] | 0, I = Ou[w - 15] | 0, D = Cp(E, I, 1) ^ Cp(E, I, 8) ^ YM(E, I, 7), U = Ip(E, I, 1) ^ Ip(E, I, 8) ^ QM(E, I, 7), K = Pu[w - 2] | 0, $ = Ou[w - 2] | 0, ne = Cp(K, $, 19) ^ Dw(K, $, 61) ^ YM(K, $, 6), te = Ip(K, $, 19) ^ Fw(K, $, 61) ^ QM(K, $, 6), J = Xre(U, te, Ou[w - 7], Ou[w - 16]), C = Gre(J, D, ne, Pu[w - 7], Pu[w - 16]);
                Pu[w] = C | 0, Ou[w] = J | 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: b, Gl: y, Hh: _, Hl: v } = this;
            for(let w = 0; w < 80; w++){
                const E = Cp(d, f, 14) ^ Cp(d, f, 18) ^ Dw(d, f, 41), I = Ip(d, f, 14) ^ Ip(d, f, 18) ^ Fw(d, f, 41), D = d & p ^ ~d & b, U = f & h ^ ~f & y, K = Zre(v, I, U, nse[w], Ou[w]), $ = Jre(K, _, E, D, tse[w], Pu[w]), ne = K | 0, te = Cp(r, s, 28) ^ Dw(r, s, 34) ^ Dw(r, s, 39), J = Ip(r, s, 28) ^ Fw(r, s, 34) ^ Fw(r, s, 39), C = r & i ^ r & a ^ i & a, g = s & o ^ s & c ^ o & c;
                _ = b | 0, v = y | 0, b = p | 0, y = h | 0, p = d | 0, h = f | 0, { h: d, l: f } = rl(l | 0, u | 0, $ | 0, ne | 0), l = a | 0, u = c | 0, a = i | 0, c = o | 0, i = r | 0, o = s | 0;
                const x = Wre(ne, J, g);
                r = $re(x, $, te, C), s = x | 0;
            }
            ({ h: r, l: s } = rl(this.Ah | 0, this.Al | 0, r | 0, s | 0)), { h: i, l: o } = rl(this.Bh | 0, this.Bl | 0, i | 0, o | 0), { h: a, l: c } = rl(this.Ch | 0, this.Cl | 0, a | 0, c | 0), { h: l, l: u } = rl(this.Dh | 0, this.Dl | 0, l | 0, u | 0), { h: d, l: f } = rl(this.Eh | 0, this.El | 0, d | 0, f | 0), { h: p, l: h } = rl(this.Fh | 0, this.Fl | 0, p | 0, h | 0), { h: b, l: y } = rl(this.Gh | 0, this.Gl | 0, b | 0, y | 0), { h: _, l: v } = rl(this.Hh | 0, this.Hl | 0, _ | 0, v | 0), this.set(r, s, i, o, a, c, l, u, d, f, p, h, b, y, _, v);
        }
        roundClean() {
            xd(Pu, Ou);
        }
        destroy() {
            xd(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        }
    }
    class sse extends rse {
        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 bE = pE(()=>new ese, vH(1)), eR = pE(()=>new sse, vH(3));
    const mE = BigInt(0), _6 = BigInt(1);
    function T2(t, e = "") {
        if (typeof t != "boolean") {
            const n = e && `"${e}" `;
            throw new Error(n + "expected boolean, got type=" + typeof t);
        }
        return t;
    }
    function kH(t) {
        if (typeof t == "bigint") {
            if (!R_(t)) throw new Error("positive bigint expected, got " + t);
        } else _h(t);
        return t;
    }
    function Lw(t) {
        const e = kH(t).toString(16);
        return e.length & 1 ? "0" + e : e;
    }
    function TH(t) {
        if (typeof t != "string") throw new Error("hex string expected, got " + typeof t);
        return t === "" ? mE : BigInt("0x" + t);
    }
    function kv(t) {
        return TH(Sv(t));
    }
    function EH(t) {
        return TH(Sv(ise(er(t)).reverse()));
    }
    function yE(t, e) {
        _h(e), t = kH(t);
        const n = k2(t.toString(16).padStart(e * 2, "0"));
        if (n.length !== e) throw new Error("number too large");
        return n;
    }
    function CH(t, e) {
        return yE(t, e).reverse();
    }
    function ise(t) {
        return Uint8Array.from(t);
    }
    const R_ = (t)=>typeof t == "bigint" && mE <= t;
    function ose(t, e, n) {
        return R_(t) && R_(e) && R_(n) && e <= t && t < n;
    }
    function ase(t, e, n, r) {
        if (!ose(e, n, r)) throw new Error("expected valid " + t + ": " + n + " <= n < " + r + ", got " + e);
    }
    function cse(t) {
        let e;
        for(e = 0; t > mE; t >>= _6, e += 1);
        return e;
    }
    const wE = (t)=>(_6 << BigInt(t)) - _6;
    function lse(t, e, n) {
        if (_h(t, "hashLen"), _h(e, "qByteLen"), typeof n != "function") throw new Error("hmacFn must be a function");
        const r = (y)=>new Uint8Array(y), 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 = (...y)=>n(l, Zo(c, ...y)), p = (y = s)=>{
            l = f(i, y), c = f(), y.length !== 0 && (l = f(o, y), c = f());
        }, h = ()=>{
            if (u++ >= a) throw new Error("drbg: tried max amount of iterations");
            let y = 0;
            const _ = [];
            for(; y < e;){
                c = f();
                const v = c.slice();
                _.push(v), y += c.length;
            }
            return Zo(..._);
        };
        return (y, _)=>{
            d(), p(y);
            let v;
            for(; !(v = _(h()));)p();
            return d(), v;
        };
    }
    function _E(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 tR(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 ji = BigInt(0), xi = BigInt(1), Ff = BigInt(2), IH = BigInt(3), AH = BigInt(4), PH = BigInt(5), use = BigInt(7), OH = BigInt(8), dse = BigInt(9), MH = BigInt(16);
    function Ta(t, e) {
        const n = t % e;
        return n >= ji ? n : e + n;
    }
    function No(t, e, n) {
        let r = t;
        for(; e-- > ji;)r *= r, r %= n;
        return r;
    }
    function nR(t, e) {
        if (t === ji) throw new Error("invert: expected non-zero number");
        if (e <= ji) throw new Error("invert: expected positive modulus, got " + e);
        let n = Ta(t, e), r = e, s = ji, i = xi;
        for(; n !== ji;){
            const a = r / n, c = r % n, l = s - i * a;
            r = n, n = c, s = i, i = l;
        }
        if (r !== xi) throw new Error("invert: does not exist");
        return Ta(s, e);
    }
    function xE(t, e, n) {
        if (!t.eql(t.sqr(e), n)) throw new Error("Cannot find square root");
    }
    function RH(t, e) {
        const n = (t.ORDER + xi) / AH, r = t.pow(e, n);
        return xE(t, r, e), r;
    }
    function fse(t, e) {
        const n = (t.ORDER - PH) / OH, r = t.mul(e, Ff), s = t.pow(r, n), i = t.mul(e, s), o = t.mul(t.mul(i, Ff), s), a = t.mul(i, t.sub(o, t.ONE));
        return xE(t, a, e), a;
    }
    function hse(t) {
        const e = Tv(t), n = NH(t), r = n(e, e.neg(e.ONE)), s = n(e, r), i = n(e, e.neg(r)), o = (t + use) / MH;
        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 b = a.eql(a.sqr(u), c), y = a.cmov(l, u, b);
            return xE(a, y, c), y;
        };
    }
    function NH(t) {
        if (t < IH) throw new Error("sqrt is not defined for small field");
        let e = t - xi, n = 0;
        for(; e % Ff === ji;)e /= Ff, n++;
        let r = Ff;
        const s = Tv(t);
        for(; rR(s, r) === 1;)if (r++ > 1e3) throw new Error("Cannot find square root: probably non-prime P");
        if (n === 1) return RH;
        let i = s.pow(r, e);
        const o = (e + xi) / Ff;
        return function(c, l) {
            if (c.is0(l)) return l;
            if (rR(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, b = c.sqr(f);
                for(; !c.eql(b, c.ONE);)if (h++, b = c.sqr(b), h === u) throw new Error("Cannot find square root");
                const y = xi << BigInt(u - h - 1), _ = c.pow(d, y);
                u = h, d = c.sqr(_), f = c.mul(f, d), p = c.mul(p, _);
            }
            return p;
        };
    }
    function pse(t) {
        return t % AH === IH ? RH : t % OH === PH ? fse : t % MH === dse ? hse(t) : NH(t);
    }
    const gse = [
        "create",
        "isValid",
        "is0",
        "neg",
        "inv",
        "sqrt",
        "sqr",
        "eql",
        "add",
        "sub",
        "mul",
        "pow",
        "div",
        "addN",
        "subN",
        "mulN",
        "sqrN"
    ];
    function bse(t) {
        const e = {
            ORDER: "bigint",
            BYTES: "number",
            BITS: "number"
        }, n = gse.reduce((r, s)=>(r[s] = "function", r), e);
        return _E(t, n), t;
    }
    function mse(t, e, n) {
        if (n < ji) throw new Error("invalid exponent, negatives unsupported");
        if (n === ji) return t.ONE;
        if (n === xi) return e;
        let r = t.ONE, s = e;
        for(; n > ji;)n & xi && (r = t.mul(r, s)), s = t.sqr(s), n >>= xi;
        return r;
    }
    function VH(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 rR(t, e) {
        const n = (t.ORDER - xi) / Ff, 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 yse(t, e) {
        e !== void 0 && _h(e);
        const n = e !== void 0 ? e : t.toString(2).length, r = Math.ceil(n / 8);
        return {
            nBitLength: n,
            nByteLength: r
        };
    }
    class wse {
        ORDER;
        BITS;
        BYTES;
        isLE;
        ZERO = ji;
        ONE = xi;
        _lengths;
        _sqrt;
        _mod;
        constructor(e, n = {}){
            if (e <= ji) 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 } = yse(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 Ta(e, this.ORDER);
        }
        isValid(e) {
            if (typeof e != "bigint") throw new Error("invalid field element: expected bigint, got " + typeof e);
            return ji <= e && e < this.ORDER;
        }
        is0(e) {
            return e === ji;
        }
        isValidNot0(e) {
            return !this.is0(e) && this.isValid(e);
        }
        isOdd(e) {
            return (e & xi) === xi;
        }
        neg(e) {
            return Ta(-e, this.ORDER);
        }
        eql(e, n) {
            return e === n;
        }
        sqr(e) {
            return Ta(e * e, this.ORDER);
        }
        add(e, n) {
            return Ta(e + n, this.ORDER);
        }
        sub(e, n) {
            return Ta(e - n, this.ORDER);
        }
        mul(e, n) {
            return Ta(e * n, this.ORDER);
        }
        pow(e, n) {
            return mse(this, e, n);
        }
        div(e, n) {
            return Ta(e * nR(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 nR(e, this.ORDER);
        }
        sqrt(e) {
            return this._sqrt || (this._sqrt = pse(this.ORDER)), this._sqrt(this, e);
        }
        toBytes(e) {
            return this.isLE ? CH(e, this.BYTES) : yE(e, this.BYTES);
        }
        fromBytes(e, n = !1) {
            er(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 ? EH(e) : kv(e);
            if (a && (c = Ta(c, o)), !n && !this.isValid(c)) throw new Error("invalid field element: outside of range 0..ORDER");
            return c;
        }
        invertBatch(e) {
            return VH(this, e);
        }
        cmov(e, n, r) {
            return r ? n : e;
        }
    }
    function Tv(t, e = {}) {
        return new wse(t, e);
    }
    function BH(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 DH(t) {
        const e = BH(t);
        return e + Math.ceil(e / 2);
    }
    function _se(t, e, n = !1) {
        er(t);
        const r = t.length, s = BH(e), i = DH(e);
        if (r < 16 || r < i || r > 1024) throw new Error("expected " + i + "-1024 bytes of input, got " + r);
        const o = n ? EH(t) : kv(t), a = Ta(o, e - xi) + xi;
        return n ? CH(a, s) : yE(a, s);
    }
    const y0 = BigInt(0), Lf = BigInt(1);
    function E2(t, e) {
        const n = e.negate();
        return t ? n : e;
    }
    function sR(t, e) {
        const n = VH(t.Fp, e.map((r)=>r.Z));
        return e.map((r, s)=>t.fromAffine(r.toAffine(n[s])));
    }
    function FH(t, e) {
        if (!Number.isSafeInteger(t) || t <= 0 || t > e) throw new Error("invalid window size, expected [1.." + e + "], got W=" + t);
    }
    function P9(t, e) {
        FH(t, e);
        const n = Math.ceil(e / t) + 1, r = 2 ** (t - 1), s = 2 ** t, i = wE(t), o = BigInt(t);
        return {
            windows: n,
            windowSize: r,
            mask: i,
            maxNumber: s,
            shiftBy: o
        };
    }
    function iR(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 += Lf);
        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 O9 = new WeakMap, LH = new WeakMap;
    function M9(t) {
        return LH.get(t) || 1;
    }
    function oR(t) {
        if (t !== y0) throw new Error("invalid wNAF");
    }
    let xse = class {
        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 > y0;)n & Lf && (r = r.add(s)), s = s.double(), n >>= Lf;
            return r;
        }
        precomputeWindow(e, n) {
            const { windows: r, windowSize: s } = P9(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 = P9(e, this.bits);
            for(let a = 0; a < o.windows; a++){
                const { nextN: c, offset: l, isZero: u, isNeg: d, isNegF: f, offsetF: p } = iR(r, a, o);
                r = c, u ? i = i.add(E2(f, n[p])) : s = s.add(E2(d, n[l]));
            }
            return oR(r), {
                p: s,
                f: i
            };
        }
        wNAFUnsafe(e, n, r, s = this.ZERO) {
            const i = P9(e, this.bits);
            for(let o = 0; o < i.windows && r !== y0; o++){
                const { nextN: a, offset: c, isZero: l, isNeg: u } = iR(r, o, i);
                if (r = a, !l) {
                    const d = n[c];
                    s = s.add(u ? d.negate() : d);
                }
            }
            return oR(r), s;
        }
        getPrecomputes(e, n, r) {
            let s = O9.get(n);
            return s || (s = this.precomputeWindow(n, e), e !== 1 && (typeof r == "function" && (s = r(s)), O9.set(n, s))), s;
        }
        cached(e, n, r) {
            const s = M9(e);
            return this.wNAF(s, this.getPrecomputes(s, e, r), n);
        }
        unsafe(e, n, r, s) {
            const i = M9(e);
            return i === 1 ? this._unsafeLadder(e, n, s) : this.wNAFUnsafe(i, this.getPrecomputes(i, e, r), n, s);
        }
        createCache(e, n) {
            FH(n, this.bits), LH.set(e, n), O9.delete(e);
        }
        hasCache(e) {
            return M9(e) !== 1;
        }
    };
    function vse(t, e, n, r) {
        let s = e, i = t.ZERO, o = t.ZERO;
        for(; n > y0 || r > y0;)n & Lf && (i = i.add(s)), r & Lf && (o = o.add(s)), s = s.double(), n >>= Lf, r >>= Lf;
        return {
            p1: i,
            p2: o
        };
    }
    function aR(t, e, n) {
        if (e) {
            if (e.ORDER !== t) throw new Error("Field.ORDER must match order: Fp == p, Fn == n");
            return bse(e), e;
        } else return Tv(t, {
            isLE: n
        });
    }
    function Sse(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 > y0)) throw new Error(`CURVE.${c} must be positive bigint`);
        }
        const s = aR(e.p, n.Fp, r), i = aR(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 kse(t, e) {
        return function(r) {
            const s = t(r);
            return {
                secretKey: s,
                publicKey: e(s)
            };
        };
    }
    class zH {
        oHash;
        iHash;
        blockLen;
        outputLen;
        finished = !1;
        destroyed = !1;
        constructor(e, n){
            if (wH(e), er(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), xd(s);
        }
        update(e) {
            return S2(this), this.iHash.update(e), this;
        }
        digestInto(e) {
            S2(this), er(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 C2 = (t, e, n)=>new zH(t, e).update(n).digest();
    C2.create = (t, e)=>new zH(t, e);
    const cR = (t, e)=>(t + (t >= 0 ? e : -e) / UH) / e;
    function Tse(t, e, n) {
        const [[r, s], [i, o]] = e, a = cR(o * t, n), c = cR(-s * t, n);
        let l = t - a * r - c * i, u = -a * s - c * o;
        const d = l < Cl, f = u < Cl;
        d && (l = -l), f && (u = -u);
        const p = wE(Math.ceil(cse(n) / 2)) + r0;
        if (l < Cl || l >= p || u < Cl || u >= p) throw new Error("splitScalar (endomorphism): failed, k=" + t);
        return {
            k1neg: d,
            k1: l,
            k2neg: f,
            k2: u
        };
    }
    function x6(t) {
        if (![
            "compact",
            "recovered",
            "der"
        ].includes(t)) throw new Error('Signature format must be "compact", "recovered", or "der"');
        return t;
    }
    function R9(t, e) {
        const n = {};
        for (let r of Object.keys(e))n[r] = t[r] === void 0 ? e[r] : t[r];
        return T2(n.lowS, "lowS"), T2(n.prehash, "prehash"), n.format !== void 0 && x6(n.format), n;
    }
    let Ese = class extends Error {
        constructor(e = ""){
            super(e);
        }
    };
    const Yu = {
        Err: Ese,
        _tlv: {
            encode: (t, e)=>{
                const { Err: n } = Yu;
                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 = Lw(r);
                if (s.length / 2 & 128) throw new n("tlv.encode: long form length too big");
                const i = r > 127 ? Lw(s.length / 2 | 128) : "";
                return Lw(t) + i + s + e;
            },
            decode (t, e) {
                const { Err: n } = Yu;
                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 } = Yu;
                if (t < Cl) throw new e("integer: negative integers are not allowed");
                let n = Lw(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 } = Yu;
                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 kv(t);
            }
        },
        toSig (t) {
            const { Err: e, _int: n, _tlv: r } = Yu, s = er(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 } = Yu, r = e.encode(2, n.encode(t.r)), s = e.encode(2, n.encode(t.s)), i = r + s;
            return e.encode(48, i);
        }
    }, Cl = BigInt(0), r0 = BigInt(1), UH = BigInt(2), zw = BigInt(3), Cse = BigInt(4);
    function Ise(t, e = {}) {
        const n = Sse("weierstrass", t, e), { Fp: r, Fn: s } = n;
        let i = n.CURVE;
        const { h: o, n: a } = i;
        _E(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 = jH(r, s);
        function u() {
            if (!r.isOdd) throw new Error("compression is not supported: Field does not have .isOdd()");
        }
        function d(J, C, g) {
            const { x, y: A } = C.toAffine(), R = r.toBytes(x);
            if (T2(g, "isCompressed"), g) {
                u();
                const N = !r.isOdd(A);
                return Zo(HH(N), R);
            } else return Zo(Uint8Array.of(4), R, r.toBytes(A));
        }
        function f(J) {
            er(J, void 0, "Point");
            const { publicKey: C, publicKeyUncompressed: g } = l, x = J.length, A = J[0], R = J.subarray(1);
            if (x === C && (A === 2 || A === 3)) {
                const N = r.fromBytes(R);
                if (!r.isValid(N)) throw new Error("bad point: is not on curve, wrong x");
                const L = b(N);
                let z;
                try {
                    z = r.sqrt(L);
                } catch (O) {
                    const W = O instanceof Error ? ": " + O.message : "";
                    throw new Error("bad point: is not on curve, sqrt error" + W);
                }
                u();
                const B = r.isOdd(z);
                return (A & 1) === 1 !== B && (z = r.neg(z)), {
                    x: N,
                    y: z
                };
            } else if (x === g && A === 4) {
                const N = r.BYTES, L = r.fromBytes(R.subarray(0, N)), z = r.fromBytes(R.subarray(N, N * 2));
                if (!y(L, z)) throw new Error("bad point: is not on curve");
                return {
                    x: L,
                    y: z
                };
            } else throw new Error(`bad point: got length ${x}, expected compressed=${C} or uncompressed=${g}`);
        }
        const p = e.toBytes || d, h = e.fromBytes || f;
        function b(J) {
            const C = r.sqr(J), g = r.mul(C, J);
            return r.add(r.add(g, r.mul(J, i.a)), i.b);
        }
        function y(J, C) {
            const g = r.sqr(C), x = b(J);
            return r.eql(g, x);
        }
        if (!y(i.Gx, i.Gy)) throw new Error("bad curve params: generator point");
        const _ = r.mul(r.pow(i.a, zw), Cse), v = r.mul(r.sqr(i.b), BigInt(27));
        if (r.is0(r.add(_, v))) throw new Error("bad curve params: a or b");
        function w(J, C, g = !1) {
            if (!r.isValid(C) || g && r.is0(C)) throw new Error(`bad point coordinate ${J}`);
            return C;
        }
        function E(J) {
            if (!(J instanceof $)) throw new Error("Weierstrass Point expected");
        }
        function I(J) {
            if (!c || !c.basises) throw new Error("no endo");
            return Tse(J, c.basises, s.ORDER);
        }
        const D = tR((J, C)=>{
            const { X: g, Y: x, Z: A } = J;
            if (r.eql(A, r.ONE)) return {
                x: g,
                y: x
            };
            const R = J.is0();
            C == null && (C = R ? r.ONE : r.inv(A));
            const N = r.mul(g, C), L = r.mul(x, C), z = r.mul(A, C);
            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
            };
        }), U = tR((J)=>{
            if (J.is0()) {
                if (e.allowInfinityPoint && !r.is0(J.Y)) return;
                throw new Error("bad point: ZERO");
            }
            const { x: C, y: g } = J.toAffine();
            if (!r.isValid(C) || !r.isValid(g)) throw new Error("bad point: x or y not field elements");
            if (!y(C, g)) throw new Error("bad point: equation left != right");
            if (!J.isTorsionFree()) throw new Error("bad point: not in prime-order subgroup");
            return !0;
        });
        function K(J, C, g, x, A) {
            return g = new $(r.mul(g.X, J), g.Y, g.Z), C = E2(x, C), g = E2(A, g), C.add(g);
        }
        class $ {
            static BASE = new $(i.Gx, i.Gy, r.ONE);
            static ZERO = new $(r.ZERO, r.ONE, r.ZERO);
            static Fp = r;
            static Fn = s;
            X;
            Y;
            Z;
            constructor(C, g, x){
                this.X = w("x", C), this.Y = w("y", g, !0), this.Z = w("z", x), Object.freeze(this);
            }
            static CURVE() {
                return i;
            }
            static fromAffine(C) {
                const { x: g, y: x } = C || {};
                if (!C || !r.isValid(g) || !r.isValid(x)) throw new Error("invalid affine point");
                if (C instanceof $) throw new Error("projective point not allowed");
                return r.is0(g) && r.is0(x) ? $.ZERO : new $(g, x, r.ONE);
            }
            static fromBytes(C) {
                const g = $.fromAffine(h(er(C, void 0, "point")));
                return g.assertValidity(), g;
            }
            static fromHex(C) {
                return $.fromBytes(k2(C));
            }
            get x() {
                return this.toAffine().x;
            }
            get y() {
                return this.toAffine().y;
            }
            precompute(C = 8, g = !0) {
                return te.createCache(this, C), g || this.multiply(zw), this;
            }
            assertValidity() {
                U(this);
            }
            hasEvenY() {
                const { y: C } = this.toAffine();
                if (!r.isOdd) throw new Error("Field doesn't support isOdd");
                return !r.isOdd(C);
            }
            equals(C) {
                E(C);
                const { X: g, Y: x, Z: A } = this, { X: R, Y: N, Z: L } = C, z = r.eql(r.mul(g, L), r.mul(R, A)), B = r.eql(r.mul(x, L), r.mul(N, A));
                return z && B;
            }
            negate() {
                return new $(this.X, r.neg(this.Y), this.Z);
            }
            double() {
                const { a: C, b: g } = i, x = r.mul(g, zw), { X: A, Y: R, Z: N } = this;
                let L = r.ZERO, z = r.ZERO, B = r.ZERO, S = r.mul(A, A), O = r.mul(R, R), W = r.mul(N, N), F = r.mul(A, R);
                return F = r.add(F, F), B = r.mul(A, N), B = r.add(B, B), L = r.mul(C, B), z = r.mul(x, W), z = r.add(L, z), L = r.sub(O, z), z = r.add(O, z), z = r.mul(L, z), L = r.mul(F, L), B = r.mul(x, B), W = r.mul(C, W), F = r.sub(S, W), F = r.mul(C, F), F = r.add(F, B), B = r.add(S, S), S = r.add(B, S), S = r.add(S, W), S = r.mul(S, F), z = r.add(z, S), W = r.mul(R, N), W = r.add(W, W), S = r.mul(W, F), L = r.sub(L, S), B = r.mul(W, O), B = r.add(B, B), B = r.add(B, B), new $(L, z, B);
            }
            add(C) {
                E(C);
                const { X: g, Y: x, Z: A } = this, { X: R, Y: N, Z: L } = C;
                let z = r.ZERO, B = r.ZERO, S = r.ZERO;
                const O = i.a, W = r.mul(i.b, zw);
                let F = r.mul(g, R), G = r.mul(x, N), ee = r.mul(A, L), Q = r.add(g, x), Y = r.add(R, N);
                Q = r.mul(Q, Y), Y = r.add(F, G), Q = r.sub(Q, Y), Y = r.add(g, A);
                let ae = r.add(R, L);
                return Y = r.mul(Y, ae), ae = r.add(F, ee), Y = r.sub(Y, ae), ae = r.add(x, A), z = r.add(N, L), ae = r.mul(ae, z), z = r.add(G, ee), ae = r.sub(ae, z), S = r.mul(O, Y), z = r.mul(W, ee), S = r.add(z, S), z = r.sub(G, S), S = r.add(G, S), B = r.mul(z, S), G = r.add(F, F), G = r.add(G, F), ee = r.mul(O, ee), Y = r.mul(W, Y), G = r.add(G, ee), ee = r.sub(F, ee), ee = r.mul(O, ee), Y = r.add(Y, ee), F = r.mul(G, Y), B = r.add(B, F), F = r.mul(ae, Y), z = r.mul(Q, z), z = r.sub(z, F), F = r.mul(Q, G), S = r.mul(ae, S), S = r.add(S, F), new $(z, B, S);
            }
            subtract(C) {
                return this.add(C.negate());
            }
            is0() {
                return this.equals($.ZERO);
            }
            multiply(C) {
                const { endo: g } = e;
                if (!s.isValidNot0(C)) throw new Error("invalid scalar: out of range");
                let x, A;
                const R = (N)=>te.cached(this, N, (L)=>sR($, L));
                if (g) {
                    const { k1neg: N, k1: L, k2neg: z, k2: B } = I(C), { p: S, f: O } = R(L), { p: W, f: F } = R(B);
                    A = O.add(F), x = K(g.beta, S, W, N, z);
                } else {
                    const { p: N, f: L } = R(C);
                    x = N, A = L;
                }
                return sR($, [
                    x,
                    A
                ])[0];
            }
            multiplyUnsafe(C) {
                const { endo: g } = e, x = this;
                if (!s.isValid(C)) throw new Error("invalid scalar: out of range");
                if (C === Cl || x.is0()) return $.ZERO;
                if (C === r0) return x;
                if (te.hasCache(this)) return this.multiply(C);
                if (g) {
                    const { k1neg: A, k1: R, k2neg: N, k2: L } = I(C), { p1: z, p2: B } = vse($, x, R, L);
                    return K(g.beta, z, B, A, N);
                } else return te.unsafe(x, C);
            }
            toAffine(C) {
                return D(this, C);
            }
            isTorsionFree() {
                const { isTorsionFree: C } = e;
                return o === r0 ? !0 : C ? C($, this) : te.unsafe(this, a).is0();
            }
            clearCofactor() {
                const { clearCofactor: C } = e;
                return o === r0 ? this : C ? C($, this) : this.multiplyUnsafe(o);
            }
            isSmallOrder() {
                return this.multiplyUnsafe(o).is0();
            }
            toBytes(C = !0) {
                return T2(C, "isCompressed"), this.assertValidity(), p($, this, C);
            }
            toHex(C = !0) {
                return Sv(this.toBytes(C));
            }
            toString() {
                return `<Point ${this.is0() ? "ZERO" : this.toHex()}>`;
            }
        }
        const ne = s.BITS, te = new xse($, e.endo ? Math.ceil(ne / 2) : ne);
        return $.BASE.precompute(8), $;
    }
    function HH(t) {
        return Uint8Array.of(t ? 2 : 3);
    }
    function jH(t, e) {
        return {
            secretKey: e.BYTES,
            publicKey: 1 + t.BYTES,
            publicKeyUncompressed: 1 + 2 * t.BYTES,
            publicKeyHasPrefix: !0,
            signature: 2 * e.BYTES
        };
    }
    function Ase(t, e = {}) {
        const { Fn: n } = t, r = e.randomBytes || xH, s = Object.assign(jH(t.Fp, n), {
            seed: DH(n.ORDER)
        });
        function i(p) {
            try {
                const h = n.fromBytes(p);
                return n.isValidNot0(h);
            } catch  {
                return !1;
            }
        }
        function o(p, h) {
            const { publicKey: b, publicKeyUncompressed: y } = s;
            try {
                const _ = p.length;
                return h === !0 && _ !== b || h === !1 && _ !== y ? !1 : !!t.fromBytes(p);
            } catch  {
                return !1;
            }
        }
        function a(p = r(s.seed)) {
            return _se(er(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: b, publicKeyUncompressed: y } = s;
            if (!hE(p) || "_lengths" in n && n._lengths || h === b) return;
            const _ = er(p, void 0, "key").length;
            return _ === b || _ === y;
        }
        function u(p, h, b = !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 y = n.fromBytes(p);
            return t.fromBytes(h).multiply(y).toBytes(b);
        }
        const d = {
            isValidSecretKey: i,
            isValidPublicKey: o,
            randomSecretKey: a
        }, f = kse(a, c);
        return Object.freeze({
            getPublicKey: c,
            getSharedSecret: u,
            keygen: f,
            Point: t,
            utils: d,
            lengths: s
        });
    }
    function Pse(t, e, n = {}) {
        wH(e), _E(n, {}, {
            hmac: "function",
            lowS: "boolean",
            randomBytes: "function",
            bits2int: "function",
            bits2int_modN: "function"
        }), n = Object.assign({}, n);
        const r = n.randomBytes || xH, s = n.hmac || ((g, x)=>C2(e, g, x)), { Fp: i, Fn: o } = t, { ORDER: a, BITS: c } = o, { keygen: l, getPublicKey: u, getSharedSecret: d, utils: f, lengths: p } = Ase(t, n), h = {
            prehash: !0,
            lowS: typeof n.lowS == "boolean" ? n.lowS : !0,
            format: "compact",
            extraEntropy: !1
        }, b = a * UH < i.ORDER;
        function y(g) {
            const x = a >> r0;
            return g > x;
        }
        function _(g, x) {
            if (!o.isValidNot0(x)) throw new Error(`invalid signature ${g}: out of range 1..Point.Fn.ORDER`);
            return x;
        }
        function v() {
            if (b) throw new Error('"recovered" sig type is not supported for cofactor >2 curves');
        }
        function w(g, x) {
            x6(x);
            const A = p.signature, R = x === "compact" ? A : x === "recovered" ? A + 1 : void 0;
            return er(g, R);
        }
        class E {
            r;
            s;
            recovery;
            constructor(x, A, R){
                if (this.r = _("r", x), this.s = _("s", A), R != null) {
                    if (v(), ![
                        0,
                        1,
                        2,
                        3
                    ].includes(R)) throw new Error("invalid recovery id");
                    this.recovery = R;
                }
                Object.freeze(this);
            }
            static fromBytes(x, A = h.format) {
                w(x, A);
                let R;
                if (A === "der") {
                    const { r: B, s: S } = Yu.toSig(er(x));
                    return new E(B, S);
                }
                A === "recovered" && (R = x[0], A = "compact", x = x.subarray(1));
                const N = p.signature / 2, L = x.subarray(0, N), z = x.subarray(N, N * 2);
                return new E(o.fromBytes(L), o.fromBytes(z), R);
            }
            static fromHex(x, A) {
                return this.fromBytes(k2(x), A);
            }
            assertRecovery() {
                const { recovery: x } = this;
                if (x == null) throw new Error("invalid recovery id: must be present");
                return x;
            }
            addRecoveryBit(x) {
                return new E(this.r, this.s, x);
            }
            recoverPublicKey(x) {
                const { r: A, s: R } = this, N = this.assertRecovery(), L = N === 2 || N === 3 ? A + a : A;
                if (!i.isValid(L)) throw new Error("invalid recovery id: sig.r+curve.n != R.x");
                const z = i.toBytes(L), B = t.fromBytes(Zo(HH((N & 1) === 0), z)), S = o.inv(L), O = D(er(x, void 0, "msgHash")), W = o.create(-O * S), F = o.create(R * S), G = t.BASE.multiplyUnsafe(W).add(B.multiplyUnsafe(F));
                if (G.is0()) throw new Error("invalid recovery: point at infinify");
                return G.assertValidity(), G;
            }
            hasHighS() {
                return y(this.s);
            }
            toBytes(x = h.format) {
                if (x6(x), x === "der") return k2(Yu.hexFromSig(this));
                const { r: A, s: R } = this, N = o.toBytes(A), L = o.toBytes(R);
                return x === "recovered" ? (v(), Zo(Uint8Array.of(this.assertRecovery()), N, L)) : Zo(N, L);
            }
            toHex(x) {
                return Sv(this.toBytes(x));
            }
        }
        const I = n.bits2int || function(x) {
            if (x.length > 8192) throw new Error("input is too large");
            const A = kv(x), R = x.length * 8 - c;
            return R > 0 ? A >> BigInt(R) : A;
        }, D = n.bits2int_modN || function(x) {
            return o.create(I(x));
        }, U = wE(c);
        function K(g) {
            return ase("num < 2^" + c, g, Cl, U), o.toBytes(g);
        }
        function $(g, x) {
            return er(g, void 0, "message"), x ? er(e(g), void 0, "prehashed message") : g;
        }
        function ne(g, x, A) {
            const { lowS: R, prehash: N, extraEntropy: L } = R9(A, h);
            g = $(g, N);
            const z = D(g), B = o.fromBytes(x);
            if (!o.isValidNot0(B)) throw new Error("invalid private key");
            const S = [
                K(B),
                K(z)
            ];
            if (L != null && L !== !1) {
                const G = L === !0 ? r(p.secretKey) : L;
                S.push(er(G, void 0, "extraEntropy"));
            }
            const O = Zo(...S), W = z;
            function F(G) {
                const ee = I(G);
                if (!o.isValidNot0(ee)) return;
                const Q = o.inv(ee), Y = t.BASE.multiply(ee).toAffine(), ae = o.create(Y.x);
                if (ae === Cl) return;
                const de = o.create(Q * o.create(W + ae * B));
                if (de === Cl) return;
                let pe = (Y.x === ae ? 0 : 2) | Number(Y.y & r0), Ae = de;
                return R && y(de) && (Ae = o.neg(de), pe ^= 1), new E(ae, Ae, b ? void 0 : pe);
            }
            return {
                seed: O,
                k2sig: F
            };
        }
        function te(g, x, A = {}) {
            const { seed: R, k2sig: N } = ne(g, x, A);
            return lse(e.outputLen, o.BYTES, s)(R, N).toBytes(A.format);
        }
        function J(g, x, A, R = {}) {
            const { lowS: N, prehash: L, format: z } = R9(R, h);
            if (A = er(A, void 0, "publicKey"), x = $(x, L), !hE(g)) {
                const B = g instanceof E ? ", use sig.toBytes()" : "";
                throw new Error("verify expects Uint8Array signature" + B);
            }
            w(g, z);
            try {
                const B = E.fromBytes(g, z), S = t.fromBytes(A);
                if (N && B.hasHighS()) return !1;
                const { r: O, s: W } = B, F = D(x), G = o.inv(W), ee = o.create(F * G), Q = o.create(O * G), Y = t.BASE.multiplyUnsafe(ee).add(S.multiplyUnsafe(Q));
                return Y.is0() ? !1 : o.create(Y.x) === O;
            } catch  {
                return !1;
            }
        }
        function C(g, x, A = {}) {
            const { prehash: R } = R9(A, h);
            return x = $(x, R), E.fromBytes(g, "recovered").recoverPublicKey(x).toBytes();
        }
        return Object.freeze({
            keygen: l,
            getPublicKey: u,
            getSharedSecret: d,
            utils: f,
            lengths: p,
            Point: t,
            sign: te,
            verify: J,
            recoverPublicKey: C,
            Signature: E,
            hash: e
        });
    }
    const vE = {
        p: BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),
        n: BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),
        h: BigInt(1),
        a: BigInt(0),
        b: BigInt(7),
        Gx: BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),
        Gy: BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")
    }, Ose = {
        beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),
        basises: [
            [
                BigInt("0x3086d221a7d46bcde86c90e49284eb15"),
                -BigInt("0xe4437ed6010e88286f547fa90abfe4c3")
            ],
            [
                BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),
                BigInt("0x3086d221a7d46bcde86c90e49284eb15")
            ]
        ]
    }, lR = BigInt(2);
    function Mse(t) {
        const e = vE.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 = No(u, n, e) * u % e, f = No(d, n, e) * u % e, p = No(f, lR, e) * l % e, h = No(p, s, e) * p % e, b = No(h, i, e) * h % e, y = No(b, a, e) * b % e, _ = No(y, c, e) * y % e, v = No(_, a, e) * b % e, w = No(v, n, e) * u % e, E = No(w, o, e) * h % e, I = No(E, r, e) * l % e, D = No(I, lR, e);
        if (!v6.eql(v6.sqr(D), t)) throw new Error("Cannot find square root");
        return D;
    }
    const v6 = Tv(vE.p, {
        sqrt: Mse
    }), Rse = Ise(vE, {
        Fp: v6,
        endo: Ose
    }), qp = Pse(Rse, bE), Nse = Uint8Array.from([
        7,
        4,
        13,
        1,
        10,
        6,
        15,
        3,
        12,
        0,
        9,
        5,
        2,
        14,
        11,
        8
    ]), qH = Uint8Array.from(new Array(16).fill(0).map((t, e)=>e)), Vse = qH.map((t)=>(9 * t + 5) % 16), KH = (()=>{
        const n = [
            [
                qH
            ],
            [
                Vse
            ]
        ];
        for(let r = 0; r < 4; r++)for (let s of n)s.push(s[r].map((i)=>Nse[i]));
        return n;
    })(), WH = KH[0], $H = KH[1], XH = [
        [
            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)), Bse = WH.map((t, e)=>t.map((n)=>XH[e][n])), Dse = $H.map((t, e)=>t.map((n)=>XH[e][n])), Fse = Uint32Array.from([
        0,
        1518500249,
        1859775393,
        2400959708,
        2840853838
    ]), Lse = Uint32Array.from([
        1352829926,
        1548603684,
        1836072691,
        2053994217,
        0
    ]);
    function uR(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 Uw = new Uint32Array(16);
    class zse extends gE {
        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)Uw[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, b = Fse[p], y = Lse[p], _ = WH[p], v = $H[p], w = Bse[p], E = Dse[p];
                for(let I = 0; I < 16; I++){
                    const D = Vw(r + uR(p, i, a, l) + Uw[_[I]] + b, w[I]) + d | 0;
                    r = d, d = l, l = Vw(a, 10) | 0, a = i, i = D;
                }
                for(let I = 0; I < 16; I++){
                    const D = Vw(s + uR(h, o, c, u) + Uw[v[I]] + y, E[I]) + f | 0;
                    s = f, f = u, u = Vw(c, 10) | 0, c = o, o = D;
                }
            }
            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() {
            xd(Uw);
        }
        destroy() {
            this.destroyed = !0, xd(this.buffer), this.set(0, 0, 0, 0, 0);
        }
    }
    const Use = pE(()=>new zse);
    function Jm(t) {
        return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
    }
    function GH(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 ZH(t) {
        if (typeof t != "function") throw new Error("function expected");
        return !0;
    }
    function w0(t, e) {
        if (typeof e != "string") throw new Error(`${t}: string expected`);
        return !0;
    }
    function Ag(t) {
        if (!Number.isSafeInteger(t)) throw new Error(`invalid integer: ${t}`);
    }
    function I2(t) {
        if (!Array.isArray(t)) throw new Error("array expected");
    }
    function A2(t, e) {
        if (!GH(!0, e)) throw new Error(`${t}: array of strings expected`);
    }
    function SE(t, e) {
        if (!GH(!1, e)) throw new Error(`${t}: array of numbers expected`);
    }
    function Ev(...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 kE(t) {
        const e = typeof t == "string" ? t.split("") : t, n = e.length;
        A2("alphabet", e);
        const r = new Map(e.map((s, i)=>[
                s,
                i
            ]));
        return {
            encode: (s)=>(I2(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)=>(I2(s), s.map((i)=>{
                    w0("alphabet.decode", i);
                    const o = r.get(i);
                    if (o === void 0) throw new Error(`Unknown letter: "${i}". Allowed: ${t}`);
                    return o;
                }))
        };
    }
    function TE(t = "") {
        return w0("join", t), {
            encode: (e)=>(A2("join.decode", e), e.join(t)),
            decode: (e)=>(w0("join.decode", e), e.split(t))
        };
    }
    function Hse(t, e = "=") {
        return Ag(t), w0("padding", e), {
            encode (n) {
                for(A2("padding.encode", n); n.length * t % 8;)n.push(e);
                return n;
            },
            decode (n) {
                A2("padding.decode", n);
                let r = n.length;
                if (r * t % 8) throw new Error("padding: invalid, string should have whole number of bytes");
                for(; r > 0 && n[r - 1] === e; r--)if ((r - 1) * t % 8 === 0) throw new Error("padding: invalid, string has too much padding");
                return n.slice(0, r);
            }
        };
    }
    function S6(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 (I2(t), !t.length) return [];
        let r = 0;
        const s = [], i = Array.from(t, (a)=>{
            if (Ag(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();
    }
    const JH = (t, e)=>e === 0 ? t : JH(e, t % e), P2 = (t, e)=>t + (e - JH(t, e)), N_ = (()=>{
        let t = [];
        for(let e = 0; e < 40; e++)t.push(2 ** e);
        return t;
    })();
    function O2(t, e, n, r) {
        if (I2(t), e <= 0 || e > 32) throw new Error(`convertRadix2: wrong from=${e}`);
        if (n <= 0 || n > 32) throw new Error(`convertRadix2: wrong to=${n}`);
        if (P2(e, n) > 32) throw new Error(`convertRadix2: carry overflow from=${e} to=${n} carryBits=${P2(e, n)}`);
        let s = 0, i = 0;
        const o = N_[e], a = N_[n] - 1, c = [];
        for (const l of t){
            if (Ag(l), l >= o) throw new Error(`convertRadix2: invalid data word=${l} from=${e}`);
            if (s = s << e | l, i + e > 32) throw new Error(`convertRadix2: carry overflow pos=${i} from=${e}`);
            for(i += e; i >= n; i -= n)c.push((s >> i - n & a) >>> 0);
            const u = N_[i];
            if (u === void 0) throw new Error("invalid carry");
            s &= u - 1;
        }
        if (s = s << n - i & a, !r && i >= e) throw new Error("Excess padding");
        if (!r && s > 0) throw new Error(`Non-zero padding: ${s}`);
        return r && i > 0 && c.push(s >>> 0), c;
    }
    function YH(t) {
        Ag(t);
        const e = 2 ** 8;
        return {
            encode: (n)=>{
                if (!Jm(n)) throw new Error("radix.encode input should be Uint8Array");
                return S6(Array.from(n), e, t);
            },
            decode: (n)=>(SE("radix.decode", n), Uint8Array.from(S6(n, t, e)))
        };
    }
    function QH(t, e = !1) {
        if (Ag(t), t <= 0 || t > 32) throw new Error("radix2: bits should be in (0..32]");
        if (P2(8, t) > 32 || P2(t, 8) > 32) throw new Error("radix2: carry overflow");
        return {
            encode: (n)=>{
                if (!Jm(n)) throw new Error("radix2.encode input should be Uint8Array");
                return O2(Array.from(n), 8, t, !e);
            },
            decode: (n)=>(SE("radix2.decode", n), Uint8Array.from(O2(n, t, 8, e)))
        };
    }
    function dR(t) {
        return ZH(t), function(...e) {
            try {
                return t.apply(null, e);
            } catch  {}
        };
    }
    function ej(t, e) {
        return Ag(t), ZH(e), {
            encode (n) {
                if (!Jm(n)) throw new Error("checksum.encode: input should be Uint8Array");
                const r = e(n).slice(0, t), s = new Uint8Array(n.length + t);
                return s.set(n), s.set(r, n.length), s;
            },
            decode (n) {
                if (!Jm(n)) throw new Error("checksum.decode: input should be Uint8Array");
                const r = n.slice(0, -t), s = n.slice(-t), i = e(r).slice(0, t);
                for(let o = 0; o < t; o++)if (i[o] !== s[o]) throw new Error("Invalid checksum");
                return r;
            }
        };
    }
    const Hw = {
        alphabet: kE,
        chain: Ev,
        checksum: ej,
        convertRadix: S6,
        convertRadix2: O2,
        radix: YH,
        radix2: QH,
        join: TE,
        padding: Hse
    }, jse = (t)=>Ev(YH(58), kE(t), TE("")), qse = jse("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"), Kse = (t)=>Ev(ej(4, (e)=>t(t(e))), qse), k6 = Ev(kE("qpzry9x8gf2tvdw0s3jn54khce6mua7l"), TE("")), fR = [
        996825010,
        642813549,
        513874426,
        1027748829,
        705979059
    ];
    function Pb(t) {
        const e = t >> 25;
        let n = (t & 33554431) << 5;
        for(let r = 0; r < fR.length; r++)(e >> r & 1) === 1 && (n ^= fR[r]);
        return n;
    }
    function hR(t, e, n = 1) {
        const r = t.length;
        let s = 1;
        for(let i = 0; i < r; i++){
            const o = t.charCodeAt(i);
            if (o < 33 || o > 126) throw new Error(`Invalid prefix (${t})`);
            s = Pb(s) ^ o >> 5;
        }
        s = Pb(s);
        for(let i = 0; i < r; i++)s = Pb(s) ^ t.charCodeAt(i) & 31;
        for (let i of e)s = Pb(s) ^ i;
        for(let i = 0; i < 6; i++)s = Pb(s);
        return s ^= n, k6.encode(O2([
            s % N_[30]
        ], 30, 5, !1));
    }
    function tj(t) {
        const e = t === "bech32" ? 1 : 734539939, n = QH(5), r = n.decode, s = n.encode, i = dR(r);
        function o(d, f, p = 90) {
            w0("bech32.encode prefix", d), Jm(f) && (f = Array.from(f)), SE("bech32.encode", f);
            const h = d.length;
            if (h === 0) throw new TypeError(`Invalid prefix length ${h}`);
            const b = h + 7 + f.length;
            if (p !== !1 && b > p) throw new TypeError(`Length ${b} exceeds limit ${p}`);
            const y = d.toLowerCase(), _ = hR(y, f, e);
            return `${y}1${k6.encode(f)}${_}`;
        }
        function a(d, f = 90) {
            w0("bech32.decode input", d);
            const p = d.length;
            if (p < 8 || f !== !1 && p > f) throw new TypeError(`invalid string length: ${p} (${d}). Expected (8..${f})`);
            const h = d.toLowerCase();
            if (d !== h && d !== d.toUpperCase()) throw new Error("String must be lowercase or uppercase");
            const b = h.lastIndexOf("1");
            if (b === 0 || b === -1) throw new Error('Letter "1" must be present between prefix and data only');
            const y = h.slice(0, b), _ = h.slice(b + 1);
            if (_.length < 6) throw new Error("Data must be at least 6 characters long");
            const v = k6.decode(_).slice(0, -6), w = hR(y, v, e);
            if (!_.endsWith(w)) throw new Error(`Invalid checksum in ${d}: expected "${w}"`);
            return {
                prefix: y,
                words: v
            };
        }
        const c = dR(a);
        function l(d) {
            const { prefix: f, words: p } = a(d, !1);
            return {
                prefix: f,
                words: p,
                bytes: r(p)
            };
        }
        function u(d, f) {
            return o(d, s(f));
        }
        return {
            encode: o,
            decode: a,
            encodeFromBytes: u,
            decodeToBytes: l,
            decodeUnsafe: c,
            fromWords: r,
            fromWordsUnsafe: i,
            toWords: s
        };
    }
    const pR = tj("bech32"), zf = tj("bech32m");
    const im = qp.Point, { Fn: Ob } = im, N9 = Kse(bE), Wse = Uint8Array.from("Bitcoin seed".split(""), (t)=>t.charCodeAt(0)), V9 = {
        private: 76066276,
        public: 76067358
    }, B9 = 2147483648, $se = (t)=>Use(bE(t)), Xse = (t)=>n0(t).getUint32(0, !1), jw = (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 n0(e).setUint32(0, t, !1), e;
    };
    class Mf {
        get fingerprint() {
            if (!this.pubHash) throw new Error("No publicKey set!");
            return Xse(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 N9.encode(this.serialize(this.versions.private, Zo(Uint8Array.of(0), e)));
        }
        get publicExtendedKey() {
            if (!this._publicKey) throw new Error("No public key");
            return N9.encode(this.serialize(this.versions.public, this._publicKey));
        }
        static fromMasterSeed(e, n = V9) {
            if (er(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 = C2(eR, Wse, e), s = r.slice(0, 32), i = r.slice(32);
            return new Mf({
                versions: n,
                chainCode: i,
                privateKey: s
            });
        }
        static fromExtendedKey(e, n = V9) {
            const r = N9.decode(e), s = n0(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 Mf({
                ...o,
                privateKey: a.slice(1)
            }) : new Mf({
                ...o,
                publicKey: a
            });
        }
        static fromJSON(e) {
            return Mf.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 || V9, 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 (!qp.utils.isValidSecretKey(e.privateKey)) throw new Error("Invalid private key");
                this._privateKey = e.privateKey, this._publicKey = qp.getPublicKey(e.privateKey, !0);
            } else if (e.publicKey) this._publicKey = im.fromBytes(e.publicKey).toBytes(!0);
            else throw new Error("HDKey: no public or private key provided");
            this.pubHash = $se(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 >= B9) throw new Error("Invalid index");
                i[2] === "'" && (a += B9), r = r.deriveChild(a);
            }
            return r;
        }
        deriveChild(e) {
            if (!this._publicKey || !this.chainCode) throw new Error("No publicKey or chainCode set");
            let n = jw(e);
            if (e >= B9) {
                const c = this._privateKey;
                if (!c) throw new Error("Could not derive hardened child key");
                n = Zo(Uint8Array.of(0), c, n);
            } else n = Zo(this._publicKey, n);
            const r = C2(eR, this.chainCode, n), s = r.slice(0, 32), i = r.slice(32);
            if (!qp.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 = Ob.fromBytes(s);
            try {
                if (this._privateKey) {
                    const c = Ob.create(Ob.fromBytes(this._privateKey) + a);
                    if (!Ob.isValidNot0(c)) throw new Error("The tweak was out of range or the resulted private key is invalid");
                    o.privateKey = Ob.toBytes(c);
                } else {
                    const c = im.fromBytes(this._publicKey).add(im.BASE.multiply(a));
                    if (c.equals(im.ZERO)) throw new Error("The tweak was equal to negative P, which made the result key invalid");
                    o.publicKey = c.toBytes(!0);
                }
                return new Mf(o);
            } catch  {
                return this.deriveChild(e + 1);
            }
        }
        sign(e) {
            if (!this._privateKey) throw new Error("No privateKey set!");
            return er(e, 32), qp.sign(e, this._privateKey, {
                prehash: !1
            });
        }
        verify(e, n) {
            if (er(e, 32), er(n, 64), !this._publicKey) throw new Error("No publicKey set!");
            return qp.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 er(n, 33), Zo(jw(e), new Uint8Array([
                this.depth
            ]), jw(this.parentFingerprint), jw(this.index), this.chainCode, n);
        }
    }
    const Ap = {
        NightExternal: 0,
        Dust: 2,
        Zswap: 3
    }, Gse = 44, Zse = 2400, Jse = {
        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 EE {
        rootKey;
        constructor(e){
            this.rootKey = e;
        }
        static fromSeed(e) {
            try {
                const n = Mf.fromMasterSeed(e);
                return {
                    type: "seedOk",
                    hdWallet: new EE(n)
                };
            } catch (n) {
                return {
                    type: "seedError",
                    error: n
                };
            }
        }
        selectAccount(e) {
            return new Yse(this.rootKey, e);
        }
        clear() {
            this.rootKey.wipePrivateData();
        }
    }
    class Yse {
        rootKey;
        account;
        constructor(e, n){
            this.account = n, this.rootKey = e;
        }
        selectRole(e) {
            return new nj(this.rootKey, this.account, e);
        }
        selectRoles(e) {
            return new Qse(this.rootKey, this.account, e);
        }
    }
    class nj {
        rootKey;
        account;
        role;
        constructor(e, n, r){
            this.role = r, this.account = n, this.rootKey = e;
        }
        deriveKeyAt(e) {
            const n = `m/${Gse}'/${Zse}'/${this.account}'/${this.role}/${e}`, r = this.rootKey.derive(n);
            return r.privateKey ? {
                type: "keyDerived",
                key: r.privateKey
            } : {
                type: "keyOutOfBounds"
            };
        }
    }
    class Qse {
        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 nj(this.rootKey, this.account, r).deriveKeyAt(e)
                }));
            return Jse.fromResults(n);
        }
    }
    function eie(t) {
        return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
    }
    function tie(t, e = "") {
        if (!Number.isSafeInteger(t) || t < 0) {
            const n = e && `"${e}" `;
            throw new Error(`${n}expected integer >= 0, got ${t}`);
        }
    }
    function CE(t, e, n = "") {
        const r = eie(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 gR(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 nie(t, e) {
        CE(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 T6(...t) {
        for(let e = 0; e < t.length; e++)t[e].fill(0);
    }
    function D9(t) {
        return new DataView(t.buffer, t.byteOffset, t.byteLength);
    }
    function nc(t, e) {
        return t << 32 - e | t >>> e;
    }
    function rie(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 sie(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 iie = (t)=>({
            oid: Uint8Array.from([
                6,
                9,
                96,
                134,
                72,
                1,
                101,
                3,
                4,
                2,
                t
            ])
        });
    function oie(t, e, n) {
        return t & e ^ ~t & n;
    }
    function aie(t, e, n) {
        return t & e ^ t & n ^ e & n;
    }
    let cie = 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 = D9(this.buffer);
        }
        update(e) {
            gR(this), CE(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 = D9(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) {
            gR(this), nie(e, this), this.finished = !0;
            const { buffer: n, view: r, blockLen: s, isLE: i } = this;
            let { pos: o } = this;
            n[o++] = 128, T6(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 = D9(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 Mu = Uint32Array.from([
        1779033703,
        3144134277,
        1013904242,
        2773480762,
        1359893119,
        2600822924,
        528734635,
        1541459225
    ]), lie = 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
    ]), Ru = new Uint32Array(64);
    class uie extends cie {
        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)Ru[d] = e.getUint32(n, !1);
            for(let d = 16; d < 64; d++){
                const f = Ru[d - 15], p = Ru[d - 2], h = nc(f, 7) ^ nc(f, 18) ^ f >>> 3, b = nc(p, 17) ^ nc(p, 19) ^ p >>> 10;
                Ru[d] = b + Ru[d - 7] + h + Ru[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 = nc(a, 6) ^ nc(a, 11) ^ nc(a, 25), p = u + f + oie(a, c, l) + lie[d] + Ru[d] | 0, b = (nc(r, 2) ^ nc(r, 13) ^ nc(r, 22)) + aie(r, s, i) | 0;
                u = l, l = c, c = a, a = o + p | 0, o = i, i = s, s = r, r = p + b | 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() {
            T6(Ru);
        }
        destroy() {
            this.set(0, 0, 0, 0, 0, 0, 0, 0), T6(this.buffer);
        }
    }
    class die extends uie {
        A = Mu[0] | 0;
        B = Mu[1] | 0;
        C = Mu[2] | 0;
        D = Mu[3] | 0;
        E = Mu[4] | 0;
        F = Mu[5] | 0;
        G = Mu[6] | 0;
        H = Mu[7] | 0;
        constructor(){
            super(32);
        }
    }
    const fie = rie(()=>new die, iie(1));
    const hie = (t)=>t[0] === "あいこくしん";
    function pie(t) {
        if (CE(t), ![
            16,
            20,
            24,
            28,
            32
        ].includes(t.length)) throw new Error("invalid entropy length");
    }
    function gie(t, e = 128) {
        if (tie(e), e % 32 !== 0 || e > 256) throw new TypeError("Invalid entropy");
        return yie(sie(e / 8), t);
    }
    const bie = (t)=>{
        const e = 8 - t.length / 4;
        return new Uint8Array([
            fie(t)[0] >> e << e
        ]);
    };
    function mie(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);
        }), Hw.chain(Hw.checksum(1, bie), Hw.radix2(11, !0), Hw.alphabet(t));
    }
    function yie(t, e) {
        return pie(t), mie(e).encode(t).join(hie(e) ? "　" : " ");
    }
    let wie, _ie, vie, Sie;
    wie = `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(`
`);
    _ie = (t)=>t.split(" ");
    xie = (t = 256)=>_ie(gie(wie, t));
    M2 = (t)=>t.join(" ");
    vie = (t)=>t != null;
    Sie = (t)=>t.filter(vie);
    function kie(t) {
        return (...e)=>{
            for (const n of t)n && n(...e);
        };
    }
    let E6;
    ke = (t)=>typeof t == "function" && !t.length ? t() : t;
    E6 = (t)=>Array.isArray(t) ? t : t ? [
            t
        ] : [];
    function Tie(t, ...e) {
        return typeof t == "function" ? t(...e) : t;
    }
    const Eie = At;
    function Cie(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 Iie(t, e, n, r) {
        return t.addEventListener(e, n, r), Eie(t.removeEventListener.bind(t, e, n, r));
    }
    function Aie(t, e, n, r) {
        const s = ()=>{
            E6(ke(t)).forEach((i)=>{
                i && E6(ke(e)).forEach((o)=>Iie(i, o, n, r));
            });
        };
        typeof t == "function" ? ot(s) : mt(s);
    }
    const F9 = Symbol("fallback");
    function bR(t) {
        for (const e of t)e.dispose();
    }
    function Pie(t, e, n, r = {}) {
        const s = new Map;
        return At(()=>bR(s.values())), ()=>{
            const o = t() || [];
            return o[Rre], uE(()=>{
                if (!o.length) return bR(s.values()), s.clear(), r.fallback ? [
                    WM((d)=>(s.set(F9, {
                            dispose: d
                        }), r.fallback()))
                ] : [];
                const a = new Array(o.length), c = s.get(F9);
                if (!s.size || c) {
                    c?.dispose(), s.delete(F9);
                    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) {
            WM((u)=>{
                const [d, f] = he(a), p = {
                    setItem: f,
                    dispose: u
                };
                if (n.length > 1) {
                    const [h, b] = he(c);
                    p.setIndex = b, p.mapped = n(d, h);
                } else p.mapped = n(d);
                s.set(l, p), o[c] = p.mapped;
            });
        }
    }
    function Oie(t) {
        const { by: e } = t;
        return _t(Pie(()=>t.each, typeof e == "function" ? e : (n)=>n[e], t.children, "fallback" in t ? {
            fallback: ()=>t.fallback
        } : void 0));
    }
    const Mie = /((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;
    function mR(t) {
        const e = {};
        let n;
        for(; n = Mie.exec(t);)e[n[1]] = n[2];
        return e;
    }
    Pg = function(t, e) {
        if (typeof t == "string") {
            if (typeof e == "string") return `${t};${e}`;
            t = mR(t);
        } else typeof e == "string" && (e = mR(e));
        return {
            ...t,
            ...e
        };
    };
    ir = function(...t) {
        return kie(t);
    };
    function Rie(t, e, n = -1) {
        return n in t ? [
            ...t.slice(0, n),
            e,
            ...t.slice(n)
        ] : [
            ...t,
            e
        ];
    }
    function C6(t, e) {
        const n = [
            ...t
        ], r = n.indexOf(e);
        return r !== -1 && n.splice(r, 1), n;
    }
    function Nie(t) {
        return typeof t == "number";
    }
    function Kp(t) {
        return Object.prototype.toString.call(t) === "[object String]";
    }
    function IE(t) {
        return typeof t == "function";
    }
    du = function(t) {
        return (e)=>`${t()}-${e}`;
    };
    function po(t, e) {
        return t ? t === e || t.contains(e) : !1;
    }
    function om(t, e = !1) {
        const { activeElement: n } = Mc(t);
        if (!n?.nodeName) return null;
        if (rj(n) && n.contentDocument) return om(n.contentDocument.body, e);
        if (e) {
            const r = n.getAttribute("aria-activedescendant");
            if (r) {
                const s = Mc(n).getElementById(r);
                if (s) return s;
            }
        }
        return n;
    }
    function Vie(t) {
        return Mc(t).defaultView || window;
    }
    function Mc(t) {
        return t ? t.ownerDocument || t : document;
    }
    function rj(t) {
        return t.tagName === "IFRAME";
    }
    sj = ((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))(sj || {});
    function ij(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 AE(t) {
        return typeof window < "u" && window.navigator != null ? t.test(window.navigator.userAgentData?.platform || window.navigator.platform) : !1;
    }
    function a1() {
        return AE(/^Mac/i);
    }
    function Bie() {
        return AE(/^iPhone/i);
    }
    function Die() {
        return AE(/^iPad/i) || a1() && navigator.maxTouchPoints > 1;
    }
    function Fie() {
        return Bie() || Die();
    }
    function Lie() {
        return a1() || Fie();
    }
    function oj() {
        return ij(/AppleWebKit/i) && !zie();
    }
    function zie() {
        return ij(/Chrome/i);
    }
    Fn = function(t, e) {
        return e && (IE(e) ? e(t) : e[0](e[1], t)), t?.defaultPrevented;
    };
    function Yt(t) {
        return (e)=>{
            for (const n of t)Fn(e, n);
        };
    }
    function Uie(t) {
        return a1() ? t.metaKey && !t.ctrlKey : t.ctrlKey && !t.metaKey;
    }
    function Lr(t) {
        if (t) if (Hie()) t.focus({
            preventScroll: !0
        });
        else {
            const e = jie(t);
            t.focus(), qie(e);
        }
    }
    var qw = null;
    function Hie() {
        if (qw == null) {
            qw = !1;
            try {
                document.createElement("div").focus({
                    get preventScroll () {
                        return qw = !0, !0;
                    }
                });
            } catch  {}
        }
        return qw;
    }
    function jie(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 qie(t) {
        for (const { element: e, scrollTop: n, scrollLeft: r } of t)e.scrollTop = n, e.scrollLeft = r;
    }
    var aj = [
        "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'])"
    ], Kie = [
        ...aj,
        '[tabindex]:not([tabindex="-1"]):not([disabled])'
    ], PE = `${aj.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`, Wie = Kie.join(':not([hidden]):not([tabindex="-1"]),');
    function cj(t, e) {
        const r = Array.from(t.querySelectorAll(PE)).filter(yR);
        return e && yR(t) && r.unshift(t), r.forEach((s, i)=>{
            if (rj(s) && s.contentDocument) {
                const o = s.contentDocument.body, a = cj(o, !1);
                r.splice(i, 1, ...a);
            }
        }), r;
    }
    function yR(t) {
        return lj(t) && !$ie(t);
    }
    function lj(t) {
        return t.matches(PE) && OE(t);
    }
    function $ie(t) {
        return Number.parseInt(t.getAttribute("tabindex") || "0", 10) < 0;
    }
    function OE(t, e) {
        return t.nodeName !== "#comment" && Xie(t) && Gie(t, e) && (!t.parentElement || OE(t.parentElement, t));
    }
    function Xie(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 Gie(t, e) {
        return !t.hasAttribute("hidden") && (t.nodeName === "DETAILS" && e && e.nodeName !== "SUMMARY" ? t.hasAttribute("open") : !0);
    }
    function uj(t, e, n) {
        const r = e?.tabbable ? Wie : PE, s = document.createTreeWalker(t, NodeFilter.SHOW_ELEMENT, {
            acceptNode (i) {
                return e?.from?.contains(i) ? NodeFilter.FILTER_REJECT : i.matches(r) && OE(i) && (!e?.accept || e.accept(i)) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
            }
        });
        return e?.from && (s.currentNode = e.from), s;
    }
    function wR(t) {
        let e = t;
        for(; e && !Zie(e);)e = e.parentElement;
        return e || document.scrollingElement || document.documentElement;
    }
    function Zie(t) {
        const e = window.getComputedStyle(t);
        return /(auto|scroll)/.test(e.overflow + e.overflowX + e.overflowY);
    }
    function Jie() {}
    function Yie(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;
    }
    zt = function(t, e) {
        return Le(t, e);
    };
    var Mb = new Map, _R = new Set;
    function xR() {
        if (typeof window > "u") return;
        const t = (n)=>{
            if (!n.target) return;
            let r = Mb.get(n.target);
            r || (r = new Set, Mb.set(n.target, r), n.target.addEventListener("transitioncancel", e)), r.add(n.propertyName);
        }, e = (n)=>{
            if (!n.target) return;
            const r = Mb.get(n.target);
            if (r && (r.delete(n.propertyName), r.size === 0 && (n.target.removeEventListener("transitioncancel", e), Mb.delete(n.target)), Mb.size === 0)) {
                for (const s of _R)s();
                _R.clear();
            }
        };
        document.body.addEventListener("transitionrun", t), document.body.addEventListener("transitionend", e);
    }
    typeof document < "u" && (document.readyState !== "loading" ? xR() : document.addEventListener("DOMContentLoaded", xR));
    function I6(t, e) {
        const n = vR(t, e, "left"), r = vR(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 vR(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 Qie(t, e) {
        if (document.contains(t)) {
            const n = document.scrollingElement || document.documentElement;
            if (window.getComputedStyle(n).overflow === "hidden") {
                let s = wR(t);
                for(; t && s && t !== n && s !== n;)I6(s, t), t = s, s = wR(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"
                });
            }
        }
    }
    dj = {
        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 Cv(t, e) {
        const [n, r] = he(SR(e?.()));
        return ot(()=>{
            r(t()?.tagName.toLowerCase() || SR(e?.()));
        }), n;
    }
    function SR(t) {
        return Kp(t) ? t : void 0;
    }
    yn = function(t) {
        const [e, n] = Ze(t, [
            "as"
        ]);
        if (!e.as) throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");
        return M(Nre, Le(n, {
            get component () {
                return e.as;
            }
        }));
    };
    let eoe, toe;
    eoe = Object.defineProperty;
    fu = (t, e)=>{
        for(var n in e)eoe(t, n, {
            get: e[n],
            enumerable: !0
        });
    };
    toe = {};
    fu(toe, {
        Button: ()=>soe,
        Root: ()=>zc
    });
    var noe = [
        "button",
        "color",
        "file",
        "image",
        "reset",
        "submit"
    ];
    function roe(t) {
        const e = t.tagName.toLowerCase();
        return e === "button" ? !0 : e === "input" && t.type ? noe.indexOf(t.type) !== -1 : !1;
    }
    function zc(t) {
        let e;
        const n = zt({
            type: "button"
        }, t), [r, s] = Ze(n, [
            "ref",
            "type",
            "disabled"
        ]), i = Cv(()=>e, ()=>"button"), o = _t(()=>{
            const l = i();
            return l == null ? !1 : roe({
                tagName: l,
                type: r.type
            });
        }), a = _t(()=>i() === "input"), c = _t(()=>i() === "a" && e?.getAttribute("href") != null);
        return M(yn, Le({
            as: "button",
            ref (l) {
                var u = ir((d)=>e = d, r.ref);
                typeof u == "function" && u(l);
            },
            get type () {
                return it(()=>!!(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 it(()=>!!(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 soe = zc;
    function fj(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 = fj(t[e])) && (r && (r += " "), r += n);
        } else for(n in t)t[n] && (r && (r += " "), r += n);
        return r;
    }
    function hj() {
        for(var t, e, n = 0, r = "", s = arguments.length; n < s; n++)(t = arguments[n]) && (e = fj(t)) && (r && (r += " "), r += e);
        return r;
    }
    const kR = (t)=>typeof t == "boolean" ? `${t}` : t === 0 ? "0" : t, TR = hj, pj = (t, e)=>(n)=>{
            var r;
            if (e?.variants == null) return TR(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 = kR(u) || kR(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 [b, y] = h;
                    return Array.isArray(y) ? y.includes({
                        ...i,
                        ...a
                    }[b]) : {
                        ...i,
                        ...a
                    }[b] === y;
                }) ? [
                    ...l,
                    d,
                    f
                ] : l;
            }, []);
            return TR(t, o, c, n?.class, n?.className);
        }, V_ = globalThis.browser?.runtime?.id ? globalThis.browser : globalThis.chrome, ioe = new Error("request for lock canceled");
    var ooe = function(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());
        });
    };
    let aoe = class {
        constructor(e, n = ioe){
            this._value = e, this._cancelError = n, this._queue = [], this._weightedWaiters = [];
        }
        acquire(e = 1, n = 0) {
            if (e <= 0) throw new Error(`invalid weight ${e}: must be positive`);
            return new Promise((r, s)=>{
                const i = {
                    resolve: r,
                    reject: s,
                    weight: e,
                    priority: n
                }, o = gj(this._queue, (a)=>n <= a.priority);
                o === -1 && e <= this._value ? this._dispatchItem(i) : this._queue.splice(o + 1, 0, i);
            });
        }
        runExclusive(e) {
            return ooe(this, arguments, void 0, function*(n, r = 1, s = 0) {
                const [i, o] = yield this.acquire(r, s);
                try {
                    return yield n(i);
                } finally{
                    o();
                }
            });
        }
        waitForUnlock(e = 1, n = 0) {
            if (e <= 0) throw new Error(`invalid weight ${e}: must be positive`);
            return this._couldLockImmediately(e, n) ? Promise.resolve() : new Promise((r)=>{
                this._weightedWaiters[e - 1] || (this._weightedWaiters[e - 1] = []), coe(this._weightedWaiters[e - 1], {
                    resolve: r,
                    priority: n
                });
            });
        }
        isLocked() {
            return this._value <= 0;
        }
        getValue() {
            return this._value;
        }
        setValue(e) {
            this._value = e, this._dispatchQueue();
        }
        release(e = 1) {
            if (e <= 0) throw new Error(`invalid weight ${e}: must be positive`);
            this._value += e, this._dispatchQueue();
        }
        cancel() {
            this._queue.forEach((e)=>e.reject(this._cancelError)), this._queue = [];
        }
        _dispatchQueue() {
            for(this._drainUnlockWaiters(); this._queue.length > 0 && this._queue[0].weight <= this._value;)this._dispatchItem(this._queue.shift()), this._drainUnlockWaiters();
        }
        _dispatchItem(e) {
            const n = this._value;
            this._value -= e.weight, e.resolve([
                n,
                this._newReleaser(e.weight)
            ]);
        }
        _newReleaser(e) {
            let n = !1;
            return ()=>{
                n || (n = !0, this.release(e));
            };
        }
        _drainUnlockWaiters() {
            if (this._queue.length === 0) for(let e = this._value; e > 0; e--){
                const n = this._weightedWaiters[e - 1];
                n && (n.forEach((r)=>r.resolve()), this._weightedWaiters[e - 1] = []);
            }
            else {
                const e = this._queue[0].priority;
                for(let n = this._value; n > 0; n--){
                    const r = this._weightedWaiters[n - 1];
                    if (!r) continue;
                    const s = r.findIndex((i)=>i.priority <= e);
                    (s === -1 ? r : r.splice(0, s)).forEach(((i)=>i.resolve()));
                }
            }
        }
        _couldLockImmediately(e, n) {
            return (this._queue.length === 0 || this._queue[0].priority < n) && e <= this._value;
        }
    };
    function coe(t, e) {
        const n = gj(t, (r)=>e.priority <= r.priority);
        t.splice(n + 1, 0, e);
    }
    function gj(t, e) {
        for(let n = t.length - 1; n >= 0; n--)if (e(t[n])) return n;
        return -1;
    }
    var loe = function(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());
        });
    };
    class uoe {
        constructor(e){
            this._semaphore = new aoe(1, e);
        }
        acquire() {
            return loe(this, arguments, void 0, function*(e = 0) {
                const [, n] = yield this._semaphore.acquire(1, e);
                return n;
            });
        }
        runExclusive(e, n = 0) {
            return this._semaphore.runExclusive(()=>e(), 1, n);
        }
        isLocked() {
            return this._semaphore.isLocked();
        }
        waitForUnlock(e = 0) {
            return this._semaphore.waitForUnlock(1, e);
        }
        release() {
            this._semaphore.isLocked() && this._semaphore.release();
        }
        cancel() {
            return this._semaphore.cancel();
        }
    }
    var ER = Object.prototype.hasOwnProperty;
    function A6(t, e) {
        var n, r;
        if (t === e) return !0;
        if (t && e && (n = t.constructor) === e.constructor) {
            if (n === Date) return t.getTime() === e.getTime();
            if (n === RegExp) return t.toString() === e.toString();
            if (n === Array) {
                if ((r = t.length) === e.length) for(; r-- && A6(t[r], e[r]););
                return r === -1;
            }
            if (!n || typeof t == "object") {
                r = 0;
                for(n in t)if (ER.call(t, n) && ++r && !ER.call(e, n) || !(n in e) || !A6(t[n], e[n])) return !1;
                return Object.keys(e).length === r;
            }
        }
        return t !== t && e !== e;
    }
    const cn = doe();
    function doe() {
        const t = {
            local: Kw("local"),
            session: Kw("session"),
            sync: Kw("sync"),
            managed: Kw("managed")
        }, e = (h)=>{
            const b = t[h];
            if (b == null) {
                const y = Object.keys(t).join(", ");
                throw Error(`Invalid area "${h}". Options: ${y}`);
            }
            return b;
        }, n = (h)=>{
            const b = h.indexOf(":"), y = h.substring(0, b), _ = h.substring(b + 1);
            if (_ == null) throw Error(`Storage key should be in the form of "area:key", but received "${h}"`);
            return {
                driverArea: y,
                driverKey: _,
                driver: e(y)
            };
        }, r = (h)=>h + "$", s = (h, b)=>{
            const y = {
                ...h
            };
            return Object.entries(b).forEach(([_, v])=>{
                v == null ? delete y[_] : y[_] = v;
            }), y;
        }, i = (h, b)=>h ?? b ?? null, o = (h)=>typeof h == "object" && !Array.isArray(h) ? h : {}, a = async (h, b, y)=>i(await h.getItem(b), y?.fallback ?? y?.defaultValue), c = async (h, b)=>{
            const y = r(b);
            return o(await h.getItem(y));
        }, l = async (h, b, y)=>{
            await h.setItem(b, y ?? null);
        }, u = async (h, b, y)=>{
            const _ = r(b), v = o(await h.getItem(_));
            await h.setItem(_, s(v, y));
        }, d = async (h, b, y)=>{
            if (await h.removeItem(b), y?.removeMeta) {
                const _ = r(b);
                await h.removeItem(_);
            }
        }, f = async (h, b, y)=>{
            const _ = r(b);
            if (y == null) await h.removeItem(_);
            else {
                const v = o(await h.getItem(_));
                [
                    y
                ].flat().forEach((w)=>delete v[w]), await h.setItem(_, v);
            }
        }, p = (h, b, y)=>h.watch(b, y);
        return {
            getItem: async (h, b)=>{
                const { driver: y, driverKey: _ } = n(h);
                return await a(y, _, b);
            },
            getItems: async (h)=>{
                const b = new Map, y = new Map, _ = [];
                h.forEach((w)=>{
                    let E, I;
                    typeof w == "string" ? E = w : "getValue" in w ? (E = w.key, I = {
                        fallback: w.fallback
                    }) : (E = w.key, I = w.options), _.push(E);
                    const { driverArea: D, driverKey: U } = n(E), K = b.get(D) ?? [];
                    b.set(D, K.concat(U)), y.set(E, I);
                });
                const v = new Map;
                return await Promise.all(Array.from(b.entries()).map(async ([w, E])=>{
                    (await t[w].getItems(E)).forEach((I)=>{
                        const D = `${w}:${I.key}`, U = y.get(D), K = i(I.value, U?.fallback ?? U?.defaultValue);
                        v.set(D, K);
                    });
                })), _.map((w)=>({
                        key: w,
                        value: v.get(w)
                    }));
            },
            getMeta: async (h)=>{
                const { driver: b, driverKey: y } = n(h);
                return await c(b, y);
            },
            getMetas: async (h)=>{
                const b = h.map((v)=>{
                    const w = typeof v == "string" ? v : v.key, { driverArea: E, driverKey: I } = n(w);
                    return {
                        key: w,
                        driverArea: E,
                        driverKey: I,
                        driverMetaKey: r(I)
                    };
                }), y = b.reduce((v, w)=>(v[w.driverArea] ??= [], v[w.driverArea].push(w), v), {}), _ = {};
                return await Promise.all(Object.entries(y).map(async ([v, w])=>{
                    const E = await V_.storage[v].get(w.map((I)=>I.driverMetaKey));
                    w.forEach((I)=>{
                        _[I.key] = E[I.driverMetaKey] ?? {};
                    });
                })), b.map((v)=>({
                        key: v.key,
                        meta: _[v.key]
                    }));
            },
            setItem: async (h, b)=>{
                const { driver: y, driverKey: _ } = n(h);
                await l(y, _, b);
            },
            setItems: async (h)=>{
                const b = {};
                h.forEach((y)=>{
                    const { driverArea: _, driverKey: v } = n("key" in y ? y.key : y.item.key);
                    b[_] ??= [], b[_].push({
                        key: v,
                        value: y.value
                    });
                }), await Promise.all(Object.entries(b).map(async ([y, _])=>{
                    await e(y).setItems(_);
                }));
            },
            setMeta: async (h, b)=>{
                const { driver: y, driverKey: _ } = n(h);
                await u(y, _, b);
            },
            setMetas: async (h)=>{
                const b = {};
                h.forEach((y)=>{
                    const { driverArea: _, driverKey: v } = n("key" in y ? y.key : y.item.key);
                    b[_] ??= [], b[_].push({
                        key: v,
                        properties: y.meta
                    });
                }), await Promise.all(Object.entries(b).map(async ([y, _])=>{
                    const v = e(y), w = _.map(({ key: U })=>r(U)), E = await v.getItems(w), I = Object.fromEntries(E.map(({ key: U, value: K })=>[
                            U,
                            o(K)
                        ])), D = _.map(({ key: U, properties: K })=>{
                        const $ = r(U);
                        return {
                            key: $,
                            value: s(I[$] ?? {}, K)
                        };
                    });
                    await v.setItems(D);
                }));
            },
            removeItem: async (h, b)=>{
                const { driver: y, driverKey: _ } = n(h);
                await d(y, _, b);
            },
            removeItems: async (h)=>{
                const b = {};
                h.forEach((y)=>{
                    let _, v;
                    typeof y == "string" ? _ = y : "getValue" in y ? _ = y.key : "item" in y ? (_ = y.item.key, v = y.options) : (_ = y.key, v = y.options);
                    const { driverArea: w, driverKey: E } = n(_);
                    b[w] ??= [], b[w].push(E), v?.removeMeta && b[w].push(r(E));
                }), await Promise.all(Object.entries(b).map(async ([y, _])=>{
                    await e(y).removeItems(_);
                }));
            },
            clear: async (h)=>{
                await e(h).clear();
            },
            removeMeta: async (h, b)=>{
                const { driver: y, driverKey: _ } = n(h);
                await f(y, _, b);
            },
            snapshot: async (h, b)=>{
                const y = await e(h).snapshot();
                return b?.excludeKeys?.forEach((_)=>{
                    delete y[_], delete y[r(_)];
                }), y;
            },
            restoreSnapshot: async (h, b)=>{
                await e(h).restoreSnapshot(b);
            },
            watch: (h, b)=>{
                const { driver: y, driverKey: _ } = n(h);
                return p(y, _, b);
            },
            unwatch () {
                Object.values(t).forEach((h)=>{
                    h.unwatch();
                });
            },
            defineItem: (h, b)=>{
                const { driver: y, driverKey: _ } = n(h), { version: v = 1, migrations: w = {}, onMigrationComplete: E, debug: I = !1 } = b ?? {};
                if (v < 1) throw Error("Storage item version cannot be less than 1. Initial versions should be set to 1, not 0.");
                let D = !1;
                const U = async ()=>{
                    const J = r(_), [{ value: C }, { value: g }] = await y.getItems([
                        _,
                        J
                    ]);
                    if (D = C == null && g?.v == null && !!v, C == null) return;
                    const x = g?.v ?? 1;
                    if (x > v) throw Error(`Version downgrade detected (v${x} -> v${v}) for "${h}"`);
                    if (x === v) return;
                    I && console.debug(`[@wxt-dev/storage] Running storage migration for ${h}: v${x} -> v${v}`);
                    const A = Array.from({
                        length: v - x
                    }, (N, L)=>x + L + 1);
                    let R = C;
                    for (const N of A)try {
                        R = await w?.[N]?.(R) ?? R, I && console.debug(`[@wxt-dev/storage] Storage migration processed for version: v${N}`);
                    } catch (L) {
                        throw new foe(h, N, {
                            cause: L
                        });
                    }
                    await y.setItems([
                        {
                            key: _,
                            value: R
                        },
                        {
                            key: J,
                            value: {
                                ...g,
                                v
                            }
                        }
                    ]), I && console.debug(`[@wxt-dev/storage] Storage migration completed for ${h} v${v}`, {
                        migratedValue: R
                    }), E?.(R, v);
                }, K = b?.migrations == null ? Promise.resolve() : U().catch((J)=>{
                    console.error(`[@wxt-dev/storage] Migration failed for ${h}`, J);
                }), $ = new uoe, ne = ()=>b?.fallback ?? b?.defaultValue ?? null, te = ()=>$.runExclusive(async ()=>{
                        const J = await y.getItem(_);
                        if (J != null || b?.init == null) return J;
                        const C = await b.init();
                        return await y.setItem(_, C), J == null && v > 1 && await u(y, _, {
                            v
                        }), C;
                    });
                return K.then(te), {
                    key: h,
                    get defaultValue () {
                        return ne();
                    },
                    get fallback () {
                        return ne();
                    },
                    getValue: async ()=>(await K, b?.init ? await te() : await a(y, _, b)),
                    getMeta: async ()=>(await K, await c(y, _)),
                    setValue: async (J)=>{
                        await K, D ? (D = !1, await Promise.all([
                            l(y, _, J),
                            u(y, _, {
                                v
                            })
                        ])) : await l(y, _, J);
                    },
                    setMeta: async (J)=>(await K, await u(y, _, J)),
                    removeValue: async (J)=>(await K, await d(y, _, J)),
                    removeMeta: async (J)=>(await K, await f(y, _, J)),
                    watch: (J)=>p(y, _, (C, g)=>J(C ?? ne(), g ?? ne())),
                    migrate: U
                };
            }
        };
    }
    function Kw(t) {
        const e = ()=>{
            if (V_.runtime == null) throw Error(`'wxt/storage' must be loaded in a web extension environment

 - If thrown during a build, see https://github.com/wxt-dev/wxt/issues/371
 - If thrown during tests, mock 'wxt/browser' correctly. See https://wxt.dev/guide/go-further/testing.html
`);
            if (V_.storage == null) throw Error("You must add the 'storage' permission to your manifest to use 'wxt/storage'");
            const r = V_.storage[t];
            if (r == null) throw Error(`"browser.storage.${t}" is undefined`);
            return r;
        }, n = new Set;
        return {
            getItem: async (r)=>(await e().get(r))[r],
            getItems: async (r)=>{
                const s = await e().get(r);
                return r.map((i)=>({
                        key: i,
                        value: s[i] ?? null
                    }));
            },
            setItem: async (r, s)=>{
                s == null ? await e().remove(r) : await e().set({
                    [r]: s
                });
            },
            setItems: async (r)=>{
                const s = r.reduce((i, { key: o, value: a })=>(i[o] = a, i), {});
                await e().set(s);
            },
            removeItem: async (r)=>{
                await e().remove(r);
            },
            removeItems: async (r)=>{
                await e().remove(r);
            },
            clear: async ()=>{
                await e().clear();
            },
            snapshot: async ()=>await e().get(),
            restoreSnapshot: async (r)=>{
                await e().set(r);
            },
            watch (r, s) {
                const i = (o)=>{
                    const a = o[r];
                    a == null || A6(a.newValue, a.oldValue) || s(a.newValue ?? null, a.oldValue ?? null);
                };
                return e().onChanged.addListener(i), n.add(i), ()=>{
                    e().onChanged.removeListener(i), n.delete(i);
                };
            },
            unwatch () {
                n.forEach((r)=>{
                    e().onChanged.removeListener(r);
                }), n.clear();
            }
        };
    }
    var foe = class extends Error {
        constructor(t, e, n){
            super(`v${e} migration failed for "${t}"`, n), this.key = t, this.version = e;
        }
    };
    let hoe, poe, bj, R2, CR, goe, boe, mj, moe, yoe, woe, ME, _oe, xoe, voe, Soe, yj, koe, Toe, P6, IR, Eoe, AR, Coe, Ioe, Aoe, Poe, Ooe, Moe, wj, Roe, Noe, bs, _j, xj, Voe, Boe, Doe, Foe, Loe, zoe, Pp, on, Nu, L9, sl, Uoe, Hoe, vj, joe, qoe, Koe, Woe, gt, gf, z9, PR, $oe, Ww, bt, Rb, Xoe, OR, Goe, Zoe, $w, Og, Mg, Sj, kj, Tj, Ej, Joe, Yoe, Cj, Qoe, eae, tae;
    hoe = (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;
    };
    poe = (t, e)=>({
            classGroupId: t,
            validator: e
        });
    bj = (t = new Map, e = null, n)=>({
            nextPart: t,
            validators: e,
            classGroupId: n
        });
    R2 = "-";
    CR = [];
    goe = "arbitrary..";
    boe = (t)=>{
        const e = yoe(t), { conflictingClassGroups: n, conflictingClassGroupModifiers: r } = t;
        return {
            getClassGroupId: (o)=>{
                if (o.startsWith("[") && o.endsWith("]")) return moe(o);
                const a = o.split(R2), c = a[0] === "" && a.length > 1 ? 1 : 0;
                return mj(a, c, e);
            },
            getConflictingClassGroupIds: (o, a)=>{
                if (a) {
                    const c = r[o], l = n[o];
                    return c ? l ? hoe(l, c) : c : l || CR;
                }
                return n[o] || CR;
            }
        };
    };
    mj = (t, e, n)=>{
        if (t.length - e === 0) return n.classGroupId;
        const s = t[e], i = n.nextPart.get(s);
        if (i) {
            const l = mj(t, e + 1, i);
            if (l) return l;
        }
        const o = n.validators;
        if (o === null) return;
        const a = e === 0 ? t.join(R2) : t.slice(e).join(R2), c = o.length;
        for(let l = 0; l < c; l++){
            const u = o[l];
            if (u.validator(a)) return u.classGroupId;
        }
    };
    moe = (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 ? goe + r : void 0;
        })();
    yoe = (t)=>{
        const { theme: e, classGroups: n } = t;
        return woe(n, e);
    };
    woe = (t, e)=>{
        const n = bj();
        for(const r in t){
            const s = t[r];
            ME(s, n, r, e);
        }
        return n;
    };
    ME = (t, e, n, r)=>{
        const s = t.length;
        for(let i = 0; i < s; i++){
            const o = t[i];
            _oe(o, e, n, r);
        }
    };
    _oe = (t, e, n, r)=>{
        if (typeof t == "string") {
            xoe(t, e, n);
            return;
        }
        if (typeof t == "function") {
            voe(t, e, n, r);
            return;
        }
        Soe(t, e, n, r);
    };
    xoe = (t, e, n)=>{
        const r = t === "" ? e : yj(e, t);
        r.classGroupId = n;
    };
    voe = (t, e, n, r)=>{
        if (koe(t)) {
            ME(t(r), e, n, r);
            return;
        }
        e.validators === null && (e.validators = []), e.validators.push(poe(n, t));
    };
    Soe = (t, e, n, r)=>{
        const s = Object.entries(t), i = s.length;
        for(let o = 0; o < i; o++){
            const [a, c] = s[o];
            ME(c, yj(e, a), n, r);
        }
    };
    yj = (t, e)=>{
        let n = t;
        const r = e.split(R2), s = r.length;
        for(let i = 0; i < s; i++){
            const o = r[i];
            let a = n.nextPart.get(o);
            a || (a = bj(), n.nextPart.set(o, a)), n = a;
        }
        return n;
    };
    koe = (t)=>"isThemeGetter" in t && t.isThemeGetter === !0;
    Toe = (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);
            }
        };
    };
    P6 = "!";
    IR = ":";
    Eoe = [];
    AR = (t, e, n, r, s)=>({
            modifiers: t,
            hasImportantModifier: e,
            baseClassName: n,
            maybePostfixModifierPosition: r,
            isExternal: s
        });
    Coe = (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 b = 0; b < u; b++){
                const y = s[b];
                if (o === 0 && a === 0) {
                    if (y === IR) {
                        i.push(s.slice(c, b)), c = b + 1;
                        continue;
                    }
                    if (y === "/") {
                        l = b;
                        continue;
                    }
                }
                y === "[" ? o++ : y === "]" ? o-- : y === "(" ? a++ : y === ")" && a--;
            }
            const d = i.length === 0 ? s : s.slice(c);
            let f = d, p = !1;
            d.endsWith(P6) ? (f = d.slice(0, -1), p = !0) : d.startsWith(P6) && (f = d.slice(1), p = !0);
            const h = l && l > c ? l - c : void 0;
            return AR(i, p, f, h);
        };
        if (e) {
            const s = e + IR, i = r;
            r = (o)=>o.startsWith(s) ? i(o.slice(s.length)) : AR(Eoe, !1, o, void 0, !0);
        }
        if (n) {
            const s = r;
            r = (i)=>n({
                    className: i,
                    parseClassName: s
                });
        }
        return r;
    };
    Ioe = (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;
        };
    };
    Aoe = (t)=>({
            cache: Toe(t.cacheSize),
            parseClassName: Coe(t),
            sortModifiers: Ioe(t),
            ...boe(t)
        });
    Poe = /\s+/;
    Ooe = (t, e)=>{
        const { parseClassName: n, getClassGroupId: r, getConflictingClassGroupIds: s, sortModifiers: i } = e, o = [], a = t.trim().split(Poe);
        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: b } = n(u);
            if (d) {
                c = u + (c.length > 0 ? " " + c : c);
                continue;
            }
            let y = !!b, _ = r(y ? h.substring(0, b) : h);
            if (!_) {
                if (!y) {
                    c = u + (c.length > 0 ? " " + c : c);
                    continue;
                }
                if (_ = r(h), !_) {
                    c = u + (c.length > 0 ? " " + c : c);
                    continue;
                }
                y = !1;
            }
            const v = f.length === 0 ? "" : f.length === 1 ? f[0] : i(f).join(":"), w = p ? v + P6 : v, E = w + _;
            if (o.indexOf(E) > -1) continue;
            o.push(E);
            const I = s(_, y);
            for(let D = 0; D < I.length; ++D){
                const U = I[D];
                o.push(w + U);
            }
            c = u + (c.length > 0 ? " " + c : c);
        }
        return c;
    };
    Moe = (...t)=>{
        let e = 0, n, r, s = "";
        for(; e < t.length;)(n = t[e++]) && (r = wj(n)) && (s && (s += " "), s += r);
        return s;
    };
    wj = (t)=>{
        if (typeof t == "string") return t;
        let e, n = "";
        for(let r = 0; r < t.length; r++)t[r] && (e = wj(t[r])) && (n && (n += " "), n += e);
        return n;
    };
    Roe = (t, ...e)=>{
        let n, r, s, i;
        const o = (c)=>{
            const l = e.reduce((u, d)=>d(u), t());
            return n = Aoe(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 = Ooe(c, n);
            return s(c, u), u;
        };
        return i = o, (...c)=>i(Moe(...c));
    };
    Noe = [];
    bs = (t)=>{
        const e = (n)=>n[t] || Noe;
        return e.isThemeGetter = !0, e;
    };
    _j = /^\[(?:(\w[\w-]*):)?(.+)\]$/i;
    xj = /^\((?:(\w[\w-]*):)?(.+)\)$/i;
    Voe = /^\d+\/\d+$/;
    Boe = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/;
    Doe = /\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$/;
    Foe = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/;
    Loe = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/;
    zoe = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;
    Pp = (t)=>Voe.test(t);
    on = (t)=>!!t && !Number.isNaN(Number(t));
    Nu = (t)=>!!t && Number.isInteger(Number(t));
    L9 = (t)=>t.endsWith("%") && on(t.slice(0, -1));
    sl = (t)=>Boe.test(t);
    Uoe = ()=>!0;
    Hoe = (t)=>Doe.test(t) && !Foe.test(t);
    vj = ()=>!1;
    joe = (t)=>Loe.test(t);
    qoe = (t)=>zoe.test(t);
    Koe = (t)=>!gt(t) && !bt(t);
    Woe = (t)=>Og(t, Tj, vj);
    gt = (t)=>_j.test(t);
    gf = (t)=>Og(t, Ej, Hoe);
    z9 = (t)=>Og(t, Joe, on);
    PR = (t)=>Og(t, Sj, vj);
    $oe = (t)=>Og(t, kj, qoe);
    Ww = (t)=>Og(t, Cj, joe);
    bt = (t)=>xj.test(t);
    Rb = (t)=>Mg(t, Ej);
    Xoe = (t)=>Mg(t, Yoe);
    OR = (t)=>Mg(t, Sj);
    Goe = (t)=>Mg(t, Tj);
    Zoe = (t)=>Mg(t, kj);
    $w = (t)=>Mg(t, Cj, !0);
    Og = (t, e, n)=>{
        const r = _j.exec(t);
        return r ? r[1] ? e(r[1]) : n(r[2]) : !1;
    };
    Mg = (t, e, n = !1)=>{
        const r = xj.exec(t);
        return r ? r[1] ? e(r[1]) : n : !1;
    };
    Sj = (t)=>t === "position" || t === "percentage";
    kj = (t)=>t === "image" || t === "url";
    Tj = (t)=>t === "length" || t === "size" || t === "bg-size";
    Ej = (t)=>t === "length";
    Joe = (t)=>t === "number";
    Yoe = (t)=>t === "family-name";
    Cj = (t)=>t === "shadow";
    Qoe = ()=>{
        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"), b = bs("perspective"), y = bs("aspect"), _ = bs("ease"), v = bs("animate"), w = ()=>[
                "auto",
                "avoid",
                "all",
                "avoid-page",
                "page",
                "left",
                "right",
                "column"
            ], E = ()=>[
                "center",
                "top",
                "bottom",
                "left",
                "right",
                "top-left",
                "left-top",
                "top-right",
                "right-top",
                "bottom-right",
                "right-bottom",
                "bottom-left",
                "left-bottom"
            ], I = ()=>[
                ...E(),
                bt,
                gt
            ], D = ()=>[
                "auto",
                "hidden",
                "clip",
                "visible",
                "scroll"
            ], U = ()=>[
                "auto",
                "contain",
                "none"
            ], K = ()=>[
                bt,
                gt,
                c
            ], $ = ()=>[
                Pp,
                "full",
                "auto",
                ...K()
            ], ne = ()=>[
                Nu,
                "none",
                "subgrid",
                bt,
                gt
            ], te = ()=>[
                "auto",
                {
                    span: [
                        "full",
                        Nu,
                        bt,
                        gt
                    ]
                },
                Nu,
                bt,
                gt
            ], J = ()=>[
                Nu,
                "auto",
                bt,
                gt
            ], C = ()=>[
                "auto",
                "min",
                "max",
                "fr",
                bt,
                gt
            ], g = ()=>[
                "start",
                "end",
                "center",
                "between",
                "around",
                "evenly",
                "stretch",
                "baseline",
                "center-safe",
                "end-safe"
            ], x = ()=>[
                "start",
                "end",
                "center",
                "stretch",
                "center-safe",
                "end-safe"
            ], A = ()=>[
                "auto",
                ...K()
            ], R = ()=>[
                Pp,
                "auto",
                "full",
                "dvw",
                "dvh",
                "lvw",
                "lvh",
                "svw",
                "svh",
                "min",
                "max",
                "fit",
                ...K()
            ], N = ()=>[
                t,
                bt,
                gt
            ], L = ()=>[
                ...E(),
                OR,
                PR,
                {
                    position: [
                        bt,
                        gt
                    ]
                }
            ], z = ()=>[
                "no-repeat",
                {
                    repeat: [
                        "",
                        "x",
                        "y",
                        "space",
                        "round"
                    ]
                }
            ], B = ()=>[
                "auto",
                "cover",
                "contain",
                Goe,
                Woe,
                {
                    size: [
                        bt,
                        gt
                    ]
                }
            ], S = ()=>[
                L9,
                Rb,
                gf
            ], O = ()=>[
                "",
                "none",
                "full",
                l,
                bt,
                gt
            ], W = ()=>[
                "",
                on,
                Rb,
                gf
            ], F = ()=>[
                "solid",
                "dashed",
                "dotted",
                "double"
            ], G = ()=>[
                "normal",
                "multiply",
                "screen",
                "overlay",
                "darken",
                "lighten",
                "color-dodge",
                "color-burn",
                "hard-light",
                "soft-light",
                "difference",
                "exclusion",
                "hue",
                "saturation",
                "color",
                "luminosity"
            ], ee = ()=>[
                on,
                L9,
                OR,
                PR
            ], Q = ()=>[
                "",
                "none",
                h,
                bt,
                gt
            ], Y = ()=>[
                "none",
                on,
                bt,
                gt
            ], ae = ()=>[
                "none",
                on,
                bt,
                gt
            ], de = ()=>[
                on,
                bt,
                gt
            ], pe = ()=>[
                Pp,
                "full",
                ...K()
            ];
        return {
            cacheSize: 500,
            theme: {
                animate: [
                    "spin",
                    "ping",
                    "pulse",
                    "bounce"
                ],
                aspect: [
                    "video"
                ],
                blur: [
                    sl
                ],
                breakpoint: [
                    sl
                ],
                color: [
                    Uoe
                ],
                container: [
                    sl
                ],
                "drop-shadow": [
                    sl
                ],
                ease: [
                    "in",
                    "out",
                    "in-out"
                ],
                font: [
                    Koe
                ],
                "font-weight": [
                    "thin",
                    "extralight",
                    "light",
                    "normal",
                    "medium",
                    "semibold",
                    "bold",
                    "extrabold",
                    "black"
                ],
                "inset-shadow": [
                    sl
                ],
                leading: [
                    "none",
                    "tight",
                    "snug",
                    "normal",
                    "relaxed",
                    "loose"
                ],
                perspective: [
                    "dramatic",
                    "near",
                    "normal",
                    "midrange",
                    "distant",
                    "none"
                ],
                radius: [
                    sl
                ],
                shadow: [
                    sl
                ],
                spacing: [
                    "px",
                    on
                ],
                text: [
                    sl
                ],
                "text-shadow": [
                    sl
                ],
                tracking: [
                    "tighter",
                    "tight",
                    "normal",
                    "wide",
                    "wider",
                    "widest"
                ]
            },
            classGroups: {
                aspect: [
                    {
                        aspect: [
                            "auto",
                            "square",
                            Pp,
                            gt,
                            bt,
                            y
                        ]
                    }
                ],
                container: [
                    "container"
                ],
                columns: [
                    {
                        columns: [
                            on,
                            gt,
                            bt,
                            a
                        ]
                    }
                ],
                "break-after": [
                    {
                        "break-after": w()
                    }
                ],
                "break-before": [
                    {
                        "break-before": w()
                    }
                ],
                "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: I()
                    }
                ],
                overflow: [
                    {
                        overflow: D()
                    }
                ],
                "overflow-x": [
                    {
                        "overflow-x": D()
                    }
                ],
                "overflow-y": [
                    {
                        "overflow-y": D()
                    }
                ],
                overscroll: [
                    {
                        overscroll: U()
                    }
                ],
                "overscroll-x": [
                    {
                        "overscroll-x": U()
                    }
                ],
                "overscroll-y": [
                    {
                        "overscroll-y": U()
                    }
                ],
                position: [
                    "static",
                    "fixed",
                    "absolute",
                    "relative",
                    "sticky"
                ],
                inset: [
                    {
                        inset: $()
                    }
                ],
                "inset-x": [
                    {
                        "inset-x": $()
                    }
                ],
                "inset-y": [
                    {
                        "inset-y": $()
                    }
                ],
                start: [
                    {
                        start: $()
                    }
                ],
                end: [
                    {
                        end: $()
                    }
                ],
                top: [
                    {
                        top: $()
                    }
                ],
                right: [
                    {
                        right: $()
                    }
                ],
                bottom: [
                    {
                        bottom: $()
                    }
                ],
                left: [
                    {
                        left: $()
                    }
                ],
                visibility: [
                    "visible",
                    "invisible",
                    "collapse"
                ],
                z: [
                    {
                        z: [
                            Nu,
                            "auto",
                            bt,
                            gt
                        ]
                    }
                ],
                basis: [
                    {
                        basis: [
                            Pp,
                            "full",
                            "auto",
                            a,
                            ...K()
                        ]
                    }
                ],
                "flex-direction": [
                    {
                        flex: [
                            "row",
                            "row-reverse",
                            "col",
                            "col-reverse"
                        ]
                    }
                ],
                "flex-wrap": [
                    {
                        flex: [
                            "nowrap",
                            "wrap",
                            "wrap-reverse"
                        ]
                    }
                ],
                flex: [
                    {
                        flex: [
                            on,
                            Pp,
                            "auto",
                            "initial",
                            "none",
                            gt
                        ]
                    }
                ],
                grow: [
                    {
                        grow: [
                            "",
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                shrink: [
                    {
                        shrink: [
                            "",
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                order: [
                    {
                        order: [
                            Nu,
                            "first",
                            "last",
                            "none",
                            bt,
                            gt
                        ]
                    }
                ],
                "grid-cols": [
                    {
                        "grid-cols": ne()
                    }
                ],
                "col-start-end": [
                    {
                        col: te()
                    }
                ],
                "col-start": [
                    {
                        "col-start": J()
                    }
                ],
                "col-end": [
                    {
                        "col-end": J()
                    }
                ],
                "grid-rows": [
                    {
                        "grid-rows": ne()
                    }
                ],
                "row-start-end": [
                    {
                        row: te()
                    }
                ],
                "row-start": [
                    {
                        "row-start": J()
                    }
                ],
                "row-end": [
                    {
                        "row-end": J()
                    }
                ],
                "grid-flow": [
                    {
                        "grid-flow": [
                            "row",
                            "col",
                            "dense",
                            "row-dense",
                            "col-dense"
                        ]
                    }
                ],
                "auto-cols": [
                    {
                        "auto-cols": C()
                    }
                ],
                "auto-rows": [
                    {
                        "auto-rows": C()
                    }
                ],
                gap: [
                    {
                        gap: K()
                    }
                ],
                "gap-x": [
                    {
                        "gap-x": K()
                    }
                ],
                "gap-y": [
                    {
                        "gap-y": K()
                    }
                ],
                "justify-content": [
                    {
                        justify: [
                            ...g(),
                            "normal"
                        ]
                    }
                ],
                "justify-items": [
                    {
                        "justify-items": [
                            ...x(),
                            "normal"
                        ]
                    }
                ],
                "justify-self": [
                    {
                        "justify-self": [
                            "auto",
                            ...x()
                        ]
                    }
                ],
                "align-content": [
                    {
                        content: [
                            "normal",
                            ...g()
                        ]
                    }
                ],
                "align-items": [
                    {
                        items: [
                            ...x(),
                            {
                                baseline: [
                                    "",
                                    "last"
                                ]
                            }
                        ]
                    }
                ],
                "align-self": [
                    {
                        self: [
                            "auto",
                            ...x(),
                            {
                                baseline: [
                                    "",
                                    "last"
                                ]
                            }
                        ]
                    }
                ],
                "place-content": [
                    {
                        "place-content": g()
                    }
                ],
                "place-items": [
                    {
                        "place-items": [
                            ...x(),
                            "baseline"
                        ]
                    }
                ],
                "place-self": [
                    {
                        "place-self": [
                            "auto",
                            ...x()
                        ]
                    }
                ],
                p: [
                    {
                        p: K()
                    }
                ],
                px: [
                    {
                        px: K()
                    }
                ],
                py: [
                    {
                        py: K()
                    }
                ],
                ps: [
                    {
                        ps: K()
                    }
                ],
                pe: [
                    {
                        pe: K()
                    }
                ],
                pt: [
                    {
                        pt: K()
                    }
                ],
                pr: [
                    {
                        pr: K()
                    }
                ],
                pb: [
                    {
                        pb: K()
                    }
                ],
                pl: [
                    {
                        pl: K()
                    }
                ],
                m: [
                    {
                        m: A()
                    }
                ],
                mx: [
                    {
                        mx: A()
                    }
                ],
                my: [
                    {
                        my: A()
                    }
                ],
                ms: [
                    {
                        ms: A()
                    }
                ],
                me: [
                    {
                        me: A()
                    }
                ],
                mt: [
                    {
                        mt: A()
                    }
                ],
                mr: [
                    {
                        mr: A()
                    }
                ],
                mb: [
                    {
                        mb: A()
                    }
                ],
                ml: [
                    {
                        ml: A()
                    }
                ],
                "space-x": [
                    {
                        "space-x": K()
                    }
                ],
                "space-x-reverse": [
                    "space-x-reverse"
                ],
                "space-y": [
                    {
                        "space-y": K()
                    }
                ],
                "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,
                            Rb,
                            gf
                        ]
                    }
                ],
                "font-smoothing": [
                    "antialiased",
                    "subpixel-antialiased"
                ],
                "font-style": [
                    "italic",
                    "not-italic"
                ],
                "font-weight": [
                    {
                        font: [
                            r,
                            bt,
                            z9
                        ]
                    }
                ],
                "font-stretch": [
                    {
                        "font-stretch": [
                            "ultra-condensed",
                            "extra-condensed",
                            "condensed",
                            "semi-condensed",
                            "normal",
                            "semi-expanded",
                            "expanded",
                            "extra-expanded",
                            "ultra-expanded",
                            L9,
                            gt
                        ]
                    }
                ],
                "font-family": [
                    {
                        font: [
                            Xoe,
                            gt,
                            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,
                            bt,
                            gt
                        ]
                    }
                ],
                "line-clamp": [
                    {
                        "line-clamp": [
                            on,
                            "none",
                            bt,
                            z9
                        ]
                    }
                ],
                leading: [
                    {
                        leading: [
                            i,
                            ...K()
                        ]
                    }
                ],
                "list-image": [
                    {
                        "list-image": [
                            "none",
                            bt,
                            gt
                        ]
                    }
                ],
                "list-style-position": [
                    {
                        list: [
                            "inside",
                            "outside"
                        ]
                    }
                ],
                "list-style-type": [
                    {
                        list: [
                            "disc",
                            "decimal",
                            "none",
                            bt,
                            gt
                        ]
                    }
                ],
                "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: [
                            ...F(),
                            "wavy"
                        ]
                    }
                ],
                "text-decoration-thickness": [
                    {
                        decoration: [
                            on,
                            "from-font",
                            "auto",
                            bt,
                            gf
                        ]
                    }
                ],
                "text-decoration-color": [
                    {
                        decoration: N()
                    }
                ],
                "underline-offset": [
                    {
                        "underline-offset": [
                            on,
                            "auto",
                            bt,
                            gt
                        ]
                    }
                ],
                "text-transform": [
                    "uppercase",
                    "lowercase",
                    "capitalize",
                    "normal-case"
                ],
                "text-overflow": [
                    "truncate",
                    "text-ellipsis",
                    "text-clip"
                ],
                "text-wrap": [
                    {
                        text: [
                            "wrap",
                            "nowrap",
                            "balance",
                            "pretty"
                        ]
                    }
                ],
                indent: [
                    {
                        indent: K()
                    }
                ],
                "vertical-align": [
                    {
                        align: [
                            "baseline",
                            "top",
                            "middle",
                            "bottom",
                            "text-top",
                            "text-bottom",
                            "sub",
                            "super",
                            bt,
                            gt
                        ]
                    }
                ],
                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",
                            bt,
                            gt
                        ]
                    }
                ],
                "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"
                                        ]
                                    },
                                    Nu,
                                    bt,
                                    gt
                                ],
                                radial: [
                                    "",
                                    bt,
                                    gt
                                ],
                                conic: [
                                    Nu,
                                    bt,
                                    gt
                                ]
                            },
                            Zoe,
                            $oe
                        ]
                    }
                ],
                "bg-color": [
                    {
                        bg: N()
                    }
                ],
                "gradient-from-pos": [
                    {
                        from: S()
                    }
                ],
                "gradient-via-pos": [
                    {
                        via: S()
                    }
                ],
                "gradient-to-pos": [
                    {
                        to: S()
                    }
                ],
                "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: W()
                    }
                ],
                "border-w-x": [
                    {
                        "border-x": W()
                    }
                ],
                "border-w-y": [
                    {
                        "border-y": W()
                    }
                ],
                "border-w-s": [
                    {
                        "border-s": W()
                    }
                ],
                "border-w-e": [
                    {
                        "border-e": W()
                    }
                ],
                "border-w-t": [
                    {
                        "border-t": W()
                    }
                ],
                "border-w-r": [
                    {
                        "border-r": W()
                    }
                ],
                "border-w-b": [
                    {
                        "border-b": W()
                    }
                ],
                "border-w-l": [
                    {
                        "border-l": W()
                    }
                ],
                "divide-x": [
                    {
                        "divide-x": W()
                    }
                ],
                "divide-x-reverse": [
                    "divide-x-reverse"
                ],
                "divide-y": [
                    {
                        "divide-y": W()
                    }
                ],
                "divide-y-reverse": [
                    "divide-y-reverse"
                ],
                "border-style": [
                    {
                        border: [
                            ...F(),
                            "hidden",
                            "none"
                        ]
                    }
                ],
                "divide-style": [
                    {
                        divide: [
                            ...F(),
                            "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: [
                            ...F(),
                            "none",
                            "hidden"
                        ]
                    }
                ],
                "outline-offset": [
                    {
                        "outline-offset": [
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                "outline-w": [
                    {
                        outline: [
                            "",
                            on,
                            Rb,
                            gf
                        ]
                    }
                ],
                "outline-color": [
                    {
                        outline: N()
                    }
                ],
                shadow: [
                    {
                        shadow: [
                            "",
                            "none",
                            u,
                            $w,
                            Ww
                        ]
                    }
                ],
                "shadow-color": [
                    {
                        shadow: N()
                    }
                ],
                "inset-shadow": [
                    {
                        "inset-shadow": [
                            "none",
                            d,
                            $w,
                            Ww
                        ]
                    }
                ],
                "inset-shadow-color": [
                    {
                        "inset-shadow": N()
                    }
                ],
                "ring-w": [
                    {
                        ring: W()
                    }
                ],
                "ring-w-inset": [
                    "ring-inset"
                ],
                "ring-color": [
                    {
                        ring: N()
                    }
                ],
                "ring-offset-w": [
                    {
                        "ring-offset": [
                            on,
                            gf
                        ]
                    }
                ],
                "ring-offset-color": [
                    {
                        "ring-offset": N()
                    }
                ],
                "inset-ring-w": [
                    {
                        "inset-ring": W()
                    }
                ],
                "inset-ring-color": [
                    {
                        "inset-ring": N()
                    }
                ],
                "text-shadow": [
                    {
                        "text-shadow": [
                            "none",
                            f,
                            $w,
                            Ww
                        ]
                    }
                ],
                "text-shadow-color": [
                    {
                        "text-shadow": N()
                    }
                ],
                opacity: [
                    {
                        opacity: [
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                "mix-blend": [
                    {
                        "mix-blend": [
                            ...G(),
                            "plus-darker",
                            "plus-lighter"
                        ]
                    }
                ],
                "bg-blend": [
                    {
                        "bg-blend": G()
                    }
                ],
                "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": [
                            on
                        ]
                    }
                ],
                "mask-image-linear-from-pos": [
                    {
                        "mask-linear-from": ee()
                    }
                ],
                "mask-image-linear-to-pos": [
                    {
                        "mask-linear-to": ee()
                    }
                ],
                "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": ee()
                    }
                ],
                "mask-image-t-to-pos": [
                    {
                        "mask-t-to": ee()
                    }
                ],
                "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": ee()
                    }
                ],
                "mask-image-r-to-pos": [
                    {
                        "mask-r-to": ee()
                    }
                ],
                "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": ee()
                    }
                ],
                "mask-image-b-to-pos": [
                    {
                        "mask-b-to": ee()
                    }
                ],
                "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": ee()
                    }
                ],
                "mask-image-l-to-pos": [
                    {
                        "mask-l-to": ee()
                    }
                ],
                "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": ee()
                    }
                ],
                "mask-image-x-to-pos": [
                    {
                        "mask-x-to": ee()
                    }
                ],
                "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": ee()
                    }
                ],
                "mask-image-y-to-pos": [
                    {
                        "mask-y-to": ee()
                    }
                ],
                "mask-image-y-from-color": [
                    {
                        "mask-y-from": N()
                    }
                ],
                "mask-image-y-to-color": [
                    {
                        "mask-y-to": N()
                    }
                ],
                "mask-image-radial": [
                    {
                        "mask-radial": [
                            bt,
                            gt
                        ]
                    }
                ],
                "mask-image-radial-from-pos": [
                    {
                        "mask-radial-from": ee()
                    }
                ],
                "mask-image-radial-to-pos": [
                    {
                        "mask-radial-to": ee()
                    }
                ],
                "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": E()
                    }
                ],
                "mask-image-conic-pos": [
                    {
                        "mask-conic": [
                            on
                        ]
                    }
                ],
                "mask-image-conic-from-pos": [
                    {
                        "mask-conic-from": ee()
                    }
                ],
                "mask-image-conic-to-pos": [
                    {
                        "mask-conic-to": ee()
                    }
                ],
                "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",
                            bt,
                            gt
                        ]
                    }
                ],
                filter: [
                    {
                        filter: [
                            "",
                            "none",
                            bt,
                            gt
                        ]
                    }
                ],
                blur: [
                    {
                        blur: Q()
                    }
                ],
                brightness: [
                    {
                        brightness: [
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                contrast: [
                    {
                        contrast: [
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                "drop-shadow": [
                    {
                        "drop-shadow": [
                            "",
                            "none",
                            p,
                            $w,
                            Ww
                        ]
                    }
                ],
                "drop-shadow-color": [
                    {
                        "drop-shadow": N()
                    }
                ],
                grayscale: [
                    {
                        grayscale: [
                            "",
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                "hue-rotate": [
                    {
                        "hue-rotate": [
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                invert: [
                    {
                        invert: [
                            "",
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                saturate: [
                    {
                        saturate: [
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                sepia: [
                    {
                        sepia: [
                            "",
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                "backdrop-filter": [
                    {
                        "backdrop-filter": [
                            "",
                            "none",
                            bt,
                            gt
                        ]
                    }
                ],
                "backdrop-blur": [
                    {
                        "backdrop-blur": Q()
                    }
                ],
                "backdrop-brightness": [
                    {
                        "backdrop-brightness": [
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                "backdrop-contrast": [
                    {
                        "backdrop-contrast": [
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                "backdrop-grayscale": [
                    {
                        "backdrop-grayscale": [
                            "",
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                "backdrop-hue-rotate": [
                    {
                        "backdrop-hue-rotate": [
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                "backdrop-invert": [
                    {
                        "backdrop-invert": [
                            "",
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                "backdrop-opacity": [
                    {
                        "backdrop-opacity": [
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                "backdrop-saturate": [
                    {
                        "backdrop-saturate": [
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                "backdrop-sepia": [
                    {
                        "backdrop-sepia": [
                            "",
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                "border-collapse": [
                    {
                        border: [
                            "collapse",
                            "separate"
                        ]
                    }
                ],
                "border-spacing": [
                    {
                        "border-spacing": K()
                    }
                ],
                "border-spacing-x": [
                    {
                        "border-spacing-x": K()
                    }
                ],
                "border-spacing-y": [
                    {
                        "border-spacing-y": K()
                    }
                ],
                "table-layout": [
                    {
                        table: [
                            "auto",
                            "fixed"
                        ]
                    }
                ],
                caption: [
                    {
                        caption: [
                            "top",
                            "bottom"
                        ]
                    }
                ],
                transition: [
                    {
                        transition: [
                            "",
                            "all",
                            "colors",
                            "opacity",
                            "shadow",
                            "transform",
                            "none",
                            bt,
                            gt
                        ]
                    }
                ],
                "transition-behavior": [
                    {
                        transition: [
                            "normal",
                            "discrete"
                        ]
                    }
                ],
                duration: [
                    {
                        duration: [
                            on,
                            "initial",
                            bt,
                            gt
                        ]
                    }
                ],
                ease: [
                    {
                        ease: [
                            "linear",
                            "initial",
                            _,
                            bt,
                            gt
                        ]
                    }
                ],
                delay: [
                    {
                        delay: [
                            on,
                            bt,
                            gt
                        ]
                    }
                ],
                animate: [
                    {
                        animate: [
                            "none",
                            v,
                            bt,
                            gt
                        ]
                    }
                ],
                backface: [
                    {
                        backface: [
                            "hidden",
                            "visible"
                        ]
                    }
                ],
                perspective: [
                    {
                        perspective: [
                            b,
                            bt,
                            gt
                        ]
                    }
                ],
                "perspective-origin": [
                    {
                        "perspective-origin": I()
                    }
                ],
                rotate: [
                    {
                        rotate: Y()
                    }
                ],
                "rotate-x": [
                    {
                        "rotate-x": Y()
                    }
                ],
                "rotate-y": [
                    {
                        "rotate-y": Y()
                    }
                ],
                "rotate-z": [
                    {
                        "rotate-z": Y()
                    }
                ],
                scale: [
                    {
                        scale: ae()
                    }
                ],
                "scale-x": [
                    {
                        "scale-x": ae()
                    }
                ],
                "scale-y": [
                    {
                        "scale-y": ae()
                    }
                ],
                "scale-z": [
                    {
                        "scale-z": ae()
                    }
                ],
                "scale-3d": [
                    "scale-3d"
                ],
                skew: [
                    {
                        skew: de()
                    }
                ],
                "skew-x": [
                    {
                        "skew-x": de()
                    }
                ],
                "skew-y": [
                    {
                        "skew-y": de()
                    }
                ],
                transform: [
                    {
                        transform: [
                            bt,
                            gt,
                            "",
                            "none",
                            "gpu",
                            "cpu"
                        ]
                    }
                ],
                "transform-origin": [
                    {
                        origin: I()
                    }
                ],
                "transform-style": [
                    {
                        transform: [
                            "3d",
                            "flat"
                        ]
                    }
                ],
                translate: [
                    {
                        translate: pe()
                    }
                ],
                "translate-x": [
                    {
                        "translate-x": pe()
                    }
                ],
                "translate-y": [
                    {
                        "translate-y": pe()
                    }
                ],
                "translate-z": [
                    {
                        "translate-z": pe()
                    }
                ],
                "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",
                            bt,
                            gt
                        ]
                    }
                ],
                "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": K()
                    }
                ],
                "scroll-mx": [
                    {
                        "scroll-mx": K()
                    }
                ],
                "scroll-my": [
                    {
                        "scroll-my": K()
                    }
                ],
                "scroll-ms": [
                    {
                        "scroll-ms": K()
                    }
                ],
                "scroll-me": [
                    {
                        "scroll-me": K()
                    }
                ],
                "scroll-mt": [
                    {
                        "scroll-mt": K()
                    }
                ],
                "scroll-mr": [
                    {
                        "scroll-mr": K()
                    }
                ],
                "scroll-mb": [
                    {
                        "scroll-mb": K()
                    }
                ],
                "scroll-ml": [
                    {
                        "scroll-ml": K()
                    }
                ],
                "scroll-p": [
                    {
                        "scroll-p": K()
                    }
                ],
                "scroll-px": [
                    {
                        "scroll-px": K()
                    }
                ],
                "scroll-py": [
                    {
                        "scroll-py": K()
                    }
                ],
                "scroll-ps": [
                    {
                        "scroll-ps": K()
                    }
                ],
                "scroll-pe": [
                    {
                        "scroll-pe": K()
                    }
                ],
                "scroll-pt": [
                    {
                        "scroll-pt": K()
                    }
                ],
                "scroll-pr": [
                    {
                        "scroll-pr": K()
                    }
                ],
                "scroll-pb": [
                    {
                        "scroll-pb": K()
                    }
                ],
                "scroll-pl": [
                    {
                        "scroll-pl": K()
                    }
                ],
                "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",
                            bt,
                            gt
                        ]
                    }
                ],
                fill: [
                    {
                        fill: [
                            "none",
                            ...N()
                        ]
                    }
                ],
                "stroke-w": [
                    {
                        stroke: [
                            on,
                            Rb,
                            gf,
                            z9
                        ]
                    }
                ],
                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"
            ]
        };
    };
    eae = Roe(Qoe);
    tae = "/assets/midnight_ledger_wasm_bg-fHO7eNd8.wasm";
    Ij = async (t = {}, e)=>{
        let n;
        if (e.startsWith("data:")) {
            const r = e.replace(/^data:.*?base64,/, "");
            let s;
            if (typeof Buffer == "function" && typeof Buffer.from == "function") s = Buffer.from(r, "base64");
            else if (typeof atob == "function") {
                const i = atob(r);
                s = new Uint8Array(i.length);
                for(let o = 0; o < i.length; o++)s[o] = i.charCodeAt(o);
            } else throw new Error("Cannot decode base64-encoded data URL");
            n = await WebAssembly.instantiate(s, t);
        } else {
            const r = await fetch(e), s = r.headers.get("Content-Type") || "";
            if ("instantiateStreaming" in WebAssembly && s.startsWith("application/wasm")) n = await WebAssembly.instantiateStreaming(r, t);
            else {
                const i = await r.arrayBuffer();
                n = await WebAssembly.instantiate(i, t);
            }
        }
        return n.instance.exports;
    };
    function nae() {
        return N2;
    }
    function rae() {
        return go;
    }
    let m;
    function sae(t) {
        m = t;
    }
    function mr(t) {
        const e = m.__externref_table_alloc();
        return m.__wbindgen_export_2.set(e, t), e;
    }
    function li(t, e) {
        try {
            return t.apply(this, e);
        } catch (n) {
            const r = mr(n);
            m.__wbindgen_exn_store(r);
        }
    }
    let Xw = null;
    function Cm() {
        return (Xw === null || Xw.byteLength === 0) && (Xw = new Uint8Array(m.memory.buffer)), Xw;
    }
    let B_ = new TextDecoder("utf-8", {
        ignoreBOM: !0,
        fatal: !0
    });
    B_.decode();
    const iae = 2146435072;
    let U9 = 0;
    function oae(t, e) {
        return U9 += e, U9 >= iae && (B_ = new TextDecoder("utf-8", {
            ignoreBOM: !0,
            fatal: !0
        }), B_.decode(), U9 = e), B_.decode(Cm().subarray(t, t + e));
    }
    function Be(t, e) {
        return t = t >>> 0, oae(t, e);
    }
    let We = 0;
    const Im = new TextEncoder;
    "encodeInto" in Im || (Im.encodeInto = function(t, e) {
        const n = Im.encode(t);
        return e.set(n), {
            read: t.length,
            written: n.length
        };
    });
    function st(t, e, n) {
        if (n === void 0) {
            const a = Im.encode(t), c = e(a.length, 1) >>> 0;
            return Cm().subarray(c, c + a.length).set(a), We = a.length, c;
        }
        let r = t.length, s = e(r, 1) >>> 0;
        const i = Cm();
        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 = Cm().subarray(s + o, s + r), c = Im.encodeInto(t, a);
            o += c.written, s = n(s, r, o, 1) >>> 0;
        }
        return We = o, s;
    }
    let Op = null;
    function ia() {
        return (Op === null || Op.buffer.detached === !0 || Op.buffer.detached === void 0 && Op.buffer !== m.memory.buffer) && (Op = new DataView(m.memory.buffer)), Op;
    }
    function He(t) {
        return t == null;
    }
    function Iv(t, e) {
        return t = t >>> 0, Cm().subarray(t / 1, t / 1 + e);
    }
    function O6(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 += O6(t[0]));
            for(let o = 1; o < s; o++)i += ", " + O6(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 is(t, e) {
        t = t >>> 0;
        const n = ia(), r = [];
        for(let s = t; s < t + 4 * e; s += 4)r.push(m.__wbindgen_export_2.get(n.getUint32(s, !0)));
        return m.__externref_drop_slice(t, e), r;
    }
    const MR = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>{
        m.__wbindgen_export_7.get(t.dtor)(t.a, t.b);
    });
    function aae(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 ? (m.__wbindgen_export_7.get(s.dtor)(a, s.b), MR.unregister(s)) : s.a = a;
            }
        };
        return i.original = s, MR.register(i, s, s), i;
    }
    function ft(t, e) {
        if (!(t instanceof e)) throw new Error(`expected instance of ${e.name}`);
    }
    function q(t) {
        const e = m.__wbindgen_export_2.get(t);
        return m.__externref_table_dealloc(t), e;
    }
    function Jo(t, e) {
        const n = e(t.length * 4, 4) >>> 0;
        for(let r = 0; r < t.length; r++){
            const s = mr(t[r]);
            ia().setUint32(n + 4 * r, s, !0);
        }
        return We = t.length, n;
    }
    function cae(t, e) {
        let n, r;
        try {
            const o = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), a = We, c = m.coinCommitment(t, o, a);
            var s = c[0], i = c[1];
            if (c[3]) throw s = 0, i = 0, q(c[2]);
            return n = s, r = i, Be(s, i);
        } finally{
            m.__wbindgen_free(n, r, 1);
        }
    }
    function H9(t, e) {
        const n = st(t, m.__wbindgen_malloc, m.__wbindgen_realloc), r = We, s = m.createShieldedCoinInfo(n, r, e);
        if (s[2]) throw q(s[1]);
        return q(s[0]);
    }
    function lae(t, e) {
        let n, r;
        try {
            ft(e, x0);
            const o = m.coinNullifier(t, e.__wbg_ptr);
            var s = o[0], i = o[1];
            if (o[3]) throw s = 0, i = 0, q(o[2]);
            return n = s, r = i, Be(s, i);
        } finally{
            m.__wbindgen_free(n, r, 1);
        }
    }
    function Av() {
        const t = m.nativeToken();
        if (t[2]) throw q(t[1]);
        return q(t[0]);
    }
    function Aj(t) {
        let e, n;
        try {
            const i = st(t, m.__wbindgen_malloc, m.__wbindgen_realloc), o = We, a = m.addressFromKey(i, o);
            var r = a[0], s = a[1];
            if (a[3]) throw r = 0, s = 0, q(a[2]);
            return e = r, n = s, Be(r, s);
        } finally{
            m.__wbindgen_free(e, n, 1);
        }
    }
    function RE(t, e) {
        const n = m.createCheckPayload(t, He(e) ? 0 : mr(e));
        if (n[2]) throw q(n[1]);
        return q(n[0]);
    }
    function NE(t) {
        const e = m.parseCheckResult(t);
        if (e[2]) throw q(e[1]);
        return q(e[0]);
    }
    function VE(t, e, n) {
        const r = m.createProvingPayload(t, He(e) ? 0 : mr(e), n);
        if (r[2]) throw q(r[1]);
        return q(r[0]);
    }
    function RR(t, e, n, r, s) {
        const i = m.updatedValue(t, e, n, r, s);
        if (i[2]) throw q(i[1]);
        return q(i[0]);
    }
    function Pj(t) {
        let e, n;
        try {
            const i = st(t, m.__wbindgen_malloc, m.__wbindgen_realloc), o = We, a = m.signatureVerifyingKey(i, o);
            var r = a[0], s = a[1];
            if (a[3]) throw r = 0, s = 0, q(a[2]);
            return e = r, n = s, Be(r, s);
        } finally{
            m.__wbindgen_free(e, n, 1);
        }
    }
    function uae() {
        let t, e;
        try {
            const s = m.sampleSigningKey();
            var n = s[0], r = s[1];
            if (s[3]) throw n = 0, r = 0, q(s[2]);
            return t = n, e = r, Be(n, r);
        } finally{
            m.__wbindgen_free(t, e, 1);
        }
    }
    function Oj(t, e) {
        let n, r;
        try {
            const o = st(t, m.__wbindgen_malloc, m.__wbindgen_realloc), a = We, c = m.signData(o, a, e);
            var s = c[0], i = c[1];
            if (c[3]) throw s = 0, i = 0, q(c[2]);
            return n = s, r = i, Be(s, i);
        } finally{
            m.__wbindgen_free(n, r, 1);
        }
    }
    function dae(t, e, n) {
        m.closure3109_externref_shim(t, e, n);
    }
    function Mj(t, e, n, r) {
        m.closure3155_externref_shim(t, e, n, r);
    }
    function fae(t, e, n, r, s) {
        m.closure3158_externref_shim(t, e, n, r, s);
    }
    typeof FinalizationRegistry > "u" || new FinalizationRegistry((t)=>m.__wbg_authorizedclaim_free(t >>> 0, 1));
    const j9 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_binding_free(t >>> 0, 1));
    class _0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(_0.prototype);
            return n.__wbg_ptr = e, j9.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, j9.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_binding_free(e, 0);
        }
        static deserialize(e) {
            const n = m.binding_deserialize(e);
            if (n[2]) throw q(n[1]);
            return _0.__wrap(n[0]);
        }
        constructor(e){
            const n = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), r = We, s = m.binding_new(n, r);
            if (s[2]) throw q(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, j9.register(this, this.__wbg_ptr, this), this;
        }
        get instance() {
            let e, n;
            try {
                const r = m.binding_instance(this.__wbg_ptr);
                return e = r[0], n = r[1], Be(r[0], r[1]);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        serialize() {
            const e = m.binding_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.binding_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (_0.prototype[Symbol.dispose] = _0.prototype.free);
    const q9 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_chargedstate_free(t >>> 0, 1));
    let xh = class Rj {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Rj.prototype);
            return n.__wbg_ptr = e, q9.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, q9.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_chargedstate_free(e, 0);
        }
        constructor(e){
            ft(e, Zl);
            const n = m.chargedstate_new(e.__wbg_ptr);
            return this.__wbg_ptr = n >>> 0, q9.register(this, this.__wbg_ptr, this), this;
        }
        get state() {
            const e = m.chargedstate_state(this.__wbg_ptr);
            return Zl.__wrap(e);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.chargedstate_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (xh.prototype[Symbol.dispose] = xh.prototype.free);
    const K9 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_claimrewardstransaction_free(t >>> 0, 1));
    class yc {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(yc.prototype);
            return n.__wbg_ptr = e, K9.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, K9.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_claimrewardstransaction_free(e, 0);
        }
        static deserialize(e, n) {
            const r = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), s = We, i = m.claimrewardstransaction_deserialize(r, s, n);
            if (i[2]) throw q(i[1]);
            return yc.__wrap(i[0]);
        }
        get dataToSign() {
            return m.claimrewardstransaction_dataToSign(this.__wbg_ptr);
        }
        addSignature(e) {
            const n = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), r = We, s = m.claimrewardstransaction_addSignature(this.__wbg_ptr, n, r);
            if (s[2]) throw q(s[1]);
            return yc.__wrap(s[0]);
        }
        eraseSignatures() {
            const e = m.claimrewardstransaction_eraseSignatures(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return yc.__wrap(e[0]);
        }
        static new(e, n, r, s, i) {
            const o = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), a = We, c = st(r, m.__wbindgen_malloc, m.__wbindgen_realloc), l = We, u = st(s, m.__wbindgen_malloc, m.__wbindgen_realloc), d = We, f = st(i, m.__wbindgen_malloc, m.__wbindgen_realloc), p = We, h = m.claimrewardstransaction_new(o, a, n, c, l, u, d, f, p);
            if (h[2]) throw q(h[1]);
            return yc.__wrap(h[0]);
        }
        get kind() {
            let e, n;
            try {
                const r = m.claimrewardstransaction_kind(this.__wbg_ptr);
                return e = r[0], n = r[1], Be(r[0], r[1]);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        get nonce() {
            let e, n;
            try {
                const i = m.claimrewardstransaction_nonce(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, q(i[2]);
                return e = r, n = s, Be(r, s);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        get owner() {
            let e, n;
            try {
                const i = m.claimrewardstransaction_owner(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, q(i[2]);
                return e = r, n = s, Be(r, s);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        get value() {
            return m.claimrewardstransaction_value(this.__wbg_ptr);
        }
        constructor(e, n, r, s, i, o, a){
            const c = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), l = We, u = st(n, m.__wbindgen_malloc, m.__wbindgen_realloc), d = We, f = st(s, m.__wbindgen_malloc, m.__wbindgen_realloc), p = We, h = st(i, m.__wbindgen_malloc, m.__wbindgen_realloc), b = We, y = m.claimrewardstransaction_construct(c, l, u, d, r, f, p, h, b, o, a);
            if (y[2]) throw q(y[1]);
            return this.__wbg_ptr = y[0] >>> 0, K9.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = m.claimrewardstransaction_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get signature() {
            const e = m.claimrewardstransaction_signature(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.claimrewardstransaction_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (yc.prototype[Symbol.dispose] = yc.prototype.free);
    const W9 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_coinsecretkey_free(t >>> 0, 1));
    class x0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(x0.prototype);
            return n.__wbg_ptr = e, W9.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, W9.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_coinsecretkey_free(e, 0);
        }
        public_key() {
            let e, n;
            try {
                const i = m.coinsecretkey_public_key(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, q(i[2]);
                return e = r, n = s, Be(r, s);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        constructor(){
            const e = m.coinsecretkey_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, W9.register(this, this.__wbg_ptr, this), this;
        }
        clear() {
            m.coinsecretkey_clear(this.__wbg_ptr);
        }
        yesIKnowTheSecurityImplicationsOfThis_serialize() {
            const e = m.coinsecretkey_yesIKnowTheSecurityImplicationsOfThis_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
    }
    Symbol.dispose && (x0.prototype[Symbol.dispose] = x0.prototype.free);
    const $9 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_contractcall_free(t >>> 0, 1));
    class vh {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(vh.prototype);
            return n.__wbg_ptr = e, $9.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, $9.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_contractcall_free(e, 0);
        }
        get entryPoint() {
            const e = m.contractcall_entryPoint(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get fallibleTranscript() {
            const e = m.contractcall_fallibleTranscript(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get guaranteedTranscript() {
            const e = m.contractcall_guaranteedTranscript(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get communicationCommitment() {
            const e = m.contractcall_communicationCommitment(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        constructor(){
            const e = m.contractcall_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, $9.register(this, this.__wbg_ptr, this), this;
        }
        get proof() {
            const e = m.contractcall_proof(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get address() {
            let e, n;
            try {
                const i = m.contractcall_address(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, q(i[2]);
                return e = r, n = s, Be(r, s);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        toString(e) {
            let n, r;
            try {
                const s = m.contractcall_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (vh.prototype[Symbol.dispose] = vh.prototype.free);
    const NR = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_contractcallprototype_free(t >>> 0, 1));
    class M6 {
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, NR.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_contractcallprototype_free(e, 0);
        }
        constructor(e, n, r, s, i, o, a, c, l, u){
            const d = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), f = We;
            ft(r, S0);
            const p = Jo(o, m.__wbindgen_malloc), h = We, b = st(l, m.__wbindgen_malloc, m.__wbindgen_realloc), y = We, _ = st(u, m.__wbindgen_malloc, m.__wbindgen_realloc), v = We, w = m.contractcallprototype_new(d, f, n, r.__wbg_ptr, s, i, p, h, a, c, b, y, _, v);
            if (w[2]) throw q(w[1]);
            return this.__wbg_ptr = w[0] >>> 0, NR.register(this, this.__wbg_ptr, this), this;
        }
        intoCall(e) {
            const n = m.contractcallprototype_intoCall(this.__wbg_ptr, e);
            if (n[2]) throw q(n[1]);
            return vh.__wrap(n[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.contractcallprototype_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (M6.prototype[Symbol.dispose] = M6.prototype.free);
    const X9 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_contractdeploy_free(t >>> 0, 1));
    class Sh {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Sh.prototype);
            return n.__wbg_ptr = e, X9.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, X9.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_contractdeploy_free(e, 0);
        }
        get initialState() {
            const e = m.contractdeploy_initialState(this.__wbg_ptr);
            return E0.__wrap(e);
        }
        constructor(e){
            ft(e, E0);
            const n = m.contractdeploy_new(e.__wbg_ptr);
            return this.__wbg_ptr = n >>> 0, X9.register(this, this.__wbg_ptr, this), this;
        }
        get address() {
            let e, n;
            try {
                const i = m.contractdeploy_address(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, q(i[2]);
                return e = r, n = s, Be(r, s);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        toString(e) {
            let n, r;
            try {
                const s = m.contractdeploy_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Sh.prototype[Symbol.dispose] = Sh.prototype.free);
    const G9 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_contractmaintenanceauthority_free(t >>> 0, 1));
    let v0 = class R6 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(R6.prototype);
            return n.__wbg_ptr = e, G9.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, G9.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_contractmaintenanceauthority_free(e, 0);
        }
        static deserialize(e) {
            const n = m.contractmaintenanceauthority_deserialize(e);
            if (n[2]) throw q(n[1]);
            return R6.__wrap(n[0]);
        }
        constructor(e, n, r){
            const s = m.contractmaintenanceauthority_new(e, n, He(r) ? 0 : mr(r));
            if (s[2]) throw q(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, G9.register(this, this.__wbg_ptr, this), this;
        }
        get counter() {
            return m.contractmaintenanceauthority_counter(this.__wbg_ptr);
        }
        get committee() {
            const e = m.contractmaintenanceauthority_committee(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        serialize() {
            const e = m.contractmaintenanceauthority_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get threshold() {
            return m.contractmaintenanceauthority_threshold(this.__wbg_ptr) >>> 0;
        }
        toString(e) {
            let n, r;
            try {
                const s = m.contractmaintenanceauthority_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (v0.prototype[Symbol.dispose] = v0.prototype.free);
    const Z9 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_contractoperation_free(t >>> 0, 1));
    let S0 = class N6 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(N6.prototype);
            return n.__wbg_ptr = e, Z9.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, Z9.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_contractoperation_free(e, 0);
        }
        static deserialize(e) {
            const n = m.contractoperation_deserialize(e);
            if (n[2]) throw q(n[1]);
            return N6.__wrap(n[0]);
        }
        get verifierKey() {
            const e = m.contractoperation_verifier_key(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        set verifierKey(e) {
            const n = m.contractoperation_set_verifier_key(this.__wbg_ptr, e);
            if (n[1]) throw q(n[0]);
        }
        constructor(){
            const e = m.contractoperation_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, Z9.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = m.contractoperation_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.contractoperation_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (S0.prototype[Symbol.dispose] = S0.prototype.free);
    const J9 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_contractoperationversion_free(t >>> 0, 1));
    class k0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(k0.prototype);
            return n.__wbg_ptr = e, J9.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, J9.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_contractoperationversion_free(e, 0);
        }
        constructor(e){
            const n = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), r = We, s = m.contractoperationversion_new(n, r);
            if (s[2]) throw q(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, J9.register(this, this.__wbg_ptr, this), this;
        }
        get version() {
            let e, n;
            try {
                const r = m.contractoperationversion_version(this.__wbg_ptr);
                return e = r[0], n = r[1], Be(r[0], r[1]);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        toString(e) {
            let n, r;
            try {
                const s = m.contractoperationversion_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (k0.prototype[Symbol.dispose] = k0.prototype.free);
    const Y9 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_contractoperationversionedverifierkey_free(t >>> 0, 1));
    class T0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(T0.prototype);
            return n.__wbg_ptr = e, Y9.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, Y9.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_contractoperationversionedverifierkey_free(e, 0);
        }
        constructor(e, n){
            const r = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), s = We, i = m.contractoperationversionedverifierkey_new(r, s, n);
            if (i[2]) throw q(i[1]);
            return this.__wbg_ptr = i[0] >>> 0, Y9.register(this, this.__wbg_ptr, this), this;
        }
        get rawVk() {
            const e = m.contractoperationversionedverifierkey_raw_vk(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get version() {
            let e, n;
            try {
                const r = m.contractoperationversionedverifierkey_version(this.__wbg_ptr);
                return e = r[0], n = r[1], Be(r[0], r[1]);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        toString(e) {
            let n, r;
            try {
                const s = m.contractoperationversionedverifierkey_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (T0.prototype[Symbol.dispose] = T0.prototype.free);
    const Q9 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_contractstate_free(t >>> 0, 1));
    let E0 = class V6 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(V6.prototype);
            return n.__wbg_ptr = e, Q9.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, Q9.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_contractstate_free(e, 0);
        }
        operations() {
            const e = m.contractstate_operations(this.__wbg_ptr);
            var n = is(e[0], e[1]).slice();
            return m.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        static deserialize(e) {
            const n = m.contractstate_deserialize(e);
            if (n[2]) throw q(n[1]);
            return V6.__wrap(n[0]);
        }
        set balance(e) {
            const n = m.contractstate_set_balance(this.__wbg_ptr, e);
            if (n[1]) throw q(n[0]);
        }
        setOperation(e, n) {
            ft(n, S0);
            const r = m.contractstate_setOperation(this.__wbg_ptr, e, n.__wbg_ptr);
            if (r[1]) throw q(r[0]);
        }
        get maintenanceAuthority() {
            const e = m.contractstate_maintenance_authority(this.__wbg_ptr);
            return v0.__wrap(e);
        }
        set maintenanceAuthority(e) {
            ft(e, v0), m.contractstate_set_maintenance_authority(this.__wbg_ptr, e.__wbg_ptr);
        }
        constructor(){
            const e = m.contractstate_new();
            return this.__wbg_ptr = e >>> 0, Q9.register(this, this.__wbg_ptr, this), this;
        }
        get data() {
            const e = m.contractstate_data(this.__wbg_ptr);
            return xh.__wrap(e);
        }
        query(e, n) {
            ft(n, vd);
            const r = m.contractstate_query(this.__wbg_ptr, e, n.__wbg_ptr);
            if (r[2]) throw q(r[1]);
            return q(r[0]);
        }
        get balance() {
            const e = m.contractstate_balance(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        set data(e) {
            ft(e, xh), m.contractstate_set_data(this.__wbg_ptr, e.__wbg_ptr);
        }
        operation(e) {
            const n = m.contractstate_operation(this.__wbg_ptr, e);
            if (n[2]) throw q(n[1]);
            return n[0] === 0 ? void 0 : S0.__wrap(n[0]);
        }
        serialize() {
            const e = m.contractstate_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.contractstate_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (E0.prototype[Symbol.dispose] = E0.prototype.free);
    const e8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_costmodel_free(t >>> 0, 1));
    let vd = class B6 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(B6.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();
            m.__wbg_costmodel_free(e, 0);
        }
        static initialCostModel() {
            const e = m.costmodel_initialCostModel();
            return B6.__wrap(e);
        }
        constructor(){
            const e = m.costmodel_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, e8.register(this, this.__wbg_ptr, this), this;
        }
        toString(e) {
            let n, r;
            try {
                const s = m.costmodel_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (vd.prototype[Symbol.dispose] = vd.prototype.free);
    const t8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_dustactions_free(t >>> 0, 1));
    class Ca {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Ca.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();
            m.__wbg_dustactions_free(e, 0);
        }
        set spends(e) {
            const n = m.dustactions_set_spends(this.__wbg_ptr, e);
            if (n[1]) throw q(n[0]);
        }
        static deserialize(e, n, r) {
            const s = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), i = We, o = st(n, m.__wbindgen_malloc, m.__wbindgen_realloc), a = We, c = m.dustactions_deserialize(s, i, o, a, r);
            if (c[2]) throw q(c[1]);
            return Ca.__wrap(c[0]);
        }
        get registrations() {
            const e = m.dustactions_registrations(this.__wbg_ptr);
            if (e[3]) throw q(e[2]);
            var n = is(e[0], e[1]).slice();
            return m.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        set registrations(e) {
            const n = m.dustactions_set_registrations(this.__wbg_ptr, e);
            if (n[1]) throw q(n[0]);
        }
        constructor(e, n, r, s, i){
            const o = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), a = We, c = st(n, m.__wbindgen_malloc, m.__wbindgen_realloc), l = We, u = m.dustactions_new(o, a, c, l, r, s, i);
            if (u[2]) throw q(u[1]);
            return this.__wbg_ptr = u[0] >>> 0, t8.register(this, this.__wbg_ptr, this), this;
        }
        get ctime() {
            return m.dustactions_ctime(this.__wbg_ptr);
        }
        get spends() {
            const e = m.dustactions_spends(this.__wbg_ptr);
            if (e[3]) throw q(e[2]);
            var n = is(e[0], e[1]).slice();
            return m.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        serialize() {
            const e = m.dustactions_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        set ctime(e) {
            const n = m.dustactions_set_ctime(this.__wbg_ptr, e);
            if (n[1]) throw q(n[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.dustactions_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Ca.prototype[Symbol.dispose] = Ca.prototype.free);
    const n8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_dustgenerationstate_free(t >>> 0, 1));
    class C0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(C0.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();
            m.__wbg_dustgenerationstate_free(e, 0);
        }
        static deserialize(e) {
            const n = m.dustgenerationstate_deserialize(e);
            if (n[2]) throw q(n[1]);
            return C0.__wrap(n[0]);
        }
        constructor(){
            const e = m.dustgenerationstate_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, n8.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = m.dustgenerationstate_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.dustgenerationstate_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (C0.prototype[Symbol.dispose] = C0.prototype.free);
    const r8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_dustlocalstate_free(t >>> 0, 1));
    class Yo {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Yo.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();
            m.__wbg_dustlocalstate_free(e, 0);
        }
        static deserialize(e) {
            const n = m.dustlocalstate_deserialize(e);
            if (n[2]) throw q(n[1]);
            return Yo.__wrap(n[0]);
        }
        processTtls(e) {
            const n = m.dustlocalstate_processTtls(this.__wbg_ptr, e);
            if (n[2]) throw q(n[1]);
            return Yo.__wrap(n[0]);
        }
        replayEvents(e, n) {
            ft(e, Ma);
            const r = Jo(n, m.__wbindgen_malloc), s = We, i = m.dustlocalstate_replayEvents(this.__wbg_ptr, e.__wbg_ptr, r, s);
            if (i[2]) throw q(i[1]);
            return Yo.__wrap(i[0]);
        }
        walletBalance(e) {
            return m.dustlocalstate_walletBalance(this.__wbg_ptr, e);
        }
        generationInfo(e) {
            const n = m.dustlocalstate_generationInfo(this.__wbg_ptr, e);
            if (n[2]) throw q(n[1]);
            return q(n[0]);
        }
        replayEventsWithChanges(e, n) {
            ft(e, Ma);
            const r = Jo(n, m.__wbindgen_malloc), s = We, i = m.dustlocalstate_replayEventsWithChanges(this.__wbg_ptr, e.__wbg_ptr, r, s);
            if (i[2]) throw q(i[1]);
            return Ym.__wrap(i[0]);
        }
        constructor(e){
            ft(e, Sd);
            const n = m.dustlocalstate_new(e.__wbg_ptr);
            return this.__wbg_ptr = n >>> 0, r8.register(this, this.__wbg_ptr, this), this;
        }
        spend(e, n, r, s) {
            ft(e, Ma);
            const i = m.dustlocalstate_spend(this.__wbg_ptr, e.__wbg_ptr, n, r, s);
            if (i[2]) throw q(i[1]);
            return q(i[0]);
        }
        get utxos() {
            const e = m.dustlocalstate_utxos(this.__wbg_ptr);
            if (e[3]) throw q(e[2]);
            var n = is(e[0], e[1]).slice();
            return m.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        get params() {
            const e = m.dustlocalstate_params(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return Sd.__wrap(e[0]);
        }
        serialize() {
            const e = m.dustlocalstate_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get syncTime() {
            return m.dustlocalstate_syncTime(this.__wbg_ptr);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.dustlocalstate_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Yo.prototype[Symbol.dispose] = Yo.prototype.free);
    const VR = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_dustlocalstatewithchanges_free(t >>> 0, 1));
    class Ym {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Ym.prototype);
            return n.__wbg_ptr = e, VR.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, VR.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_dustlocalstatewithchanges_free(e, 0);
        }
        get state() {
            const e = m.dustlocalstatewithchanges_state(this.__wbg_ptr);
            return Yo.__wrap(e);
        }
        get changes() {
            const e = m.dustlocalstatewithchanges_changes(this.__wbg_ptr);
            var n = is(e[0], e[1]).slice();
            return m.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
    }
    Symbol.dispose && (Ym.prototype[Symbol.dispose] = Ym.prototype.free);
    const s8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_dustparameters_free(t >>> 0, 1));
    class Sd {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Sd.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();
            m.__wbg_dustparameters_free(e, 0);
        }
        static deserialize(e) {
            const n = m.dustparameters_deserialize(e);
            if (n[2]) throw q(n[1]);
            return Sd.__wrap(n[0]);
        }
        get nightDustRatio() {
            return m.dustparameters_nightDustRatio(this.__wbg_ptr);
        }
        get timeToCapSeconds() {
            return m.dustparameters_timeToCapSeconds(this.__wbg_ptr);
        }
        set nightDustRatio(e) {
            const n = m.dustparameters_set_nightDustRatio(this.__wbg_ptr, e);
            if (n[1]) throw q(n[0]);
        }
        get generationDecayRate() {
            return m.dustparameters_generationDecayRate(this.__wbg_ptr);
        }
        get dustGracePeriodSeconds() {
            return m.dustparameters_dustGracePeriodSeconds(this.__wbg_ptr);
        }
        set generationDecayRate(e) {
            const n = m.dustparameters_set_generationDecayRate(this.__wbg_ptr, e);
            if (n[1]) throw q(n[0]);
        }
        set dustGracePeriodSeconds(e) {
            const n = m.dustparameters_set_dustGracePeriodSeconds(this.__wbg_ptr, e);
            if (n[1]) throw q(n[0]);
        }
        constructor(e, n, r){
            const s = m.dustparameters_new(e, n, r);
            if (s[2]) throw q(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, s8.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = m.dustparameters_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.dustparameters_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Sd.prototype[Symbol.dispose] = Sd.prototype.free);
    const i8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_dustregistration_free(t >>> 0, 1));
    class Gl {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Gl.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();
            m.__wbg_dustregistration_free(e, 0);
        }
        static deserialize(e, n) {
            const r = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), s = We, i = m.dustregistration_deserialize(r, s, n);
            if (i[2]) throw q(i[1]);
            return Gl.__wrap(i[0]);
        }
        get dustAddress() {
            return m.dustregistration_dustAddress(this.__wbg_ptr);
        }
        set nightKey(e) {
            const n = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), r = We, s = m.dustregistration_set_nightKey(this.__wbg_ptr, n, r);
            if (s[1]) throw q(s[0]);
        }
        set signature(e) {
            const n = m.dustregistration_set_signature(this.__wbg_ptr, e);
            if (n[1]) throw q(n[0]);
        }
        set dustAddress(e) {
            const n = m.dustregistration_set_dustAddress(this.__wbg_ptr, He(e) ? 0 : mr(e));
            if (n[1]) throw q(n[0]);
        }
        get allowFeePayment() {
            return m.dustregistration_allowFeePayment(this.__wbg_ptr);
        }
        set allowFeePayment(e) {
            const n = m.dustregistration_set_allowFeePayment(this.__wbg_ptr, e);
            if (n[1]) throw q(n[0]);
        }
        constructor(e, n, r, s, i){
            const o = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), a = We, c = st(n, m.__wbindgen_malloc, m.__wbindgen_realloc), l = We, u = m.dustregistration_new(o, a, c, l, He(r) ? 0 : mr(r), s, i);
            if (u[2]) throw q(u[1]);
            return this.__wbg_ptr = u[0] >>> 0, i8.register(this, this.__wbg_ptr, this), this;
        }
        get nightKey() {
            let e, n;
            try {
                const i = m.dustregistration_nightKey(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, q(i[2]);
                return e = r, n = s, Be(r, s);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        serialize() {
            const e = m.dustregistration_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get signature() {
            const e = m.dustregistration_signature(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.dustregistration_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Gl.prototype[Symbol.dispose] = Gl.prototype.free);
    const o8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_dustsecretkey_free(t >>> 0, 1));
    class Ma {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Ma.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();
            m.__wbg_dustsecretkey_free(e, 0);
        }
        get publicKey() {
            const e = m.dustsecretkey_publicKey(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        static fromBigint(e) {
            const n = m.dustsecretkey_fromBigint(e);
            if (n[2]) throw q(n[1]);
            return Ma.__wrap(n[0]);
        }
        constructor(){
            const e = m.dustsecretkey_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, o8.register(this, this.__wbg_ptr, this), this;
        }
        clear() {
            m.dustsecretkey_clear(this.__wbg_ptr);
        }
        static fromSeed(e) {
            const n = m.dustsecretkey_fromSeed(e);
            if (n[2]) throw q(n[1]);
            return Ma.__wrap(n[0]);
        }
    }
    Symbol.dispose && (Ma.prototype[Symbol.dispose] = Ma.prototype.free);
    const a8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_dustspend_free(t >>> 0, 1));
    class I0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(I0.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();
            m.__wbg_dustspend_free(e, 0);
        }
        get oldNullifier() {
            return m.dustspend_oldNullifier(this.__wbg_ptr);
        }
        get newCommitment() {
            return m.dustspend_newCommitment(this.__wbg_ptr);
        }
        constructor(){
            const e = m.dustspend_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, a8.register(this, this.__wbg_ptr, this), this;
        }
        get proof() {
            const e = m.dustspend_proof(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get vFee() {
            return m.dustspend_vFee(this.__wbg_ptr);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.dustspend_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (I0.prototype[Symbol.dispose] = I0.prototype.free);
    const c8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_duststate_free(t >>> 0, 1));
    class A0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(A0.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();
            m.__wbg_duststate_free(e, 0);
        }
        get generation() {
            const e = m.duststate_generation(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return C0.__wrap(e[0]);
        }
        static deserialize(e) {
            const n = m.duststate_deserialize(e);
            if (n[2]) throw q(n[1]);
            return A0.__wrap(n[0]);
        }
        constructor(){
            const e = m.duststate_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, c8.register(this, this.__wbg_ptr, this), this;
        }
        get utxo() {
            const e = m.duststate_utxo(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return P0.__wrap(e[0]);
        }
        serialize() {
            const e = m.duststate_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.duststate_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (A0.prototype[Symbol.dispose] = A0.prototype.free);
    const BR = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_duststatechanges_free(t >>> 0, 1));
    class Qm {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Qm.prototype);
            return n.__wbg_ptr = e, BR.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, BR.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_duststatechanges_free(e, 0);
        }
        get spentUtxos() {
            const e = m.duststatechanges_spentUtxos(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get receivedUtxos() {
            const e = m.duststatechanges_receivedUtxos(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get source() {
            let e, n;
            try {
                const i = m.duststatechanges_source(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, q(i[2]);
                return e = r, n = s, Be(r, s);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
    }
    Symbol.dispose && (Qm.prototype[Symbol.dispose] = Qm.prototype.free);
    const l8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_dustutxostate_free(t >>> 0, 1));
    class P0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(P0.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();
            m.__wbg_dustutxostate_free(e, 0);
        }
        static deserialize(e) {
            const n = m.dustutxostate_deserialize(e);
            if (n[2]) throw q(n[1]);
            return P0.__wrap(n[0]);
        }
        constructor(){
            const e = m.dustutxostate_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, l8.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = m.dustutxostate_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.dustutxostate_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (P0.prototype[Symbol.dispose] = P0.prototype.free);
    const u8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_encryptionsecretkey_free(t >>> 0, 1));
    class Yf {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Yf.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();
            m.__wbg_encryptionsecretkey_free(e, 0);
        }
        public_key() {
            let e, n;
            try {
                const i = m.encryptionsecretkey_public_key(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, q(i[2]);
                return e = r, n = s, Be(r, s);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        static deserialize(e) {
            const n = m.encryptionsecretkey_deserialize(e);
            if (n[2]) throw q(n[1]);
            return Yf.__wrap(n[0]);
        }
        yesIKnowTheSecurityImplicationsOfThis_taggedSerialize() {
            const e = m.encryptionsecretkey_yesIKnowTheSecurityImplicationsOfThis_taggedSerialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        static taggedDeserialize(e) {
            const n = m.encryptionsecretkey_taggedDeserialize(e);
            if (n[2]) throw q(n[1]);
            return Yf.__wrap(n[0]);
        }
        constructor(){
            const e = m.encryptionsecretkey_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, u8.register(this, this.__wbg_ptr, this), this;
        }
        test(e) {
            ft(e, rs);
            const n = m.encryptionsecretkey_test(this.__wbg_ptr, e.__wbg_ptr);
            if (n[2]) throw q(n[1]);
            return n[0] !== 0;
        }
        clear() {
            m.encryptionsecretkey_clear(this.__wbg_ptr);
        }
        yesIKnowTheSecurityImplicationsOfThis_serialize() {
            const e = m.encryptionsecretkey_yesIKnowTheSecurityImplicationsOfThis_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
    }
    Symbol.dispose && (Yf.prototype[Symbol.dispose] = Yf.prototype.free);
    const d8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_event_free(t >>> 0, 1));
    let kd = class D_ {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(D_.prototype);
            return n.__wbg_ptr = e, d8.register(n, n.__wbg_ptr, n), n;
        }
        static __unwrap(e) {
            return e instanceof D_ ? e.__destroy_into_raw() : 0;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, d8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_event_free(e, 0);
        }
        static deserialize(e) {
            const n = m.event_deserialize(e);
            if (n[2]) throw q(n[1]);
            return D_.__wrap(n[0]);
        }
        constructor(){
            const e = m.event_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, d8.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = m.event_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.event_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (kd.prototype[Symbol.dispose] = kd.prototype.free);
    const f8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_intent_free(t >>> 0, 1));
    class Gr {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Gr.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();
            m.__wbg_intent_free(e, 0);
        }
        addDeploy(e) {
            ft(e, Sh);
            const n = m.intent_addDeploy(this.__wbg_ptr, e.__wbg_ptr);
            if (n[2]) throw q(n[1]);
            return Gr.__wrap(n[0]);
        }
        static deserialize(e, n, r, s) {
            const i = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), o = We, a = st(n, m.__wbindgen_malloc, m.__wbindgen_realloc), c = We, l = st(r, m.__wbindgen_malloc, m.__wbindgen_realloc), u = We, d = m.intent_deserialize(i, o, a, c, l, u, s);
            if (d[2]) throw q(d[1]);
            return Gr.__wrap(d[0]);
        }
        intentHash(e) {
            let n, r;
            try {
                const o = m.intent_intentHash(this.__wbg_ptr, e);
                var s = o[0], i = o[1];
                if (o[3]) throw s = 0, i = 0, q(o[2]);
                return n = s, r = i, Be(s, i);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
        set actions(e) {
            const n = Jo(e, m.__wbindgen_malloc), r = We, s = m.intent_set_actions(this.__wbg_ptr, n, r);
            if (s[1]) throw q(s[0]);
        }
        get dustActions() {
            const e = m.intent_dustActions(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        eraseProofs() {
            const e = m.intent_eraseProofs(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return Gr.__wrap(e[0]);
        }
        signatureData(e) {
            return m.intent_signatureData(this.__wbg_ptr, e);
        }
        eraseSignatures() {
            const e = m.intent_eraseSignatures(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return Gr.__wrap(e[0]);
        }
        set dustActions(e) {
            const n = m.intent_set_dustActions(this.__wbg_ptr, e);
            if (n[1]) throw q(n[0]);
        }
        addMaintenanceUpdate(e) {
            ft(e, Td);
            const n = m.intent_addMaintenanceUpdate(this.__wbg_ptr, e.__wbg_ptr);
            if (n[2]) throw q(n[1]);
            return Gr.__wrap(n[0]);
        }
        get fallibleUnshieldedOffer() {
            const e = m.intent_fallibleUnshieldedOffer(this.__wbg_ptr);
            return e === 0 ? void 0 : go.__wrap(e);
        }
        get guaranteedUnshieldedOffer() {
            const e = m.intent_guaranteedUnshieldedOffer(this.__wbg_ptr);
            return e === 0 ? void 0 : go.__wrap(e);
        }
        set fallibleUnshieldedOffer(e) {
            const n = m.intent_set_fallibleUnshieldedOffer(this.__wbg_ptr, e);
            if (n[1]) throw q(n[0]);
        }
        set guaranteedUnshieldedOffer(e) {
            const n = m.intent_set_guaranteedUnshieldedOffer(this.__wbg_ptr, e);
            if (n[1]) throw q(n[0]);
        }
        static new(e) {
            const n = m.intent_new(e);
            if (n[2]) throw q(n[1]);
            return Gr.__wrap(n[0]);
        }
        get ttl() {
            return m.intent_ttl(this.__wbg_ptr);
        }
        bind(e) {
            const n = m.intent_bind(this.__wbg_ptr, e);
            if (n[2]) throw q(n[1]);
            return Gr.__wrap(n[0]);
        }
        get actions() {
            const e = m.intent_actions(this.__wbg_ptr);
            var n = is(e[0], e[1]).slice();
            return m.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        get binding() {
            const e = m.intent_binding(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        set ttl(e) {
            m.intent_set_ttl(this.__wbg_ptr, e);
        }
        addCall(e) {
            ft(e, M6);
            const n = m.intent_addCall(this.__wbg_ptr, e.__wbg_ptr);
            if (n[2]) throw q(n[1]);
            return Gr.__wrap(n[0]);
        }
        constructor(){
            const e = m.intent_construct();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, f8.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = m.intent_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.intent_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Gr.prototype[Symbol.dispose] = Gr.prototype.free);
    typeof FinalizationRegistry > "u" || new FinalizationRegistry((t)=>m.__wbg_intounderlyingbytesource_free(t >>> 0, 1));
    typeof FinalizationRegistry > "u" || new FinalizationRegistry((t)=>m.__wbg_intounderlyingsink_free(t >>> 0, 1));
    typeof FinalizationRegistry > "u" || new FinalizationRegistry((t)=>m.__wbg_intounderlyingsource_free(t >>> 0, 1));
    const h8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__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, 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();
            m.__wbg_ledgerparameters_free(e, 0);
        }
        get feePrices() {
            const e = m.ledgerparameters_feePrices(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        static deserialize(e) {
            const n = m.ledgerparameters_deserialize(e);
            if (n[2]) throw q(n[1]);
            return wi.__wrap(n[0]);
        }
        static initialParameters() {
            const e = m.ledgerparameters_initialParameters();
            return wi.__wrap(e);
        }
        normalizeFullness(e) {
            const n = m.ledgerparameters_normalizeFullness(this.__wbg_ptr, e);
            if (n[2]) throw q(n[1]);
            return q(n[0]);
        }
        maxPriceAdjustment() {
            return m.ledgerparameters_maxPriceAdjustment(this.__wbg_ptr);
        }
        get transactionCostModel() {
            const e = m.ledgerparameters_transactionCostModel(this.__wbg_ptr);
            return Qf.__wrap(e);
        }
        constructor(){
            const e = m.ledgerparameters_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, h8.register(this, this.__wbg_ptr, this), this;
        }
        get dust() {
            const e = m.ledgerparameters_dust(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return Sd.__wrap(e[0]);
        }
        serialize() {
            const e = m.ledgerparameters_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.ledgerparameters_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (wi.prototype[Symbol.dispose] = wi.prototype.free);
    const p8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_ledgerstate_free(t >>> 0, 1));
    class jo {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(jo.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();
            m.__wbg_ledgerstate_free(e, 0);
        }
        get parameters() {
            const e = m.ledgerstate_parameters(this.__wbg_ptr);
            return wi.__wrap(e);
        }
        static deserialize(e) {
            const n = m.ledgerstate_deserialize(e);
            if (n[2]) throw q(n[1]);
            return jo.__wrap(n[0]);
        }
        get lockedPool() {
            return m.ledgerstate_locked_pool(this.__wbg_ptr);
        }
        get reservePool() {
            return m.ledgerstate_reserve_pool(this.__wbg_ptr);
        }
        updateIndex(e, n, r) {
            const s = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), i = We;
            ft(n, xh);
            const o = m.ledgerstate_updateIndex(this.__wbg_ptr, s, i, n.__wbg_ptr, r);
            if (o[2]) throw q(o[1]);
            return jo.__wrap(o[0]);
        }
        set parameters(e) {
            ft(e, wi), m.ledgerstate_set_parameters(this.__wbg_ptr, e.__wbg_ptr);
        }
        applySystemTx(e, n) {
            ft(e, F0);
            const r = m.ledgerstate_applySystemTx(this.__wbg_ptr, e.__wbg_ptr, n);
            if (r[2]) throw q(r[1]);
            return q(r[0]);
        }
        bridgeReceiving(e) {
            const n = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), r = We, s = m.ledgerstate_bridgeReceiving(this.__wbg_ptr, n, r);
            if (s[2]) throw q(s[1]);
            return q(s[0]);
        }
        testingDistributeNight(e, n, r) {
            const s = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), i = We, o = m.ledgerstate_testingDistributeNight(this.__wbg_ptr, s, i, n, r);
            if (o[2]) throw q(o[1]);
            return jo.__wrap(o[0]);
        }
        treasuryBalance(e) {
            const n = m.ledgerstate_treasuryBalance(this.__wbg_ptr, e);
            if (n[2]) throw q(n[1]);
            return q(n[0]);
        }
        get blockRewardPool() {
            return m.ledgerstate_block_reward_pool(this.__wbg_ptr);
        }
        postBlockUpdate(e, n, r) {
            const s = m.ledgerstate_postBlockUpdate(this.__wbg_ptr, e, n, r);
            if (s[2]) throw q(s[1]);
            return jo.__wrap(s[0]);
        }
        unclaimedBlockRewards(e) {
            const n = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), r = We, s = m.ledgerstate_unclaimedBlockRewards(this.__wbg_ptr, n, r);
            if (s[2]) throw q(s[1]);
            return q(s[0]);
        }
        constructor(e, n){
            const r = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), s = We;
            ft(n, lo);
            const i = m.ledgerstate_new(r, s, n.__wbg_ptr);
            return this.__wbg_ptr = i >>> 0, p8.register(this, this.__wbg_ptr, this), this;
        }
        get dust() {
            const e = m.ledgerstate_dust(this.__wbg_ptr);
            return A0.__wrap(e);
        }
        get utxo() {
            const e = m.ledgerstate_utxo(this.__wbg_ptr);
            return eh.__wrap(e);
        }
        apply(e, n) {
            return ft(e, L0), ft(n, L6), m.ledgerstate_apply(this.__wbg_ptr, e.__wbg_ptr, n.__wbg_ptr);
        }
        static blank(e) {
            const n = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), r = We, s = m.ledgerstate_blank(n, r);
            return jo.__wrap(s);
        }
        index(e) {
            const n = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), r = We, s = m.ledgerstate_index(this.__wbg_ptr, n, r);
            if (s[2]) throw q(s[1]);
            return s[0] === 0 ? void 0 : E0.__wrap(s[0]);
        }
        get zswap() {
            const e = m.ledgerstate_zswap(this.__wbg_ptr);
            return lo.__wrap(e);
        }
        serialize() {
            const e = m.ledgerstate_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.ledgerstate_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (jo.prototype[Symbol.dispose] = jo.prototype.free);
    const g8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_maintenanceupdate_free(t >>> 0, 1));
    class Td {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Td.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();
            m.__wbg_maintenanceupdate_free(e, 0);
        }
        get signatures() {
            const e = m.maintenanceupdate_signatures(this.__wbg_ptr);
            if (e[3]) throw q(e[2]);
            var n = is(e[0], e[1]).slice();
            return m.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        get dataToSign() {
            return m.maintenanceupdate_data_to_sign(this.__wbg_ptr);
        }
        addSignature(e, n) {
            const r = st(n, m.__wbindgen_malloc, m.__wbindgen_realloc), s = We, i = m.maintenanceupdate_addSignature(this.__wbg_ptr, e, r, s);
            if (i[2]) throw q(i[1]);
            return Td.__wrap(i[0]);
        }
        constructor(e, n, r){
            const s = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), i = We, o = Jo(n, m.__wbindgen_malloc), a = We, c = m.maintenanceupdate_new(s, i, o, a, r);
            if (c[2]) throw q(c[1]);
            return this.__wbg_ptr = c[0] >>> 0, g8.register(this, this.__wbg_ptr, this), this;
        }
        get address() {
            let e, n;
            try {
                const i = m.maintenanceupdate_address(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, q(i[2]);
                return e = r, n = s, Be(r, s);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        get counter() {
            const e = m.maintenanceupdate_counter(this.__wbg_ptr);
            return BigInt.asUintN(64, e);
        }
        get updates() {
            const e = m.maintenanceupdate_updates(this.__wbg_ptr);
            var n = is(e[0], e[1]).slice();
            return m.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        toString(e) {
            let n, r;
            try {
                const s = m.maintenanceupdate_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Td.prototype[Symbol.dispose] = Td.prototype.free);
    const b8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_merkletreecollapsedupdate_free(t >>> 0, 1));
    class O0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(O0.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();
            m.__wbg_merkletreecollapsedupdate_free(e, 0);
        }
        static deserialize(e) {
            const n = m.merkletreecollapsedupdate_deserialize(e);
            if (n[2]) throw q(n[1]);
            return O0.__wrap(n[0]);
        }
        constructor(e, n, r){
            ft(e, lo);
            const s = m.merkletreecollapsedupdate_new(e.__wbg_ptr, n, r);
            if (s[2]) throw q(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, b8.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = m.merkletreecollapsedupdate_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.merkletreecollapsedupdate_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (O0.prototype[Symbol.dispose] = O0.prototype.free);
    const m8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__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, 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();
            m.__wbg_nobinding_free(e, 0);
        }
        static deserialize(e) {
            const n = m.nobinding_deserialize(e);
            if (n[2]) throw q(n[1]);
            return M0.__wrap(n[0]);
        }
        constructor(e){
            const n = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), r = We, s = m.nobinding_new(n, r);
            if (s[2]) throw q(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, m8.register(this, this.__wbg_ptr, this), this;
        }
        get instance() {
            let e, n;
            try {
                const r = m.nobinding_instance(this.__wbg_ptr);
                return e = r[0], n = r[1], Be(r[0], r[1]);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        serialize() {
            const e = m.nobinding_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.nobinding_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (M0.prototype[Symbol.dispose] = M0.prototype.free);
    const y8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_noproof_free(t >>> 0, 1));
    class ey {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(ey.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();
            m.__wbg_noproof_free(e, 0);
        }
        constructor(){
            const e = m.noproof_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, y8.register(this, this.__wbg_ptr, this), this;
        }
        get instance() {
            let e, n;
            try {
                const r = m.noproof_instance(this.__wbg_ptr);
                return e = r[0], n = r[1], Be(r[0], r[1]);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        toString(e) {
            let n, r;
            try {
                const s = m.noproof_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (ey.prototype[Symbol.dispose] = ey.prototype.free);
    const w8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_prebinding_free(t >>> 0, 1));
    class R0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(R0.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();
            m.__wbg_prebinding_free(e, 0);
        }
        static deserialize(e) {
            const n = m.prebinding_deserialize(e);
            if (n[2]) throw q(n[1]);
            return R0.__wrap(n[0]);
        }
        constructor(e){
            const n = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), r = We, s = m.prebinding_new(n, r);
            if (s[2]) throw q(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, w8.register(this, this.__wbg_ptr, this), this;
        }
        get instance() {
            let e, n;
            try {
                const r = m.prebinding_instance(this.__wbg_ptr);
                return e = r[0], n = r[1], Be(r[0], r[1]);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        serialize() {
            const e = m.prebinding_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.prebinding_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (R0.prototype[Symbol.dispose] = R0.prototype.free);
    const DR = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_prepartitioncontractcall_free(t >>> 0, 1));
    class D6 {
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, DR.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_prepartitioncontractcall_free(e, 0);
        }
        constructor(e, n, r, s, i, o, a, c, l){
            const u = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), d = We;
            ft(r, S0), ft(s, N2);
            const f = Jo(i, m.__wbindgen_malloc), p = We, h = st(c, m.__wbindgen_malloc, m.__wbindgen_realloc), b = We, y = st(l, m.__wbindgen_malloc, m.__wbindgen_realloc), _ = We, v = m.prepartitioncontractcall_new(u, d, n, r.__wbg_ptr, s.__wbg_ptr, f, p, o, a, h, b, y, _);
            if (v[2]) throw q(v[1]);
            return this.__wbg_ptr = v[0] >>> 0, DR.register(this, this.__wbg_ptr, this), this;
        }
        toString(e) {
            let n, r;
            try {
                const s = m.prepartitioncontractcall_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (D6.prototype[Symbol.dispose] = D6.prototype.free);
    const _8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_preproof_free(t >>> 0, 1));
    class N0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(N0.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();
            m.__wbg_preproof_free(e, 0);
        }
        static deserialize(e) {
            const n = m.preproof_deserialize(e);
            if (n[2]) throw q(n[1]);
            return N0.__wrap(n[0]);
        }
        constructor(e){
            const n = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), r = We, s = m.preproof_new(n, r);
            if (s[2]) throw q(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, _8.register(this, this.__wbg_ptr, this), this;
        }
        get instance() {
            let e, n;
            try {
                const r = m.preproof_instance(this.__wbg_ptr);
                return e = r[0], n = r[1], Be(r[0], r[1]);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        serialize() {
            const e = m.preproof_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.preproof_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (N0.prototype[Symbol.dispose] = N0.prototype.free);
    const FR = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_pretranscript_free(t >>> 0, 1));
    class N2 {
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, FR.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_pretranscript_free(e, 0);
        }
        constructor(e, n, r){
            ft(e, V2);
            const s = m.pretranscript_new(e.__wbg_ptr, n, r);
            if (s[2]) throw q(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, FR.register(this, this.__wbg_ptr, this), this;
        }
        toString(e) {
            let n, r;
            try {
                const s = m.pretranscript_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (N2.prototype[Symbol.dispose] = N2.prototype.free);
    const x8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_proof_free(t >>> 0, 1));
    class V0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(V0.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();
            m.__wbg_proof_free(e, 0);
        }
        static deserialize(e) {
            const n = m.proof_deserialize(e);
            if (n[2]) throw q(n[1]);
            return V0.__wrap(n[0]);
        }
        constructor(e){
            const n = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), r = We, s = m.proof_new(n, r);
            if (s[2]) throw q(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, x8.register(this, this.__wbg_ptr, this), this;
        }
        get instance() {
            let e, n;
            try {
                const r = m.proof_instance(this.__wbg_ptr);
                return e = r[0], n = r[1], Be(r[0], r[1]);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        serialize() {
            const e = m.proof_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.proof_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (V0.prototype[Symbol.dispose] = V0.prototype.free);
    const v8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_querycontext_free(t >>> 0, 1));
    let V2 = class F_ {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(F_.prototype);
            return n.__wbg_ptr = e, v8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, v8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_querycontext_free(e, 0);
        }
        get comIndices() {
            const e = m.querycontext_com_indices(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        set effects(e) {
            const n = m.querycontext_set_effects(this.__wbg_ptr, e);
            if (n[1]) throw q(n[0]);
        }
        toVmStack() {
            const e = m.querycontext_toVmStack(this.__wbg_ptr);
            return z6.__wrap(e);
        }
        runTranscript(e, n) {
            ft(n, vd);
            const r = m.querycontext_runTranscript(this.__wbg_ptr, e, n.__wbg_ptr);
            if (r[2]) throw q(r[1]);
            return F_.__wrap(r[0]);
        }
        insertCommitment(e, n) {
            const r = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), s = We, i = m.querycontext_insertCommitment(this.__wbg_ptr, r, s, n);
            if (i[2]) throw q(i[1]);
            return F_.__wrap(i[0]);
        }
        constructor(e, n){
            ft(e, xh);
            const r = st(n, m.__wbindgen_malloc, m.__wbindgen_realloc), s = We, i = m.querycontext_new(e.__wbg_ptr, r, s);
            if (i[2]) throw q(i[1]);
            return this.__wbg_ptr = i[0] >>> 0, v8.register(this, this.__wbg_ptr, this), this;
        }
        get block() {
            const e = m.querycontext_block(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        query(e, n, r) {
            ft(n, vd);
            const s = m.querycontext_query(this.__wbg_ptr, e, n.__wbg_ptr, r);
            if (s[2]) throw q(s[1]);
            return F6.__wrap(s[0]);
        }
        get state() {
            const e = m.querycontext_state(this.__wbg_ptr);
            return xh.__wrap(e);
        }
        get address() {
            let e, n;
            try {
                const i = m.querycontext_address(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, q(i[2]);
                return e = r, n = s, Be(r, s);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        get effects() {
            const e = m.querycontext_effects(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        qualify(e) {
            const n = m.querycontext_qualify(this.__wbg_ptr, e);
            if (n[2]) throw q(n[1]);
            return q(n[0]);
        }
        set block(e) {
            const n = m.querycontext_set_block(this.__wbg_ptr, e);
            if (n[1]) throw q(n[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.querycontext_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (V2.prototype[Symbol.dispose] = V2.prototype.free);
    const S8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_queryresults_free(t >>> 0, 1));
    let F6 = class Nj {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Nj.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();
            m.__wbg_queryresults_free(e, 0);
        }
        constructor(){
            const e = m.queryresults_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, S8.register(this, this.__wbg_ptr, this), this;
        }
        get events() {
            const e = m.queryresults_events(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get context() {
            const e = m.queryresults_context(this.__wbg_ptr);
            return V2.__wrap(e);
        }
        get gasCost() {
            const e = m.queryresults_gas_cost(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.queryresults_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (F6.prototype[Symbol.dispose] = F6.prototype.free);
    const k8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_replaceauthority_free(t >>> 0, 1));
    class B0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(B0.prototype);
            return n.__wbg_ptr = e, k8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, k8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_replaceauthority_free(e, 0);
        }
        constructor(e){
            ft(e, v0);
            const n = m.replaceauthority_new(e.__wbg_ptr);
            return this.__wbg_ptr = n >>> 0, k8.register(this, this.__wbg_ptr, this), this;
        }
        get authority() {
            const e = m.replaceauthority_authority(this.__wbg_ptr);
            return v0.__wrap(e);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.replaceauthority_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (B0.prototype[Symbol.dispose] = B0.prototype.free);
    const T8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_signatureenabled_free(t >>> 0, 1));
    class Ed {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Ed.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();
            m.__wbg_signatureenabled_free(e, 0);
        }
        static deserialize(e) {
            const n = m.signatureenabled_deserialize(e);
            if (n[2]) throw q(n[1]);
            return Ed.__wrap(n[0]);
        }
        constructor(e){
            const n = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), r = We, s = m.signatureenabled_new(n, r);
            if (s[2]) throw q(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 = m.signatureenabled_instance(this.__wbg_ptr);
                return e = r[0], n = r[1], Be(r[0], r[1]);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        serialize() {
            const e = m.signatureenabled_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.signatureenabled_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Ed.prototype[Symbol.dispose] = Ed.prototype.free);
    const E8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_signatureerased_free(t >>> 0, 1));
    class D0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(D0.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();
            m.__wbg_signatureerased_free(e, 0);
        }
        constructor(){
            const e = m.signatureerased_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, E8.register(this, this.__wbg_ptr, this), this;
        }
        get instance() {
            let e, n;
            try {
                const r = m.signatureerased_instance(this.__wbg_ptr);
                return e = r[0], n = r[1], Be(r[0], r[1]);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        toString(e) {
            let n, r;
            try {
                const s = m.signatureerased_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (D0.prototype[Symbol.dispose] = D0.prototype.free);
    const C8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_stateboundedmerkletree_free(t >>> 0, 1));
    let B2 = class am {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(am.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();
            m.__wbg_stateboundedmerkletree_free(e, 0);
        }
        pathForLeaf(e, n) {
            const r = m.stateboundedmerkletree_pathForLeaf(this.__wbg_ptr, e, n);
            if (r[2]) throw q(r[1]);
            return q(r[0]);
        }
        findPathForLeaf(e) {
            const n = m.stateboundedmerkletree_findPathForLeaf(this.__wbg_ptr, e);
            if (n[2]) throw q(n[1]);
            return q(n[0]);
        }
        root() {
            const e = m.stateboundedmerkletree_root(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        constructor(e){
            const n = m.stateboundedmerkletree_blank(e);
            return this.__wbg_ptr = n >>> 0, C8.register(this, this.__wbg_ptr, this), this;
        }
        get height() {
            return m.stateboundedmerkletree_height(this.__wbg_ptr);
        }
        rehash() {
            const e = m.stateboundedmerkletree_rehash(this.__wbg_ptr);
            return am.__wrap(e);
        }
        update(e, n) {
            const r = m.stateboundedmerkletree_update(this.__wbg_ptr, e, n);
            if (r[2]) throw q(r[1]);
            return am.__wrap(r[0]);
        }
        collapse(e, n) {
            const r = m.stateboundedmerkletree_collapse(this.__wbg_ptr, e, n);
            return am.__wrap(r);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.stateboundedmerkletree_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (B2.prototype[Symbol.dispose] = B2.prototype.free);
    const I8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_statemap_free(t >>> 0, 1));
    let D2 = class L_ {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(L_.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();
            m.__wbg_statemap_free(e, 0);
        }
        get(e) {
            const n = m.statemap_get(this.__wbg_ptr, e);
            if (n[2]) throw q(n[1]);
            return n[0] === 0 ? void 0 : Zl.__wrap(n[0]);
        }
        constructor(){
            const e = m.statemap_new();
            return this.__wbg_ptr = e >>> 0, I8.register(this, this.__wbg_ptr, this), this;
        }
        keys() {
            const e = m.statemap_keys(this.__wbg_ptr);
            if (e[3]) throw q(e[2]);
            var n = is(e[0], e[1]).slice();
            return m.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        insert(e, n) {
            ft(n, Zl);
            const r = m.statemap_insert(this.__wbg_ptr, e, n.__wbg_ptr);
            if (r[2]) throw q(r[1]);
            return L_.__wrap(r[0]);
        }
        remove(e) {
            const n = m.statemap_remove(this.__wbg_ptr, e);
            if (n[2]) throw q(n[1]);
            return L_.__wrap(n[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.statemap_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (D2.prototype[Symbol.dispose] = D2.prototype.free);
    const A8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_statevalue_free(t >>> 0, 1));
    let Zl = class uc {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(uc.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();
            m.__wbg_statevalue_free(e, 0);
        }
        arrayPush(e) {
            ft(e, uc);
            const n = m.statevalue_arrayPush(this.__wbg_ptr, e.__wbg_ptr);
            if (n[2]) throw q(n[1]);
            return uc.__wrap(n[0]);
        }
        asBoundedMerkleTree() {
            const e = m.statevalue_asBoundedMerkleTree(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return e[0] === 0 ? void 0 : B2.__wrap(e[0]);
        }
        static newBoundedMerkleTree(e) {
            ft(e, B2);
            const n = m.statevalue_newBoundedMerkleTree(e.__wbg_ptr);
            return uc.__wrap(n);
        }
        constructor(){
            const e = m.statevalue_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, A8.register(this, this.__wbg_ptr, this), this;
        }
        type() {
            let e, n;
            try {
                const r = m.statevalue_type(this.__wbg_ptr);
                return e = r[0], n = r[1], Be(r[0], r[1]);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        asMap() {
            const e = m.statevalue_asMap(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return e[0] === 0 ? void 0 : D2.__wrap(e[0]);
        }
        static decode(e) {
            const n = m.statevalue_decode(e);
            if (n[2]) throw q(n[1]);
            return uc.__wrap(n[0]);
        }
        encode() {
            const e = m.statevalue_encode(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        asCell() {
            const e = m.statevalue_asCell(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        static newMap(e) {
            ft(e, D2);
            const n = m.statevalue_newMap(e.__wbg_ptr);
            return uc.__wrap(n);
        }
        asArray() {
            const e = m.statevalue_asArray(this.__wbg_ptr);
            if (e[3]) throw q(e[2]);
            let n;
            return e[0] !== 0 && (n = is(e[0], e[1]).slice(), m.__wbindgen_free(e[0], e[1] * 4, 4)), n;
        }
        logSize() {
            return m.statevalue_logSize(this.__wbg_ptr) >>> 0;
        }
        static newCell(e) {
            const n = m.statevalue_newCell(e);
            if (n[2]) throw q(n[1]);
            return uc.__wrap(n[0]);
        }
        static newNull() {
            const e = m.statevalue_newNull();
            return uc.__wrap(e);
        }
        static newArray() {
            const e = m.statevalue_newArray();
            return uc.__wrap(e);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.statevalue_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (Zl.prototype[Symbol.dispose] = Zl.prototype.free);
    const P8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_systemtransaction_free(t >>> 0, 1));
    class F0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(F0.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();
            m.__wbg_systemtransaction_free(e, 0);
        }
        static deserialize(e) {
            const n = m.systemtransaction_deserialize(e);
            if (n[2]) throw q(n[1]);
            return F0.__wrap(n[0]);
        }
        constructor(){
            const e = m.systemtransaction_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, P8.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = m.systemtransaction_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.systemtransaction_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (F0.prototype[Symbol.dispose] = F0.prototype.free);
    const O8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_transaction_free(t >>> 0, 1));
    class xn {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(xn.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();
            m.__wbg_transaction_free(e, 0);
        }
        static fromParts(e, n, r, s) {
            const i = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), o = We, a = m.transaction_fromParts(i, o, n, r, s);
            if (a[2]) throw q(a[1]);
            return xn.__wrap(a[0]);
        }
        imbalances(e, n) {
            const r = m.transaction_imbalances(this.__wbg_ptr, e, He(n) ? 0 : mr(n));
            if (r[2]) throw q(r[1]);
            return q(r[0]);
        }
        mockProve() {
            const e = m.transaction_mockProve(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return xn.__wrap(e[0]);
        }
        static deserialize(e, n, r, s) {
            const i = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), o = We, a = st(n, m.__wbindgen_malloc, m.__wbindgen_realloc), c = We, l = st(r, m.__wbindgen_malloc, m.__wbindgen_realloc), u = We, d = m.transaction_deserialize(i, o, a, c, l, u, s);
            if (d[2]) throw q(d[1]);
            return xn.__wrap(d[0]);
        }
        identifiers() {
            const e = m.transaction_identifiers(this.__wbg_ptr);
            if (e[3]) throw q(e[2]);
            var n = is(e[0], e[1]).slice();
            return m.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        set intents(e) {
            const n = m.transaction_set_intents(this.__wbg_ptr, He(e) ? 0 : mr(e));
            if (n[1]) throw q(n[0]);
        }
        wellFormed(e, n, r) {
            ft(e, jo), ft(n, U6);
            const s = m.transaction_wellFormed(this.__wbg_ptr, e.__wbg_ptr, n.__wbg_ptr, r);
            if (s[2]) throw q(s[1]);
            return L0.__wrap(s[0]);
        }
        eraseProofs() {
            const e = m.transaction_eraseProofs(this.__wbg_ptr);
            return xn.__wrap(e);
        }
        static fromRewards(e) {
            ft(e, yc);
            const n = m.transaction_fromRewards(e.__wbg_ptr);
            return xn.__wrap(n);
        }
        get fallibleOffer() {
            return m.transaction_fallibleOffer(this.__wbg_ptr);
        }
        eraseSignatures() {
            const e = m.transaction_eraseSignatures(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return xn.__wrap(e[0]);
        }
        feesWithMargin(e, n) {
            ft(e, wi);
            const r = m.transaction_feesWithMargin(this.__wbg_ptr, e.__wbg_ptr, n);
            if (r[2]) throw q(r[1]);
            return q(r[0]);
        }
        get guaranteedOffer() {
            const e = m.transaction_guaranteedOffer(this.__wbg_ptr);
            return e === 0 ? void 0 : rs.__wrap(e);
        }
        transactionHash() {
            let e, n;
            try {
                const i = m.transaction_transactionHash(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, q(i[2]);
                return e = r, n = s, Be(r, s);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        get bindingRandomness() {
            const e = m.transaction_bindingRandomness(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        set fallibleOffer(e) {
            const n = m.transaction_set_fallibleOffer(this.__wbg_ptr, He(e) ? 0 : mr(e));
            if (n[1]) throw q(n[0]);
        }
        set guaranteedOffer(e) {
            const n = m.transaction_set_guaranteedOffer(this.__wbg_ptr, e);
            if (n[1]) throw q(n[0]);
        }
        static fromPartsRandomized(e, n, r, s) {
            const i = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), o = We, a = m.transaction_fromPartsRandomized(i, o, n, r, s);
            if (a[2]) throw q(a[1]);
            return xn.__wrap(a[0]);
        }
        constructor(){
            const e = m.transaction_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, O8.register(this, this.__wbg_ptr, this), this;
        }
        bind() {
            const e = m.transaction_bind(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return xn.__wrap(e[0]);
        }
        cost(e, n) {
            ft(e, wi);
            const r = m.transaction_cost(this.__wbg_ptr, e.__wbg_ptr, He(n) ? 16777215 : n ? 1 : 0);
            if (r[2]) throw q(r[1]);
            return q(r[0]);
        }
        fees(e, n) {
            ft(e, wi);
            const r = m.transaction_fees(this.__wbg_ptr, e.__wbg_ptr, He(n) ? 16777215 : n ? 1 : 0);
            if (r[2]) throw q(r[1]);
            return q(r[0]);
        }
        merge(e) {
            ft(e, xn);
            const n = m.transaction_merge(this.__wbg_ptr, e.__wbg_ptr);
            if (n[2]) throw q(n[1]);
            return xn.__wrap(n[0]);
        }
        prove(e, n) {
            return ft(n, vd), m.transaction_prove(this.__wbg_ptr, e, n.__wbg_ptr);
        }
        get intents() {
            return m.transaction_intents(this.__wbg_ptr);
        }
        get rewards() {
            const e = m.transaction_rewards(this.__wbg_ptr);
            return e === 0 ? void 0 : yc.__wrap(e);
        }
        addCalls(e, n, r, s, i, o, a) {
            ft(r, wi);
            const c = m.transaction_addCalls(this.__wbg_ptr, e, n, r.__wbg_ptr, s, He(i) ? 0 : mr(i), He(o) ? 0 : mr(o), He(a) ? 0 : mr(a));
            if (c[2]) throw q(c[1]);
            return xn.__wrap(c[0]);
        }
        serialize() {
            const e = m.transaction_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.transaction_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (xn.prototype[Symbol.dispose] = xn.prototype.free);
    const LR = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_transactioncontext_free(t >>> 0, 1));
    class L6 {
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, LR.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_transactioncontext_free(e, 0);
        }
        constructor(e, n, r){
            ft(e, jo);
            const s = m.transactioncontext_new(e.__wbg_ptr, n, r);
            if (s[2]) throw q(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, LR.register(this, this.__wbg_ptr, this), this;
        }
        toString(e) {
            let n, r;
            try {
                const s = m.transactioncontext_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (L6.prototype[Symbol.dispose] = L6.prototype.free);
    const M8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_transactioncostmodel_free(t >>> 0, 1));
    class Qf {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Qf.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();
            m.__wbg_transactioncostmodel_free(e, 0);
        }
        static deserialize(e) {
            const n = m.transactioncostmodel_deserialize(e);
            if (n[2]) throw q(n[1]);
            return Qf.__wrap(n[0]);
        }
        get baselineCost() {
            const e = m.transactioncostmodel_baselineCost(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get runtimeCostModel() {
            const e = m.transactioncostmodel_runtimeCostModel(this.__wbg_ptr);
            return vd.__wrap(e);
        }
        static initialTransactionCostModel() {
            const e = m.transactioncostmodel_initialTransactionCostModel();
            return Qf.__wrap(e);
        }
        constructor(){
            const e = m.transactioncostmodel_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, M8.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = m.transactioncostmodel_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.transactioncostmodel_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Qf.prototype[Symbol.dispose] = Qf.prototype.free);
    const R8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_transactionresult_free(t >>> 0, 1));
    class ty {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(ty.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();
            m.__wbg_transactionresult_free(e, 0);
        }
        get successfulSegments() {
            return m.transactionresult_successfulSegments(this.__wbg_ptr);
        }
        constructor(){
            const e = m.transactionresult_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, R8.register(this, this.__wbg_ptr, this), this;
        }
        get error() {
            const e = m.transactionresult_error(this.__wbg_ptr);
            let n;
            return e[0] !== 0 && (n = Be(e[0], e[1]).slice(), m.__wbindgen_free(e[0], e[1] * 1, 1)), n;
        }
        get type() {
            let e, n;
            try {
                const r = m.transactionresult_type_(this.__wbg_ptr);
                return e = r[0], n = r[1], Be(r[0], r[1]);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        get events() {
            const e = m.transactionresult_events(this.__wbg_ptr);
            var n = is(e[0], e[1]).slice();
            return m.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        toString(e) {
            let n, r;
            try {
                const s = m.transactionresult_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (ty.prototype[Symbol.dispose] = ty.prototype.free);
    const N8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_unshieldedoffer_free(t >>> 0, 1));
    class go {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(go.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();
            m.__wbg_unshieldedoffer_free(e, 0);
        }
        get signatures() {
            const e = m.unshieldedoffer_signatures(this.__wbg_ptr);
            if (e[3]) throw q(e[2]);
            var n = is(e[0], e[1]).slice();
            return m.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        addSignatures(e) {
            const n = Jo(e, m.__wbindgen_malloc), r = We, s = m.unshieldedoffer_addSignatures(this.__wbg_ptr, n, r);
            if (s[2]) throw q(s[1]);
            return go.__wrap(s[0]);
        }
        eraseSignatures() {
            const e = m.unshieldedoffer_eraseSignatures(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return go.__wrap(e[0]);
        }
        static new(e, n, r) {
            const s = Jo(e, m.__wbindgen_malloc), i = We, o = Jo(n, m.__wbindgen_malloc), a = We, c = Jo(r, m.__wbindgen_malloc), l = We, u = m.unshieldedoffer_new(s, i, o, a, c, l);
            if (u[2]) throw q(u[1]);
            return go.__wrap(u[0]);
        }
        get inputs() {
            const e = m.unshieldedoffer_inputs(this.__wbg_ptr);
            if (e[3]) throw q(e[2]);
            var n = is(e[0], e[1]).slice();
            return m.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        get outputs() {
            const e = m.unshieldedoffer_outputs(this.__wbg_ptr);
            if (e[3]) throw q(e[2]);
            var n = is(e[0], e[1]).slice();
            return m.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        constructor(){
            const e = m.unshieldedoffer_construct();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, N8.register(this, this.__wbg_ptr, this), this;
        }
        toString(e) {
            let n, r;
            try {
                const s = m.unshieldedoffer_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (go.prototype[Symbol.dispose] = go.prototype.free);
    const V8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_utxometa_free(t >>> 0, 1));
    class ny {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(ny.prototype);
            return n.__wbg_ptr = e, V8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, V8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_utxometa_free(e, 0);
        }
        constructor(e){
            const n = m.utxometa_new(e);
            return this.__wbg_ptr = n >>> 0, V8.register(this, this.__wbg_ptr, this), this;
        }
        get ctime() {
            return m.utxometa_ctime(this.__wbg_ptr);
        }
        set ctime(e) {
            const n = m.utxometa_set_ctime(this.__wbg_ptr, e);
            if (n[1]) throw q(n[0]);
        }
    }
    Symbol.dispose && (ny.prototype[Symbol.dispose] = ny.prototype.free);
    const zR = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_utxostate_free(t >>> 0, 1));
    class eh {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(eh.prototype);
            return n.__wbg_ptr = e, zR.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, zR.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_utxostate_free(e, 0);
        }
        lookupMeta(e) {
            const n = m.utxostate_lookupMeta(this.__wbg_ptr, e);
            if (n[2]) throw q(n[1]);
            return n[0] === 0 ? void 0 : ny.__wrap(n[0]);
        }
        static new(e) {
            const n = m.utxostate_new(e);
            if (n[2]) throw q(n[1]);
            return eh.__wrap(n[0]);
        }
        delta(e, n) {
            ft(e, eh);
            const r = m.utxostate_delta(this.__wbg_ptr, e.__wbg_ptr, He(n) ? 0 : mr(n));
            if (r[2]) throw q(r[1]);
            return q(r[0]);
        }
        get utxos() {
            const e = m.utxostate_utxos(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        filter(e) {
            const n = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), r = We, s = m.utxostate_filter(this.__wbg_ptr, n, r);
            if (s[2]) throw q(s[1]);
            return q(s[0]);
        }
    }
    Symbol.dispose && (eh.prototype[Symbol.dispose] = eh.prototype.free);
    const UR = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_verifiedtransaction_free(t >>> 0, 1));
    class L0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(L0.prototype);
            return n.__wbg_ptr = e, UR.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, UR.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_verifiedtransaction_free(e, 0);
        }
        get transaction() {
            const e = m.verifiedtransaction_transaction(this.__wbg_ptr);
            return xn.__wrap(e);
        }
    }
    Symbol.dispose && (L0.prototype[Symbol.dispose] = L0.prototype.free);
    const B8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_verifierkeyinsert_free(t >>> 0, 1));
    class z0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(z0.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();
            m.__wbg_verifierkeyinsert_free(e, 0);
        }
        get vk() {
            const e = m.verifierkeyinsert_vk(this.__wbg_ptr);
            return T0.__wrap(e);
        }
        constructor(e, n){
            ft(n, T0);
            const r = m.verifierkeyinsert_new(e, n.__wbg_ptr);
            if (r[2]) throw q(r[1]);
            return this.__wbg_ptr = r[0] >>> 0, B8.register(this, this.__wbg_ptr, this), this;
        }
        get operation() {
            return m.verifierkeyinsert_operation(this.__wbg_ptr);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.verifierkeyinsert_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (z0.prototype[Symbol.dispose] = z0.prototype.free);
    const D8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_verifierkeyremove_free(t >>> 0, 1));
    class U0 {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(U0.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();
            m.__wbg_verifierkeyremove_free(e, 0);
        }
        constructor(e, n){
            ft(n, k0);
            const r = m.verifierkeyremove_new(e, n.__wbg_ptr);
            if (r[2]) throw q(r[1]);
            return this.__wbg_ptr = r[0] >>> 0, D8.register(this, this.__wbg_ptr, this), this;
        }
        get version() {
            const e = m.verifierkeyremove_version(this.__wbg_ptr);
            return k0.__wrap(e);
        }
        get operation() {
            return m.verifierkeyremove_operation(this.__wbg_ptr);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.verifierkeyremove_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (U0.prototype[Symbol.dispose] = U0.prototype.free);
    typeof FinalizationRegistry > "u" || new FinalizationRegistry((t)=>m.__wbg_vmresults_free(t >>> 0, 1));
    const F8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_vmstack_free(t >>> 0, 1));
    let z6 = class Vj {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Vj.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();
            m.__wbg_vmstack_free(e, 0);
        }
        removeLast() {
            m.vmstack_removeLast(this.__wbg_ptr);
        }
        get(e) {
            const n = m.vmstack_get(this.__wbg_ptr, e);
            return n === 0 ? void 0 : Zl.__wrap(n);
        }
        constructor(){
            const e = m.vmstack_new();
            return this.__wbg_ptr = e >>> 0, F8.register(this, this.__wbg_ptr, this), this;
        }
        push(e, n) {
            ft(e, Zl), m.vmstack_push(this.__wbg_ptr, e.__wbg_ptr, n);
        }
        length() {
            return m.vmstack_length(this.__wbg_ptr) >>> 0;
        }
        isStrong(e) {
            const n = m.vmstack_isStrong(this.__wbg_ptr, e);
            return n === 16777215 ? void 0 : n !== 0;
        }
        toString(e) {
            let n, r;
            try {
                const s = m.vmstack_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (z6.prototype[Symbol.dispose] = z6.prototype.free);
    const HR = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_wellformedstrictness_free(t >>> 0, 1));
    class U6 {
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, HR.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_wellformedstrictness_free(e, 0);
        }
        get enforceLimits() {
            return m.wellformedstrictness_enforce_limits(this.__wbg_ptr) !== 0;
        }
        get enforceBalancing() {
            return m.wellformedstrictness_enforce_balancing(this.__wbg_ptr) !== 0;
        }
        get verifySignatures() {
            return m.wellformedstrictness_verify_signatures(this.__wbg_ptr) !== 0;
        }
        set enforceLimits(e) {
            m.wellformedstrictness_set_enforce_limits(this.__wbg_ptr, e);
        }
        get verifyNativeProofs() {
            return m.wellformedstrictness_verify_native_proofs(this.__wbg_ptr) !== 0;
        }
        set enforceBalancing(e) {
            m.wellformedstrictness_set_enforce_balancing(this.__wbg_ptr, e);
        }
        set verifySignatures(e) {
            m.wellformedstrictness_set_verify_signatures(this.__wbg_ptr, e);
        }
        get verifyContractProofs() {
            return m.wellformedstrictness_verify_contract_proofs(this.__wbg_ptr) !== 0;
        }
        set verifyNativeProofs(e) {
            m.wellformedstrictness_set_verify_native_proofs(this.__wbg_ptr, e);
        }
        set verifyContractProofs(e) {
            m.wellformedstrictness_set_verify_contract_proofs(this.__wbg_ptr, e);
        }
        constructor(){
            const e = m.wellformedstrictness_new();
            return this.__wbg_ptr = e >>> 0, HR.register(this, this.__wbg_ptr, this), this;
        }
    }
    Symbol.dispose && (U6.prototype[Symbol.dispose] = U6.prototype.free);
    const L8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_zswapchainstate_free(t >>> 0, 1));
    class lo {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(lo.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();
            m.__wbg_zswapchainstate_free(e, 0);
        }
        get firstFree() {
            const e = m.zswapchainstate_firstFree(this.__wbg_ptr);
            return BigInt.asUintN(64, e);
        }
        static deserialize(e) {
            const n = m.zswapchainstate_deserialize(e);
            if (n[2]) throw q(n[1]);
            return lo.__wrap(n[0]);
        }
        postBlockUpdate(e) {
            const n = m.zswapchainstate_postBlockUpdate(this.__wbg_ptr, e);
            return lo.__wrap(n);
        }
        static deserializeFromLedgerState(e) {
            const n = m.zswapchainstate_deserializeFromLedgerState(e);
            if (n[2]) throw q(n[1]);
            return lo.__wrap(n[0]);
        }
        constructor(){
            const e = m.zswapchainstate_new();
            return this.__wbg_ptr = e >>> 0, L8.register(this, this.__wbg_ptr, this), this;
        }
        filter(e) {
            const n = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), r = We, s = m.zswapchainstate_filter(this.__wbg_ptr, n, r);
            if (s[2]) throw q(s[1]);
            return lo.__wrap(s[0]);
        }
        serialize() {
            const e = m.zswapchainstate_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.zswapchainstate_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
        tryApply(e, n) {
            ft(e, rs);
            const r = m.zswapchainstate_tryApply(this.__wbg_ptr, e.__wbg_ptr, n);
            if (r[2]) throw q(r[1]);
            return q(r[0]);
        }
    }
    Symbol.dispose && (lo.prototype[Symbol.dispose] = lo.prototype.free);
    const z8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_zswapinput_free(t >>> 0, 1));
    class Fl {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Fl.prototype);
            return n.__wbg_ptr = e, z8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, z8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_zswapinput_free(e, 0);
        }
        static deserialize(e, n) {
            const r = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), s = We, i = m.zswapinput_deserialize(r, s, n);
            if (i[2]) throw q(i[1]);
            return Fl.__wrap(i[0]);
        }
        get contractAddress() {
            const e = m.zswapinput_contractAddress(this.__wbg_ptr);
            if (e[3]) throw q(e[2]);
            let n;
            return e[0] !== 0 && (n = Be(e[0], e[1]).slice(), m.__wbindgen_free(e[0], e[1] * 1, 1)), n;
        }
        static newContractOwned(e, n, r, s) {
            const i = st(r, m.__wbindgen_malloc, m.__wbindgen_realloc), o = We;
            ft(s, lo);
            const a = m.zswapinput_newContractOwned(e, He(n) ? 16777215 : n, i, o, s.__wbg_ptr);
            if (a[2]) throw q(a[1]);
            return Fl.__wrap(a[0]);
        }
        constructor(){
            const e = m.zswapinput_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, z8.register(this, this.__wbg_ptr, this), this;
        }
        get proof() {
            const e = m.zswapinput_proof(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get nullifier() {
            let e, n;
            try {
                const i = m.zswapinput_nullifier(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, q(i[2]);
                return e = r, n = s, Be(r, s);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        serialize() {
            const e = m.zswapinput_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.zswapinput_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Fl.prototype[Symbol.dispose] = Fl.prototype.free);
    const U8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_zswaplocalstate_free(t >>> 0, 1));
    class zs {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(zs.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();
            m.__wbg_zswaplocalstate_free(e, 0);
        }
        get firstFree() {
            const e = m.zswaplocalstate_firstFree(this.__wbg_ptr);
            return BigInt.asUintN(64, e);
        }
        static deserialize(e) {
            const n = m.zswaplocalstate_deserialize(e);
            if (n[2]) throw q(n[1]);
            return zs.__wrap(n[0]);
        }
        applyFailed(e) {
            ft(e, rs);
            const n = m.zswaplocalstate_applyFailed(this.__wbg_ptr, e.__wbg_ptr);
            return zs.__wrap(n);
        }
        clearPending(e) {
            const n = m.zswaplocalstate_clearPending(this.__wbg_ptr, e);
            return zs.__wrap(n);
        }
        replayEvents(e, n) {
            ft(e, Ui);
            const r = Jo(n, m.__wbindgen_malloc), s = We, i = m.zswaplocalstate_replayEvents(this.__wbg_ptr, e.__wbg_ptr, r, s);
            if (i[2]) throw q(i[1]);
            return zs.__wrap(i[0]);
        }
        get pendingSpends() {
            const e = m.zswaplocalstate_pendingSpends(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get pendingOutputs() {
            const e = m.zswaplocalstate_pendingOutputs(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        spendFromOutput(e, n, r, s, i) {
            ft(e, Ui), ft(s, qi);
            const o = m.zswaplocalstate_spendFromOutput(this.__wbg_ptr, e.__wbg_ptr, n, He(r) ? 16777215 : r, s.__wbg_ptr, He(i) ? 0 : mr(i));
            if (o[2]) throw q(o[1]);
            return q(o[0]);
        }
        revertTransaction(e) {
            ft(e, xn);
            const n = m.zswaplocalstate_revertTransaction(this.__wbg_ptr, e.__wbg_ptr);
            return zs.__wrap(n);
        }
        applyCollapsedUpdate(e) {
            ft(e, O0);
            const n = m.zswaplocalstate_applyCollapsedUpdate(this.__wbg_ptr, e.__wbg_ptr);
            if (n[2]) throw q(n[1]);
            return zs.__wrap(n[0]);
        }
        replayEventsWithChanges(e, n) {
            ft(e, Ui);
            const r = Jo(n, m.__wbindgen_malloc), s = We, i = m.zswaplocalstate_replayEventsWithChanges(this.__wbg_ptr, e.__wbg_ptr, r, s);
            if (i[2]) throw q(i[1]);
            return ry.__wrap(i[0]);
        }
        constructor(){
            const e = m.zswaplocalstate_new();
            return this.__wbg_ptr = e >>> 0, U8.register(this, this.__wbg_ptr, this), this;
        }
        apply(e, n) {
            ft(e, Ui), ft(n, rs);
            const r = m.zswaplocalstate_apply(this.__wbg_ptr, e.__wbg_ptr, n.__wbg_ptr);
            if (r[2]) throw q(r[1]);
            return zs.__wrap(r[0]);
        }
        get coins() {
            const e = m.zswaplocalstate_coins(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        spend(e, n, r, s) {
            ft(e, Ui);
            const i = m.zswaplocalstate_spend(this.__wbg_ptr, e.__wbg_ptr, n, He(r) ? 16777215 : r, He(s) ? 0 : mr(s));
            if (i[2]) throw q(i[1]);
            return q(i[0]);
        }
        serialize() {
            const e = m.zswaplocalstate_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.zswaplocalstate_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
        watchFor(e, n) {
            const r = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), s = We, i = m.zswaplocalstate_watchFor(this.__wbg_ptr, r, s, n);
            if (i[2]) throw q(i[1]);
            return zs.__wrap(i[0]);
        }
    }
    Symbol.dispose && (zs.prototype[Symbol.dispose] = zs.prototype.free);
    const jR = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_zswaplocalstatewithchanges_free(t >>> 0, 1));
    class ry {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(ry.prototype);
            return n.__wbg_ptr = e, jR.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, jR.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_zswaplocalstatewithchanges_free(e, 0);
        }
        get state() {
            const e = m.zswaplocalstatewithchanges_state(this.__wbg_ptr);
            return zs.__wrap(e);
        }
        get changes() {
            const e = m.zswaplocalstatewithchanges_changes(this.__wbg_ptr);
            var n = is(e[0], e[1]).slice();
            return m.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
    }
    Symbol.dispose && (ry.prototype[Symbol.dispose] = ry.prototype.free);
    const H8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_zswapoffer_free(t >>> 0, 1));
    class rs {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(rs.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();
            m.__wbg_zswapoffer_free(e, 0);
        }
        static fromInput(e, n, r) {
            ft(e, Fl);
            var s = He(n) ? 0 : st(n, m.__wbindgen_malloc, m.__wbindgen_realloc), i = We;
            const o = m.zswapoffer_fromInput(e.__wbg_ptr, s, i, He(r) ? 0 : mr(r));
            if (o[2]) throw q(o[1]);
            return rs.__wrap(o[0]);
        }
        get transients() {
            const e = m.zswapoffer_transients(this.__wbg_ptr);
            var n = is(e[0], e[1]).slice();
            return m.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        static deserialize(e, n) {
            const r = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), s = We, i = m.zswapoffer_deserialize(r, s, n);
            if (i[2]) throw q(i[1]);
            return rs.__wrap(i[0]);
        }
        static fromOutput(e, n, r) {
            ft(e, qi);
            var s = He(n) ? 0 : st(n, m.__wbindgen_malloc, m.__wbindgen_realloc), i = We;
            const o = m.zswapoffer_fromOutput(e.__wbg_ptr, s, i, He(r) ? 0 : mr(r));
            if (o[2]) throw q(o[1]);
            return rs.__wrap(o[0]);
        }
        static fromTransient(e) {
            ft(e, Ll);
            const n = m.zswapoffer_fromTransient(e.__wbg_ptr);
            if (n[2]) throw q(n[1]);
            return rs.__wrap(n[0]);
        }
        constructor(){
            const e = m.zswapoffer_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, H8.register(this, this.__wbg_ptr, this), this;
        }
        merge(e) {
            ft(e, rs);
            const n = m.zswapoffer_merge(this.__wbg_ptr, e.__wbg_ptr);
            if (n[2]) throw q(n[1]);
            return rs.__wrap(n[0]);
        }
        get deltas() {
            const e = m.zswapoffer_deltas(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get inputs() {
            const e = m.zswapoffer_inputs(this.__wbg_ptr);
            var n = is(e[0], e[1]).slice();
            return m.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        get outputs() {
            const e = m.zswapoffer_outputs(this.__wbg_ptr);
            var n = is(e[0], e[1]).slice();
            return m.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        serialize() {
            const e = m.zswapoffer_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.zswapoffer_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (rs.prototype[Symbol.dispose] = rs.prototype.free);
    const j8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_zswapoutput_free(t >>> 0, 1));
    class qi {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(qi.prototype);
            return n.__wbg_ptr = e, j8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, j8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_zswapoutput_free(e, 0);
        }
        get commitment() {
            let e, n;
            try {
                const i = m.zswapoutput_commitment(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, q(i[2]);
                return e = r, n = s, Be(r, s);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        static deserialize(e, n) {
            const r = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), s = We, i = m.zswapoutput_deserialize(r, s, n);
            if (i[2]) throw q(i[1]);
            return qi.__wrap(i[0]);
        }
        get contractAddress() {
            const e = m.zswapoutput_contractAddress(this.__wbg_ptr);
            if (e[3]) throw q(e[2]);
            let n;
            return e[0] !== 0 && (n = Be(e[0], e[1]).slice(), m.__wbindgen_free(e[0], e[1] * 1, 1)), n;
        }
        static newContractOwned(e, n, r) {
            const s = st(r, m.__wbindgen_malloc, m.__wbindgen_realloc), i = We, o = m.zswapoutput_newContractOwned(e, He(n) ? 16777215 : n, s, i);
            if (o[2]) throw q(o[1]);
            return qi.__wrap(o[0]);
        }
        static new(e, n, r, s) {
            const i = st(r, m.__wbindgen_malloc, m.__wbindgen_realloc), o = We, a = st(s, m.__wbindgen_malloc, m.__wbindgen_realloc), c = We, l = m.zswapoutput_new(e, He(n) ? 16777215 : n, i, o, a, c);
            if (l[2]) throw q(l[1]);
            return qi.__wrap(l[0]);
        }
        get proof() {
            const e = m.zswapoutput_proof(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        constructor(){
            const e = m.zswapoutput_construct();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, j8.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = m.zswapoutput_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.zswapoutput_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (qi.prototype[Symbol.dispose] = qi.prototype.free);
    const q8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_zswapsecretkeys_free(t >>> 0, 1));
    class Ui {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Ui.prototype);
            return n.__wbg_ptr = e, q8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, q8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_zswapsecretkeys_free(e, 0);
        }
        static fromSeedRng(e) {
            const n = m.zswapsecretkeys_fromSeedRng(e);
            if (n[2]) throw q(n[1]);
            return Ui.__wrap(n[0]);
        }
        get coinPublicKey() {
            let e, n;
            try {
                const i = m.zswapsecretkeys_coinPublicKey(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, q(i[2]);
                return e = r, n = s, Be(r, s);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        get coinSecretKey() {
            const e = m.zswapsecretkeys_coinSecretKey(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return x0.__wrap(e[0]);
        }
        get encryptionPublicKey() {
            let e, n;
            try {
                const i = m.zswapsecretkeys_encryptionPublicKey(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, q(i[2]);
                return e = r, n = s, Be(r, s);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        get encryptionSecretKey() {
            const e = m.zswapsecretkeys_encryptionSecretKey(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return Yf.__wrap(e[0]);
        }
        constructor(){
            const e = m.zswapsecretkeys_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, q8.register(this, this.__wbg_ptr, this), this;
        }
        clear() {
            m.zswapsecretkeys_clear(this.__wbg_ptr);
        }
        static fromSeed(e) {
            const n = m.zswapsecretkeys_fromSeed(e);
            if (n[2]) throw q(n[1]);
            return Ui.__wrap(n[0]);
        }
    }
    Symbol.dispose && (Ui.prototype[Symbol.dispose] = Ui.prototype.free);
    const qR = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_zswapstatechanges_free(t >>> 0, 1));
    class sy {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(sy.prototype);
            return n.__wbg_ptr = e, qR.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, qR.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_zswapstatechanges_free(e, 0);
        }
        get spentCoins() {
            const e = m.zswapstatechanges_spentCoins(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get receivedCoins() {
            const e = m.zswapstatechanges_receivedCoins(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get source() {
            let e, n;
            try {
                const i = m.zswapstatechanges_source(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, q(i[2]);
                return e = r, n = s, Be(r, s);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
    }
    Symbol.dispose && (sy.prototype[Symbol.dispose] = sy.prototype.free);
    const K8 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>m.__wbg_zswaptransient_free(t >>> 0, 1));
    class Ll {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Ll.prototype);
            return n.__wbg_ptr = e, K8.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, K8.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            m.__wbg_zswaptransient_free(e, 0);
        }
        get commitment() {
            let e, n;
            try {
                const i = m.zswaptransient_commitment(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, q(i[2]);
                return e = r, n = s, Be(r, s);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        static deserialize(e, n) {
            const r = st(e, m.__wbindgen_malloc, m.__wbindgen_realloc), s = We, i = m.zswaptransient_deserialize(r, s, n);
            if (i[2]) throw q(i[1]);
            return Ll.__wrap(i[0]);
        }
        get inputProof() {
            const e = m.zswaptransient_inputProof(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get outputProof() {
            const e = m.zswaptransient_outputProof(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        get contractAddress() {
            const e = m.zswaptransient_contractAddress(this.__wbg_ptr);
            if (e[3]) throw q(e[2]);
            let n;
            return e[0] !== 0 && (n = Be(e[0], e[1]).slice(), m.__wbindgen_free(e[0], e[1] * 1, 1)), n;
        }
        static newFromContractOwnedOutput(e, n, r) {
            ft(r, qi);
            const s = m.zswaptransient_newFromContractOwnedOutput(e, He(n) ? 16777215 : n, r.__wbg_ptr);
            if (s[2]) throw q(s[1]);
            return Ll.__wrap(s[0]);
        }
        constructor(){
            const e = m.zswaptransient_new();
            if (e[2]) throw q(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, K8.register(this, this.__wbg_ptr, this), this;
        }
        get nullifier() {
            let e, n;
            try {
                const i = m.zswaptransient_nullifier(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, q(i[2]);
                return e = r, n = s, Be(r, s);
            } finally{
                m.__wbindgen_free(e, n, 1);
            }
        }
        serialize() {
            const e = m.zswaptransient_serialize(this.__wbg_ptr);
            if (e[2]) throw q(e[1]);
            return q(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = m.zswaptransient_toString(this.__wbg_ptr, He(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], Be(s[0], s[1]);
            } finally{
                m.__wbindgen_free(n, r, 1);
            }
        }
    }
    Symbol.dispose && (Ll.prototype[Symbol.dispose] = Ll.prototype.free);
    function hae() {
        return li(function(t) {
            return BigInt(t);
        }, arguments);
    }
    function pae(t) {
        return BigInt(t);
    }
    function gae(t, e) {
        return Error(Be(t, e));
    }
    function bae(t) {
        return Number(t);
    }
    function mae(t, e) {
        const n = String(e), r = st(n, m.__wbindgen_malloc, m.__wbindgen_realloc), s = We;
        ia().setInt32(t + 4, s, !0), ia().setInt32(t + 0, r, !0);
    }
    function yae(t, e) {
        return t.add(e);
    }
    function wae(t) {
        return _0.__wrap(t);
    }
    function _ae(t) {
        return t.buffer;
    }
    function xae(t) {
        const e = t.byobRequest;
        return He(e) ? 0 : mr(e);
    }
    function vae(t) {
        return t.byteLength;
    }
    function Sae(t) {
        return t.byteOffset;
    }
    function kae() {
        return li(function(t, e) {
            return t.call(e);
        }, arguments);
    }
    function Tae() {
        return li(function(t, e, n, r) {
            return t.call(e, n, r);
        }, arguments);
    }
    function Eae() {
        return li(function(t, e, n) {
            return t.call(e, n);
        }, arguments);
    }
    function Cae() {
        return li(function(t, e, n, r, s) {
            return t.call(e, n, r, s);
        }, arguments);
    }
    function Iae() {
        return li(function(t) {
            t.close();
        }, arguments);
    }
    function Aae() {
        return li(function(t) {
            t.close();
        }, arguments);
    }
    function Pae(t) {
        return vh.__wrap(t);
    }
    function Oae(t) {
        return Sh.__wrap(t);
    }
    function Mae(t) {
        return E0.__wrap(t);
    }
    function Rae(t) {
        return t.crypto;
    }
    function Nae(t) {
        return t.done;
    }
    function Vae(t) {
        return Ca.__wrap(t);
    }
    function Bae(t) {
        return Yo.__wrap(t);
    }
    function Dae(t) {
        return Gl.__wrap(t);
    }
    function Fae(t) {
        return I0.__wrap(t);
    }
    function Lae(t) {
        return Qm.__wrap(t);
    }
    function zae() {
        return li(function(t, e) {
            t.enqueue(e);
        }, arguments);
    }
    function Uae(t) {
        return Object.entries(t);
    }
    function Hae(t) {
        return kd.__wrap(t);
    }
    function jae(t) {
        return kd.__unwrap(t);
    }
    function qae(t, e, n) {
        try {
            var r = {
                a: e,
                b: n
            }, s = (i, o, a)=>{
                const c = r.a;
                r.a = 0;
                try {
                    return fae(c, r.b, i, o, a);
                } finally{
                    r.a = c;
                }
            };
            t.forEach(s);
        } finally{
            r.a = r.b = 0;
        }
    }
    function Kae(t, e, n) {
        try {
            var r = {
                a: e,
                b: n
            }, s = (i, o)=>{
                const a = r.a;
                r.a = 0;
                try {
                    return Mj(a, r.b, i, o);
                } finally{
                    r.a = a;
                }
            };
            t.forEach(s);
        } finally{
            r.a = r.b = 0;
        }
    }
    function Wae(t) {
        return Array.from(t);
    }
    function $ae() {
        return li(function(t) {
            return Reflect.getPrototypeOf(t);
        }, arguments);
    }
    function Xae() {
        return li(function(t, e) {
            t.getRandomValues(e);
        }, arguments);
    }
    function Gae(t) {
        return t.getTime();
    }
    function Zae(t, e) {
        return t[e >>> 0];
    }
    function Jae() {
        return li(function(t, e) {
            return Reflect.get(t, e);
        }, arguments);
    }
    function Yae(t, e) {
        return t.get(e);
    }
    function Qae(t, e) {
        return t[e];
    }
    function ece(t) {
        let e;
        try {
            e = t instanceof ArrayBuffer;
        } catch  {
            e = !1;
        }
        return e;
    }
    function tce(t) {
        let e;
        try {
            e = t instanceof Date;
        } catch  {
            e = !1;
        }
        return e;
    }
    function nce(t) {
        let e;
        try {
            e = t instanceof Map;
        } catch  {
            e = !1;
        }
        return e;
    }
    function rce(t) {
        let e;
        try {
            e = t instanceof Promise;
        } catch  {
            e = !1;
        }
        return e;
    }
    function sce(t) {
        let e;
        try {
            e = t instanceof Set;
        } catch  {
            e = !1;
        }
        return e;
    }
    function ice(t) {
        let e;
        try {
            e = t instanceof Uint8Array;
        } catch  {
            e = !1;
        }
        return e;
    }
    function oce(t) {
        return Gr.__wrap(t);
    }
    function ace(t) {
        return Array.isArray(t);
    }
    function cce(t) {
        return Number.isSafeInteger(t);
    }
    function lce() {
        return Symbol.iterator;
    }
    function uce(t) {
        return t.keys();
    }
    function dce(t) {
        return jo.__wrap(t);
    }
    function fce(t) {
        return t.length;
    }
    function hce(t) {
        return t.length;
    }
    function pce(t) {
        return Td.__wrap(t);
    }
    function gce(t) {
        return t.msCrypto;
    }
    function bce() {
        return new Date;
    }
    function mce(t) {
        return new Set(t);
    }
    function yce() {
        return new Object;
    }
    function wce() {
        return new Array;
    }
    function _ce(t, e) {
        try {
            var n = {
                a: t,
                b: e
            }, r = (i, o)=>{
                const a = n.a;
                n.a = 0;
                try {
                    return Mj(a, n.b, i, o);
                } finally{
                    n.a = a;
                }
            };
            return new Promise(r);
        } finally{
            n.a = n.b = 0;
        }
    }
    function xce() {
        return new Map;
    }
    function vce(t) {
        return new Uint8Array(t);
    }
    function Sce(t, e) {
        return new Error(Be(t, e));
    }
    function kce(t, e) {
        return new Uint8Array(Iv(t, e));
    }
    function Tce(t, e) {
        return new Function(Be(t, e));
    }
    function Ece(t, e, n) {
        return new Uint8Array(t, e >>> 0, n >>> 0);
    }
    function Cce(t) {
        return new Uint8Array(t >>> 0);
    }
    function Ice(t) {
        return t.next;
    }
    function Ace() {
        return li(function(t) {
            return t.next();
        }, arguments);
    }
    function Pce(t) {
        return M0.__wrap(t);
    }
    function Oce(t) {
        return t.node;
    }
    function Mce(t) {
        return ey.__wrap(t);
    }
    function Rce(t) {
        return R0.__wrap(t);
    }
    function Nce(t) {
        return N0.__wrap(t);
    }
    function Vce(t) {
        return t.process;
    }
    function Bce(t) {
        return V0.__wrap(t);
    }
    function Dce(t, e, n) {
        Uint8Array.prototype.set.call(Iv(t, e), n);
    }
    function Fce(t, e) {
        return t.push(e);
    }
    function Lce(t) {
        queueMicrotask(t);
    }
    function zce(t) {
        return t.queueMicrotask;
    }
    function Uce() {
        return li(function(t, e) {
            t.randomFillSync(e);
        }, arguments);
    }
    function Hce(t) {
        return B0.__wrap(t);
    }
    function jce() {
        return li(function() {
            return module.require;
        }, arguments);
    }
    function qce(t) {
        return Promise.resolve(t);
    }
    function Kce() {
        return li(function(t, e) {
            t.respond(e >>> 0);
        }, arguments);
    }
    function Wce(t, e) {
        return t.setTime(e);
    }
    function $ce(t, e, n) {
        t.set(Iv(e, n));
    }
    function Xce(t, e, n) {
        t[e] = n;
    }
    function Gce(t, e, n) {
        t[e >>> 0] = n;
    }
    function Zce(t, e, n) {
        return t.set(e, n);
    }
    function Jce(t) {
        return Ed.__wrap(t);
    }
    function Yce(t) {
        return D0.__wrap(t);
    }
    function Qce(t) {
        return t.size;
    }
    function ele(t) {
        return Zl.__wrap(t);
    }
    function tle() {
        const t = typeof globalThis > "u" ? null : globalThis;
        return He(t) ? 0 : mr(t);
    }
    function nle() {
        const t = typeof globalThis > "u" ? null : globalThis;
        return He(t) ? 0 : mr(t);
    }
    function rle() {
        const t = typeof self > "u" ? null : self;
        return He(t) ? 0 : mr(t);
    }
    function sle() {
        const t = typeof window > "u" ? null : window;
        return He(t) ? 0 : mr(t);
    }
    function ile(t, e, n) {
        return t.subarray(e >>> 0, n >>> 0);
    }
    function ole(t, e, n) {
        return t.then(e, n);
    }
    function ale(t, e) {
        return t.then(e);
    }
    function cle() {
        return li(function(t, e) {
            return t.toString(e);
        }, arguments);
    }
    function lle(t) {
        return t.toString();
    }
    function ule(t) {
        return xn.__wrap(t);
    }
    function dle(t) {
        return ty.__wrap(t);
    }
    function fle(t) {
        return t.value;
    }
    function hle(t) {
        return z0.__wrap(t);
    }
    function ple(t) {
        return U0.__wrap(t);
    }
    function gle(t) {
        return t.versions;
    }
    function ble(t) {
        const e = t.view;
        return He(e) ? 0 : mr(e);
    }
    function mle(t, e) {
        const n = e, r = typeof n == "bigint" ? n : void 0;
        ia().setBigInt64(t + 8, He(r) ? BigInt(0) : r, !0), ia().setInt32(t + 0, !He(r), !0);
    }
    function yle(t) {
        const e = t, n = typeof e == "boolean" ? e : void 0;
        return He(n) ? 16777215 : n ? 1 : 0;
    }
    function wle(t) {
        const e = t.original;
        return e.cnt-- == 1 ? (e.a = 0, !0) : !1;
    }
    function _le(t, e) {
        const n = O6(e), r = st(n, m.__wbindgen_malloc, m.__wbindgen_realloc), s = We;
        ia().setInt32(t + 4, s, !0), ia().setInt32(t + 0, r, !0);
    }
    function xle(t, e) {
        return t in e;
    }
    function vle(t) {
        return typeof t == "bigint";
    }
    function Sle(t) {
        return typeof t == "function";
    }
    function kle(t) {
        return t === null;
    }
    function Tle(t) {
        const e = t;
        return typeof e == "object" && e !== null;
    }
    function Ele(t) {
        return typeof t == "string";
    }
    function Cle(t) {
        return t === void 0;
    }
    function Ile(t, e) {
        return t === e;
    }
    function Ale(t, e) {
        return t == e;
    }
    function Ple(t, e) {
        const n = e, r = typeof n == "number" ? n : void 0;
        ia().setFloat64(t + 8, He(r) ? 0 : r, !0), ia().setInt32(t + 0, !He(r), !0);
    }
    function Ole(t, e) {
        return t >> e;
    }
    function Mle(t, e) {
        const n = e, r = typeof n == "string" ? n : void 0;
        var s = He(r) ? 0 : st(r, m.__wbindgen_malloc, m.__wbindgen_realloc), i = We;
        ia().setInt32(t + 4, i, !0), ia().setInt32(t + 0, s, !0);
    }
    function Rle(t, e) {
        throw new Error(Be(t, e));
    }
    function Nle(t) {
        return lo.__wrap(t);
    }
    function Vle(t) {
        return Fl.__wrap(t);
    }
    function Ble(t) {
        return zs.__wrap(t);
    }
    function Dle(t) {
        return rs.__wrap(t);
    }
    function Fle(t) {
        return qi.__wrap(t);
    }
    function Lle(t) {
        return sy.__wrap(t);
    }
    function zle(t) {
        return Ll.__wrap(t);
    }
    function Ule(t, e) {
        var n = is(t, e).slice();
        return m.__wbindgen_free(t, e * 4, 4), n;
    }
    function Hle(t, e) {
        return Be(t, e);
    }
    function jle(t, e) {
        return BigInt.asUintN(64, t) | e << BigInt(64);
    }
    function qle(t) {
        return BigInt.asUintN(64, t);
    }
    function Kle(t) {
        return t;
    }
    function Wle(t, e) {
        return Iv(t, e);
    }
    function $le(t, e) {
        return aae(t, e, 3108, dae);
    }
    function Xle(t) {
        return t;
    }
    function Gle(t, e) {
        return BigInt.asUintN(64, t) | BigInt.asUintN(64, e) << BigInt(64);
    }
    function Zle() {
        const t = m.__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 Jle() {
        return Fl;
    }
    function Yle() {
        return rs;
    }
    function Qle() {
        return qi;
    }
    function eue() {
        return Ll;
    }
    function tue() {
        return D6;
    }
    function nue() {
        return I0;
    }
    function rue() {
        return Ca;
    }
    function sue() {
        return Gl;
    }
    function iue() {
        return D0;
    }
    function oue() {
        return Ed;
    }
    function aue() {
        return Gr;
    }
    function cue() {
        return vh;
    }
    function lue() {
        return Sh;
    }
    function uue() {
        return B0;
    }
    function due() {
        return Td;
    }
    function fue() {
        return z0;
    }
    function hue() {
        return U0;
    }
    URL = globalThis.URL;
    const k = await Ij({
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline0.js": {
            PreTranscript_: nae
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline1.js": {
            UnshieldedOffer_: rae
        },
        "./midnight_ledger_wasm_bg.js": {
            __wbg_zswapinput_new: Vle,
            __wbg_zswapoffer_new: Dle,
            __wbg_zswapoutput_new: Fle,
            __wbg_zswaptransient_new: zle,
            __wbg_zswapchainstate_new: Nle,
            __wbg_zswaplocalstate_new: Ble,
            __wbg_duststatechanges_new: Lae,
            __wbg_zswapstatechanges_new: Lle,
            __wbg_transaction_new: ule,
            __wbg_transactionresult_new: dle,
            __wbg_event_new: Hae,
            __wbg_dustspend_new: Fae,
            __wbg_dustactions_new: Vae,
            __wbg_dustlocalstate_new: Bae,
            __wbg_dustregistration_new: Dae,
            __wbg_ledgerstate_new: dce,
            __wbg_proof_new: Bce,
            __wbg_binding_new: wae,
            __wbg_noproof_new: Mce,
            __wbg_preproof_new: Nce,
            __wbg_nobinding_new: Pce,
            __wbg_prebinding_new: Rce,
            __wbg_signatureerased_new: Yce,
            __wbg_signatureenabled_new: Jce,
            __wbg_intent_new: oce,
            __wbg_contractcall_new: Pae,
            __wbg_contractdeploy_new: Oae,
            __wbg_replaceauthority_new: Hce,
            __wbg_maintenanceupdate_new: pce,
            __wbg_verifierkeyinsert_new: hle,
            __wbg_verifierkeyremove_new: ple,
            __wbg_event_unwrap: jae,
            __wbg_statevalue_new: ele,
            __wbg_contractstate_new: Mae,
            __wbg_getwithrefkey_1dc361bd10053bfe: Qae,
            __wbg_set_3f1d0b984ed272ed: Xce,
            __wbg_String_8f0eb39a4a4c2f66: mae,
            __wbg_queueMicrotask_25d0739ac89e8c88: Lce,
            __wbg_queueMicrotask_4488407636f5bf24: zce,
            __wbg_respond_6c2c4e20ef85138e: Kce,
            __wbg_view_91cc97d57ab30530: ble,
            __wbg_byobRequest_2c036bceca1e6037: xae,
            __wbg_close_cccada6053ee3a65: Iae,
            __wbg_enqueue_452bc2343d1c2ff9: zae,
            __wbg_close_d71a78219dc23e91: Aae,
            __wbg_crypto_86f2631e91b51511: Rae,
            __wbg_process_3975fd6c72f520aa: Vce,
            __wbg_versions_4e31226f5e8dc909: gle,
            __wbg_node_e1f24f89a7336c2e: Oce,
            __wbg_require_b74f47fc2d022fd6: jce,
            __wbg_msCrypto_d562bbe83e0d4b91: gce,
            __wbg_getRandomValues_b3f15fcbfabb0f8b: Xae,
            __wbg_randomFillSync_f8c153b79f285817: Uce,
            __wbg_byteLength_331a6b5545834024: vae,
            __wbg_byteOffset_49a5b5608000358b: Sae,
            __wbg_newfromslice_074c56947bd43469: kce,
            __wbg_newwithlength_a167dcc7aaa3ba77: Cce,
            __wbg_newwithbyteoffsetandlength_e8f53910b4d42b45: Ece,
            __wbg_new_638ebfaedbf32a5e: vce,
            __wbg_buffer_8d40b1d762fb3c66: _ae,
            __wbg_length_6bb7e81f9d7713e4: hce,
            __wbg_prototypesetcall_3d4a26c1ed734349: Dce,
            __wbg_subarray_70fd07feefe14294: ile,
            __wbg_set_1353b2a5e96bc48c: $ce,
            __wbg_BigInt_40a77d45cca49470: hae,
            __wbg_done_75ed0ee6dd243d9d: Nae,
            __wbg_value_dd9372230531eade: fle,
            __wbg_instanceof_Map_ebb01a5b6b5ffd0b: nce,
            __wbg_instanceof_Set_b0e0ca8a8b2062e8: sce,
            __wbg_instanceof_Date_c0cdff0c3b978b0e: tce,
            __wbg_instanceof_Promise_3ec9e849bf41bdb6: rce,
            __wbg_instanceof_Uint8Array_9a8378d955933db7: ice,
            __wbg_instanceof_ArrayBuffer_67f3012529f6a2dd: ece,
            __wbg_BigInt_6adbfd8eb0f7ec07: pae,
            __wbg_get_5ee3191755594360: Yae,
            __wbg_new_2ff1f68f3676ea53: xce,
            __wbg_set_b7f1cf4fae26fe2a: Zce,
            __wbg_keys_822161a7faf55538: uce,
            __wbg_size_af8602b0b838d49e: Qce,
            __wbg_forEach_859dfd887a0f866c: Kae,
            __wbg_add_bd7fa428f539a577: yae,
            __wbg_new_0dc86f3faa8a3b53: mce,
            __wbg_forEach_48feffedd75c5b94: qae,
            __wbg_new0_b0a0a38c201e6df5: bce,
            __wbg_getTime_6bb3f64e0f18f817: Gae,
            __wbg_setTime_fb96d30252f92656: Wce,
            __wbg_get_0da715ceaecea5c8: Zae,
            __wbg_new_1f3a344cf3123716: wce,
            __wbg_set_90f6c0f7bd8c0415: Gce,
            __wbg_from_88bc52ce20ba6318: Wae,
            __wbg_push_330b2eb93e4e1212: Fce,
            __wbg_length_186546c51cd61acd: fce,
            __wbg_isArray_030cce220591fb41: ace,
            __wbg_new_da9dc54c5db29dfa: Sce,
            __wbg_toString_d8f537919ef401d6: lle,
            __wbg_toString_7268338f40012a03: cle,
            __wbg_isSafeInteger_1c0d1af5542e102a: cce,
            __wbg_new_19c25a3f2fa63a02: yce,
            __wbg_entries_2be2f15bd5554996: Uae,
            __wbg_iterator_f370b34483c71a1c: lce,
            __wbg_static_accessor_GLOBAL_THIS_f0a4409105898184: nle,
            __wbg_static_accessor_SELF_995b214ae681ff99: rle,
            __wbg_static_accessor_GLOBAL_8921f820c2ce3f12: tle,
            __wbg_static_accessor_WINDOW_cde3890479c675ea: sle,
            __wbg_new_2e3c58a15f39f5f9: _ce,
            __wbg_then_e22500defe16819f: ale,
            __wbg_then_b33a773d723afa3e: ole,
            __wbg_resolve_4055c623acdd6a1b: qce,
            __wbg_getPrototypeOf_1b3ce3e146539859: $ae,
            __wbg_get_458e874b43b18b25: Jae,
            __wbg_newnoargs_254190557c45b4ec: Tce,
            __wbg_call_13410aac570ffff7: kae,
            __wbg_call_a5400b25a865cfd8: Eae,
            __wbg_call_641db1bb5db5a579: Tae,
            __wbg_call_f1fd202ba222e0ec: Cae,
            __wbg_next_5b3530e612fde77d: Ice,
            __wbg_next_692e82279131b03c: Ace,
            __wbg_wbindgenin_d7a1ee10933d2d55: xle,
            __wbg_wbindgenshr_7d2aae6044c0dab1: Ole,
            __wbg_wbindgenthrow_451ec1a8469d7eb6: Rle,
            __wbg_wbindgencbdrop_eb10308566512b88: wle,
            __wbg_wbindgenisnull_f3037694abe4d97a: kle,
            __wbg_wbindgenjsvaleq_e6f2ad59ccae1b58: Ile,
            __wbg_Number_998bea33bd87c3e0: bae,
            __wbg_Error_e17e777aac105295: gae,
            __wbg_wbindgenisbigint_ecb90cc08a5a9154: vle,
            __wbg_wbindgenisobject_307a53c6bd97fbf8: Tle,
            __wbg_wbindgenisstring_d4fa939789f003b0: Ele,
            __wbg_wbindgennumberget_f74b4c7525ac05cb: Ple,
            __wbg_wbindgenstringget_0f16a6ddddef376f: Mle,
            __wbg_wbindgenbooleanget_3fe6f642c7d97746: yle,
            __wbg_wbindgenisfunction_8cee7dce3725ae74: Sle,
            __wbg_wbindgenisundefined_c4b71d073b92f3c5: Cle,
            __wbg_wbindgenjsvallooseeq_9bec8c9be826bed1: Ale,
            __wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1: mle,
            __wbg_wbindgendebugstring_99ef257a3ddda34d: _le,
            __wbindgen_init_externref_table: Zle,
            __wbindgen_cast_2241b6af4c4b2941: Hle,
            __wbindgen_cast_cc2ffe7a88863288: $le,
            __wbindgen_cast_4625c577ab2ec9ee: qle,
            __wbindgen_cast_0be206197f6586af: Ule,
            __wbindgen_cast_d6cd19b81560fd6e: Xle,
            __wbindgen_cast_2ddd8a25ff58642a: jle,
            __wbindgen_cast_e7b45dd881f38ce3: Gle,
            __wbindgen_cast_9ae0607507abb057: Kle,
            __wbindgen_cast_cb9088102bce6b30: Wle
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline4.js": {
            ZswapInput_: Jle
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline3.js": {
            ZswapOffer_: Yle
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline2.js": {
            ZswapOutput_: Qle
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline5.js": {
            ZswapTransient_: eue
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline6.js": {
            PrePartitionContractCall_: tue
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline7.js": {
            DustSpend_: nue
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline9.js": {
            DustActions_: rue
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline8.js": {
            DustRegistration_: sue
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline11.js": {
            SignatureErased_: iue
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline13.js": {
            SignatureEnabled_: oue
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline17.js": {
            Intent_: aue
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline20.js": {
            ContractCall_: cue
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline23.js": {
            ContractDeploy_: lue
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline18.js": {
            ReplaceAuthority_: uue
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline21.js": {
            MaintenanceUpdate_: due
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline19.js": {
            VerifierKeyInsert_: fue
        },
        "./snippets/midnight-ledger-wasm-5979ca4215261931/inline22.js": {
            VerifierKeyRemove_: hue
        }
    }, tae), pue = k.memory, gue = k.__wbg_authorizedclaim_free, bue = k.__wbg_binding_free, mue = k.__wbg_claimrewardstransaction_free, yue = k.__wbg_coinsecretkey_free, wue = k.__wbg_contractcall_free, _ue = k.__wbg_contractcallprototype_free, xue = k.__wbg_contractdeploy_free, vue = k.__wbg_contractoperationversion_free, Sue = k.__wbg_contractoperationversionedverifierkey_free, kue = k.__wbg_dustactions_free, Tue = k.__wbg_dustgenerationstate_free, Eue = k.__wbg_dustlocalstate_free, Cue = k.__wbg_dustlocalstatewithchanges_free, Iue = k.__wbg_dustparameters_free, Aue = k.__wbg_dustregistration_free, Pue = k.__wbg_dustsecretkey_free, Oue = k.__wbg_dustspend_free, Mue = k.__wbg_duststate_free, Rue = k.__wbg_duststatechanges_free, Nue = k.__wbg_dustutxostate_free, Vue = k.__wbg_encryptionsecretkey_free, Bue = k.__wbg_event_free, Due = k.__wbg_intent_free, Fue = k.__wbg_ledgerparameters_free, Lue = k.__wbg_ledgerstate_free, zue = k.__wbg_maintenanceupdate_free, Uue = k.__wbg_merkletreecollapsedupdate_free, Hue = k.__wbg_nobinding_free, jue = k.__wbg_prebinding_free, que = k.__wbg_prepartitioncontractcall_free, Kue = k.__wbg_preproof_free, Wue = k.__wbg_pretranscript_free, $ue = k.__wbg_proof_free, Xue = k.__wbg_replaceauthority_free, Gue = k.__wbg_signatureenabled_free, Zue = k.__wbg_systemtransaction_free, Jue = k.__wbg_transaction_free, Yue = k.__wbg_transactioncontext_free, Que = k.__wbg_transactioncostmodel_free, ede = k.__wbg_transactionresult_free, tde = k.__wbg_unshieldedoffer_free, nde = k.__wbg_utxometa_free, rde = k.__wbg_utxostate_free, sde = k.__wbg_verifiedtransaction_free, ide = k.__wbg_verifierkeyinsert_free, ode = k.__wbg_wellformedstrictness_free, ade = k.__wbg_zswapchainstate_free, cde = k.__wbg_zswapinput_free, lde = k.__wbg_zswaplocalstate_free, ude = k.__wbg_zswaplocalstatewithchanges_free, dde = k.__wbg_zswapoffer_free, fde = k.__wbg_zswapoutput_free, hde = k.__wbg_zswapsecretkeys_free, pde = k.__wbg_zswapstatechanges_free, gde = k.__wbg_zswaptransient_free, bde = k.addressFromKey, mde = k.authorizedclaim_coin, yde = k.authorizedclaim_deserialize, wde = k.authorizedclaim_eraseProof, _de = k.authorizedclaim_new, xde = k.authorizedclaim_recipient, vde = k.authorizedclaim_serialize, Sde = k.authorizedclaim_toString, kde = k.binding_deserialize, Tde = k.binding_instance, Ede = k.binding_new, Cde = k.binding_serialize, Ide = k.binding_toString, Ade = k.claimrewardstransaction_addSignature, Pde = k.claimrewardstransaction_construct, Ode = k.claimrewardstransaction_dataToSign, Mde = k.claimrewardstransaction_deserialize, Rde = k.claimrewardstransaction_eraseSignatures, Nde = k.claimrewardstransaction_kind, Vde = k.claimrewardstransaction_new, Bde = k.claimrewardstransaction_nonce, Dde = k.claimrewardstransaction_owner, Fde = k.claimrewardstransaction_serialize, Lde = k.claimrewardstransaction_signature, zde = k.claimrewardstransaction_toString, Ude = k.claimrewardstransaction_value, Hde = k.coinCommitment, jde = k.coinNullifier, qde = k.coinsecretkey_clear, Kde = k.coinsecretkey_new, Wde = k.coinsecretkey_public_key, $de = k.coinsecretkey_yesIKnowTheSecurityImplicationsOfThis_serialize, Xde = k.contractcall_address, Gde = k.contractcall_communicationCommitment, Zde = k.contractcall_entryPoint, Jde = k.contractcall_fallibleTranscript, Yde = k.contractcall_guaranteedTranscript, Qde = k.contractcall_new, efe = k.contractcall_proof, tfe = k.contractcall_toString, nfe = k.contractcallprototype_intoCall, rfe = k.contractcallprototype_new, sfe = k.contractcallprototype_toString, ife = k.contractdeploy_address, ofe = k.contractdeploy_initialState, afe = k.contractdeploy_new, cfe = k.contractdeploy_toString, lfe = k.contractoperationversion_new, ufe = k.contractoperationversion_toString, dfe = k.contractoperationversion_version, ffe = k.contractoperationversionedverifierkey_new, hfe = k.contractoperationversionedverifierkey_raw_vk, pfe = k.contractoperationversionedverifierkey_toString, gfe = k.contractoperationversionedverifierkey_version, bfe = k.createCheckPayload, mfe = k.createCoinInfo, yfe = k.createProvingPayload, wfe = k.createProvingTransactionPayload, _fe = k.createShieldedCoinInfo, xfe = k.dustactions_ctime, vfe = k.dustactions_deserialize, Sfe = k.dustactions_new, kfe = k.dustactions_registrations, Tfe = k.dustactions_serialize, Efe = k.dustactions_set_ctime, Cfe = k.dustactions_set_registrations, Ife = k.dustactions_set_spends, Afe = k.dustactions_spends, Pfe = k.dustactions_toString, Ofe = k.dustgenerationstate_deserialize, Mfe = k.dustgenerationstate_new, Rfe = k.dustgenerationstate_serialize, Nfe = k.dustgenerationstate_toString, Vfe = k.dustlocalstate_deserialize, Bfe = k.dustlocalstate_generationInfo, Dfe = k.dustlocalstate_new, Ffe = k.dustlocalstate_params, Lfe = k.dustlocalstate_processTtls, zfe = k.dustlocalstate_replayEvents, Ufe = k.dustlocalstate_replayEventsWithChanges, Hfe = k.dustlocalstate_serialize, jfe = k.dustlocalstate_spend, qfe = k.dustlocalstate_syncTime, Kfe = k.dustlocalstate_toString, Wfe = k.dustlocalstate_utxos, $fe = k.dustlocalstate_walletBalance, Xfe = k.dustlocalstatewithchanges_changes, Gfe = k.dustlocalstatewithchanges_state, Zfe = k.dustparameters_deserialize, Jfe = k.dustparameters_dustGracePeriodSeconds, Yfe = k.dustparameters_generationDecayRate, Qfe = k.dustparameters_new, ehe = k.dustparameters_nightDustRatio, the = k.dustparameters_serialize, nhe = k.dustparameters_set_dustGracePeriodSeconds, rhe = k.dustparameters_set_generationDecayRate, she = k.dustparameters_set_nightDustRatio, ihe = k.dustparameters_timeToCapSeconds, ohe = k.dustparameters_toString, ahe = k.dustregistration_allowFeePayment, che = k.dustregistration_deserialize, lhe = k.dustregistration_dustAddress, uhe = k.dustregistration_new, dhe = k.dustregistration_nightKey, fhe = k.dustregistration_serialize, hhe = k.dustregistration_set_allowFeePayment, phe = k.dustregistration_set_dustAddress, ghe = k.dustregistration_set_nightKey, bhe = k.dustregistration_set_signature, mhe = k.dustregistration_signature, yhe = k.dustregistration_toString, whe = k.dustsecretkey_clear, _he = k.dustsecretkey_fromBigint, xhe = k.dustsecretkey_fromSeed, vhe = k.dustsecretkey_new, She = k.dustsecretkey_publicKey, khe = k.dustspend_new, The = k.dustspend_newCommitment, Ehe = k.dustspend_oldNullifier, Che = k.dustspend_proof, Ihe = k.dustspend_toString, Ahe = k.dustspend_vFee, Phe = k.duststate_deserialize, Ohe = k.duststate_generation, Mhe = k.duststate_new, Rhe = k.duststate_serialize, Nhe = k.duststate_toString, Vhe = k.duststate_utxo, Bhe = k.duststatechanges_receivedUtxos, Dhe = k.duststatechanges_source, Fhe = k.duststatechanges_spentUtxos, Lhe = k.dustutxostate_deserialize, zhe = k.dustutxostate_new, Uhe = k.dustutxostate_serialize, Hhe = k.dustutxostate_toString, jhe = k.encryptionsecretkey_clear, qhe = k.encryptionsecretkey_deserialize, Khe = k.encryptionsecretkey_new, Whe = k.encryptionsecretkey_public_key, $he = k.encryptionsecretkey_taggedDeserialize, Xhe = k.encryptionsecretkey_test, Ghe = k.encryptionsecretkey_yesIKnowTheSecurityImplicationsOfThis_serialize, Zhe = k.encryptionsecretkey_yesIKnowTheSecurityImplicationsOfThis_taggedSerialize, Jhe = k.event_deserialize, Yhe = k.event_new, Qhe = k.event_serialize, epe = k.event_toString, tpe = k.feeToken, npe = k.intent_actions, rpe = k.intent_addCall, spe = k.intent_addDeploy, ipe = k.intent_addMaintenanceUpdate, ope = k.intent_bind, ape = k.intent_binding, cpe = k.intent_construct, lpe = k.intent_deserialize, upe = k.intent_dustActions, dpe = k.intent_eraseProofs, fpe = k.intent_eraseSignatures, hpe = k.intent_fallibleUnshieldedOffer, ppe = k.intent_guaranteedUnshieldedOffer, gpe = k.intent_intentHash, bpe = k.intent_new, mpe = k.intent_serialize, ype = k.intent_set_actions, wpe = k.intent_set_dustActions, _pe = k.intent_set_fallibleUnshieldedOffer, xpe = k.intent_set_guaranteedUnshieldedOffer, vpe = k.intent_set_ttl, Spe = k.intent_signatureData, kpe = k.intent_toString, Tpe = k.intent_ttl, Epe = k.ledgerparameters_deserialize, Cpe = k.ledgerparameters_dust, Ipe = k.ledgerparameters_feePrices, Ape = k.ledgerparameters_initialParameters, Ppe = k.ledgerparameters_maxPriceAdjustment, Ope = k.ledgerparameters_new, Mpe = k.ledgerparameters_normalizeFullness, Rpe = k.ledgerparameters_serialize, Npe = k.ledgerparameters_toString, Vpe = k.ledgerparameters_transactionCostModel, Bpe = k.ledgerstate_apply, Dpe = k.ledgerstate_applySystemTx, Fpe = k.ledgerstate_blank, Lpe = k.ledgerstate_block_reward_pool, zpe = k.ledgerstate_bridgeReceiving, Upe = k.ledgerstate_deserialize, Hpe = k.ledgerstate_dust, jpe = k.ledgerstate_index, qpe = k.ledgerstate_locked_pool, Kpe = k.ledgerstate_new, Wpe = k.ledgerstate_parameters, $pe = k.ledgerstate_postBlockUpdate, Xpe = k.ledgerstate_reserve_pool, Gpe = k.ledgerstate_serialize, Zpe = k.ledgerstate_set_parameters, Jpe = k.ledgerstate_testingDistributeNight, Ype = k.ledgerstate_toString, Qpe = k.ledgerstate_treasuryBalance, e0e = k.ledgerstate_unclaimedBlockRewards, t0e = k.ledgerstate_updateIndex, n0e = k.ledgerstate_utxo, r0e = k.ledgerstate_zswap, s0e = k.maintenanceupdate_addSignature, i0e = k.maintenanceupdate_address, o0e = k.maintenanceupdate_counter, a0e = k.maintenanceupdate_data_to_sign, c0e = k.maintenanceupdate_new, l0e = k.maintenanceupdate_signatures, u0e = k.maintenanceupdate_toString, d0e = k.maintenanceupdate_updates, f0e = k.merkletreecollapsedupdate_deserialize, h0e = k.merkletreecollapsedupdate_new, p0e = k.merkletreecollapsedupdate_serialize, g0e = k.merkletreecollapsedupdate_toString, b0e = k.nativeToken, m0e = k.nobinding_deserialize, y0e = k.nobinding_instance, w0e = k.nobinding_new, _0e = k.nobinding_serialize, x0e = k.nobinding_toString, v0e = k.noproof_instance, S0e = k.noproof_new, k0e = k.noproof_toString, T0e = k.parseCheckResult, E0e = k.partitionTranscripts, C0e = k.prebinding_deserialize, I0e = k.prebinding_instance, A0e = k.prebinding_new, P0e = k.prebinding_serialize, O0e = k.prebinding_toString, M0e = k.prepartitioncontractcall_new, R0e = k.prepartitioncontractcall_toString, N0e = k.preproof_deserialize, V0e = k.preproof_instance, B0e = k.preproof_new, D0e = k.preproof_serialize, F0e = k.preproof_toString, L0e = k.pretranscript_new, z0e = k.pretranscript_toString, U0e = k.proof_deserialize, H0e = k.proof_instance, j0e = k.proof_new, q0e = k.proof_serialize, K0e = k.proof_toString, W0e = k.replaceauthority_authority, $0e = k.replaceauthority_new, X0e = k.replaceauthority_toString, G0e = k.sampleCoinPublicKey, Z0e = k.sampleDustSecretKey, J0e = k.sampleEncryptionPublicKey, Y0e = k.sampleIntentHash, Q0e = k.shieldedToken, ege = k.signatureenabled_deserialize, tge = k.signatureenabled_instance, nge = k.signatureenabled_new, rge = k.signatureenabled_serialize, sge = k.signatureenabled_toString, ige = k.signatureerased_instance, oge = k.signatureerased_toString, age = k.systemtransaction_deserialize, cge = k.systemtransaction_new, lge = k.systemtransaction_serialize, uge = k.systemtransaction_toString, dge = k.transaction_addCalls, fge = k.transaction_bind, hge = k.transaction_bindingRandomness, pge = k.transaction_cost, gge = k.transaction_deserialize, bge = k.transaction_eraseProofs, mge = k.transaction_eraseSignatures, yge = k.transaction_fallibleOffer, wge = k.transaction_fees, _ge = k.transaction_feesWithMargin, xge = k.transaction_fromParts, vge = k.transaction_fromPartsRandomized, Sge = k.transaction_fromRewards, kge = k.transaction_guaranteedOffer, Tge = k.transaction_identifiers, Ege = k.transaction_imbalances, Cge = k.transaction_intents, Ige = k.transaction_merge, Age = k.transaction_mockProve, Pge = k.transaction_new, Oge = k.transaction_prove, Mge = k.transaction_rewards, Rge = k.transaction_serialize, Nge = k.transaction_set_fallibleOffer, Vge = k.transaction_set_guaranteedOffer, Bge = k.transaction_set_intents, Dge = k.transaction_toString, Fge = k.transaction_transactionHash, Lge = k.transaction_wellFormed, zge = k.transactioncontext_new, Uge = k.transactioncontext_toString, Hge = k.transactioncostmodel_baselineCost, jge = k.transactioncostmodel_deserialize, qge = k.transactioncostmodel_initialTransactionCostModel, Kge = k.transactioncostmodel_new, Wge = k.transactioncostmodel_runtimeCostModel, $ge = k.transactioncostmodel_serialize, Xge = k.transactioncostmodel_toString, Gge = k.transactionresult_error, Zge = k.transactionresult_events, Jge = k.transactionresult_new, Yge = k.transactionresult_successfulSegments, Qge = k.transactionresult_toString, ebe = k.transactionresult_type_, tbe = k.unshieldedoffer_addSignatures, nbe = k.unshieldedoffer_construct, rbe = k.unshieldedoffer_eraseSignatures, sbe = k.unshieldedoffer_inputs, ibe = k.unshieldedoffer_new, obe = k.unshieldedoffer_outputs, abe = k.unshieldedoffer_signatures, cbe = k.unshieldedoffer_toString, lbe = k.updatedValue, ube = k.utxometa_ctime, dbe = k.utxometa_new, fbe = k.utxometa_set_ctime, hbe = k.utxostate_delta, pbe = k.utxostate_filter, gbe = k.utxostate_lookupMeta, bbe = k.utxostate_new, mbe = k.utxostate_utxos, ybe = k.verifiedtransaction_transaction, wbe = k.verifierkeyinsert_new, _be = k.verifierkeyinsert_operation, xbe = k.verifierkeyinsert_toString, vbe = k.verifierkeyinsert_vk, Sbe = k.verifierkeyremove_new, kbe = k.verifierkeyremove_operation, Tbe = k.verifierkeyremove_toString, Ebe = k.verifierkeyremove_version, Cbe = k.wellformedstrictness_enforce_balancing, Ibe = k.wellformedstrictness_enforce_limits, Abe = k.wellformedstrictness_new, Pbe = k.wellformedstrictness_set_enforce_balancing, Obe = k.wellformedstrictness_set_enforce_limits, Mbe = k.wellformedstrictness_set_verify_contract_proofs, Rbe = k.wellformedstrictness_set_verify_native_proofs, Nbe = k.wellformedstrictness_set_verify_signatures, Vbe = k.wellformedstrictness_verify_contract_proofs, Bbe = k.wellformedstrictness_verify_native_proofs, Dbe = k.wellformedstrictness_verify_signatures, Fbe = k.zswapchainstate_deserialize, Lbe = k.zswapchainstate_deserializeFromLedgerState, zbe = k.zswapchainstate_filter, Ube = k.zswapchainstate_firstFree, Hbe = k.zswapchainstate_new, jbe = k.zswapchainstate_postBlockUpdate, qbe = k.zswapchainstate_serialize, Kbe = k.zswapchainstate_toString, Wbe = k.zswapchainstate_tryApply, $be = k.zswapinput_contractAddress, Xbe = k.zswapinput_deserialize, Gbe = k.zswapinput_new, Zbe = k.zswapinput_newContractOwned, Jbe = k.zswapinput_nullifier, Ybe = k.zswapinput_proof, Qbe = k.zswapinput_serialize, eme = k.zswapinput_toString, tme = k.zswaplocalstate_apply, nme = k.zswaplocalstate_applyCollapsedUpdate, rme = k.zswaplocalstate_applyFailed, sme = k.zswaplocalstate_clearPending, ime = k.zswaplocalstate_coins, ome = k.zswaplocalstate_deserialize, ame = k.zswaplocalstate_firstFree, cme = k.zswaplocalstate_new, lme = k.zswaplocalstate_pendingOutputs, ume = k.zswaplocalstate_pendingSpends, dme = k.zswaplocalstate_replayEvents, fme = k.zswaplocalstate_replayEventsWithChanges, hme = k.zswaplocalstate_revertTransaction, pme = k.zswaplocalstate_serialize, gme = k.zswaplocalstate_spend, bme = k.zswaplocalstate_spendFromOutput, mme = k.zswaplocalstate_toString, yme = k.zswaplocalstate_watchFor, wme = k.zswaplocalstatewithchanges_changes, _me = k.zswaplocalstatewithchanges_state, xme = k.zswapoffer_deltas, vme = k.zswapoffer_deserialize, Sme = k.zswapoffer_fromInput, kme = k.zswapoffer_fromOutput, Tme = k.zswapoffer_fromTransient, Eme = k.zswapoffer_inputs, Cme = k.zswapoffer_merge, Ime = k.zswapoffer_new, Ame = k.zswapoffer_outputs, Pme = k.zswapoffer_serialize, Ome = k.zswapoffer_toString, Mme = k.zswapoffer_transients, Rme = k.zswapoutput_commitment, Nme = k.zswapoutput_construct, Vme = k.zswapoutput_contractAddress, Bme = k.zswapoutput_deserialize, Dme = k.zswapoutput_new, Fme = k.zswapoutput_newContractOwned, Lme = k.zswapoutput_proof, zme = k.zswapoutput_serialize, Ume = k.zswapoutput_toString, Hme = k.zswapsecretkeys_clear, jme = k.zswapsecretkeys_coinPublicKey, qme = k.zswapsecretkeys_coinSecretKey, Kme = k.zswapsecretkeys_encryptionPublicKey, Wme = k.zswapsecretkeys_encryptionSecretKey, $me = k.zswapsecretkeys_fromSeed, Xme = k.zswapsecretkeys_fromSeedRng, Gme = k.zswapsecretkeys_new, Zme = k.zswapstatechanges_receivedCoins, Jme = k.zswapstatechanges_source, Yme = k.zswapstatechanges_spentCoins, Qme = k.zswaptransient_commitment, eye = k.zswaptransient_contractAddress, tye = k.zswaptransient_deserialize, nye = k.zswaptransient_inputProof, rye = k.zswaptransient_new, sye = k.zswaptransient_newFromContractOwnedOutput, iye = k.zswaptransient_nullifier, oye = k.zswaptransient_outputProof, aye = k.zswaptransient_serialize, cye = k.zswaptransient_toString, lye = k.signatureerased_new, uye = k.unshieldedToken, dye = k.__wbg_signatureerased_free, fye = k.__wbg_noproof_free, hye = k.__wbg_verifierkeyremove_free, pye = k.__wbg_chargedstate_free, gye = k.__wbg_contractmaintenanceauthority_free, bye = k.__wbg_contractoperation_free, mye = k.__wbg_contractstate_free, yye = k.__wbg_costmodel_free, wye = k.__wbg_querycontext_free, _ye = k.__wbg_queryresults_free, xye = k.__wbg_stateboundedmerkletree_free, vye = k.__wbg_statemap_free, Sye = k.__wbg_statevalue_free, kye = k.__wbg_vmresults_free, Tye = k.__wbg_vmstack_free, Eye = k.bigIntModFr, Cye = k.bigIntToValue, Iye = k.chargedstate_new, Aye = k.chargedstate_state, Pye = k.chargedstate_toString, Oye = k.communicationCommitment, Mye = k.communicationCommitmentRandomness, Rye = k.contractmaintenanceauthority_committee, Nye = k.contractmaintenanceauthority_counter, Vye = k.contractmaintenanceauthority_deserialize, Bye = k.contractmaintenanceauthority_new, Dye = k.contractmaintenanceauthority_serialize, Fye = k.contractmaintenanceauthority_threshold, Lye = k.contractmaintenanceauthority_toString, zye = k.contractoperation_deserialize, Uye = k.contractoperation_new, Hye = k.contractoperation_serialize, jye = k.contractoperation_set_verifier_key, qye = k.contractoperation_toString, Kye = k.contractoperation_verifier_key, Wye = k.contractstate_balance, $ye = k.contractstate_data, Xye = k.contractstate_deserialize, Gye = k.contractstate_maintenance_authority, Zye = k.contractstate_new, Jye = k.contractstate_operation, Yye = k.contractstate_operations, Qye = k.contractstate_query, e1e = k.contractstate_serialize, t1e = k.contractstate_setOperation, n1e = k.contractstate_set_balance, r1e = k.contractstate_set_data, s1e = k.contractstate_set_maintenance_authority, i1e = k.contractstate_toString, o1e = k.costmodel_initialCostModel, a1e = k.costmodel_new, c1e = k.costmodel_toString, l1e = k.decodeCoinPublicKey, u1e = k.decodeContractAddress, d1e = k.decodeQualifiedShieldedCoinInfo, f1e = k.decodeRawTokenType, h1e = k.decodeShieldedCoinInfo, p1e = k.decodeUserAddress, g1e = k.degradeToTransient, b1e = k.dummyContractAddress, m1e = k.dummyUserAddress, y1e = k.ecAdd, w1e = k.ecMul, _1e = k.ecMulGenerator, x1e = k.encodeCoinPublicKey, v1e = k.encodeContractAddress, S1e = k.encodeQualifiedShieldedCoinInfo, k1e = k.encodeRawTokenType, T1e = k.encodeShieldedCoinInfo, E1e = k.encodeUserAddress, C1e = k.entryPointHash, I1e = k.hashToCurve, A1e = k.leafHash, P1e = k.maxAlignedSize, O1e = k.maxField, M1e = k.persistentCommit, R1e = k.persistentHash, N1e = k.proofDataIntoSerializedPreimage, V1e = k.querycontext_address, B1e = k.querycontext_block, D1e = k.querycontext_com_indices, F1e = k.querycontext_effects, L1e = k.querycontext_insertCommitment, z1e = k.querycontext_new, U1e = k.querycontext_qualify, H1e = k.querycontext_query, j1e = k.querycontext_runTranscript, q1e = k.querycontext_set_block, K1e = k.querycontext_set_effects, W1e = k.querycontext_state, $1e = k.querycontext_toString, X1e = k.querycontext_toVmStack, G1e = k.queryresults_context, Z1e = k.queryresults_events, J1e = k.queryresults_gas_cost, Y1e = k.queryresults_new, Q1e = k.queryresults_toString, ewe = k.rawTokenType, twe = k.runProgram, nwe = k.runtimeCoinCommitment, rwe = k.runtimeCoinNullifier, swe = k.sampleContractAddress, iwe = k.sampleRawTokenType, owe = k.sampleSigningKey, awe = k.sampleUserAddress, cwe = k.signData, lwe = k.signatureVerifyingKey, uwe = k.signingKeyFromBip340, dwe = k.stateboundedmerkletree_blank, fwe = k.stateboundedmerkletree_collapse, hwe = k.stateboundedmerkletree_findPathForLeaf, pwe = k.stateboundedmerkletree_height, gwe = k.stateboundedmerkletree_pathForLeaf, bwe = k.stateboundedmerkletree_rehash, mwe = k.stateboundedmerkletree_root, ywe = k.stateboundedmerkletree_toString, wwe = k.stateboundedmerkletree_update, _we = k.statemap_get, xwe = k.statemap_insert, vwe = k.statemap_keys, Swe = k.statemap_new, kwe = k.statemap_remove, Twe = k.statemap_toString, Ewe = k.statevalue_arrayPush, Cwe = k.statevalue_asArray, Iwe = k.statevalue_asBoundedMerkleTree, Awe = k.statevalue_asCell, Pwe = k.statevalue_asMap, Owe = k.statevalue_decode, Mwe = k.statevalue_encode, Rwe = k.statevalue_logSize, Nwe = k.statevalue_new, Vwe = k.statevalue_newArray, Bwe = k.statevalue_newBoundedMerkleTree, Dwe = k.statevalue_newCell, Fwe = k.statevalue_newMap, Lwe = k.statevalue_newNull, zwe = k.statevalue_toString, Uwe = k.statevalue_type, Hwe = k.transientCommit, jwe = k.transientHash, qwe = k.upgradeFromTransient, Kwe = k.valueToBigInt, Wwe = k.verifySignature, $we = k.vmresults_events, Xwe = k.vmresults_gas_cost, Gwe = k.vmresults_new, Zwe = k.vmresults_stack, Jwe = k.vmresults_toString, Ywe = k.vmstack_get, Qwe = k.vmstack_isStrong, e_e = k.vmstack_length, t_e = k.vmstack_new, n_e = k.vmstack_push, r_e = k.vmstack_removeLast, s_e = k.vmstack_toString, i_e = k.__wbg_intounderlyingbytesource_free, o_e = k.__wbg_intounderlyingsink_free, a_e = k.__wbg_intounderlyingsource_free, c_e = k.intounderlyingbytesource_autoAllocateChunkSize, l_e = k.intounderlyingbytesource_cancel, u_e = k.intounderlyingbytesource_pull, d_e = k.intounderlyingbytesource_start, f_e = k.intounderlyingbytesource_type, h_e = k.intounderlyingsink_abort, p_e = k.intounderlyingsink_close, g_e = k.intounderlyingsink_write, b_e = k.intounderlyingsource_cancel, m_e = k.intounderlyingsource_pull, y_e = k.__wbindgen_exn_store, w_e = k.__externref_table_alloc, __e = k.__wbindgen_export_2, x_e = k.__wbindgen_malloc, v_e = k.__wbindgen_realloc, S_e = k.__externref_drop_slice, k_e = k.__wbindgen_free, T_e = k.__wbindgen_export_7, E_e = k.__externref_table_dealloc, C_e = k.closure3109_externref_shim, I_e = k.closure3155_externref_shim, A_e = k.closure3158_externref_shim, Bj = k.__wbindgen_start, P_e = Object.freeze(Object.defineProperty({
        __proto__: null,
        __externref_drop_slice: S_e,
        __externref_table_alloc: w_e,
        __externref_table_dealloc: E_e,
        __wbg_authorizedclaim_free: gue,
        __wbg_binding_free: bue,
        __wbg_chargedstate_free: pye,
        __wbg_claimrewardstransaction_free: mue,
        __wbg_coinsecretkey_free: yue,
        __wbg_contractcall_free: wue,
        __wbg_contractcallprototype_free: _ue,
        __wbg_contractdeploy_free: xue,
        __wbg_contractmaintenanceauthority_free: gye,
        __wbg_contractoperation_free: bye,
        __wbg_contractoperationversion_free: vue,
        __wbg_contractoperationversionedverifierkey_free: Sue,
        __wbg_contractstate_free: mye,
        __wbg_costmodel_free: yye,
        __wbg_dustactions_free: kue,
        __wbg_dustgenerationstate_free: Tue,
        __wbg_dustlocalstate_free: Eue,
        __wbg_dustlocalstatewithchanges_free: Cue,
        __wbg_dustparameters_free: Iue,
        __wbg_dustregistration_free: Aue,
        __wbg_dustsecretkey_free: Pue,
        __wbg_dustspend_free: Oue,
        __wbg_duststate_free: Mue,
        __wbg_duststatechanges_free: Rue,
        __wbg_dustutxostate_free: Nue,
        __wbg_encryptionsecretkey_free: Vue,
        __wbg_event_free: Bue,
        __wbg_intent_free: Due,
        __wbg_intounderlyingbytesource_free: i_e,
        __wbg_intounderlyingsink_free: o_e,
        __wbg_intounderlyingsource_free: a_e,
        __wbg_ledgerparameters_free: Fue,
        __wbg_ledgerstate_free: Lue,
        __wbg_maintenanceupdate_free: zue,
        __wbg_merkletreecollapsedupdate_free: Uue,
        __wbg_nobinding_free: Hue,
        __wbg_noproof_free: fye,
        __wbg_prebinding_free: jue,
        __wbg_prepartitioncontractcall_free: que,
        __wbg_preproof_free: Kue,
        __wbg_pretranscript_free: Wue,
        __wbg_proof_free: $ue,
        __wbg_querycontext_free: wye,
        __wbg_queryresults_free: _ye,
        __wbg_replaceauthority_free: Xue,
        __wbg_signatureenabled_free: Gue,
        __wbg_signatureerased_free: dye,
        __wbg_stateboundedmerkletree_free: xye,
        __wbg_statemap_free: vye,
        __wbg_statevalue_free: Sye,
        __wbg_systemtransaction_free: Zue,
        __wbg_transaction_free: Jue,
        __wbg_transactioncontext_free: Yue,
        __wbg_transactioncostmodel_free: Que,
        __wbg_transactionresult_free: ede,
        __wbg_unshieldedoffer_free: tde,
        __wbg_utxometa_free: nde,
        __wbg_utxostate_free: rde,
        __wbg_verifiedtransaction_free: sde,
        __wbg_verifierkeyinsert_free: ide,
        __wbg_verifierkeyremove_free: hye,
        __wbg_vmresults_free: kye,
        __wbg_vmstack_free: Tye,
        __wbg_wellformedstrictness_free: ode,
        __wbg_zswapchainstate_free: ade,
        __wbg_zswapinput_free: cde,
        __wbg_zswaplocalstate_free: lde,
        __wbg_zswaplocalstatewithchanges_free: ude,
        __wbg_zswapoffer_free: dde,
        __wbg_zswapoutput_free: fde,
        __wbg_zswapsecretkeys_free: hde,
        __wbg_zswapstatechanges_free: pde,
        __wbg_zswaptransient_free: gde,
        __wbindgen_exn_store: y_e,
        __wbindgen_export_2: __e,
        __wbindgen_export_7: T_e,
        __wbindgen_free: k_e,
        __wbindgen_malloc: x_e,
        __wbindgen_realloc: v_e,
        __wbindgen_start: Bj,
        addressFromKey: bde,
        authorizedclaim_coin: mde,
        authorizedclaim_deserialize: yde,
        authorizedclaim_eraseProof: wde,
        authorizedclaim_new: _de,
        authorizedclaim_recipient: xde,
        authorizedclaim_serialize: vde,
        authorizedclaim_toString: Sde,
        bigIntModFr: Eye,
        bigIntToValue: Cye,
        binding_deserialize: kde,
        binding_instance: Tde,
        binding_new: Ede,
        binding_serialize: Cde,
        binding_toString: Ide,
        chargedstate_new: Iye,
        chargedstate_state: Aye,
        chargedstate_toString: Pye,
        claimrewardstransaction_addSignature: Ade,
        claimrewardstransaction_construct: Pde,
        claimrewardstransaction_dataToSign: Ode,
        claimrewardstransaction_deserialize: Mde,
        claimrewardstransaction_eraseSignatures: Rde,
        claimrewardstransaction_kind: Nde,
        claimrewardstransaction_new: Vde,
        claimrewardstransaction_nonce: Bde,
        claimrewardstransaction_owner: Dde,
        claimrewardstransaction_serialize: Fde,
        claimrewardstransaction_signature: Lde,
        claimrewardstransaction_toString: zde,
        claimrewardstransaction_value: Ude,
        closure3109_externref_shim: C_e,
        closure3155_externref_shim: I_e,
        closure3158_externref_shim: A_e,
        coinCommitment: Hde,
        coinNullifier: jde,
        coinsecretkey_clear: qde,
        coinsecretkey_new: Kde,
        coinsecretkey_public_key: Wde,
        coinsecretkey_yesIKnowTheSecurityImplicationsOfThis_serialize: $de,
        communicationCommitment: Oye,
        communicationCommitmentRandomness: Mye,
        contractcall_address: Xde,
        contractcall_communicationCommitment: Gde,
        contractcall_entryPoint: Zde,
        contractcall_fallibleTranscript: Jde,
        contractcall_guaranteedTranscript: Yde,
        contractcall_new: Qde,
        contractcall_proof: efe,
        contractcall_toString: tfe,
        contractcallprototype_intoCall: nfe,
        contractcallprototype_new: rfe,
        contractcallprototype_toString: sfe,
        contractdeploy_address: ife,
        contractdeploy_initialState: ofe,
        contractdeploy_new: afe,
        contractdeploy_toString: cfe,
        contractmaintenanceauthority_committee: Rye,
        contractmaintenanceauthority_counter: Nye,
        contractmaintenanceauthority_deserialize: Vye,
        contractmaintenanceauthority_new: Bye,
        contractmaintenanceauthority_serialize: Dye,
        contractmaintenanceauthority_threshold: Fye,
        contractmaintenanceauthority_toString: Lye,
        contractoperation_deserialize: zye,
        contractoperation_new: Uye,
        contractoperation_serialize: Hye,
        contractoperation_set_verifier_key: jye,
        contractoperation_toString: qye,
        contractoperation_verifier_key: Kye,
        contractoperationversion_new: lfe,
        contractoperationversion_toString: ufe,
        contractoperationversion_version: dfe,
        contractoperationversionedverifierkey_new: ffe,
        contractoperationversionedverifierkey_raw_vk: hfe,
        contractoperationversionedverifierkey_toString: pfe,
        contractoperationversionedverifierkey_version: gfe,
        contractstate_balance: Wye,
        contractstate_data: $ye,
        contractstate_deserialize: Xye,
        contractstate_maintenance_authority: Gye,
        contractstate_new: Zye,
        contractstate_operation: Jye,
        contractstate_operations: Yye,
        contractstate_query: Qye,
        contractstate_serialize: e1e,
        contractstate_setOperation: t1e,
        contractstate_set_balance: n1e,
        contractstate_set_data: r1e,
        contractstate_set_maintenance_authority: s1e,
        contractstate_toString: i1e,
        costmodel_initialCostModel: o1e,
        costmodel_new: a1e,
        costmodel_toString: c1e,
        createCheckPayload: bfe,
        createCoinInfo: mfe,
        createProvingPayload: yfe,
        createProvingTransactionPayload: wfe,
        createShieldedCoinInfo: _fe,
        decodeCoinPublicKey: l1e,
        decodeContractAddress: u1e,
        decodeQualifiedShieldedCoinInfo: d1e,
        decodeRawTokenType: f1e,
        decodeShieldedCoinInfo: h1e,
        decodeUserAddress: p1e,
        degradeToTransient: g1e,
        dummyContractAddress: b1e,
        dummyUserAddress: m1e,
        dustactions_ctime: xfe,
        dustactions_deserialize: vfe,
        dustactions_new: Sfe,
        dustactions_registrations: kfe,
        dustactions_serialize: Tfe,
        dustactions_set_ctime: Efe,
        dustactions_set_registrations: Cfe,
        dustactions_set_spends: Ife,
        dustactions_spends: Afe,
        dustactions_toString: Pfe,
        dustgenerationstate_deserialize: Ofe,
        dustgenerationstate_new: Mfe,
        dustgenerationstate_serialize: Rfe,
        dustgenerationstate_toString: Nfe,
        dustlocalstate_deserialize: Vfe,
        dustlocalstate_generationInfo: Bfe,
        dustlocalstate_new: Dfe,
        dustlocalstate_params: Ffe,
        dustlocalstate_processTtls: Lfe,
        dustlocalstate_replayEvents: zfe,
        dustlocalstate_replayEventsWithChanges: Ufe,
        dustlocalstate_serialize: Hfe,
        dustlocalstate_spend: jfe,
        dustlocalstate_syncTime: qfe,
        dustlocalstate_toString: Kfe,
        dustlocalstate_utxos: Wfe,
        dustlocalstate_walletBalance: $fe,
        dustlocalstatewithchanges_changes: Xfe,
        dustlocalstatewithchanges_state: Gfe,
        dustparameters_deserialize: Zfe,
        dustparameters_dustGracePeriodSeconds: Jfe,
        dustparameters_generationDecayRate: Yfe,
        dustparameters_new: Qfe,
        dustparameters_nightDustRatio: ehe,
        dustparameters_serialize: the,
        dustparameters_set_dustGracePeriodSeconds: nhe,
        dustparameters_set_generationDecayRate: rhe,
        dustparameters_set_nightDustRatio: she,
        dustparameters_timeToCapSeconds: ihe,
        dustparameters_toString: ohe,
        dustregistration_allowFeePayment: ahe,
        dustregistration_deserialize: che,
        dustregistration_dustAddress: lhe,
        dustregistration_new: uhe,
        dustregistration_nightKey: dhe,
        dustregistration_serialize: fhe,
        dustregistration_set_allowFeePayment: hhe,
        dustregistration_set_dustAddress: phe,
        dustregistration_set_nightKey: ghe,
        dustregistration_set_signature: bhe,
        dustregistration_signature: mhe,
        dustregistration_toString: yhe,
        dustsecretkey_clear: whe,
        dustsecretkey_fromBigint: _he,
        dustsecretkey_fromSeed: xhe,
        dustsecretkey_new: vhe,
        dustsecretkey_publicKey: She,
        dustspend_new: khe,
        dustspend_newCommitment: The,
        dustspend_oldNullifier: Ehe,
        dustspend_proof: Che,
        dustspend_toString: Ihe,
        dustspend_vFee: Ahe,
        duststate_deserialize: Phe,
        duststate_generation: Ohe,
        duststate_new: Mhe,
        duststate_serialize: Rhe,
        duststate_toString: Nhe,
        duststate_utxo: Vhe,
        duststatechanges_receivedUtxos: Bhe,
        duststatechanges_source: Dhe,
        duststatechanges_spentUtxos: Fhe,
        dustutxostate_deserialize: Lhe,
        dustutxostate_new: zhe,
        dustutxostate_serialize: Uhe,
        dustutxostate_toString: Hhe,
        ecAdd: y1e,
        ecMul: w1e,
        ecMulGenerator: _1e,
        encodeCoinPublicKey: x1e,
        encodeContractAddress: v1e,
        encodeQualifiedShieldedCoinInfo: S1e,
        encodeRawTokenType: k1e,
        encodeShieldedCoinInfo: T1e,
        encodeUserAddress: E1e,
        encryptionsecretkey_clear: jhe,
        encryptionsecretkey_deserialize: qhe,
        encryptionsecretkey_new: Khe,
        encryptionsecretkey_public_key: Whe,
        encryptionsecretkey_taggedDeserialize: $he,
        encryptionsecretkey_test: Xhe,
        encryptionsecretkey_yesIKnowTheSecurityImplicationsOfThis_serialize: Ghe,
        encryptionsecretkey_yesIKnowTheSecurityImplicationsOfThis_taggedSerialize: Zhe,
        entryPointHash: C1e,
        event_deserialize: Jhe,
        event_new: Yhe,
        event_serialize: Qhe,
        event_toString: epe,
        feeToken: tpe,
        hashToCurve: I1e,
        intent_actions: npe,
        intent_addCall: rpe,
        intent_addDeploy: spe,
        intent_addMaintenanceUpdate: ipe,
        intent_bind: ope,
        intent_binding: ape,
        intent_construct: cpe,
        intent_deserialize: lpe,
        intent_dustActions: upe,
        intent_eraseProofs: dpe,
        intent_eraseSignatures: fpe,
        intent_fallibleUnshieldedOffer: hpe,
        intent_guaranteedUnshieldedOffer: ppe,
        intent_intentHash: gpe,
        intent_new: bpe,
        intent_serialize: mpe,
        intent_set_actions: ype,
        intent_set_dustActions: wpe,
        intent_set_fallibleUnshieldedOffer: _pe,
        intent_set_guaranteedUnshieldedOffer: xpe,
        intent_set_ttl: vpe,
        intent_signatureData: Spe,
        intent_toString: kpe,
        intent_ttl: Tpe,
        intounderlyingbytesource_autoAllocateChunkSize: c_e,
        intounderlyingbytesource_cancel: l_e,
        intounderlyingbytesource_pull: u_e,
        intounderlyingbytesource_start: d_e,
        intounderlyingbytesource_type: f_e,
        intounderlyingsink_abort: h_e,
        intounderlyingsink_close: p_e,
        intounderlyingsink_write: g_e,
        intounderlyingsource_cancel: b_e,
        intounderlyingsource_pull: m_e,
        leafHash: A1e,
        ledgerparameters_deserialize: Epe,
        ledgerparameters_dust: Cpe,
        ledgerparameters_feePrices: Ipe,
        ledgerparameters_initialParameters: Ape,
        ledgerparameters_maxPriceAdjustment: Ppe,
        ledgerparameters_new: Ope,
        ledgerparameters_normalizeFullness: Mpe,
        ledgerparameters_serialize: Rpe,
        ledgerparameters_toString: Npe,
        ledgerparameters_transactionCostModel: Vpe,
        ledgerstate_apply: Bpe,
        ledgerstate_applySystemTx: Dpe,
        ledgerstate_blank: Fpe,
        ledgerstate_block_reward_pool: Lpe,
        ledgerstate_bridgeReceiving: zpe,
        ledgerstate_deserialize: Upe,
        ledgerstate_dust: Hpe,
        ledgerstate_index: jpe,
        ledgerstate_locked_pool: qpe,
        ledgerstate_new: Kpe,
        ledgerstate_parameters: Wpe,
        ledgerstate_postBlockUpdate: $pe,
        ledgerstate_reserve_pool: Xpe,
        ledgerstate_serialize: Gpe,
        ledgerstate_set_parameters: Zpe,
        ledgerstate_testingDistributeNight: Jpe,
        ledgerstate_toString: Ype,
        ledgerstate_treasuryBalance: Qpe,
        ledgerstate_unclaimedBlockRewards: e0e,
        ledgerstate_updateIndex: t0e,
        ledgerstate_utxo: n0e,
        ledgerstate_zswap: r0e,
        maintenanceupdate_addSignature: s0e,
        maintenanceupdate_address: i0e,
        maintenanceupdate_counter: o0e,
        maintenanceupdate_data_to_sign: a0e,
        maintenanceupdate_new: c0e,
        maintenanceupdate_signatures: l0e,
        maintenanceupdate_toString: u0e,
        maintenanceupdate_updates: d0e,
        maxAlignedSize: P1e,
        maxField: O1e,
        memory: pue,
        merkletreecollapsedupdate_deserialize: f0e,
        merkletreecollapsedupdate_new: h0e,
        merkletreecollapsedupdate_serialize: p0e,
        merkletreecollapsedupdate_toString: g0e,
        nativeToken: b0e,
        nobinding_deserialize: m0e,
        nobinding_instance: y0e,
        nobinding_new: w0e,
        nobinding_serialize: _0e,
        nobinding_toString: x0e,
        noproof_instance: v0e,
        noproof_new: S0e,
        noproof_toString: k0e,
        parseCheckResult: T0e,
        partitionTranscripts: E0e,
        persistentCommit: M1e,
        persistentHash: R1e,
        prebinding_deserialize: C0e,
        prebinding_instance: I0e,
        prebinding_new: A0e,
        prebinding_serialize: P0e,
        prebinding_toString: O0e,
        prepartitioncontractcall_new: M0e,
        prepartitioncontractcall_toString: R0e,
        preproof_deserialize: N0e,
        preproof_instance: V0e,
        preproof_new: B0e,
        preproof_serialize: D0e,
        preproof_toString: F0e,
        pretranscript_new: L0e,
        pretranscript_toString: z0e,
        proofDataIntoSerializedPreimage: N1e,
        proof_deserialize: U0e,
        proof_instance: H0e,
        proof_new: j0e,
        proof_serialize: q0e,
        proof_toString: K0e,
        querycontext_address: V1e,
        querycontext_block: B1e,
        querycontext_com_indices: D1e,
        querycontext_effects: F1e,
        querycontext_insertCommitment: L1e,
        querycontext_new: z1e,
        querycontext_qualify: U1e,
        querycontext_query: H1e,
        querycontext_runTranscript: j1e,
        querycontext_set_block: q1e,
        querycontext_set_effects: K1e,
        querycontext_state: W1e,
        querycontext_toString: $1e,
        querycontext_toVmStack: X1e,
        queryresults_context: G1e,
        queryresults_events: Z1e,
        queryresults_gas_cost: J1e,
        queryresults_new: Y1e,
        queryresults_toString: Q1e,
        rawTokenType: ewe,
        replaceauthority_authority: W0e,
        replaceauthority_new: $0e,
        replaceauthority_toString: X0e,
        runProgram: twe,
        runtimeCoinCommitment: nwe,
        runtimeCoinNullifier: rwe,
        sampleCoinPublicKey: G0e,
        sampleContractAddress: swe,
        sampleDustSecretKey: Z0e,
        sampleEncryptionPublicKey: J0e,
        sampleIntentHash: Y0e,
        sampleRawTokenType: iwe,
        sampleSigningKey: owe,
        sampleUserAddress: awe,
        shieldedToken: Q0e,
        signData: cwe,
        signatureVerifyingKey: lwe,
        signatureenabled_deserialize: ege,
        signatureenabled_instance: tge,
        signatureenabled_new: nge,
        signatureenabled_serialize: rge,
        signatureenabled_toString: sge,
        signatureerased_instance: ige,
        signatureerased_new: lye,
        signatureerased_toString: oge,
        signingKeyFromBip340: uwe,
        stateboundedmerkletree_blank: dwe,
        stateboundedmerkletree_collapse: fwe,
        stateboundedmerkletree_findPathForLeaf: hwe,
        stateboundedmerkletree_height: pwe,
        stateboundedmerkletree_pathForLeaf: gwe,
        stateboundedmerkletree_rehash: bwe,
        stateboundedmerkletree_root: mwe,
        stateboundedmerkletree_toString: ywe,
        stateboundedmerkletree_update: wwe,
        statemap_get: _we,
        statemap_insert: xwe,
        statemap_keys: vwe,
        statemap_new: Swe,
        statemap_remove: kwe,
        statemap_toString: Twe,
        statevalue_arrayPush: Ewe,
        statevalue_asArray: Cwe,
        statevalue_asBoundedMerkleTree: Iwe,
        statevalue_asCell: Awe,
        statevalue_asMap: Pwe,
        statevalue_decode: Owe,
        statevalue_encode: Mwe,
        statevalue_logSize: Rwe,
        statevalue_new: Nwe,
        statevalue_newArray: Vwe,
        statevalue_newBoundedMerkleTree: Bwe,
        statevalue_newCell: Dwe,
        statevalue_newMap: Fwe,
        statevalue_newNull: Lwe,
        statevalue_toString: zwe,
        statevalue_type: Uwe,
        systemtransaction_deserialize: age,
        systemtransaction_new: cge,
        systemtransaction_serialize: lge,
        systemtransaction_toString: uge,
        transaction_addCalls: dge,
        transaction_bind: fge,
        transaction_bindingRandomness: hge,
        transaction_cost: pge,
        transaction_deserialize: gge,
        transaction_eraseProofs: bge,
        transaction_eraseSignatures: mge,
        transaction_fallibleOffer: yge,
        transaction_fees: wge,
        transaction_feesWithMargin: _ge,
        transaction_fromParts: xge,
        transaction_fromPartsRandomized: vge,
        transaction_fromRewards: Sge,
        transaction_guaranteedOffer: kge,
        transaction_identifiers: Tge,
        transaction_imbalances: Ege,
        transaction_intents: Cge,
        transaction_merge: Ige,
        transaction_mockProve: Age,
        transaction_new: Pge,
        transaction_prove: Oge,
        transaction_rewards: Mge,
        transaction_serialize: Rge,
        transaction_set_fallibleOffer: Nge,
        transaction_set_guaranteedOffer: Vge,
        transaction_set_intents: Bge,
        transaction_toString: Dge,
        transaction_transactionHash: Fge,
        transaction_wellFormed: Lge,
        transactioncontext_new: zge,
        transactioncontext_toString: Uge,
        transactioncostmodel_baselineCost: Hge,
        transactioncostmodel_deserialize: jge,
        transactioncostmodel_initialTransactionCostModel: qge,
        transactioncostmodel_new: Kge,
        transactioncostmodel_runtimeCostModel: Wge,
        transactioncostmodel_serialize: $ge,
        transactioncostmodel_toString: Xge,
        transactionresult_error: Gge,
        transactionresult_events: Zge,
        transactionresult_new: Jge,
        transactionresult_successfulSegments: Yge,
        transactionresult_toString: Qge,
        transactionresult_type_: ebe,
        transientCommit: Hwe,
        transientHash: jwe,
        unshieldedToken: uye,
        unshieldedoffer_addSignatures: tbe,
        unshieldedoffer_construct: nbe,
        unshieldedoffer_eraseSignatures: rbe,
        unshieldedoffer_inputs: sbe,
        unshieldedoffer_new: ibe,
        unshieldedoffer_outputs: obe,
        unshieldedoffer_signatures: abe,
        unshieldedoffer_toString: cbe,
        updatedValue: lbe,
        upgradeFromTransient: qwe,
        utxometa_ctime: ube,
        utxometa_new: dbe,
        utxometa_set_ctime: fbe,
        utxostate_delta: hbe,
        utxostate_filter: pbe,
        utxostate_lookupMeta: gbe,
        utxostate_new: bbe,
        utxostate_utxos: mbe,
        valueToBigInt: Kwe,
        verifiedtransaction_transaction: ybe,
        verifierkeyinsert_new: wbe,
        verifierkeyinsert_operation: _be,
        verifierkeyinsert_toString: xbe,
        verifierkeyinsert_vk: vbe,
        verifierkeyremove_new: Sbe,
        verifierkeyremove_operation: kbe,
        verifierkeyremove_toString: Tbe,
        verifierkeyremove_version: Ebe,
        verifySignature: Wwe,
        vmresults_events: $we,
        vmresults_gas_cost: Xwe,
        vmresults_new: Gwe,
        vmresults_stack: Zwe,
        vmresults_toString: Jwe,
        vmstack_get: Ywe,
        vmstack_isStrong: Qwe,
        vmstack_length: e_e,
        vmstack_new: t_e,
        vmstack_push: n_e,
        vmstack_removeLast: r_e,
        vmstack_toString: s_e,
        wellformedstrictness_enforce_balancing: Cbe,
        wellformedstrictness_enforce_limits: Ibe,
        wellformedstrictness_new: Abe,
        wellformedstrictness_set_enforce_balancing: Pbe,
        wellformedstrictness_set_enforce_limits: Obe,
        wellformedstrictness_set_verify_contract_proofs: Mbe,
        wellformedstrictness_set_verify_native_proofs: Rbe,
        wellformedstrictness_set_verify_signatures: Nbe,
        wellformedstrictness_verify_contract_proofs: Vbe,
        wellformedstrictness_verify_native_proofs: Bbe,
        wellformedstrictness_verify_signatures: Dbe,
        zswapchainstate_deserialize: Fbe,
        zswapchainstate_deserializeFromLedgerState: Lbe,
        zswapchainstate_filter: zbe,
        zswapchainstate_firstFree: Ube,
        zswapchainstate_new: Hbe,
        zswapchainstate_postBlockUpdate: jbe,
        zswapchainstate_serialize: qbe,
        zswapchainstate_toString: Kbe,
        zswapchainstate_tryApply: Wbe,
        zswapinput_contractAddress: $be,
        zswapinput_deserialize: Xbe,
        zswapinput_new: Gbe,
        zswapinput_newContractOwned: Zbe,
        zswapinput_nullifier: Jbe,
        zswapinput_proof: Ybe,
        zswapinput_serialize: Qbe,
        zswapinput_toString: eme,
        zswaplocalstate_apply: tme,
        zswaplocalstate_applyCollapsedUpdate: nme,
        zswaplocalstate_applyFailed: rme,
        zswaplocalstate_clearPending: sme,
        zswaplocalstate_coins: ime,
        zswaplocalstate_deserialize: ome,
        zswaplocalstate_firstFree: ame,
        zswaplocalstate_new: cme,
        zswaplocalstate_pendingOutputs: lme,
        zswaplocalstate_pendingSpends: ume,
        zswaplocalstate_replayEvents: dme,
        zswaplocalstate_replayEventsWithChanges: fme,
        zswaplocalstate_revertTransaction: hme,
        zswaplocalstate_serialize: pme,
        zswaplocalstate_spend: gme,
        zswaplocalstate_spendFromOutput: bme,
        zswaplocalstate_toString: mme,
        zswaplocalstate_watchFor: yme,
        zswaplocalstatewithchanges_changes: wme,
        zswaplocalstatewithchanges_state: _me,
        zswapoffer_deltas: xme,
        zswapoffer_deserialize: vme,
        zswapoffer_fromInput: Sme,
        zswapoffer_fromOutput: kme,
        zswapoffer_fromTransient: Tme,
        zswapoffer_inputs: Eme,
        zswapoffer_merge: Cme,
        zswapoffer_new: Ime,
        zswapoffer_outputs: Ame,
        zswapoffer_serialize: Pme,
        zswapoffer_toString: Ome,
        zswapoffer_transients: Mme,
        zswapoutput_commitment: Rme,
        zswapoutput_construct: Nme,
        zswapoutput_contractAddress: Vme,
        zswapoutput_deserialize: Bme,
        zswapoutput_new: Dme,
        zswapoutput_newContractOwned: Fme,
        zswapoutput_proof: Lme,
        zswapoutput_serialize: zme,
        zswapoutput_toString: Ume,
        zswapsecretkeys_clear: Hme,
        zswapsecretkeys_coinPublicKey: jme,
        zswapsecretkeys_coinSecretKey: qme,
        zswapsecretkeys_encryptionPublicKey: Kme,
        zswapsecretkeys_encryptionSecretKey: Wme,
        zswapsecretkeys_fromSeed: $me,
        zswapsecretkeys_fromSeedRng: Xme,
        zswapsecretkeys_new: Gme,
        zswapstatechanges_receivedCoins: Zme,
        zswapstatechanges_source: Jme,
        zswapstatechanges_spentCoins: Yme,
        zswaptransient_commitment: Qme,
        zswaptransient_contractAddress: eye,
        zswaptransient_deserialize: tye,
        zswaptransient_inputProof: nye,
        zswaptransient_new: rye,
        zswaptransient_newFromContractOwnedOutput: sye,
        zswaptransient_nullifier: iye,
        zswaptransient_outputProof: oye,
        zswaptransient_serialize: aye,
        zswaptransient_toString: cye
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    sae(P_e);
    Bj();
    const Is = 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 O_e {
        imbalances;
        transactionCostModel;
        feeTokenType;
        inputs;
        outputs;
        targetImbalances;
        constructor(e, n, r, s){
            this.imbalances = Is.ensureZerosFor(e, Is.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 iy = class extends Error {
        tokenType;
        constructor(e){
            super(`Insufficient Funds: could not balance ${e}`), this.tokenType = e;
        }
    };
    const F2 = ({ coins: t, initialImbalances: e, transactionCostModel: n, feeTokenType: r, createOutput: s, coinSelection: i, isCoinEqual: o, targetImbalances: a })=>{
        const c = M_e(t, e, n, r, i ?? BE, s, o, a);
        return {
            inputs: c.inputs,
            outputs: c.outputs
        };
    }, M_e = (t, e, n, r, s, i, o, a = new Map)=>{
        const c = new O_e(e, n, r, a);
        let l;
        for(; l = c.findNonNativeImbalance();)t = KR(l, t, c, s, i, o);
        for(; l = c.findNativeImbalance();)t = KR(l, t, c, s, i, o);
        return c;
    }, KR = (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 iy(o);
            n.addInput(l), e = e.filter((u)=>!i(u, l));
        }
        return e;
    }, BE = (t, e)=>t.filter((n)=>n.type === e).sort((n, r)=>Number(n.value - r.value)).at(0), R_e = (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);
                    };
                };
        }
    }, Ft = (t)=>t, Pv = (t)=>()=>t, WR = Pv(!0), oy = Pv(!1), Dj = Pv(void 0), L2 = Dj;
    function V(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 H0 = (t)=>(e, n)=>e === n || t(e, n), N_e = (t, e)=>t === e, V_e = ()=>N_e, B_e = V_e(), Fj = j(2, (t, e)=>H0((n, r)=>t(e(n), e(r)))), D_e = Fj(B_e, (t)=>t.getTime()), F_e = (t)=>H0((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;
        }), L_e = (t)=>j(3, (e, n, r)=>t(e, (s)=>({
                    ...s,
                    [n]: r(s)
                }))), z_e = (t)=>j(2, (e, n)=>t(e, (r)=>({
                    [n]: r
                }))), U_e = (t, e)=>j(3, (n, r, s)=>e(n, (i)=>t(s(i), (o)=>({
                        ...i,
                        [r]: o
                    })))), $R = "effect/GlobalValue";
    let Nb;
    const qt = (t, e)=>(Nb || (globalThis[$R] ??= new Map, Nb = globalThis[$R]), Nb.has(t) || Nb.set(t, e()), Nb.get(t)), H_e = (t)=>t instanceof Map, ko = (t)=>typeof t == "string", kh = (t)=>typeof t == "number", c1 = (t)=>typeof t == "boolean", Ov = (t)=>typeof t == "bigint", H6 = (t)=>typeof t == "symbol", Rg = R_e, j_e = (t)=>t === void 0, q_e = (t)=>!1, DE = (t)=>typeof t == "object" && t !== null, Uc = (t)=>DE(t) || Rg(t), Vt = j(2, (t, e)=>Uc(t) && e in t), FE = j(2, (t, e)=>Vt(t, "_tag") && t._tag === e), Mp = (t)=>t == null, K_e = (t)=>t != null, W_e = (t)=>t instanceof Uint8Array, Lj = (t)=>t instanceof Date, zj = (t)=>typeof t == "string" || Vt(t, Symbol.iterator), $_e = (t)=>DE(t) && !Array.isArray(t), Uj = (t)=>Vt(t, "then") && Rg(t.then), Mv = (t)=>`BUG: ${t} - please report an issue at https://github.com/Effect-TS/effect/issues`, j6 = Symbol.for("effect/Gen/GenKind"), X_e = (t)=>Uc(t) && j6 in t;
    class G_e {
        value;
        constructor(e){
            this.value = e;
        }
        get _F() {
            return Ft;
        }
        get _R() {
            return (e)=>e;
        }
        get _O() {
            return (e)=>e;
        }
        get _E() {
            return (e)=>e;
        }
        [j6] = j6;
        [Symbol.iterator]() {
            return new LE(this);
        }
    }
    let LE = class Hj {
        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 Hj(this.self);
        }
    };
    const Z_e = ()=>function() {
            let t = arguments[0];
            for(let e = 1; e < arguments.length; e++)t = arguments[e](t);
            return new G_e(t);
        }, J_e = 335903614, Y_e = 4150755663, Q_e = 1481765933, e2e = 1284865837, t2e = 9007199254740992, n2e = 134217728;
    class r2e {
        _state;
        constructor(e, n, r, s){
            return Mp(n) && Mp(e) ? (n = Math.random() * 4294967295 >>> 0, e = 0) : Mp(n) && (n = e, e = 0), Mp(s) && Mp(r) ? (s = this._state ? this._state[3] : Y_e, r = this._state ? this._state[2] : J_e) : Mp(s) && (s = r, r = 0), this._state = new Int32Array([
                0,
                0,
                r >>> 0,
                ((s || 0) | 1) >>> 0
            ]), this._next(), XR(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 * n2e + n) / t2e;
        }
        _next() {
            const e = this._state[0] >>> 0, n = this._state[1] >>> 0;
            s2e(this._state, e, n, Q_e, e2e), XR(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 s2e(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 XR(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 q6 = Symbol.for("effect/Utils/YieldWrap");
    class l1 {
        #e;
        constructor(e){
            this.#e = e;
        }
        [q6]() {
            return this.#e;
        }
    }
    function jj(t) {
        if (typeof t == "object" && t !== null && q6 in t) return t[q6]();
        throw new Error(Mv("yieldWrapGet"));
    }
    const Fo = qt("effect/Utils/isStructuralRegion", ()=>({
            enabled: !1,
            tester: void 0
        })), qj = {
        effect_internal_function: (t)=>t()
    }, i2e = {
        effect_internal_function: (t)=>{
            try {
                return t();
            } finally{}
        }
    }, o2e = qj.effect_internal_function(()=>new Error().stack)?.includes("effect_internal_function") === !0, Us = o2e ? qj.effect_internal_function : i2e.effect_internal_function, W8 = qt(Symbol.for("effect/Hash/randomHashCache"), ()=>new WeakMap), Zt = Symbol.for("effect/Hash"), St = (t)=>{
        if (Fo.enabled === !0) return 0;
        switch(typeof t){
            case "number":
                return u1(t);
            case "bigint":
                return zr(t.toString(10));
            case "boolean":
                return zr(String(t));
            case "symbol":
                return zr(String(t));
            case "string":
                return zr(t);
            case "undefined":
                return zr("undefined");
            case "function":
            case "object":
                return t === null ? zr("null") : t instanceof Date ? Number.isNaN(t.getTime()) ? zr("Invalid Date") : St(t.toISOString()) : t instanceof URL ? St(t.href) : a2e(t) ? t[Zt]() : zE(t);
            default:
                throw new Error(`BUG: unhandled typeof ${typeof t} - please report an issue at https://github.com/Effect-TS/effect/issues`);
        }
    }, zE = (t)=>(W8.has(t) || W8.set(t, u1(Math.floor(Math.random() * Number.MAX_SAFE_INTEGER))), W8.get(t)), bn = (t)=>(e)=>e * 53 ^ t, Rv = (t)=>t & 3221225471 | t >>> 1 & 1073741824, a2e = (t)=>Vt(t, Zt), u1 = (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 Rv(e);
    }, zr = (t)=>{
        let e = 5381, n = t.length;
        for(; n;)e = e * 33 ^ t.charCodeAt(--n);
        return Rv(e);
    }, c2e = (t, e)=>{
        let n = 12289;
        for(let r = 0; r < e.length; r++)n ^= V(zr(e[r]), bn(St(t[e[r]])));
        return Rv(n);
    }, Kj = (t)=>c2e(t, Object.keys(t)), Ng = (t)=>{
        let e = 6151;
        for(let n = 0; n < t.length; n++)e = V(e, bn(St(t[n])));
        return Rv(e);
    }, Jn = function() {
        if (arguments.length === 1) {
            const n = arguments[0];
            return function(r) {
                return Object.defineProperty(n, Zt, {
                    value () {
                        return r;
                    },
                    enumerable: !1
                }), r;
            };
        }
        const t = arguments[0], e = arguments[1];
        return Object.defineProperty(t, Zt, {
            value () {
                return e;
            },
            enumerable: !1
        }), e;
    }, jt = Symbol.for("effect/Equal");
    function Lt() {
        return arguments.length === 1 ? (t)=>z2(t, arguments[0]) : z2(arguments[0], arguments[1]);
    }
    function z2(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 (ay(t) && ay(e)) return St(t) === St(e) && t[jt](e) ? !0 : Fo.enabled && Fo.tester ? Fo.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 (Fo.enabled) {
                if (t === null || e === null) return !1;
                if (Array.isArray(t) && Array.isArray(e)) return t.length === e.length && t.every((r, s)=>z2(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 && z2(t[i], e[i]))) return Fo.tester ? Fo.tester(t, e) : !1;
                        return !0;
                    }
                }
                return Fo.tester ? Fo.tester(t, e) : !1;
            }
        }
        return Fo.enabled && Fo.tester ? Fo.tester(t, e) : !1;
    }
    const ay = (t)=>Vt(t, jt), UE = ()=>Lt, Rn = Symbol.for("nodejs.util.inspect.custom"), wr = (t)=>{
        try {
            if (Vt(t, "toJSON") && Rg(t.toJSON) && t.toJSON.length === 0) return t.toJSON();
            if (Array.isArray(t)) return t.map(wr);
        } catch  {
            return {};
        }
        return HE(t);
    }, $8 = "[Circular]";
    function Wj(t) {
        try {
            return t.toISOString();
        } catch  {
            return "Invalid Date";
        }
    }
    function l2e(t) {
        try {
            const e = t.toString();
            return typeof e == "string" ? e : String(e);
        } catch  {
            return "[toString threw]";
        }
    }
    function $j(t) {
        return ko(t) ? JSON.stringify(t) : String(t);
    }
    function Zd(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) ? $8 : (n.add(o), `[${o.map((c)=>i(c, a)).join(",")}]`);
            if (Lj(o)) return Wj(o);
            if (Vt(o, "toString") && Rg(o.toString) && o.toString !== Object.prototype.toString && o.toString !== Array.prototype.toString) {
                const c = l2e(o);
                return o instanceof Error && o.cause ? `${c} (cause: ${i(o.cause, a)})` : c;
            }
            if (ko(o)) return JSON.stringify(o);
            if (kh(o) || o == null || c1(o) || H6(o)) return String(o);
            if (Ov(o)) return String(o) + "n";
            if (o instanceof Set || o instanceof Map) return n.has(o) ? $8 : (n.add(o), `${o.constructor.name}(${i(Array.from(o), a)})`);
            if (Uc(o)) {
                if (n.has(o)) return $8;
                n.add(o);
                const c = s(o);
                {
                    const l = `{${c.map((u)=>`${$j(u)}:${i(o[u], a)}`).join(",")}}`;
                    return r(o, l);
                }
            }
            return String(o);
        }
        return i(t, 0);
    }
    const vr = (t)=>JSON.stringify(t, null, 2), Nv = {
        toJSON () {
            return wr(this);
        },
        [Rn] () {
            return this.toJSON();
        },
        toString () {
            return vr(this.toJSON());
        }
    };
    let u2e = class {
        [Rn]() {
            return this.toJSON();
        }
        toString() {
            return vr(this.toJSON());
        }
    };
    const j0 = (t, e = 2)=>{
        if (typeof t == "string") return t;
        try {
            return typeof t == "object" ? Xj(t, e) : String(t);
        } catch  {
            return String(t);
        }
    }, Xj = (t, e)=>{
        let n = [];
        const r = JSON.stringify(t, (s, i)=>typeof i == "object" && i !== null ? n.includes(i) ? void 0 : n.push(i) && (th.fiberRefs !== void 0 && Gj(i) ? i[Vv](th.fiberRefs) : i) : i, e);
        return n = void 0, r;
    }, Vv = Symbol.for("effect/Inspectable/Redactable"), Gj = (t)=>typeof t == "object" && t !== null && Vv in t, th = qt("effect/Inspectable/redactableState", ()=>({
            fiberRefs: void 0
        })), d2e = (t, e)=>{
        const n = th.fiberRefs;
        th.fiberRefs = t;
        try {
            return e();
        } finally{
            th.fiberRefs = n;
        }
    }, HE = (t)=>Gj(t) && th.fiberRefs !== void 0 ? t[Vv](th.fiberRefs) : t, xt = (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;
                }
        }
    }, Am = "Async", Bv = "Commit", Os = "Failure", z_ = "OnFailure", U2 = "OnSuccess", H2 = "OnSuccessAndFailure", Ms = "Success", Zj = "Sync", f2e = "Tag", Vg = "UpdateRuntimeFlags", j2 = "While", Pm = "Iterator", Jj = "WithRuntime", U_ = "Yield", jE = "RevertFlags";
    let h2e = "3.21.0";
    const qE = ()=>h2e, p2e = Symbol.for("effect/Effect"), g2e = Symbol.for("effect/Stream"), b2e = Symbol.for("effect/Sink"), m2e = Symbol.for("effect/Channel"), q0 = {
        _R: (t)=>t,
        _E: (t)=>t,
        _A: (t)=>t,
        _V: qE()
    }, y2e = {
        _A: (t)=>t,
        _In: (t)=>t,
        _L: (t)=>t,
        _E: (t)=>t,
        _R: (t)=>t
    }, w2e = {
        _Env: (t)=>t,
        _InErr: (t)=>t,
        _InElem: (t)=>t,
        _InDone: (t)=>t,
        _OutErr: (t)=>t,
        _OutElem: (t)=>t,
        _OutDone: (t)=>t
    }, d1 = {
        [p2e]: q0,
        [g2e]: q0,
        [b2e]: y2e,
        [m2e]: w2e,
        [jt] (t) {
            return this === t;
        },
        [Zt] () {
            return Jn(this, zE(this));
        },
        [Symbol.iterator] () {
            return new LE(new l1(this));
        },
        pipe () {
            return xt(this, arguments);
        }
    }, f1 = {
        [Zt] () {
            return Jn(this, Kj(this));
        },
        [jt] (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 && Lt(this[r], t[r]))) return !1;
            return !0;
        }
    }, h1 = {
        ...d1,
        _op: Bv
    }, _2e = {
        ...h1,
        ...f1
    }, x2e = (function() {
        function t() {}
        return t.prototype = h1, t;
    })(), Yj = Symbol.for("effect/Option"), Qj = {
        ...d1,
        [Yj]: {
            _A: (t)=>t
        },
        [Rn] () {
            return this.toJSON();
        },
        toString () {
            return vr(this.toJSON());
        }
    }, v2e = Object.assign(Object.create(Qj), {
        _tag: "Some",
        _op: "Some",
        [jt] (t) {
            return eq(t) && tq(t) && Lt(this.value, t.value);
        },
        [Zt] () {
            return Jn(this, bn(St(this._tag))(St(this.value)));
        },
        toJSON () {
            return {
                _id: "Option",
                _tag: this._tag,
                value: wr(this.value)
            };
        }
    }), S2e = St("None"), k2e = Object.assign(Object.create(Qj), {
        _tag: "None",
        _op: "None",
        [jt] (t) {
            return eq(t) && KE(t);
        },
        [Zt] () {
            return S2e;
        },
        toJSON () {
            return {
                _id: "Option",
                _tag: this._tag
            };
        }
    }), eq = (t)=>Vt(t, Yj), KE = (t)=>t._tag === "None", tq = (t)=>t._tag === "Some", WE = Object.create(k2e), q2 = (t)=>{
        const e = Object.create(v2e);
        return e.value = t, e;
    }, nq = Symbol.for("effect/Either"), rq = {
        ...d1,
        [nq]: {
            _R: (t)=>t
        },
        [Rn] () {
            return this.toJSON();
        },
        toString () {
            return vr(this.toJSON());
        }
    }, T2e = Object.assign(Object.create(rq), {
        _tag: "Right",
        _op: "Right",
        [jt] (t) {
            return $E(t) && sq(t) && Lt(this.right, t.right);
        },
        [Zt] () {
            return bn(St(this._tag))(St(this.right));
        },
        toJSON () {
            return {
                _id: "Either",
                _tag: this._tag,
                right: wr(this.right)
            };
        }
    }), E2e = Object.assign(Object.create(rq), {
        _tag: "Left",
        _op: "Left",
        [jt] (t) {
            return $E(t) && XE(t) && Lt(this.left, t.left);
        },
        [Zt] () {
            return bn(St(this._tag))(St(this.left));
        },
        toJSON () {
            return {
                _id: "Either",
                _tag: this._tag,
                left: wr(this.left)
            };
        }
    }), $E = (t)=>Vt(t, nq), XE = (t)=>t._tag === "Left", sq = (t)=>t._tag === "Right", iq = (t)=>{
        const e = Object.create(E2e);
        return e.left = t, e;
    }, oq = (t)=>{
        const e = Object.create(T2e);
        return e.right = t, e;
    }, C2e = (t)=>XE(t) ? WE : q2(t.right), I2e = j(2, (t, e)=>KE(t) ? iq(e()) : oq(t.value)), lt = oq, A2e = lt(void 0), Qe = iq, GE = I2e, bo = (t)=>{
        if (Rg(t)) try {
            return lt(t());
        } catch (e) {
            return Qe(e);
        }
        else try {
            return lt(t.try());
        } catch (e) {
            return Qe(t.catch(e));
        }
    }, P2e = $E, Qn = XE, Ia = sq, aq = j(2, (t, { onLeft: e, onRight: n })=>Qn(t) ? Qe(e(t.left)) : lt(n(t.right))), qs = j(2, (t, e)=>Qn(t) ? Qe(e(t.left)) : lt(t.right)), ti = j(2, (t, e)=>Ia(t) ? lt(e(t.right)) : Qe(t.left)), cr = j(2, (t, { onLeft: e, onRight: n })=>Qn(t) ? e(t.left) : n(t.right)), O2e = cr({
        onLeft: Ft,
        onRight: Ft
    }), M2e = j(2, (t, e)=>Qn(t) ? e(t.left) : t.right), ZE = j(2, (t, e)=>{
        if (Ia(t)) return t.right;
        throw e(t.left);
    }), Dv = ZE(()=>new Error("getOrThrow called on a Left")), Bg = j(2, (t, e)=>Qn(t) ? Qe(t.left) : e(t.right)), R2e = Z_e(), Hs = (...t)=>{
        const n = (t.length === 1 ? t[0] : t[1].bind(t[0]))(R2e);
        let r = n.next();
        for(; !r.done;){
            const s = X_e(r.value) ? r.value.value : jj(r.value);
            if (Qn(s)) return s;
            r = n.next(s.right);
        }
        return lt(r.value);
    }, cq = (t)=>t.length > 0, Fv = (t)=>(e, n)=>e === n ? 0 : t(e, n), Lv = Fv((t, e)=>t < e ? -1 : 1), N2e = Fv((t, e)=>t < e ? -1 : 1), V2e = (t)=>Fv((e, n)=>t(n, e)), Th = j(2, (t, e)=>Fv((n, r)=>t(e(n), e(r)))), B2e = Th(Lv, (t)=>t.getTime()), D2e = (t)=>j(2, (e, n)=>t(e, n) === 1), lq = (t)=>j(2, (e, n)=>e === n || t(e, n) < 1 ? e : n), F2e = (t)=>j(2, (e, n)=>e === n || t(e, n) > -1 ? e : n), Ve = ()=>WE, Fe = q2, Zr = KE, nr = tq, un = j(2, (t, { onNone: e, onSome: n })=>Zr(t) ? e() : n(t.value)), L2e = C2e, xr = j(2, (t, e)=>Zr(t) ? e() : t.value), dd = j(2, (t, e)=>Zr(t) ? e() : t), z2e = j(2, (t, e)=>Zr(t) ? Fe(e()) : t), Yh = (t)=>t == null ? Ve() : Fe(t), gc = xr(Dj), uq = (t)=>(...e)=>{
            try {
                return Fe(t(...e));
            } catch  {
                return Ve();
            }
        }, U2e = j(2, (t, e)=>{
        if (nr(t)) return t.value;
        throw e();
    }), H2e = U2e(()=>new Error("getOrThrow called on a None")), Tc = j(2, (t, e)=>Zr(t) ? Ve() : Fe(e(t.value))), p1 = j(2, (t, e)=>Zr(t) ? Ve() : e(t.value)), j2e = j(2, (t, e)=>Zr(t) ? Ve() : Yh(e(t.value))), q2e = (t)=>j(2, (e, n)=>Zr(e) ? !1 : t(e.value, n)), K2e = UE(), W2e = q2e(K2e), $2e = j(2, (t, e)=>Zr(t) ? !1 : e(t.value)), K2 = (t)=>(e, n)=>Zr(e) ? n : Zr(n) ? e : Fe(t(e.value, n.value)), X2e = (...t)=>t, G2e = (t)=>{
        const n = t[Symbol.iterator]().next();
        return n.done ? Ve() : Fe(n.value);
    }, Z2e = j(2, (t, e)=>{
        let n = 0;
        for (const r of t){
            const s = e(r, n);
            if (c1(s)) {
                if (s) return Fe(r);
            } else if (nr(s)) return s;
            n++;
        }
        return Ve();
    }), K6 = 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++)
                        };
                    }
                };
            }
        })), J2e = 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 (nr(i)) return {
                                done: !1,
                                value: i.value
                            };
                            s = n.next();
                        }
                        return {
                            done: !0,
                            value: void 0
                        };
                    }
                };
            }
        })), Y2e = 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
                        };
                    }
                };
            }
        })), dq = ()=>({}), GR = (t)=>cy(t).length === 0, Q2e = j(2, (t, e)=>{
        const n = dq();
        for (const r of t){
            const [s, i] = e(r);
            n[s] = i;
        }
        return n;
    }), exe = j(2, (t, e)=>{
        const n = [];
        for (const r of cy(t))n.push(e(r, t[r]));
        return n;
    }), txe = exe((t, e)=>[
            t,
            e
        ]), ZR = j(2, (t, e)=>Object.prototype.hasOwnProperty.call(t, e)), nxe = j(2, (t, e)=>{
        const n = {
            ...t
        };
        for (const r of cy(t))n[r] = e(t[r], r);
        return n;
    }), cy = (t)=>Object.keys(t), rxe = j(3, (t, e, n)=>{
        if (GR(t)) return {
            ...e
        };
        if (GR(e)) return {
            ...t
        };
        const r = dq();
        for (const s of cy(t))ZR(e, s) ? r[s] = n(t[s], e[s]) : r[s] = t[s];
        for (const s of cy(e))ZR(r, s) || (r[s] = e[s]);
        return r;
    }), zv = (t)=>new Array(t), sxe = 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), ixe = (t)=>Array.isArray(t) ? t : [
            t
        ], X8 = j(2, (t, { onEmpty: e, onNonEmpty: n })=>Rr(t) ? n(t) : e()), oxe = j(2, (t, { onEmpty: e, onNonEmpty: n })=>Rr(t) ? n(vi(t), Eh(t)) : e()), W2 = j(2, (t, e)=>[
            e,
            ...t
        ]), ly = j(2, (t, e)=>[
            ...t,
            e
        ]), Uv = j(2, (t, e)=>Un(t).concat(Un(e))), axe = Array.isArray, cxe = (t)=>t.length === 0, lxe = cxe, Om = cq, Rr = cq, fq = (t, e)=>t < 0 || t >= e.length, uxe = (t, e)=>Math.floor(Math.min(Math.max(0, t), e.length)), dxe = j(2, (t, e)=>{
        const n = Math.floor(e);
        return fq(n, t) ? Ve() : Fe(t[n]);
    }), hq = j(2, (t, e)=>{
        const n = Math.floor(e);
        if (fq(n, t)) throw new Error(`Index ${n} out of bounds`);
        return t[n];
    }), Mm = dxe(0), vi = hq(0), fxe = (t)=>Rr(t) ? Fe(pq(t)) : Ve(), pq = (t)=>t[t.length - 1], Eh = (t)=>t.slice(1), hxe = (t, e)=>{
        let n = 0;
        for (const r of t){
            if (!e(r, n)) break;
            n++;
        }
        return n;
    }, pxe = j(2, (t, e)=>JE(t, hxe(t, e))), gxe = j(2, (t, e)=>{
        const n = Un(t);
        return n.slice(uxe(e, n), n.length);
    }), bxe = Z2e, JR = (t)=>Array.from(t).reverse(), K0 = j(2, (t, e)=>{
        const n = Array.from(t);
        return n.sort(e), n;
    }), YR = j(2, (t, e)=>mxe(t, e, X2e)), mxe = j(3, (t, e, n)=>{
        const r = Un(t), s = Un(e);
        if (Rr(r) && Rr(s)) {
            const i = [
                n(vi(r), vi(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 [];
    }), yxe = UE(), JE = j(2, (t, e)=>{
        const n = Array.from(t), r = Math.floor(e);
        return Rr(n) ? r >= 1 ? wxe(n, r) : [
            [],
            n
        ] : [
            n,
            []
        ];
    }), wxe = j(2, (t, e)=>{
        const n = Math.max(1, Math.floor(e));
        return n >= t.length ? [
            cm(t),
            []
        ] : [
            W2(t.slice(1, n), vi(t)),
            t.slice(n)
        ];
    }), cm = (t)=>t.slice(), _xe = j(3, (t, e, n)=>{
        const r = Un(t), s = Un(e);
        return Rr(r) ? Rr(s) ? gq(n)(Uv(r, s)) : r : s;
    }), H_ = j(2, (t, e)=>_xe(t, e, yxe)), Jl = ()=>[], Ho = (t)=>[
            t
        ], Rs = j(2, (t, e)=>t.map(e)), Dg = j(2, (t, e)=>{
        if (lxe(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;
    }), xxe = Dg(Ft), Hv = j(2, (t, e)=>{
        const n = Un(t), r = [];
        for(let s = 0; s < n.length; s++){
            const i = e(n[s], s);
            nr(i) && r.push(i.value);
        }
        return r;
    }), g1 = 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;
    }), vxe = 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
        ];
    }), Yl = j(3, (t, e, n)=>Un(t).reduce((r, s, i)=>n(r, s, i), e)), Sxe = j(2, (t, e)=>t.reduce(lq(e))), kxe = j(2, (t, e)=>t.reduce(F2e(e))), QR = (t, e)=>{
        const n = [];
        let r = t, s;
        for(; nr(s = e(r));){
            const [i, o] = s.value;
            n.push(i), r = o;
        }
        return n;
    }, b1 = F_e, gq = j(2, (t, e)=>{
        const n = Un(t);
        if (Rr(n)) {
            const r = [
                vi(n)
            ], s = Eh(n);
            for (const i of s)r.every((o)=>!e(i, o)) && r.push(i);
            return r;
        }
        return [];
    }), Txe = (t)=>gq(t, UE()), Fg = j(2, (t, e)=>Un(t).join(e)), Exe = 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
        ];
    }), bq = (t, e)=>{
        switch(e._tag){
            case "StringKeyword":
            case "TemplateLiteral":
                return Object.keys(t);
            case "SymbolKeyword":
                return Object.getOwnPropertySymbols(t);
            case "Refinement":
                return bq(t, e.from);
        }
    }, mq = (t)=>{
        let e = !1, n;
        return ()=>(e || (n = t(), e = !0), n);
    }, yq = (t)=>Array.isArray(t), Cxe = (t)=>!Array.isArray(t), eN = (t)=>`[${$j(t)}]`, Ixe = (t)=>yq(t) ? t.map(eN).join("") : eN(t), Qh = (t, e, n, r)=>{
        let s = t;
        return e !== void 0 && (s += `
details: ${e}`), r && (s += `
schema (${r._tag}): ${r}`), s;
    }, Axe = (t)=>Qh("Unsupported key schema", void 0, void 0, t), Pxe = (t)=>Qh("Unsupported literal", `literal value: ${Zd(t)}`), tN = (t)=>Qh("Duplicate index signature", `${t} index signature`), Oxe = Qh("Unsupported index signature parameter", "An index signature parameter type must be `string`, `symbol`, a template literal type or a refinement of the previous types"), Mxe = Qh("Invalid element", "A required element cannot follow an optional element. ts(1257)"), nN = (t)=>Qh("Duplicate property signature transformation", `Duplicate key ${Zd(t)}`), Rxe = (t)=>Qh("Duplicate property signature", `Duplicate key ${Zd(t)}`), Nxe = Symbol.for("effect/SchemaId/DateFromSelf"), Vxe = Symbol.for("effect/SchemaId/Between"), W0 = Lv, Bxe = (t)=>{
        const e = Math.ceil(Math.log(t) / Math.log(2));
        return Math.max(Math.pow(2, e), 2);
    }, $2 = (t)=>t.replace(/[/\\^$*+?.()|[\]{}]/g, "\\$&"), Dxe = Symbol.for("effect/annotation/TypeConstructor"), Fxe = Symbol.for("effect/annotation/Brand"), Lxe = Symbol.for("effect/annotation/SchemaId"), wq = Symbol.for("effect/annotation/Message"), YE = Symbol.for("effect/annotation/MissingMessage"), QE = Symbol.for("effect/annotation/Identifier"), Hc = Symbol.for("effect/annotation/Title"), W6 = Symbol.for("effect/annotation/AutoTitle"), Lg = Symbol.for("effect/annotation/Description"), _q = Symbol.for("effect/annotation/Examples"), xq = Symbol.for("effect/annotation/Default"), vq = Symbol.for("effect/annotation/JSONSchema"), Sq = Symbol.for("effect/annotation/Arbitrary"), kq = Symbol.for("effect/annotation/Pretty"), Tq = Symbol.for("effect/annotation/Equivalence"), zxe = Symbol.for("effect/annotation/Documentation"), Eq = Symbol.for("effect/annotation/Concurrency"), Cq = Symbol.for("effect/annotation/Batching"), Iq = Symbol.for("effect/annotation/ParseIssueTitle"), Aq = Symbol.for("effect/annotation/ParseOptions"), Pq = Symbol.for("effect/annotation/DecodingFallback"), Oq = Symbol.for("effect/annotation/Surrogate"), Uxe = Symbol.for("effect/annotation/StableFilter"), Ai = j(2, (t, e)=>Object.prototype.hasOwnProperty.call(t.annotations, e) ? Fe(t.annotations[e]) : Ve()), Hxe = Ai(Fxe), jxe = Ai(wq), qxe = Ai(YE), Mq = Ai(Hc), Rq = Ai(W6), jv = Ai(QE), Nq = Ai(Lg), Kxe = Ai(Eq), Wxe = Ai(Cq), $xe = Ai(Iq), Xxe = Ai(Aq), Gxe = Ai(Pq), Vq = Ai(Oq), Zxe = Ai(Uxe), Jxe = (t)=>$2e(Zxe(t), (e)=>e === !0), Bq = Symbol.for("effect/annotation/JSONIdentifier"), Yxe = Ai(Bq), Qxe = (t)=>dd(Yxe(t), ()=>jv(t)), eve = Symbol.for("effect/schema/ParseJson");
    class qv {
        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 xr(Rc(this), ()=>"<declaration schema>");
        }
        toJSON() {
            return {
                _tag: this._tag,
                typeParameters: this.typeParameters.map((e)=>e.toJSON()),
                annotations: fs(this.annotations)
            };
        }
    }
    const m1 = (t)=>(e)=>e._tag === t;
    let X2 = class {
        literal;
        annotations;
        _tag = "Literal";
        constructor(e, n = {}){
            this.literal = e, this.annotations = n;
        }
        toString() {
            return xr(Rc(this), ()=>Zd(this.literal));
        }
        toJSON() {
            return {
                _tag: this._tag,
                literal: Ov(this.literal) ? String(this.literal) : this.literal,
                annotations: fs(this.annotations)
            };
        }
    };
    const rN = m1("Literal"), tve = new X2(null);
    class nve {
        symbol;
        annotations;
        _tag = "UniqueSymbol";
        constructor(e, n = {}){
            this.symbol = e, this.annotations = n;
        }
        toString() {
            return xr(Rc(this), ()=>Zd(this.symbol));
        }
        toJSON() {
            return {
                _tag: this._tag,
                symbol: String(this.symbol),
                annotations: fs(this.annotations)
            };
        }
    }
    class rve {
        annotations;
        _tag = "UndefinedKeyword";
        constructor(e = {}){
            this.annotations = e;
        }
        toString() {
            return Jd(this);
        }
        toJSON() {
            return {
                _tag: this._tag,
                annotations: fs(this.annotations)
            };
        }
    }
    const $6 = new rve({
        [Hc]: "undefined"
    });
    class sve {
        annotations;
        _tag = "NeverKeyword";
        constructor(e = {}){
            this.annotations = e;
        }
        toString() {
            return Jd(this);
        }
        toJSON() {
            return {
                _tag: this._tag,
                annotations: fs(this.annotations)
            };
        }
    }
    const eC = new sve({
        [Hc]: "never"
    });
    class ive {
        annotations;
        _tag = "UnknownKeyword";
        constructor(e = {}){
            this.annotations = e;
        }
        toString() {
            return Jd(this);
        }
        toJSON() {
            return {
                _tag: this._tag,
                annotations: fs(this.annotations)
            };
        }
    }
    const Dq = new ive({
        [Hc]: "unknown"
    });
    class ove {
        annotations;
        _tag = "AnyKeyword";
        constructor(e = {}){
            this.annotations = e;
        }
        toString() {
            return Jd(this);
        }
        toJSON() {
            return {
                _tag: this._tag,
                annotations: fs(this.annotations)
            };
        }
    }
    const ave = new ove({
        [Hc]: "any"
    });
    class cve {
        annotations;
        _tag = "StringKeyword";
        constructor(e = {}){
            this.annotations = e;
        }
        toString() {
            return Jd(this);
        }
        toJSON() {
            return {
                _tag: this._tag,
                annotations: fs(this.annotations)
            };
        }
    }
    const lve = new cve({
        [Hc]: "string",
        [Lg]: "a string"
    }), uve = m1("StringKeyword");
    class dve {
        annotations;
        _tag = "NumberKeyword";
        constructor(e = {}){
            this.annotations = e;
        }
        toString() {
            return Jd(this);
        }
        toJSON() {
            return {
                _tag: this._tag,
                annotations: fs(this.annotations)
            };
        }
    }
    const fve = new dve({
        [Hc]: "number",
        [Lg]: "a number"
    });
    class hve {
        annotations;
        _tag = "BooleanKeyword";
        constructor(e = {}){
            this.annotations = e;
        }
        toString() {
            return Jd(this);
        }
        toJSON() {
            return {
                _tag: this._tag,
                annotations: fs(this.annotations)
            };
        }
    }
    const pve = new hve({
        [Hc]: "boolean",
        [Lg]: "a boolean"
    });
    class gve {
        annotations;
        _tag = "BigIntKeyword";
        constructor(e = {}){
            this.annotations = e;
        }
        toString() {
            return Jd(this);
        }
        toJSON() {
            return {
                _tag: this._tag,
                annotations: fs(this.annotations)
            };
        }
    }
    const bve = new gve({
        [Hc]: "bigint",
        [Lg]: "a bigint"
    }), mve = m1("SymbolKeyword");
    let Kv = class {
        type;
        annotations;
        constructor(e, n = {}){
            this.type = e, this.annotations = n;
        }
        toJSON() {
            return {
                type: this.type.toJSON(),
                annotations: fs(this.annotations)
            };
        }
        toString() {
            return String(this.type);
        }
    };
    class zg extends Kv {
        isOptional;
        constructor(e, n, r = {}){
            super(e, r), this.isOptional = n;
        }
        toJSON() {
            return {
                type: this.type.toJSON(),
                isOptional: this.isOptional,
                annotations: fs(this.annotations)
            };
        }
        toString() {
            return String(this.type) + (this.isOptional ? "?" : "");
        }
    }
    const Fq = (t)=>t.map((e)=>e.type);
    class tC {
        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(Mxe);
        }
        toString() {
            return xr(Rc(this), ()=>yve(this));
        }
        toJSON() {
            return {
                _tag: this._tag,
                elements: this.elements.map((e)=>e.toJSON()),
                rest: this.rest.map((e)=>e.toJSON()),
                isReadonly: this.isReadonly,
                annotations: fs(this.annotations)
            };
        }
    }
    const yve = (t)=>{
        const e = t.elements.map(String).join(", ");
        return oxe(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 Qs extends zg {
        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: fs(this.annotations)
            };
        }
    }
    const Lq = (t)=>{
        switch(t._tag){
            case "StringKeyword":
            case "SymbolKeyword":
            case "TemplateLiteral":
                return !0;
            case "Refinement":
                return Lq(t.from);
        }
        return !1;
    };
    class Wv {
        type;
        isReadonly;
        parameter;
        constructor(e, n, r){
            if (this.type = n, this.isReadonly = r, Lq(e)) this.parameter = e;
            else throw new Error(Oxe);
        }
        toString() {
            return (this.isReadonly ? "readonly " : "") + `[x: ${this.parameter}]: ${this.type}`;
        }
        toJSON() {
            return {
                parameter: this.parameter.toJSON(),
                type: this.type.toJSON(),
                isReadonly: this.isReadonly
            };
        }
    }
    class nh {
        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(Rxe(a));
                s[a] = null;
            }
            const i = {
                string: !1,
                symbol: !1
            };
            for(let o = 0; o < n.length; o++){
                const a = Wq(n[o].parameter);
                if (uve(a)) {
                    if (i.string) throw new Error(tN("string"));
                    i.string = !0;
                } else if (mve(a)) {
                    if (i.symbol) throw new Error(tN("symbol"));
                    i.symbol = !0;
                }
            }
            this.propertySignatures = e, this.indexSignatures = n;
        }
        toString() {
            return xr(Rc(this), ()=>wve(this));
        }
        toJSON() {
            return {
                _tag: this._tag,
                propertySignatures: this.propertySignatures.map((e)=>e.toJSON()),
                indexSignatures: this.indexSignatures.map((e)=>e.toJSON()),
                annotations: fs(this.annotations)
            };
        }
    }
    const sN = (t)=>t.map(String).join("; "), wve = (t)=>{
        if (t.propertySignatures.length > 0) {
            const e = t.propertySignatures.map(String).join("; ");
            return t.indexSignatures.length > 0 ? `{ ${e}; ${sN(t.indexSignatures)} }` : `{ ${e} }`;
        } else return t.indexSignatures.length > 0 ? `{ ${sN(t.indexSignatures)} }` : "{}";
    }, _ve = K0(Th(W0, (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;
    })), xve = {
        string: "StringKeyword",
        number: "NumberKeyword",
        boolean: "BooleanKeyword",
        bigint: "BigIntKeyword"
    }, zq = (t)=>Dg(t, (e)=>Uq(e) ? zq(e.types) : [
                e
            ]), vve = (t)=>{
        const e = _ve(t), n = [], r = {}, s = [];
        for (const i of e)switch(i._tag){
            case "NeverKeyword":
                break;
            case "AnyKeyword":
                return [
                    ave
                ];
            case "UnknownKeyword":
                return [
                    Dq
                ];
            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 = xve[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 bc = class X6 {
        types;
        annotations;
        static make = (e, n)=>nC(e) ? new X6(e, n) : e.length === 1 ? e[0] : eC;
        static unify = (e, n)=>X6.make(vve(zq(e)), n);
        _tag = "Union";
        constructor(e, n = {}){
            this.types = e, this.annotations = n;
        }
        toString() {
            return xr(Rc(this), ()=>this.types.map(String).join(" | "));
        }
        toJSON() {
            return {
                _tag: this._tag,
                types: this.types.map((e)=>e.toJSON()),
                annotations: fs(this.annotations)
            };
        }
    };
    const Sve = (t, e)=>t.map(e), nC = (t)=>t.length > 1, Uq = m1("Union"), G8 = qt(Symbol.for("effect/Schema/AST/toJSONMemoMap"), ()=>new WeakMap);
    class Hq {
        f;
        annotations;
        _tag = "Suspend";
        constructor(e, n = {}){
            this.f = e, this.annotations = n, this.f = mq(e);
        }
        toString() {
            return Rc(this).pipe(dd(()=>p1(uq(this.f)(), (e)=>Rc(e))), xr(()=>"<suspended schema>"));
        }
        toJSON() {
            const e = this.f();
            let n = G8.get(e);
            return n || (G8.set(e, {
                _tag: this._tag
            }), n = {
                _tag: this._tag,
                ast: e.toJSON(),
                annotations: fs(this.annotations)
            }, G8.set(e, n), n);
        }
    }
    let rC = class {
        from;
        filter;
        annotations;
        _tag = "Refinement";
        constructor(e, n, r = {}){
            this.from = e, this.filter = n, this.annotations = r;
        }
        toString() {
            return jv(this).pipe(xr(()=>un($q(this), {
                    onNone: ()=>`{ ${this.from} | filter }`,
                    onSome: (e)=>sC(this.from) ? String(this.from) + " & " + e : e
                })));
        }
        toJSON() {
            return {
                _tag: this._tag,
                from: this.from.toJSON(),
                annotations: fs(this.annotations)
            };
        }
    };
    const sC = m1("Refinement"), Z8 = {};
    let iC = 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 xr(Rc(this), ()=>`(${String(this.from)} <-> ${String(this.to)})`);
        }
        toJSON() {
            return {
                _tag: this._tag,
                from: this.from.toJSON(),
                to: this.to.toJSON(),
                annotations: fs(this.annotations)
            };
        }
    };
    class kve {
        decode;
        encode;
        _tag = "FinalTransformation";
        constructor(e, n){
            this.decode = e, this.encode = n;
        }
    }
    class Tve {
        _tag = "ComposeTransformation";
    }
    const Eve = new Tve;
    let Cve = class {
        from;
        to;
        decode;
        encode;
        constructor(e, n, r, s){
            this.from = e, this.to = n, this.decode = r, this.encode = s;
        }
    };
    class Ive {
        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(nN(i));
                n[i] = !0;
                const o = s.to;
                if (r[o]) throw new Error(nN(o));
                r[o] = !0;
            }
        }
    }
    const oC = (t, e)=>{
        const n = Object.getOwnPropertyDescriptors(t), r = {
            ...t.annotations
        };
        delete r[QE];
        const s = {
            ...r,
            ...e
        }, i = Vq(t);
        return nr(i) && (s[Oq] = oC(i.value, e)), n.annotations.value = s, Object.create(Object.getPrototypeOf(t), n);
    }, Ave = "[\\s\\S]*?", Pve = "[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?", jq = (t, e)=>{
        switch(t._tag){
            case "Literal":
                return $2(String(t.literal));
            case "StringKeyword":
                return Ave;
            case "NumberKeyword":
                return Pve;
            case "TemplateLiteral":
                return qq(t);
            case "Union":
                return t.types.map((n)=>jq(n)).join("|");
        }
    }, Ove = (t, e, n, r)=>Uq(t) ? `(${e})` : e, qq = (t, e, n)=>{
        let r = "";
        if (t.head !== "") {
            const s = $2(t.head);
            r += s;
        }
        for (const s of t.spans){
            const i = jq(s.type);
            if (r += Ove(s.type, i), s.literal !== "") {
                const o = $2(s.literal);
                r += o;
            }
        }
        return r;
    }, Mve = (t)=>new RegExp(`^${qq(t)}$`), iN = (t, e)=>{
        const n = [], r = [], s = (i)=>{
            switch(i._tag){
                case "NeverKeyword":
                    break;
                case "StringKeyword":
                case "SymbolKeyword":
                case "TemplateLiteral":
                case "Refinement":
                    r.push(new Wv(i, e, !0));
                    break;
                case "Literal":
                    if (ko(i.literal) || kh(i.literal)) n.push(new Qs(i.literal, e, !1, !0));
                    else throw new Error(Pxe(i.literal));
                    break;
                case "Enums":
                    {
                        for (const [o, a] of i.enums)n.push(new Qs(a, e, !1, !0));
                        break;
                    }
                case "UniqueSymbol":
                    n.push(new Qs(i.symbol, e, !1, !0));
                    break;
                case "Union":
                    i.types.forEach(s);
                    break;
                default:
                    throw new Error(Axe(i));
            }
        };
        return s(t), {
            propertySignatures: n,
            indexSignatures: r
        };
    }, Kq = (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;
        }, Rve = Kq([
        _q,
        xq,
        vq,
        Sq,
        kq,
        Tq
    ]), ys = (t)=>{
        switch(t._tag){
            case "Declaration":
                {
                    const e = qo(t.typeParameters, ys);
                    return e === t.typeParameters ? t : new qv(e, t.decodeUnknown, t.encodeUnknown, t.annotations);
                }
            case "TupleType":
                {
                    const e = qo(t.elements, (s)=>{
                        const i = ys(s.type);
                        return i === s.type ? s : new zg(i, s.isOptional);
                    }), n = Fq(t.rest), r = qo(n, ys);
                    return e === t.elements && r === n ? t : new tC(e, r.map((s)=>new Kv(s)), t.isReadonly, t.annotations);
                }
            case "TypeLiteral":
                {
                    const e = qo(t.propertySignatures, (r)=>{
                        const s = ys(r.type);
                        return s === r.type ? r : new Qs(r.name, s, r.isOptional, r.isReadonly);
                    }), n = qo(t.indexSignatures, (r)=>{
                        const s = ys(r.type);
                        return s === r.type ? r : new Wv(r.parameter, s, r.isReadonly);
                    });
                    return e === t.propertySignatures && n === t.indexSignatures ? t : new nh(e, n, t.annotations);
                }
            case "Union":
                {
                    const e = qo(t.types, ys);
                    return e === t.types ? t : bc.make(e, t.annotations);
                }
            case "Suspend":
                return new Hq(()=>ys(t.f()), t.annotations);
            case "Refinement":
                {
                    const e = ys(t.from);
                    return e === t.from ? t : new rC(e, t.filter, t.annotations);
                }
            case "Transformation":
                {
                    const e = Rve(t);
                    return ys(e !== void 0 ? oC(t.to, e) : t.to);
                }
        }
        return t;
    };
    function qo(t, e) {
        let n = !1;
        const r = zv(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 dc = (t, e)=>{
        switch(t._tag){
            case "Declaration":
                {
                    const n = qo(t.typeParameters, (r)=>dc(r));
                    return n === t.typeParameters ? t : new qv(n, t.decodeUnknown, t.encodeUnknown);
                }
            case "TupleType":
                {
                    const n = qo(t.elements, (i)=>{
                        const o = dc(i.type);
                        return o === i.type ? i : new zg(o, i.isOptional);
                    }), r = Fq(t.rest), s = qo(r, (i)=>dc(i));
                    return n === t.elements && s === r ? t : new tC(n, s.map((i)=>new Kv(i)), t.isReadonly);
                }
            case "TypeLiteral":
                {
                    const n = qo(t.propertySignatures, (s)=>{
                        const i = dc(s.type);
                        return i === s.type ? s : new Qs(s.name, i, s.isOptional, s.isReadonly);
                    }), r = qo(t.indexSignatures, (s)=>{
                        const i = dc(s.type);
                        return i === s.type ? s : new Wv(s.parameter, i, s.isReadonly);
                    });
                    return n === t.propertySignatures && r === t.indexSignatures ? t : new nh(n, r);
                }
            case "Union":
                {
                    const n = qo(t.types, (r)=>dc(r));
                    return n === t.types ? t : bc.make(n);
                }
            case "Suspend":
                {
                    let n;
                    const r = Qxe(t);
                    return nr(r) && (n = {
                        [Bq]: `${r.value}Encoded`
                    }), new Hq(()=>dc(t.f()), n);
                }
            case "Refinement":
                return dc(t.from);
            case "Transformation":
                return dc(t.from);
        }
        return t;
    }, oN = (t)=>dc(t), fs = (t)=>{
        const e = {};
        for (const n of Object.getOwnPropertySymbols(t))e[String(n)] = t[n];
        return e;
    }, Wq = (t)=>{
        switch(t._tag){
            case "StringKeyword":
            case "SymbolKeyword":
            case "TemplateLiteral":
                return t;
            case "Refinement":
                return Wq(t.from);
        }
    }, Nve = (t, e)=>new iC(t, e, Eve), Jd = (t)=>xr(Rc(t), ()=>t._tag);
    function Vve(t) {
        return un(Hxe(t), {
            onNone: ()=>"",
            onSome: (e)=>e.map((n)=>` & Brand<${Zd(n)}>`).join("")
        });
    }
    const $q = (t)=>Mq(t).pipe(dd(()=>Nq(t)), dd(()=>Rq(t)), Tc((e)=>e + Vve(t))), Rc = (t)=>dd(jv(t), ()=>$q(t)), Bve = BigInt(0), aN = (t)=>{
        let e = Bve;
        for (const n of t)e += n;
        return e;
    }, Dve = (t)=>{
        try {
            return t.trim() === "" ? Ve() : Fe(BigInt(t));
        } catch  {
            return Ve();
        }
    }, G2 = Symbol.for("effect/Brand/Refined"), Xq = (t, e)=>[
            {
                message: t,
                meta: e
            }
        ];
    function Gq(...t) {
        const e = t.length === 2 ? (n)=>t[0](n) ? lt(n) : Qe(t[1](n)) : (n)=>un(t[0](n), {
                onNone: ()=>lt(n),
                onSome: Qe
            });
        return Object.assign((n)=>ZE(e(n), Ft), {
            [G2]: G2,
            option: (n)=>L2e(e(n)),
            either: e,
            is: (n)=>Ia(e(n))
        });
    }
    const $v = ()=>Object.assign((t)=>t, {
            [G2]: G2,
            option: (t)=>Fe(t),
            either: (t)=>lt(t),
            is: (t)=>!0
        }), Zq = Symbol.for("effect/Context/Tag"), Z2 = Symbol.for("effect/Context/Reference"), Fve = "effect/STM", Lve = Symbol.for(Fve), aC = {
        ...d1,
        _op: "Tag",
        [Lve]: q0,
        [Zq]: {
            _Service: (t)=>t,
            _Identifier: (t)=>t
        },
        toString () {
            return vr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "Tag",
                key: this.key,
                stack: this.stack
            };
        },
        [Rn] () {
            return this.toJSON();
        },
        of (t) {
            return t;
        },
        context (t) {
            return Qq(this, t);
        }
    }, zve = {
        ...aC,
        [Z2]: Z2
    }, Uve = (t)=>{
        const e = Error.stackTraceLimit;
        Error.stackTraceLimit = 2;
        const n = new Error;
        Error.stackTraceLimit = e;
        const r = Object.create(aC);
        return Object.defineProperty(r, "stack", {
            get () {
                return n.stack;
            }
        }), r.key = t, r;
    }, Hve = (t)=>()=>{
            const e = Error.stackTraceLimit;
            Error.stackTraceLimit = 2;
            const n = new Error;
            Error.stackTraceLimit = e;
            function r() {}
            return Object.setPrototypeOf(r, aC), r.key = t, Object.defineProperty(r, "stack", {
                get () {
                    return n.stack;
                }
            }), r;
        }, jve = ()=>(t, e)=>{
            const n = Error.stackTraceLimit;
            Error.stackTraceLimit = 2;
            const r = new Error;
            Error.stackTraceLimit = n;
            function s() {}
            return Object.setPrototypeOf(s, zve), s.key = t, s.defaultValue = e.defaultValue, Object.defineProperty(s, "stack", {
                get () {
                    return r.stack;
                }
            }), s;
        }, Jq = Symbol.for("effect/Context"), qve = {
        [Jq]: {
            _Services: (t)=>t
        },
        [jt] (t) {
            if (Yq(t) && this.unsafeMap.size === t.unsafeMap.size) {
                for (const e of this.unsafeMap.keys())if (!t.unsafeMap.has(e) || !Lt(this.unsafeMap.get(e), t.unsafeMap.get(e))) return !1;
                return !0;
            }
            return !1;
        },
        [Zt] () {
            return Jn(this, u1(this.unsafeMap.size));
        },
        pipe () {
            return xt(this, arguments);
        },
        toString () {
            return vr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "Context",
                services: Array.from(this.unsafeMap).map(wr)
            };
        },
        [Rn] () {
            return this.toJSON();
        }
    }, Ch = (t)=>{
        const e = Object.create(qve);
        return e.unsafeMap = t, e;
    }, Kve = (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;
    }, Yq = (t)=>Vt(t, Jq), Wve = (t)=>Vt(t, Zq), $ve = (t)=>Vt(t, Z2), Xve = Ch(new Map), Gve = ()=>Xve, Qq = (t, e)=>Ch(new Map([
            [
                t.key,
                e
            ]
        ])), Zve = j(3, (t, e, n)=>{
        const r = new Map(t.unsafeMap);
        return r.set(e.key, n), Ch(r);
    }), J8 = qt("effect/Context/defaultValueCache", ()=>new Map), cC = (t)=>{
        if (J8.has(t.key)) return J8.get(t.key);
        const e = t.defaultValue();
        return J8.set(t.key, e), e;
    }, Jve = (t, e)=>t.unsafeMap.has(e.key) ? t.unsafeMap.get(e.key) : cC(e), eK = j(2, (t, e)=>{
        if (!t.unsafeMap.has(e.key)) {
            if (Z2 in e) return cC(e);
            throw Kve(e);
        }
        return t.unsafeMap.get(e.key);
    }), Yve = eK, Qve = j(2, (t, e)=>t.unsafeMap.has(e.key) ? q2(t.unsafeMap.get(e.key)) : $ve(e) ? q2(cC(e)) : WE), e3e = j(2, (t, e)=>{
        const n = new Map(t.unsafeMap);
        for (const [r, s] of e.unsafeMap)n.set(r, s);
        return Ch(n);
    }), t3e = (...t)=>{
        const e = new Map;
        for(let n = 0; n < t.length; n++)t[n].unsafeMap.forEach((r, s)=>{
            e.set(s, r);
        });
        return Ch(e);
    }, jc = Uve, n3e = Yq, tK = Wve, uy = Gve, lC = Qq, wc = Zve, Ec = Yve, nK = eK, ep = Qve, Ug = e3e, r3e = t3e, Xv = Hve, Hg = jve, rK = Symbol.for("effect/Chunk");
    function s3e(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 sK = [], i3e = (t)=>H0((e, n)=>e.length === n.length && wo(e).every((r, s)=>t(r, Ra(n, s)))), o3e = i3e(Lt), a3e = {
        [rK]: {
            _A: (t)=>t
        },
        toString () {
            return vr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "Chunk",
                values: wo(this).map(wr)
            };
        },
        [Rn] () {
            return this.toJSON();
        },
        [jt] (t) {
            return uC(t) && o3e(this, t);
        },
        [Zt] () {
            return Jn(this, Ng(wo(this)));
        },
        [Symbol.iterator] () {
            switch(this.backing._tag){
                case "IArray":
                    return this.backing.array[Symbol.iterator]();
                case "IEmpty":
                    return sK[Symbol.iterator]();
                default:
                    return wo(this)[Symbol.iterator]();
            }
        },
        pipe () {
            return xt(this, arguments);
        }
    }, Dr = (t)=>{
        const e = Object.create(a3e);
        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 = Ko, e.right = Ko;
                    break;
                }
            case "ISingleton":
                {
                    e.length = 1, e.depth = 0, e.left = Ko, e.right = Ko;
                    break;
                }
            case "ISlice":
                {
                    e.length = t.length, e.depth = t.chunk.depth + 1, e.left = Ko, e.right = Ko;
                    break;
                }
        }
        return e;
    }, uC = (t)=>Vt(t, rK), Ko = Dr({
        _tag: "IEmpty"
    }), Cn = ()=>Ko, Rm = (...t)=>f3e(t), Pn = (t)=>Dr({
            _tag: "ISingleton",
            a: t
        }), To = (t)=>uC(t) ? t : Zi(Un(t)), G6 = (t, e, n)=>{
        switch(t.backing._tag){
            case "IArray":
                {
                    s3e(t.backing.array, 0, e, n, t.length);
                    break;
                }
            case "IConcat":
                {
                    G6(t.left, e, n), G6(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] = Ra(t, r), r += 1, s += 1;
                    break;
                }
        }
    }, c3e = (t)=>wo(t).slice(), dC = c3e, l3e = (t)=>{
        switch(t.backing._tag){
            case "IEmpty":
                return sK;
            case "IArray":
                return t.backing.array;
            default:
                {
                    const e = new Array(t.length);
                    return G6(t, e, 0), t.backing = {
                        _tag: "IArray",
                        array: e
                    }, t.left = Ko, t.right = Ko, t.depth = 0, e;
                }
        }
    }, wo = l3e, u3e = (t)=>{
        switch(t.backing._tag){
            case "IEmpty":
            case "ISingleton":
                return t;
            case "IArray":
                return Dr({
                    _tag: "IArray",
                    array: JR(t.backing.array)
                });
            case "IConcat":
                return Dr({
                    _tag: "IConcat",
                    left: Ql(t.backing.right),
                    right: Ql(t.backing.left)
                });
            case "ISlice":
                return Zi(JR(wo(t)));
        }
    }, Ql = u3e, d3e = j(2, (t, e)=>e < 0 || e >= t.length ? Ve() : Fe(Ra(t, e))), Zi = (t)=>t.length === 0 ? Cn() : t.length === 1 ? Pn(t[0]) : Dr({
            _tag: "IArray",
            array: t
        }), f3e = (t)=>Zi(t), Ra = 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 ? Ra(t.left, e) : Ra(t.right, e - t.left.length);
            case "ISlice":
                return Ra(t.backing.chunk, e + t.backing.offset);
        }
    }), dy = j(2, (t, e)=>_r(t, Pn(e))), Vs = j(2, (t, e)=>_r(Pn(e), t)), Z6 = j(2, (t, e)=>{
        if (e <= 0) return Ko;
        if (e >= t.length) return t;
        switch(t.backing._tag){
            case "ISlice":
                return Dr({
                    _tag: "ISlice",
                    chunk: t.backing.chunk,
                    length: e,
                    offset: t.backing.offset
                });
            case "IConcat":
                return e > t.left.length ? Dr({
                    _tag: "IConcat",
                    left: t.left,
                    right: Z6(t.right, e - t.left.length)
                }) : Z6(t.left, e);
            default:
                return Dr({
                    _tag: "ISlice",
                    chunk: t,
                    offset: 0,
                    length: e
                });
        }
    }), Cd = j(2, (t, e)=>{
        if (e <= 0) return t;
        if (e >= t.length) return Ko;
        switch(t.backing._tag){
            case "ISlice":
                return Dr({
                    _tag: "ISlice",
                    chunk: t.backing.chunk,
                    offset: t.backing.offset + e,
                    length: t.backing.length - e
                });
            case "IConcat":
                return e > t.left.length ? Cd(t.right, e - t.left.length) : Dr({
                    _tag: "IConcat",
                    left: Cd(t.left, e),
                    right: t.right
                });
            default:
                return Dr({
                    _tag: "ISlice",
                    chunk: t,
                    offset: e,
                    length: t.length - e
                });
        }
    }), _r = 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 Dr({
            _tag: "IConcat",
            left: t,
            right: e
        });
        if (n < -1) if (t.left.depth >= t.right.depth) {
            const r = _r(t.right, e);
            return Dr({
                _tag: "IConcat",
                left: t.left,
                right: r
            });
        } else {
            const r = _r(t.right.right, e);
            if (r.depth === t.depth - 3) {
                const s = Dr({
                    _tag: "IConcat",
                    left: t.right.left,
                    right: r
                });
                return Dr({
                    _tag: "IConcat",
                    left: t.left,
                    right: s
                });
            } else {
                const s = Dr({
                    _tag: "IConcat",
                    left: t.left,
                    right: t.right.left
                });
                return Dr({
                    _tag: "IConcat",
                    left: s,
                    right: r
                });
            }
        }
        else if (e.right.depth >= e.left.depth) {
            const r = _r(t, e.left);
            return Dr({
                _tag: "IConcat",
                left: r,
                right: e.right
            });
        } else {
            const r = _r(t, e.left.left);
            if (r.depth === e.depth - 3) {
                const s = Dr({
                    _tag: "IConcat",
                    left: r,
                    right: e.left.right
                });
                return Dr({
                    _tag: "IConcat",
                    left: s,
                    right: e.right
                });
            } else {
                const s = Dr({
                    _tag: "IConcat",
                    left: e.left.right,
                    right: e.right
                });
                return Dr({
                    _tag: "IConcat",
                    left: r,
                    right: s
                });
            }
        }
    }), iK = j(2, (t, e)=>Zi(Hv(t, e))), y1 = j(2, (t, e)=>Zi(g1(t, e))), oK = j(2, (t, e)=>{
        if (t.backing._tag === "ISingleton") return e(t.backing.a, 0);
        let n = Ko, r = 0;
        for (const s of t)n = _r(n, e(s, r++));
        return n;
    }), h3e = j(2, (t, e)=>wo(t).forEach(e)), p3e = oK(Ft), jg = (t)=>t.length === 0, oa = (t)=>t.length > 0, Gv = d3e(0), fC = (t)=>Ra(t, 0), vc = fC, aK = j(2, (t, e)=>t.backing._tag === "ISingleton" ? Pn(e(t.backing.a, 0)) : Zi(V(wo(t), Rs((n, r)=>e(n, r))))), g3e = j(3, (t, e, n)=>{
        const [r, s] = Exe(t, e, n);
        return [
            r,
            Zi(s)
        ];
    }), cK = j(2, (t, e)=>[
            Z6(t, e),
            Cd(t, e)
        ]), b3e = j(2, (t, e)=>{
        let n = 0;
        for (const r of wo(t)){
            if (e(r)) break;
            n++;
        }
        return cK(t, n);
    }), Il = (t)=>Cd(t, 1), m3e = bxe, y3e = Yl, J6 = Symbol.for("effect/Duration"), lK = BigInt(0), cN = BigInt(24), Gw = BigInt(60), Y6 = BigInt(1e3), lN = BigInt(1e6), uN = BigInt(1e9), w3e = /^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/, Ei = (t)=>{
        if (uK(t)) return t;
        if (kh(t)) return as(t);
        if (Ov(t)) return Y8(t);
        if (Array.isArray(t) && t.length === 2 && t.every(kh)) return t[0] === -1 / 0 || t[1] === -1 / 0 || Number.isNaN(t[0]) || Number.isNaN(t[1]) ? Ih : t[0] === 1 / 0 || t[1] === 1 / 0 ? dK : Y8(BigInt(Math.round(t[0] * 1e9)) + BigInt(Math.round(t[1])));
        if (ko(t)) {
            const e = w3e.exec(t);
            if (e) {
                const [n, r, s] = e, i = Number(r);
                switch(s){
                    case "nano":
                    case "nanos":
                        return Y8(BigInt(r));
                    case "micro":
                    case "micros":
                        return k3e(BigInt(r));
                    case "milli":
                    case "millis":
                        return as(i);
                    case "second":
                    case "seconds":
                        return hu(i);
                    case "minute":
                    case "minutes":
                        return w1(i);
                    case "hour":
                    case "hours":
                        return T3e(i);
                    case "day":
                    case "days":
                        return E3e(i);
                    case "week":
                    case "weeks":
                        return C3e(i);
                }
            }
        }
        throw new Error("Invalid DurationInput");
    }, dN = {
        _tag: "Millis",
        millis: 0
    }, _3e = {
        _tag: "Infinity"
    }, x3e = {
        [J6]: J6,
        [Zt] () {
            return Jn(this, Kj(this.value));
        },
        [jt] (t) {
            return uK(t) && N3e(this, t);
        },
        toString () {
            return `Duration(${pK(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: A3e(this)
                    };
                case "Infinity":
                    return {
                        _id: "Duration",
                        _tag: "Infinity"
                    };
            }
        },
        [Rn] () {
            return this.toJSON();
        },
        pipe () {
            return xt(this, arguments);
        }
    }, Ji = (t)=>{
        const e = Object.create(x3e);
        return kh(t) ? isNaN(t) || t <= 0 ? e.value = dN : Number.isFinite(t) ? Number.isInteger(t) ? e.value = {
            _tag: "Millis",
            millis: t
        } : e.value = {
            _tag: "Nanos",
            nanos: BigInt(Math.round(t * 1e6))
        } : e.value = _3e : t <= lK ? e.value = dN : e.value = {
            _tag: "Nanos",
            nanos: t
        }, e;
    }, uK = (t)=>Vt(t, J6), v3e = (t)=>t.value._tag !== "Infinity", S3e = (t)=>{
        switch(t.value._tag){
            case "Millis":
                return t.value.millis === 0;
            case "Nanos":
                return t.value.nanos === lK;
            case "Infinity":
                return !1;
        }
    }, Ih = Ji(0), dK = Ji(1 / 0), Y8 = (t)=>Ji(t), k3e = (t)=>Ji(t * Y6), as = (t)=>Ji(t), hu = (t)=>Ji(t * 1e3), w1 = (t)=>Ji(t * 6e4), T3e = (t)=>Ji(t * 36e5), E3e = (t)=>Ji(t * 864e5), C3e = (t)=>Ji(t * 6048e5), Si = (t)=>fK(t, {
            onMillis: (e)=>e,
            onNanos: (e)=>Number(e) / 1e6
        }), I3e = (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));
        }
    }, A3e = (t)=>{
        const e = Ei(t);
        switch(e.value._tag){
            case "Infinity":
                return [
                    1 / 0,
                    0
                ];
            case "Nanos":
                return [
                    Number(e.value.nanos / uN),
                    Number(e.value.nanos % uN)
                ];
            case "Millis":
                return [
                    Math.floor(e.value.millis / 1e3),
                    Math.round(e.value.millis % 1e3 * 1e6)
                ];
        }
    }, fK = 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);
        }
    }), Zv = j(3, (t, e, n)=>{
        const r = Ei(t), s = Ei(e);
        if (r.value._tag === "Infinity" || s.value._tag === "Infinity") return n.onMillis(Si(r), Si(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);
    }), P3e = (t, e)=>Zv(t, e, {
            onMillis: (n, r)=>n === r,
            onNanos: (n, r)=>n === r
        }), O3e = j(2, (t, e)=>fK(t, {
            onMillis: (n)=>Ji(n * e),
            onNanos: (n)=>Ji(n * BigInt(e))
        })), M3e = j(2, (t, e)=>Zv(t, e, {
            onMillis: (n, r)=>Ji(n + r),
            onNanos: (n, r)=>Ji(n + r)
        })), R3e = j(2, (t, e)=>Zv(t, e, {
            onMillis: (n, r)=>n <= r,
            onNanos: (n, r)=>n <= r
        })), hK = j(2, (t, e)=>Zv(t, e, {
            onMillis: (n, r)=>n >= r,
            onNanos: (n, r)=>n >= r
        })), N3e = j(2, (t, e)=>P3e(Ei(t), Ei(e))), V3e = (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 = I3e(e), r = n / lN, s = r / Y6, i = s / Gw, o = i / Gw, a = o / cN;
        return {
            days: Number(a),
            hours: Number(o % cN),
            minutes: Number(i % Gw),
            seconds: Number(s % Gw),
            millis: Number(r % Y6),
            nanos: Number(n % lN)
        };
    }, pK = (t)=>{
        const e = Ei(t);
        if (e.value._tag === "Infinity") return "Infinity";
        if (S3e(e)) return "0";
        const n = V3e(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(" ");
    }, Ah = 5, hC = Math.pow(2, Ah), B3e = hC - 1, D3e = hC / 2, F3e = hC / 4;
    function L3e(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 $0(t, e) {
        return e >>> t & B3e;
    }
    function Zp(t) {
        return 1 << t;
    }
    function gK(t, e) {
        return L3e(t & e - 1);
    }
    const z3e = (t, e)=>({
            value: t,
            previous: e
        });
    function s0(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 bK(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 U3e(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 Id {
        _tag = "EmptyNode";
        modify(e, n, r, s, i, o) {
            const a = r(Ve());
            return Zr(a) ? new Id : (++o.value, new rh(e, s, i, a));
        }
    }
    function Aa(t) {
        return FE(t, "EmptyNode");
    }
    function H3e(t) {
        return Aa(t) || t._tag === "LeafNode" || t._tag === "CollisionNode";
    }
    function Jv(t, e) {
        return Aa(t) ? !1 : e === t.edit;
    }
    class rh {
        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 (Lt(i, this.key)) {
                const c = r(this.value);
                return c === this.value ? this : Zr(c) ? (--o.value, new Id) : Jv(this, e) ? (this.value = c, this) : new rh(e, s, i, c);
            }
            const a = r(Ve());
            return Zr(a) ? this : (++o.value, mK(e, n, this.hash, this, s, new rh(e, s, i, a)));
        }
    }
    class pC {
        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 = Jv(this, e), l = this.updateCollisionList(c, e, this.hash, this.children, r, i, o);
                return l === this.children ? this : l.length > 1 ? new pC(e, this.hash, l) : l[0];
            }
            const a = r(Ve());
            return Zr(a) ? this : (++o.value, mK(e, n, this.hash, this, s, new rh(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 && Lt(o, d.key)) {
                    const f = d.value, p = i(f);
                    return p === f ? s : Zr(p) ? (--a.value, bK(e, u, s)) : s0(e, u, new rh(n, r, o, p), s);
                }
            }
            const l = i(Ve());
            return Zr(l) ? s : (++a.value, s0(e, c, new rh(n, r, o, l), s));
        }
    }
    class X0 {
        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 = $0(n, s), u = Zp(l), d = gK(a, u), f = a & u, p = Jv(this, e);
            if (!f) {
                const v = new Id().modify(e, n + Ah, r, s, i, o);
                return v ? c.length >= D3e ? q3e(e, l, v, a, c) : new X0(e, a | u, U3e(p, d, v, c)) : this;
            }
            const h = c[d], b = h.modify(e, n + Ah, r, s, i, o);
            if (h === b) return this;
            let y = a, _;
            if (Aa(b)) {
                if (y &= ~u, !y) return new Id;
                if (c.length <= 2 && H3e(c[d ^ 1])) return c[d ^ 1];
                _ = bK(p, d, c);
            } else _ = s0(p, d, b, c);
            return p ? (this.mask = y, this.children = _, this) : new X0(e, y, _);
        }
    }
    class gC {
        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 = $0(n, s), u = c[l], d = (u || new Id).modify(e, n + Ah, r, s, i, o);
            if (u === d) return this;
            const f = Jv(this, e);
            let p;
            if (Aa(u) && !Aa(d)) ++a, p = s0(f, l, d, c);
            else if (!Aa(u) && Aa(d)) {
                if (--a, a <= F3e) return j3e(e, a, l, c);
                p = s0(f, l, new Id, c);
            } else p = s0(f, l, d, c);
            return f ? (this.size = a, this.children = p, this) : new gC(e, a, p);
        }
    }
    function j3e(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 && !Aa(l) && (s[i++] = l, o |= 1 << a);
        }
        return new X0(t, o, s);
    }
    function q3e(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 gC(t, a + 1, i);
    }
    function K3e(t, e, n, r, s, i) {
        if (n === s) return new pC(t, n, [
            i,
            r
        ]);
        const o = $0(e, n), a = $0(e, s);
        if (o === a) return (c)=>new X0(t, Zp(o) | Zp(a), [
                c
            ]);
        {
            const c = o < a ? [
                r,
                i
            ] : [
                i,
                r
            ];
            return new X0(t, Zp(o) | Zp(a), c);
        }
    }
    function mK(t, e, n, r, s, i) {
        let o, a = e;
        for(;;){
            const c = K3e(t, a, n, r, s, i);
            if (typeof c == "function") o = z3e(c, o), a = a + Ah;
            else {
                let l = c;
                for(; o != null;)l = o.value(l), o = o.previous;
                return l;
            }
        }
    }
    const yK = "effect/HashMap", Q6 = Symbol.for(yK), W3e = {
        [Q6]: Q6,
        [Symbol.iterator] () {
            return new _1(this, (t, e)=>[
                    t,
                    e
                ]);
        },
        [Zt] () {
            let t = St(yK);
            for (const e of this)t ^= V(St(e[0]), bn(St(e[1])));
            return Jn(this, t);
        },
        [jt] (t) {
            if (G3e(t)) {
                if (t._size !== this._size) return !1;
                for (const e of this){
                    const n = V(t, mC(e[0], St(e[0])));
                    if (Zr(n)) return !1;
                    if (!Lt(e[1], n.value)) return !1;
                }
                return !0;
            }
            return !1;
        },
        toString () {
            return vr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "HashMap",
                values: Array.from(this).map(wr)
            };
        },
        [Rn] () {
            return this.toJSON();
        },
        pipe () {
            return xt(this, arguments);
        }
    }, bC = (t, e, n, r)=>{
        const s = Object.create(W3e);
        return s._editable = t, s._edit = e, s._root = n, s._size = r, s;
    };
    class _1 {
        map;
        f;
        v;
        constructor(e, n){
            this.map = e, this.f = n, this.v = wK(this.map._root, this.f, void 0);
        }
        next() {
            if (Zr(this.v)) return {
                done: !0,
                value: void 0
            };
            const e = this.v.value;
            return this.v = J2(e.cont), {
                done: !1,
                value: e.value
            };
        }
        [Symbol.iterator]() {
            return new _1(this.map, this.f);
        }
    }
    const J2 = (t)=>t ? _K(t[0], t[1], t[2], t[3], t[4]) : Ve(), wK = (t, e, n = void 0)=>{
        switch(t._tag){
            case "LeafNode":
                return nr(t.value) ? Fe({
                    value: e(t.key, t.value.value),
                    cont: n
                }) : J2(n);
            case "CollisionNode":
            case "ArrayNode":
            case "IndexedNode":
                {
                    const r = t.children;
                    return _K(r.length, r, 0, e, n);
                }
            default:
                return J2(n);
        }
    }, _K = (t, e, n, r, s)=>{
        for(; n < t;){
            const i = e[n++];
            if (i && !Aa(i)) return wK(i, r, [
                t,
                e,
                n,
                r,
                s
            ]);
        }
        return J2(s);
    }, $3e = bC(!1, 0, new Id, 0), Yv = ()=>$3e, X3e = (t)=>{
        const e = Qv(Yv());
        for (const n of t)G0(e, n[0], n[1]);
        return yC(e);
    }, G3e = (t)=>Vt(t, Q6), Z3e = (t)=>t && Aa(t._root), J3e = j(2, (t, e)=>mC(t, e, St(e))), mC = j(3, (t, e, n)=>{
        let r = t._root, s = 0;
        for(;;)switch(r._tag){
            case "LeafNode":
                return Lt(e, r.key) ? r.value : Ve();
            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 && Lt(e, c.key)) return c.value;
                        }
                    }
                    return Ve();
                }
            case "IndexedNode":
                {
                    const i = $0(s, n), o = Zp(i);
                    if (r.mask & o) {
                        r = r.children[gK(r.mask, o)], s += Ah;
                        break;
                    }
                    return Ve();
                }
            case "ArrayNode":
                {
                    if (r = r.children[$0(s, n)], r) {
                        s += Ah;
                        break;
                    }
                    return Ve();
                }
            default:
                return Ve();
        }
    }), xK = j(2, (t, e)=>nr(mC(t, e, St(e)))), G0 = j(3, (t, e, n)=>wC(t, e, ()=>Fe(n))), Y3e = j(3, (t, e, n)=>t._editable ? (t._root = e, t._size = n, t) : e === t._root ? t : bC(t._editable, t._edit, e, n)), vK = (t)=>new _1(t, (e)=>e), Q3e = (t)=>new _1(t, (e, n)=>n), ek = (t)=>t._size, Qv = (t)=>bC(!0, t._edit + 1, t._root, t._size), yC = (t)=>(t._editable = !1, t), e5e = j(2, (t, e)=>{
        const n = Qv(t);
        return e(n), yC(n);
    }), wC = j(3, (t, e, n)=>t5e(t, e, St(e), n)), t5e = 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, Y3e(i, s.value));
    }), n5e = j(2, (t, e)=>{
        const n = Qv(t);
        return _C(e, (r, s)=>G0(n, s, r)), yC(n);
    }), Y2 = j(2, (t, e)=>wC(t, e, Ve)), r5e = j(2, (t, e)=>e5e(t, (n)=>{
            for (const r of e)Y2(r)(n);
        })), s5e = j(2, (t, e)=>e3(t, Yv(), (n, r, s)=>G0(n, s, e(r, s)))), _C = j(2, (t, e)=>e3(t, void 0, (n, r, s)=>e(r, s))), e3 = j(3, (t, e, n)=>{
        const r = t._root;
        if (r._tag === "LeafNode") return nr(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 && !Aa(c) && (c._tag === "LeafNode" ? nr(c.value) && (e = n(e, c.value.value, c.key)) : s.push(c.children));
        }
        return e;
    }), SK = "effect/HashSet", tk = Symbol.for(SK), i5e = {
        [tk]: tk,
        [Symbol.iterator] () {
            return vK(this._keyMap);
        },
        [Zt] () {
            return Jn(this, bn(St(this._keyMap))(St(SK)));
        },
        [jt] (t) {
            return o5e(t) ? ek(this._keyMap) === ek(t._keyMap) && Lt(this._keyMap, t._keyMap) : !1;
        },
        toString () {
            return vr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "HashSet",
                values: Array.from(this).map(wr)
            };
        },
        [Rn] () {
            return this.toJSON();
        },
        pipe () {
            return xt(this, arguments);
        }
    }, t3 = (t)=>{
        const e = Object.create(i5e);
        return e._keyMap = t, e;
    }, o5e = (t)=>Vt(t, tk), a5e = t3(Yv()), x1 = ()=>a5e, c5e = (t)=>{
        const e = vC(x1());
        for (const n of t)Z0(e, n);
        return SC(e);
    }, l5e = (...t)=>{
        const e = vC(x1());
        for (const n of t)Z0(e, n);
        return SC(e);
    }, xC = j(2, (t, e)=>xK(t._keyMap, e)), u5e = j(2, (t, e)=>{
        let n = !1;
        for (const r of t)if (n = e(r), n) break;
        return n;
    }), d5e = j(2, (t, e)=>!u5e(t, (n)=>!e(n))), f5e = j(2, (t, e)=>d5e(t, (n)=>xC(e, n))), h5e = (t)=>ek(t._keyMap), vC = (t)=>t3(Qv(t._keyMap)), SC = (t)=>(t._keyMap._editable = !1, t), kC = j(2, (t, e)=>{
        const n = vC(t);
        return e(n), SC(n);
    }), Z0 = j(2, (t, e)=>t._keyMap._editable ? (G0(e, !0)(t._keyMap), t) : t3(G0(e, !0)(t._keyMap))), kK = j(2, (t, e)=>t._keyMap._editable ? (Y2(e)(t._keyMap), t) : t3(Y2(e)(t._keyMap))), p5e = j(2, (t, e)=>kC(t, (n)=>{
            for (const r of e)kK(n, r);
        })), g5e = j(2, (t, e)=>kC(x1(), (n)=>{
            for (const r of e)xC(r)(t) && Z0(r)(n);
        })), b5e = j(2, (t, e)=>kC(x1(), (n)=>{
            m5e(t, (r)=>Z0(n, r));
            for (const r of e)Z0(n, r);
        })), m5e = j(2, (t, e)=>_C(t._keyMap, (n, r)=>e(r))), y5e = j(3, (t, e, n)=>e3(t._keyMap, e, (r, s, i)=>n(r, i))), Ph = x1, lm = c5e, TC = l5e, w5e = xC, _5e = f5e, i0 = h5e, Nm = Z0, TK = kK, fN = p5e, x5e = g5e, fy = b5e, hy = y5e, hN = Symbol.for("effect/MutableRef"), v5e = {
        [hN]: hN,
        toString () {
            return vr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "MutableRef",
                current: wr(this.current)
            };
        },
        [Rn] () {
            return this.toJSON();
        },
        pipe () {
            return xt(this, arguments);
        }
    }, tp = (t)=>{
        const e = Object.create(v5e);
        return e.current = t, e;
    }, S5e = j(3, (t, e, n)=>Lt(e, t.current) ? (t.current = n, !0) : !1), Tn = (t)=>t.current, np = j(2, (t, e)=>(t.current = e, t)), n3 = "effect/FiberId", Oh = Symbol.for(n3), J0 = "None", nk = "Runtime", rk = "Composite", k5e = zr(`${n3}-${J0}`);
    let T5e = class {
        [Oh] = Oh;
        _tag = J0;
        id = -1;
        startTimeMillis = -1;
        [Zt]() {
            return k5e;
        }
        [jt](e) {
            return EC(e) && e._tag === J0;
        }
        toString() {
            return vr(this.toJSON());
        }
        toJSON() {
            return {
                _id: "FiberId",
                _tag: this._tag
            };
        }
        [Rn]() {
            return this.toJSON();
        }
    };
    class E5e {
        id;
        startTimeMillis;
        [Oh] = Oh;
        _tag = nk;
        constructor(e, n){
            this.id = e, this.startTimeMillis = n;
        }
        [Zt]() {
            return Jn(this, zr(`${n3}-${this._tag}-${this.id}-${this.startTimeMillis}`));
        }
        [jt](e) {
            return EC(e) && e._tag === nk && this.id === e.id && this.startTimeMillis === e.startTimeMillis;
        }
        toString() {
            return vr(this.toJSON());
        }
        toJSON() {
            return {
                _id: "FiberId",
                _tag: this._tag,
                id: this.id,
                startTimeMillis: this.startTimeMillis
            };
        }
        [Rn]() {
            return this.toJSON();
        }
    }
    let C5e = class {
        left;
        right;
        [Oh] = Oh;
        _tag = rk;
        constructor(e, n){
            this.left = e, this.right = n;
        }
        _hash;
        [Zt]() {
            return V(zr(`${n3}-${this._tag}`), bn(St(this.left)), bn(St(this.right)), Jn(this));
        }
        [jt](e) {
            return EC(e) && e._tag === rk && Lt(this.left, e.left) && Lt(this.right, e.right);
        }
        toString() {
            return vr(this.toJSON());
        }
        toJSON() {
            return {
                _id: "FiberId",
                _tag: this._tag,
                left: wr(this.left),
                right: wr(this.right)
            };
        }
        [Rn]() {
            return this.toJSON();
        }
    };
    const EK = new T5e, EC = (t)=>Vt(t, Oh), CK = j(2, (t, e)=>t._tag === J0 ? e : e._tag === J0 ? t : new C5e(t, e)), I5e = (t)=>V(t, hy(EK, (e, n)=>CK(n)(e))), Q2 = (t)=>{
        switch(t._tag){
            case J0:
                return Ph();
            case nk:
                return TC(t.id);
            case rk:
                return V(Q2(t.left), fy(Q2(t.right)));
        }
    }, pN = qt(Symbol.for("effect/Fiber/Id/_fiberCounter"), ()=>tp(0)), IK = (t)=>Array.from(Q2(t)).map((n)=>`#${n}`).join(","), A5e = ()=>{
        const t = Tn(pN);
        return V(pN, np(t + 1)), new E5e(t, Date.now());
    }, Y0 = EK, P5e = CK, O5e = I5e, M5e = Q2, R5e = IK, AK = A5e, Q0 = Yv, um = X3e, N5e = Z3e, ex = J3e, gN = xK, tx = G0, PK = vK, V5e = Q3e, bN = (t)=>Array.from(V5e(t)), B5e = wC, mN = n5e, yN = Y2, Q8 = r5e, D5e = s5e, F5e = _C, OK = e3, py = Symbol.for("effect/List"), sk = (t)=>Un(t), L5e = (t)=>Fj(b1(t), sk), z5e = L5e(Lt), U5e = {
        [py]: py,
        _tag: "Cons",
        toString () {
            return vr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "List",
                _tag: "Cons",
                values: sk(this).map(wr)
            };
        },
        [Rn] () {
            return this.toJSON();
        },
        [jt] (t) {
            return RK(t) && this._tag === t._tag && z5e(this, t);
        },
        [Zt] () {
            return Jn(this, Ng(sk(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 xt(this, arguments);
        }
    }, nx = (t, e)=>{
        const n = Object.create(U5e);
        return n.head = t, n.tail = e, n;
    }, H5e = zr("Nil"), j5e = {
        [py]: py,
        _tag: "Nil",
        toString () {
            return vr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "List",
                _tag: "Nil"
            };
        },
        [Rn] () {
            return this.toJSON();
        },
        [Zt] () {
            return H5e;
        },
        [jt] (t) {
            return RK(t) && this._tag === t._tag;
        },
        [Symbol.iterator] () {
            return {
                next () {
                    return {
                        done: !0,
                        value: void 0
                    };
                }
            };
        },
        pipe () {
            return xt(this, arguments);
        }
    }, MK = Object.create(j5e), RK = (t)=>Vt(t, py), zl = (t)=>t._tag === "Nil", q5e = (t)=>t._tag === "Cons", K5e = ()=>MK, Mh = (t, e)=>nx(t, e), eg = K5e, CC = (t)=>nx(t, MK), W5e = j(2, (t, e)=>X5e(e, t)), $5e = j(2, (t, e)=>Mh(e, t)), X5e = j(2, (t, e)=>{
        if (zl(t)) return e;
        if (zl(e)) return t;
        {
            const n = nx(e.head, t);
            let r = n, s = e.tail;
            for(; !zl(s);){
                const i = nx(s.head, t);
                r.tail = i, r = i, s = s.tail;
            }
            return n;
        }
    }), G5e = j(3, (t, e, n)=>{
        let r = e, s = t;
        for(; !zl(s);)r = n(r, s.head), s = s.tail;
        return r;
    }), Z5e = (t)=>{
        let e = eg(), n = t;
        for(; !zl(n);)e = $5e(e, n.head), n = n.tail;
        return e;
    }, J5e = Object.assign(Object.create(Array.prototype), {
        [Zt] () {
            return Jn(this, Ng(this));
        },
        [jt] (t) {
            return Array.isArray(t) && this.length === t.length ? this.every((e, n)=>Lt(e, t[n])) : !1;
        }
    }), IC = (function() {
        function t(e) {
            e && Object.assign(this, e);
        }
        return t.prototype = f1, t;
    })(), Y5e = (t)=>Object.assign(Object.create(f1), t), Q5e = Symbol.for("effect/DifferContextPatch");
    function wN(t) {
        return t;
    }
    const v1 = {
        ...IC.prototype,
        [Q5e]: {
            _Value: wN,
            _Patch: wN
        }
    }, e9e = Object.assign(Object.create(v1), {
        _tag: "Empty"
    }), t9e = Object.create(e9e), NK = ()=>t9e, n9e = Object.assign(Object.create(v1), {
        _tag: "AndThen"
    }), r9e = (t, e)=>{
        const n = Object.create(n9e);
        return n.first = t, n.second = e, n;
    }, s9e = Object.assign(Object.create(v1), {
        _tag: "AddService"
    }), i9e = (t, e)=>{
        const n = Object.create(s9e);
        return n.key = t, n.service = e, n;
    }, o9e = Object.assign(Object.create(v1), {
        _tag: "RemoveService"
    }), a9e = (t)=>{
        const e = Object.create(o9e);
        return e.key = t, e;
    }, c9e = Object.assign(Object.create(v1), {
        _tag: "UpdateService"
    }), l9e = (t, e)=>{
        const n = Object.create(c9e);
        return n.key = t, n.update = e, n;
    }, u9e = (t, e)=>{
        const n = new Map(t.unsafeMap);
        let r = NK();
        for (const [s, i] of e.unsafeMap.entries())if (n.has(s)) {
            const o = n.get(s);
            n.delete(s), Lt(o, i) || (r = j_(l9e(s, ()=>i))(r));
        } else n.delete(s), r = j_(i9e(s, i))(r);
        for (const [s] of n.entries())r = j_(a9e(s))(r);
        return r;
    }, j_ = j(2, (t, e)=>r9e(t, e)), d9e = j(2, (t, e)=>{
        if (t._tag === "Empty") return e;
        let n = !1, r = Pn(t);
        const s = new Map(e.unsafeMap);
        for(; oa(r);){
            const o = vc(r), a = Il(r);
            switch(o._tag){
                case "Empty":
                    {
                        r = a;
                        break;
                    }
                case "AddService":
                    {
                        s.set(o.key, o.service), r = a;
                        break;
                    }
                case "AndThen":
                    {
                        r = Vs(Vs(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 Ch(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 Ch(i);
    }), f9e = Symbol.for("effect/DifferHashSetPatch");
    function eS(t) {
        return t;
    }
    const r3 = {
        ...IC.prototype,
        [f9e]: {
            _Value: eS,
            _Key: eS,
            _Patch: eS
        }
    }, h9e = Object.assign(Object.create(r3), {
        _tag: "Empty"
    }), p9e = Object.create(h9e), VK = ()=>p9e, g9e = Object.assign(Object.create(r3), {
        _tag: "AndThen"
    }), b9e = (t, e)=>{
        const n = Object.create(g9e);
        return n.first = t, n.second = e, n;
    }, m9e = Object.assign(Object.create(r3), {
        _tag: "Add"
    }), y9e = (t)=>{
        const e = Object.create(m9e);
        return e.value = t, e;
    }, w9e = Object.assign(Object.create(r3), {
        _tag: "Remove"
    }), _9e = (t)=>{
        const e = Object.create(w9e);
        return e.value = t, e;
    }, x9e = (t, e)=>{
        const [n, r] = hy([
            t,
            VK()
        ], ([s, i], o)=>w5e(o)(s) ? [
                TK(o)(s),
                i
            ] : [
                s,
                ik(y9e(o))(i)
            ])(e);
        return hy(r, (s, i)=>ik(_9e(i))(s))(n);
    }, ik = j(2, (t, e)=>b9e(t, e)), v9e = j(2, (t, e)=>{
        if (t._tag === "Empty") return e;
        let n = e, r = Pn(t);
        for(; oa(r);){
            const s = vc(r), i = Il(r);
            switch(s._tag){
                case "Empty":
                    {
                        r = i;
                        break;
                    }
                case "AndThen":
                    {
                        r = Vs(s.first)(Vs(s.second)(i));
                        break;
                    }
                case "Add":
                    {
                        n = Nm(s.value)(n), r = i;
                        break;
                    }
                case "Remove":
                    n = TK(s.value)(n), r = i;
            }
        }
        return n;
    }), S9e = Symbol.for("effect/DifferReadonlyArrayPatch");
    function _N(t) {
        return t;
    }
    const S1 = {
        ...IC.prototype,
        [S9e]: {
            _Value: _N,
            _Patch: _N
        }
    }, k9e = Object.assign(Object.create(S1), {
        _tag: "Empty"
    }), T9e = Object.create(k9e), BK = ()=>T9e, E9e = Object.assign(Object.create(S1), {
        _tag: "AndThen"
    }), C9e = (t, e)=>{
        const n = Object.create(E9e);
        return n.first = t, n.second = e, n;
    }, I9e = Object.assign(Object.create(S1), {
        _tag: "Append"
    }), A9e = (t)=>{
        const e = Object.create(I9e);
        return e.values = t, e;
    }, P9e = Object.assign(Object.create(S1), {
        _tag: "Slice"
    }), O9e = (t, e)=>{
        const n = Object.create(P9e);
        return n.from = t, n.until = e, n;
    }, M9e = Object.assign(Object.create(S1), {
        _tag: "Update"
    }), R9e = (t, e)=>{
        const n = Object.create(M9e);
        return n.index = t, n.patch = e, n;
    }, N9e = (t)=>{
        let e = 0, n = BK();
        for(; e < t.oldValue.length && e < t.newValue.length;){
            const r = t.oldValue[e], s = t.newValue[e], i = t.differ.diff(r, s);
            Lt(i, t.differ.empty) || (n = q_(n, R9e(e, i))), e = e + 1;
        }
        return e < t.oldValue.length && (n = q_(n, O9e(0, e))), e < t.newValue.length && (n = q_(n, A9e(gxe(e)(t.newValue)))), n;
    }, q_ = j(2, (t, e)=>C9e(t, e)), V9e = j(3, (t, e, n)=>{
        if (t._tag === "Empty") return e;
        let r = e.slice(), s = Ho(t);
        for(; Om(s);){
            const i = vi(s), o = Eh(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;
    }), B9e = Symbol.for("effect/Differ"), D9e = {
        [B9e]: {
            _P: Ft,
            _V: Ft
        },
        pipe () {
            return xt(this, arguments);
        }
    }, qg = (t)=>{
        const e = Object.create(D9e);
        return e.empty = t.empty, e.diff = t.diff, e.combine = t.combine, e.patch = t.patch, e;
    }, F9e = ()=>qg({
            empty: NK(),
            combine: (t, e)=>j_(e)(t),
            diff: (t, e)=>u9e(t, e),
            patch: (t, e)=>d9e(e)(t)
        }), L9e = ()=>qg({
            empty: VK(),
            combine: (t, e)=>ik(e)(t),
            diff: (t, e)=>x9e(t, e),
            patch: (t, e)=>v9e(e)(t)
        }), z9e = (t)=>qg({
            empty: BK(),
            combine: (e, n)=>q_(e, n),
            diff: (e, n)=>N9e({
                    oldValue: e,
                    newValue: n,
                    differ: t
                }),
            patch: (e, n)=>V9e(e, n, t)
        }), DK = ()=>U9e((t, e)=>e), U9e = (t)=>qg({
            empty: Ft,
            combine: (e, n)=>e === Ft ? n : n === Ft ? e : (r)=>n(e(r)),
            diff: (e, n)=>Lt(e, n) ? Ft : Pv(n),
            patch: (e, n)=>t(n, e(n))
        }), gy = 255, FK = 8, ok = (t)=>t & gy, ak = (t)=>t >> FK & gy, k1 = (t, e)=>(t & gy) + ((e & t & gy) << FK), H9e = k1(0, 0), j9e = (t)=>k1(t, t), q9e = (t)=>k1(t, 0), K9e = j(2, (t, e)=>k1(ok(t) & ~e, ak(t))), W9e = j(2, (t, e)=>t | e), $9e = (t)=>~t >>> 0 & gy, X9e = 0, rp = 1, G9e = 2, LK = 4, ck = 16, zK = 32, Z9e = (t)=>s3(t, zK), J9e = j(2, (t, e)=>t & ~e), Y9e = j(2, (t, e)=>t | e), Qu = (t)=>UK(t) && !e8e(t), UK = (t)=>s3(t, rp), s3 = j(2, (t, e)=>(t & e) !== 0), HK = (...t)=>t.reduce((e, n)=>e | n, 0), Q9e = HK(X9e), xN = (t)=>s3(t, LK), e8e = (t)=>s3(t, ck), fd = j(2, (t, e)=>k1(t ^ e, e)), o0 = j(2, (t, e)=>t & ($9e(ok(e)) | ak(e)) | ok(e) & ak(e)), vN = qg({
        empty: H9e,
        diff: (t, e)=>fd(t, e),
        combine: (t, e)=>W9e(e)(t),
        patch: (t, e)=>o0(e, t)
    }), t8e = j9e, jK = q9e, SN = K9e, qK = (t, e)=>({
            _tag: "Par",
            left: t,
            right: e
        }), Zw = (t, e)=>({
            _tag: "Seq",
            left: t,
            right: e
        }), n8e = (t)=>{
        let e = CC(t), n = eg();
        for(;;){
            const [r, s] = G5e(e, [
                KK(),
                eg()
            ], ([i, o], a)=>{
                const [c, l] = r8e(a);
                return [
                    c8e(i, c),
                    W5e(o, l)
                ];
            });
            if (n = s8e(n, r), zl(s)) return Z5e(n);
            e = s;
        }
        throw new Error("BUG: BlockedRequests.flatten - please report an issue at https://github.com/Effect-TS/effect/issues");
    }, r8e = (t)=>{
        let e = t, n = KK(), r = eg(), s = eg();
        for(;;)switch(e._tag){
            case "Empty":
                {
                    if (zl(r)) return [
                        n,
                        s
                    ];
                    e = r.head, r = r.tail;
                    break;
                }
            case "Par":
                {
                    r = Mh(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 = qK(Zw(a, o), Zw(c, o));
                                break;
                            }
                        case "Seq":
                            {
                                const a = i.left, c = i.right;
                                e = Zw(a, Zw(c, o));
                                break;
                            }
                        case "Single":
                            {
                                e = i, s = Mh(o, s);
                                break;
                            }
                    }
                    break;
                }
            case "Single":
                {
                    if (n = a8e(n, e), zl(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");
    }, s8e = (t, e)=>{
        if (zl(t)) return CC(tS(e));
        if (l8e(e)) return t;
        const n = g8e(t.head), r = u8e(e);
        return n.length === 1 && r.length === 1 && Lt(n[0], r[0]) ? Mh(p8e(t.head, tS(e)), t.tail) : Mh(tS(e), t);
    }, i8e = Symbol.for("effect/RequestBlock/RequestBlockParallel"), o8e = {
        _R: (t)=>t
    };
    class AC {
        map;
        [i8e] = o8e;
        constructor(e){
            this.map = e;
        }
    }
    const KK = ()=>new AC(Q0()), a8e = (t, e)=>new AC(B5e(t.map, e.dataSource, (n)=>z2e(Tc(n, dy(e.blockedRequest)), ()=>Pn(e.blockedRequest)))), c8e = (t, e)=>new AC(OK(t.map, e.map, (n, r, s)=>tx(n, s, un(ex(n, s), {
                onNone: ()=>r,
                onSome: (i)=>_r(r, i)
            })))), l8e = (t)=>N5e(t.map), u8e = (t)=>Array.from(PK(t.map)), tS = (t)=>h8e(D5e(t.map, (e)=>Pn(e))), d8e = Symbol.for("effect/RequestBlock/RequestBlockSequential"), f8e = {
        _R: (t)=>t
    };
    class WK {
        map;
        [d8e] = f8e;
        constructor(e){
            this.map = e;
        }
    }
    const h8e = (t)=>new WK(t), p8e = (t, e)=>new WK(OK(e.map, t.map, (n, r, s)=>tx(n, s, un(ex(n, s), {
                onNone: ()=>Cn(),
                onSome: (i)=>_r(i, r)
            })))), g8e = (t)=>Array.from(PK(t.map)), b8e = (t)=>Array.from(t.map), Kg = "Die", Rh = "Empty", sp = "Fail", Wg = "Interrupt", tg = "Parallel", ng = "Sequential", $K = "effect/Cause", XK = Symbol.for($K), m8e = {
        _E: (t)=>t
    }, $g = {
        [XK]: m8e,
        [Zt] () {
            return V(St($K), bn(St(I8e(this))), Jn(this));
        },
        [jt] (t) {
            return GK(t) && C8e(this, t);
        },
        pipe () {
            return xt(this, arguments);
        },
        toJSON () {
            switch(this._tag){
                case "Empty":
                    return {
                        _id: "Cause",
                        _tag: this._tag
                    };
                case "Die":
                    return {
                        _id: "Cause",
                        _tag: this._tag,
                        defect: wr(this.defect)
                    };
                case "Interrupt":
                    return {
                        _id: "Cause",
                        _tag: this._tag,
                        fiberId: this.fiberId.toJSON()
                    };
                case "Fail":
                    return {
                        _id: "Cause",
                        _tag: this._tag,
                        failure: wr(this.error)
                    };
                case "Sequential":
                case "Parallel":
                    return {
                        _id: "Cause",
                        _tag: this._tag,
                        left: wr(this.left),
                        right: wr(this.right)
                    };
            }
        },
        toString () {
            return Xg(this);
        },
        [Rn] () {
            return this.toJSON();
        }
    }, eu = (()=>{
        const t = Object.create($g);
        return t._tag = Rh, t;
    })(), Ad = (t)=>{
        const e = Object.create($g);
        return e._tag = sp, e.error = t, e;
    }, ki = (t)=>{
        const e = Object.create($g);
        return e._tag = Kg, e.defect = t, e;
    }, $o = (t)=>{
        const e = Object.create($g);
        return e._tag = Wg, e.fiberId = t, e;
    }, tu = (t, e)=>{
        const n = Object.create($g);
        return n._tag = tg, n.left = t, n.right = e, n;
    }, vs = (t, e)=>{
        const n = Object.create($g);
        return n._tag = ng, n.left = t, n.right = e, n;
    }, GK = (t)=>Vt(t, XK), y8e = (t)=>t._tag === Rh, w8e = (t)=>t._tag === sp, ZK = (t)=>t._tag === Kg, _8e = (t)=>t._tag === Rh ? !0 : rg(t, !0, (e, n)=>{
            switch(n._tag){
                case Rh:
                    return Fe(e);
                case Kg:
                case sp:
                case Wg:
                    return Fe(!1);
                default:
                    return Ve();
            }
        }), JK = (t)=>nr(S8e(t)), i3 = (t)=>NC(void 0, P8e)(t), x8e = (t)=>Ql(rg(t, Cn(), (e, n)=>n._tag === sp ? Fe(V(e, Vs(n.error))) : Ve())), PC = (t)=>Ql(rg(t, Cn(), (e, n)=>n._tag === Kg ? Fe(V(e, Vs(n.defect))) : Ve())), OC = (t)=>rg(t, Ph(), (e, n)=>n._tag === Wg ? Fe(V(e, Nm(n.fiberId))) : Ve()), YK = (t)=>RC(t, (e)=>e._tag === sp ? Fe(e.error) : Ve()), MC = (t)=>{
        const e = YK(t);
        switch(e._tag){
            case "None":
                return lt(t);
            case "Some":
                return Qe(e.value);
        }
    }, v8e = (t)=>T1(t, {
            onEmpty: Fe(eu),
            onFail: Tc(Ad),
            onDie: (e)=>Fe(ki(e)),
            onInterrupt: (e)=>Fe($o(e)),
            onSequential: K2(vs),
            onParallel: K2(tu)
        }), S8e = (t)=>RC(t, (e)=>e._tag === Wg ? Fe(e.fiberId) : Ve()), k8e = (t)=>T1(t, {
            onEmpty: Ve(),
            onFail: (e)=>Fe(ki(e)),
            onDie: (e)=>Fe(ki(e)),
            onInterrupt: ()=>Ve(),
            onSequential: K2(vs),
            onParallel: K2(tu)
        }), kN = (t)=>T1(t, {
            onEmpty: eu,
            onFail: ()=>eu,
            onDie: ki,
            onInterrupt: $o,
            onSequential: vs,
            onParallel: tu
        }), T8e = (t)=>T1(t, {
            onEmpty: eu,
            onFail: ki,
            onDie: ki,
            onInterrupt: $o,
            onSequential: vs,
            onParallel: tu
        }), QK = j(2, (t, e)=>E8e(t, (n)=>Ad(e(n)))), E8e = j(2, (t, e)=>T1(t, {
            onEmpty: eu,
            onFail: (n)=>e(n),
            onDie: (n)=>ki(n),
            onInterrupt: (n)=>$o(n),
            onSequential: (n, r)=>vs(n, r),
            onParallel: (n, r)=>tu(n, r)
        })), C8e = (t, e)=>{
        let n = Pn(t), r = Pn(e);
        for(; oa(n) && oa(r);){
            const [s, i] = V(vc(n), rg([
                Ph(),
                Cn()
            ], ([c, l], u)=>{
                const [d, f] = lk(u);
                return Fe([
                    V(c, fy(d)),
                    V(l, _r(f))
                ]);
            })), [o, a] = V(vc(r), rg([
                Ph(),
                Cn()
            ], ([c, l], u)=>{
                const [d, f] = lk(u);
                return Fe([
                    V(c, fy(d)),
                    V(l, _r(f))
                ]);
            }));
            if (!Lt(s, o)) return !1;
            n = i, r = a;
        }
        return !0;
    }, I8e = (t)=>A8e(Pn(t), Cn()), A8e = (t, e)=>{
        for(;;){
            const [n, r] = V(t, Yl([
                Ph(),
                Cn()
            ], ([i, o], a)=>{
                const [c, l] = lk(a);
                return [
                    V(i, fy(c)),
                    V(o, _r(l))
                ];
            })), s = i0(n) > 0 ? V(e, Vs(n)) : e;
            if (jg(r)) return Ql(s);
            t = r, e = s;
        }
        throw new Error(Mv("Cause.flattenCauseLoop"));
    }, RC = 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 ng:
                            case tg:
                                {
                                    n.push(r.right), n.push(r.left);
                                    break;
                                }
                        }
                        break;
                    }
                case "Some":
                    return s;
            }
        }
        return Ve();
    }), lk = (t)=>{
        let e = t;
        const n = [];
        let r = Ph(), s = Cn();
        for(; e !== void 0;)switch(e._tag){
            case Rh:
                {
                    if (n.length === 0) return [
                        r,
                        s
                    ];
                    e = n.pop();
                    break;
                }
            case sp:
                {
                    if (r = Nm(r, Rm(e._tag, e.error)), n.length === 0) return [
                        r,
                        s
                    ];
                    e = n.pop();
                    break;
                }
            case Kg:
                {
                    if (r = Nm(r, Rm(e._tag, e.defect)), n.length === 0) return [
                        r,
                        s
                    ];
                    e = n.pop();
                    break;
                }
            case Wg:
                {
                    if (r = Nm(r, Rm(e._tag, e.fiberId)), n.length === 0) return [
                        r,
                        s
                    ];
                    e = n.pop();
                    break;
                }
            case ng:
                {
                    switch(e.left._tag){
                        case Rh:
                            {
                                e = e.right;
                                break;
                            }
                        case ng:
                            {
                                e = vs(e.left.left, vs(e.left.right, e.right));
                                break;
                            }
                        case tg:
                            {
                                e = tu(vs(e.left.left, e.right), vs(e.left.right, e.right));
                                break;
                            }
                        default:
                            {
                                s = Vs(s, e.right), e = e.left;
                                break;
                            }
                    }
                    break;
                }
            case tg:
                {
                    n.push(e.right), e = e.left;
                    break;
                }
        }
        throw new Error(Mv("Cause.evaluateCauseLoop"));
    }, P8e = {
        emptyCase: WR,
        failCase: oy,
        dieCase: oy,
        interruptCase: WR,
        sequentialCase: (t, e, n)=>e && n,
        parallelCase: (t, e, n)=>e && n
    }, TN = "SequentialCase", EN = "ParallelCase", T1 = j(2, (t, { onDie: e, onEmpty: n, onFail: r, onInterrupt: s, onParallel: i, onSequential: o })=>NC(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)
        })), rg = j(3, (t, e, n)=>{
        let r = e, s = t;
        const i = [];
        for(; s !== void 0;){
            const o = n(r, s);
            switch(r = nr(o) ? o.value : r, s._tag){
                case ng:
                    {
                        i.push(s.right), s = s.left;
                        break;
                    }
                case tg:
                    {
                        i.push(s.right), s = s.left;
                        break;
                    }
                default:
                    {
                        s = void 0;
                        break;
                    }
            }
            s === void 0 && i.length > 0 && (s = i.pop());
        }
        return r;
    }), NC = j(3, (t, e, n)=>{
        const r = [
            t
        ], s = [];
        for(; r.length > 0;){
            const o = r.pop();
            switch(o._tag){
                case Rh:
                    {
                        s.push(lt(n.emptyCase(e)));
                        break;
                    }
                case sp:
                    {
                        s.push(lt(n.failCase(e, o.error)));
                        break;
                    }
                case Kg:
                    {
                        s.push(lt(n.dieCase(e, o.defect)));
                        break;
                    }
                case Wg:
                    {
                        s.push(lt(n.interruptCase(e, o.fiberId)));
                        break;
                    }
                case ng:
                    {
                        r.push(o.right), r.push(o.left), s.push(Qe({
                            _tag: TN
                        }));
                        break;
                    }
                case tg:
                    {
                        r.push(o.right), r.push(o.left), s.push(Qe({
                            _tag: EN
                        }));
                        break;
                    }
            }
        }
        const i = [];
        for(; s.length > 0;){
            const o = s.pop();
            switch(o._tag){
                case "Left":
                    {
                        switch(o.left._tag){
                            case TN:
                                {
                                    const a = i.pop(), c = i.pop(), l = n.sequentialCase(e, a, c);
                                    i.push(l);
                                    break;
                                }
                            case EN:
                                {
                                    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();
    }), Xg = (t, e)=>i3(t) ? "All fibers interrupted without errors." : tW(t).map(function(n) {
            return e?.renderErrorCause !== !0 || n.cause === void 0 ? n.stack : `${n.stack} {
${eW(n.cause, "  ")}
}`;
        }).join(`
`), eW = (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 += ` {
${eW(t.cause, `${e}  `)}
${e}}`), r;
    }, uk = (t)=>{
        const e = typeof t == "object" && t !== null, n = Error.stackTraceLimit;
        Error.stackTraceLimit = 1;
        const r = new Error(O8e(t), e && "cause" in t && typeof t.cause < "u" ? {
            cause: uk(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 && (sg in t && (r.span = t[sg]), Object.keys(t).forEach((s)=>{
            s in r || (r[s] = t[s]);
        })), r.stack = R8e(`${r.name}: ${r.message}`, t instanceof Error && t.stack ? t.stack : "", r.span), r;
    }, O8e = (t)=>{
        if (typeof t == "string") return t;
        if (typeof t == "object" && t !== null && t instanceof Error) return t.message;
        try {
            if (Vt(t, "toString") && Rg(t.toString) && t.toString !== Object.prototype.toString && t.toString !== globalThis.Array.prototype.toString) return t.toString();
        } catch  {}
        return Xj(t);
    }, M8e = /\((.*)\)/g, rx = qt("effect/Tracer/spanToTrace", ()=>new WeakMap), R8e = (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 = rx.get(i);
                if (typeof a == "function") {
                    const c = a();
                    if (typeof c == "string") {
                        const l = c.matchAll(M8e);
                        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 = gc(i.parent), o++;
            }
        }
        return r.join(`
`);
    }, sg = Symbol.for("effect/SpanAnnotation"), tW = (t)=>NC(t, void 0, {
            emptyCase: ()=>[],
            dieCase: (e, n)=>[
                    uk(n)
                ],
            failCase: (e, n)=>[
                    uk(n)
                ],
            interruptCase: ()=>[],
            parallelCase: (e, n, r)=>[
                    ...n,
                    ...r
                ],
            sequentialCase: (e, n, r)=>[
                    ...n,
                    ...r
                ]
        }), E1 = "Pending", o3 = "Done", N8e = "effect/Deferred", V8e = Symbol.for(N8e), B8e = {
        _E: (t)=>t,
        _A: (t)=>t
    }, D8e = (t)=>({
            _tag: E1,
            joiners: t
        }), nW = (t)=>({
            _tag: o3,
            effect: t
        });
    class C1 {
        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 C1(this.self);
        }
    }
    const rW = (t, e)=>{
        const n = new hs("Blocked");
        return n.effect_instruction_i0 = t, n.effect_instruction_i1 = e, n;
    }, F8e = (t)=>{
        const e = new hs("RunBlocked");
        return e.effect_instruction_i0 = t, e;
    }, ig = Symbol.for("effect/Effect");
    class L8e {
        patch;
        op;
        _op = jE;
        constructor(e, n){
            this.patch = e, this.op = n;
        }
    }
    class hs {
        _op;
        effect_instruction_i0 = void 0;
        effect_instruction_i1 = void 0;
        effect_instruction_i2 = void 0;
        trace = void 0;
        [ig] = q0;
        constructor(e){
            this._op = e;
        }
        [jt](e) {
            return this === e;
        }
        [Zt]() {
            return Jn(this, zE(this));
        }
        pipe() {
            return xt(this, arguments);
        }
        toJSON() {
            return {
                _id: "Effect",
                _op: this._op,
                effect_instruction_i0: wr(this.effect_instruction_i0),
                effect_instruction_i1: wr(this.effect_instruction_i1),
                effect_instruction_i2: wr(this.effect_instruction_i2)
            };
        }
        toString() {
            return vr(this.toJSON());
        }
        [Rn]() {
            return this.toJSON();
        }
        [Symbol.iterator]() {
            return new C1(new l1(this));
        }
    }
    class sW {
        _op;
        effect_instruction_i0 = void 0;
        effect_instruction_i1 = void 0;
        effect_instruction_i2 = void 0;
        trace = void 0;
        [ig] = q0;
        constructor(e){
            this._op = e, this._tag = e;
        }
        [jt](e) {
            return p3(e) && e._op === "Failure" && Lt(this.effect_instruction_i0, e.effect_instruction_i0);
        }
        [Zt]() {
            return V(zr(this._tag), bn(St(this.effect_instruction_i0)), Jn(this));
        }
        get cause() {
            return this.effect_instruction_i0;
        }
        pipe() {
            return xt(this, arguments);
        }
        toJSON() {
            return {
                _id: "Exit",
                _tag: this._op,
                cause: this.cause.toJSON()
            };
        }
        toString() {
            return vr(this.toJSON());
        }
        [Rn]() {
            return this.toJSON();
        }
        [Symbol.iterator]() {
            return new C1(new l1(this));
        }
    }
    class iW {
        _op;
        effect_instruction_i0 = void 0;
        effect_instruction_i1 = void 0;
        effect_instruction_i2 = void 0;
        trace = void 0;
        [ig] = q0;
        constructor(e){
            this._op = e, this._tag = e;
        }
        [jt](e) {
            return p3(e) && e._op === "Success" && Lt(this.effect_instruction_i0, e.effect_instruction_i0);
        }
        [Zt]() {
            return V(zr(this._tag), bn(St(this.effect_instruction_i0)), Jn(this));
        }
        get value() {
            return this.effect_instruction_i0;
        }
        pipe() {
            return xt(this, arguments);
        }
        toJSON() {
            return {
                _id: "Exit",
                _tag: this._op,
                value: wr(this.value)
            };
        }
        toString() {
            return vr(this.toJSON());
        }
        [Rn]() {
            return this.toJSON();
        }
        [Symbol.iterator]() {
            return new C1(new l1(this));
        }
    }
    const qc = (t)=>Vt(t, ig), dn = (t)=>{
        const e = new hs(Jj);
        return e.effect_instruction_i0 = t, e;
    }, oW = j(3, (t, e, n)=>Eo((r)=>Te(t, (s)=>Te(Cc(Ct(()=>r(e(s)))), (i)=>Ct(()=>n(s, i)).pipe(Ci({
                        onFailure: (o)=>{
                            switch(i._tag){
                                case Os:
                                    return Sr(vs(i.effect_instruction_i0, o));
                                case Ms:
                                    return Sr(o);
                            }
                        },
                        onSuccess: ()=>i
                    })))))), Ss = j(2, (t, e)=>Te(t, ()=>ze(e))), Pi = (t)=>Ss(t, void 0), aW = function() {
        const t = new hs(Bv);
        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(Mv("you're not supposed to end up here"));
        }
        return t;
    }, by = (t, e = Y0)=>{
        const n = new hs(Am);
        let r;
        return n.effect_instruction_i0 = (s)=>{
            r = t(s);
        }, n.effect_instruction_i1 = e, ip(n, (s)=>qc(r) ? r : mn);
    }, VC = (t, e = Y0)=>Ct(()=>by(t, e)), Da = (t, e = Y0)=>aW(t, function() {
            let n, r;
            function s(c) {
                n ? n(c) : r === void 0 && (r = c);
            }
            const i = new hs(Am);
            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 = Us(()=>this.effect_instruction_i0(s, a.signal))) : o = Us(()=>this.effect_instruction_i0(s)), o || a ? ip(i, (c)=>(a && a.abort(), o ?? mn)) : i;
        }), BC = j(2, (t, e)=>{
        const n = new hs(z_);
        return n.effect_instruction_i0 = t, n.effect_instruction_i1 = e, n;
    }), og = j(2, (t, e)=>Nc(t, {
            onFailure: e,
            onSuccess: ze
        })), z8e = j(3, (t, e, n)=>BC(t, (r)=>{
            const s = MC(r);
            switch(s._tag){
                case "Left":
                    return e(s.left) ? n(s.left) : Sr(r);
                case "Right":
                    return Sr(s.right);
            }
        })), CN = Symbol.for("effect/OriginalAnnotation"), DC = (t, e)=>nr(e) ? new Proxy(t, {
            has (n, r) {
                return r === sg || r === CN || r in n;
            },
            get (n, r) {
                return r === sg ? e.value : r === CN ? t : n[r];
            }
        }) : t, Al = (t)=>Uc(t) && !(sg in t) ? dn((e)=>Sr(ki(DC(t, XC(e))))) : Sr(ki(t)), cW = (t)=>FC(()=>ki(new xSe(t))), ag = (t)=>Nc(t, {
            onFailure: (e)=>ze(Qe(e)),
            onSuccess: (e)=>ze(lt(e))
        }), Cc = (t)=>lW(t, {
            onFailure: zn,
            onSuccess: Ir
        }), Cr = (t)=>Uc(t) && !(sg in t) ? dn((e)=>Sr(Ad(DC(t, XC(e))))) : Sr(Ad(t)), I1 = (t)=>Te(Ue(t), Cr), Sr = (t)=>{
        const e = new sW(Os);
        return e.effect_instruction_i0 = t, e;
    }, FC = (t)=>Te(Ue(t), Sr), A1 = dn((t)=>ze(t.id())), Gg = (t)=>dn((e)=>t(e.id())), Te = j(2, (t, e)=>{
        const n = new hs(U2);
        return n.effect_instruction_i0 = t, n.effect_instruction_i1 = e, n;
    }), U8e = j(2, (t, e)=>Te(t, (n)=>{
            const r = typeof e == "function" ? e(n) : e;
            return qc(r) ? r : Uj(r) ? by((s)=>{
                r.then((i)=>s(ze(i)), (i)=>s(Cr(new h3(i, "An unknown error occurred in Effect.andThen"))));
            }) : ze(r);
        })), H8e = (t)=>{
        const e = new hs("OnStep");
        return e.effect_instruction_i0 = t, e;
    }, Zg = (t)=>Te(t, Ft), lW = j(2, (t, e)=>Ci(t, {
            onFailure: (n)=>ze(e.onFailure(n)),
            onSuccess: (n)=>ze(e.onSuccess(n))
        })), Ci = j(2, (t, e)=>{
        const n = new hs(H2);
        return n.effect_instruction_i0 = t, n.effect_instruction_i1 = e.onFailure, n.effect_instruction_i2 = e.onSuccess, n;
    }), Nc = j(2, (t, e)=>Ci(t, {
            onFailure: (n)=>{
                if (PC(n).length > 0) return Sr(T8e(n));
                const s = x8e(n);
                return s.length > 0 ? e.onFailure(fC(s)) : Sr(n);
            },
            onSuccess: e.onSuccess
        })), Pl = j(2, (t, e)=>Ct(()=>{
            const n = Un(t), r = zv(n.length);
            let s = 0;
            return Ss(HC({
                while: ()=>s < n.length,
                body: ()=>e(n[s], s),
                step: (i)=>{
                    r[s++] = i;
                }
            }), r);
        })), a3 = j(2, (t, e)=>Ct(()=>{
            const n = Un(t);
            let r = 0;
            return HC({
                while: ()=>r < n.length,
                body: ()=>e(n[r], r),
                step: ()=>{
                    r++;
                }
            });
        })), ss = Te(A1, (t)=>uW(t)), uW = (t)=>Sr($o(t)), P1 = (t)=>{
        const e = new hs(Vg);
        return e.effect_instruction_i0 = t8e(rp), e.effect_instruction_i1 = ()=>t, e;
    }, LC = j(2, (t, e)=>Eo((n)=>Te(Cc(n(t)), (r)=>BSe(e, r)))), kt = j(2, (t, e)=>Te(t, (n)=>Ue(()=>e(n)))), zC = j(2, (t, e)=>Nc(t, {
            onFailure: (n)=>I1(()=>e.onFailure(n)),
            onSuccess: (n)=>Ue(()=>e.onSuccess(n))
        })), c3 = j(2, (t, e)=>Ci(t, {
            onFailure: (n)=>{
                const r = MC(n);
                switch(r._tag){
                    case "Left":
                        return I1(()=>e(r.left));
                    case "Right":
                        return Sr(r.right);
                }
            },
            onSuccess: ze
        })), Pd = j(2, (t, e)=>Eo((n)=>Ci(n(t), {
                onFailure: (r)=>{
                    const s = zn(r);
                    return Ci(e(s), {
                        onFailure: (i)=>zn(vs(r, i)),
                        onSuccess: ()=>s
                    });
                },
                onSuccess: (r)=>{
                    const s = Ir(r);
                    return Ur(e(s), s);
                }
            }))), ip = j(2, (t, e)=>Pd(t, g3({
            onFailure: (n)=>i3(n) ? Pi(e(OC(n))) : mn,
            onSuccess: ()=>mn
        }))), j8e = j(2, (t, e)=>$8e(t, e, ze)), UC = (t)=>q8e(t, Ft), q8e = j(2, (t, e)=>Nc(t, {
            onFailure: (n)=>Al(e(n)),
            onSuccess: ze
        })), K8e = dn((t, e)=>ze(e.runtimeFlags)), ze = (t)=>{
        const e = new iW(Ms);
        return e.effect_instruction_i0 = t, e;
    }, Ct = (t)=>{
        const e = new hs(Bv);
        return e.commit = t, e;
    }, Ue = (t)=>{
        const e = new hs(Zj);
        return e.effect_instruction_i0 = t, e;
    }, cg = j((t)=>t.length === 3 || t.length === 2 && !(Uc(t[1]) && "onlyEffect" in t[1]), (t, e)=>Te(t, (n)=>{
            const r = typeof e == "function" ? e(n) : e;
            return qc(r) ? Ss(r, n) : Uj(r) ? by((s)=>{
                r.then((i)=>s(ze(n)), (i)=>s(Cr(new h3(i, "An unknown error occurred in Effect.tap"))));
            }) : ze(n);
        })), W8e = (t)=>dn((e)=>{
            const n = e.getFiberRef(hk), r = V(n, xr(()=>e.scope()));
            return t(Jg(hk, Fe(r)));
        }), $8e = j(3, (t, e, n)=>Ci(t, {
            onFailure: (r)=>PC(r).length > 0 ? Sr(H2e(k8e(r))) : e(),
            onSuccess: n
        })), op = (t)=>{
        const e = new hs(Vg);
        return e.effect_instruction_i0 = jK(rp), e.effect_instruction_i1 = ()=>t, e;
    }, Eo = (t)=>aW(t, function() {
            const e = new hs(Vg);
            return e.effect_instruction_i0 = jK(rp), e.effect_instruction_i1 = (n)=>UK(n) ? Us(()=>this.effect_instruction_i0(P1)) : Us(()=>this.effect_instruction_i0(op)), e;
        }), mn = ze(void 0), dW = (t)=>{
        const e = new hs(Vg);
        return e.effect_instruction_i0 = t, e.effect_instruction_i1 = void 0, e;
    }, O1 = j(2, (t, e)=>Te(e, (n)=>n ? V(t, kt(Fe)) : ze(Ve()))), HC = (t)=>{
        const e = new hs(j2);
        return e.effect_instruction_i0 = t.while, e.effect_instruction_i1 = t.body, e.effect_instruction_i2 = t.step, e;
    }, dk = (t)=>Ct(()=>{
            const e = new hs(Pm);
            return e.effect_instruction_i0 = t(), e;
        }), fW = function() {
        const t = arguments.length === 1 ? arguments[0] : arguments[1].bind(arguments[0]);
        return dk(()=>t(V));
    }, X8e = (t, ...e)=>Object.defineProperty(e.length === 0 ? function(...n) {
            return dk(()=>t.apply(this, n));
        } : function(...n) {
            let r = dk(()=>t.apply(this, n));
            for (const s of e)r = s(r, ...n);
            return r;
        }, "length", {
            value: t.length,
            configurable: !0
        }), G8e = j(2, (t, e)=>{
        const n = new hs(Vg);
        return n.effect_instruction_i0 = e, n.effect_instruction_i1 = ()=>t, n;
    }), l3 = (t)=>{
        const e = new hs(U_);
        return typeof t?.priority < "u" ? fSe(e, t.priority) : e;
    }, u3 = j(2, (t, e)=>Te(t, (n)=>kt(e, (r)=>[
                    n,
                    r
                ]))), d3 = j(2, (t, e)=>Te(t, (n)=>Ss(e, n))), Ur = j(2, (t, e)=>Te(t, ()=>e)), hW = j(3, (t, e, n)=>Te(t, (r)=>kt(e, (s)=>n(r, s)))), f3 = (t)=>Te(A1, (e)=>V(t, Ol(e))), Ol = j(2, (t, e)=>Te(t.interruptAsFork(e), ()=>t.await)), Z8e = {
        _tag: "All",
        syslog: 0,
        label: "ALL",
        ordinal: Number.MIN_SAFE_INTEGER,
        pipe () {
            return xt(this, arguments);
        }
    }, J8e = {
        _tag: "Fatal",
        syslog: 2,
        label: "FATAL",
        ordinal: 5e4,
        pipe () {
            return xt(this, arguments);
        }
    }, Y8e = {
        _tag: "Error",
        syslog: 3,
        label: "ERROR",
        ordinal: 4e4,
        pipe () {
            return xt(this, arguments);
        }
    }, pW = {
        _tag: "Warning",
        syslog: 4,
        label: "WARN",
        ordinal: 3e4,
        pipe () {
            return xt(this, arguments);
        }
    }, gW = {
        _tag: "Info",
        syslog: 6,
        label: "INFO",
        ordinal: 2e4,
        pipe () {
            return xt(this, arguments);
        }
    }, bW = {
        _tag: "Debug",
        syslog: 7,
        label: "DEBUG",
        ordinal: 1e4,
        pipe () {
            return xt(this, arguments);
        }
    }, Q8e = {
        _tag: "Trace",
        syslog: 7,
        label: "TRACE",
        ordinal: 0,
        pipe () {
            return xt(this, arguments);
        }
    }, eSe = {
        _tag: "None",
        syslog: 7,
        label: "OFF",
        ordinal: Number.MAX_SAFE_INTEGER,
        pipe () {
            return xt(this, arguments);
        }
    }, tSe = "effect/FiberRef", nSe = Symbol.for(tSe), rSe = {
        _A: (t)=>t
    }, jC = (t)=>dn((e)=>Ir(e.getFiberRef(t))), M1 = j(2, (t, e)=>Te(jC(t), e)), IN = j(2, (t, e)=>sSe(t, ()=>[
                void 0,
                e
            ])), sSe = j(2, (t, e)=>dn((n)=>{
            const [r, s] = e(n.getFiberRef(t));
            return n.setFiberRef(t, s), ze(r);
        })), Jg = j(3, (t, e, n)=>oW(d3(jC(e), IN(e, n)), ()=>t, (r)=>IN(e, r))), iSe = j(3, (t, e, n)=>M1(e, (r)=>Jg(t, e, n(r)))), ks = (t, e)=>Yg(t, {
            differ: DK(),
            fork: e?.fork ?? Ft,
            join: e?.join
        }), oSe = (t)=>{
        const e = L9e();
        return Yg(t, {
            differ: e,
            fork: e.empty
        });
    }, aSe = (t)=>{
        const e = z9e(DK());
        return Yg(t, {
            differ: e,
            fork: e.empty
        });
    }, mW = (t)=>{
        const e = F9e();
        return Yg(t, {
            differ: e,
            fork: e.empty
        });
    }, Yg = (t, e)=>({
            ...h1,
            [nSe]: rSe,
            initial: t,
            commit () {
                return jC(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)
        }), cSe = (t)=>Yg(t, {
            differ: vN,
            fork: vN.empty
        }), fa = qt(Symbol.for("effect/FiberRef/currentContext"), ()=>mW(uy())), Qg = qt(Symbol.for("effect/FiberRef/currentSchedulingPriority"), ()=>ks(0)), yW = qt(Symbol.for("effect/FiberRef/currentMaxOpsBeforeYield"), ()=>ks(2048)), lSe = qt(Symbol.for("effect/FiberRef/currentLogAnnotation"), ()=>ks(Q0())), uSe = qt(Symbol.for("effect/FiberRef/currentLogLevel"), ()=>ks(gW)), dSe = qt(Symbol.for("effect/FiberRef/currentLogSpan"), ()=>ks(eg())), fSe = j(2, (t, e)=>Jg(t, Qg, e)), hSe = qt(Symbol.for("effect/FiberRef/currentConcurrency"), ()=>ks("unbounded")), pSe = qt(Symbol.for("effect/FiberRef/currentRequestBatching"), ()=>ks(!0)), gSe = qt(Symbol.for("effect/FiberRef/currentUnhandledErrorLogLevel"), ()=>ks(Fe(bW))), bSe = qt(Symbol.for("effect/FiberRef/versionMismatchErrorLogLevel"), ()=>ks(Fe(pW))), fk = qt(Symbol.for("effect/FiberRef/currentMetricLabels"), ()=>aSe(Jl())), hk = qt(Symbol.for("effect/FiberRef/currentForkScopeOverride"), ()=>ks(Ve(), {
            fork: ()=>Ve(),
            join: (t, e)=>t
        })), Jw = qt(Symbol.for("effect/FiberRef/currentInterruptedCause"), ()=>ks(eu, {
            fork: ()=>eu,
            join: (t, e)=>t
        })), wW = qt(Symbol.for("effect/FiberRef/currentTracerEnabled"), ()=>ks(!0)), _W = qt(Symbol.for("effect/FiberRef/currentTracerTiming"), ()=>ks(!0)), mSe = qt(Symbol.for("effect/FiberRef/currentTracerSpanAnnotations"), ()=>ks(Q0())), ySe = qt(Symbol.for("effect/FiberRef/currentTracerSpanLinks"), ()=>ks(Cn())), AN = Symbol.for("effect/Scope"), PN = Symbol.for("effect/CloseableScope"), xW = (t, e)=>t.addFinalizer(()=>Pi(e)), sx = (t, e)=>t.addFinalizer(e), lg = (t, e)=>t.close(e), kl = (t, e)=>t.fork(e), wSe = (t)=>_Se(Ft)(t), _Se = j(2, (t, e)=>{
        const n = V(t, YK, Tc(e));
        switch(n._tag){
            case "None":
                return V(PC(t), Gv, un({
                    onNone: ()=>{
                        const r = Un(OC(t)).flatMap((s)=>Un(M5e(s)).map((i)=>`#${i}`));
                        return new vSe(r ? `Interrupted by fibers: ${r.join(", ")}` : void 0);
                    },
                    onSome: Ft
                }));
            case "Some":
                return n.value;
        }
    }), qC = (function() {
        class t extends globalThis.Error {
            commit() {
                return Cr(this);
            }
            toJSON() {
                const n = {
                    ...this
                };
                return this.message && (n.message = this.message), this.cause && (n.cause = this.cause), n;
            }
            [Rn]() {
                return this.toString !== globalThis.Error.prototype.toString ? this.stack ? `${this.toString()}
${this.stack.split(`
`).slice(1).join(`
`)}` : this.toString() : "Bun" in globalThis ? Xg(Ad(this), {
                    renderErrorCause: !0
                }) : this;
            }
        }
        return Object.assign(t.prototype, _2e), t;
    })(), eb = (t, e)=>{
        class n extends qC {
            _tag = e;
        }
        return Object.assign(n.prototype, t), n.prototype.name = e, n;
    }, ON = Symbol.for("effect/Cause/errors/RuntimeException"), xSe = eb({
        [ON]: ON
    }, "RuntimeException"), pk = Symbol.for("effect/Cause/errors/InterruptedException"), vSe = eb({
        [pk]: pk
    }, "InterruptedException"), SSe = (t)=>Vt(t, pk), MN = Symbol.for("effect/Cause/errors/IllegalArgument"), kSe = eb({
        [MN]: MN
    }, "IllegalArgumentException"), RN = Symbol.for("effect/Cause/errors/NoSuchElement"), KC = eb({
        [RN]: RN
    }, "NoSuchElementException"), NN = Symbol.for("effect/Cause/errors/InvalidPubSubCapacityException"), TSe = eb({
        [NN]: NN
    }, "InvalidPubSubCapacityException"), VN = Symbol.for("effect/Cause/errors/Timeout"), ESe = eb({
        [VN]: VN
    }, "TimeoutException"), CSe = (t)=>new ESe(`Operation timed out after '${pK(t)}'`), BN = Symbol.for("effect/Cause/errors/UnknownException"), h3 = (function() {
        class t extends qC {
            _tag = "UnknownException";
            error;
            constructor(n, r){
                super(r ?? "An unknown error occurred", {
                    cause: n
                }), this.error = n;
            }
        }
        return Object.assign(t.prototype, {
            [BN]: BN,
            name: "UnknownException"
        }), t;
    })(), p3 = (t)=>qc(t) && "_tag" in t && (t._tag === "Success" || t._tag === "Failure"), vW = (t)=>t._tag === "Failure", ISe = (t)=>t._tag === "Success", ASe = j(2, (t, e)=>{
        switch(t._tag){
            case Os:
                return zn(t.effect_instruction_i0);
            case Ms:
                return Ir(e);
        }
    }), nS = (t)=>ASe(t, void 0), a0 = (t, e)=>RSe(t, e?.parallel ? tu : vs), SW = (t)=>zn(ki(t)), gk = (t)=>zn(Ad(t)), zn = (t)=>{
        const e = new sW(Os);
        return e.effect_instruction_i0 = t, e;
    }, kW = (t)=>zn($o(t)), K_ = j(2, (t, e)=>{
        switch(t._tag){
            case Os:
                return zn(t.effect_instruction_i0);
            case Ms:
                return Ir(e(t.effect_instruction_i0));
        }
    }), PSe = j(2, (t, { onFailure: e, onSuccess: n })=>{
        switch(t._tag){
            case Os:
                return zn(V(t.effect_instruction_i0, QK(e)));
            case Ms:
                return Ir(n(t.effect_instruction_i0));
        }
    }), g3 = j(2, (t, { onFailure: e, onSuccess: n })=>{
        switch(t._tag){
            case Os:
                return e(t.effect_instruction_i0);
            case Ms:
                return n(t.effect_instruction_i0);
        }
    }), bk = j(2, (t, { onFailure: e, onSuccess: n })=>{
        switch(t._tag){
            case Os:
                return e(t.effect_instruction_i0);
            case Ms:
                return n(t.effect_instruction_i0);
        }
    }), Ir = (t)=>{
        const e = new iW(Ms);
        return e.effect_instruction_i0 = t, e;
    }, ni = Ir(void 0), OSe = j(2, (t, e)=>WC(t, e, {
            onSuccess: (n, r)=>[
                    n,
                    r
                ],
            onFailure: vs
        })), MSe = j(2, (t, e)=>WC(t, e, {
            onSuccess: (n, r)=>r,
            onFailure: vs
        })), WC = j(3, (t, e, { onFailure: n, onSuccess: r })=>{
        switch(t._tag){
            case Os:
                switch(e._tag){
                    case Ms:
                        return zn(t.effect_instruction_i0);
                    case Os:
                        return zn(n(t.effect_instruction_i0, e.effect_instruction_i0));
                }
            case Ms:
                switch(e._tag){
                    case Ms:
                        return Ir(r(t.effect_instruction_i0, e.effect_instruction_i0));
                    case Os:
                        return zn(e.effect_instruction_i0);
                }
        }
    }), RSe = (t, e)=>{
        const n = To(t);
        return oa(n) ? V(Il(n), Yl(V(vc(n), K_(Pn)), (r, s)=>V(r, WC(s, {
                onSuccess: (i, o)=>V(i, Vs(o)),
                onFailure: e
            }))), K_(Ql), K_((r)=>wo(r)), Fe) : Ve();
    }, tb = (t)=>({
            ...h1,
            [V8e]: B8e,
            state: tp(D8e([])),
            commit () {
                return aa(this);
            },
            blockingOn: t
        }), nb = ()=>Te(A1, (t)=>NSe(t)), NSe = (t)=>Ue(()=>tb(t)), aa = (t)=>VC((e)=>{
            const n = Tn(t.state);
            switch(n._tag){
                case o3:
                    return e(n.effect);
                case E1:
                    return n.joiners.push(e), FSe(t, e);
            }
        }, t.blockingOn), VSe = j(2, (t, e)=>LC(e, t)), b3 = j(2, (t, e)=>Ue(()=>{
            const n = Tn(t.state);
            switch(n._tag){
                case o3:
                    return !1;
                case E1:
                    {
                        np(t.state, nW(e));
                        for(let r = 0, s = n.joiners.length; r < s; r++)n.joiners[r](e);
                        return !0;
                    }
            }
        })), BSe = j(2, (t, e)=>b3(t, e)), TW = j(2, (t, e)=>b3(t, Sr(e))), m3 = j(2, (t, e)=>b3(t, uW(e))), DSe = (t)=>Ue(()=>Tn(t.state)._tag === o3), R1 = j(2, (t, e)=>b3(t, ze(e))), y3 = (t, e)=>{
        const n = Tn(t.state);
        if (n._tag === E1) {
            np(t.state, nW(e));
            for(let r = 0, s = n.joiners.length; r < s; r++)n.joiners[r](e);
        }
    }, FSe = (t, e)=>Ue(()=>{
            const n = Tn(t.state);
            if (n._tag === E1) {
                const r = n.joiners.indexOf(e);
                r >= 0 && n.joiners.splice(r, 1);
            }
        }), LSe = dn((t)=>Ir(t.currentContext)), w3 = ()=>LSe, ap = (t)=>Te(w3(), t), _3 = j(2, (t, e)=>Jg(fa, e)(t)), $C = j(2, (t, e)=>iSe(fa, (n)=>Ug(n, e))(t)), EW = j(2, (t, e)=>ap((n)=>_3(t, e(n)))), XC = (t)=>{
        const e = t.currentSpan;
        return e !== void 0 && e._tag === "Span" ? Fe(e) : Ve();
    }, zSe = {
        _tag: "Span",
        spanId: "noop",
        traceId: "noop",
        sampled: !1,
        status: {
            _tag: "Ended",
            startTime: BigInt(0),
            endTime: BigInt(0),
            exit: ni
        },
        attributes: new Map,
        links: [],
        kind: "internal",
        attribute () {},
        event () {},
        end () {},
        addLinks () {}
    }, USe = (t)=>Object.assign(Object.create(zSe), t), ri = nb, Ar = aa, HSe = VSe, CW = TW, mk = DSe, Qo = R1, GC = vW, yk = ISe, jSe = a0, qSe = SW, IW = gk, ea = zn, KSe = K_, WSe = PSe, Sc = g3, uo = Ir, x3 = ni, DN = OSe, my = MSe, FN = Symbol.for("effect/MutableHashMap"), $Se = {
        [FN]: FN,
        [Symbol.iterator] () {
            return new ZC(this);
        },
        toString () {
            return vr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "MutableHashMap",
                values: Array.from(this).map(wr)
            };
        },
        [Rn] () {
            return this.toJSON();
        },
        pipe () {
            return xt(this, arguments);
        }
    };
    class ZC {
        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 XSe(this.self.buckets.values()), this.next()) : e;
        }
        [Symbol.iterator]() {
            return new ZC(this.self);
        }
    }
    class XSe {
        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 GSe = ()=>{
        const t = Object.create($Se);
        return t.referential = new Map, t.buckets = new Map, t.bucketsSize = 0, t;
    }, Cf = j(2, (t, e)=>{
        if (ay(e) === !1) return t.referential.has(e) ? Fe(t.referential.get(e)) : Ve();
        const n = e[Zt](), r = t.buckets.get(n);
        return r === void 0 ? Ve() : ZSe(t, r, e);
    }), ZSe = (t, e, n, r = !1)=>{
        for(let s = 0, i = e.length; s < i; s++)if (n[jt](e[s][0])) {
            const o = e[s][1];
            return r && (e.splice(s, 1), t.bucketsSize--), Fe(o);
        }
        return Ve();
    }, Vb = j(2, (t, e)=>nr(Cf(t, e))), Bb = j(3, (t, e, n)=>{
        if (ay(e) === !1) return t.referential.set(e, n), t;
        const r = e[Zt](), s = t.buckets.get(r);
        return s === void 0 ? (t.buckets.set(r, [
            [
                e,
                n
            ]
        ]), t.bucketsSize++, t) : (JSe(t, s, e), s.push([
            e,
            n
        ]), t.bucketsSize++, t);
    }), JSe = (t, e, n)=>{
        for(let r = 0, s = e.length; r < s; r++)if (n[jt](e[r][0])) {
            e.splice(r, 1), t.bucketsSize--;
            return;
        }
    }, LN = Symbol.for("effect/MutableList"), YSe = {
        [LN]: LN,
        [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 vr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "MutableList",
                values: Array.from(this).map(wr)
            };
        },
        [Rn] () {
            return this.toJSON();
        },
        pipe () {
            return xt(this, arguments);
        }
    }, QSe = (t)=>({
            value: t,
            removed: !1,
            prev: void 0,
            next: void 0
        }), e4e = ()=>{
        const t = Object.create(YSe);
        return t.head = void 0, t.tail = void 0, t._length = 0, t;
    }, AW = (t)=>JC(t) === 0, JC = (t)=>t._length, t4e = j(2, (t, e)=>{
        const n = QSe(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;
    }), n4e = (t)=>{
        const e = t.head;
        if (e !== void 0) return r4e(t, e), e.value;
    }, r4e = (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));
    }, zN = Symbol.for("effect/MutableQueue"), yr = Symbol.for("effect/mutable/MutableQueue/Empty"), s4e = {
        [zN]: zN,
        [Symbol.iterator] () {
            return Array.from(this.queue)[Symbol.iterator]();
        },
        toString () {
            return vr(this.toJSON());
        },
        toJSON () {
            return {
                _id: "MutableQueue",
                values: Array.from(this).map(wr)
            };
        },
        [Rn] () {
            return this.toJSON();
        },
        pipe () {
            return xt(this, arguments);
        }
    }, PW = (t)=>{
        const e = Object.create(s4e);
        return e.queue = e4e(), e.capacity = t, e;
    }, YC = (t)=>PW(t), N1 = ()=>PW(void 0), QC = (t)=>JC(t.queue), sh = (t)=>AW(t.queue), i4e = (t)=>t.capacity === void 0 ? 1 / 0 : t.capacity, Od = j(2, (t, e)=>{
        const n = JC(t.queue);
        return t.capacity !== void 0 && n === t.capacity ? !1 : (t4e(e)(t.queue), !0);
    }), eI = j(2, (t, e)=>{
        const n = e[Symbol.iterator]();
        let r, s = Cn(), i = !0;
        for(; i && (r = n.next()) && !r.done;)i = Od(r.value)(t);
        for(; r != null && !r.done;)s = Vs(r.value)(s), r = n.next();
        return Ql(s);
    }), Ic = j(2, (t, e)=>AW(t.queue) ? e : n4e(t.queue)), v3 = j(2, (t, e)=>{
        let n = Cn(), r = 0;
        for(; r < e;){
            const s = Ic(yr)(t);
            if (s === yr) break;
            n = Vs(s)(n), r += 1;
        }
        return Ql(n);
    }), o4e = "effect/Clock", UN = Symbol.for(o4e), rb = jc("effect/Clock"), a4e = 2 ** 31 - 1, HN = {
        unsafeSchedule (t, e) {
            const n = Si(e);
            if (n > a4e) return oy;
            let r = !1;
            const s = setTimeout(()=>{
                r = !0, t();
            }, n);
            return ()=>(clearTimeout(s), !r);
        }
    }, jN = (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)));
    })(), c4e = (function() {
        const t = typeof process == "object" && "hrtime" in process && typeof process.hrtime.bigint == "function" ? process.hrtime : void 0;
        if (!t) return jN;
        const e = jN() - t.bigint();
        return ()=>e + t.bigint();
    })();
    class l4e {
        [UN] = UN;
        unsafeCurrentTimeMillis() {
            return Date.now();
        }
        unsafeCurrentTimeNanos() {
            return c4e();
        }
        currentTimeMillis = Ue(()=>this.unsafeCurrentTimeMillis());
        currentTimeNanos = Ue(()=>this.unsafeCurrentTimeNanos());
        scheduler() {
            return ze(HN);
        }
        sleep(e) {
            return Da((n)=>{
                const r = HN.unsafeSchedule(()=>n(mn), e);
                return Pi(Ue(r));
            });
        }
    }
    const u4e = ()=>new l4e, OW = "And", MW = "Or", RW = "InvalidData", NW = "MissingData", VW = "SourceUnavailable", BW = "Unsupported", d4e = "effect/ConfigError", qN = Symbol.for(d4e), sb = {
        _tag: "ConfigError",
        [qN]: qN
    }, DW = (t, e)=>{
        const n = Object.create(sb);
        return n._op = OW, 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;
    }, FW = (t, e)=>{
        const n = Object.create(sb);
        return n._op = MW, 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;
    }, f4e = (t, e, n = {
        pathDelim: "."
    })=>{
        const r = Object.create(sb);
        return r._op = RW, r.path = t, r.message = e, Object.defineProperty(r, "toString", {
            enumerable: !1,
            value () {
                return `(Invalid data at ${V(this.path, Fg(n.pathDelim))}: "${this.message}")`;
            }
        }), r;
    }, Nh = (t, e, n = {
        pathDelim: "."
    })=>{
        const r = Object.create(sb);
        return r._op = NW, r.path = t, r.message = e, Object.defineProperty(r, "toString", {
            enumerable: !1,
            value () {
                return `(Missing data at ${V(this.path, Fg(n.pathDelim))}: "${this.message}")`;
            }
        }), r;
    }, h4e = (t, e, n, r = {
        pathDelim: "."
    })=>{
        const s = Object.create(sb);
        return s._op = VW, s.path = t, s.message = e, s.cause = n, Object.defineProperty(s, "toString", {
            enumerable: !1,
            value () {
                return `(Source unavailable at ${V(this.path, Fg(r.pathDelim))}: "${this.message}")`;
            }
        }), s;
    }, p4e = (t, e, n = {
        pathDelim: "."
    })=>{
        const r = Object.create(sb);
        return r._op = BW, r.path = t, r.message = e, Object.defineProperty(r, "toString", {
            enumerable: !1,
            value () {
                return `(Unsupported operation at ${V(this.path, Fg(n.pathDelim))}: "${this.message}")`;
            }
        }), r;
    }, Uf = j(2, (t, e)=>{
        switch(t._op){
            case OW:
                return DW(Uf(t.left, e), Uf(t.right, e));
            case MW:
                return FW(Uf(t.left, e), Uf(t.right, e));
            case RW:
                return f4e([
                    ...e,
                    ...t.path
                ], t.message);
            case NW:
                return Nh([
                    ...e,
                    ...t.path
                ], t.message);
            case VW:
                return h4e([
                    ...e,
                    ...t.path
                ], t.message, t.cause);
            case BW:
                return p4e([
                    ...e,
                    ...t.path
                ], t.message);
        }
    }), g4e = {
        _tag: "Empty"
    }, rS = j(2, (t, e)=>{
        let n = CC(e), r = t;
        for(; q5e(n);){
            const s = n.head;
            switch(s._tag){
                case "Empty":
                    {
                        n = n.tail;
                        break;
                    }
                case "AndThen":
                    {
                        n = Mh(s.first, Mh(s.second, n.tail));
                        break;
                    }
                case "MapName":
                    {
                        r = Rs(r, s.f), n = n.tail;
                        break;
                    }
                case "Nested":
                    {
                        r = W2(r, s.name), n = n.tail;
                        break;
                    }
                case "Unnested":
                    {
                        if (V(Mm(r), W2e(s.name))) r = Eh(r), n = n.tail;
                        else return Qe(Nh(r, `Expected ${s.name} to be in path in ConfigProvider#unnested`));
                        break;
                    }
            }
        }
        return lt(r);
    }), b4e = "Constant", m4e = "Fail", y4e = "Fallback", w4e = "Described", _4e = "Lazy", x4e = "MapOrFail", v4e = "Nested", S4e = "Primitive", k4e = "Sequence", T4e = "HashMap", E4e = "ZipWith";
    var KN = {};
    const ix = (t, e)=>[
            ...t,
            ...e
        ], C4e = "effect/ConfigProvider", WN = Symbol.for(C4e), I4e = jc("effect/ConfigProvider"), A4e = "effect/ConfigProviderFlat", $N = Symbol.for(A4e), P4e = (t)=>({
            [WN]: WN,
            pipe () {
                return xt(this, arguments);
            },
            ...t
        }), O4e = (t)=>({
            [$N]: $N,
            patch: t.patch,
            load: (e, n, r = !0)=>t.load(e, n, r),
            enumerateChildren: t.enumerateChildren
        }), M4e = (t)=>P4e({
            load: (e)=>Te(Lo(t, Jl(), e, !1), (n)=>un(Mm(n), {
                        onNone: ()=>Cr(Nh(Jl(), `Expected a single value having structure: ${e}`)),
                        onSome: ze
                    })),
            flattened: t
        }), R4e = (t)=>{
        const { pathDelim: e, seqDelim: n } = Object.assign({}, {
            pathDelim: "_",
            seqDelim: ","
        }, t), r = (c)=>V(c, Fg(e)), s = (c)=>c.split(e), i = ()=>typeof process < "u" && "env" in process && typeof KN == "object" ? KN : {};
        return M4e(O4e({
            load: (c, l, u = !0)=>{
                const d = r(c), f = i(), p = d in f ? Fe(f[d]) : Ve();
                return V(p, c3(()=>Nh(c, `Expected ${d} to exist in the process context`)), Te((h)=>F4e(h, c, l, n, u)));
            },
            enumerateChildren: (c)=>Ue(()=>{
                    const l = i(), f = Object.keys(l).map((p)=>s(p.toUpperCase())).filter((p)=>{
                        for(let h = 0; h < c.length; h++){
                            const b = V(c, hq(h)), y = p[h];
                            if (y === void 0 || b !== y) return !1;
                        }
                        return !0;
                    }).flatMap((p)=>p.slice(c.length, c.length + 1));
                    return lm(f);
                }),
            patch: g4e
        }));
    }, N4e = (t, e, n, r)=>{
        const s = QR(n.length, (c)=>c >= r.length ? Ve() : Fe([
                t(c),
                c + 1
            ])), i = QR(r.length, (c)=>c >= n.length ? Ve() : Fe([
                e(c),
                c + 1
            ])), o = ix(n, s), a = ix(r, i);
        return [
            o,
            a
        ];
    }, V4e = (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;
    }, Lo = (t, e, n, r)=>{
        const s = n;
        switch(s._tag){
            case b4e:
                return ze(Ho(s.value));
            case w4e:
                return Ct(()=>Lo(t, e, s.config, r));
            case m4e:
                return Cr(Nh(e, s.message));
            case y4e:
                return V(Ct(()=>Lo(t, e, s.first, r)), og((i)=>s.condition(i) ? V(Lo(t, e, s.second, r), og((o)=>Cr(FW(i, o)))) : Cr(i)));
            case _4e:
                return Ct(()=>Lo(t, e, s.config(), r));
            case x4e:
                return Ct(()=>V(Lo(t, e, s.original, r), Te(Pl((i)=>V(s.mapOrFail(i), c3(Uf(V4e(e, s.original))))))));
            case v4e:
                return Ct(()=>Lo(t, ix(e, Ho(s.name)), s.config, r));
            case S4e:
                return V(rS(e, t.patch), Te((i)=>V(t.load(i, s, r), Te((o)=>{
                        if (o.length === 0) {
                            const a = V(fxe(i), xr(()=>"<n/a>"));
                            return Cr(Nh([], `Expected ${s.description} with name ${a}`));
                        }
                        return ze(o);
                    }))));
            case k4e:
                return V(rS(e, t.patch), Te((i)=>V(t.enumerateChildren(i), Te(z4e), Te((o)=>o.length === 0 ? Ct(()=>kt(Lo(t, e, s.config, !0), Ho)) : V(Pl(o, (a)=>Lo(t, ly(e, `[${a}]`), s.config, !0)), kt((a)=>{
                            const c = xxe(a);
                            return c.length === 0 ? Ho(Jl()) : Ho(c);
                        }))))));
            case T4e:
                return Ct(()=>V(rS(e, t.patch), Te((i)=>V(t.enumerateChildren(i), Te((o)=>V(o, Pl((a)=>Lo(t, ix(i, Ho(a)), s.valueConfig, r)), kt((a)=>a.length === 0 ? Ho(Q0()) : V(L4e(a), Rs((c)=>um(YR(Un(o), c)))))))))));
            case E4e:
                return Ct(()=>V(Lo(t, e, s.left, r), ag, Te((i)=>V(Lo(t, e, s.right, r), ag, Te((o)=>{
                            if (Qn(i) && Qn(o)) return Cr(DW(i.left, o.left));
                            if (Qn(i) && Ia(o)) return Cr(i.left);
                            if (Ia(i) && Qn(o)) return Cr(o.left);
                            if (Ia(i) && Ia(o)) {
                                const a = V(e, Fg(".")), c = B4e(e, a), [l, u] = N4e(c, c, V(i.right, Rs(lt)), V(o.right, Rs(lt)));
                                return V(l, YR(u), Pl(([d, f])=>V(u3(d, f), kt(([p, h])=>s.zip(p, h)))));
                            }
                            throw new Error("BUG: ConfigProvider.fromFlatLoop - please report an issue at https://github.com/Effect-TS/effect/issues");
                        })))));
        }
    }, B4e = (t, e)=>(n)=>Qe(Nh(t, `The element at index ${n} in a sequence at path "${e}" was missing`)), D4e = (t, e)=>t.split(new RegExp(`\\s*${$2(e)}\\s*`)), F4e = (t, e, n, r, s)=>s ? V(D4e(t, r), Pl((i)=>n.parse(i.trim())), c3(Uf(e))) : V(n.parse(t), zC({
            onFailure: Uf(e),
            onSuccess: Ho
        })), L4e = (t)=>Object.keys(t[0]).map((e)=>t.map((n)=>n[e])), z4e = (t)=>V(Pl(t, H4e), zC({
            onFailure: ()=>Jl(),
            onSuccess: K0(W0)
        }), ag, kt(O2e)), U4e = /^(\[(\d+)\])$/, H4e = (t)=>{
        const e = t.match(U4e);
        if (e !== null) {
            const n = e[2];
            return V(n !== void 0 && n.length > 0 ? Fe(n) : Ve(), p1(j4e));
        }
        return Ve();
    }, j4e = (t)=>{
        const e = Number.parseInt(t);
        return Number.isNaN(e) ? Ve() : Fe(e);
    }, XN = Symbol.for("effect/Console"), tI = jc("effect/Console"), q4e = {
        [XN]: XN,
        assert (t, ...e) {
            return Ue(()=>{
                console.assert(t, ...e);
            });
        },
        clear: Ue(()=>{
            console.clear();
        }),
        count (t) {
            return Ue(()=>{
                console.count(t);
            });
        },
        countReset (t) {
            return Ue(()=>{
                console.countReset(t);
            });
        },
        debug (...t) {
            return Ue(()=>{
                console.debug(...t);
            });
        },
        dir (t, e) {
            return Ue(()=>{
                console.dir(t, e);
            });
        },
        dirxml (...t) {
            return Ue(()=>{
                console.dirxml(...t);
            });
        },
        error (...t) {
            return Ue(()=>{
                console.error(...t);
            });
        },
        group (t) {
            return t?.collapsed ? Ue(()=>console.groupCollapsed(t?.label)) : Ue(()=>console.group(t?.label));
        },
        groupEnd: Ue(()=>{
            console.groupEnd();
        }),
        info (...t) {
            return Ue(()=>{
                console.info(...t);
            });
        },
        log (...t) {
            return Ue(()=>{
                [
                    ...t
                ];
            });
        },
        table (t, e) {
            return Ue(()=>{
                console.table(t, e);
            });
        },
        time (t) {
            return Ue(()=>console.time(t));
        },
        timeEnd (t) {
            return Ue(()=>console.timeEnd(t));
        },
        timeLog (t, ...e) {
            return Ue(()=>{
                console.timeLog(t, ...e);
            });
        },
        trace (...t) {
            return Ue(()=>{
                console.trace(...t);
            });
        },
        warn (...t) {
            return Ue(()=>{
                console.warn(...t);
            });
        },
        unsafe: console
    }, K4e = "effect/Random", GN = Symbol.for(K4e), LW = jc("effect/Random");
    class W4e {
        seed;
        [GN] = GN;
        PRNG;
        constructor(e){
            this.seed = e, this.PRNG = new r2e(e);
        }
        get next() {
            return Ue(()=>this.PRNG.number());
        }
        get nextBoolean() {
            return kt(this.next, (e)=>e > .5);
        }
        get nextInt() {
            return Ue(()=>this.PRNG.integer(Number.MAX_SAFE_INTEGER));
        }
        nextRange(e, n) {
            return kt(this.next, (r)=>(n - e) * r + e);
        }
        nextIntBetween(e, n) {
            return Ue(()=>this.PRNG.integer(n - e) + e);
        }
        shuffle(e) {
            return $4e(e, (n)=>this.nextIntBetween(0, n));
        }
    }
    const $4e = (t, e)=>Ct(()=>V(Ue(()=>Array.from(t)), Te((n)=>{
                const r = [];
                for(let s = n.length; s >= 2; s = s - 1)r.push(s);
                return V(r, a3((s)=>V(e(s), kt((i)=>X4e(n, s - 1, i)))), Ss(To(n)));
            }))), X4e = (t, e, n)=>{
        const r = t[e];
        return t[e] = t[n], t[n] = r, t;
    }, G4e = (t)=>new W4e(St(t)), ZN = Symbol.for("effect/Tracer"), Z4e = (t)=>({
            [ZN]: ZN,
            ...t
        }), nI = jc("effect/Tracer"), S3 = jc("effect/ParentSpan"), JN = (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 J4e {
        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 : JN(32), this.spanId = JN(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 Y4e = Z4e({
        span: (t, e, n, r, s, i)=>new J4e(t, e, n, r, s, i),
        context: (t)=>t()
    }), Q4e = (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;
                }
            }
        };
    }, wk = Hg()("effect/Tracer/DisablePropagation", {
        defaultValue: oy
    }), zW = V(uy(), wc(rb, u4e()), wc(tI, q4e), wc(LW, G4e(Math.random())), wc(I4e, R4e()), wc(nI, Y4e)), Vh = qt(Symbol.for("effect/DefaultServices/currentServices"), ()=>mW(zW)), e7e = (t)=>{
        const e = Ei(t);
        return HW((n)=>n.sleep(e));
    }, UW = (t)=>dn((e)=>t(e.currentDefaultServices)), HW = (t)=>UW((e)=>t(e.unsafeMap.get(rb.key))), t7e = HW((t)=>t.currentTimeMillis), n7e = (t)=>UW((e)=>t(e.unsafeMap.get(LW.key))), r7e = n7e((t)=>t.next), s7e = e7e, jW = t7e, i7e = rb;
    function o7e(t) {
        return new Md(t);
    }
    function a7e() {
        return o7e(new Map);
    }
    const YN = Symbol.for("effect/FiberRefs");
    class Md {
        locals;
        [YN] = YN;
        constructor(e){
            this.locals = e;
        }
        pipe() {
            return xt(this, arguments);
        }
    }
    const c7e = (t, e, n, r = !1)=>{
        const s = t;
        let i = e, o = n, a = r, c;
        for(; c === void 0;)if (Rr(i) && Rr(o)) {
            const l = vi(i)[0], u = Eh(i), d = vi(o)[0], f = vi(o)[1], p = Eh(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;
    }, l7e = 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][jt](e)) {
                if (!r.has(i)) {
                    if (Lt(o, i.initial)) return;
                    r.set(i, [
                        [
                            e,
                            i.join(i.initial, o)
                        ]
                    ]);
                    return;
                }
                const a = r.get(i), [c, l] = c7e(i, a, s);
                if (l) {
                    const u = i.diff(c, o), d = a[0][1], f = i.join(d, i.patch(u)(d));
                    if (!Lt(d, f)) {
                        let p;
                        const h = a[0][0];
                        h[jt](e) ? p = [
                            [
                                h,
                                f
                            ],
                            ...a.slice(1)
                        ] : p = [
                            [
                                e,
                                f
                            ],
                            ...a
                        ], r.set(i, p);
                    }
                }
            }
        }), new Md(r);
    }), u7e = j(2, (t, e)=>{
        const n = new Map;
        return qW(t, n, e), new Md(n);
    }), qW = (t, e, n)=>{
        t.locals.forEach((r, s)=>{
            const i = r[0][1], o = s.patch(s.fork)(i);
            Lt(i, o) ? e.set(s, r) : e.set(s, [
                [
                    n,
                    o
                ],
                ...r
            ]);
        });
    }, KW = j(2, (t, e)=>{
        const n = new Map(t.locals);
        return n.delete(e), new Md(n);
    }), WW = j(2, (t, e)=>t.locals.has(e) ? Fe(vi(t.locals.get(e))[1]) : Ve()), yy = j(2, (t, e)=>V(WW(t, e), xr(()=>e.initial))), _k = j(2, (t, { fiberId: e, fiberRef: n, value: r })=>{
        if (t.locals.size === 0) return new Md(new Map([
            [
                n,
                [
                    [
                        e,
                        r
                    ]
                ]
            ]
        ]));
        const s = new Map(t.locals);
        return xk(s, e, n, r), new Md(s);
    }), xk = (t, e, n, r)=>{
        const s = t.get(n) ?? [];
        let i;
        if (Rr(s)) {
            const [o, a] = vi(s);
            if (o[jt](e)) {
                if (Lt(a, r)) return;
                i = [
                    [
                        e,
                        r
                    ],
                    ...s.slice(1)
                ];
            } else i = [
                [
                    e,
                    r
                ],
                ...s
            ];
        } else i = [
            [
                e,
                r
            ]
        ];
        t.set(n, i);
    }, d7e = j(2, (t, { entries: e, forkAs: n })=>{
        if (t.locals.size === 0) return new Md(new Map(e));
        const r = new Map(t.locals);
        return n !== void 0 && qW(t, r, n), e.forEach(([s, i])=>{
            i.length === 1 ? xk(r, i[0][0], s, i[0][1]) : i.forEach(([o, a])=>{
                xk(r, o, s, a);
            });
        }), new Md(r);
    }), QN = WW, $W = yy, f7e = d7e, h7e = a7e, p7e = Z8e, g7e = J8e, b7e = Y8e, XW = pW, m7e = gW, GW = bW, y7e = Q8e, w7e = eSe, _7e = V(W0, Th((t)=>t.ordinal)), x7e = D2e(_7e), v7e = (t)=>{
        switch(t){
            case "All":
                return p7e;
            case "Debug":
                return GW;
            case "Error":
                return b7e;
            case "Fatal":
                return g7e;
            case "Info":
                return m7e;
            case "Trace":
                return y7e;
            case "None":
                return w7e;
            case "Warning":
                return XW;
        }
    }, ZW = (t)=>t.replace(/[\s="]/g, "_"), S7e = (t)=>(e)=>`${ZW(e.label)}=${t - e.startTime}ms`, k7e = d1, T7e = x2e;
    class Kc extends T7e {
    }
    const Rd = Symbol.for("effect/Readable"), rI = Symbol.for("effect/Ref"), sI = {
        _A: (t)=>t
    };
    class E7e extends Kc {
        ref;
        commit() {
            return this.get;
        }
        [rI] = sI;
        [Rd] = Rd;
        constructor(e){
            super(), this.ref = e, this.get = Ue(()=>Tn(this.ref));
        }
        get;
        modify(e) {
            return Ue(()=>{
                const n = Tn(this.ref), [r, s] = e(n);
                return n !== s && np(s)(this.ref), r;
            });
        }
    }
    const iI = (t)=>new E7e(tp(t)), ox = (t)=>Ue(()=>iI(t)), _o = (t)=>t.get, ih = j(2, (t, e)=>t.modify(()=>[
                void 0,
                e
            ])), C7e = j(2, (t, e)=>t.modify((n)=>[
                n,
                e
            ])), JW = j(2, (t, e)=>t.modify(e)), ax = j(2, (t, e)=>t.modify((n)=>[
                void 0,
                e(n)
            ])), I7e = rI, Ml = ox, Xo = _o, YW = C7e, Rf = JW, so = ih, QW = ax, e$ = "Empty", t$ = "Add", n$ = "Remove", r$ = "Update", s$ = "AndThen", A7e = {
        _tag: e$
    }, oI = (t, e)=>{
        const n = new Map(t.locals);
        let r = A7e;
        for (const [s, i] of e.locals.entries()){
            const o = vi(i)[1], a = n.get(s);
            if (a !== void 0) {
                const c = vi(a)[1];
                Lt(c, o) || (r = sS({
                    _tag: r$,
                    fiberRef: s,
                    patch: s.diff(c, o)
                })(r));
            } else r = sS({
                _tag: t$,
                fiberRef: s,
                value: o
            })(r);
            n.delete(s);
        }
        for (const [s] of n.entries())r = sS({
            _tag: n$,
            fiberRef: s
        })(r);
        return r;
    }, sS = j(2, (t, e)=>({
            _tag: s$,
            first: t,
            second: e
        })), i$ = j(3, (t, e, n)=>{
        let r = n, s = Ho(t);
        for(; Rr(s);){
            const i = vi(s), o = Eh(s);
            switch(i._tag){
                case e$:
                    {
                        s = o;
                        break;
                    }
                case t$:
                    {
                        r = _k(r, {
                            fiberId: e,
                            fiberRef: i.fiberRef,
                            value: i.value
                        }), s = o;
                        break;
                    }
                case n$:
                    {
                        r = KW(r, i.fiberRef), s = o;
                        break;
                    }
                case r$:
                    {
                        const a = yy(r, i.fiberRef);
                        r = _k(r, {
                            fiberId: e,
                            fiberRef: i.fiberRef,
                            value: i.fiberRef.patch(i.patch)(a)
                        }), s = o;
                        break;
                    }
                case s$:
                    {
                        s = W2(i.first)(W2(i.second)(o));
                        break;
                    }
            }
        }
        return r;
    }), o$ = "effect/MetricLabel", vk = Symbol.for(o$);
    class P7e {
        key;
        value;
        [vk] = vk;
        _hash;
        constructor(e, n){
            this.key = e, this.value = n, this._hash = zr(o$ + this.key + this.value);
        }
        [Zt]() {
            return this._hash;
        }
        [jt](e) {
            return M7e(e) && this.key === e.key && this.value === e.value;
        }
        pipe() {
            return xt(this, arguments);
        }
    }
    const O7e = (t, e)=>new P7e(t, e), M7e = (t)=>Vt(t, vk), R7e = (t)=>kt(t, Fe), a$ = (t)=>{
        let e, n;
        return typeof t == "function" ? e = t : (e = t.try, n = t.catch), Ct(()=>{
            try {
                return ze(Us(e));
            } catch (r) {
                return Cr(n ? Us(()=>n(r)) : new h3(r, "An unknown error occurred in Effect.try"));
            }
        });
    }, N7e = j(2, (t, e)=>Ci(t, {
            onFailure: (n)=>{
                const r = e(n);
                switch(r._tag){
                    case "None":
                        return Sr(n);
                    case "Some":
                        return r.value;
                }
            },
            onSuccess: ze
        })), V7e = j(2, (t, e)=>{
        let n;
        return z8e(t, (r)=>(n ??= Object.keys(e), Vt(r, "_tag") && ko(r._tag) && n.includes(r._tag)), (r)=>e[r._tag](r));
    }), B7e = (t)=>h$(t, l$, oI), D7e = (t)=>h$(t, u3(l$, K8e), ([e, n], [r, s])=>[
                oI(e, r),
                fd(n, s)
            ]), F7e = ze({}), Sk = U_e(kt, Te), eV = z_e(kt), L7e = L_e(kt), c$ = j(2, (t, e)=>Nc(t, {
            onFailure: (n)=>ze(e.onFailure(n)),
            onSuccess: (n)=>ze(e.onSuccess(n))
        })), z7e = (t)=>{
        const e = Te(Te(t, ()=>l3()), ()=>e);
        return e;
    }, l$ = dn((t)=>ze(t.getFiberRefs())), U7e = (t)=>c$(t, {
            onFailure: L2,
            onSuccess: L2
        }), H7e = (t)=>Ci(t, {
            onFailure: (e)=>j7e(e, "An error was silently ignored because it is not anticipated to be useful"),
            onSuccess: ()=>mn
        }), u$ = (t, e)=>Ct(()=>e.while(t) ? Te(e.body(t), (n)=>u$(n, e)) : ze(t)), d$ = (t)=>(...e)=>{
            const n = Yh(t);
            let r;
            for(let s = 0, i = e.length; s < i; s++){
                const o = e[s];
                GK(o) && (r !== void 0 ? r = vs(r, o) : r = o, e = [
                    ...e.slice(0, s),
                    ...e.slice(s + 1)
                ], s--);
            }
            return r === void 0 && (r = eu), dn((s)=>(s.log(e, r, n), mn));
        }, j7e = d$(GW), q7e = d$(XW), tV = j(2, (t, e)=>Ci(t, {
            onFailure: (n)=>FC(()=>e(n)),
            onSuccess: ze
        })), K7e = (t)=>V(nb(), Te((e)=>V(D7e(t), LC(e), $7e, kt((n)=>Ur(n, V(aa(e), Te(([r, s])=>Ss(u3(f$(r[0]), dW(r[1])), s)))))))), W7e = (t)=>kt(t, (e)=>!e), $7e = (t)=>kt(Ml(!0), (e)=>Pi(O1(t, YW(e, !1)))), X7e = j(2, (t, e)=>j8e(t, ()=>Ue(e))), f$ = (t)=>t6e((e, n)=>V(t, i$(e, n))), G7e = (t)=>t.length >= 1 ? Da((e, n)=>{
            try {
                t(n).then((r)=>e(ze(r)), (r)=>e(Al(r)));
            } catch (r) {
                e(Al(r));
            }
        }) : Da((e)=>{
            try {
                t().then((n)=>e(ze(n)), (n)=>e(Al(n)));
            } catch (n) {
                e(Al(n));
            }
        }), aI = j(3, (t, e, n)=>ap((r)=>_3(t, wc(r, e, n)))), wy = j(3, (t, e, n)=>ap((r)=>Te(n, (s)=>_3(t, V(r, wc(e, s)))))), Z7e = j(3, (t, e, n)=>Un(t).reduce((r, s, i)=>Te(r, (o)=>n(o, s, i)), ze(e))), cI = s7e, J7e = ze(Ve()), h$ = j(3, (t, e, n)=>Te(e, (r)=>Te(t, (s)=>kt(e, (i)=>[
                        n(r, i),
                        s
                    ])))), Y7e = j(2, (t, e)=>Ci(t, {
            onFailure: (n)=>Ur(e(n), Sr(n)),
            onSuccess: ze
        })), Q7e = (t)=>{
        let e, n;
        typeof t == "function" ? e = t : (e = t.try, n = t.catch);
        const r = (s)=>n ? I1(()=>n(s)) : Cr(new h3(s, "An unknown error occurred in Effect.tryPromise"));
        return e.length >= 1 ? Da((s, i)=>{
            try {
                e(i).then((o)=>s(ze(o)), (o)=>s(r(o)));
            } catch (o) {
                s(r(o));
            }
        }) : Da((s)=>{
            try {
                e().then((i)=>s(ze(i)), (i)=>s(r(i)));
            } catch (i) {
                s(r(i));
            }
        });
    }, e6e = j(2, (t, e)=>Te(t, (n)=>a$({
                try: ()=>e.try(n),
                catch: e.catch
            }))), t6e = (t)=>dn((e)=>(e.setFiberRefs(t(e.id(), e.getFiberRefs())), mn)), n6e = j(2, (t, e)=>Ct(()=>e() ? kt(t, Fe) : ze(Ve()))), r6e = (t)=>new Proxy({}, {
            get (e, n, r) {
                return (...s)=>Te(t, (i)=>i[n](...s));
            }
        }), s6e = (t)=>kt(w3(), ep(t)), p$ = BigInt(0), lI = p1((t)=>Ec(t.context, wk) ? t._tag === "Span" ? lI(t.parent) : Ve() : Fe(t)), i6e = (t, e, n)=>{
        const r = !t.getFiberRef(wW) || n.context && Ec(n.context, wk), s = t.getFiberRef(fa), i = n.parent ? Fe(n.parent) : n.root ? Ve() : lI(ep(s, S3));
        let o;
        if (r) o = USe({
            name: e,
            parent: i,
            context: wc(n.context ?? uy(), wk, !0)
        });
        else {
            const a = t.getFiberRef(Vh), c = Ec(a, nI), l = Ec(a, i7e), u = t.getFiberRef(_W), d = t.getFiberRefs(), f = QN(d, mSe), p = QN(d, ySe), h = p._tag === "Some" ? n.links !== void 0 ? [
                ...wo(p.value),
                ...n.links ?? []
            ] : wo(p.value) : n.links ?? Jl();
            o = c.span(e, i, n.context ?? uy(), h, u ? l.unsafeCurrentTimeNanos() : p$, n.kind ?? "internal", n), f._tag === "Some" && F5e(f.value, (b, y)=>o.attribute(y, b)), n.attributes !== void 0 && Object.entries(n.attributes).forEach(([b, y])=>o.attribute(b, y));
        }
        return typeof n.captureStackTrace == "function" && rx.set(o, n.captureStackTrace), o;
    }, o6e = (t, e, n, r)=>Ue(()=>{
            t.status._tag !== "Ended" && (vW(e) && rx.has(t) && t.attribute("code.stacktrace", rx.get(t)()), t.end(r ? n.unsafeCurrentTimeNanos() : p$, e));
        }), a6e = (t, ...e)=>{
        const n = Q4e(e.length === 1 ? void 0 : e[0]), r = e[e.length - 1];
        return dn((s)=>{
            const i = i6e(s, t, n), o = s.getFiberRef(_W), a = Ec(s.getFiberRef(Vh), rb);
            return Pd(r(i), (c)=>o6e(i, c, a, o));
        });
    }, c6e = j(2, (t, e)=>aI(t, S3, e)), g$ = "Sequential", b$ = "Parallel", l6e = "ParallelN", hd = {
        _tag: g$
    }, kk = {
        _tag: b$
    }, u6e = (t)=>({
            _tag: l6e,
            parallelism: t
        }), d6e = (t)=>t._tag === g$, f6e = (t)=>t._tag === b$, cx = hd, Tk = kk, Ek = u6e, _y = oI, xy = i$, k3 = "effect/FiberStatus", Bh = Symbol.for(k3), lx = "Done", nV = "Running", rV = "Suspended", h6e = zr(`${k3}-${lx}`);
    let p6e = class {
        [Bh] = Bh;
        _tag = lx;
        [Zt]() {
            return h6e;
        }
        [jt](e) {
            return uI(e) && e._tag === lx;
        }
    };
    class g6e {
        runtimeFlags;
        [Bh] = Bh;
        _tag = nV;
        constructor(e){
            this.runtimeFlags = e;
        }
        [Zt]() {
            return V(St(k3), bn(St(this._tag)), bn(St(this.runtimeFlags)), Jn(this));
        }
        [jt](e) {
            return uI(e) && e._tag === nV && this.runtimeFlags === e.runtimeFlags;
        }
    }
    class b6e {
        runtimeFlags;
        blockingOn;
        [Bh] = Bh;
        _tag = rV;
        constructor(e, n){
            this.runtimeFlags = e, this.blockingOn = n;
        }
        [Zt]() {
            return V(St(k3), bn(St(this._tag)), bn(St(this.runtimeFlags)), bn(St(this.blockingOn)), Jn(this));
        }
        [jt](e) {
            return uI(e) && e._tag === rV && this.runtimeFlags === e.runtimeFlags && Lt(this.blockingOn, e.blockingOn);
        }
    }
    const m6e = new p6e, y6e = (t)=>new g6e(t), w6e = (t, e)=>new b6e(t, e), uI = (t)=>Vt(t, Bh), _6e = (t)=>t._tag === lx, x6e = m6e, m$ = y6e, v6e = w6e, S6e = _6e, k6e = Symbol.for("effect/Micro"), ux = Symbol.for("effect/Micro/MicroExit"), sV = Symbol.for("effect/Micro/MicroCause"), T6e = {
        _E: Ft
    };
    class y$ extends globalThis.Error {
        _tag;
        traces;
        [sV];
        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 = j0(n, 0), a = `${i}: ${o}`;
            r.length > 0 && (a += `
    ${r.join(`
    `)}`), super(o), this._tag = e, this.traces = r, this[sV] = T6e, this.name = i, this.stack = a;
        }
        pipe() {
            return xt(this, arguments);
        }
        toString() {
            return this.stack;
        }
        [Rn]() {
            return this.stack;
        }
    }
    class E6e extends y$ {
        defect;
        constructor(e, n = []){
            super("Die", e, n), this.defect = e;
        }
    }
    const C6e = (t, e = [])=>new E6e(t, e);
    class I6e extends y$ {
        constructor(e = []){
            super("Interrupt", "interrupted", e);
        }
    }
    const A6e = (t = [])=>new I6e(t), P6e = (t)=>t._tag === "Interrupt", iV = Symbol.for("effect/Micro/MicroFiber"), O6e = {
        _A: Ft,
        _E: Ft
    };
    class M6e {
        context;
        interruptible;
        [iV];
        _stack = [];
        _observers = [];
        _exit;
        _children;
        currentOpCount = 0;
        constructor(e, n = !0){
            this.context = e, this.interruptible = n, this[iV] = O6e;
        }
        getRef(e) {
            return Jve(this.context, e);
        }
        addObserver(e) {
            return this._exit ? (e(this._exit), L2) : (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(gI));
        }
        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 === Yw) return;
            const r = oV.interruptChildren && oV.interruptChildren(this);
            if (r !== void 0) return this.evaluate(fx(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(bI).shouldYield(this)) {
                        n = !0;
                        const s = r;
                        r = fx(D6e, ()=>s);
                    }
                    if (r = r[Ck](this), r === Yw) {
                        const s = this._yielded;
                        return ux in s ? (this._yielded = void 0, s) : Yw;
                    }
                }
            } catch (s) {
                return Vt(r, Ck) ? Ik(s) : Ik(`MicroFiber.runLoop: Not a valid effect: ${String(r)}`);
            }
        }
        getCont(e) {
            for(;;){
                const n = this._stack.pop();
                if (!n) return;
                const r = n[dx] && n[dx](this);
                if (r) return {
                    [e]: r
                };
                if (n[e]) return n;
            }
        }
        _yielded = void 0;
        yieldWith(e) {
            return this._yielded = e, Yw;
        }
        children() {
            return this._children ??= new Set;
        }
    }
    const oV = qt("effect/Micro/fiberMiddleware", ()=>({
            interruptChildren: void 0
        })), w$ = Symbol.for("effect/Micro/identifier"), ws = Symbol.for("effect/Micro/args"), Ck = Symbol.for("effect/Micro/evaluate"), ug = Symbol.for("effect/Micro/successCont"), c0 = Symbol.for("effect/Micro/failureCont"), dx = Symbol.for("effect/Micro/ensureCont"), Yw = Symbol.for("effect/Micro/Yield"), R6e = {
        _A: Ft,
        _E: Ft,
        _R: Ft
    }, N6e = {
        ...k7e,
        _op: "Micro",
        [k6e]: R6e,
        pipe () {
            return xt(this, arguments);
        },
        [Symbol.iterator] () {
            return new LE(new l1(this));
        },
        toJSON () {
            return {
                _id: "Micro",
                op: this[w$],
                ...ws in this ? {
                    args: this[ws]
                } : void 0
            };
        },
        toString () {
            return vr(this);
        },
        [Rn] () {
            return vr(this);
        }
    };
    function V6e(t) {
        return Ik("Micro.evaluate: Not implemented");
    }
    const T3 = (t)=>({
            ...N6e,
            [w$]: t.op,
            [Ck]: t.eval ?? V6e,
            [ug]: t.contA,
            [c0]: t.contE,
            [dx]: t.ensure
        }), dI = (t)=>{
        const e = T3(t);
        return function() {
            const n = Object.create(e);
            return n[ws] = t.single === !1 ? arguments : arguments[0], n;
        };
    }, _$ = (t)=>{
        const e = {
            ...T3(t),
            [ux]: ux,
            _tag: t.op,
            get [t.prop] () {
                return this[ws];
            },
            toJSON () {
                return {
                    _id: "MicroExit",
                    _tag: t.op,
                    [t.prop]: this[ws]
                };
            },
            [jt] (n) {
                return z6e(n) && n._tag === t.op && Lt(this[ws], n[ws]);
            },
            [Zt] () {
                return Jn(this, bn(zr(t.op))(St(this[ws])));
            }
        };
        return function(n) {
            const r = Object.create(e);
            return r[ws] = n, r[ug] = void 0, r[c0] = void 0, r[dx] = void 0, r;
        };
    }, fI = _$({
        op: "Success",
        prop: "value",
        eval (t) {
            const e = t.getCont(ug);
            return e ? e[ug](this[ws], t) : t.yieldWith(this);
        }
    }), x$ = _$({
        op: "Failure",
        prop: "cause",
        eval (t) {
            let e = t.getCont(c0);
            for(; P6e(this[ws]) && e && t.interruptible;)e = t.getCont(c0);
            return e ? e[c0](this[ws], t) : t.yieldWith(this);
        }
    }), B6e = dI({
        op: "Yield",
        eval (t) {
            let e = !1;
            return t.getRef(bI).scheduleTask(()=>{
                e || t.evaluate(U6e);
            }, this[ws] ?? 0), t.yieldWith(()=>{
                e = !0;
            });
        }
    }), D6e = B6e(0), F6e = fI(void 0), hI = dI({
        op: "WithMicroFiber",
        eval (t) {
            return this[ws](t);
        }
    }), fx = j(2, (t, e)=>{
        const n = Object.create(L6e);
        return n[ws] = t, n[ug] = e, n;
    }), L6e = T3({
        op: "OnSuccess",
        eval (t) {
            return t._stack.push(this), this[ws];
        }
    }), z6e = (t)=>Vt(t, ux), v$ = fI, pI = x$, gI = pI(A6e()), Ik = (t)=>pI(C6e(t)), U6e = v$(void 0), H6e = "setImmediate" in globalThis ? globalThis.setImmediate : (t)=>setTimeout(t, 0);
    class S$ {
        tasks = [];
        running = !1;
        scheduleTask(e, n) {
            this.tasks.push(e), this.running || (this.running = !0, H6e(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(K6e);
        }
        flush() {
            for(; this.tasks.length > 0;)this.runTasks();
        }
    }
    const j6e = j(2, (t, e)=>hI((n)=>{
            const r = n.context;
            return n.context = e(r), X6e(t, ()=>(n.context = r, F6e));
        })), q6e = j(2, (t, e)=>j6e(t, Ug(e)));
    class K6e extends Hg()("effect/Micro/currentMaxOpsBeforeYield", {
        defaultValue: ()=>2048
    }) {
    }
    class bI extends Hg()("effect/Micro/currentScheduler", {
        defaultValue: ()=>new S$
    }) {
    }
    const W6e = j(2, (t, e)=>{
        const n = Object.create($6e);
        return n[ws] = t, n[ug] = e.onSuccess, n[c0] = e.onFailure, n;
    }), $6e = T3({
        op: "OnSuccessAndFailure",
        eval (t) {
            return t._stack.push(this), this[ws];
        }
    }), X6e = j(2, (t, e)=>Z6e((n)=>W6e(n(t), {
                onFailure: (r)=>fx(e(pI(r)), ()=>x$(r)),
                onSuccess: (r)=>fx(e(v$(r)), ()=>fI(r))
            }))), k$ = dI({
        op: "SetInterruptible",
        ensure (t) {
            if (t.interruptible = this[ws], t._interrupted && t.interruptible) return ()=>gI;
        }
    }), G6e = (t)=>hI((e)=>e.interruptible ? t : (e.interruptible = !0, e._stack.push(k$(!1)), e._interrupted ? gI : t)), Z6e = (t)=>hI((e)=>e.interruptible ? (e.interruptible = !1, e._stack.push(k$(!0)), t(G6e)) : t(Ft)), J6e = (t, e)=>{
        const n = new M6e(bI.context(new S$));
        return n.evaluate(t), n;
    };
    class hx {
        scheduleDrain;
        running = !1;
        tasks = new T$;
        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 hx(e), r = new WeakMap;
            return (s)=>{
                if (s === void 0) return n;
                let i = r.get(s);
                return i === void 0 && (i = new hx(e), r.set(s, i)), i;
            };
        }
    }
    class T$ {
        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 Y6e {
        maxNextTickBeforeTimer;
        getRunner = hx.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(yW) ? e.getFiberRef(Qg) : !1;
        }
        scheduleTask(e, n, r) {
            this.getRunner(r).scheduleTask(e, n);
        }
    }
    const E$ = qt(Symbol.for("effect/Scheduler/defaultScheduler"), ()=>new Y6e(2048));
    class C$ {
        tasks = new T$;
        deferred = !1;
        scheduleTask(e, n, r) {
            this.deferred ? E$.scheduleTask(e, n, r) : this.tasks.scheduleTask(e, n);
        }
        shouldYield(e) {
            return e.currentOpCount > e.getFiberRef(yW) ? e.getFiberRef(Qg) : !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 mI = qt(Symbol.for("effect/FiberRef/currentScheduler"), ()=>ks(E$)), I$ = qt(Symbol.for("effect/FiberRef/currentRequestMap"), ()=>ks(new Map)), aV = (t, e, n, r)=>{
        switch(t){
            case void 0:
                return e();
            case "unbounded":
                return n();
            case "inherit":
                return M1(hSe, (s)=>s === "unbounded" ? n() : s > 1 ? r(s) : e());
            default:
                return t > 1 ? r(t) : e();
        }
    }, yI = "InterruptSignal", wI = "Stateful", _I = "Resume", xI = "YieldNow", iS = (t)=>({
            _tag: yI,
            cause: t
        }), W_ = (t)=>({
            _tag: wI,
            onFiber: t
        }), Rp = (t)=>({
            _tag: _I,
            effect: t
        }), Q6e = ()=>({
            _tag: xI
        }), eke = "effect/FiberScope", px = Symbol.for(eke);
    class tke {
        [px] = px;
        fiberId = Y0;
        roots = new Set;
        add(e, n) {
            this.roots.add(n), n.addObserver(()=>{
                this.roots.delete(n);
            });
        }
    }
    class nke {
        fiberId;
        parent;
        [px] = px;
        constructor(e, n){
            this.fiberId = e, this.parent = n;
        }
        add(e, n) {
            this.parent.tell(W_((r)=>{
                r.addChild(n), n.addObserver(()=>{
                    r.removeChild(n);
                });
            }));
        }
    }
    const rke = (t)=>new nke(t.id(), t), V1 = qt(Symbol.for("effect/FiberScope/Global"), ()=>new tke), ske = "effect/Fiber", ike = Symbol.for(ske), oke = {
        _E: (t)=>t,
        _A: (t)=>t
    }, ake = "effect/Fiber", cke = Symbol.for(ake), lke = (t)=>t.await, uke = (t)=>t.inheritAll, vy = (t)=>d3(Zg(t.await), t.inheritAll);
    ({
        ...h1
    });
    const bf = "effect/FiberCurrent", dke = "effect/Logger", fke = Symbol.for(dke), hke = {
        _Message: (t)=>t,
        _Output: (t)=>t
    }, vI = (t)=>({
            [fke]: hke,
            log: t,
            pipe () {
                return xt(this, arguments);
            }
        }), pke = /^[^\s"=]*$/, gke = (t, e)=>({ annotations: n, cause: r, date: s, fiberId: i, logLevel: o, message: a, spans: c })=>{
            const l = (h)=>h.match(pke) ? h : t(h), u = (h, b)=>`${ZW(h)}=${l(b)}`, d = (h, b)=>" " + u(h, b);
            let f = u("timestamp", s.toISOString());
            f += d("level", o.label), f += d("fiber", IK(i));
            const p = ixe(a);
            for(let h = 0; h < p.length; h++)f += d("message", j0(p[h], e));
            y8e(r) || (f += d("cause", Xg(r, {
                renderErrorCause: !0
            })));
            for (const h of c)f += " " + S7e(s.getTime())(h);
            for (const [h, b] of n)f += d(h, j0(b, e));
            return f;
        }, bke = (t)=>`"${t.replace(/\\([\s\S])|(")/g, "\\$1$2")}"`, mke = vI(gke(bke)), yke = typeof process == "object" && process !== null && typeof process.stdout == "object" && process.stdout !== null;
    yke && process.stdout.isTTY;
    const A$ = "effect/MetricBoundaries", Ak = Symbol.for(A$);
    class wke {
        values;
        [Ak] = Ak;
        constructor(e){
            this.values = e, this._hash = V(zr(A$), bn(Ng(this.values)));
        }
        _hash;
        [Zt]() {
            return this._hash;
        }
        [jt](e) {
            return _ke(e) && Lt(this.values, e.values);
        }
        pipe() {
            return xt(this, arguments);
        }
    }
    const _ke = (t)=>Vt(t, Ak), xke = (t)=>{
        const e = V(t, Uv(Pn(Number.POSITIVE_INFINITY)), Txe);
        return new wke(e);
    }, vke = (t)=>V(sxe(t.count - 1, (e)=>t.start * Math.pow(t.factor, e)), Zi, xke), Ske = "effect/MetricKeyType", P$ = Symbol.for(Ske), O$ = "effect/MetricKeyType/Counter", Pk = Symbol.for(O$), kke = "effect/MetricKeyType/Frequency", Tke = Symbol.for(kke), Eke = "effect/MetricKeyType/Gauge", Cke = Symbol.for(Eke), M$ = "effect/MetricKeyType/Histogram", Ok = Symbol.for(M$), Ike = "effect/MetricKeyType/Summary", Ake = Symbol.for(Ike), R$ = {
        _In: (t)=>t,
        _Out: (t)=>t
    };
    class Pke {
        incremental;
        bigint;
        [P$] = R$;
        [Pk] = Pk;
        constructor(e, n){
            this.incremental = e, this.bigint = n, this._hash = zr(O$);
        }
        _hash;
        [Zt]() {
            return this._hash;
        }
        [jt](e) {
            return N$(e);
        }
        pipe() {
            return xt(this, arguments);
        }
    }
    class Oke {
        boundaries;
        [P$] = R$;
        [Ok] = Ok;
        constructor(e){
            this.boundaries = e, this._hash = V(zr(M$), bn(St(this.boundaries)));
        }
        _hash;
        [Zt]() {
            return this._hash;
        }
        [jt](e) {
            return V$(e) && Lt(this.boundaries, e.boundaries);
        }
        pipe() {
            return xt(this, arguments);
        }
    }
    const Mke = (t)=>new Pke(t?.incremental ?? !1, t?.bigint ?? !1), Rke = (t)=>new Oke(t), N$ = (t)=>Vt(t, Pk), Nke = (t)=>Vt(t, Tke), Vke = (t)=>Vt(t, Cke), V$ = (t)=>Vt(t, Ok), Bke = (t)=>Vt(t, Ake), Dke = "effect/MetricKey", B$ = Symbol.for(Dke), Fke = {
        _Type: (t)=>t
    }, Lke = b1(Lt);
    class SI {
        name;
        keyType;
        description;
        tags;
        [B$] = Fke;
        constructor(e, n, r, s = []){
            this.name = e, this.keyType = n, this.description = r, this.tags = s, this._hash = V(zr(this.name + this.description), bn(St(this.keyType)), bn(Ng(this.tags)));
        }
        _hash;
        [Zt]() {
            return this._hash;
        }
        [jt](e) {
            return zke(e) && this.name === e.name && Lt(this.keyType, e.keyType) && Lt(this.description, e.description) && Lke(this.tags, e.tags);
        }
        pipe() {
            return xt(this, arguments);
        }
    }
    const zke = (t)=>Vt(t, B$), Uke = (t, e)=>new SI(t, Mke(e), Yh(e?.description)), Hke = (t, e, n)=>new SI(t, Rke(e), Yh(n)), jke = j(2, (t, e)=>e.length === 0 ? t : new SI(t.name, t.keyType, t.description, H_(t.tags, e))), qke = "effect/MetricState", B1 = Symbol.for(qke), D$ = "effect/MetricState/Counter", Mk = Symbol.for(D$), F$ = "effect/MetricState/Frequency", Rk = Symbol.for(F$), L$ = "effect/MetricState/Gauge", Nk = Symbol.for(L$), z$ = "effect/MetricState/Histogram", Vk = Symbol.for(z$), U$ = "effect/MetricState/Summary", Bk = Symbol.for(U$), D1 = {
        _A: (t)=>t
    };
    class Kke {
        count;
        [B1] = D1;
        [Mk] = Mk;
        constructor(e){
            this.count = e;
        }
        [Zt]() {
            return V(St(D$), bn(St(this.count)), Jn(this));
        }
        [jt](e) {
            return nTe(e) && this.count === e.count;
        }
        pipe() {
            return xt(this, arguments);
        }
    }
    const Wke = b1(Lt);
    class $ke {
        occurrences;
        [B1] = D1;
        [Rk] = Rk;
        constructor(e){
            this.occurrences = e;
        }
        _hash;
        [Zt]() {
            return V(zr(F$), bn(Ng(Un(this.occurrences.entries()))), Jn(this));
        }
        [jt](e) {
            return rTe(e) && Wke(Un(this.occurrences.entries()), Un(e.occurrences.entries()));
        }
        pipe() {
            return xt(this, arguments);
        }
    }
    class Xke {
        value;
        [B1] = D1;
        [Nk] = Nk;
        constructor(e){
            this.value = e;
        }
        [Zt]() {
            return V(St(L$), bn(St(this.value)), Jn(this));
        }
        [jt](e) {
            return sTe(e) && this.value === e.value;
        }
        pipe() {
            return xt(this, arguments);
        }
    }
    class Gke {
        buckets;
        count;
        min;
        max;
        sum;
        [B1] = D1;
        [Vk] = Vk;
        constructor(e, n, r, s, i){
            this.buckets = e, this.count = n, this.min = r, this.max = s, this.sum = i;
        }
        [Zt]() {
            return V(St(z$), bn(St(this.buckets)), bn(St(this.count)), bn(St(this.min)), bn(St(this.max)), bn(St(this.sum)), Jn(this));
        }
        [jt](e) {
            return iTe(e) && Lt(this.buckets, e.buckets) && this.count === e.count && this.min === e.min && this.max === e.max && this.sum === e.sum;
        }
        pipe() {
            return xt(this, arguments);
        }
    }
    class Zke {
        error;
        quantiles;
        count;
        min;
        max;
        sum;
        [B1] = D1;
        [Bk] = Bk;
        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;
        }
        [Zt]() {
            return V(St(U$), bn(St(this.error)), bn(St(this.quantiles)), bn(St(this.count)), bn(St(this.min)), bn(St(this.max)), bn(St(this.sum)), Jn(this));
        }
        [jt](e) {
            return oTe(e) && this.error === e.error && Lt(this.quantiles, e.quantiles) && this.count === e.count && this.min === e.min && this.max === e.max && this.sum === e.sum;
        }
        pipe() {
            return xt(this, arguments);
        }
    }
    const Jke = (t)=>new Kke(t), Yke = (t)=>new $ke(t), Qke = (t)=>new Xke(t), eTe = (t)=>new Gke(t.buckets, t.count, t.min, t.max, t.sum), tTe = (t)=>new Zke(t.error, t.quantiles, t.count, t.min, t.max, t.sum), nTe = (t)=>Vt(t, Mk), rTe = (t)=>Vt(t, Rk), sTe = (t)=>Vt(t, Nk), iTe = (t)=>Vt(t, Vk), oTe = (t)=>Vt(t, Bk), aTe = "effect/MetricHook", cTe = Symbol.for(aTe), lTe = {
        _In: (t)=>t,
        _Out: (t)=>t
    }, F1 = (t)=>({
            [cTe]: lTe,
            pipe () {
                return xt(this, arguments);
            },
            ...t
        }), cV = BigInt(0), uTe = (t)=>{
        let e = t.keyType.bigint ? cV : 0;
        const n = t.keyType.incremental ? t.keyType.bigint ? (s)=>s >= cV : (s)=>s >= 0 : (s)=>!0, r = (s)=>{
            n(s) && (e = e + s);
        };
        return F1({
            get: ()=>Jke(e),
            update: r,
            modify: r
        });
    }, dTe = (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 F1({
            get: ()=>Yke(e),
            update: n,
            modify: n
        });
    }, fTe = (t, e)=>{
        let n = e;
        return F1({
            get: ()=>Qke(n),
            update: (r)=>{
                n = r;
            },
            modify: (r)=>{
                n = n + r;
            }
        });
    }, hTe = (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, K0(W0), Rs((d, f)=>{
            s[f] = d;
        }));
        const l = (d)=>{
            let f = 0, p = n;
            for(; f !== p;){
                const h = Math.floor(f + (p - f) / 2), b = s[h];
                d <= b ? 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 = zv(n);
            let f = 0;
            for(let p = 0; p < n; p++){
                const h = s[p], b = r[p];
                f = f + b, d[p] = [
                    h,
                    f
                ];
            }
            return d;
        };
        return F1({
            get: ()=>eTe({
                    buckets: u(),
                    count: i,
                    min: a,
                    max: c,
                    sum: o
                }),
            update: l,
            modify: l
        });
    }, pTe = (t)=>{
        const { error: e, maxAge: n, maxSize: r, quantiles: s } = t.keyType, i = V(s, K0(W0)), o = zv(r);
        let a = 0, c = 0, l = 0, u = 0, d = 0;
        const f = (h)=>{
            const b = [];
            let y = 0;
            for(; y !== r - 1;){
                const _ = o[y];
                if (_ != null) {
                    const [v, w] = _, E = as(h - v);
                    hK(E, Ih) && R3e(E, n) && b.push(w);
                }
                y = y + 1;
            }
            return gTe(e, i, K0(b, W0));
        }, p = (h, b)=>{
            if (r > 0) {
                a = a + 1;
                const y = a % r;
                o[y] = [
                    b,
                    h
                ];
            }
            u = c === 0 ? h : Math.min(u, h), d = c === 0 ? h : Math.max(d, h), c = c + 1, l = l + h;
        };
        return F1({
            get: ()=>tTe({
                    error: e,
                    quantiles: f(Date.now()),
                    count: c,
                    min: u,
                    max: d,
                    sum: l
                }),
            update: ([h, b])=>p(h, b),
            modify: ([h, b])=>p(h, b)
        });
    }, gTe = (t, e, n)=>{
        const r = n.length;
        if (!Rr(e)) return Jl();
        const s = e[0], i = e.slice(1), o = lV(t, r, Ve(), 0, s, n), a = Ho(o);
        return i.forEach((c)=>{
            a.push(lV(t, r, o.value, o.consumed, c, o.rest));
        }), Rs(a, (c)=>[
                c.quantile,
                c.value
            ]);
    }, lV = (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, b = r, y = s, _ = i;
        for(;;){
            if (!Rr(d)) return {
                quantile: u,
                value: Ve(),
                consumed: l,
                rest: []
            };
            if (u === 1) return {
                quantile: u,
                value: Fe(pq(d)),
                consumed: l + d.length,
                rest: []
            };
            const v = vi(d), w = pxe(d, (K)=>K === v), E = u * a, I = o / 2 * E, D = l + w[0].length, U = Math.abs(D - E);
            if (D < E - I) {
                f = o, p = a, h = Mm(d), b = D, y = u, _ = w[1], o = f, a = p, c = h, l = b, u = y, d = _;
                continue;
            }
            if (D > E + I) {
                const K = Zr(c) ? Fe(v) : c;
                return {
                    quantile: u,
                    value: K,
                    consumed: l,
                    rest: d
                };
            }
            switch(c._tag){
                case "None":
                    {
                        f = o, p = a, h = Mm(d), b = D, y = u, _ = w[1], o = f, a = p, c = h, l = b, u = y, d = _;
                        continue;
                    }
                case "Some":
                    {
                        const K = Math.abs(E - c.value);
                        if (U < K) {
                            f = o, p = a, h = Mm(d), b = D, y = u, _ = w[1], o = f, a = p, c = h, l = b, u = y, d = _;
                            continue;
                        }
                        return {
                            quantile: u,
                            value: Fe(c.value),
                            consumed: l,
                            rest: d
                        };
                    }
            }
        }
        throw new Error("BUG: MetricHook.resolveQuantiles - please report an issue at https://github.com/Effect-TS/effect/issues");
    }, bTe = "effect/MetricPair", mTe = Symbol.for(bTe), yTe = {
        _Type: (t)=>t
    }, wTe = (t, e)=>({
            [mTe]: yTe,
            metricKey: t,
            metricState: e,
            pipe () {
                return xt(this, arguments);
            }
        }), _Te = "effect/MetricRegistry", uV = Symbol.for(_Te);
    class xTe {
        [uV] = uV;
        map = GSe();
        snapshot() {
            const e = [];
            for (const [n, r] of this.map)e.push(wTe(n, r.get()));
            return e;
        }
        get(e) {
            const n = V(this.map, Cf(e), gc);
            if (n == null) {
                if (N$(e.keyType)) return this.getCounter(e);
                if (Vke(e.keyType)) return this.getGauge(e);
                if (Nke(e.keyType)) return this.getFrequency(e);
                if (V$(e.keyType)) return this.getHistogram(e);
                if (Bke(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, Cf(e), gc);
            if (n == null) {
                const r = uTe(e);
                V(this.map, Vb(e)) || V(this.map, Bb(e, r)), n = r;
            }
            return n;
        }
        getFrequency(e) {
            let n = V(this.map, Cf(e), gc);
            if (n == null) {
                const r = dTe(e);
                V(this.map, Vb(e)) || V(this.map, Bb(e, r)), n = r;
            }
            return n;
        }
        getGauge(e) {
            let n = V(this.map, Cf(e), gc);
            if (n == null) {
                const r = fTe(e, e.keyType.bigint ? BigInt(0) : 0);
                V(this.map, Vb(e)) || V(this.map, Bb(e, r)), n = r;
            }
            return n;
        }
        getHistogram(e) {
            let n = V(this.map, Cf(e), gc);
            if (n == null) {
                const r = hTe(e);
                V(this.map, Vb(e)) || V(this.map, Bb(e, r)), n = r;
            }
            return n;
        }
        getSummary(e) {
            let n = V(this.map, Cf(e), gc);
            if (n == null) {
                const r = pTe(e);
                V(this.map, Vb(e)) || V(this.map, Bb(e, r)), n = r;
            }
            return n;
        }
    }
    const vTe = ()=>new xTe, STe = "effect/Metric", kTe = Symbol.for(STe), TTe = {
        _Type: (t)=>t,
        _In: (t)=>t,
        _Out: (t)=>t
    }, dV = qt(Symbol.for("effect/Metric/globalMetricRegistry"), ()=>vTe()), H$ = function(t, e, n, r) {
        const s = Object.assign((i)=>cg(i, (o)=>ATe(s, o)), {
            [kTe]: TTe,
            keyType: t,
            unsafeUpdate: e,
            unsafeValue: n,
            unsafeModify: r,
            register () {
                return this.unsafeValue([]), this;
            },
            pipe () {
                return xt(this, arguments);
            }
        });
        return s;
    }, E3 = (t, e)=>j$(Uke(t, e)), j$ = (t)=>{
        let e;
        const n = new WeakMap, r = (s)=>{
            if (s.length === 0) return e !== void 0 || (e = dV.get(t)), e;
            let i = n.get(s);
            return i !== void 0 || (i = dV.get(jke(t, s)), n.set(s, i)), i;
        };
        return H$(t.keyType, (s, i)=>r(i).update(s), (s)=>r(s).get(), (s, i)=>r(i).modify(s));
    }, ETe = (t, e, n)=>j$(Hke(t, e, n)), CTe = j(3, (t, e, n)=>ITe(t, [
            O7e(e, n)
        ])), ITe = j(2, (t, e)=>H$(t.keyType, (n, r)=>t.unsafeUpdate(n, H_(e, r)), (n)=>t.unsafeValue(H_(e, n)), (n, r)=>t.unsafeModify(n, H_(e, r)))), ATe = j(2, (t, e)=>M1(fk, (n)=>Ue(()=>t.unsafeUpdate(e, n))));
    ({
        ...f1
    });
    const PTe = j(2, (t, e)=>M1(I$, (n)=>Ue(()=>{
                if (n.has(t)) {
                    const r = n.get(t);
                    r.state.completed || (r.state.completed = !0, y3(r.result, e));
                }
            }))), OTe = "effect/Supervisor", C3 = Symbol.for(OTe), kI = {
        _T: (t)=>t
    };
    class I3 {
        underlying;
        value0;
        [C3] = kI;
        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 I3(this, V(this.value, kt(e)));
        }
        zip(e) {
            return new A3(this, e);
        }
    }
    class A3 {
        left;
        right;
        _tag = "Zip";
        [C3] = kI;
        constructor(e, n){
            this.left = e, this.right = n;
        }
        get value() {
            return u3(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 I3(this, V(this.value, kt(e)));
        }
        zip(e) {
            return new A3(this, e);
        }
    }
    const q$ = (t)=>Vt(t, C3) && FE(t, "Zip");
    class MTe {
        effect;
        [C3] = kI;
        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 I3(this, V(this.value, kt(e)));
        }
        zip(e) {
            return new A3(this, e);
        }
        onRun(e, n) {
            return e();
        }
    }
    const RTe = (t)=>new MTe(t), P3 = qt("effect/Supervisor/none", ()=>RTe(mn)), NTe = qg, K$ = "Empty", W$ = "AddSupervisor", $$ = "RemoveSupervisor", X$ = "AndThen", Vm = {
        _tag: K$
    }, $_ = (t, e)=>({
            _tag: X$,
            first: t,
            second: e
        }), VTe = (t, e)=>BTe(e, Pn(t)), BTe = (t, e)=>{
        let n = t, r = e;
        for(; oa(r);){
            const s = vc(r);
            switch(s._tag){
                case K$:
                    {
                        r = Il(r);
                        break;
                    }
                case W$:
                    {
                        n = n.zip(s.supervisor), r = Il(r);
                        break;
                    }
                case $$:
                    {
                        n = Dk(n, s.supervisor), r = Il(r);
                        break;
                    }
                case X$:
                    {
                        r = Vs(s.first)(Vs(s.second)(Il(r)));
                        break;
                    }
            }
        }
        return n;
    }, Dk = (t, e)=>Lt(t, e) ? P3 : q$(t) ? Dk(t.left, e).zip(Dk(t.right, e)) : t, gx = (t)=>Lt(t, P3) ? Ph() : q$(t) ? V(gx(t.left), fy(gx(t.right))) : TC(t), DTe = (t, e)=>{
        if (Lt(t, e)) return Vm;
        const n = gx(t), r = gx(e), s = V(r, fN(n), hy(Vm, (o, a)=>$_(o, {
                _tag: W$,
                supervisor: a
            }))), i = V(n, fN(r), hy(Vm, (o, a)=>$_(o, {
                _tag: $$,
                supervisor: a
            })));
        return $_(s, i);
    }, FTe = NTe({
        empty: Vm,
        patch: VTe,
        combine: $_,
        diff: DTe
    }), LTe = E3("effect_fiber_started", {
        incremental: !0
    }), fV = E3("effect_fiber_active"), zTe = E3("effect_fiber_successes", {
        incremental: !0
    }), UTe = E3("effect_fiber_failures", {
        incremental: !0
    }), HTe = CTe(ETe("effect_fiber_lifetimes", vke({
        start: .5,
        factor: 2,
        count: 35
    })), "time_unit", "milliseconds"), Db = "Continue", jTe = "Done", hV = "Yield", qTe = {
        _E: (t)=>t,
        _A: (t)=>t
    }, Qw = (t)=>{
        throw new Error(`BUG: FiberRuntime - ${j0(t)} - please report an issue at https://github.com/Effect-TS/effect/issues`);
    }, il = Symbol.for("effect/internal/fiberRuntime/YieldedOp"), ol = qt("effect/internal/fiberRuntime/yieldedOpChannel", ()=>({
            currentOp: null
        })), Fb = {
        [U2]: (t, e, n)=>Us(()=>e.effect_instruction_i1(n)),
        OnStep: (t, e, n)=>Ir(Ir(n)),
        [H2]: (t, e, n)=>Us(()=>e.effect_instruction_i2(n)),
        [jE]: (t, e, n)=>(t.patchRuntimeFlags(t.currentRuntimeFlags, e.patch), Qu(t.currentRuntimeFlags) && t.isInterrupted() ? zn(t.getInterruptedCause()) : Ir(n)),
        [j2]: (t, e, n)=>(Us(()=>e.effect_instruction_i2(n)), Us(()=>e.effect_instruction_i0()) ? (t.pushStack(e), Us(()=>e.effect_instruction_i1())) : mn),
        [Pm]: (t, e, n)=>{
            for(;;){
                const r = Us(()=>e.effect_instruction_i0.next(n));
                if (r.done) return Ir(r.value);
                const s = jj(r.value);
                if (p3(s)) {
                    if (s._tag === "Failure") return s;
                } else return t.pushStack(e), s;
                n = s.value;
            }
        }
    }, KTe = {
        [yI]: (t, e, n, r)=>(t.processNewInterruptSignal(r.cause), Qu(e) ? zn(r.cause) : n),
        [_I]: (t, e, n, r)=>{
            throw new Error("It is illegal to have multiple concurrent run loops in a single fiber");
        },
        [wI]: (t, e, n, r)=>(r.onFiber(t, m$(e)), n),
        [xI]: (t, e, n, r)=>Te(l3(), ()=>n)
    }, WTe = (t)=>a3(n8e(t), (e)=>Na(b8e(e), ([n, r])=>{
                const s = new Map, i = [];
                for (const a of r){
                    i.push(wo(a));
                    for (const c of a)s.set(c.request, c);
                }
                const o = i.flat();
                return Jg(pEe(n.runAll(i), o, ()=>o.forEach((a)=>{
                        a.listeners.interrupted = !0;
                    })), I$, s);
            }, !1, !1)), $Te = qE();
    class G$ extends Kc {
        [ike] = oke;
        [cke] = qTe;
        _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, xN(r)) {
                const s = this.getFiberRef(fk);
                LTe.unsafeUpdate(1, s), fV.unsafeUpdate(1, s);
            }
            this.refreshRefCache();
        }
        commit() {
            return vy(this);
        }
        id() {
            return this._fiberId;
        }
        resume(e) {
            this.tell(Rp(e));
        }
        get status() {
            return this.ask((e, n)=>n);
        }
        get runtimeFlags() {
            return this.ask((e, n)=>S6e(n) ? e.currentRuntimeFlags : n.runtimeFlags);
        }
        scope() {
            return rke(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(Jw);
        }
        fiberRefs() {
            return this.ask((e)=>e.getFiberRefs());
        }
        ask(e) {
            return Ct(()=>{
                const n = tb(this._fiberId);
                return this.tell(W_((r, s)=>{
                    y3(n, Ue(()=>e(r, s)));
                })), aa(n);
            });
        }
        tell(e) {
            this._queue.push(e), this._running || (this._running = !0, this.drainQueueLaterOnExecutor());
        }
        get await() {
            return Da((e)=>{
                const n = (r)=>e(ze(r));
                if (this._exitValue !== null) {
                    n(this._exitValue);
                    return;
                }
                return this.tell(W_((r, s)=>{
                    r._exitValue !== null ? n(this._exitValue) : r.addObserver(n);
                })), Ue(()=>this.tell(W_((r, s)=>{
                        r.removeObserver(n);
                    })));
            }, this.id());
        }
        get inheritAll() {
            return dn((e, n)=>{
                const r = e.id(), s = e.getFiberRefs(), i = n.runtimeFlags, o = this.getFiberRefs(), a = l7e(s, r, o);
                e.setFiberRefs(a);
                const c = e.getFiberRef(mV), l = V(fd(i, c), SN(rp), SN(ck));
                return dW(l);
            });
        }
        get poll() {
            return Ue(()=>Yh(this._exitValue));
        }
        unsafePoll() {
            return this._exitValue;
        }
        interruptAsFork(e) {
            return Ue(()=>this.tell(iS($o(e))));
        }
        unsafeInterruptAsFork(e) {
            this.tell(iS($o(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(mV, this.currentRuntimeFlags), this._fiberRefs;
        }
        unsafeDeleteFiberRef(e) {
            this._fiberRefs = KW(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 = _k(this._fiberRefs, {
                fiberId: this._fiberId,
                fiberRef: e,
                value: n
            }), this.refreshRefCache();
        }
        refreshRefCache() {
            this.currentDefaultServices = this.getFiberRef(Vh), this.currentTracer = this.currentDefaultServices.unsafeMap.get(nI.key), this.currentSupervisor = this.getFiberRef(hEe), this.currentScheduler = this.getFiberRef(mI), this.currentContext = this.getFiberRef(fa), this.currentSpan = this.currentContext.unsafeMap.get(S3.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 = Db;
                const r = globalThis[bf];
                globalThis[bf] = this;
                try {
                    for(; n === Db;)n = this._queue.length === 0 ? jTe : this.evaluateMessageWhileSuspended(this._queue.splice(0, 1)[0]);
                } finally{
                    this._running = !1, globalThis[bf] = r;
                }
                this._queue.length > 0 && !this._running ? (this._running = !0, n === hV ? (this.drainQueueLaterOnExecutor(), e = !1) : e = !0) : e = !1;
            }
        }
        drainQueueLaterOnExecutor() {
            this.currentScheduler.scheduleTask(this.run, this.getFiberRef(Qg), this);
        }
        drainQueueWhileRunning(e, n) {
            let r = n;
            for(; this._queue.length > 0;){
                const s = this._queue.splice(0, 1)[0];
                r = KTe[s._tag](this, e, r, s);
            }
            return r;
        }
        isInterrupted() {
            return !_8e(this.getFiberRef(Jw));
        }
        addInterruptedCause(e) {
            const n = this.getFiberRef(Jw);
            this.setFiberRef(Jw, vs(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(iS($o(this.id()))), e = !0;
            return e;
        }
        interruptAllChildren() {
            if (this.sendInterruptSignalToAllChildren()) {
                const e = this._children.values();
                this._children = null;
                let n = !1;
                return HC({
                    while: ()=>!n,
                    body: ()=>{
                        const s = e.next();
                        return s.done ? Ue(()=>{
                            n = !0;
                        }) : Pi(s.value.await);
                    },
                    step: ()=>{}
                });
            }
            return null;
        }
        reportExitValue(e) {
            if (xN(this.currentRuntimeFlags)) {
                const n = this.getFiberRef(fk), r = this.id().startTimeMillis, s = Date.now();
                switch(HTe.unsafeUpdate(s - r, n), fV.unsafeUpdate(-1, n), e._tag){
                    case Ms:
                        {
                            zTe.unsafeUpdate(1, n);
                            break;
                        }
                    case Os:
                        {
                            UTe.unsafeUpdate(1, n);
                            break;
                        }
                }
            }
            if (e._tag === "Failure") {
                const n = this.getFiberRef(gSe);
                !i3(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(YTe);
        }
        log(e, n, r) {
            const s = nr(r) ? r.value : this.getFiberRef(uSe), i = this.getFiberRef(XTe);
            if (x7e(i, s)) return;
            const o = this.getFiberRef(dSe), a = this.getFiberRef(lSe), c = this.getLoggers(), l = this.getFiberRefs();
            if (i0(c) > 0) {
                const u = Ec(this.getFiberRef(Vh), rb), d = new Date(u.unsafeCurrentTimeMillis());
                d2e(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 xI:
                    return hV;
                case yI:
                    return this.processNewInterruptSignal(e.cause), this._asyncInterruptor !== null && (this._asyncInterruptor(zn(e.cause)), this._asyncInterruptor = null), Db;
                case _I:
                    return this._asyncInterruptor = null, this._asyncBlockingOn = null, this.evaluateEffect(e.effect), Db;
                case wI:
                    return e.onFiber(this, this._exitValue !== null ? x6e : v6e(this.currentRuntimeFlags, this._asyncBlockingOn)), Db;
                default:
                    return Qw(e);
            }
        }
        evaluateEffect(e) {
            this.currentSupervisor.onResume(this);
            try {
                let n = Qu(this.currentRuntimeFlags) && this.isInterrupted() ? zn(this.getInterruptedCause()) : e;
                for(; n !== null;){
                    const r = n, s = this.runLoop(r);
                    if (s === il) {
                        const i = ol.currentOp;
                        ol.currentOp = null, i._op === U_ ? Z9e(this.currentRuntimeFlags) ? (this.tell(Q6e()), this.tell(Rp(ni)), n = null) : n = ni : i._op === Am && (n = null);
                    } else {
                        this.currentRuntimeFlags = V(this.currentRuntimeFlags, Y9e(ck));
                        const i = this.interruptAllChildren();
                        i !== null ? n = Te(i, ()=>s) : (this._queue.length === 0 ? this.setExitValue(s) : this.tell(Rp(s)), n = null);
                    }
                }
            } finally{
                this.currentSupervisor.onSuspend(this);
            }
        }
        start(e) {
            if (this._running) this.tell(Rp(e));
            else {
                this._running = !0;
                const n = globalThis[bf];
                globalThis[bf] = this;
                try {
                    this.evaluateEffect(e);
                } finally{
                    this._running = !1, globalThis[bf] = n, this._queue.length > 0 && this.drainQueueLaterOnExecutor();
                }
            }
        }
        startFork(e) {
            this.tell(Rp(e));
        }
        patchRuntimeFlags(e, n) {
            const r = o0(e, n);
            return globalThis[bf] = this, this.currentRuntimeFlags = r, r;
        }
        initiateAsync(e, n) {
            let r = !1;
            const s = (i)=>{
                r || (r = !0, this.tell(Rp(i)));
            };
            Qu(e) && (this._asyncInterruptor = s);
            try {
                n(s);
            } catch (i) {
                s(Sr(ki(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 !== z_) return e;
                e = this.popStack();
            }
        }
        getNextFailCont() {
            let e = this.popStack();
            for(; e;){
                if (e._op !== U2 && e._op !== j2 && e._op !== Pm) return e;
                e = this.popStack();
            }
        }
        [f2e](e) {
            return Ue(()=>nK(this.currentContext, e));
        }
        Left(e) {
            return Cr(e.left);
        }
        None(e) {
            return Cr(new KC);
        }
        Right(e) {
            return Ir(e.right);
        }
        Some(e) {
            return Ir(e.value);
        }
        Micro(e) {
            return by((n)=>{
                let r = n;
                const s = J6e(q6e(e, this.currentContext));
                return s.addObserver((i)=>{
                    if (i._tag === "Success") return r(Ir(i.value));
                    switch(i.cause._tag){
                        case "Interrupt":
                            return r(zn($o(Y0)));
                        case "Fail":
                            return r(Cr(i.cause.error));
                        case "Die":
                            return r(Al(i.cause.defect));
                    }
                }), by((i)=>{
                    r = (o)=>{
                        i(mn);
                    }, s.unsafeInterrupt();
                });
            });
        }
        [Zj](e) {
            const n = Us(()=>e.effect_instruction_i0()), r = this.getNextSuccessCont();
            return r !== void 0 ? (r._op in Fb || Qw(r), Fb[r._op](this, r, n)) : (ol.currentOp = Ir(n), il);
        }
        [Ms](e) {
            const n = e, r = this.getNextSuccessCont();
            return r !== void 0 ? (r._op in Fb || Qw(r), Fb[r._op](this, r, n.effect_instruction_i0)) : (ol.currentOp = n, il);
        }
        [Os](e) {
            const n = e.effect_instruction_i0, r = this.getNextFailCont();
            if (r !== void 0) switch(r._op){
                case z_:
                case H2:
                    return Qu(this.currentRuntimeFlags) && this.isInterrupted() ? zn(kN(n)) : Us(()=>r.effect_instruction_i1(n));
                case "OnStep":
                    return Qu(this.currentRuntimeFlags) && this.isInterrupted() ? zn(kN(n)) : Ir(zn(n));
                case jE:
                    return this.patchRuntimeFlags(this.currentRuntimeFlags, r.patch), Qu(this.currentRuntimeFlags) && this.isInterrupted() ? zn(vs(n, this.getInterruptedCause())) : zn(n);
                default:
                    Qw(r);
            }
            else return ol.currentOp = zn(n), il;
        }
        [Jj](e) {
            return Us(()=>e.effect_instruction_i0(this, m$(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 = _y(i.refs, n), c = fd(i.flags, r);
                return Ir(rW(e.effect_instruction_i0, dn((l)=>{
                    for(; s.length > 0;)l.pushStack(s.pop());
                    return l.setFiberRefs(xy(l.id(), l.getFiberRefs())(a)), l.currentRuntimeFlags = o0(c)(l.currentRuntimeFlags), e.effect_instruction_i1;
                })));
            }
            return Eo((s)=>Te(CI(F8e(e.effect_instruction_i0)), ()=>s(e.effect_instruction_i1)));
        }
        RunBlocked(e) {
            return WTe(e.effect_instruction_i0);
        }
        [Vg](e) {
            const n = e.effect_instruction_i0, r = this.currentRuntimeFlags, s = o0(r, n);
            if (Qu(s) && this.isInterrupted()) return zn(this.getInterruptedCause());
            if (this.patchRuntimeFlags(this.currentRuntimeFlags, n), e.effect_instruction_i1) {
                const i = fd(s, r);
                return this.pushStack(new L8e(i, e)), Us(()=>e.effect_instruction_i1(r));
            } else return ni;
        }
        [U2](e) {
            return this.pushStack(e), e.effect_instruction_i0;
        }
        OnStep(e) {
            return this.pushStack(e), e.effect_instruction_i0;
        }
        [z_](e) {
            return this.pushStack(e), e.effect_instruction_i0;
        }
        [H2](e) {
            return this.pushStack(e), e.effect_instruction_i0;
        }
        [Am](e) {
            return this._asyncBlockingOn = e.effect_instruction_i1, this.initiateAsync(this.currentRuntimeFlags, e.effect_instruction_i0), ol.currentOp = e, il;
        }
        [U_](e) {
            return this._isYielding = !1, ol.currentOp = e, il;
        }
        [j2](e) {
            const n = e.effect_instruction_i0, r = e.effect_instruction_i1;
            return n() ? (this.pushStack(e), r()) : ni;
        }
        [Pm](e) {
            return Fb[Pm](this, e, void 0);
        }
        [Bv](e) {
            return Us(()=>e.commit());
        }
        runLoop(e) {
            let n = e;
            for(this.currentOpCount = 0;;){
                if ((this.currentRuntimeFlags & G9e) !== 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 = Te(l3({
                            priority: r
                        }), ()=>s);
                    }
                }
                try {
                    if (n = this.currentTracer.context(()=>{
                        if ($Te !== n[ig]._V) {
                            const r = this.getFiberRef(bSe);
                            if (r._tag === "Some") {
                                const s = n[ig]._V;
                                this.log(`Executing an Effect versioned ${s} with a Runtime of version ${qE()}, 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`, eu, r);
                            }
                        }
                        return this[n._op](n);
                    }, this), n === il) {
                        const r = ol.currentOp;
                        return r._op === U_ || r._op === Am ? il : (ol.currentOp = null, r._op === Ms || r._op === Os ? r : zn(ki(r)));
                    }
                } catch (r) {
                    n !== il && !Vt(n, "_op") || !(n._op in this) ? n = cW(`Not a valid effect: ${j0(n)}`) : SSe(r) ? n = zn(vs(ki(r), $o(Y0))) : n = Al(r);
                }
            }
        }
        run = ()=>{
            this.drainQueueOnCurrentThread();
        };
    }
    const XTe = qt("effect/FiberRef/currentMinimumLogLevel", ()=>ks(v7e("Info"))), GTe = (t)=>vI((e)=>{
            const n = $W(e.context, Vh);
            Ec(n, tI).unsafe.log(t.log(e));
        }), ZTe = qt(Symbol.for("effect/Logger/defaultLogger"), ()=>GTe(mke)), JTe = qt(Symbol.for("effect/Logger/tracerLogger"), ()=>vI(({ annotations: t, cause: e, context: n, fiberId: r, logLevel: s, message: i })=>{
            const o = lI(ep(yy(n, fa), S3));
            if (o._tag === "None" || o.value._tag === "ExternalSpan") return;
            const a = nK(yy(n, Vh), rb), c = {};
            for (const [l, u] of t)c[l] = u;
            c["effect.fiberId"] = R5e(r), c["effect.logLevel"] = s.label, e !== null && e._tag !== "Empty" && (c["effect.cause"] = Xg(e, {
                renderErrorCause: !0
            })), o.value.event(j0(Array.isArray(i) && i.length === 1 ? i[0] : i), a.unsafeCurrentTimeNanos(), c);
        })), YTe = qt(Symbol.for("effect/FiberRef/currentLoggers"), ()=>oSe(TC(ZTe, JTe))), Z$ = j((t)=>qc(t[0]), (t, e)=>op(cg(t, (n)=>QTe((r)=>e(n, r))))), QTe = (t)=>dn((e)=>{
            const n = e.getFiberRefs(), r = J9e(e.currentRuntimeFlags, rp);
            return Te(Q$, (s)=>sx(s, (i)=>dn((o)=>{
                        const a = o.getFiberRefs(), c = o.currentRuntimeFlags, l = _y(a, n), u = fd(c, r), d = _y(n, a);
                        return o.setFiberRefs(xy(l, o.id(), n)), fg(G8e(t(i), u), Ue(()=>{
                            o.setFiberRefs(xy(d, o.id(), o.getFiberRefs()));
                        }));
                    })));
        }), eEe = (t)=>{
        if (Array.isArray(t) || zj(t)) return [
            t,
            Ve()
        ];
        const e = Object.keys(t), n = e.length;
        return [
            e.map((r)=>t[r]),
            Fe((r)=>{
                const s = {};
                for(let i = 0; i < n; i++)s[e[i]] = r[i];
                return s;
            })
        ];
    }, tEe = (t, e, n)=>{
        const r = [];
        for (const s of t)r.push(ag(s));
        return Te(dg(r, Ft, {
            concurrency: n?.concurrency,
            batching: n?.batching,
            concurrentFinalizers: n?.concurrentFinalizers
        }), (s)=>{
            const i = Ve(), 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] = Fe(d.left), l = !0) : (c[u] = d.right, a[u] = i);
            }
            return l ? e._tag === "Some" ? Cr(e.value(a)) : Cr(a) : n?.discard ? mn : e._tag === "Some" ? ze(e.value(c)) : ze(c);
        });
    }, nEe = (t, e, n)=>{
        const r = [];
        for (const s of t)r.push(ag(s));
        return n?.discard ? dg(r, Ft, {
            concurrency: n?.concurrency,
            batching: n?.batching,
            discard: !0,
            concurrentFinalizers: n?.concurrentFinalizers
        }) : kt(dg(r, Ft, {
            concurrency: n?.concurrency,
            batching: n?.batching,
            concurrentFinalizers: n?.concurrentFinalizers
        }), (s)=>e._tag === "Some" ? e.value(s) : s);
    }, TI = (t, e)=>{
        const [n, r] = eEe(t);
        return e?.mode === "validate" ? tEe(n, r, e) : e?.mode === "either" ? nEe(n, r, e) : e?.discard !== !0 && r._tag === "Some" ? kt(dg(n, Ft, e), r.value) : dg(n, Ft, e);
    }, dg = j((t)=>zj(t[0]), (t, e, n)=>dn((r)=>{
            const s = n?.batching === !0 || n?.batching === "inherit" && r.getFiberRef(pSe);
            return n?.discard ? aV(n.concurrency, ()=>Np(cx, n?.concurrentFinalizers)((i)=>s ? Na(t, (o, a)=>i(e(o, a)), !0, !1, 1) : a3(t, (o, a)=>i(e(o, a)))), ()=>Np(Tk, n?.concurrentFinalizers)((i)=>Na(t, (o, a)=>i(e(o, a)), s, !1)), (i)=>Np(Ek(i), n?.concurrentFinalizers)((o)=>Na(t, (a, c)=>o(e(a, c)), s, !1, i))) : aV(n?.concurrency, ()=>Np(cx, n?.concurrentFinalizers)((i)=>s ? Fk(t, 1, (o, a)=>i(e(o, a)), !0) : Pl(t, (o, a)=>i(e(o, a)))), ()=>Np(Tk, n?.concurrentFinalizers)((i)=>EI(t, (o, a)=>i(e(o, a)), s)), (i)=>Np(Ek(i), n?.concurrentFinalizers)((o)=>Fk(t, i, (a, c)=>o(e(a, c)), s)));
        })), EI = (t, e, n)=>Ct(()=>{
            const r = Un(t), s = new Array(r.length);
            return Ur(Na(r, (o, a)=>Te(e(o, a), (c)=>Ue(()=>s[a] = c)), n, !1), ze(s));
        }), Na = (t, e, n, r, s)=>Eo((i)=>W8e((o)=>dn((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, b = ()=>p.forEach((K)=>{
                            K.currentScheduler.scheduleTask(()=>{
                                K.unsafeInterruptAsFork(a.id());
                            }, 0, K);
                        }), y = new Array, _ = new Array, v = new Array, w = ()=>{
                        const K = h.filter(({ exit: $ })=>$._tag === "Failure").sort(($, ne)=>$.index < ne.index ? -1 : $.index === ne.index ? 0 : 1).map(({ exit: $ })=>$);
                        return K.length === 0 && K.push(ni), K;
                    }, E = (K, $ = !1)=>{
                        const ne = op(o(K)), te = rEe(ne, a, a.currentRuntimeFlags, V1);
                        return a.currentScheduler.scheduleTask(()=>{
                            $ && te.unsafeInterruptAsFork(a.id()), te.resume(ne);
                        }, 0, te), te;
                    }, I = ()=>{
                        r || (l -= c.length, c = []), d = !0, b();
                    }, D = n ? H8e : Cc, U = E(Da((K)=>{
                        const $ = (te, J)=>{
                            te._op === "Blocked" ? v.push(te) : (h.push({
                                index: J,
                                exit: te
                            }), te._op === "Failure" && !d && I());
                        }, ne = ()=>{
                            if (c.length > 0) {
                                const te = c.pop();
                                let J = u++;
                                const C = ()=>{
                                    const R = c.pop();
                                    return J = u++, Te(l3(), ()=>Te(D(i(e(R, J))), g));
                                }, g = (R)=>c.length > 0 && ($(R, J), c.length > 0) ? C() : ze(R), x = Te(D(i(e(te, J))), g), A = E(x);
                                y.push(A), p.add(A), d && A.currentScheduler.scheduleTask(()=>{
                                    A.unsafeInterruptAsFork(a.id());
                                }, 0, A), A.addObserver((R)=>{
                                    let N;
                                    if (R._op === "Failure" ? N = R : N = R.effect_instruction_i0, _.push(A), p.delete(A), $(N, J), h.length === l) K(ze(xr(a0(w(), {
                                        parallel: !0
                                    }), ()=>ni)));
                                    else if (v.length + h.length === l) {
                                        const L = w(), z = v.map((B)=>B.effect_instruction_i0).reduce(qK);
                                        K(ze(rW(z, Na([
                                            xr(a0(L, {
                                                parallel: !0
                                            }), ()=>ni),
                                            ...v.map((B)=>B.effect_instruction_i1)
                                        ], (B)=>B, n, !0, s))));
                                    } else ne();
                                });
                            }
                        };
                        for(let te = 0; te < f; te++)ne();
                    }));
                    return Pi(Pd(Zg(i(vy(U))), g3({
                        onFailure: (K)=>{
                            I();
                            const $ = v.length + 1, ne = Math.min(typeof s == "number" ? s : v.length, v.length), te = Array.from(v);
                            return Da((J)=>{
                                let C = 0, g = 0;
                                const x = (R, N)=>(L)=>{
                                        C++, C === $ && J(Ir(zn(K))), te.length > 0 && N && A();
                                    }, A = ()=>{
                                    E(te.pop(), !0).addObserver(x(g, !0)), g++;
                                };
                                U.addObserver(x(g, !1)), g++;
                                for(let R = 0; R < ne; R++)A();
                            });
                        },
                        onSuccess: ()=>Pl(_, (K)=>K.inheritAll)
                    })));
                }))), Fk = (t, e, n, r)=>Ct(()=>{
            const s = Un(t), i = new Array(s.length);
            return Ur(Na(s, (a, c)=>kt(n(a, c), (l)=>i[c] = l), r, !1, e), ze(i));
        }), CI = (t)=>sEe(t, V1), J$ = (t, e, n, r = null)=>{
        const s = bx(t, e, n, r);
        return s.resume(t), s;
    }, rEe = (t, e, n, r = null)=>bx(t, e, n, r), bx = (t, e, n, r = null)=>{
        const s = AK(), i = e.getFiberRefs(), o = u7e(i, s), a = new G$(s, o, n), c = yy(o, fa), l = a.currentSupervisor;
        return l.onStart(c, t, Fe(e), a), a.addObserver((d)=>l.onEnd(d, a)), (r !== null ? r : V(e.getFiberRef(hk), xr(()=>e.scope()))).add(n, a), a;
    }, sEe = (t, e)=>dn((n, r)=>ze(J$(t, n, r.runtimeFlags, e))), pV = (t)=>ap((e)=>un(ep(e, Fa), {
                onNone: ()=>t,
                onSome: (n)=>{
                    switch(n.strategy._tag){
                        case "Parallel":
                            return t;
                        case "Sequential":
                        case "ParallelN":
                            return Te(kl(n, Tk), (r)=>ob(t, r));
                    }
                }
            })), gV = (t)=>(e)=>ap((n)=>un(ep(n, Fa), {
                    onNone: ()=>e,
                    onSome: (r)=>r.strategy._tag === "ParallelN" && r.strategy.parallelism === t ? e : Te(kl(r, Ek(t)), (s)=>ob(e, s))
                })), Np = (t, e)=>(n)=>ap((r)=>un(ep(r, Fa), {
                    onNone: ()=>n(Ft),
                    onSome: (s)=>{
                        if (e === !0) {
                            const i = t._tag === "Parallel" ? pV : t._tag === "Sequential" ? bV : gV(t.parallelism);
                            switch(s.strategy._tag){
                                case "Parallel":
                                    return i(n(pV));
                                case "Sequential":
                                    return i(n(bV));
                                case "ParallelN":
                                    return i(n(gV(s.strategy.parallelism)));
                            }
                        } else return n(Ft);
                    }
                })), II = (t)=>Te(Fa, t), Y$ = (t)=>Te(ib(), (e)=>Pd(t(e), (n)=>e.close(n))), iEe = (t)=>Te(ib(), (e)=>dEe(t, e)), bV = (t)=>ap((e)=>un(ep(e, Fa), {
                onNone: ()=>t,
                onSome: (n)=>{
                    switch(n.strategy._tag){
                        case "Sequential":
                            return t;
                        case "Parallel":
                        case "ParallelN":
                            return Te(kl(n, cx), (r)=>ob(t, r));
                    }
                }
            })), oEe = j((t)=>qc(t[1]), (t, e, n)=>L1(t, e, (r, s)=>[
                r,
                s
            ], n)), aEe = j((t)=>qc(t[1]), (t, e, n)=>n?.concurrent !== !0 && (n?.batching === void 0 || n.batching === !1) ? d3(t, e) : L1(t, e, (r, s)=>r, n)), cEe = j((t)=>qc(t[1]), (t, e, n)=>n?.concurrent !== !0 && (n?.batching === void 0 || n.batching === !1) ? Ur(t, e) : L1(t, e, (r, s)=>s, n)), L1 = j((t)=>qc(t[1]), (t, e, n, r)=>kt(TI([
            t,
            e
        ], {
            concurrency: r?.concurrent ? 2 : 1,
            batching: r?.batching,
            concurrentFinalizers: r?.concurrentFinalizers
        }), ([s, i])=>n(s, i))), Fa = jc("effect/Scope"), Q$ = Fa, lEe = (t, e)=>{
        t.state._tag === "Open" && t.state.finalizers.set({}, e);
    }, uEe = {
        [AN]: AN,
        [PN]: PN,
        pipe () {
            return xt(this, arguments);
        },
        fork (t) {
            return Ue(()=>{
                const e = eX(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), lEe(e, (s)=>Ue(()=>{
                        this.state._tag === "Open" && this.state.finalizers.delete(n);
                    })), e;
            });
        },
        close (t) {
            return Ct(()=>{
                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 : d6e(this.strategy) ? V(Pl(e, (n)=>Cc(n(t))), Te((n)=>V(a0(n), Tc(nS), xr(()=>ni)))) : f6e(this.strategy) ? V(EI(e, (n)=>Cc(n(t)), !1), Te((n)=>V(a0(n, {
                        parallel: !0
                    }), Tc(nS), xr(()=>ni)))) : V(Fk(e, this.strategy.parallelism, (n)=>Cc(n(t)), !1), Te((n)=>V(a0(n, {
                        parallel: !0
                    }), Tc(nS), xr(()=>ni))));
            });
        },
        addFinalizer (t) {
            return Ct(()=>this.state._tag === "Closed" ? t(this.state.exit) : (this.state.finalizers.set({}, t), mn));
        }
    }, eX = (t = hd)=>{
        const e = Object.create(uEe);
        return e.strategy = t, e.state = {
            _tag: "Open",
            finalizers: new Map
        }, e;
    }, ib = (t = hd)=>Ue(()=>eX(t)), ob = j(2, (t, e)=>EW(t, Ug(lC(Fa, e)))), dEe = j(2, (t, e)=>V(t, ob(e), Pd((n)=>e.close(n)))), fEe = (t)=>Yg(t, {
            differ: FTe,
            fork: Vm
        }), mV = cSe(Q9e), hEe = fEe(P3), tX = j(3, (t, e, n)=>rX(t, e, {
            onSelfWin: (r, s)=>Te(r.await, (i)=>{
                    switch(i._tag){
                        case Ms:
                            return Te(r.inheritAll, ()=>n.onSelfDone(i, s));
                        case Os:
                            return n.onSelfDone(i, s);
                    }
                }),
            onOtherWin: (r, s)=>Te(r.await, (i)=>{
                    switch(i._tag){
                        case Ms:
                            return Te(r.inheritAll, ()=>n.onOtherDone(i, s));
                        case Os:
                            return n.onOtherDone(i, s);
                    }
                })
        })), nX = j(2, (t, e)=>Gg((n)=>tX(t, e, {
                onSelfDone: (r, s)=>bk(r, {
                        onFailure: (i)=>V(vy(s), tV((o)=>tu(i, o))),
                        onSuccess: (i)=>V(s, Ol(n), Ss(i))
                    }),
                onOtherDone: (r, s)=>bk(r, {
                        onFailure: (i)=>V(vy(s), tV((o)=>tu(o, i))),
                        onSuccess: (i)=>V(s, Ol(n), Ss(i))
                    })
            }))), rX = j(3, (t, e, n)=>dn((r, s)=>{
            const i = s.runtimeFlags, o = tp(!0), a = bx(t, r, i, n.selfScope), c = bx(e, r, i, n.otherScope);
            return Da((l)=>{
                a.addObserver(()=>yV(a, c, n.onSelfWin, o, l)), c.addObserver(()=>yV(c, a, n.onOtherWin, o, l)), a.startFork(t), c.startFork(e);
            }, P5e(a.id(), c.id()));
        })), yV = (t, e, n, r, s)=>{
        S5e(!0, !1)(r) && s(n(t, e));
    }, fg = j(2, (t, e)=>Eo((n)=>Ci(n(t), {
                onFailure: (r)=>Ci(e, {
                        onFailure: (s)=>Sr(vs(r, s)),
                        onSuccess: ()=>Sr(r)
                    }),
                onSuccess: (r)=>Ss(e, r)
            }))), pEe = (t, e, n)=>Gg((r)=>Te(Te(CI(P1(t)), (s)=>Da((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" && p3(l.result.state.current.effect) && l.result.state.current.effect._tag === "Failure" && JK(l.result.state.current.effect.cause))) && (c.forEach((l)=>l()), n?.(), i(f3(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(), Ue(()=>{
                        c.forEach((l)=>l());
                    });
                })), ()=>Ct(()=>{
                    const s = e.flatMap((i)=>i.state.completed ? [] : [
                            i
                        ]);
                    return a3(s, (i)=>PTe(i.request, kW(r)));
                }))), AI = Ad, Lk = ki, gEe = $o, bEe = w8e, mEe = ZK, Sy = JK, oS = i3, yEe = OC, z1 = MC, sX = v8e, O3 = QK, iX = wSe, wEe = kSe, _Ee = Xg, xEe = "effect/ScheduleInterval", mx = Symbol.for(xEe), oX = {
        [mx]: mx,
        startMillis: 0,
        endMillis: 0
    }, PI = (t, e)=>t > e ? oX : {
            [mx]: mx,
            startMillis: t,
            endMillis: e
        }, vEe = j(2, (t, e)=>SEe(t, e) === t), SEe = 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), kEe = (t)=>t.startMillis >= t.endMillis, TEe = j(2, (t, e)=>{
        const n = Math.max(t.startMillis, e.startMillis), r = Math.min(t.endMillis, e.endMillis);
        return PI(n, r);
    }), EEe = (t)=>as(t.endMillis - t.startMillis), CEe = (t)=>PI(t, Number.POSITIVE_INFINITY), wV = PI, aX = oX, IEe = vEe, AEe = kEe, PEe = TEe, OEe = EEe, zk = CEe, MEe = "effect/ScheduleIntervals", _V = Symbol.for(MEe), cX = (t)=>({
            [_V]: _V,
            intervals: t
        }), REe = j(2, (t, e)=>NEe(t.intervals, e.intervals, Cn())), NEe = (t, e, n)=>{
        let r = t, s = e, i = n;
        for(; oa(r) && oa(s);){
            const o = V(vc(r), PEe(vc(s))), a = AEe(o) ? i : V(i, Vs(o));
            V(vc(r), IEe(vc(s))) ? r = Il(r) : s = Il(s), i = a;
        }
        return cX(Ql(i));
    }, Uk = (t)=>V(t.intervals, Gv, xr(()=>aX)).startMillis, VEe = (t)=>V(t.intervals, Gv, xr(()=>aX)).endMillis, BEe = j(2, (t, e)=>Uk(t) < Uk(e)), DEe = (t)=>oa(t.intervals), FEe = cX, LEe = REe, Hk = Uk, jk = VEe, zEe = BEe, UEe = DEe, OI = "Continue", lX = "Done", HEe = (t)=>({
            _tag: OI,
            intervals: t
        }), jEe = (t)=>({
            _tag: OI,
            intervals: FEe(Pn(t))
        }), qEe = {
        _tag: lX
    }, KEe = (t)=>t._tag === OI, WEe = (t)=>t._tag === lX, $Ee = HEe, yx = jEe, ky = qEe, xV = KEe, Ty = WEe, La = Fa, Ey = xW, XEe = sx, Nd = lg, GEe = ob, uX = kl, hg = ib;
    class ZEe {
        permits;
        waiters = new Set;
        taken = 0;
        constructor(e){
            this.permits = e;
        }
        get free() {
            return this.permits - this.taken;
        }
        take = (e)=>VC((n)=>{
                if (this.free < e) {
                    const r = ()=>{
                        this.free < e || (this.waiters.delete(r), n(Ct(()=>this.free < e ? this.take(e) : (this.taken += e, ze(e)))));
                    };
                    return this.waiters.add(r), Ue(()=>{
                        this.waiters.delete(r);
                    });
                }
                n(Ct(()=>this.free < e ? this.take(e) : (this.taken += e, ze(e))));
            });
        updateTakenUnsafe(e, n) {
            return this.taken = n(this.taken), this.waiters.size > 0 && e.getFiberRef(mI).scheduleTask(()=>{
                const r = this.waiters.values();
                let s = r.next();
                for(; s.done === !1 && this.free > 0;)s.value(), s = r.next();
            }, e.getFiberRef(Qg), e), ze(this.free);
        }
        updateTaken(e) {
            return dn((n)=>this.updateTakenUnsafe(n, e));
        }
        resize = (e)=>Pi(dn((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)=>Te(r(this.take(e)), (s)=>fg(r(n), this.release(s))));
        withPermitsIfAvailable = (e)=>(n)=>Eo((r)=>Ct(()=>this.free < e ? J7e : (this.taken += e, fg(r(R7e(n)), this.release(e)))));
    }
    const MI = (t)=>new ZEe(t), JEe = (t)=>Ue(()=>MI(t));
    class YEe extends Kc {
        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(Qg), e)), mn;
        }
        flushWaiters = ()=>{
            this.scheduled = !1;
            const e = this.waiters;
            this.waiters = [];
            for(let n = 0; n < e.length; n++)e[n](ni);
        };
        open = dn((e)=>this.isOpen ? mn : (this.isOpen = !0, this.unsafeSchedule(e)));
        unsafeOpen() {
            this.isOpen || (this.isOpen = !0, this.flushWaiters());
        }
        release = dn((e)=>this.isOpen ? mn : this.unsafeSchedule(e));
        await = VC((e)=>this.isOpen ? e(mn) : (this.waiters.push(e), Ue(()=>{
                const n = this.waiters.indexOf(e);
                n !== -1 && this.waiters.splice(n, 1);
            })));
        unsafeClose() {
            this.isOpen = !1;
        }
        close = Ue(()=>{
            this.isOpen = !1;
        });
        whenOpen = (e)=>Ur(this.await, e);
    }
    const QEe = (t)=>new YEe(t ?? !1), RI = j(2, (t, e)=>dn((n, r)=>{
            const s = e, i = J$(t, n, r.runtimeFlags, V1);
            if (s.state._tag === "Open") {
                const o = ()=>Gg((c)=>Lt(c, i.id()) ? mn : Pi(f3(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 ze(i);
        })), eCe = (t)=>II((e)=>RI(t, e)), tCe = j(2, (t, e)=>V(Cc(t), nX(Cc(e)), (n)=>Zg(n))), nCe = j(2, (t, e)=>rCe(t, {
            onTimeout: ()=>CSe(e),
            duration: e
        })), rCe = j(2, (t, { duration: e, onTimeout: n })=>Zg(sCe(t, {
            onTimeout: ()=>I1(n),
            onSuccess: ze,
            duration: e
        }))), sCe = j(2, (t, { duration: e, onSuccess: n, onTimeout: r })=>Gg((s)=>Eo((i)=>rX(i(t), P1(cI(e)), {
                    onSelfWin: (o, a)=>Te(o.await, (c)=>c._tag === "Success" ? Te(o.inheritAll, ()=>Ss(Ol(a, s), n(c.value))) : Te(Ol(a, s), ()=>zn(c.cause))),
                    onOtherWin: (o, a)=>Te(o.await, (c)=>c._tag === "Success" ? Te(o.inheritAll, ()=>Ss(Ol(a, s), r())) : Te(Ol(a, s), ()=>zn(c.cause))),
                    otherScope: V1
                })))), iCe = "effect/Ref/SynchronizedRef", dX = Symbol.for(iCe), fX = {
        _A: (t)=>t
    };
    class oCe extends Kc {
        ref;
        withLock;
        [dX] = fX;
        [rI] = sI;
        [Rd] = Rd;
        constructor(e, n){
            super(), this.ref = e, this.withLock = n, this.get = _o(this.ref);
        }
        get;
        commit() {
            return this.get;
        }
        modify(e) {
            return this.modifyEffect((n)=>ze(e(n)));
        }
        modifyEffect(e) {
            return this.withLock(V(Te(_o(this.ref), e), Te(([n, r])=>Ss(ih(this.ref, r), n))));
        }
    }
    const hX = (t)=>Ue(()=>pX(t)), pX = (t)=>{
        const e = iI(t), n = MI(1);
        return new oCe(e, n.withPermits(1));
    }, aCe = Symbol.for("effect/ManagedRuntime"), cCe = "Fold", lCe = "Fresh", uCe = "FromEffect", dCe = "Scoped", fCe = "Suspend", hCe = "MergeAll", pCe = "ZipWith", gX = lke, vV = uke, Ac = f3, gCe = Ol, Nf = vy, U1 = (t)=>function() {
            if (arguments.length === 1) {
                const e = arguments[0];
                return (n, ...r)=>t(e, n, ...r);
            }
            return t.apply(this, arguments);
        }, M3 = U1((t, e, n)=>{
        const r = AK(), s = [
            [
                fa,
                [
                    [
                        r,
                        t.context
                    ]
                ]
            ]
        ];
        n?.scheduler && s.push([
            mI,
            [
                [
                    r,
                    n.scheduler
                ]
            ]
        ]);
        let i = f7e(t.fiberRefs, {
            entries: s,
            forkAs: r
        });
        n?.updateRefs && (i = n.updateRefs(i, r));
        const o = new G$(r, i, t.runtimeFlags);
        let a = e;
        n?.scope && (a = Te(uX(n.scope, hd), (l)=>Ur(xW(l, Gg((u)=>Lt(u, o.id()) ? mn : Ol(o, u))), Pd(e, (u)=>Nd(l, u)))));
        const c = o.currentSupervisor;
        return c !== P3 && (c.onStart(t.context, a, Ve(), o), o.addObserver((l)=>c.onEnd(l, o))), V1.add(t.runtimeFlags, o), n?.immediate === !1 ? o.resume(a) : o.start(a), o;
    }), bCe = U1((t, e)=>{
        const n = _Ce(t)(e);
        if (n._tag === "Failure") throw bX(n.effect_instruction_i0);
        return n.effect_instruction_i0;
    });
    class mCe 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 yCe = (t)=>{
        const e = Error.stackTraceLimit;
        Error.stackTraceLimit = 0;
        const n = new mCe(t);
        return Error.stackTraceLimit = e, n;
    }, aS = Symbol.for("effect/Runtime/FiberFailure"), e_ = Symbol.for("effect/Runtime/FiberFailure/Cause");
    class wCe extends Error {
        [aS];
        [e_];
        constructor(e){
            const n = tW(e)[0];
            super(n?.message || "An error has occurred"), this[aS] = aS, this[e_] = e, this.name = n ? `(FiberFailure) ${n.name}` : "FiberFailure", n?.stack && (this.stack = n.stack);
        }
        toJSON() {
            return {
                _id: "FiberFailure",
                cause: this[e_].toJSON()
            };
        }
        toString() {
            return "(FiberFailure) " + Xg(this[e_], {
                renderErrorCause: !0
            });
        }
        [Rn]() {
            return this.toString();
        }
    }
    const bX = (t)=>{
        const e = Error.stackTraceLimit;
        Error.stackTraceLimit = 0;
        const n = new wCe(t);
        return Error.stackTraceLimit = e, n;
    }, mX = (t)=>{
        const e = t;
        switch(e._op){
            case "Failure":
            case "Success":
                return e;
            case "Left":
                return gk(e.left);
            case "Right":
                return Ir(e.right);
            case "Some":
                return Ir(e.value);
            case "None":
                return gk(new KC);
        }
    }, _Ce = U1((t, e)=>{
        const n = mX(e);
        if (n) return n;
        const r = new C$, s = M3(t)(e, {
            scheduler: r
        });
        r.flush();
        const i = s.unsafePoll();
        return i || SW(DC(yCe(s), XC(s)));
    }), xCe = U1((t, e, n)=>yX(t, e, n).then((r)=>{
            switch(r._tag){
                case Ms:
                    return r.effect_instruction_i0;
                case Os:
                    throw bX(r.effect_instruction_i0);
            }
        })), yX = U1((t, e, n)=>new Promise((r)=>{
            const s = mX(e);
            s && r(s);
            const i = M3(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 wX {
        context;
        runtimeFlags;
        fiberRefs;
        constructor(e, n, r){
            this.context = e, this.runtimeFlags = n, this.fiberRefs = r;
        }
        pipe() {
            return xt(this, arguments);
        }
    }
    const vCe = (t)=>new wX(t.context, t.runtimeFlags, t.fiberRefs), SCe = ()=>dn((t, e)=>ze(new wX(t.getFiberRef(fa), e.runtimeFlags, t.getFiberRefs()))), kCe = HK(rp, zK, LK), Cy = vCe({
        context: uy(),
        runtimeFlags: kCe,
        fiberRefs: h7e()
    }), TCe = M3(Cy), ECe = xCe(Cy), CCe = bCe(Cy), ICe = j(2, (t, e)=>t.modifyEffect(e)), ACe = j(2, (t, e)=>t.modifyEffect((n)=>kt(e(n), (r)=>[
                    void 0,
                    r
                ]))), PCe = "effect/Layer", _X = Symbol.for(PCe), OCe = {
        _RIn: (t)=>t,
        _E: (t)=>t,
        _ROut: (t)=>t
    }, ab = {
        [_X]: OCe,
        pipe () {
            return xt(this, arguments);
        }
    }, MCe = "effect/Layer/MemoMap", cS = Symbol.for(MCe), RCe = Hg()("effect/Layer/CurrentMemoMap", {
        defaultValue: ()=>DCe()
    }), NCe = (t)=>Vt(t, _X), VCe = (t)=>t._op_layer === lCe;
    class xX {
        ref;
        [cS];
        constructor(e){
            this.ref = e, this[cS] = cS;
        }
        getOrElseMemoize(e, n) {
            return V(ICe(this.ref, (r)=>{
                const s = r.get(e);
                if (s !== void 0) {
                    const [i, o] = s, a = V(i, Te(([c, l])=>V(f$(c), Ss(l))), Pd(g3({
                        onFailure: ()=>mn,
                        onSuccess: ()=>sx(n, o)
                    })));
                    return ze([
                        a,
                        r
                    ]);
                }
                return V(ox(0), Te((i)=>V(nb(), Te((o)=>V(ox(()=>mn), kt((a)=>{
                            const c = Eo((u)=>V(ib(), Te((d)=>V(u(Te(vX(e, d, !0), (f)=>B7e(f(this)))), Cc, Te((f)=>{
                                        switch(f._tag){
                                            case Os:
                                                return V(TW(o, f.effect_instruction_i0), Ur(lg(d, f)), Ur(Sr(f.effect_instruction_i0)));
                                            case Ms:
                                                return V(ih(a, (p)=>V(lg(d, p), O1(JW(i, (h)=>[
                                                            h === 1,
                                                            h - 1
                                                        ])), Pi)), Ur(ax(i, (p)=>p + 1)), Ur(sx(n, (p)=>V(Ue(()=>r.delete(e)), Ur(_o(a)), Te((h)=>h(p))))), Ur(R1(o, f.effect_instruction_i0)), Ss(f.effect_instruction_i0[1]));
                                        }
                                    }))))), l = [
                                V(aa(o), Pd(bk({
                                    onFailure: ()=>mn,
                                    onSuccess: ()=>ax(i, (u)=>u + 1)
                                }))),
                                (u)=>V(_o(a), Te((d)=>d(u)))
                            ];
                            return [
                                c,
                                VCe(e) ? r : r.set(e, l)
                            ];
                        }))))));
            }), Zg);
        }
    }
    const BCe = Ct(()=>kt(hX(new Map), (t)=>new xX(t))), DCe = ()=>new xX(pX(new Map)), NI = j(2, (t, e)=>Te(BCe, (n)=>FCe(t, n, e))), FCe = j(3, (t, e, n)=>Te(vX(t, n), (r)=>aI(r(e), RCe, e))), vX = (t, e, n = !1)=>{
        const r = t;
        switch(r._op_layer){
            case "Locally":
                return Ue(()=>(s)=>r.f(s.getOrElseMemoize(r.self, e)));
            case "ExtendScope":
                return Ue(()=>(s)=>II((i)=>s.getOrElseMemoize(r.layer, i)));
            case "Fold":
                return Ue(()=>(s)=>V(s.getOrElseMemoize(r.layer, e), Ci({
                            onFailure: (i)=>s.getOrElseMemoize(r.failureK(i), e),
                            onSuccess: (i)=>s.getOrElseMemoize(r.successK(i), e)
                        })));
            case "Fresh":
                return Ue(()=>(s)=>V(r.layer, NI(e)));
            case "FromEffect":
                return Ue(n ? ()=>(s)=>r.effect : ()=>(s)=>s.getOrElseMemoize(t, e));
            case "Provide":
                return Ue(()=>(s)=>V(s.getOrElseMemoize(r.first, e), Te((i)=>V(s.getOrElseMemoize(r.second, e), _3(i)))));
            case "Scoped":
                return Ue(n ? ()=>(s)=>ob(r.effect, e) : ()=>(s)=>s.getOrElseMemoize(t, e));
            case "Suspend":
                return Ue(()=>(s)=>s.getOrElseMemoize(r.evaluate(), e));
            case "ProvideMerge":
                return Ue(()=>(s)=>V(s.getOrElseMemoize(r.first, e), hW(s.getOrElseMemoize(r.second, e), r.zipK)));
            case "ZipWith":
                return fW(function*() {
                    const s = yield* kl(e, kk), i = yield* kl(s, hd), o = yield* kl(s, hd);
                    return (a)=>V(a.getOrElseMemoize(r.first, i), L1(a.getOrElseMemoize(r.second, o), r.zipK, {
                            concurrent: !0
                        }));
                });
            case "MergeAll":
                {
                    const s = r.layers;
                    return kt(kl(e, kk), (i)=>(o)=>{
                            const a = new Array(s.length);
                            return kt(Na(s, X8e(function*(c, l) {
                                const u = yield* kl(i, hd), d = yield* o.getOrElseMemoize(c, u);
                                a[l] = d;
                            }), !1, !1), ()=>r3e(...a));
                        });
                }
        }
    }, LCe = j(2, (t, e)=>$Ce(t, {
            onFailure: e,
            onSuccess: YCe
        })), zCe = ()=>H1(w3()), UCe = (t)=>SX(AI(t)), HCe = (t)=>jCe(()=>AI(t())), SX = (t)=>H1(Sr(t)), jCe = (t)=>H1(FC(t)), qCe = j(2, (t, e)=>{
        const n = tK(t), r = n ? t : e;
        return H1(kt(n ? e : t, (i)=>lC(r, i)));
    });
    function H1(t) {
        const e = Object.create(ab);
        return e._op_layer = uCe, e.effect = t, e;
    }
    const KCe = j(2, (t, e)=>LCe(t, (n)=>HCe(()=>e(n)))), WCe = j(2, (t, { onFailure: e, onSuccess: n })=>{
        const r = Object.create(ab);
        return r._op_layer = cCe, r.layer = t, r.failureK = e, r.successK = n, r;
    }), $Ce = j(2, (t, { onFailure: e, onSuccess: n })=>WCe(t, {
            onFailure: (r)=>{
                const s = z1(r);
                switch(s._tag){
                    case "Left":
                        return e(s.left);
                    case "Right":
                        return SX(s.right);
                }
            },
            onSuccess: n
        })), XCe = j(2, (t, e)=>eIe(t, e, (n, r)=>Ug(n, r))), GCe = (...t)=>{
        const e = Object.create(ab);
        return e._op_layer = hCe, e.layers = t, e;
    }, ZCe = j(2, (t, e)=>{
        const n = tK(t), r = n ? t : e;
        return JCe(kt(n ? e : t, (i)=>lC(r, i)));
    }), JCe = (t)=>{
        const e = Object.create(ab);
        return e._op_layer = dCe, e.effect = t, e;
    }, YCe = (t)=>H1(ze(t)), QCe = (t)=>{
        const e = Object.create(ab);
        return e._op_layer = fCe, e.evaluate = t, e;
    }, eIe = j(3, (t, e, n)=>QCe(()=>{
            const r = Object.create(ab);
            return r._op_layer = pCe, r.first = t, r.second = e, r.zipK = n, r;
        })), SV = j(2, (t, e)=>Y$((n)=>Te(NI(e, n), (r)=>$C(t, r)))), kV = j(2, (t, e)=>{
        const n = _y(Cy.fiberRefs, e.fiberRefs), r = fd(Cy.runtimeFlags, e.runtimeFlags);
        return Eo((s)=>dn((i)=>{
                const o = i.getFiberRef(fa), a = i.getFiberRefs(), c = xy(i.id(), a)(n), l = i.currentRuntimeFlags, u = o0(r)(l), d = _y(c, a), f = fd(u, l);
                return i.setFiberRefs(c), i.currentRuntimeFlags = u, fg($C(s(t), Ug(o, e.context)), dn((p)=>(p.setFiberRefs(xy(p.id(), p.getFiberRefs())(d)), p.currentRuntimeFlags = o0(f)(p.currentRuntimeFlags), mn)));
            }));
    }), tIe = j(2, (t, e)=>Array.isArray(e) ? SV(t, GCe(...e)) : NCe(e) ? SV(t, e) : n3e(e) ? $C(t, e) : aCe in e ? Te(e.runtimeEffect, (n)=>kV(t, n)) : kV(t, e)), nIe = (t)=>M1(Vh, (e)=>t(Ec(e, tI))), rIe = (...t)=>nIe((e)=>e.error(...t)), kX = Y5e, sIe = (t)=>iIe(t.slice(0)), iIe = (t)=>Object.setPrototypeOf(t, J5e), oIe = (t)=>(e)=>{
            const n = e === void 0 ? Object.create(f1) : kX(e);
            return n._tag = t, n;
        }, VI = ()=>new Proxy({}, {
            get (t, e, n) {
                return e === "$is" ? FE : e === "$match" ? aIe : oIe(e);
            }
        });
    function aIe() {
        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);
    }
    const TX = (function() {
        const t = Symbol.for("effect/Data/Error/plainArgs");
        return {
            BaseEffectError: class extends qC {
                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 TX {
                _tag = t;
            }
        };
        return e.BaseEffectError.prototype.name = t, e.BaseEffectError;
    }, qk = Symbol.for("effect/DateTime"), EX = {
        [qk]: qk,
        pipe () {
            return xt(this, arguments);
        },
        [Rn] () {
            return this.toString();
        },
        toJSON () {
            return DI(this).toJSON();
        }
    }, cIe = {
        ...EX,
        _tag: "Utc",
        [Zt] () {
            return Jn(this, u1(this.epochMillis));
        },
        [jt] (t) {
            return R3(t) && t._tag === "Utc" && this.epochMillis === t.epochMillis;
        },
        toString () {
            return `DateTime.Utc(${DI(this).toJSON()})`;
        }
    }, lIe = {
        ...EX,
        _tag: "Zoned",
        [Zt] () {
            return V(u1(this.epochMillis), bn(St(this.zone)), Jn(this));
        },
        [jt] (t) {
            return R3(t) && t._tag === "Zoned" && this.epochMillis === t.epochMillis && Lt(this.zone, t.zone);
        },
        toString () {
            return `DateTime.Zoned(${kIe(this)})`;
        }
    }, uIe = (t, e, n)=>{
        const r = Object.create(lIe);
        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;
    }, R3 = (t)=>Vt(t, qk), dIe = (t)=>t._tag === "Utc", fIe = H0((t, e)=>t.epochMillis === e.epochMillis), BI = (t)=>{
        const e = Object.create(cIe);
        return e.epochMillis = t, Object.defineProperty(e, "partsUtc", {
            value: void 0,
            enumerable: !1,
            writable: !0
        }), e;
    }, dm = (t)=>{
        const e = t.getTime();
        if (Number.isNaN(e)) throw new wEe("Invalid date");
        return BI(e);
    }, CX = (t)=>{
        if (R3(t)) return t;
        if (t instanceof Date) return dm(t);
        if (typeof t == "object") {
            const e = new Date(0);
            return _Ie(e, t), dm(e);
        } else if (typeof t == "string" && !hIe(t)) return dm(new Date(t + "Z"));
        return dm(new Date(t));
    }, hIe = (t)=>/Z|[+-]\d{2}$|[+-]\d{2}:?\d{2}$|\]$/.test(t), pIe = uq(CX), gIe = kt(jW, BI), bIe = j(2, (t, e)=>wx(e) - wx(t)), DI = (t)=>new Date(t.epochMillis), FI = (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;
    }, mIe = (t)=>FI(t).getTime() - wx(t), yIe = (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")}`;
    }, wIe = (t)=>yIe(mIe(t)), wx = (t)=>t.epochMillis, _Ie = (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);
    }, xIe = j(2, (t, e)=>{
        const n = e(wx(t));
        return t._tag === "Utc" ? BI(n) : uIe(n, t.zone);
    }), vIe = j(2, (t, e)=>xIe(t, (n)=>n + Si(e))), SIe = (t)=>DI(t).toISOString(), TV = (t)=>{
        const e = FI(t);
        return t._tag === "Utc" ? e.toISOString() : `${e.toISOString().slice(0, -1)}${wIe(t)}`;
    }, kIe = (t)=>t.zone._tag === "Offset" ? TV(t) : `${TV(t)}[${t.zone.id}]`, TIe = r7e, EIe = "effect/Schedule", IX = Symbol.for(EIe), AX = (t)=>Vt(t, IX), CIe = "effect/ScheduleDriver", IIe = Symbol.for(CIe), Kk = {
        start: 0,
        now: 0,
        input: void 0,
        output: void 0,
        elapsed: Ih,
        elapsedSincePrevious: Ih,
        recurrence: 0
    }, Iy = Hg()("effect/Schedule/CurrentIterationMetadata", {
        defaultValue: ()=>Kk
    }), AIe = {
        _Out: (t)=>t,
        _In: (t)=>t,
        _R: (t)=>t
    }, PIe = {
        _Out: (t)=>t,
        _In: (t)=>t,
        _R: (t)=>t
    };
    class OIe {
        initial;
        step;
        [IX] = AIe;
        constructor(e, n){
            this.initial = e, this.step = n;
        }
        pipe() {
            return xt(this, arguments);
        }
    }
    const EV = (t, e, n, r)=>ax(t, (s)=>s.recurrence === 0 ? {
                now: e,
                input: n,
                output: r,
                recurrence: s.recurrence + 1,
                elapsed: Ih,
                elapsedSincePrevious: Ih,
                start: e
            } : {
                now: e,
                input: n,
                output: r,
                recurrence: s.recurrence + 1,
                elapsed: as(e - s.start),
                elapsedSincePrevious: as(e - s.now),
                start: s.start
            });
    class MIe {
        schedule;
        ref;
        [IIe] = PIe;
        constructor(e, n){
            this.schedule = e, this.ref = n;
        }
        get state() {
            return kt(_o(this.ref), (e)=>e[1]);
        }
        get last() {
            return Te(_o(this.ref), ([e, n])=>{
                switch(e._tag){
                    case "None":
                        return I1(()=>new KC);
                    case "Some":
                        return ze(e.value);
                }
            });
        }
        iterationMeta = iI(Kk);
        get reset() {
            return ih(this.ref, [
                Ve(),
                this.schedule.initial
            ]).pipe(d3(ih(this.iterationMeta, Kk)));
        }
        next(e) {
            return V(kt(_o(this.ref), (n)=>n[1]), Te((n)=>V(jW, Te((r)=>V(Ct(()=>this.schedule.step(r, e, n)), Te(([s, i, o])=>{
                        const a = ih(this.ref, [
                            Fe(i),
                            s
                        ]);
                        if (Ty(o)) return a.pipe(Ur(Cr(Ve())));
                        const c = Hk(o.intervals) - r;
                        if (c <= 0) return a.pipe(Ur(EV(this.iterationMeta, r, e, i)), Ss(i));
                        const l = as(c);
                        return V(a, Ur(EV(this.iterationMeta, r, e, i)), Ur(cI(l)), Ss(i));
                    }))))));
        }
    }
    const Yd = (t, e)=>new OIe(t, e), PX = j(2, (t, e)=>RIe(t, (n)=>Ue(()=>e(n)))), RIe = j(2, (t, e)=>OX(t, (n, r)=>kt(e(n), (s)=>M3e(r, Ei(s))))), NIe = j(2, (t, e)=>LI(t, (n, r)=>Ue(()=>e(n, r)))), LI = j(2, (t, e)=>Yd(t.initial, (n, r, s)=>Te(t.step(n, r, s), ([i, o, a])=>Ty(a) ? ze([
                    i,
                    o,
                    ky
                ]) : kt(e(r, o), (c)=>c ? [
                        i,
                        o,
                        a
                    ] : [
                        i,
                        o,
                        ky
                    ])))), VIe = j(2, (t, e)=>OX(t, (n, r)=>e(r))), BIe = (t)=>PX(t, (e)=>e), zI = (t)=>V(ox([
            Ve(),
            t.initial
        ]), kt((e)=>new MIe(t, e))), DIe = (t, e = 2)=>{
        const n = Ei(t);
        return BIe(N3(j1, (r)=>O3e(n, Math.pow(e, r))));
    }, UI = j(2, (t, e)=>FIe(t, e, LEe)), FIe = j(3, (t, e, n)=>Yd([
            t.initial,
            e.initial
        ], (r, s, i)=>V(hW(t.step(r, s, i[0]), e.step(r, s, i[1]), (o, a)=>[
                    o,
                    a
                ]), Te(([[o, a, c], [l, u, d]])=>xV(c) && xV(d) ? Wk(t, e, s, o, a, c.intervals, l, u, d.intervals, n) : ze([
                    [
                        o,
                        l
                    ],
                    [
                        a,
                        u
                    ],
                    ky
                ]))))), Wk = (t, e, n, r, s, i, o, a, c, l)=>{
        const u = l(i, c);
        return UEe(u) ? ze([
            [
                r,
                o
            ],
            [
                s,
                a
            ],
            $Ee(u)
        ]) : V(i, zEe(c)) ? Te(t.step(jk(i), n, r), ([d, f, p])=>Ty(p) ? ze([
                [
                    d,
                    o
                ],
                [
                    f,
                    a
                ],
                ky
            ]) : Wk(t, e, n, d, f, p.intervals, o, a, c, l)) : Te(e.step(jk(c), n, o), ([d, f, p])=>Ty(p) ? ze([
                [
                    r,
                    d
                ],
                [
                    s,
                    f
                ],
                ky
            ]) : Wk(t, e, n, r, s, i, d, f, p.intervals, l));
    }, LIe = j(2, (t, e)=>{
        const { max: n, min: r } = Object.assign({
            min: .8,
            max: 1.2
        }, e);
        return VIe(t, (s)=>kt(TIe, (i)=>{
                const o = Si(s), a = o * r * (1 - i) + o * n * i;
                return as(a);
            }));
    }), N3 = j(2, (t, e)=>zIe(t, (n)=>Ue(()=>e(n)))), zIe = j(2, (t, e)=>Yd(t.initial, (n, r, s)=>Te(t.step(n, r, s), ([i, o, a])=>kt(e(o), (c)=>[
                        i,
                        c,
                        a
                    ])))), OX = j(2, (t, e)=>Yd(t.initial, (n, r, s)=>Te(t.step(n, r, s), ([i, o, a])=>{
                if (Ty(a)) return ze([
                    i,
                    o,
                    a
                ]);
                const c = a.intervals, l = OEe(wV(n, Hk(c)));
                return kt(e(o, l), (u)=>{
                    const d = Ei(u), f = Hk(c), p = n + Si(d), h = p - f, b = Math.max(0, jk(c) + h), y = wV(p, b);
                    return [
                        i,
                        o,
                        yx(y)
                    ];
                });
            }))), UIe = (t)=>Yd(t.initial, (e, n, r)=>V(t.step(e, n, r), kt(([s, i, o])=>[
                    s,
                    n,
                    o
                ]))), MX = (t)=>WIe(j1, (e)=>e < t), HIe = j(2, (t, e)=>{
        const n = Ei(e);
        return V(t, UI(tAe), jIe(([, r])=>hK(r, n)), N3((r)=>r[0]));
    }), jIe = j(2, (t, e)=>Yd(t.initial, (n, r, s)=>Te(t.step(n, r, s), ([i, o, a])=>e(o) ? t.step(n, r, t.initial) : ze([
                    i,
                    o,
                    a
                ])))), qIe = (t)=>PX(j1, ()=>t), KIe = (t, e)=>Yd(t, (n, r, s)=>Ue(()=>[
                    e(s),
                    s,
                    yx(zk(n))
                ])), RX = j(2, (t, e)=>LI(t, (n, r)=>W7e(e(n)))), NX = j(2, (t, e)=>LI(t, (n, r)=>e(n))), WIe = j(2, (t, e)=>NIe(t, (n, r)=>e(r))), X_ = Symbol.for("effect/Schedule/ScheduleDefect");
    class $Ie {
        error;
        [X_];
        constructor(e){
            this.error = e, this[X_] = X_;
        }
    }
    const XIe = (t)=>Vt(t, X_), _x = (t)=>og(t, (e)=>Al(new $Ie(e))), GIe = (t)=>un(RC(t, (e)=>ZK(e) && XIe(e.defect) ? Fe(e.defect) : Ve()), {
            onNone: ()=>t,
            onSome: (e)=>Ad(e.error)
        }), VX = (t)=>BC(t, (e)=>Sr(GIe(e))), CV = j(2, (t, e)=>JIe(t, e, (n, r)=>Cr(n))), ZIe = j(2, (t, e)=>{
        if (AX(e)) return CV(t, e);
        const n = e.schedule ?? UIe(j1), r = e.while ? NX(n, (o)=>{
            const a = e.while(o);
            return typeof a == "boolean" ? ze(a) : _x(a);
        }) : n, s = e.until ? RX(r, (o)=>{
            const a = e.until(o);
            return typeof a == "boolean" ? ze(a) : _x(a);
        }) : r, i = e.times ? UI(s, MX(e.times)).pipe(N3((o)=>o[0])) : s;
        return VX(CV(t, i));
    }), JIe = j(3, (t, e, n)=>Te(zI(e), (r)=>Nc(t, {
                onFailure: (s)=>n(s, Ve()),
                onSuccess: (s)=>BX(wy(t, Iy, _o(r.iterationMeta)), r, (i, o)=>wy(n(i, o), Iy, _o(r.iterationMeta)), s)
            }))), BX = (t, e, n, r)=>Nc(e.next(r), {
            onFailure: ()=>UC(e.last),
            onSuccess: (s)=>Nc(t, {
                    onFailure: (i)=>n(i, Fe(s)),
                    onSuccess: (i)=>BX(t, e, n, i)
                })
        }), IV = j(2, (t, e)=>eAe(t, e, (n, r)=>Cr(n))), YIe = j(2, (t, e)=>AX(e) ? IV(t, e) : VX(IV(t, QIe(e)))), QIe = (t)=>{
        const e = t.schedule ?? j1, n = t.while ? NX(e, (s)=>{
            const i = t.while(s);
            return typeof i == "boolean" ? ze(i) : _x(i);
        }) : e, r = t.until ? RX(n, (s)=>{
            const i = t.until(s);
            return typeof i == "boolean" ? ze(i) : _x(i);
        }) : n;
        return t.times !== void 0 ? UI(r, MX(t.times)) : r;
    }, eAe = j(3, (t, e, n)=>Te(zI(e), (r)=>DX(wy(t, Iy, _o(r.iterationMeta)), r, (s, i)=>wy(n(s, i), Iy, _o(r.iterationMeta))))), DX = (t, e, n)=>og(t, (r)=>Nc(e.next(r), {
                onFailure: ()=>V(e.last, UC, Te((s)=>n(r, s))),
                onSuccess: ()=>DX(t, e, n)
            })), tAe = Yd(Ve(), (t, e, n)=>{
        switch(n._tag){
            case "None":
                return ze([
                    Fe(t),
                    Ih,
                    yx(zk(t))
                ]);
            case "Some":
                return ze([
                    Fe(n.value),
                    as(t - n.value),
                    yx(zk(t))
                ]);
        }
    }), j1 = KIe(0, (t)=>t + 1), cb = qc, lS = K7e, Ay = TI, Va = dg, nAe = Z7e, rAe = Da, $k = dn, Bs = Cr, xo = Sr, sAe = Al, FX = cW, Gn = fW, yl = G7e, Gt = ze, ar = Ct, Dn = Ue, an = mn, lb = og, HI = BC, uS = N7e, iAe = V7e, oAe = U7e, aAe = H7e, cAe = YIe, Co = a$, lAe = e6e, pd = Q7e, Vp = ss, fo = P1, uAe = ip, fm = op, Py = Eo, Ba = Ss, ub = Pi, ht = kt, LX = zC, Vd = c3, cp = Z$, dAe = oW, Hf = fg, zX = Q$, fAe = II, Xk = Y$, jI = iEe, hAe = Gg, G_ = CI, mi = RI, q1 = eCe, pAe = nCe, UX = w3, gAe = EW, Bd = tIe, Dd = aI, HX = wy, bAe = r6e, jX = s6e, qX = F7e, Vf = Sk, AV = L7e, If = ag, xs = Cc, KX = LC, WX = n6e, Ge = Te, xx = U8e, Tl = Zg, dS = nX, mAe = tCe, qI = tX, $X = cg, KI = Y7e, yAe = z7e, wAe = u$, Gk = ZIe, K1 = c$, Oy = lW, ho = Ci, XX = Nc, PV = q7e, _Ae = UC, xAe = X7e, WI = SCe, $I = JEe, vAe = QEe, vx = TCe, En = ECe, Ki = CCe, Sx = oEe, V3 = aEe, kn = cEe, B3 = L1, SAe = a6e, kAe = c6e, XI = ks, TAe = fa, EAe = wW, CAe = NI, IAe = zCe, GX = qCe, AAe = UCe, OV = KCe, PAe = XCe, ZX = ZCe, OAe = "effect/QueueEnqueue", JX = Symbol.for(OAe), MAe = "effect/QueueDequeue", GI = Symbol.for(MAe), RAe = "effect/QueueStrategy", ZI = Symbol.for(RAe), NAe = "effect/BackingQueue", VAe = Symbol.for(NAe), JI = {
        _A: (t)=>t
    }, BAe = {
        _A: (t)=>t
    }, YX = {
        _In: (t)=>t
    }, YI = {
        _Out: (t)=>t
    };
    class DAe extends Kc {
        queue;
        takers;
        shutdownHook;
        shutdownFlag;
        strategy;
        [JX] = YX;
        [GI] = YI;
        constructor(e, n, r, s, i){
            super(), this.queue = e, this.takers = n, this.shutdownHook = r, this.shutdownFlag = s, this.strategy = i;
        }
        pipe() {
            return xt(this, arguments);
        }
        commit() {
            return this.take;
        }
        capacity() {
            return this.queue.capacity();
        }
        get size() {
            return Ct(()=>og(this.unsafeSize(), ()=>ss));
        }
        unsafeSize() {
            return Tn(this.shutdownFlag) ? Ve() : Fe(this.queue.length() - QC(this.takers) + this.strategy.surplusSize());
        }
        get isEmpty() {
            return kt(this.size, (e)=>e <= 0);
        }
        get isFull() {
            return kt(this.size, (e)=>e >= this.capacity());
        }
        get shutdown() {
            return op(dn((e)=>(V(this.shutdownFlag, np(!0)), V(Na(l0(this.takers), (n)=>m3(n, e.id()), !1, !1), Ur(this.strategy.shutdown), O1(R1(this.shutdownHook, void 0)), Pi))));
        }
        get isShutdown() {
            return Ue(()=>Tn(this.shutdownFlag));
        }
        get awaitShutdown() {
            return aa(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, Ic(yr));
                s !== yr ? (oh(s, e), n = !0) : n = !1;
            } else n = !1;
            if (n) return !0;
            const r = this.queue.offer(e);
            return jf(this.strategy, this.queue, this.takers), r;
        }
        offer(e) {
            return Ct(()=>{
                if (Tn(this.shutdownFlag)) return ss;
                let n;
                if (this.queue.length() === 0) {
                    const s = V(this.takers, Ic(yr));
                    s !== yr ? (oh(s, e), n = !0) : n = !1;
                } else n = !1;
                if (n) return ze(!0);
                const r = this.queue.offer(e);
                return jf(this.strategy, this.queue, this.takers), r ? ze(!0) : this.strategy.handleSurplus([
                    e
                ], this.queue, this.takers, this.shutdownFlag);
            });
        }
        offerAll(e) {
            return Ct(()=>{
                if (Tn(this.shutdownFlag)) return ss;
                const n = Un(e), r = this.queue.length() === 0 ? Un(tPe(this.takers, n.length)) : Jl, [s, i] = V(n, JE(r.length));
                for(let a = 0; a < r.length; a++){
                    const c = r[a], l = s[a];
                    oh(c, l);
                }
                if (i.length === 0) return ze(!0);
                const o = this.queue.offerAll(i);
                return jf(this.strategy, this.queue, this.takers), jg(o) ? ze(!0) : this.strategy.handleSurplus(o, this.queue, this.takers, this.shutdownFlag);
            });
        }
        get take() {
            return dn((e)=>{
                if (Tn(this.shutdownFlag)) return ss;
                const n = this.queue.poll(yr);
                if (n !== yr) return this.strategy.unsafeOnQueueEmptySpace(this.queue, this.takers), ze(n);
                {
                    const r = tb(e.id());
                    return V(Ct(()=>(V(this.takers, Od(r)), jf(this.strategy, this.queue, this.takers), Tn(this.shutdownFlag) ? ss : aa(r))), ip(()=>Ue(()=>nPe(this.takers, r))));
                }
            });
        }
        get takeAll() {
            return Ct(()=>Tn(this.shutdownFlag) ? ss : Ue(()=>{
                    const e = this.queue.pollUpTo(Number.POSITIVE_INFINITY);
                    return this.strategy.unsafeOnQueueEmptySpace(this.queue, this.takers), To(e);
                }));
        }
        takeUpTo(e) {
            return Ct(()=>Tn(this.shutdownFlag) ? ss : Ue(()=>{
                    const n = this.queue.pollUpTo(e);
                    return this.strategy.unsafeOnQueueEmptySpace(this.queue, this.takers), To(n);
                }));
        }
        takeBetween(e, n) {
            return Ct(()=>QX(this, e, n, Cn()));
        }
    }
    const QX = (t, e, n, r)=>n < e ? ze(r) : V(XAe(t, n), Te((s)=>{
            const i = e - s.length;
            return i === 1 ? V(Zk(t), kt((o)=>V(r, _r(s), dy(o)))) : i > 1 ? V(Zk(t), Te((o)=>QX(t, i - 1, n - s.length - 1, V(r, _r(s), dy(o))))) : ze(V(r, _r(s)));
        })), FAe = (t)=>V(Ue(()=>YC(t)), Te((e)=>D3(F3(e), ZAe()))), LAe = (t)=>V(Ue(()=>YC(t)), Te((e)=>D3(F3(e), eG()))), zAe = (t)=>V(Ue(()=>YC(t)), Te((e)=>D3(F3(e), JAe()))), UAe = ()=>V(Ue(()=>N1()), Te((t)=>D3(F3(t), eG()))), HAe = (t, e, n, r, s)=>new DAe(t, e, n, r, s), D3 = (t, e)=>V(nb(), kt((n)=>HAe(t, N1(), n, tp(!1), e)));
    class jAe {
        mutable;
        [VAe] = BAe;
        constructor(e){
            this.mutable = e;
        }
        poll(e) {
            return Ic(this.mutable, e);
        }
        pollUpTo(e) {
            return v3(this.mutable, e);
        }
        offerAll(e) {
            return eI(this.mutable, e);
        }
        offer(e) {
            return Od(this.mutable, e);
        }
        capacity() {
            return i4e(this.mutable);
        }
        length() {
            return QC(this.mutable);
        }
    }
    const F3 = (t)=>new jAe(t), qAe = (t)=>t.size, KAe = (t)=>t.isShutdown, WAe = (t)=>t.shutdown, $Ae = j(2, (t, e)=>t.offer(e)), Zk = (t)=>t.take, XAe = j(2, (t, e)=>t.takeUpTo(e)), GAe = j(3, (t, e, n)=>t.takeBetween(e, n)), ZAe = ()=>new YAe, eG = ()=>new QAe, JAe = ()=>new ePe;
    let YAe = class {
        [ZI] = JI;
        putters = N1();
        surplusSize() {
            return QC(this.putters);
        }
        onCompleteTakersWithEmptyQueue(e) {
            for(; !sh(this.putters) && !sh(e);){
                const n = Ic(e, void 0), r = Ic(this.putters, void 0);
                r[2] && oh(r[1], !0), oh(n, r[0]);
            }
        }
        get shutdown() {
            return V(A1, Te((e)=>V(Ue(()=>l0(this.putters)), Te((n)=>Na(n, ([r, s, i])=>i ? V(m3(s, e), Pi) : mn, !1, !1)))));
        }
        handleSurplus(e, n, r, s) {
            return dn((i)=>{
                const o = tb(i.id());
                return V(Ct(()=>(this.unsafeOffer(e, o), this.unsafeOnQueueEmptySpace(n, r), jf(this, n, r), Tn(s) ? ss : aa(o))), ip(()=>Ue(()=>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, Ic(yr));
                if (s === yr) r = !1;
                else {
                    const i = e.offer(s[0]);
                    i && s[2] ? oh(s[1], !0) : i || kx(this.putters, V(l0(this.putters), Vs(s))), jf(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, Od([
                    i,
                    n,
                    !0
                ])) : V(this.putters, Od([
                    i,
                    n,
                    !1
                ]));
            }
        }
        unsafeRemove(e) {
            kx(this.putters, V(l0(this.putters), y1(([, n])=>n !== e)));
        }
    }, QAe = class {
        [ZI] = JI;
        surplusSize() {
            return 0;
        }
        get shutdown() {
            return mn;
        }
        onCompleteTakersWithEmptyQueue() {}
        handleSurplus(e, n, r, s) {
            return ze(!1);
        }
        unsafeOnQueueEmptySpace(e, n) {}
    }, ePe = class {
        [ZI] = JI;
        surplusSize() {
            return 0;
        }
        get shutdown() {
            return mn;
        }
        onCompleteTakersWithEmptyQueue() {}
        handleSurplus(e, n, r, s) {
            return Ue(()=>(this.unsafeOffer(n, e), jf(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(yr), i = e.offer(s.value);
            }
        }
    };
    const oh = (t, e)=>y3(t, ze(e)), kx = (t, e)=>V(t, eI(e)), l0 = (t)=>V(t, v3(Number.POSITIVE_INFINITY)), tPe = (t, e)=>V(t, v3(e)), nPe = (t, e)=>{
        kx(t, V(l0(t), y1((n)=>e !== n)));
    }, jf = (t, e, n)=>{
        let r = !0;
        for(; r && e.length() !== 0;){
            const s = V(n, Ic(yr));
            if (s !== yr) {
                const i = e.poll(yr);
                i !== yr ? (oh(s, i), t.unsafeOnQueueEmptySpace(e, n)) : kx(n, V(l0(n), Vs(s))), r = !0;
            } else r = !1;
        }
        r && e.length() === 0 && !sh(n) && t.onCompleteTakersWithEmptyQueue(n);
    }, Pr = Symbol.for("effect/PubSub/AbsentValue"), tG = (t, e)=>(n)=>{
            n.has(t) || n.set(t, new Set), n.get(t).add(e);
        }, rPe = (t, e)=>(n)=>{
            if (!n.has(t)) return;
            const r = n.get(t);
            r.delete(e), r.size === 0 && n.delete(t);
        }, sPe = (t)=>Ct(()=>{
            const e = QI(t);
            return L3(e, new PPe);
        }), iPe = (t)=>Ct(()=>{
            const e = QI(t);
            return L3(e, new sG);
        }), oPe = (t)=>Ct(()=>{
            const e = QI(t);
            return L3(e, new OPe);
        }), aPe = (t)=>Ct(()=>{
            const e = dPe(t);
            return L3(e, new sG);
        }), cPe = (t)=>t.shutdown, lPe = j(2, (t, e)=>t.publish(e)), uPe = (t)=>t.subscribe, QI = (t)=>{
        const e = typeof t == "number" ? {
            capacity: t
        } : t;
        TPe(e.capacity);
        const n = e.replay && e.replay > 0 ? new iG(Math.ceil(e.replay)) : void 0;
        return e.capacity === 1 ? new yPe(n) : Bxe(e.capacity) === e.capacity ? new bPe(e.capacity, n) : new pPe(e.capacity, n);
    }, dPe = (t)=>new _Pe(t?.replay ? new iG(t.replay) : void 0), fPe = (t, e, n)=>kt(nb(), (r)=>hPe(t, e, t.subscribe(), N1(), r, tp(!1), n)), hPe = (t, e, n, r, s, i, o)=>new vPe(t, e, n, r, s, i, o, t.replayWindow());
    class pPe {
        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 z3(this.replayBuffer) : U3;
        }
        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), Cn();
            const n = To(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 = Ra(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 Cd(n, a);
        }
        slide() {
            if (this.subscribersIndex !== this.publisherIndex) {
                const e = this.subscribersIndex % this.capacity;
                this.array[e] = Pr, this.subscribers[e] = 0, this.subscribersIndex += 1;
            }
            this.replayBuffer && this.replayBuffer.slide();
        }
        subscribe() {
            return this.subscriberCount += 1, new gPe(this, this.publisherIndex, !1);
        }
    }
    class gPe {
        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] = Pr, this.self.subscribersIndex += 1), this.subscriberIndex += 1, r;
            }
            return e;
        }
        pollUpTo(e) {
            if (this.unsubscribed) return Cn();
            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 Cn();
            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] = Pr, this.self.subscribersIndex += 1), s.push(a), this.subscriberIndex += 1;
            }
            return To(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] = Pr, this.self.subscribersIndex += 1), this.subscriberIndex += 1;
            }
        }
    }
    class bPe {
        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 z3(this.replayBuffer) : U3;
        }
        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), Cn();
            const n = To(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 = Ra(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 Cd(n, a);
        }
        slide() {
            if (this.subscribersIndex !== this.publisherIndex) {
                const e = this.subscribersIndex & this.mask;
                this.array[e] = Pr, this.subscribers[e] = 0, this.subscribersIndex += 1;
            }
            this.replayBuffer && this.replayBuffer.slide();
        }
        subscribe() {
            return this.subscriberCount += 1, new mPe(this, this.publisherIndex, !1);
        }
    }
    class mPe {
        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] = Pr, this.self.subscribersIndex += 1), this.subscriberIndex += 1, r;
            }
            return e;
        }
        pollUpTo(e) {
            if (this.unsubscribed) return Cn();
            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 Cn();
            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] = Pr, this.self.subscribersIndex += 1), s.push(a), this.subscriberIndex += 1;
            }
            return To(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] = Pr, this.self.subscribersIndex += 1), this.subscriberIndex += 1;
            }
        }
    }
    class yPe {
        replayBuffer;
        publisherIndex = 0;
        subscriberCount = 0;
        subscribers = 0;
        value = Pr;
        capacity = 1;
        constructor(e){
            this.replayBuffer = e;
        }
        replayWindow() {
            return this.replayBuffer ? new z3(this.replayBuffer) : U3;
        }
        pipe() {
            return xt(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), Cn();
            const n = To(e);
            return jg(n) ? n : this.publish(fC(n)) ? Cd(n, 1) : n;
        }
        slide() {
            this.isFull() && (this.subscribers = 0, this.value = Pr), this.replayBuffer && this.replayBuffer.slide();
        }
        subscribe() {
            return this.subscriberCount += 1, new wPe(this, this.publisherIndex, !1);
        }
    }
    class wPe {
        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 = Pr), this.subscriberIndex += 1, n;
        }
        pollUpTo(e) {
            if (this.isEmpty() || e < 1) return Cn();
            const n = this.self.value;
            return this.self.subscribers -= 1, this.self.subscribers === 0 && (this.self.value = Pr), this.subscriberIndex += 1, Pn(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 = Pr)));
        }
    }
    class _Pe {
        replayBuffer;
        publisherHead = {
            value: Pr,
            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 z3(this.replayBuffer) : U3;
        }
        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 Cn();
        }
        slide() {
            this.publisherHead !== this.publisherTail && (this.publisherHead = this.publisherHead.next, this.publisherHead.value = Pr, this.subscribersIndex += 1), this.replayBuffer && this.replayBuffer.slide();
        }
        subscribe() {
            return this.publisherTail.subscribers += 1, new xPe(this, this.publisherTail, this.publisherIndex, !1);
        }
    }
    class xPe {
        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 !== Pr ? (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 !== Pr && (r = s, this.subscriberHead.subscribers -= 1, this.subscriberHead.subscribers === 0 && (this.self.publisherHead = this.self.publisherHead.next, this.self.publisherHead.value = Pr, this.self.subscribersIndex += 1), n = !1), this.subscriberHead = this.subscriberHead.next, this.subscriberIndex += 1;
            }
            return r;
        }
        pollUpTo(e) {
            const n = [], r = Pr;
            let s = 0;
            for(; s !== e;){
                const i = this.poll(r);
                i === r ? s = e : (n.push(i), s += 1);
            }
            return To(n);
        }
        unsubscribe() {
            if (!this.unsubscribed) for(this.unsubscribed = !0, this.self.publisherTail.subscribers -= 1; this.subscriberHead !== this.self.publisherTail;)this.subscriberHead.next.value !== Pr && (this.subscriberHead.subscribers -= 1, this.subscriberHead.subscribers === 0 && (this.self.publisherHead = this.self.publisherHead.next, this.self.publisherHead.value = Pr, this.self.subscribersIndex += 1)), this.subscriberHead = this.subscriberHead.next;
        }
    }
    let vPe = class extends Kc {
        pubsub;
        subscribers;
        subscription;
        pollers;
        shutdownHook;
        shutdownFlag;
        strategy;
        replayWindow;
        [GI] = YI;
        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 xt(this, arguments);
        }
        capacity() {
            return this.pubsub.capacity;
        }
        isActive() {
            return !Tn(this.shutdownFlag);
        }
        get size() {
            return Ct(()=>Tn(this.shutdownFlag) ? ss : ze(this.subscription.size() + this.replayWindow.remaining));
        }
        unsafeSize() {
            return Tn(this.shutdownFlag) ? Ve() : Fe(this.subscription.size() + this.replayWindow.remaining);
        }
        get isFull() {
            return Ct(()=>Tn(this.shutdownFlag) ? ss : ze(this.subscription.size() === this.capacity()));
        }
        get isEmpty() {
            return kt(this.size, (e)=>e === 0);
        }
        get shutdown() {
            return op(dn((e)=>(np(this.shutdownFlag, !0), V(EI(u0(this.pollers), (n)=>m3(n, e.id()), !1), Ur(Ue(()=>{
                    this.subscribers.delete(this.subscription), this.subscription.unsubscribe(), this.strategy.unsafeOnPubSubEmptySpace(this.pubsub, this.subscribers);
                })), O1(R1(this.shutdownHook, void 0)), Pi))));
        }
        get isShutdown() {
            return Ue(()=>Tn(this.shutdownFlag));
        }
        get awaitShutdown() {
            return aa(this.shutdownHook);
        }
        get take() {
            return dn((e)=>{
                if (Tn(this.shutdownFlag)) return ss;
                if (this.replayWindow.remaining > 0) {
                    const r = this.replayWindow.take();
                    return ze(r);
                }
                const n = sh(this.pollers) ? this.subscription.poll(yr) : yr;
                if (n === yr) {
                    const r = tb(e.id());
                    return V(Ct(()=>(V(this.pollers, Od(r)), V(this.subscribers, tG(this.subscription, this.pollers)), this.strategy.unsafeCompletePollers(this.pubsub, this.subscribers, this.subscription, this.pollers), Tn(this.shutdownFlag) ? ss : aa(r))), ip(()=>Ue(()=>APe(this.pollers, r))));
                } else return this.strategy.unsafeOnPubSubEmptySpace(this.pubsub, this.subscribers), ze(n);
            });
        }
        get takeAll() {
            return Ct(()=>{
                if (Tn(this.shutdownFlag)) return ss;
                const e = sh(this.pollers) ? EPe(this.subscription) : Cn();
                return this.strategy.unsafeOnPubSubEmptySpace(this.pubsub, this.subscribers), this.replayWindow.remaining > 0 ? ze(_r(this.replayWindow.takeAll(), e)) : ze(e);
            });
        }
        takeUpTo(e) {
            return Ct(()=>{
                if (Tn(this.shutdownFlag)) return ss;
                let n;
                if (this.replayWindow.remaining >= e) {
                    const s = this.replayWindow.takeN(e);
                    return ze(s);
                } else this.replayWindow.remaining > 0 && (n = this.replayWindow.takeAll(), e = e - n.length);
                const r = sh(this.pollers) ? CPe(this.subscription, e) : Cn();
                return this.strategy.unsafeOnPubSubEmptySpace(this.pubsub, this.subscribers), ze(n ? _r(n, r) : r);
            });
        }
        takeBetween(e, n) {
            return Ct(()=>nG(this, e, n, Cn()));
        }
    };
    const nG = (t, e, n, r)=>n < e ? ze(r) : V(t.takeUpTo(n), Te((s)=>{
            const i = e - s.length;
            return i === 1 ? V(t.take, kt((o)=>V(r, _r(s), dy(o)))) : i > 1 ? V(t.take, Te((o)=>nG(t, i - 1, n - s.length - 1, V(r, _r(s), dy(o))))) : ze(V(r, _r(s)));
        }));
    class SPe {
        pubsub;
        subscribers;
        scope;
        shutdownHook;
        shutdownFlag;
        strategy;
        [JX] = YX;
        [GI] = YI;
        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 Ct(()=>Tn(this.shutdownFlag) ? ss : Ue(()=>this.pubsub.size()));
        }
        unsafeSize() {
            return Tn(this.shutdownFlag) ? Ve() : Fe(this.pubsub.size());
        }
        get isFull() {
            return kt(this.size, (e)=>e === this.capacity());
        }
        get isEmpty() {
            return kt(this.size, (e)=>e === 0);
        }
        get awaitShutdown() {
            return aa(this.shutdownHook);
        }
        get isShutdown() {
            return Ue(()=>Tn(this.shutdownFlag));
        }
        get shutdown() {
            return op(dn((e)=>(V(this.shutdownFlag, np(!0)), V(this.scope.close(kW(e.id())), Ur(this.strategy.shutdown), O1(R1(this.shutdownHook, void 0)), Pi))));
        }
        publish(e) {
            return Ct(()=>Tn(this.shutdownFlag) ? ss : this.pubsub.publish(e) ? (this.strategy.unsafeCompleteSubscribers(this.pubsub, this.subscribers), ze(!0)) : this.strategy.handleSurplus(this.pubsub, this.subscribers, Pn(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 Ct(()=>{
                if (Tn(this.shutdownFlag)) return ss;
                const n = IPe(this.pubsub, e);
                return this.strategy.unsafeCompleteSubscribers(this.pubsub, this.subscribers), jg(n) ? ze(!0) : this.strategy.handleSurplus(this.pubsub, this.subscribers, n, this.shutdownFlag);
            });
        }
        get subscribe() {
            const e = cg(TI([
                this.scope.fork(hd),
                fPe(this.pubsub, this.subscribers, this.strategy)
            ]), (n)=>n[0].addFinalizer(()=>n[1].shutdown));
            return kt(Z$(e, (n, r)=>n[0].close(r)), (n)=>n[1]);
        }
        offer(e) {
            return this.publish(e);
        }
        offerAll(e) {
            return this.publishAll(e);
        }
        pipe() {
            return xt(this, arguments);
        }
    }
    const L3 = (t, e)=>Te(ib(), (n)=>kt(nb(), (r)=>kPe(t, new Map, n, r, tp(!1), e))), kPe = (t, e, n, r, s, i)=>new SPe(t, e, n, r, s, i), TPe = (t)=>{
        if (t <= 0) throw new TSe(`Cannot construct PubSub with capacity of ${t}`);
    }, rG = (t, e)=>{
        y3(t, ze(e));
    }, Tx = (t, e)=>V(t, eI(e)), u0 = (t)=>V(t, v3(Number.POSITIVE_INFINITY)), EPe = (t)=>t.pollUpTo(Number.POSITIVE_INFINITY), CPe = (t, e)=>t.pollUpTo(e), IPe = (t, e)=>t.publishAll(e), APe = (t, e)=>{
        Tx(t, V(u0(t), y1((n)=>n !== e)));
    };
    class PPe {
        publishers = N1();
        get shutdown() {
            return Te(A1, (e)=>Te(Ue(()=>u0(this.publishers)), (n)=>Na(n, ([r, s, i])=>i ? V(m3(s, e), Pi) : mn, !1, !1)));
        }
        handleSurplus(e, n, r, s) {
            return dn((i)=>{
                const o = tb(i.id());
                return V(Ct(()=>(this.unsafeOffer(r, o), this.unsafeOnPubSubEmptySpace(e, n), this.unsafeCompleteSubscribers(e, n), Tn(s) ? ss : aa(o))), ip(()=>Ue(()=>this.unsafeRemove(o))));
            });
        }
        unsafeOnPubSubEmptySpace(e, n) {
            let r = !0;
            for(; r && !e.isFull();){
                const s = V(this.publishers, Ic(yr));
                if (s === yr) r = !1;
                else {
                    const i = e.publish(s[0]);
                    i && s[2] ? rG(s[1], !0) : i || Tx(this.publishers, V(u0(this.publishers), Vs(s))), this.unsafeCompleteSubscribers(e, n);
                }
            }
        }
        unsafeCompletePollers(e, n, r, s) {
            return eA(this, e, n, r, s);
        }
        unsafeCompleteSubscribers(e, n) {
            return tA(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, Od([
                        i,
                        n,
                        !0
                    ]));
                    break;
                }
                V(this.publishers, Od([
                    i,
                    n,
                    !1
                ]));
            }
        }
        unsafeRemove(e) {
            Tx(this.publishers, V(u0(this.publishers), y1(([n, r])=>r !== e)));
        }
    }
    class sG {
        get shutdown() {
            return mn;
        }
        handleSurplus(e, n, r, s) {
            return ze(!1);
        }
        unsafeOnPubSubEmptySpace(e, n) {}
        unsafeCompletePollers(e, n, r, s) {
            return eA(this, e, n, r, s);
        }
        unsafeCompleteSubscribers(e, n) {
            return tA(this, e, n);
        }
    }
    class OPe {
        get shutdown() {
            return mn;
        }
        handleSurplus(e, n, r, s) {
            return Ue(()=>(this.unsafeSlidingPublish(e, r), this.unsafeCompleteSubscribers(e, n), !0));
        }
        unsafeOnPubSubEmptySpace(e, n) {}
        unsafeCompletePollers(e, n, r, s) {
            return eA(this, e, n, r, s);
        }
        unsafeCompleteSubscribers(e, n) {
            return tA(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 eA = (t, e, n, r, s)=>{
        let i = !0;
        for(; i && !r.isEmpty();){
            const o = V(s, Ic(yr));
            if (o === yr) V(n, rPe(r, s)), sh(s) ? i = !1 : V(n, tG(r, s));
            else {
                const a = r.poll(yr);
                a === yr ? Tx(s, V(u0(s), Vs(o))) : (rG(o, a), t.unsafeOnPubSubEmptySpace(e, n));
            }
        }
    }, tA = (t, e, n)=>{
        for (const [r, s] of n)for (const i of s)t.unsafeCompletePollers(e, n, r, i);
    };
    class iG {
        capacity;
        constructor(e){
            this.capacity = e;
        }
        head = {
            value: Pr,
            next: null
        };
        tail = this.head;
        size = 0;
        index = 0;
        slide() {
            this.index++;
        }
        offer(e) {
            this.tail.value = e, this.tail.next = {
                value: Pr,
                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 z3 {
        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 Cn();
            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, Zi(r);
        }
        takeAll() {
            return this.takeN(this.remaining);
        }
    }
    const U3 = {
        remaining: 0,
        take: ()=>{},
        takeN: ()=>Cn(),
        takeAll: ()=>Cn()
    }, MV = sPe, MPe = iPe, RPe = oPe, oG = aPe, Jk = cPe, aG = lPe, RV = uPe, My = FAe, NPe = LAe, VPe = zAe, nA = UAe, BPe = qAe, DPe = KAe, Dh = WAe, js = $Ae, Ex = Zk, FPe = GAe, cG = "Continue", LPe = "Close", zPe = "Yield", UPe = "effect/ChannelChildExecutorDecision", NV = Symbol.for(UPe), HPe = {
        [NV]: NV
    }, lG = (t)=>{
        const e = Object.create(HPe);
        return e._tag = cG, e;
    }, Z_ = "ContinuationK", jPe = "ContinuationFinalizer", uG = Symbol.for("effect/ChannelContinuation"), dG = {
        _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 rA {
        onSuccess;
        onHalt;
        _tag = Z_;
        [uG] = dG;
        constructor(e, n){
            this.onSuccess = e, this.onHalt = n;
        }
        onExit(e) {
            return GC(e) ? this.onHalt(e.cause) : this.onSuccess(e.value);
        }
    }
    class qPe {
        finalizer;
        _tag = jPe;
        [uG] = dG;
        constructor(e){
            this.finalizer = e;
        }
    }
    const fG = "PullAfterNext", KPe = "PullAfterAllEnqueued", WPe = "effect/ChannelUpstreamPullStrategy", $Pe = Symbol.for(WPe), XPe = {
        _A: (t)=>t
    }, GPe = {
        [$Pe]: XPe
    }, hG = (t)=>{
        const e = Object.create(GPe);
        return e._tag = fG, e.emitSeparator = t, e;
    }, pG = "BracketOut", gG = "Bridge", sA = "ConcatAll", bG = "Emit", mG = "Ensuring", yG = "Fail", iA = "Fold", wG = "FromEffect", _G = "PipeTo", xG = "Provide", vG = "Read", SG = "Succeed", kG = "SucceedNow", TG = "Suspend", ZPe = "effect/Channel", EG = Symbol.for(ZPe), JPe = {
        _Env: (t)=>t,
        _InErr: (t)=>t,
        _InElem: (t)=>t,
        _InDone: (t)=>t,
        _OutErr: (t)=>t,
        _OutElem: (t)=>t,
        _OutDone: (t)=>t
    }, ui = {
        [EG]: JPe,
        pipe () {
            return xt(this, arguments);
        }
    }, CG = (t)=>Vt(t, EG) || cb(t), YPe = j(2, (t, e)=>{
        const n = Object.create(ui);
        return n._tag = pG, n.acquire = ()=>t, n.finalizer = e, n;
    }), oA = j(2, (t, e)=>{
        const n = Object.create(ui);
        return n._tag = iA, n.channel = t, n.k = new rA(gd, e), n;
    }), VV = (t)=>W1(()=>{
            const e = [];
            return Ht(jr(t, IG(e)), (n)=>H3(()=>[
                        To(e),
                        n
                    ]));
        }), IG = (t)=>Qd({
            onInput: (e)=>Ht(H3(()=>{
                    t.push(e);
                }), ()=>IG(t)),
            onFailure: vo,
            onDone: ca
        }), AG = (t, e, n)=>{
        const r = Object.create(ui);
        return r._tag = sA, r.combineInners = e, r.combineAll = n, r.onPull = ()=>hG(Ve()), r.onEmit = ()=>lG, r.value = ()=>t, r.k = Ft, r;
    }, QPe = j(4, (t, e, n, r)=>{
        const s = Object.create(ui);
        return s._tag = sA, s.combineInners = n, s.combineAll = r, s.onPull = ()=>hG(Ve()), s.onEmit = ()=>lG, s.value = ()=>t, s.k = e, s;
    }), aA = j(2, (t, e)=>{
        const n = Object.create(ui);
        return n._tag = gG, n.input = e, n.channel = t, n;
    }), eOe = j(2, (t, e)=>{
        const n = Object.create(ui);
        return n._tag = mG, n.channel = t, n.finalizer = e, n;
    }), vo = (t)=>lr(AI(t)), lr = (t)=>tOe(()=>t), tOe = (t)=>{
        const e = Object.create(ui);
        return e._tag = yG, e.error = t, e;
    }, Ht = j(2, (t, e)=>{
        const n = Object.create(ui);
        return n._tag = iA, n.channel = t, n.k = new rA(e, lr), n;
    }), Wn = (t)=>{
        const e = Object.create(ui);
        return e._tag = wG, e.effect = ()=>t, e;
    }, jr = j(2, (t, e)=>{
        const n = Object.create(ui);
        return n._tag = _G, n.left = ()=>t, n.right = ()=>e, n;
    }), PG = j(2, (t, e)=>{
        const n = Object.create(ui);
        return n._tag = xG, n.context = ()=>e, n.inner = t, n;
    }), Qd = (t)=>Oi({
            onInput: t.onInput,
            onFailure: (e)=>cr(z1(e), {
                    onLeft: t.onFailure,
                    onRight: lr
                }),
            onDone: t.onDone
        }), Oi = (t)=>{
        const e = Object.create(ui);
        return e._tag = vG, e.more = t.onInput, e.done = new rA(t.onDone, t.onFailure), e;
    }, gd = (t)=>H3(()=>t), ca = (t)=>{
        const e = Object.create(ui);
        return e._tag = kG, e.terminal = t, e;
    }, W1 = (t)=>{
        const e = Object.create(ui);
        return e._tag = TG, e.channel = t, e;
    }, H3 = (t)=>{
        const e = Object.create(ui);
        return e._tag = SG, e.evaluate = t, e;
    }, os = ca(void 0), ln = (t)=>{
        const e = Object.create(ui);
        return e._tag = bG, e.out = t, e;
    }, $1 = "Done", X1 = "Emit", db = "FromEffect", G1 = "Read", nOe = Symbol.for("effect/ChannelState"), rOe = {
        _E: (t)=>t,
        _R: (t)=>t
    }, j3 = {
        [nOe]: rOe
    }, Bp = ()=>{
        const t = Object.create(j3);
        return t._tag = $1, t;
    }, fS = ()=>{
        const t = Object.create(j3);
        return t._tag = X1, t;
    }, Lb = (t)=>{
        const e = Object.create(j3);
        return e._tag = db, e.effect = t, e;
    }, hS = (t, e, n, r)=>{
        const s = Object.create(j3);
        return s._tag = G1, s.upstream = t, s.onEffect = e, s.onEmit = n, s.onDone = r, s;
    }, Cx = (t)=>t._tag === db, sOe = (t)=>Cx(t) ? t.effect : an, BV = (t)=>Cx(t) ? oAe(t.effect) : void 0, OG = "PullFromChild", Yk = "PullFromUpstream", Qk = "DrainChildExecutors", MG = "Emit";
    class t_ {
        childExecutor;
        parentSubexecutor;
        onEmit;
        _tag = OG;
        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 ? B3(xs(n), xs(r), (s, i)=>V(s, my(i))) : n !== void 0 ? n : r !== void 0 ? r : void 0;
        }
        enqueuePullFromChild(e) {
            return this;
        }
    }
    class Bf {
        upstreamExecutor;
        createChild;
        lastDone;
        activeChildExecutors;
        combineChildResults;
        combineWithChildResult;
        onPull;
        onEmit;
        _tag = Yk;
        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 ? B3(i, xs(o), (a, c)=>my(a, c)) : i !== void 0 ? i : o !== void 0 ? xs(o) : void 0, void 0);
            return s;
        }
        enqueuePullFromChild(e) {
            return new Bf(this.upstreamExecutor, this.createChild, this.lastDone, [
                ...this.activeChildExecutors,
                e
            ], this.combineChildResults, this.combineWithChildResult, this.onPull, this.onEmit);
        }
    }
    class Jp {
        upstreamExecutor;
        lastDone;
        activeChildExecutors;
        upstreamDone;
        combineChildResults;
        combineWithChildResult;
        onPull;
        _tag = Qk;
        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 ? B3(i, xs(o), (a, c)=>my(a, c)) : i !== void 0 ? i : o !== void 0 ? xs(o) : void 0, void 0);
            return s;
        }
        enqueuePullFromChild(e) {
            return new Jp(this.upstreamExecutor, this.lastDone, [
                ...this.activeChildExecutors,
                e
            ], this.upstreamDone, this.combineChildResults, this.combineWithChildResult, this.onPull);
        }
    }
    class pS {
        value;
        next;
        _tag = MG;
        constructor(e, n){
            this.value = e, this.next = n;
        }
        close(e) {
            const n = this.next.close(e);
            return n;
        }
        enqueuePullFromChild(e) {
            return this;
        }
    }
    const iOe = "Pulled", oOe = "NoUpstream", aOe = "effect/ChannelUpstreamPullRequest", cOe = Symbol.for(aOe), lOe = {
        _A: (t)=>t
    }, RG = {
        [cOe]: lOe
    }, DV = (t)=>{
        const e = Object.create(RG);
        return e._tag = iOe, e.value = t, e;
    }, uOe = (t)=>{
        const e = Object.create(RG);
        return e._tag = oOe, e.activeDownstreamCount = t, e;
    };
    class qf {
        _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 = Bp();
                else switch(cb(this._currentChannel) && (this._currentChannel = Wn(this._currentChannel)), this._currentChannel._tag){
                    case pG:
                        {
                            e = this.runBracketOut(this._currentChannel);
                            break;
                        }
                    case gG:
                        {
                            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 = ()=>Ge(n.awaitRead(), ()=>ar(()=>{
                                            const i = r.run();
                                            switch(i._tag){
                                                case $1:
                                                    return Sc(r.getDone(), {
                                                        onFailure: (o)=>n.error(o),
                                                        onSuccess: (o)=>n.done(o)
                                                    });
                                                case X1:
                                                    return Ge(n.emit(r.getEmit()), ()=>s());
                                                case db:
                                                    return ho(i.effect, {
                                                        onFailure: (o)=>n.error(o),
                                                        onSuccess: ()=>s()
                                                    });
                                                case G1:
                                                    return cA(i, ()=>s(), (o)=>n.error(o));
                                            }
                                        }));
                                e = Lb(Ge(G_(fo(s())), (i)=>Dn(()=>this.addFinalizer((o)=>Ge(Ac(i), ()=>ar(()=>{
                                                    const a = this.restorePipe(o, r);
                                                    return a !== void 0 ? a : an;
                                                }))))));
                            }
                            break;
                        }
                    case sA:
                        {
                            const n = new qf(this._currentChannel.value(), this._providedEnv, (s)=>Dn(()=>{
                                    const i = this._closeLastSubstream === void 0 ? an : this._closeLastSubstream;
                                    this._closeLastSubstream = V(i, kn(s));
                                }));
                            n._input = this._input;
                            const r = this._currentChannel;
                            this._activeSubexecutor = new Bf(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 bG:
                        {
                            this._emitted = this._currentChannel.out, this._currentChannel = this._activeSubexecutor !== void 0 ? void 0 : os, e = fS();
                            break;
                        }
                    case mG:
                        {
                            this.runEnsuring(this._currentChannel);
                            break;
                        }
                    case yG:
                        {
                            e = this.doneHalt(this._currentChannel.error());
                            break;
                        }
                    case iA:
                        {
                            this._doneStack.push(this._currentChannel.k), this._currentChannel = this._currentChannel.channel;
                            break;
                        }
                    case wG:
                        {
                            const n = this._providedEnv === void 0 ? this._currentChannel.effect() : V(this._currentChannel.effect(), Bd(this._providedEnv));
                            e = Lb(ho(n, {
                                onFailure: (r)=>{
                                    const s = this.doneHalt(r);
                                    return s !== void 0 && Cx(s) ? s.effect : an;
                                },
                                onSuccess: (r)=>{
                                    const s = this.doneSucceed(r);
                                    return s !== void 0 && Cx(s) ? s.effect : an;
                                }
                            }));
                            break;
                        }
                    case _G:
                        {
                            const n = this._input, r = new qf(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 : an;
                            }), this._currentChannel = this._currentChannel.right();
                            break;
                        }
                    case xG:
                        {
                            const n = this._providedEnv;
                            this._providedEnv = this._currentChannel.context(), this._currentChannel = this._currentChannel.inner, this.addFinalizer(()=>Dn(()=>{
                                    this._providedEnv = n;
                                }));
                            break;
                        }
                    case vG:
                        {
                            const n = this._currentChannel;
                            e = hS(this._input, Ft, (r)=>{
                                try {
                                    this._currentChannel = n.more(r);
                                } catch (s) {
                                    this._currentChannel = n.done.onExit(qSe(s));
                                }
                            }, (r)=>{
                                const s = (i)=>n.done.onExit(i);
                                this._currentChannel = s(r);
                            });
                            break;
                        }
                    case SG:
                        {
                            e = this.doneSucceed(this._currentChannel.evaluate());
                            break;
                        }
                    case kG:
                        {
                            e = this.doneSucceed(this._currentChannel.terminal);
                            break;
                        }
                    case TG:
                        {
                            this._currentChannel = this._currentChannel.channel();
                            break;
                        }
                }
            } catch (n) {
                this._currentChannel = lr(Lk(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 ? an : bS(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 === Z_) 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) : an;
        }
        close(e) {
            let n;
            const r = this._inProgressFinalizer;
            r !== void 0 && (n = V(r, Hf(Dn(()=>this.clearInProgressFinalizer()))));
            let s;
            const i = this.popAllFinalizers(e);
            i !== void 0 && (s = V(i, Hf(Dn(()=>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(xs(gS(o)), Sx(xs(gS(n))), Sx(xs(gS(s))), ht(([[a, c], l])=>V(a, my(c), my(l))), fm, Ge((a)=>ar(()=>a)));
        }
        doneSucceed(e) {
            if (this._doneStack.length === 0) return this._done = uo(e), this._currentChannel = void 0, Bp();
            const n = this._doneStack[this._doneStack.length - 1];
            if (n._tag === Z_) {
                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 = uo(e), this._currentChannel = void 0, Bp();
            const s = bS(r.map((o)=>o.finalizer), uo(e));
            this.storeInProgressFinalizer(s);
            const i = V(s, Hf(Dn(()=>this.clearInProgressFinalizer())), fm, Ge(()=>Dn(()=>this.doneSucceed(e))));
            return Lb(i);
        }
        doneHalt(e) {
            if (this._doneStack.length === 0) return this._done = ea(e), this._currentChannel = void 0, Bp();
            const n = this._doneStack[this._doneStack.length - 1];
            if (n._tag === Z_) {
                this._doneStack.pop();
                try {
                    this._currentChannel = n.onHalt(e);
                } catch (o) {
                    this._currentChannel = lr(Lk(o));
                }
                return;
            }
            const r = this.popNextFinalizers();
            if (this._doneStack.length === 0) return this._doneStack = r.reverse(), this._done = ea(e), this._currentChannel = void 0, Bp();
            const s = bS(r.map((o)=>o.finalizer), ea(e));
            this.storeInProgressFinalizer(s);
            const i = V(s, Hf(Dn(()=>this.clearInProgressFinalizer())), fm, Ge(()=>Dn(()=>this.doneHalt(e))));
            return Lb(i);
        }
        processCancellation() {
            return this._currentChannel = void 0, this._done = this._cancelled, this._cancelled = void 0, Bp();
        }
        runBracketOut(e) {
            const n = fm(ho(this.provide(e.acquire()), {
                onFailure: (r)=>Dn(()=>{
                        this._currentChannel = lr(r);
                    }),
                onSuccess: (r)=>Dn(()=>{
                        this.addFinalizer((s)=>this.provide(e.finalizer(r, s))), this._currentChannel = ln(r);
                    })
            }));
            return Lb(n);
        }
        provide(e) {
            return this._providedEnv === void 0 ? e : V(e, Bd(this._providedEnv));
        }
        runEnsuring(e) {
            this.addFinalizer(e.finalizer), this._currentChannel = e.channel;
        }
        addFinalizer(e) {
            this._doneStack.push(new qPe(e));
        }
        runSubexecutor() {
            const e = this._activeSubexecutor;
            switch(e._tag){
                case OG:
                    return this.pullFromChild(e.childExecutor, e.parentSubexecutor, e.onEmit, e);
                case Yk:
                    return this.pullFromUpstream(e);
                case Qk:
                    return this.drainChildExecutors(e);
                case MG:
                    return this._emitted = e.value, this._activeSubexecutor = e.next, fS();
            }
        }
        replaceSubexecutor(e) {
            this._currentChannel = void 0, this._activeSubexecutor = e;
        }
        finishWithExit(e) {
            const n = Sc(e, {
                onFailure: (r)=>this.doneHalt(r),
                onSuccess: (r)=>this.doneSucceed(r)
            });
            return this._activeSubexecutor = void 0, n === void 0 ? an : sOe(n);
        }
        finishSubexecutorWithCloseEffect(e, ...n) {
            this.addFinalizer(()=>V(n, Va((s)=>V(Dn(()=>s(e)), Ge((i)=>i !== void 0 ? i : an)), {
                    discard: !0
                })));
            const r = V(e, Sc({
                onFailure: (s)=>this.doneHalt(s),
                onSuccess: (s)=>this.doneSucceed(s)
            }));
            return this._activeSubexecutor = void 0, r;
        }
        applyUpstreamPullStrategy(e, n, r) {
            switch(r._tag){
                case fG:
                    {
                        const s = !e || n.some((i)=>i !== void 0);
                        return [
                            r.emitSeparator,
                            s ? [
                                void 0,
                                ...n
                            ] : n
                        ];
                    }
                case KPe:
                    {
                        const s = !e || n.some((i)=>i !== void 0);
                        return [
                            r.emitSeparator,
                            s ? [
                                ...n,
                                void 0
                            ] : n
                        ];
                    }
            }
        }
        pullFromChild(e, n, r, s) {
            return hS(e, Ft, (i)=>{
                const o = r(i);
                switch(o._tag){
                    case cG:
                        break;
                    case LPe:
                        {
                            this.finishWithDoneValue(e, n, o.value);
                            break;
                        }
                    case zPe:
                        {
                            const a = n.enqueuePullFromChild(s);
                            this.replaceSubexecutor(a);
                            break;
                        }
                }
                this._activeSubexecutor = new pS(i, this._activeSubexecutor);
            }, Sc({
                onFailure: (i)=>{
                    const o = this.handleSubexecutorFailure(e, n, i);
                    return o === void 0 ? void 0 : BV(o);
                },
                onSuccess: (i)=>{
                    this.finishWithDoneValue(e, n, i);
                }
            }));
        }
        finishWithDoneValue(e, n, r) {
            const s = n;
            switch(s._tag){
                case Yk:
                    {
                        const i = new Bf(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(uo(r)), this.replaceSubexecutor(i);
                        break;
                    }
                case Qk:
                    {
                        const i = new Jp(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(uo(r)), this.replaceSubexecutor(i);
                        break;
                    }
            }
        }
        handleSubexecutorFailure(e, n, r) {
            return this.finishSubexecutorWithCloseEffect(ea(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 Bf(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 t_(n.childExecutor, r, n.onEmit));
        }
        performPullFromUpstream(e) {
            return hS(e.upstreamExecutor, (n)=>{
                const r = this._closeLastSubstream === void 0 ? an : 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), ht(()=>{
                        const a = new qf(e.createChild(n), this._providedEnv, this._executeCloseLastSubstream);
                        a._input = this._input;
                        const [c, l] = this.applyUpstreamPullStrategy(!1, e.activeChildExecutors, e.onPull(DV(n)));
                        this._activeSubexecutor = new t_(a, new Bf(e.upstreamExecutor, e.createChild, e.lastDone, l, e.combineChildResults, e.combineWithChildResult, e.onPull, e.onEmit), e.onEmit), nr(c) && (this._activeSubexecutor = new pS(c.value, this._activeSubexecutor));
                    }));
                }
                const r = new qf(e.createChild(n), this._providedEnv, this._executeCloseLastSubstream);
                r._input = this._input;
                const [s, i] = this.applyUpstreamPullStrategy(!1, e.activeChildExecutors, e.onPull(DV(n)));
                this._activeSubexecutor = new t_(r, new Bf(e.upstreamExecutor, e.createChild, e.lastDone, i, e.combineChildResults, e.combineWithChildResult, e.onPull, e.onEmit), e.onEmit), nr(s) && (this._activeSubexecutor = new pS(s.value, this._activeSubexecutor));
            }, (n)=>{
                if (e.activeChildExecutors.some((i)=>i !== void 0)) {
                    const i = new Jp(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), ht(()=>this.replaceSubexecutor(i)));
                    }
                    this.replaceSubexecutor(i);
                    return;
                }
                const r = this._closeLastSubstream, s = this.finishSubexecutorWithCloseEffect(V(n, KSe((i)=>e.combineWithChildResult(e.lastDone, i))), ()=>r, (i)=>e.upstreamExecutor.close(i));
                return s === void 0 ? void 0 : BV(s);
            });
        }
        drainChildExecutors(e) {
            if (e.activeChildExecutors.length === 0) {
                const i = this._closeLastSubstream;
                return i !== void 0 && this.addFinalizer(()=>Gt(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(uOe(r.reduce((a, c)=>c !== void 0 ? a + 1 : a, 0))));
                return this.replaceSubexecutor(new Jp(e.upstreamExecutor, e.lastDone, o, e.upstreamDone, e.combineChildResults, e.combineWithChildResult, e.onPull)), nr(i) ? (this._emitted = i.value, fS()) : void 0;
            }
            const s = new Jp(e.upstreamExecutor, e.lastDone, r, e.upstreamDone, e.combineChildResults, e.combineWithChildResult, e.onPull);
            this.replaceSubexecutor(new t_(n.childExecutor, s, n.onEmit));
        }
    }
    const gS = (t)=>t !== void 0 ? t : an, bS = (t, e)=>V(Va(t, (n)=>xs(n(e))), ht((n)=>V(jSe(n), xr(()=>x3))), Ge((n)=>ar(()=>n))), cA = (t, e, n)=>{
        const r = [
            t
        ], s = ()=>{
            const i = r.pop();
            if (i === void 0 || i.upstream === void 0) return FX("Unexpected end of input for channel execution");
            const o = i.upstream.run();
            switch(o._tag){
                case X1:
                    {
                        const a = i.onEmit(i.upstream.getEmit());
                        return r.length === 0 ? a === void 0 ? ar(e) : V(a, ho({
                            onFailure: n,
                            onSuccess: e
                        })) : a === void 0 ? ar(()=>s()) : V(a, ho({
                            onFailure: n,
                            onSuccess: ()=>s()
                        }));
                    }
                case $1:
                    {
                        const a = i.onDone(i.upstream.getDone());
                        return r.length === 0 ? a === void 0 ? ar(e) : V(a, ho({
                            onFailure: n,
                            onSuccess: e
                        })) : a === void 0 ? ar(()=>s()) : V(a, ho({
                            onFailure: n,
                            onSuccess: ()=>s()
                        }));
                    }
                case db:
                    return r.push(i), V(i.onEffect(o.effect), HI((a)=>ar(()=>{
                            const c = i.onDone(ea(a));
                            return c === void 0 ? an : c;
                        })), ho({
                        onFailure: n,
                        onSuccess: ()=>s()
                    }));
                case G1:
                    return r.push(i), r.push(o), ar(()=>s());
            }
        };
        return s();
    }, lA = j(2, (t, e)=>{
        const n = (r, s, i)=>dAe(Dn(()=>new qf(t, void 0, Ft)), (o)=>ar(()=>J_(o.run(), o).pipe(KX(r), kn(Ar(r)), V3(Ar(s)))), (o, a)=>{
                const c = o.close(a);
                return c === void 0 ? an : KI(c, (l)=>Ey(i, xo(l)));
            });
        return Py((r)=>Ay([
                uX(e, cx),
                ri(),
                ri()
            ]).pipe(Ge(([s, i, o])=>r(n(i, o, s)).pipe(mi(e), Ge((a)=>e.addFinalizer((c)=>{
                        const l = GC(c) ? yEe(c.cause) : void 0;
                        return mk(i).pipe(Ge((u)=>u ? Qo(o, void 0).pipe(kn(gX(a)), kn(vV(a))) : Qo(o, void 0).pipe(kn(l && i0(l) > 0 ? gCe(a, O5e(l)) : Ac(a)), kn(vV(a)))));
                    }).pipe(kn(r(Ar(i)))))))));
    }), J_ = (t, e)=>{
        const n = t;
        switch(n._tag){
            case db:
                return V(n.effect, Ge(()=>J_(e.run(), e)));
            case X1:
                return J_(e.run(), e);
            case $1:
                return ar(()=>e.getDone());
            case G1:
                return cA(n, ()=>J_(e.run(), e), xo);
        }
    }, dOe = "Done", fOe = "Await", hOe = "effect/ChannelMergeDecision", pOe = Symbol.for(hOe), gOe = {
        [pOe]: {
            _R: (t)=>t,
            _E0: (t)=>t,
            _Z0: (t)=>t,
            _E: (t)=>t,
            _Z: (t)=>t
        }
    }, FV = (t)=>{
        const e = Object.create(gOe);
        return e._tag = fOe, e.f = t, e;
    }, NG = "BothRunning", VG = "LeftDone", BG = "RightDone", bOe = "effect/ChannelMergeState", LV = Symbol.for(bOe), uA = {
        [LV]: LV
    }, mS = (t, e)=>{
        const n = Object.create(uA);
        return n._tag = NG, n.left = t, n.right = e, n;
    }, zV = (t)=>{
        const e = Object.create(uA);
        return e._tag = VG, e.f = t, e;
    }, UV = (t)=>{
        const e = Object.create(uA);
        return e._tag = BG, e.f = t, e;
    }, DG = "BackPressure", FG = "BufferSliding", mOe = "effect/ChannelMergeStrategy", HV = Symbol.for(mOe), LG = {
        [HV]: HV
    }, yOe = (t)=>{
        const e = Object.create(LG);
        return e._tag = DG, e;
    }, wOe = (t)=>{
        const e = Object.create(LG);
        return e._tag = FG, e;
    }, _Oe = j(2, (t, { onBackPressure: e, onBufferSliding: n })=>{
        switch(t._tag){
            case DG:
                return e();
            case FG:
                return n();
        }
    }), Wp = "Empty", hm = "Emit", pm = "Error", gm = "Done", zG = (t)=>({
            _tag: Wp,
            notifyProducer: t
        }), yS = (t)=>({
            _tag: hm,
            notifyConsumers: t
        }), xOe = (t)=>({
            _tag: pm,
            cause: t
        }), vOe = (t)=>({
            _tag: gm,
            done: t
        });
    class SOe {
        ref;
        constructor(e){
            this.ref = e;
        }
        awaitRead() {
            return Tl(Rf(this.ref, (e)=>e._tag === Wp ? [
                    Ar(e.notifyProducer),
                    e
                ] : [
                    an,
                    e
                ]));
        }
        get close() {
            return hAe((e)=>this.error(gEe(e)));
        }
        done(e) {
            return Tl(Rf(this.ref, (n)=>{
                switch(n._tag){
                    case Wp:
                        return [
                            Ar(n.notifyProducer),
                            n
                        ];
                    case hm:
                        return [
                            Va(n.notifyConsumers, (r)=>Qo(r, Qe(e)), {
                                discard: !0
                            }),
                            vOe(e)
                        ];
                    case pm:
                        return [
                            Vp,
                            n
                        ];
                    case gm:
                        return [
                            Vp,
                            n
                        ];
                }
            }));
        }
        emit(e) {
            return Ge(ri(), (n)=>Tl(Rf(this.ref, (r)=>{
                    switch(r._tag){
                        case Wp:
                            return [
                                Ar(r.notifyProducer),
                                r
                            ];
                        case hm:
                            {
                                const s = r.notifyConsumers[0], i = r.notifyConsumers.slice(1);
                                if (s !== void 0) return [
                                    Qo(s, lt(e)),
                                    i.length === 0 ? zG(n) : yS(i)
                                ];
                                throw new Error("Bug: Channel.SingleProducerAsyncInput.emit - Queue was empty! please report an issue at https://github.com/Effect-TS/effect/issues");
                            }
                        case pm:
                            return [
                                Vp,
                                r
                            ];
                        case gm:
                            return [
                                Vp,
                                r
                            ];
                    }
                })));
        }
        error(e) {
            return Tl(Rf(this.ref, (n)=>{
                switch(n._tag){
                    case Wp:
                        return [
                            Ar(n.notifyProducer),
                            n
                        ];
                    case hm:
                        return [
                            Va(n.notifyConsumers, (r)=>CW(r, e), {
                                discard: !0
                            }),
                            xOe(e)
                        ];
                    case pm:
                        return [
                            Vp,
                            n
                        ];
                    case gm:
                        return [
                            Vp,
                            n
                        ];
                }
            }));
        }
        get take() {
            return this.takeWith((e)=>ea(O3(e, Qe)), (e)=>uo(e), (e)=>IW(lt(e)));
        }
        takeWith(e, n, r) {
            return Ge(ri(), (s)=>Tl(Rf(this.ref, (i)=>{
                    switch(i._tag){
                        case Wp:
                            return [
                                kn(Qo(i.notifyProducer, void 0), Oy(Ar(s), {
                                    onFailure: e,
                                    onSuccess: cr({
                                        onLeft: r,
                                        onRight: n
                                    })
                                })),
                                yS([
                                    s
                                ])
                            ];
                        case hm:
                            return [
                                Oy(Ar(s), {
                                    onFailure: e,
                                    onSuccess: cr({
                                        onLeft: r,
                                        onRight: n
                                    })
                                }),
                                yS([
                                    ...i.notifyConsumers,
                                    s
                                ])
                            ];
                        case pm:
                            return [
                                Gt(e(i.cause)),
                                i
                            ];
                        case gm:
                            return [
                                Gt(r(i.done)),
                                i
                            ];
                    }
                })));
        }
    }
    const dA = ()=>V(ri(), Ge((t)=>Ml(zG(t))), ht((t)=>new SOe(t))), kOe = j(2, (t, e)=>fA(t, ()=>e)), TOe = j(2, (t, e)=>oA(t, (n)=>cr(z1(n), {
                onLeft: e,
                onRight: lr
            }))), Ix = j(2, (t, e)=>QPe(t, e, ()=>{}, ()=>{})), fb = (t)=>{
        const e = Oi({
            onInput: ()=>e,
            onFailure: lr,
            onDone: gd
        });
        return jr(t, e);
    }, UG = j(2, (t, e)=>eOe(t, ()=>e)), EOe = (t)=>Ht(t, Ft), q3 = (t)=>Hr(t.takeWith(lr, (e)=>Ht(ln(e), ()=>q3(t)), gd)), HG = ()=>Qd({
            onInput: (t)=>Ht(ln(t), ()=>HG()),
            onFailure: vo,
            onDone: ca
        }), fA = j(2, (t, e)=>Ht(t, (n)=>H3(()=>e(n)))), COe = j(2, (t, e)=>IOe(t, O3(e))), IOe = j(2, (t, e)=>oA(t, (n)=>lr(e(n)))), K3 = j(2, (t, e)=>{
        const n = Qd({
            onInput: (r)=>Ht(ln(e(r)), ()=>n),
            onFailure: vo,
            onDone: ca
        });
        return jr(t, n);
    }), jG = j(2, (t, e)=>{
        const n = Oi({
            onInput: (r)=>V(Wn(e(r)), Ht(ln), Ht(()=>n)),
            onFailure: lr,
            onDone: ca
        });
        return jr(t, n);
    }), AOe = j(3, (t, e, n)=>W3((r)=>Gn(function*() {
                const s = yield* dA(), i = q3(s), o = yield* My(n);
                yield* Ey(r, Dh(o));
                const a = yield* ri(), c = n === Number.POSITIVE_INFINITY ? (d)=>Ft : (yield* $I(n)).withPermits;
                yield* (yield* i.pipe(jr(t), ah(r))).pipe(ho({
                    onFailure: (d)=>js(o, xo(d)),
                    onSuccess: cr({
                        onLeft: (d)=>kn(fo(c(n)(an)), ub(js(o, Gt(Qe(d))))),
                        onRight: (d)=>Gn(function*() {
                                const f = yield* ri(), p = yield* ri();
                                yield* js(o, ht(Ar(f), lt)), yield* Qo(p, void 0).pipe(kn(Py((h)=>xs(h(Ar(a))).pipe(mAe(xs(h(e(d)))), Ge(Ft))).pipe(KI((h)=>CW(a, h)), KX(f))), c(1), mi(r)), yield* Ar(p);
                            })
                    })
                }), yAe, fo, mi(r));
                const u = Hr(Oy(Tl(Ex(o)), {
                    onFailure: lr,
                    onSuccess: cr({
                        onLeft: ca,
                        onRight: (d)=>Ht(ln(d), ()=>u)
                    })
                }));
                return aA(u, s);
            }))), POe = (t)=>(e)=>OOe(t)(e, L2), OOe = ({ bufferSize: t = 16, concurrency: e, mergeStrategy: n = yOe() })=>(r, s)=>W3((i)=>Gn(function*() {
                    const o = e === "unbounded" ? Number.MAX_SAFE_INTEGER : e, a = yield* dA(), c = q3(a), l = yield* My(t);
                    yield* Ey(i, Dh(l));
                    const u = yield* nA();
                    yield* Ey(i, Dh(u));
                    const d = yield* Ml(Ve()), f = yield* ri(), p = (yield* $I(o)).withPermits, h = yield* ah(jr(c, r), i);
                    function b(_) {
                        return _.pipe(Ge(cr({
                            onLeft: (v)=>Gt(Fe(v)),
                            onRight: (v)=>Ba(js(l, Gt(lt(v))), Ve())
                        })), Gk({
                            until: (v)=>nr(v)
                        }), Ge((v)=>QW(d, un({
                                onNone: ()=>Fe(v.value),
                                onSome: (w)=>Fe(s(w, v.value))
                            }))), HI((v)=>Sy(v) ? xo(v) : js(l, xo(v)).pipe(kn(Qo(f, void 0)), ub)));
                    }
                    yield* h.pipe(ho({
                        onFailure: (_)=>js(l, xo(_)).pipe(kn(Gt(!1))),
                        onSuccess: cr({
                            onLeft: (_)=>qI(fo(Ar(f)), fo(p(o)(an)), {
                                    onSelfDone: (v, w)=>Ba(Ac(w), !1),
                                    onOtherDone: (v, w)=>kn(Ac(w), Xo(d).pipe(Ge(un({
                                            onNone: ()=>js(l, Gt(Qe(_))),
                                            onSome: (E)=>js(l, Gt(Qe(s(E, _))))
                                        })), Ba(!1)))
                                }),
                            onRight: (_)=>_Oe(n, {
                                    onBackPressure: ()=>Gn(function*() {
                                            const v = yield* ri(), w = Xk((I)=>ah(jr(c, _), I).pipe(Ge((D)=>dS(xs(b(D)), xs(fo(Ar(f))))), Ge(Ft)));
                                            return yield* Qo(v, void 0).pipe(kn(w), p(1), mi(i)), yield* Ar(v), !(yield* mk(f));
                                        }),
                                    onBufferSliding: ()=>Gn(function*() {
                                            const v = yield* ri(), w = yield* ri(), E = yield* BPe(u);
                                            yield* Ex(u).pipe(Ge((U)=>Qo(U, void 0)), WX(()=>E >= o)), yield* js(u, v);
                                            const I = Xk((U)=>ah(jr(c, _), U).pipe(Ge((K)=>xs(b(K)).pipe(dS(xs(fo(Ar(f)))), dS(xs(fo(Ar(v)))))), Ge(Ft)));
                                            return yield* Qo(w, void 0).pipe(kn(I), p(1), mi(i)), yield* Ar(w), !(yield* mk(f));
                                        })
                                })
                        })
                    }), Gk({
                        while: (_)=>_
                    }), mi(i));
                    const y = V(Ex(l), Tl, Oy({
                        onFailure: lr,
                        onSuccess: cr({
                            onLeft: ca,
                            onRight: (_)=>Ht(ln(_), ()=>y)
                        })
                    }), Hr);
                    return aA(y, a);
                })), qG = j(3, (t, e, n)=>POe(n)(K3(t, e))), MOe = j(2, (t, e)=>{
        function n(r) {
            return Gn(function*() {
                const s = yield* dA(), i = q3(s), o = yield* ah(jr(i, t), r), a = yield* ah(jr(i, e.other), r);
                function c(u, d, f) {
                    return (p, h, b)=>{
                        function y(_) {
                            const v = _;
                            return v._tag === dOe ? Gt(Wn(kn(Ac(d), v.effect))) : ht(gX(d), Sc({
                                onFailure: (w)=>Wn(v.f(ea(w))),
                                onSuccess: cr({
                                    onLeft: (w)=>Wn(v.f(uo(w))),
                                    onRight: (w)=>Fh(ln(w), l(b(v.f)))
                                })
                            }));
                        }
                        return Sc(u, {
                            onFailure: (_)=>y(p(ea(_))),
                            onSuccess: cr({
                                onLeft: (_)=>y(p(uo(_))),
                                onRight: (_)=>Gt(Ht(ln(_), ()=>Ht(Wn(mi(fo(f), r)), (v)=>l(h(v, d)))))
                            })
                        });
                    };
                }
                function l(u) {
                    switch(u._tag){
                        case NG:
                            {
                                const d = fo(Nf(u.left)), f = fo(Nf(u.right));
                                return Hr(qI(d, f, {
                                    onSelfDone: (p, h)=>kn(Ac(h), c(p, u.right, o)(e.onSelfDone, mS, (b)=>zV(b))),
                                    onOtherDone: (p, h)=>kn(Ac(h), c(p, u.left, a)(e.onOtherDone, (b, y)=>mS(y, b), (b)=>UV(b)))
                                }));
                            }
                        case VG:
                            return Hr(ht(xs(a), Sc({
                                onFailure: (d)=>Wn(u.f(ea(d))),
                                onSuccess: cr({
                                    onLeft: (d)=>Wn(u.f(uo(d))),
                                    onRight: (d)=>Ht(ln(d), ()=>l(zV(u.f)))
                                })
                            })));
                        case BG:
                            return Hr(ht(xs(o), Sc({
                                onFailure: (d)=>Wn(u.f(ea(d))),
                                onSuccess: cr({
                                    onLeft: (d)=>Wn(u.f(uo(d))),
                                    onRight: (d)=>Ht(ln(d), ()=>l(UV(u.f)))
                                })
                            })));
                    }
                }
                return Wn($k((u)=>{
                    const d = $k((h)=>(h.transferChildren(u.scope()), an)), f = fo(o).pipe(Hf(d), mi(r)), p = fo(a).pipe(Hf(d), mi(r));
                    return B3(f, p, (h, b)=>mS(h, b));
                })).pipe(Ht(l), aA(s));
            });
        }
        return W3(n);
    }), Ry = j(2, (t, e)=>W1(()=>{
            let n;
            const r = Qd({
                onInput: (i)=>Ht(ln(i), ()=>r),
                onFailure: (i)=>(n = DOe(i), lr(Lk(n))),
                onDone: ca
            }), s = Oi({
                onInput: (i)=>V(ln(i), Ht(()=>s)),
                onFailure: (i)=>mEe(i) && FOe(i.defect) && Lt(i.defect, n) ? vo(i.defect.error) : lr(i),
                onDone: ca
            });
            return jr(jr(jr(t, r), e), s);
        })), Y_ = (t)=>Xk((e)=>lA(t, e)), ROe = (t)=>Y_(fb(t)), KG = (t)=>fAe((e)=>lA(t, e)), WG = (t)=>Hr(Py((e)=>ht(hg(), (n)=>YPe(KI(e(GEe(t, n)), (r)=>Nd(n, ea(r))), (r, s)=>Nd(n, s))))), $G = (t)=>VOe(ht(zX, (e)=>Ht(Wn(t(e)), ln))), NOe = (t)=>Ge(zX, (e)=>ah(t, e)), ah = j(2, (t, e)=>Sx(Dn(()=>new qf(t, void 0, Ft)), WI()).pipe($X(([n, r])=>XEe(e, (s)=>{
                const i = n.close(s);
                return i !== void 0 ? Bd(i, r) : an;
            })), fm, ht(([n])=>ar(()=>eT(n.run(), n))))), eT = (t, e)=>{
        const n = t;
        switch(n._tag){
            case $1:
                return Sc(e.getDone(), {
                    onFailure: xo,
                    onSuccess: (r)=>Gt(Qe(r))
                });
            case X1:
                return Gt(lt(e.getEmit()));
            case db:
                return V(n.effect, Ge(()=>eT(e.run(), e)));
            case G1:
                return cA(n, ()=>eT(e.run(), e), (r)=>xo(r));
        }
    }, Hr = (t)=>EOe(Wn(t)), VOe = (t)=>AG(WG(t), (e, n)=>e, (e, n)=>e), W3 = (t)=>AG($G(t), (e, n)=>e, (e, n)=>e), $3 = (t)=>XG(0, t.length, t), XG = (t, e, n)=>t === e ? os : V(ln(V(n, Ra(t))), Ht(()=>XG(t + 1, e, n))), BOe = j((t)=>CG(t[1]), (t, e, n)=>n?.concurrent ? MOe(t, {
            other: e,
            onSelfDone: (r)=>FV((s)=>ar(()=>DN(r, s))),
            onOtherDone: (r)=>FV((s)=>ar(()=>DN(s, r)))
        }) : Ht(t, (r)=>fA(e, (s)=>[
                    r,
                    s
                ]))), Fh = j((t)=>CG(t[1]), (t, e, n)=>n?.concurrent ? fA(BOe(t, e, {
            concurrent: !0
        }), (r)=>r[1]) : Ht(t, ()=>e)), tT = Symbol.for("effect/Channel/ChannelException"), DOe = (t)=>({
            _tag: "ChannelException",
            [tT]: tT,
            error: t
        }), FOe = (t)=>Vt(t, tT), LOe = Symbol.for("effect/Sink"), zOe = {
        _A: (t)=>t,
        _In: (t)=>t,
        _L: (t)=>t,
        _E: (t)=>t,
        _R: (t)=>t
    };
    class ef {
        channel;
        [LOe] = zOe;
        constructor(e){
            this.channel = e;
        }
        pipe() {
            return xt(this, arguments);
        }
    }
    const GG = (t)=>new ef(W1(()=>pg(t()))), UOe = ()=>new ef(ZG(Cn())), ZG = (t)=>Oi({
            onInput: (e)=>ZG(V(t, _r(e))),
            onFailure: lr,
            onDone: ()=>gd(t)
        }), HOe = (t)=>GG(()=>$Oe(JG(t, Cn()))), JG = (t, e)=>Oi({
            onInput: (n)=>{
                const [r, s] = cK(n, t);
                return r.length < t ? JG(t - r.length, _r(e, r)) : jg(s) ? gd(_r(e, r)) : Ht(ln(s), ()=>gd(_r(e, r)));
            },
            onFailure: lr,
            onDone: ()=>gd(e)
        }), jOe = new ef(fb(HG())), qOe = (t, e, n)=>GG(()=>new ef(YG(t, e, n))), YG = (t, e, n)=>e(t) ? Qd({
            onInput: (r)=>{
                const [s, i] = QG(t, r, e, n, 0, r.length);
                return oa(i) ? V(ln(i), kOe(s)) : YG(s, e, n);
            },
            onFailure: vo,
            onDone: ()=>ca(t)
        }) : ca(t), QG = (t, e, n, r, s, i)=>{
        if (s === i) return [
            t,
            Cn()
        ];
        const o = r(t, V(e, Ra(s)));
        return n(o) ? QG(o, e, n, r, s + 1, i) : [
            o,
            V(e, Cd(s + 1))
        ];
    }, KOe = (t)=>{
        const e = Oi({
            onInput: (n)=>V(Wn(Va(n, (r)=>t(r), {
                    discard: !0
                })), Ht(()=>e)),
            onFailure: lr,
            onDone: ()=>os
        });
        return new ef(e);
    }, WOe = (t)=>{
        const e = Oi({
            onInput: (n)=>V(Wn(t(n)), Ht(()=>e)),
            onFailure: lr,
            onDone: ()=>os
        });
        return new ef(e);
    }, $Oe = (t)=>new ef(t), XOe = (t)=>new ef(Wn(t)), GOe = ()=>qOe(Ve(), Zr, (t, e)=>un(t, {
                onNone: ()=>Fe(e),
                onSome: ()=>t
            })), pg = (t)=>cb(t) ? pg(XOe(t)) : t.channel, ZOe = Symbol.for("effect/RcRef"), nT = {
        _tag: "Empty"
    }, JOe = {
        _tag: "Closed"
    }, YOe = {
        _A: Ft,
        _E: Ft
    };
    class QOe extends Kc {
        acquire;
        context;
        scope;
        idleTimeToLive;
        [ZOe] = YOe;
        [Rd] = Rd;
        state = nT;
        semaphore = MI(1);
        constructor(e, n, r, s){
            super(), this.acquire = e, this.context = n, this.scope = r, this.idleTimeToLive = s, this.get = eZ(this);
        }
        get;
        commit() {
            return this.get;
        }
    }
    const eMe = (t)=>dn((e)=>{
            const n = e.getFiberRef(fa), r = Ec(n, Fa), s = new QOe(t.acquire, n, r, t.idleTimeToLive ? Ei(t.idleTimeToLive) : void 0);
            return Ss(r.addFinalizer(()=>s.semaphore.withPermits(1)(Ct(()=>{
                    const i = s.state._tag === "Acquired" ? lg(s.state.scope, ni) : mn;
                    return s.state = JOe, i;
                }))), s);
        }), eZ = (t)=>{
        const e = t, n = e.idleTimeToLive && !v3e(e.idleTimeToLive);
        return Eo((r)=>Ct(()=>{
                switch(e.state._tag){
                    case "Closed":
                        return ss;
                    case "Acquired":
                        return e.state.refCount++, e.state.fiber ? Ss(f3(e.state.fiber), e.state) : ze(e.state);
                    case "Empty":
                        return ib().pipe(eV("scope"), Sk("value", ({ scope: s })=>r(Jg(e.acquire, fa, wc(e.context, Fa, s)))), kt(({ 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), eV("state"), Sk("scope", ()=>Fa), cg(({ scope: r, state: s })=>r.addFinalizer(()=>Ct(()=>(s.refCount--, s.refCount > 0 || n ? mn : e.idleTimeToLive === void 0 ? (e.state = nT, lg(s.scope, ni)) : cI(e.idleTimeToLive).pipe(P1, Ur(Ct(()=>e.state._tag === "Acquired" && e.state.refCount === 0 ? (e.state = nT, lg(s.scope, ni)) : mn)), fg(Ue(()=>{
                        s.fiber = void 0;
                    })), RI(e.scope), cg((i)=>{
                        s.fiber = i;
                    }), e.semaphore.withPermits(1)))))), kt(({ state: r })=>r.value));
    }, tMe = eMe, nMe = eZ, rMe = M3, sMe = yX, X3 = zI, Z1 = DIe, iMe = LIe, hA = N3, oMe = HIe, J1 = qIe, tZ = Iy, aMe = (t)=>Object.assign(t, {
            chunk (n) {
                return this(Gt(n));
            },
            die (n) {
                return this(sAe(n));
            },
            dieMessage (n) {
                return this(FX(n));
            },
            done (n) {
                return this(ar(()=>WSe(n, {
                        onFailure: Fe,
                        onSuccess: Pn
                    })));
            },
            end () {
                return this(Bs(Ve()));
            },
            fail (n) {
                return this(Bs(Fe(n)));
            },
            fromEffect (n) {
                return this(LX(n, {
                    onFailure: Fe,
                    onSuccess: Pn
                }));
            },
            fromEffectChunk (n) {
                return this(V(n, Vd(Fe)));
            },
            halt (n) {
                return this(xo(V(n, O3(Fe))));
            },
            single (n) {
                return this(Gt(Pn(n)));
            }
        }), cMe = Symbol.for("effect/Stream/Handoff"), nZ = "Empty", rZ = "Full", sZ = (t)=>({
            _tag: nZ,
            notifyConsumer: t
        }), lMe = (t, e)=>({
            _tag: rZ,
            value: t,
            notifyProducer: e
        }), iZ = (t, e)=>(n)=>{
            switch(n._tag){
                case nZ:
                    return t(n.notifyConsumer);
                case rZ:
                    return e(n.value, n.notifyProducer);
            }
        }, uMe = {
        _A: (t)=>t
    }, dMe = ()=>V(ri(), Ge((t)=>Ml(sZ(t))), ht((t)=>({
                [cMe]: uMe,
                ref: t
            }))), Af = j(2, (t, e)=>Ge(ri(), (n)=>Tl(Rf(t.ref, (r)=>V(r, iZ((s)=>[
                        kn(Qo(s, void 0), Ar(n)),
                        lMe(e, n)
                    ], (s, i)=>[
                        Ge(Ar(i), ()=>V(t, Af(e))),
                        r
                    ])))))), oZ = (t)=>Ge(ri(), (e)=>Tl(Rf(t.ref, (n)=>V(n, iZ((r)=>[
                        Ge(Ar(r), ()=>oZ(t)),
                        n
                    ], (r, s)=>[
                        Ba(Qo(s, void 0), r),
                        sZ(e)
                    ]))))), aZ = "Emit", cZ = "Halt", lZ = "End", fMe = (t)=>({
            _tag: aZ,
            elements: t
        }), jV = (t)=>({
            _tag: cZ,
            cause: t
        }), wS = (t)=>({
            _tag: lZ,
            reason: t
        }), hMe = "effect/Take", pMe = Symbol.for(hMe), gMe = {
        _A: (t)=>t,
        _E: (t)=>t
    };
    class G3 {
        exit;
        [pMe] = gMe;
        constructor(e){
            this.exit = e;
        }
        pipe() {
            return xt(this, arguments);
        }
    }
    const Ax = (t)=>new G3(uo(t)), bMe = (t)=>ar(()=>t.exit), Px = new G3(IW(Ve())), pA = (t)=>new G3(ea(V(t, O3(Fe)))), mMe = (t)=>Oy(t, {
            onFailure: (e)=>un(sX(e), {
                    onNone: ()=>Px,
                    onSome: pA
                }),
            onSuccess: Ax
        }), yMe = (t)=>new G3(uo(Pn(t))), wMe = ()=>Bs(Ve()), _Me = (t)=>Vd(xo(t), Fe), rT = "ScheduleEnd", uZ = "UpstreamEnd", zb = {
        _tag: rT
    }, xMe = {
        _tag: uZ
    }, vMe = "effect/Stream", dZ = Symbol.for(vMe), SMe = {
        _R: (t)=>t,
        _E: (t)=>t,
        _A: (t)=>t
    };
    class Hn {
        channel;
        [dZ] = SMe;
        constructor(e){
            this.channel = e;
        }
        pipe() {
            return xt(this, arguments);
        }
    }
    const Z3 = (t)=>Vt(t, dZ) || cb(t), gA = 4096, kMe = j(3, (t, e, n)=>hZ(TMe(t, e, n), (r)=>cr(r, {
                onLeft: Ve,
                onRight: Fe
            }))), TMe = j(3, (t, e, n)=>{
        const r = Ay([
            dMe(),
            Ml(zb),
            Ml(Cn()),
            X3(n),
            Ml(!1),
            Ml(!1)
        ]);
        return Xa(r).pipe(pu(([s, i, o, a, c, l])=>{
            const u = Oi({
                onInput: (h)=>Ht(Wn(V(s, Af(fMe(h)), WX(()=>oa(h)))), ()=>u),
                onFailure: (h)=>Wn(Af(s, jV(h))),
                onDone: ()=>Wn(Af(s, wS(xMe)))
            }), d = V(YW(o, Cn()), Ge((h)=>oa(h) ? V(so(c, !0), kn(Gt(V(ln(h), Ht(()=>d))))) : V(oZ(s), ht((b)=>{
                    switch(b._tag){
                        case aZ:
                            return V(Wn(so(c, !0)), Fh(ln(b.elements)), Fh(Wn(Xo(l))), Ht((y)=>y ? os : d));
                        case cZ:
                            return lr(b.cause);
                        case lZ:
                            return b.reason._tag === rT ? V(Xo(c), ht((y)=>y ? Wn(V(so(i, zb), kn(so(l, !0)))) : V(Wn(V(so(i, zb), kn(so(l, !0)))), Ht(()=>d))), Hr) : V(so(i, b.reason), kn(so(l, !0)), Wn);
                    }
                }))), Hr), f = (h)=>a.next(h), p = (h, b, y)=>{
                const _ = V(so(c, !1), kn(so(l, !1)), kn(V(d, Ry(pg(e)), VV, Y_, mi(y)))), v = (w, E, I)=>V(so(o, p3e(w)), kn(ht(Xo(i), (D)=>{
                        switch(D._tag){
                            case rT:
                                return V(Ay([
                                    Xo(c),
                                    _,
                                    V(f(Fe(E)), mi(y))
                                ]), ht(([U, K, $])=>{
                                    const ne = V(I, un({
                                        onNone: ()=>Pn(lt(E)),
                                        onSome: (te)=>Rm(lt(E), Qe(te))
                                    }));
                                    return U ? V(ln(ne), Ht(()=>p(K, $, y))) : p(K, $, y);
                                }), Hr);
                            case uZ:
                                return V(Xo(c), ht((U)=>U ? ln(Pn(lt(E))) : os), Hr);
                        }
                    })), Hr);
                return Hr(qI(Nf(h), Nf(b), {
                    onSelfDone: (w, E)=>V(Ac(b), kn(V(ar(()=>w), ht(([I, D])=>v(I, D, Ve()))))),
                    onOtherDone: (w, E)=>ho(ar(()=>w), {
                            onFailure: (I)=>cr(z1(I), {
                                    onLeft: ()=>V(s, Af(wS(zb)), G_, kn(V(Nf(h), ht(([D, U])=>v(D, U, Ve()))))),
                                    onRight: (D)=>V(s, Af(jV(D)), G_, kn(V(Nf(h), ht(([U, K])=>v(U, K, Ve())))))
                                }),
                            onSuccess: (I)=>V(s, Af(wS(zb)), G_, kn(V(Nf(h), ht(([D, U])=>v(D, U, Fe(I))))))
                        })
                }));
            };
            return TZ((h)=>jr(An(t), u).pipe(Y_, mi(h), kn(Ry(d, pg(e)).pipe(VV, Y_, mi(h), Ge((b)=>f(Ve()).pipe(mi(h), ht((y)=>new Hn(p(b, y, h)))))))));
        }));
    }), EMe = (t)=>{
        if (t === "unbounded") return nA();
        if (typeof t == "number" || t === void 0) return My(t ?? 16);
        switch(t.strategy){
            case "dropping":
                return NPe(t.bufferSize ?? 16);
            case "sliding":
                return VPe(t.bufferSize ?? 16);
            default:
                return My(t.bufferSize ?? 16);
        }
    }, CMe = (t, e)=>cp(EMe(e), (n)=>Dh(n)).pipe(Ge((n)=>WI().pipe(Ge((r)=>Dn(()=>{
                    const s = sMe(r);
                    return t(aMe((o)=>mMe(o).pipe(Ge((a)=>js(n, a)), ub, s).then((a)=>{
                            if (GC(a) && !Sy(a.cause)) throw iX(a.cause);
                        })));
                })), ht((r)=>{
                const s = Ex(n).pipe(Ge((i)=>bMe(i)), K1({
                    onFailure: (i)=>Wn(Dh(n)).pipe(Fh(un(i, {
                            onNone: ()=>os,
                            onSome: (o)=>vo(o)
                        }))),
                    onSuccess: (i)=>ln(i).pipe(Ht(()=>s))
                }), Hr);
                return pZ(s).pipe(Ny(r ?? an));
            }))), Y3), IMe = j(2, (t, e)=>ht(_Re(t, e), (n)=>yA(mZ(n)))), AMe = j(2, (t, e)=>ht(tMe({
            acquire: IMe(t, e),
            idleTimeToLive: e.idleTimeToLive
        }), (n)=>Y3(nMe(n)))), fZ = j(2, (t, e)=>PMe(t, (n)=>cr(z1(n), {
                onLeft: e,
                onRight: BMe
            }))), PMe = j(2, (t, e)=>new Hn(V(An(t), oA((n)=>An(e(n)))))), bA = j(2, (t, e)=>new Hn(V(An(t), Fh(An(e))))), OMe = (t)=>new Hn(fb(An(t))), Ny = j(2, (t, e)=>new Hn(V(An(t), UG(e)))), MMe = ()=>Xa(UX()), RMe = (t)=>V(MMe(), pu(t)), NMe = (t)=>OMe(Xa(t)), VMe = (t)=>bZ(Bs(Fe(t))), BMe = (t)=>Xa(xo(t)), DMe = j(2, (t, e)=>wA(t, y1(e))), hZ = j(2, (t, e)=>wA(t, iK(e))), FMe = j(2, (t, e)=>{
        const n = Qd({
            onInput: (r)=>un(m3e(r, e), {
                    onNone: ()=>n,
                    onSome: (s)=>ln(Pn(s))
                }),
            onFailure: vo,
            onDone: ()=>os
        });
        return new Hn(V(An(t), jr(n)));
    }), pu = j((t)=>Z3(t[0]), (t, e, n)=>{
        const r = n?.bufferSize ?? 16;
        return n?.switch ? sT(n?.concurrency, ()=>qV(t, 1, r, e), (s)=>qV(t, s, r, e)) : sT(n?.concurrency, ()=>new Hn(Ix(An(t), (s)=>V(s, aK((i)=>An(e(i))), y3e(os, (i, o)=>V(i, Fh(o)))))), (s)=>new Hn(V(An(t), Ix($3), qG((i)=>An(e(i)), n))));
    }), sT = (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();
        }
    }, qV = j(4, (t, e, n, r)=>new Hn(V(An(t), Ix($3), qG((s)=>An(r(s)), {
            concurrency: e,
            mergeStrategy: wOe(),
            bufferSize: n
        })))), mA = j((t)=>Z3(t[0]), (t, e)=>pu(t, Ft, e)), LMe = (t)=>{
        const e = Oi({
            onInput: (n)=>Ht($3(n), ()=>e),
            onFailure: lr,
            onDone: ()=>os
        });
        return new Hn(V(An(t), jr(e)));
    }, zMe = (t)=>{
        const e = (r, s)=>{
            const [i, o] = V(r, b3e((c)=>!yk(c))), a = V(Gv(o), un({
                onNone: ()=>s,
                onSome: Sc({
                    onFailure: (c)=>un(sX(c), {
                            onNone: ()=>os,
                            onSome: lr
                        }),
                    onSuccess: ()=>os
                })
            }));
            return V(ln(V(i, iK((c)=>yk(c) ? Fe(c.value) : Ve()))), Ht(()=>a));
        }, n = Oi({
            onInput: (r)=>e(r, n),
            onFailure: (r)=>lr(r),
            onDone: ()=>os
        });
        return new Hn(V(An(t), jr(n)));
    }, yA = (t)=>LMe(zMe(V(t, yZ((e)=>e.exit)))), pZ = (t)=>new Hn(t), An = (t)=>{
        if ("channel" in t) return t.channel;
        if (cb(t)) return An(Xa(t));
        throw new TypeError("Expected a Stream.");
    }, gZ = (t)=>new Hn(jg(t) ? os : ln(t)), Xa = (t)=>V(t, Vd(Fe), bZ), bZ = (t)=>new Hn(Hr(K1(t, {
            onFailure: un({
                onNone: ()=>os,
                onSome: vo
            }),
            onSuccess: (e)=>ln(Pn(e))
        }))), mZ = (t, e)=>{
        const n = e?.maxChunkSize ?? gA;
        if (e?.scoped) {
            const s = ht(RV(t), (i)=>Ox(i, {
                    maxChunkSize: n,
                    shutdown: !0
                }));
            return e.shutdown ? ht(s, Ny(Jk(t))) : s;
        }
        const r = pu(SZ(RV(t)), (s)=>Ox(s, {
                maxChunkSize: n
            }));
        return e?.shutdown ? Ny(r, Jk(t)) : r;
    }, UMe = (t)=>J3(()=>uC(t) ? gZ(t) : HMe(t[Symbol.iterator]())), HMe = (t, e = gA)=>V(Dn(()=>{
            let n = [];
            const r = (s)=>V(Dn(()=>{
                    let i = s.next();
                    if (e === 1) return i.done ? os : V(ln(Pn(i.value)), Ht(()=>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(ln(Zi(n)), Ht(()=>r(s))) : os;
                }), Hr);
            return new Hn(r(t));
        }), TRe), Ox = (t, e)=>V(FPe(t, 1, e?.maxChunkSize ?? gA), HI((n)=>V(DPe(t), Ge((r)=>r && Sy(n) ? wMe() : _Me(n)))), xZ, e?.shutdown ? Ny(Dh(t)) : Ft), jMe = (...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 Y3(ht(cp(Dn(()=>e().getReader()), (s)=>r ? Dn(()=>s.releaseLock()) : yl(()=>s.cancel())), (s)=>nRe(Ge(pd({
                try: ()=>s.read(),
                catch: (i)=>Fe(n(i))
            }), ({ done: i, value: o })=>i ? Bs(Ve()) : Gt(o)))));
    }, qMe = j(3, (t, e, n)=>kMe(t, HOe(e), J1(n))), KMe = (...t)=>UMe(t), yZ = j(2, (t, e)=>new Hn(V(An(t), K3(aK(e))))), WMe = j(3, (t, e, n)=>{
        const r = (s)=>Qd({
                onInput: (i)=>{
                    const [o, a] = g3e(i, s, n);
                    return Ht(ln(a), ()=>r(o));
                },
                onFailure: vo,
                onDone: ()=>os
            });
        return new Hn(V(An(t), jr(r(e))));
    }), $Me = j(3, (t, e, n)=>J3(()=>{
            const r = (s)=>Qd({
                    onInput: (i)=>V(ar(()=>{
                            const o = [], a = (c)=>Dn(()=>{
                                    o.push(c);
                                });
                            return V(i, nAe(s, (c, l)=>V(n(c, l), Ge(([u, d])=>V(a(d), Ba(u))))), K1({
                                onFailure: (c)=>o.length !== 0 ? Fh(ln(Zi(o)), vo(c)) : vo(c),
                                onSuccess: (c)=>Ht(ln(Zi(o)), ()=>r(c))
                            }));
                        }), Hr),
                    onFailure: vo,
                    onDone: ()=>os
                });
            return new Hn(V(An(t), Ry(r(e))));
        })), wA = j(2, (t, e)=>new Hn(V(An(t), K3(e)))), XMe = j(2, (t, e)=>V(t, wZ((n)=>To(e(n))))), wZ = j(2, (t, e)=>V(t, wA(oK(e)))), GMe = j(2, (t, e)=>V(t, iT((n)=>V(e(n), ht(To))), wZ(Ft))), iT = j(2, (t, e)=>{
        const n = (r)=>{
            const s = r.next();
            if (s.done) return Oi({
                onInput: (i)=>n(i[Symbol.iterator]()),
                onFailure: lr,
                onDone: gd
            });
            {
                const i = s.value;
                return Hr(ht(e(i), (o)=>Ht(ln(Pn(o)), ()=>n(r))));
            }
        };
        return new Hn(V(An(t), jr(W1(()=>n(Cn()[Symbol.iterator]())))));
    }), ZMe = j(3, (t, e, n)=>new Hn(V(An(t), Ix($3), AOe(n, e), K3(Pn)))), JMe = j(2, (t, e)=>new Hn(V(An(t), COe(e)))), YMe = j(2, (t, e)=>new Hn(V(An(t), PG(e)))), _Z = j(2, (t, e)=>new Hn(W3((n)=>CAe(e, n).pipe(ht((r)=>V(An(t), PG(r))))))), QMe = j(3, (t, e, n)=>eRe(t, e, Xa(n))), eRe = j(3, (t, e, n)=>RMe((r)=>pu(n, (s)=>V(t, YMe(wc(r, e, s)))))), tRe = j(2, (t, e)=>V(t, _Z(V(IAe(), PAe(e))))), xZ = (t)=>kZ(t, (e)=>V(ht(e, (n)=>Fe([
                    n,
                    e
                ])), lb(un({
                onNone: ()=>Gt(Ve()),
                onSome: Bs
            })))), nRe = (t)=>xZ(V(t, ht(Pn))), rRe = (t, e)=>sRe(Gt(t), e), sRe = (t, e)=>pu(Xa(Sx(t, X3(e))), ([n, r])=>{
            const s = HX(tZ, Xo(r.iterationMeta));
            return bA(bRe(n), kRe(n, (i)=>XX(r.next(i), {
                    onFailure: Gt,
                    onSuccess: ()=>ht(s(t), (o)=>Fe([
                                o,
                                o
                            ]))
                })));
        }), iRe = j(2, (t, e)=>X3(e).pipe(ht((n)=>{
            const r = QMe(tZ, Xo(n.iterationMeta)), s = An(r(t)).pipe(jG((i)=>Ba(n.reset, i)), TOe((i)=>n.next(i).pipe(K1({
                    onFailure: ()=>vo(i),
                    onSuccess: ()=>s
                }), Hr)));
            return s;
        }), Hr, pZ)), _A = j(2, (t, e)=>An(t).pipe(Ry(pg(e)), ROe)), oRe = (t)=>_A(t, UOe()), aRe = j(2, (t, e)=>_A(t, WOe(e))), cRe = j(2, (t, e)=>V(t, vZ(KOe(e)))), lRe = (t)=>_A(t, GOe()), uRe = j(2, (t, e)=>V(t, dRe(e))), dRe = j(2, (t, e)=>{
        const n = Oi({
            onInput: (r)=>Ht(ln(Ax(r)), ()=>n),
            onFailure: (r)=>ln(pA(r)),
            onDone: ()=>ln(Px)
        });
        return V(jr(An(t), n), jG((r)=>js(e, r)), fb, KG, ub);
    }), vZ = j(2, (t, e)=>V(An(t), Ry(pg(e)), fb, KG)), fRe = j(2, (t, e)=>hZ(hRe(t, e, {
            onElement: Fe,
            onSchedule: Ve
        }), Ft)), hRe = j(3, (t, e, n)=>{
        const r = (s, i)=>{
            const o = i.next();
            return o.done ? Oi({
                onInput: (a)=>r(s, a[Symbol.iterator]()),
                onFailure: lr,
                onDone: ca
            }) : Hr(XX(s.next(o.value), {
                onFailure: ()=>V(s.last, _Ae, ht((a)=>V(ln(Rm(n.onElement(o.value), n.onSchedule(a))), Ht(()=>r(s, i)))), V3(s.reset)),
                onSuccess: ()=>Gt(V(ln(Pn(n.onElement(o.value))), Ht(()=>r(s, i))))
            }));
        };
        return new Hn(V(Wn(X3(e)), Ht((s)=>V(An(t), jr(r(s, Cn()[Symbol.iterator]()))))));
    }), pRe = j(3, (t, e, n)=>new Hn(V(ln(Pn(e)), Ht(()=>An(V(t, $Me(e, (r, s)=>V(n(r, s), ht((i)=>[
                        i,
                        i
                    ]))))))))), SZ = (t)=>new Hn(UG(WG(V(t, ht(Pn))), an)), gRe = (t)=>new Hn($G((e)=>t(e).pipe(ht(Pn)))), bRe = (t)=>gZ(Pn(t)), J3 = (t)=>new Hn(W1(()=>An(t()))), mRe = j(2, (t, e)=>fZ(t, (n)=>Xa(kn(e(n), Bs(n))))), yRe = (t)=>rRe(void 0, J1(t)), wRe = (t)=>{
        if (typeof t == "number") return MV(t);
        if (t.capacity === "unbounded") return oG({
            replay: t.replay
        });
        switch(t.strategy){
            case "dropping":
                return MPe(t);
            case "sliding":
                return RPe(t);
            default:
                return MV(t);
        }
    }, _Re = j(2, (t, e)=>V(cp(wRe(e), (n)=>Jk(n)), $X((n)=>V(t, uRe(n), q1)))), xRe = (t)=>ht(NOe(An(t)), (e)=>V(e, Vd(Fe), Ge(cr({
                onLeft: ()=>Bs(Ve()),
                onRight: Gt
            })))), vRe = j((t)=>Z3(t[0]), (t, e)=>ht(WI(), (n)=>SRe(t, n, e))), SRe = j((t)=>Z3(t[0]), (t, e, n)=>{
        const r = rMe(e);
        let s, i;
        const o = vAe(!1);
        return new ReadableStream({
            start (a) {
                i = r(aRe(t, (c)=>c.length === 0 ? an : o.whenOpen(Dn(()=>{
                        o.unsafeClose();
                        for (const l of c)a.enqueue(l);
                        s(), s = void 0;
                    })))), i.addObserver((c)=>{
                    try {
                        c._tag === "Failure" ? a.error(iX(c.cause)) : a.close();
                    } catch  {}
                });
            },
            pull () {
                return new Promise((a)=>{
                    s = a, Ki(o.open);
                });
            },
            cancel () {
                if (i) return En(ub(Ac(i)));
            }
        }, n?.strategy);
    }), kZ = (t, e)=>J3(()=>{
            const n = (r)=>Hr(ht(e(r), un({
                    onNone: ()=>os,
                    onSome: ([s, i])=>Ht(ln(s), ()=>n(i))
                })));
            return new Hn(n(t));
        }), kRe = (t, e)=>kZ(t, (n)=>V(e(n), ht(Tc(([r, s])=>[
                    Pn(r),
                    s
                ])))), TRe = (t)=>mA(Xa(t)), Y3 = (t)=>mA(SZ(t)), TZ = (t)=>mA(gRe((e)=>t(e))), EZ = "effect/Redacted", Q_ = qt("effect/Redacted/redactedRegistry", ()=>new WeakMap), CZ = Symbol.for(EZ), ERe = {
        [CZ]: {
            _A: (t)=>t
        },
        pipe () {
            return xt(this, arguments);
        },
        toString () {
            return "<redacted>";
        },
        toJSON () {
            return "<redacted>";
        },
        [Rn] () {
            return "<redacted>";
        },
        [Zt] () {
            return V(St(EZ), bn(St(Q_.get(this))), Jn(this));
        },
        [jt] (t) {
            return CRe(t) && Lt(Q_.get(this), Q_.get(t));
        }
    }, CRe = (t)=>Vt(t, CZ), IRe = (t)=>{
        const e = Object.create(ERe);
        return Q_.set(e, t), e;
    }, xA = rIe, ARe = R3, PRe = dIe, ORe = fIe, MRe = dm, RRe = CX, NRe = pIe, KV = gIe, VRe = bIe, BRe = FI, DRe = vIe, FRe = SIe, LRe = zW, WV = Symbol.for("effect/Encoding/errors/Decode"), $V = (t, e)=>{
        const n = {
            _tag: "DecodeException",
            [WV]: WV,
            input: t
        };
        return ko(e) && (n.message = e), n;
    }, zRe = new TextEncoder, XV = (t)=>{
        let e = "";
        for(let n = 0; n < t.length; ++n)e += HRe[t[n]];
        return e;
    }, URe = (t)=>{
        const e = new TextEncoder().encode(t);
        if (e.length % 2 !== 0) return Qe($V(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 = GV(e[s * 2]), o = GV(e[s * 2 + 1]);
                r[s] = i << 4 | o;
            }
            return lt(r);
        } catch (n) {
            return Qe($V(t, n instanceof Error ? n.message : "Invalid input"));
        }
    }, HRe = [
        "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"
    ], GV = (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");
    }, jRe = (t)=>XV(typeof t == "string" ? zRe.encode(t) : t), qRe = (t)=>URe(t), KRe = "effect/GroupBy", IZ = Symbol.for(KRe), WRe = {
        _R: (t)=>t,
        _E: (t)=>t,
        _K: (t)=>t,
        _V: (t)=>t
    }, $Re = (t)=>Vt(t, IZ), XRe = j((t)=>$Re(t[0]), (t, e, n)=>pu(t.grouped, ([r, s])=>e(r, yA(Ox(s, {
                shutdown: !0
            }))), {
            concurrency: "unbounded",
            bufferSize: n?.bufferSize ?? 16
        })), GRe = (t)=>({
            [IZ]: WRe,
            pipe () {
                return xt(this, arguments);
            },
            grouped: t
        }), ZRe = j((t)=>typeof t[0] != "function", (t, e, n)=>n?.key ? XRe(JRe(t, n.key, {
            bufferSize: n.bufferSize
        }), (r, s)=>iT(s, e)) : sT(n?.concurrency, ()=>iT(t, e), (r)=>n?.unordered ? pu(t, (s)=>Xa(e(s)), {
                concurrency: r
            }) : ZMe(t, r, e))), JRe = j((t)=>typeof t[0] != "function", (t, e, n)=>{
        const r = (s, i)=>Oi({
                onInput: (o)=>Ht(Wn(Va(YRe(o, e), ([a, c])=>{
                        const l = s.get(a);
                        return l === void 0 ? V(My(n?.bufferSize ?? 16), Ge((u)=>V(Dn(()=>{
                                s.set(a, u);
                            }), kn(js(i, yMe([
                                a,
                                u
                            ]))), kn(V(js(u, Ax(c)), uS((d)=>oS(d) ? Fe(an) : Ve())))))) : uS(js(l, Ax(c)), (u)=>oS(u) ? Fe(an) : Ve());
                    }, {
                        discard: !0
                    })), ()=>r(s, i)),
                onFailure: (o)=>Wn(js(i, pA(o))),
                onDone: ()=>Wn(V(Va(s.entries(), ([o, a])=>V(js(a, Px), uS((c)=>oS(c) ? Fe(an) : Ve())), {
                        discard: !0
                    }), kn(js(i, Px))))
            });
        return GRe(TZ((s)=>Gn(function*() {
                const i = new Map, o = yield* nA();
                return yield* Ey(s, Dh(o)), yield* An(t).pipe(jr(r(i, o)), fb, lA(s), mi(s), Ba(yA(Ox(o, {
                    shutdown: !0
                }))));
            })));
    }), YRe = 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 Zi(n.map((o)=>[
                o[0],
                Zi(o[1])
            ]));
    });
    class Ls {
        path;
        actual;
        issue;
        _tag = "Pointer";
        constructor(e, n, r){
            this.path = e, this.actual = n, this.issue = r;
        }
    }
    class Io {
        actual;
        message;
        _tag = "Unexpected";
        constructor(e, n){
            this.actual = e, this.message = n;
        }
    }
    class Ub {
        ast;
        message;
        _tag = "Missing";
        actual = void 0;
        constructor(e, n){
            this.ast = e, this.message = n;
        }
    }
    class Vr {
        ast;
        actual;
        issues;
        output;
        _tag = "Composite";
        constructor(e, n, r, s){
            this.ast = e, this.actual = n, this.issues = r, this.output = s;
        }
    }
    class _S {
        ast;
        actual;
        kind;
        issue;
        _tag = "Refinement";
        constructor(e, n, r, s){
            this.ast = e, this.actual = n, this.kind = r, this.issue = s;
        }
    }
    class xS {
        ast;
        actual;
        kind;
        issue;
        _tag = "Transformation";
        constructor(e, n, r, s){
            this.ast = e, this.actual = n, this.kind = r, this.issue = s;
        }
    }
    let As = class {
        ast;
        actual;
        message;
        _tag = "Type";
        constructor(e, n, r){
            this.ast = e, this.actual = n, this.message = r;
        }
    };
    class ZV {
        ast;
        actual;
        message;
        _tag = "Forbidden";
        constructor(e, n, r){
            this.ast = e, this.actual = n, this.message = r;
        }
    }
    const JV = Symbol.for("effect/Schema/ParseErrorTypeId");
    let QRe = class extends wn("ParseError") {
        [JV] = JV;
        get message() {
            return this.toString();
        }
        toString() {
            return e2.formatIssueSync(this.issue);
        }
        toJSON() {
            return {
                _id: "ParseError",
                message: this.toString()
            };
        }
        [Rn]() {
            return this.toJSON();
        }
    };
    const vA = (t)=>new QRe({
            issue: t
        }), gg = lt, SA = Qe, oT = bo, eNe = GE, gi = P2e, ad = j(2, (t, e)=>gi(t) ? cr(t, {
            onLeft: Qe,
            onRight: e
        }) : Ge(t, e)), hc = j(2, (t, e)=>gi(t) ? ti(t, e) : ht(t, e)), vS = j(2, (t, e)=>gi(t) ? qs(t, e) : Vd(t, e)), tNe = j(2, (t, e)=>gi(t) ? aq(t, {
            onLeft: e.onFailure,
            onRight: e.onSuccess
        }) : LX(t, e)), AZ = j(2, (t, e)=>gi(t) ? cr(t, {
            onLeft: e,
            onRight: lt
        }) : lb(t, e)), Q3 = (t, e)=>e === void 0 || kh(e) ? t : t === void 0 ? e : {
            ...t,
            ...e
        }, kA = (t, e, n)=>{
        const r = Es(t, e);
        return (s, i)=>r(s, Q3(n, i));
    }, TA = (t, e, n)=>{
        const r = kA(t, e, n);
        return (s, i)=>ZE(r(s, i), vA);
    }, PZ = (t, e, n)=>{
        const r = Es(t, e);
        return (s, i)=>r(s, {
                ...Q3(n, i),
                isEffectAllowed: !0
            });
    }, nNe = (t, e)=>TA(t.ast, !0, e), rNe = (t, e)=>kA(t.ast, !0, e), OZ = (t, e)=>PZ(t.ast, !0, e), sNe = (t, e)=>TA(t.ast, !1, e), iNe = (t, e)=>kA(t.ast, !1, e), MZ = (t, e)=>PZ(t.ast, !1, e), EA = (t, e)=>TA(ys(t.ast), !0, e), CA = (t, e)=>{
        const n = Es(ys(t.ast), !0);
        return (r, s)=>Ia(n(r, {
                exact: !0,
                ...Q3(e, s)
            }));
    }, cd = sNe, oNe = qt(Symbol.for("effect/ParseResult/decodeMemoMap"), ()=>new WeakMap), aNe = qt(Symbol.for("effect/ParseResult/encodeMemoMap"), ()=>new WeakMap), Es = (t, e)=>{
        const n = e ? oNe : aNe, r = n.get(t);
        if (r) return r;
        const s = cNe(t, e), i = Xxe(t), o = nr(i) ? (l, u)=>s(l, Q3(u, i.value)) : s, a = Gxe(t), c = e && nr(a) ? (l, u)=>mm(AZ(o(l, u), a.value), t, l, u) : o;
        return n.set(t, c), c;
    }, SS = (t)=>gc(Kxe(t)), kS = (t)=>gc(Wxe(t)), cNe = (t, e)=>{
        switch(t._tag){
            case "Refinement":
                if (e) {
                    const n = Es(t.from, !0);
                    return (r, s)=>{
                        s = s ?? Z8;
                        const i = s?.errors === "all", o = ad(AZ(n(r, s), (a)=>{
                            const c = new _S(t, r, "From", a);
                            return i && Jxe(t) && BZ(a) ? un(t.filter(r, s, t), {
                                onNone: ()=>Qe(c),
                                onSome: (l)=>Qe(new Vr(t, r, [
                                        c,
                                        new _S(t, r, "Predicate", l)
                                    ]))
                            }) : Qe(c);
                        }), (a)=>un(t.filter(a, s, t), {
                                onNone: ()=>lt(a),
                                onSome: (c)=>Qe(new _S(t, r, "Predicate", c))
                            }));
                        return mm(o, t, r, s);
                    };
                } else {
                    const n = Es(ys(t), !0), r = Es(RZ(t.from), !1);
                    return (s, i)=>mm(ad(n(s, i), (o)=>r(o, i)), t, s, i);
                }
            case "Transformation":
                {
                    const n = dNe(t.transformation, e), r = e ? Es(t.from, !0) : Es(t.to, !1), s = e ? Es(t.to, !0) : Es(t.from, !1);
                    return (i, o)=>mm(ad(vS(r(i, o), (a)=>new xS(t, i, e ? "Encoded" : "Type", a)), (a)=>ad(vS(n(a, o ?? Z8, t, i), (c)=>new xS(t, i, "Transformation", c)), (c)=>vS(s(c, o), (l)=>new xS(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)=>mm(n(r, s ?? Z8, t), t, r, s);
                }
            case "Literal":
                return Qi(t, (n)=>n === t.literal);
            case "UniqueSymbol":
                return Qi(t, (n)=>n === t.symbol);
            case "UndefinedKeyword":
                return Qi(t, j_e);
            case "NeverKeyword":
                return Qi(t, q_e);
            case "UnknownKeyword":
            case "AnyKeyword":
            case "VoidKeyword":
                return lt;
            case "StringKeyword":
                return Qi(t, ko);
            case "NumberKeyword":
                return Qi(t, kh);
            case "BooleanKeyword":
                return Qi(t, c1);
            case "BigIntKeyword":
                return Qi(t, Ov);
            case "SymbolKeyword":
                return Qi(t, H6);
            case "ObjectKeyword":
                return Qi(t, Uc);
            case "Enums":
                return Qi(t, (n)=>t.enums.some(([r, s])=>s === n));
            case "TemplateLiteral":
                {
                    const n = Mve(t);
                    return Qi(t, (r)=>ko(r) && n.test(r));
                }
            case "TupleType":
                {
                    const n = t.elements.map((l)=>Es(l.type, e)), r = t.rest.map((l)=>Es(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 = SS(t), c = kS(t);
                    return (l, u)=>{
                        if (!axe(l)) return Qe(new As(t, l));
                        const d = u?.errors === "all", f = [];
                        let p = 0;
                        const h = [], b = l.length;
                        for(let w = b; w <= i - 1; w++){
                            const E = new Ls(w, l, new Ub(s[w - b]));
                            if (d) {
                                f.push([
                                    p++,
                                    E
                                ]);
                                continue;
                            } else return Qe(new Vr(t, l, E, h));
                        }
                        if (t.rest.length === 0) for(let w = t.elements.length; w <= b - 1; w++){
                            const E = new Ls(w, l, new Io(l[w], `is unexpected, expected: ${o}`));
                            if (d) {
                                f.push([
                                    p++,
                                    E
                                ]);
                                continue;
                            } else return Qe(new Vr(t, l, E, h));
                        }
                        let y = 0, _;
                        for(; y < n.length; y++)if (b < y + 1) {
                            if (t.elements[y].isOptional) continue;
                        } else {
                            const w = n[y], E = w(l[y], u);
                            if (gi(E)) {
                                if (Qn(E)) {
                                    const I = new Ls(y, l, E.left);
                                    if (d) {
                                        f.push([
                                            p++,
                                            I
                                        ]);
                                        continue;
                                    } else return Qe(new Vr(t, l, I, ga(h)));
                                }
                                h.push([
                                    p++,
                                    E.right
                                ]);
                            } else {
                                const I = p++, D = y;
                                _ || (_ = []), _.push(({ es: U, output: K })=>Ge(If(E), ($)=>{
                                        if (Qn($)) {
                                            const ne = new Ls(D, l, $.left);
                                            return d ? (U.push([
                                                I,
                                                ne
                                            ]), an) : Qe(new Vr(t, l, ne, ga(K)));
                                        }
                                        return K.push([
                                            I,
                                            $.right
                                        ]), an;
                                    }));
                            }
                        }
                        if (Rr(r)) {
                            const [w, ...E] = r;
                            for(; y < b - E.length; y++){
                                const I = w(l[y], u);
                                if (gi(I)) if (Qn(I)) {
                                    const D = new Ls(y, l, I.left);
                                    if (d) {
                                        f.push([
                                            p++,
                                            D
                                        ]);
                                        continue;
                                    } else return Qe(new Vr(t, l, D, ga(h)));
                                } else h.push([
                                    p++,
                                    I.right
                                ]);
                                else {
                                    const D = p++, U = y;
                                    _ || (_ = []), _.push(({ es: K, output: $ })=>Ge(If(I), (ne)=>{
                                            if (Qn(ne)) {
                                                const te = new Ls(U, l, ne.left);
                                                return d ? (K.push([
                                                    D,
                                                    te
                                                ]), an) : Qe(new Vr(t, l, te, ga($)));
                                            } else return $.push([
                                                D,
                                                ne.right
                                            ]), an;
                                        }));
                                }
                            }
                            for(let I = 0; I < E.length; I++){
                                const D = y + I;
                                if (!(b < D + 1)) {
                                    const U = E[I](l[D], u);
                                    if (gi(U)) {
                                        if (Qn(U)) {
                                            const K = new Ls(D, l, U.left);
                                            if (d) {
                                                f.push([
                                                    p++,
                                                    K
                                                ]);
                                                continue;
                                            } else return Qe(new Vr(t, l, K, ga(h)));
                                        }
                                        h.push([
                                            p++,
                                            U.right
                                        ]);
                                    } else {
                                        const K = p++;
                                        _ || (_ = []), _.push(({ es: $, output: ne })=>Ge(If(U), (te)=>{
                                                if (Qn(te)) {
                                                    const J = new Ls(D, l, te.left);
                                                    return d ? ($.push([
                                                        K,
                                                        J
                                                    ]), an) : Qe(new Vr(t, l, J, ga(ne)));
                                                }
                                                return ne.push([
                                                    K,
                                                    te.right
                                                ]), an;
                                            }));
                                    }
                                }
                            }
                        }
                        const v = ({ es: w, output: E })=>Om(w) ? Qe(new Vr(t, l, ga(w), ga(E))) : lt(ga(E));
                        if (_ && _.length > 0) {
                            const w = _;
                            return ar(()=>{
                                const E = {
                                    es: cm(f),
                                    output: cm(h)
                                };
                                return Ge(Va(w, (I)=>I(E), {
                                    concurrency: a,
                                    batching: c,
                                    discard: !0
                                }), ()=>v(E));
                            });
                        }
                        return v({
                            output: h,
                            es: f
                        });
                    };
                }
            case "TypeLiteral":
                {
                    if (t.propertySignatures.length === 0 && t.indexSignatures.length === 0) return Qi(t, K_e);
                    const n = [], r = {}, s = [];
                    for (const u of t.propertySignatures)n.push([
                        Es(u.type, e),
                        u
                    ]), r[u.name] = null, s.push(u.name);
                    const i = t.indexSignatures.map((u)=>[
                            Es(u.parameter, e),
                            Es(u.type, e),
                            u.parameter
                        ]), o = bc.make(t.indexSignatures.map((u)=>u.parameter).concat(s.map((u)=>H6(u) ? new nve(u) : new X2(u)))), a = Es(o, e), c = SS(t), l = kS(t);
                    return (u, d)=>{
                        if (!$_e(u)) return Qe(new As(t, u));
                        const f = d?.errors === "all", p = [];
                        let h = 0;
                        const b = d?.onExcessProperty === "error", y = d?.onExcessProperty === "preserve", _ = {};
                        let v;
                        if (b || y) {
                            v = Reflect.ownKeys(u);
                            for (const D of v){
                                const U = a(D, d);
                                if (gi(U) && Qn(U)) if (b) {
                                    const K = new Ls(D, u, new Io(u[D], `is unexpected, expected: ${String(o)}`));
                                    if (f) {
                                        p.push([
                                            h++,
                                            K
                                        ]);
                                        continue;
                                    } else return Qe(new Vr(t, u, K, _));
                                } else _[D] = u[D];
                            }
                        }
                        let w;
                        const E = d?.exact === !0;
                        for(let D = 0; D < n.length; D++){
                            const U = n[D][1], K = U.name, $ = Object.prototype.hasOwnProperty.call(u, K);
                            if (!$) {
                                if (U.isOptional) continue;
                                if (E) {
                                    const J = new Ls(K, u, new Ub(U));
                                    if (f) {
                                        p.push([
                                            h++,
                                            J
                                        ]);
                                        continue;
                                    } else return Qe(new Vr(t, u, J, _));
                                }
                            }
                            const ne = n[D][0], te = ne(u[K], d);
                            if (gi(te)) {
                                if (Qn(te)) {
                                    const J = new Ls(K, u, $ ? te.left : new Ub(U));
                                    if (f) {
                                        p.push([
                                            h++,
                                            J
                                        ]);
                                        continue;
                                    } else return Qe(new Vr(t, u, J, _));
                                }
                                _[K] = te.right;
                            } else {
                                const J = h++, C = K;
                                w || (w = []), w.push(({ es: g, output: x })=>Ge(If(te), (A)=>{
                                        if (Qn(A)) {
                                            const R = new Ls(C, u, $ ? A.left : new Ub(U));
                                            return f ? (g.push([
                                                J,
                                                R
                                            ]), an) : Qe(new Vr(t, u, R, x));
                                        }
                                        return x[C] = A.right, an;
                                    }));
                            }
                        }
                        for(let D = 0; D < i.length; D++){
                            const U = i[D], K = U[0], $ = U[1], ne = bq(u, U[2]);
                            for (const te of ne){
                                const J = K(te, d);
                                if (gi(J) && Ia(J)) {
                                    const C = $(u[te], d);
                                    if (gi(C)) if (Qn(C)) {
                                        const g = new Ls(te, u, C.left);
                                        if (f) {
                                            p.push([
                                                h++,
                                                g
                                            ]);
                                            continue;
                                        } else return Qe(new Vr(t, u, g, _));
                                    } else Object.prototype.hasOwnProperty.call(r, te) || (_[te] = C.right);
                                    else {
                                        const g = h++, x = te;
                                        w || (w = []), w.push(({ es: A, output: R })=>Ge(If(C), (N)=>{
                                                if (Qn(N)) {
                                                    const L = new Ls(x, u, N.left);
                                                    return f ? (A.push([
                                                        g,
                                                        L
                                                    ]), an) : Qe(new Vr(t, u, L, R));
                                                } else return Object.prototype.hasOwnProperty.call(r, te) || (R[te] = N.right), an;
                                            }));
                                    }
                                }
                            }
                        }
                        const I = ({ es: D, output: U })=>{
                            if (Om(D)) return Qe(new Vr(t, u, ga(D), U));
                            if (d?.propertyOrder === "original") {
                                const K = v || Reflect.ownKeys(u);
                                for (const ne of s)K.indexOf(ne) === -1 && K.push(ne);
                                const $ = {};
                                for (const ne of K)Object.prototype.hasOwnProperty.call(U, ne) && ($[ne] = U[ne]);
                                return lt($);
                            }
                            return lt(U);
                        };
                        if (w && w.length > 0) {
                            const D = w;
                            return ar(()=>{
                                const U = {
                                    es: cm(p),
                                    output: Object.assign({}, _)
                                };
                                return Ge(Va(D, (K)=>K(U), {
                                    concurrency: c,
                                    batching: l,
                                    discard: !0
                                }), ()=>I(U));
                            });
                        }
                        return I({
                            es: p,
                            output: _
                        });
                    };
                }
            case "Union":
                {
                    const n = lNe(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], Es(t.types[l], e));
                    const a = SS(t) ?? 1, c = kS(t);
                    return (l, u)=>{
                        const d = [];
                        let f = 0, p = [];
                        if (s > 0) if (DE(l)) for(let y = 0; y < s; y++){
                            const _ = r[y], v = n.keys[_].buckets;
                            if (Object.prototype.hasOwnProperty.call(l, _)) {
                                const w = String(l[_]);
                                if (Object.prototype.hasOwnProperty.call(v, w)) p = p.concat(v[w]);
                                else {
                                    const { candidates: E, literals: I } = n.keys[_], D = bc.make(I), U = E.length === i ? new nh([
                                        new Qs(_, D, !1, !0)
                                    ], []) : bc.make(E);
                                    d.push([
                                        f++,
                                        new Vr(U, l, new Ls(_, l, new As(D, l[_])))
                                    ]);
                                }
                            } else {
                                const { candidates: w, literals: E } = n.keys[_], I = new Qs(_, bc.make(E), !1, !0), D = w.length === i ? new nh([
                                    I
                                ], []) : bc.make(w);
                                d.push([
                                    f++,
                                    new Vr(D, l, new Ls(_, l, new Ub(I)))
                                ]);
                            }
                        }
                        else {
                            const y = n.candidates.length === i ? t : bc.make(n.candidates);
                            d.push([
                                f++,
                                new As(y, l)
                            ]);
                        }
                        n.otherwise.length > 0 && (p = p.concat(n.otherwise));
                        let h;
                        for(let y = 0; y < p.length; y++){
                            const _ = p[y], v = o.get(_)(l, u);
                            if (gi(v) && (!h || h.length === 0)) {
                                if (Ia(v)) return v;
                                d.push([
                                    f++,
                                    v.left
                                ]);
                            } else {
                                const w = f++;
                                h || (h = []), h.push((E)=>ar(()=>"finalResult" in E ? an : Ge(If(v), (I)=>(Ia(I) ? E.finalResult = I : E.es.push([
                                                w,
                                                I.left
                                            ]), an))));
                            }
                        }
                        const b = (y)=>Om(y) ? y.length === 1 && y[0][1]._tag === "Type" ? Qe(y[0][1]) : Qe(new Vr(t, l, ga(y))) : Qe(new As(t, l));
                        if (h && h.length > 0) {
                            const y = h;
                            return ar(()=>{
                                const _ = {
                                    es: cm(d)
                                };
                                return Ge(Va(y, (v)=>v(_), {
                                    concurrency: a,
                                    batching: c,
                                    discard: !0
                                }), ()=>"finalResult" in _ ? _.finalResult : b(_.es));
                            });
                        }
                        return b(d);
                    };
                }
            case "Suspend":
                {
                    const n = mq(()=>Es(t.f(), e));
                    return (r, s)=>n()(r, s);
                }
        }
    }, Qi = (t, e)=>(n)=>e(n) ? lt(n) : Qe(new As(t, n)), bm = (t, e)=>{
        switch(t._tag){
            case "Declaration":
                {
                    const n = Vq(t);
                    if (nr(n)) return bm(n.value, e);
                    break;
                }
            case "TypeLiteral":
                {
                    const n = [];
                    for(let r = 0; r < t.propertySignatures.length; r++){
                        const s = t.propertySignatures[r], i = e ? oN(s.type) : ys(s.type);
                        rN(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 ? oN(s.type) : ys(s.type);
                        rN(i) && !s.isOptional && n.push([
                            r,
                            i
                        ]);
                    }
                    return n;
                }
            case "Refinement":
                return bm(t.from, e);
            case "Suspend":
                return bm(t.f(), e);
            case "Transformation":
                return bm(e ? t.from : t.to, e);
        }
        return [];
    }, lNe = (t, e)=>{
        const n = {}, r = [], s = [];
        for(let i = 0; i < t.length; i++){
            const o = t[i], a = bm(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
        };
    }, RZ = (t)=>sC(t) ? RZ(t.from) : t, mm = (t, e, n, r)=>{
        if (r?.isEffectAllowed === !0 || gi(t)) return t;
        const s = new C$, i = vx(t, {
            scheduler: s
        });
        s.flush();
        const o = i.unsafePoll();
        if (o) {
            if (yk(o)) return lt(o.value);
            const a = o.cause;
            return bEe(a) ? Qe(a.error) : Qe(new ZV(e, n, _Ee(a)));
        }
        return Qe(new ZV(e, n, "cannot be be resolved synchronously, this is caused by using runSync on an effect that performs async work"));
    }, uNe = ([t], [e])=>t > e ? 1 : t < e ? -1 : 0;
    function ga(t) {
        return t.sort(uNe).map((e)=>e[1]);
    }
    const dNe = (t, e)=>{
        switch(t._tag){
            case "FinalTransformation":
                return e ? t.decode : t.encode;
            case "ComposeTransformation":
                return lt;
            case "TypeLiteralTransformation":
                return (n)=>{
                    let r = lt(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 = hc(r, (l)=>{
                            const u = a(Object.prototype.hasOwnProperty.call(l, i) ? Fe(l[i]) : Ve());
                            return delete l[i], nr(u) && (l[o] = u.value), l;
                        });
                    }
                    return r;
                };
        }
    }, di = (t, e = [])=>({
            value: t,
            forest: e
        }), e2 = {
        formatIssue: (t)=>hc($p(t), fNe),
        formatIssueSync: (t)=>{
            const e = e2.formatIssue(t);
            return gi(e) ? Dv(e) : Ki(e);
        },
        formatError: (t)=>e2.formatIssue(t.issue),
        formatErrorSync: (t)=>e2.formatIssueSync(t.issue)
    }, fNe = (t)=>t.value + NZ(`
`, t.forest), NZ = (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 += NZ(t + (r > 1 && !o ? "│  " : "   "), s.forest);
        }
        return n;
    }, hNe = (t)=>{
        switch(t){
            case "Encoded":
                return "Encoded side transformation failure";
            case "Transformation":
                return "Transformation process failure";
            case "Type":
                return "Type side transformation failure";
        }
    }, pNe = (t)=>{
        switch(t){
            case "From":
                return "From side refinement failure";
            case "Predicate":
                return "Predicate refinement failure";
        }
    }, VZ = (t)=>"ast" in t ? Fe(t.ast) : Ve(), aT = lt(void 0), gNe = (t)=>VZ(t).pipe(p1(jxe), un({
            onNone: ()=>aT,
            onSome: (e)=>{
                const n = e(t);
                return ko(n) ? lt({
                    message: n,
                    override: !1
                }) : cb(n) ? ht(n, (r)=>({
                        message: r,
                        override: !1
                    })) : ko(n.message) ? lt({
                    message: n.message,
                    override: n.override
                }) : ht(n.message, (r)=>({
                        message: r,
                        override: n.override
                    }));
            }
        })), IA = (t)=>(e)=>e._tag === t, BZ = IA("Composite"), YV = IA("Refinement"), QV = IA("Transformation"), Bm = (t)=>ad(gNe(t), (e)=>e !== void 0 ? !e.override && (BZ(t) || YV(t) && t.kind === "From" || QV(t) && t.kind !== "Transformation") ? QV(t) || YV(t) ? Bm(t.issue) : aT : lt(e.message) : aT), DZ = (t)=>VZ(t).pipe(p1($xe), j2e((e)=>e(t)), gc);
    function bNe(t) {
        return Nq(t).pipe(dd(()=>Mq(t)), dd(()=>Rq(t)), dd(()=>jv(t)), xr(()=>`{ ${t.from} | filter }`));
    }
    function mNe(t) {
        return t.message !== void 0 ? t.message : `Expected ${sC(t.ast) ? bNe(t.ast) : String(t.ast)}, actual ${Zd(t.actual)}`;
    }
    const yNe = (t)=>hc(Bm(t), (e)=>e ?? DZ(t) ?? mNe(t)), n_ = (t)=>DZ(t) ?? String(t.ast), wNe = (t)=>t.message ?? "is forbidden", _Ne = (t)=>t.message ?? "is unexpected", xNe = (t)=>{
        const e = qxe(t.ast);
        if (nr(e)) {
            const n = e.value();
            return ko(n) ? lt(n) : n;
        }
        return lt(t.message ?? "is missing");
    }, $p = (t)=>{
        switch(t._tag){
            case "Type":
                return hc(yNe(t), di);
            case "Forbidden":
                return lt(di(n_(t), [
                    di(wNe(t))
                ]));
            case "Unexpected":
                return lt(di(_Ne(t)));
            case "Missing":
                return hc(xNe(t), di);
            case "Transformation":
                return ad(Bm(t), (e)=>e !== void 0 ? lt(di(e)) : hc($p(t.issue), (n)=>di(n_(t), [
                            di(hNe(t.kind), [
                                n
                            ])
                        ])));
            case "Refinement":
                return ad(Bm(t), (e)=>e !== void 0 ? lt(di(e)) : hc($p(t.issue), (n)=>di(n_(t), [
                            di(pNe(t.kind), [
                                n
                            ])
                        ])));
            case "Pointer":
                return hc($p(t.issue), (e)=>di(Ixe(t.path), [
                        e
                    ]));
            case "Composite":
                return ad(Bm(t), (e)=>{
                    if (e !== void 0) return lt(di(e));
                    const n = n_(t);
                    return yq(t.issues) ? hc(Va(t.issues, $p), (r)=>di(n, r)) : hc($p(t.issues), (r)=>di(n, [
                            r
                        ]));
                });
        }
    }, eB = IRe, vNe = j((t)=>Uc(t[0]), (t, ...e)=>{
        const n = {};
        for (const r of e)r in t && (n[r] = t[r]);
        return n;
    }), SNe = j((t)=>Uc(t[0]), (t, ...e)=>{
        const n = {
            ...t
        };
        for (const r of e)delete n[r];
        return n;
    }), Vy = Symbol.for("effect/Schema");
    function cs(t) {
        return class {
            [Vy] = tB;
            static ast = t;
            static annotations(n) {
                return cs(Ga(this.ast, n));
            }
            static pipe() {
                return xt(this, arguments);
            }
            static toString() {
                return String(t);
            }
            static Type;
            static Encoded;
            static Context;
            static [Vy] = tB;
        };
    }
    const tB = {
        _A: (t)=>t,
        _I: (t)=>t,
        _R: (t)=>t
    }, nB = {
        typeConstructor: Dxe,
        schemaId: Lxe,
        message: wq,
        missingMessage: YE,
        identifier: QE,
        title: Hc,
        description: Lg,
        examples: _q,
        default: xq,
        documentation: zxe,
        jsonSchema: vq,
        arbitrary: Sq,
        pretty: kq,
        equivalence: Tq,
        concurrency: Eq,
        batching: Cq,
        parseIssueTitle: Iq,
        parseOptions: Aq,
        decodingFallback: Pq
    }, lp = (t)=>{
        if (!t) return {};
        const e = {
            ...t
        };
        for(const n in nB)if (n in t) {
            const r = nB[n];
            e[r] = t[n], delete e[n];
        }
        return e;
    }, Ga = (t, e)=>oC(t, lp(e));
    const cT = (t)=>String(t.ast), ch = (t)=>cs(ys(t.ast)), kNe = (t, e)=>{
        const n = iNe(t, e);
        return (r, s)=>qs(n(r, s), vA);
    }, TNe = kNe, Wc = (t, e)=>{
        const n = rNe(t, e);
        return (r, s)=>qs(n(r, s), vA);
    }, Fd = (t)=>Vt(t, Vy) && Uc(t[Vy]);
    function ENe(t) {
        return nC(t) ? bc.make(Sve(t, (e)=>new X2(e))) : new X2(t[0]);
    }
    function FZ(t, e = ENe(t)) {
        return class extends cs(e) {
            static annotations(r) {
                return FZ(this.literals, Ga(this.ast, r));
            }
            static literals = [
                ...t
            ];
        };
    }
    function ii(...t) {
        return Rr(t) ? FZ(t) : LZ;
    }
    const CNe = (t, e, n)=>AA(t, new qv(t.map((r)=>r.ast), (...r)=>e.decode(...r.map(cs)), (...r)=>e.encode(...r.map(cs)), lp(n))), INe = (t, e)=>{
        const n = ()=>(s, i, o)=>t(s) ? gg(s) : SA(new As(o, s)), r = n;
        return AA([], new qv([], n, r, lp(e)));
    };
    function AA(t, e) {
        return class extends cs(e) {
            static annotations(r) {
                return AA(this.typeParameters, Ga(this.ast, r));
            }
            static typeParameters = [
                ...t
            ];
        };
    }
    const Mi = function() {
        if (Array.isArray(arguments[0])) {
            const n = arguments[0], r = arguments[1], s = arguments[2];
            return CNe(n, r, s);
        }
        const t = arguments[0], e = arguments[1];
        return INe(t, e);
    }, rB = Symbol.for("effect/SchemaId/Brand"), PA = (t, e)=>(n)=>GZ(n, new rC(n.ast, function(i, o, a) {
                const c = t.either(i);
                return Qn(c) ? Fe(new As(a, i, c.left.map((l)=>l.message).join(", "))) : Ve();
            }, lp({
                schemaId: rB,
                [rB]: {
                    constructor: t
                },
                ...e
            }))), sB = Symbol.for("effect/SchemaId/InstanceOf"), ANe = (t, e)=>Mi((n)=>n instanceof t, {
            title: t.name,
            description: `an instance of ${t.name}`,
            pretty: ()=>String,
            schemaId: sB,
            [sB]: {
                constructor: t
            },
            ...e
        });
    class OA extends cs($6) {
    }
    let PNe = class extends cs(tve) {
    };
    class LZ extends cs(eC) {
    }
    class ONe extends cs(Dq) {
    }
    class MA extends cs(bve) {
    }
    class gn extends cs(lve) {
    }
    class Jr extends cs(fve) {
    }
    class e5 extends cs(pve) {
    }
    const MNe = (t)=>bc.make(t.map((e)=>e.ast));
    function zZ(t, e = MNe(t)) {
        return class extends cs(e) {
            static annotations(r) {
                return zZ(this.members, Ga(this.ast, r));
            }
            static members = [
                ...t
            ];
        };
    }
    function Lh(...t) {
        return nC(t) ? zZ(t) : Rr(t) ? t[0] : LZ;
    }
    const UZ = (t)=>Lh(t, PNe), RNe = (t)=>Lh(t, OA), NNe = (t, e)=>new tC(t.map((n)=>Fd(n) ? new zg(n.ast, !1) : n.ast), e.map((n)=>Fd(n) ? new Kv(n.ast) : n.ast), !0);
    function Mx(t, e, n = NNe(t, e)) {
        return class extends cs(n) {
            static annotations(s) {
                return Mx(this.elements, this.rest, Ga(this.ast, s));
            }
            static elements = [
                ...t
            ];
            static rest = [
                ...e
            ];
        };
    }
    function By(...t) {
        return Array.isArray(t[0]) ? Mx(t[0], t.slice(1)) : Mx(t, []);
    }
    function HZ(t, e) {
        return class extends Mx([], [
            t
        ], e) {
            static annotations(r) {
                return HZ(this.value, Ga(this.ast, r));
            }
            static value = t;
        };
    }
    const Ws = (t)=>HZ(t), lT = (t)=>t ? '"?:"' : '":"';
    class t5 extends zg {
        isReadonly;
        defaultValue;
        _tag = "PropertySignatureDeclaration";
        constructor(e, n, r, s, i){
            super(e, n, s), this.isReadonly = r, this.defaultValue = i;
        }
        toString() {
            const e = lT(this.isOptional), n = String(this.type);
            return `PropertySignature<${e}, ${n}, never, ${e}, ${n}>`;
        }
    }
    class jZ extends zg {
        isReadonly;
        defaultValue;
        constructor(e, n, r, s, i){
            super(e, n, s), this.isReadonly = r, this.defaultValue = i;
        }
    }
    const VNe = (t)=>t === void 0 ? "never" : ko(t) ? JSON.stringify(t) : String(t);
    class qZ {
        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<${lT(this.to.isOptional)}, ${this.to.type}, ${VNe(this.from.fromKey)}, ${lT(this.from.isOptional)}, ${this.from.type}>`;
        }
    }
    const KZ = (t, e)=>{
        switch(t._tag){
            case "PropertySignatureDeclaration":
                return new t5(t.type, t.isOptional, t.isReadonly, {
                    ...t.annotations,
                    ...e
                }, t.defaultValue);
            case "PropertySignatureTransformation":
                return new qZ(t.from, new jZ(t.to.type, t.to.isOptional, t.to.isReadonly, {
                    ...t.to.annotations,
                    ...e
                }, t.to.defaultValue), t.decode, t.encode);
        }
    }, WZ = Symbol.for("effect/PropertySignature"), $Z = (t)=>Vt(t, WZ);
    class n5 {
        ast;
        [Vy];
        [WZ] = null;
        _TypeToken;
        _Key;
        _EncodedToken;
        _HasDefault;
        constructor(e){
            this.ast = e;
        }
        pipe() {
            return xt(this, arguments);
        }
        annotations(e) {
            return new n5(KZ(this.ast, lp(e)));
        }
        toString() {
            return String(this.ast);
        }
    }
    const iB = (t)=>new n5(t);
    class r5 extends n5 {
        from;
        constructor(e, n){
            super(e), this.from = n;
        }
        annotations(e) {
            return new r5(KZ(this.ast, lp(e)), this.from);
        }
    }
    const BNe = (t)=>new r5(new t5(t.ast, !1, !0, {}, void 0), t), DNe = j(2, (t, e)=>{
        const n = t.ast;
        switch(n._tag){
            case "PropertySignatureDeclaration":
                return iB(new t5(n.type, n.isOptional, n.isReadonly, n.annotations, e));
            case "PropertySignatureTransformation":
                return iB(new qZ(n.from, new jZ(n.to.type, n.to.isOptional, n.to.isReadonly, n.to.annotations, e), n.decode, n.encode));
        }
    }), lh = (t)=>{
        const e = t.ast === $6 || t.ast === eC ? $6 : RNe(t).ast;
        return new r5(new t5(e, !0, !0, {}, void 0), t);
    }, FNe = Kq([
        YE
    ]), LNe = (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 ($Z(u)) {
                    const d = u.ast;
                    switch(d._tag){
                        case "PropertySignatureDeclaration":
                            {
                                const f = d.type, p = d.isOptional, h = d.annotations;
                                i.push(new Qs(l, f, p, !0, FNe(d))), o.push(new Qs(l, ys(f), p, !0, h)), r.push(new Qs(l, f, p, !0, h));
                                break;
                            }
                        case "PropertySignatureTransformation":
                            {
                                const f = d.from.fromKey ?? l;
                                i.push(new Qs(f, d.from.type, d.from.isOptional, !0, d.from.annotations)), o.push(new Qs(l, d.to.type, d.to.isOptional, !0, d.to.annotations)), a.push(new Cve(f, l, d.decode, d.encode));
                                break;
                            }
                    }
                } else i.push(new Qs(l, u.ast, !1, !0)), o.push(new Qs(l, ys(u.ast), !1, !0)), r.push(new Qs(l, u.ast, !1, !0));
            }
            if (Rr(a)) {
                const c = [], l = [];
                for (const u of e){
                    const { indexSignatures: d, propertySignatures: f } = iN(u.key.ast, u.value.ast);
                    f.forEach((p)=>{
                        i.push(p), o.push(new Qs(p.name, ys(p.type), p.isOptional, p.isReadonly, p.annotations));
                    }), d.forEach((p)=>{
                        c.push(p), l.push(new Wv(p.parameter, ys(p.type), p.isReadonly));
                    });
                }
                return new iC(new nh(i, c, {
                    [W6]: "Struct (Encoded side)"
                }), new nh(o, l, {
                    [W6]: "Struct (Type side)"
                }), new Ive(a));
            }
        }
        const s = [];
        for (const i of e){
            const { indexSignatures: o, propertySignatures: a } = iN(i.key.ast, i.value.ast);
            a.forEach((c)=>r.push(c)), o.forEach((c)=>s.push(c));
        }
        return new nh(r, s);
    }, zNe = (t, e)=>{
        const n = Reflect.ownKeys(t);
        for (const r of n){
            const s = t[r];
            if (e[r] === void 0 && $Z(s)) {
                const i = s.ast, o = i._tag === "PropertySignatureDeclaration" ? i.defaultValue : i.to.defaultValue;
                o !== void 0 && (e[r] = o());
            }
        }
        return e;
    };
    function RA(t, e, n = LNe(t, e)) {
        return class extends cs(n) {
            static annotations(s) {
                return RA(this.fields, this.records, Ga(this.ast, s));
            }
            static fields = {
                ...t
            };
            static records = [
                ...e
            ];
            static make = (s, i)=>{
                const o = zNe(t, {
                    ...s
                });
                return DA(i) ? o : EA(this)(o);
            };
            static pick(...s) {
                return tn(vNe(t, ...s));
            }
            static omit(...s) {
                return tn(SNe(t, ...s));
            }
        };
    }
    function tn(t, ...e) {
        return RA(t, e);
    }
    const UNe = (t)=>ii(t).pipe(BNe, DNe(()=>t)), HNe = (t, e)=>tn({
            _tag: UNe(t),
            ...e
        });
    function XZ(t, e, n) {
        return class extends RA({}, [
            {
                key: t,
                value: e
            }
        ], n) {
            static annotations(s) {
                return XZ(t, e, Ga(this.ast, s));
            }
            static key = t;
            static value = e;
        };
    }
    const jNe = (t)=>XZ(t.key, t.value);
    function GZ(t, e) {
        return class extends cs(e) {
            static annotations(r) {
                return GZ(this.from, Ga(this.ast, r));
            }
            static make = (r, s)=>DA(s) ? r : EA(this)(r);
            static from = t;
        };
    }
    const Y1 = j((t)=>Fd(t[1]), (t, e)=>NA(t, e, Nve(t.ast, e.ast))), qNe = Symbol.for("effect/SchemaId/Refine");
    function ZZ(t, e, n) {
        return class extends cs(n) {
            static annotations(s) {
                return ZZ(this.from, this.filter, Ga(this.ast, s));
            }
            static [qNe] = t;
            static from = t;
            static filter = e;
            static make = (s, i)=>DA(i) ? s : EA(this)(s);
        };
    }
    const oB = (t, e, n)=>{
        if (c1(t)) return t ? Ve() : Fe(new As(e, n));
        if (ko(t)) return Fe(new As(e, n, t));
        if (t !== void 0) {
            if ("_tag" in t) return Fe(t);
            const r = new As(e, n, t.message);
            return Fe(Rr(t.path) ? new Ls(t.path, n, r) : r);
        }
        return Ve();
    }, KNe = (t, e, n)=>{
        if (Cxe(t)) return oB(t, e, n);
        if (Rr(t)) {
            const r = Hv(t, (s)=>oB(s, e, n));
            if (Rr(r)) return Fe(r.length === 1 ? r[0] : new Vr(e, n, r));
        }
        return Ve();
    };
    function JZ(t, e) {
        return (n)=>{
            function r(i, o, a) {
                return KNe(t(i, o, a), a, i);
            }
            const s = new rC(n.ast, r, lp(e));
            return ZZ(n, r, s);
        };
    }
    function NA(t, e, n) {
        return class extends cs(n) {
            static annotations(s) {
                return NA(this.from, this.to, Ga(this.ast, s));
            }
            static from = t;
            static to = e;
        };
    }
    const Za = j((t)=>Fd(t[0]) && Fd(t[1]), (t, e, n)=>NA(t, e, new iC(t.ast, e.ast, new kve(n.decode, n.encode)))), tf = j((t)=>Fd(t[0]) && Fd(t[1]), (t, e, n)=>Za(t, e, {
            strict: !0,
            decode: (r, s, i, o)=>gg(n.decode(r, o)),
            encode: (r, s, i, o)=>gg(n.encode(r, o))
        })), aB = (t)=>t instanceof Error ? t.message : String(t), WNe = (t)=>Za(gn.annotations({
            description: "a string to be decoded into JSON"
        }), ONe, {
            strict: !0,
            decode: (e, n, r)=>oT({
                    try: ()=>JSON.parse(e, t?.reviver),
                    catch: (s)=>new As(r, e, aB(s))
                }),
            encode: (e, n, r)=>oT({
                    try: ()=>JSON.stringify(e, t?.replacer, t?.space),
                    catch: (s)=>new As(r, e, aB(s))
                })
        }).annotations({
            title: "parseJson",
            schemaId: eve
        }), Q1 = (t, e)=>Fd(t) ? Y1(Q1(e), t) : WNe(t), $Ne = Vxe, XNe = (t, e, n)=>(r)=>r.pipe(JZ((s)=>s >= t && s <= e, {
                schemaId: $Ne,
                title: `between(${t}, ${e})`,
                description: `a number between ${t} and ${e}`,
                jsonSchema: {
                    minimum: t,
                    maximum: e
                },
                ...n
            }));
    class Ul extends Za(gn.annotations({
        description: "a string to be decoded into a bigint"
    }), MA, {
        strict: !0,
        decode: (e, n, r)=>eNe(Dve(e), ()=>new As(r, e, `Unable to decode ${JSON.stringify(e)} into a bigint`)),
        encode: (e)=>gg(String(e))
    }).annotations({
        identifier: "BigInt"
    }) {
    }
    const YZ = (t, e, n, r)=>tNe(t, {
            onFailure: (s)=>new Vr(n, r, s),
            onSuccess: e
        });
    class QZ extends Mi(W_e, {
        typeConstructor: {
            _tag: "Uint8Array"
        },
        identifier: "Uint8ArrayFromSelf",
        pretty: ()=>(e)=>`new Uint8Array(${JSON.stringify(Array.from(e))})`,
        arbitrary: ()=>(e)=>e.uint8Array(),
        equivalence: ()=>b1(Lt)
    }) {
    }
    class GNe extends Jr.pipe(XNe(0, 255, {
        identifier: "Uint8",
        description: "a 8-bit unsigned integer"
    })) {
    }
    class bd extends tf(Ws(GNe).annotations({
        description: "an array of 8-bit unsigned integers to be decoded into a Uint8Array"
    }), QZ, {
        strict: !0,
        decode: (e)=>Uint8Array.from(e),
        encode: (e)=>Array.from(e)
    }).annotations({
        identifier: "Uint8Array"
    }) {
    }
    const ZNe = (t, e, n)=>Za(gn.annotations({
            description: "a string to be decoded into a Uint8Array"
        }), QZ, {
            strict: !0,
            decode: (r, s, i)=>qs(e(r), (o)=>new As(i, r, o.message)),
            encode: (r)=>gg(n(r))
        }).annotations({
            identifier: t
        }), ew = ZNe("Uint8ArrayFromHex", qRe, jRe), cB = Symbol.for("effect/SchemaId/ValidDate"), JNe = (t)=>(e)=>e.pipe(JZ((n)=>!Number.isNaN(n.getTime()), {
                schemaId: cB,
                [cB]: {
                    noInvalidDate: !0
                },
                title: "validDate",
                description: "a valid Date",
                ...t
            })), lB = Nxe;
    class VA extends Mi(Lj, {
        typeConstructor: {
            _tag: "Date"
        },
        identifier: "DateFromSelf",
        schemaId: lB,
        [lB]: {
            noInvalidDate: !1
        },
        description: "a potentially invalid Date instance",
        pretty: ()=>(e)=>`new Date(${JSON.stringify(e)})`,
        arbitrary: ()=>(e)=>e.date({
                    noInvalidDate: !1
                }),
        equivalence: ()=>D_e
    }) {
    }
    class YNe extends tf(gn.annotations({
        description: "a string to be decoded into a Date"
    }), VA, {
        strict: !0,
        decode: (e)=>new Date(e),
        encode: (e)=>Wj(e)
    }).annotations({
        identifier: "DateFromString"
    }) {
    }
    class eJ extends YNe.pipe(JNe({
        identifier: "Date"
    })) {
    }
    class QNe extends Mi((e)=>ARe(e) && PRe(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)=>MRe(n)),
        equivalence: ()=>ORe
    }) {
    }
    const eVe = (t, e)=>oT({
            try: ()=>RRe(t),
            catch: ()=>new As(e, t, `Unable to decode ${Zd(t)} into a DateTime.Utc`)
        });
    class tVe extends Za(gn.annotations({
        description: "a string to be decoded into a DateTime.Utc"
    }), QNe, {
        strict: !0,
        decode: (e, n, r)=>eVe(e, r),
        encode: (e)=>gg(FRe(e))
    }).annotations({
        identifier: "DateTimeUtc"
    }) {
    }
    const nVe = (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));
        }, rVe = (t, e)=>(n)=>`new Map([${Array.from(n.entries()).map(([r, s])=>`[${t(r)}, ${e(s)}]`).join(", ")}])`, sVe = (t, e)=>{
        const n = b1(H0(([r, s], [i, o])=>t(r, i) && e(s, o)));
        return H0((r, s)=>n(Array.from(r.entries()), Array.from(s.entries())));
    }, uB = (t)=>(e, n, r)=>H_e(e) ? YZ(t(Array.from(e.entries()), n), (s)=>new Map(s), r, e) : SA(new As(r, e)), iVe = (t, e, n)=>Mi([
            t,
            e
        ], {
            decode: (r, s)=>uB(OZ(Ws(By(r, s)))),
            encode: (r, s)=>uB(MZ(Ws(By(r, s))))
        }, {
            typeConstructor: {
                _tag: "ReadonlyMap"
            },
            description: n,
            pretty: rVe,
            arbitrary: nVe,
            equivalence: sVe
        }), oVe = ({ key: t, value: e })=>iVe(t, e, `Map<${cT(t)}, ${cT(e)}>`);
    function aVe({ key: t, value: e }) {
        return tf(Ws(By(t, e)), oVe({
            key: ch(t),
            value: ch(e)
        }), {
            strict: !0,
            decode: (n)=>new Map(n),
            encode: (n)=>Array.from(n.entries())
        });
    }
    const BA = (t)=>Array.isArray(t) ? sIe(t) : kX(t), cVe = (t)=>(e)=>t(e).map(BA), lVe = (t)=>(e)=>`Data(${t(e)})`, dB = (t)=>(e, n, r)=>ay(e) ? YZ(t(e, n), BA, r, e) : SA(new As(r, e)), uVe = (t)=>Mi([
            t
        ], {
            decode: (e)=>dB(OZ(e)),
            encode: (e)=>dB(MZ(e))
        }, {
            description: `Data<${cT(t)}>`,
            pretty: lVe,
            arbitrary: cVe
        }), dVe = (t)=>tf(t, uVe(ch(t)), {
            strict: !1,
            decode: (e)=>BA(e),
            encode: (e)=>Array.isArray(e) ? Array.from(e) : Object.assign({}, e)
        });
    function DA(t) {
        return c1(t) ? t : t?.disableValidation ?? !1;
    }
    const FA = jOe, tJ = CMe, fVe = AMe, hVe = fZ, pVe = bA, nJ = Ny, gVe = NMe, Dy = VMe, bVe = DMe, mVe = FMe, Vc = pu, nu = Xa, yVe = jMe, rJ = qMe, Rx = yZ, LA = WMe, s5 = XMe, wVe = GMe, nf = ZRe, zA = JMe, sJ = _Z, _Ve = tRe, i5 = iRe, xVe = oRe, vVe = cRe, iJ = lRe, UA = vZ, SVe = pRe, oJ = fRe, kVe = J3, HA = mRe, TVe = yRe, EVe = xRe, CVe = vRe, fB = Symbol.for("effect/Subscribable"), IVe = dX, hB = hX, AVe = _o, pB = ih, PVe = ACe, OVe = "effect/SubscriptionRef", MVe = Symbol.for(OVe), RVe = {
        _A: (t)=>t
    };
    class NVe extends Kc {
        ref;
        pubsub;
        semaphore;
        [Rd] = Rd;
        [fB] = fB;
        [I7e] = sI;
        [IVe] = fX;
        [MVe] = RVe;
        constructor(e, n, r){
            super(), this.ref = e, this.pubsub = n, this.semaphore = r, this.get = Xo(this.ref);
        }
        commit() {
            return this.get;
        }
        get;
        get changes() {
            return V(Xo(this.ref), Ge((e)=>ht(mZ(this.pubsub, {
                    scoped: !0
                }), (n)=>bA(KMe(e), n))), this.semaphore.withPermits(1), Y3);
        }
        modify(e) {
            return this.modifyEffect((n)=>Gt(e(n)));
        }
        modifyEffect(e) {
            return V(Xo(this.ref), Ge(e), Ge(([n, r])=>V(so(this.ref, r), Ba(n), V3(aG(this.pubsub, r)))), this.semaphore.withPermits(1));
        }
    }
    const VVe = (t)=>Xo(t.ref), BVe = (t)=>V(Ay([
            oG(),
            Ml(t),
            $I(1)
        ]), ht(([e, n, r])=>new NVe(n, e, r))), DVe = j(2, (t, e)=>t.modifyEffect(e)), FVe = j(2, (t, e)=>V(so(t.ref, e), V3(aG(t.pubsub, e)), t.semaphore.withPermits(1))), uh = VVe, jA = BVe, El = DVe, aJ = FVe, gB = QW, zh = PVe, LVe = (t)=>t.all.filter((e)=>"result" in e && (e.result?.status === "FAILURE" || e.result?.status === "PARTIAL_SUCCESS")), zVe = (t)=>t.all.filter((e)=>!("result" in e) || e.result === void 0), UVe = ()=>({
            all: []
        }), HVe = (t, e, n, r)=>{
        const [s, i] = V(t.all, vxe((c)=>r.isOneIncludedInOther(e, c.tx))), o = ly(i, {
            tx: e,
            creationTime: n
        }), a = kxe(o, V(Lv, Th((c)=>r.ids(c).length), Th((c)=>c.tx)));
        return {
            ...t,
            all: ly(s, a)
        };
    }, jVe = (t, e, n)=>({
            ...t,
            all: g1(t.all, (r)=>!n.areAllTxIdsIncluded(r.tx, n.ids(e)))
        }), qVe = (t, e, n, r)=>({
            ...t,
            all: Rs(t.all, (s)=>r.areAllTxIdsIncluded(s.tx, r.ids(e)) ? {
                    ...s,
                    result: n
                } : s)
        }), KVe = (t)=>{
        const e = Mi((s)=>t.isTx(s)), n = tf(ew, e, {
            encode: (s)=>t.serialize(s),
            decode: (s)=>t.deserialize(s)
        }), r = tn({
            tx: n,
            creationTime: tVe
        });
        return tn({
            version: ii("v1"),
            transactions: Ws(r)
        });
    }, cJ = (t, e)=>V(t, Wc(Q1(KVe(e))), ti((n)=>WVe(n))), WVe = (t)=>({
            all: t.transactions
        });
    class lJ extends Xv("@midnight-ntwrk/indexer-client#QueryClient")() {
    }
    const tw = (t, e)=>new $Ve(`${t}Query`, e);
    class $Ve extends Kc {
        name;
        document;
        constructor(e, n){
            super(), this.document = n, this.name = e, this.tag = jc(e), this.run = ((r)=>Ge(this, (s)=>s(r)));
        }
        tag;
        run;
        commit() {
            const e = this;
            return Gn(function*() {
                return un(yield* jX(e.tag), {
                    onSome: Ft,
                    onNone: ()=>e.defaultFn.bind(e)
                });
            });
        }
        defaultFn(e) {
            return lJ.pipe(Ge((n)=>n.query(this.document, e)));
        }
    }
    class uJ extends Xv("@midnight-ntwrk/indexer-client#SubscriptionClient")() {
    }
    const o5 = (t, e)=>new XVe(`${t}Subscription`, e);
    class XVe extends Kc {
        name;
        document;
        constructor(e, n){
            super(), this.document = n, this.name = e, this.tag = jc(e), this.run = ((r)=>Vc(this, (s)=>s(r)));
        }
        tag;
        run;
        commit() {
            const e = this;
            return Gn(function*() {
                return un(yield* jX(e.tag), {
                    onSome: Ft,
                    onNone: ()=>e.defaultFn.bind(e)
                });
            });
        }
        defaultFn(e) {
            return uJ.pipe(Vc((n)=>n.subscribe(this.document, e)));
        }
    }
    function GVe(t, e) {
        if (!!!t) throw new Error(e);
    }
    const dJ = {
        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"
        ]
    }, ZVe = new Set(Object.keys(dJ));
    function bB(t) {
        const e = t?.kind;
        return typeof e == "string" && ZVe.has(e);
    }
    var mB;
    (function(t) {
        t.QUERY = "query", t.MUTATION = "mutation", t.SUBSCRIPTION = "subscription";
    })(mB || (mB = {}));
    var uT;
    (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";
    })(uT || (uT = {}));
    function yB(t) {
        return t === 9 || t === 32;
    }
    function JVe(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 || yB(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 && yB(t.charCodeAt(0));
        return (u && !f || i) && (d += `
`), d += n, (u || l) && (d += `
`), '"""' + d + '"""';
    }
    const YVe = 10, fJ = 2;
    function QVe(t) {
        return a5(t, []);
    }
    function a5(t, e) {
        switch(typeof t){
            case "string":
                return JSON.stringify(t);
            case "function":
                return t.name ? `[function ${t.name}]` : "[function]";
            case "object":
                return eBe(t, e);
            default:
                return String(t);
        }
    }
    function eBe(t, e) {
        if (t === null) return "null";
        if (e.includes(t)) return "[Circular]";
        const n = [
            ...e,
            t
        ];
        if (tBe(t)) {
            const r = t.toJSON();
            if (r !== t) return typeof r == "string" ? r : a5(r, n);
        } else if (Array.isArray(t)) return rBe(t, n);
        return nBe(t, n);
    }
    function tBe(t) {
        return typeof t.toJSON == "function";
    }
    function nBe(t, e) {
        const n = Object.entries(t);
        return n.length === 0 ? "{}" : e.length > fJ ? "[" + sBe(t) + "]" : "{ " + n.map(([s, i])=>s + ": " + a5(i, e)).join(", ") + " }";
    }
    function rBe(t, e) {
        if (t.length === 0) return "[]";
        if (e.length > fJ) return "[Array]";
        const n = Math.min(YVe, t.length), r = t.length - n, s = [];
        for(let i = 0; i < n; ++i)s.push(a5(t[i], e));
        return r === 1 ? s.push("... 1 more item") : r > 1 && s.push(`... ${r} more items`), "[" + s.join(", ") + "]";
    }
    function sBe(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 iBe(t) {
        return `"${t.replace(oBe, aBe)}"`;
    }
    const oBe = /[\x00-\x1f\x22\x5c\x7f-\x9f]/g;
    function aBe(t) {
        return cBe[t.charCodeAt(0)];
    }
    const cBe = [
        "\\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"
    ], lBe = Object.freeze({});
    function uBe(t, e, n = dJ) {
        const r = new Map;
        for (const _ of Object.values(uT))r.set(_, dBe(e, _));
        let s, i = Array.isArray(t), o = [
            t
        ], a = -1, c = [], l = t, u, d;
        const f = [], p = [];
        do {
            a++;
            const _ = a === o.length, v = _ && c.length !== 0;
            if (_) {
                if (u = p.length === 0 ? void 0 : f[f.length - 1], l = d, d = p.pop(), v) if (i) {
                    l = l.slice();
                    let E = 0;
                    for (const [I, D] of c){
                        const U = I - E;
                        D === null ? (l.splice(U, 1), E++) : l[U] = D;
                    }
                } else {
                    l = {
                        ...l
                    };
                    for (const [E, I] of c)l[E] = I;
                }
                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 w;
            if (!Array.isArray(l)) {
                var h, b;
                bB(l) || GVe(!1, `Invalid AST Node: ${QVe(l)}.`);
                const E = _ ? (h = r.get(l.kind)) === null || h === void 0 ? void 0 : h.leave : (b = r.get(l.kind)) === null || b === void 0 ? void 0 : b.enter;
                if (w = E?.call(e, l, u, d, f, p), w === lBe) break;
                if (w === !1) {
                    if (!_) {
                        f.pop();
                        continue;
                    }
                } else if (w !== void 0 && (c.push([
                    u,
                    w
                ]), !_)) if (bB(w)) l = w;
                else {
                    f.pop();
                    continue;
                }
            }
            if (w === void 0 && v && c.push([
                u,
                l
            ]), _) f.pop();
            else {
                var y;
                s = {
                    inArray: i,
                    index: a,
                    keys: o,
                    edits: c,
                    prev: s
                }, i = Array.isArray(l), o = i ? l : (y = n[l.kind]) !== null && y !== void 0 ? y : [], a = -1, c = [], d && p.push(d), d = l;
            }
        }while (s !== void 0);
        return c.length !== 0 ? c[c.length - 1][1] : t;
    }
    function dBe(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 hJ(t) {
        return uBe(t, hBe);
    }
    const fBe = 80, hBe = {
        Name: {
            leave: (t)=>t.value
        },
        Variable: {
            leave: (t)=>"$" + t.name
        },
        Document: {
            leave: (t)=>ct(t.definitions, `

`)
        },
        OperationDefinition: {
            leave (t) {
                const e = TS(t.variableDefinitions) ? Xt(`(
`, ct(t.variableDefinitions, `
`), `
)`) : Xt("(", ct(t.variableDefinitions, ", "), ")"), n = Xt("", t.description, `
`) + ct([
                    t.operation,
                    ct([
                        t.name,
                        e
                    ]),
                    ct(t.directives, " ")
                ], " ");
                return (n === "query" ? "" : n + " ") + t.selectionSet;
            }
        },
        VariableDefinition: {
            leave: ({ variable: t, type: e, defaultValue: n, directives: r, description: s })=>Xt("", s, `
`) + t + ": " + e + Xt(" = ", n) + Xt(" ", ct(r, " "))
        },
        SelectionSet: {
            leave: ({ selections: t })=>ba(t)
        },
        Field: {
            leave ({ alias: t, name: e, arguments: n, directives: r, selectionSet: s }) {
                const i = Xt("", t, ": ") + e;
                let o = i + Xt("(", ct(n, ", "), ")");
                return o.length > fBe && (o = i + Xt(`(
`, t2(ct(n, `
`)), `
)`)), ct([
                    o,
                    ct(r, " "),
                    s
                ], " ");
            }
        },
        Argument: {
            leave: ({ name: t, value: e })=>t + ": " + e
        },
        FragmentSpread: {
            leave: ({ name: t, directives: e })=>"..." + t + Xt(" ", ct(e, " "))
        },
        InlineFragment: {
            leave: ({ typeCondition: t, directives: e, selectionSet: n })=>ct([
                    "...",
                    Xt("on ", t),
                    ct(e, " "),
                    n
                ], " ")
        },
        FragmentDefinition: {
            leave: ({ name: t, typeCondition: e, variableDefinitions: n, directives: r, selectionSet: s, description: i })=>Xt("", i, `
`) + `fragment ${t}${Xt("(", ct(n, ", "), ")")} on ${e} ${Xt("", ct(r, " "), " ")}` + s
        },
        IntValue: {
            leave: ({ value: t })=>t
        },
        FloatValue: {
            leave: ({ value: t })=>t
        },
        StringValue: {
            leave: ({ value: t, block: e })=>e ? JVe(t) : iBe(t)
        },
        BooleanValue: {
            leave: ({ value: t })=>t ? "true" : "false"
        },
        NullValue: {
            leave: ()=>"null"
        },
        EnumValue: {
            leave: ({ value: t })=>t
        },
        ListValue: {
            leave: ({ values: t })=>"[" + ct(t, ", ") + "]"
        },
        ObjectValue: {
            leave: ({ fields: t })=>"{" + ct(t, ", ") + "}"
        },
        ObjectField: {
            leave: ({ name: t, value: e })=>t + ": " + e
        },
        Directive: {
            leave: ({ name: t, arguments: e })=>"@" + t + Xt("(", ct(e, ", "), ")")
        },
        NamedType: {
            leave: ({ name: t })=>t
        },
        ListType: {
            leave: ({ type: t })=>"[" + t + "]"
        },
        NonNullType: {
            leave: ({ type: t })=>t + "!"
        },
        SchemaDefinition: {
            leave: ({ description: t, directives: e, operationTypes: n })=>Xt("", t, `
`) + ct([
                    "schema",
                    ct(e, " "),
                    ba(n)
                ], " ")
        },
        OperationTypeDefinition: {
            leave: ({ operation: t, type: e })=>t + ": " + e
        },
        ScalarTypeDefinition: {
            leave: ({ description: t, name: e, directives: n })=>Xt("", t, `
`) + ct([
                    "scalar",
                    e,
                    ct(n, " ")
                ], " ")
        },
        ObjectTypeDefinition: {
            leave: ({ description: t, name: e, interfaces: n, directives: r, fields: s })=>Xt("", t, `
`) + ct([
                    "type",
                    e,
                    Xt("implements ", ct(n, " & ")),
                    ct(r, " "),
                    ba(s)
                ], " ")
        },
        FieldDefinition: {
            leave: ({ description: t, name: e, arguments: n, type: r, directives: s })=>Xt("", t, `
`) + e + (TS(n) ? Xt(`(
`, t2(ct(n, `
`)), `
)`) : Xt("(", ct(n, ", "), ")")) + ": " + r + Xt(" ", ct(s, " "))
        },
        InputValueDefinition: {
            leave: ({ description: t, name: e, type: n, defaultValue: r, directives: s })=>Xt("", t, `
`) + ct([
                    e + ": " + n,
                    Xt("= ", r),
                    ct(s, " ")
                ], " ")
        },
        InterfaceTypeDefinition: {
            leave: ({ description: t, name: e, interfaces: n, directives: r, fields: s })=>Xt("", t, `
`) + ct([
                    "interface",
                    e,
                    Xt("implements ", ct(n, " & ")),
                    ct(r, " "),
                    ba(s)
                ], " ")
        },
        UnionTypeDefinition: {
            leave: ({ description: t, name: e, directives: n, types: r })=>Xt("", t, `
`) + ct([
                    "union",
                    e,
                    ct(n, " "),
                    Xt("= ", ct(r, " | "))
                ], " ")
        },
        EnumTypeDefinition: {
            leave: ({ description: t, name: e, directives: n, values: r })=>Xt("", t, `
`) + ct([
                    "enum",
                    e,
                    ct(n, " "),
                    ba(r)
                ], " ")
        },
        EnumValueDefinition: {
            leave: ({ description: t, name: e, directives: n })=>Xt("", t, `
`) + ct([
                    e,
                    ct(n, " ")
                ], " ")
        },
        InputObjectTypeDefinition: {
            leave: ({ description: t, name: e, directives: n, fields: r })=>Xt("", t, `
`) + ct([
                    "input",
                    e,
                    ct(n, " "),
                    ba(r)
                ], " ")
        },
        DirectiveDefinition: {
            leave: ({ description: t, name: e, arguments: n, repeatable: r, locations: s })=>Xt("", t, `
`) + "directive @" + e + (TS(n) ? Xt(`(
`, t2(ct(n, `
`)), `
)`) : Xt("(", ct(n, ", "), ")")) + (r ? " repeatable" : "") + " on " + ct(s, " | ")
        },
        SchemaExtension: {
            leave: ({ directives: t, operationTypes: e })=>ct([
                    "extend schema",
                    ct(t, " "),
                    ba(e)
                ], " ")
        },
        ScalarTypeExtension: {
            leave: ({ name: t, directives: e })=>ct([
                    "extend scalar",
                    t,
                    ct(e, " ")
                ], " ")
        },
        ObjectTypeExtension: {
            leave: ({ name: t, interfaces: e, directives: n, fields: r })=>ct([
                    "extend type",
                    t,
                    Xt("implements ", ct(e, " & ")),
                    ct(n, " "),
                    ba(r)
                ], " ")
        },
        InterfaceTypeExtension: {
            leave: ({ name: t, interfaces: e, directives: n, fields: r })=>ct([
                    "extend interface",
                    t,
                    Xt("implements ", ct(e, " & ")),
                    ct(n, " "),
                    ba(r)
                ], " ")
        },
        UnionTypeExtension: {
            leave: ({ name: t, directives: e, types: n })=>ct([
                    "extend union",
                    t,
                    ct(e, " "),
                    Xt("= ", ct(n, " | "))
                ], " ")
        },
        EnumTypeExtension: {
            leave: ({ name: t, directives: e, values: n })=>ct([
                    "extend enum",
                    t,
                    ct(e, " "),
                    ba(n)
                ], " ")
        },
        InputObjectTypeExtension: {
            leave: ({ name: t, directives: e, fields: n })=>ct([
                    "extend input",
                    t,
                    ct(e, " "),
                    ba(n)
                ], " ")
        },
        TypeCoordinate: {
            leave: ({ name: t })=>t
        },
        MemberCoordinate: {
            leave: ({ name: t, memberName: e })=>ct([
                    t,
                    Xt(".", e)
                ])
        },
        ArgumentCoordinate: {
            leave: ({ name: t, fieldName: e, argumentName: n })=>ct([
                    t,
                    Xt(".", e),
                    Xt("(", n, ":)")
                ])
        },
        DirectiveCoordinate: {
            leave: ({ name: t })=>ct([
                    "@",
                    t
                ])
        },
        DirectiveArgumentCoordinate: {
            leave: ({ name: t, argumentName: e })=>ct([
                    "@",
                    t,
                    Xt("(", e, ":)")
                ])
        }
    };
    function ct(t, e = "") {
        var n;
        return (n = t?.filter((r)=>r).join(e)) !== null && n !== void 0 ? n : "";
    }
    function ba(t) {
        return Xt(`{
`, t2(ct(t, `
`)), `
}`);
    }
    function Xt(t, e, n = "") {
        return e != null && e !== "" ? t + e + n : "";
    }
    function t2(t) {
        return Xt("  ", t.replace(/\n/g, `
  `));
    }
    function TS(t) {
        var e;
        return (e = t?.some((n)=>n.includes(`
`))) !== null && e !== void 0 ? e : !1;
    }
    function pBe(t) {
        return typeof t == "object" && t !== null;
    }
    function gBe(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 b = await s(p, h);
                            if (u.signal.aborted) return;
                            if (!b) throw p;
                            h++;
                        }
                        try {
                            const b = typeof t.url == "function" ? await t.url(c) : t.url;
                            if (u.signal.aborted) return;
                            const y = typeof t.headers == "function" ? await t.headers() : (f = t.headers) !== null && f !== void 0 ? f : {};
                            if (u.signal.aborted) return;
                            let _;
                            try {
                                _ = await i(b, {
                                    signal: u.signal,
                                    method: "POST",
                                    headers: Object.assign(Object.assign({}, y), {
                                        "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 (E) {
                                throw new ES(E);
                            }
                            if (!_.ok) throw new ES(_);
                            if (!_.body) throw new Error("Missing response body");
                            const v = _.headers.get("content-type");
                            if (!v) throw new Error("Missing response content-type");
                            if (!v.includes("application/graphql-response+json") && !v.includes("application/json")) throw new Error(`Unsupported response content-type ${v}`);
                            const w = await _.json();
                            return l.next(w), u.abort();
                        } catch (b) {
                            if (u.signal.aborted) return;
                            if (!(b instanceof ES)) throw b;
                            p = b;
                        }
                    }
                })().then(()=>l.complete()).catch((f)=>l.error(f)), ()=>u.abort();
            },
            dispose () {
                a.dispose();
            }
        };
    }
    class ES extends Error {
        constructor(e){
            let n, r;
            bBe(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 bBe(t) {
        return pBe(t) && typeof t.ok == "boolean" && typeof t.status == "number" && typeof t.statusText == "string";
    }
    class pJ extends wn("InvalidProtocolSchemeError") {
        static tag = "InvalidProtocolSchemeError";
    }
    class mBe extends wn("FailedToDeriveWebSocketUrlError") {
        static tag = "FailedToDeriveWebSocketUrlError";
    }
    const gJ = Gq((t)=>t.protocol === "http:" || t.protocol === "https:", (t)=>Xq(`Invalid protocol scheme '${t.protocol}'. Expected 'http:' or 'https:'`)), bJ = (t)=>{
        const e = new URL(t);
        try {
            return lt(gJ(e));
        } catch (n) {
            return Qe(new pJ({
                message: String(n),
                invalidScheme: e.protocol
            }));
        }
    }, yBe = Gq((t)=>t.protocol === "ws:" || t.protocol === "wss:", (t)=>Xq(`Invalid protocol scheme '${t.protocol}'. Expected 'ws:' or 'wss:'`)), c5 = (t)=>{
        const e = new URL(t);
        try {
            return lt(yBe(e));
        } catch (n) {
            return Qe(new pJ({
                message: String(n),
                invalidScheme: e.protocol
            }));
        }
    };
    class ta extends wn("ClientError") {
    }
    class Fy extends wn("ServerError") {
    }
    const qA = (t)=>GX(lJ, bJ(t.url).pipe(Ge((e)=>cp(Dn(()=>gBe({
                    url: e.toString(),
                    shouldRetry: (n, r)=>{
                        const s = n.response?.status ?? 500;
                        return Promise.resolve(r < 3 && s >= 502 && s <= 504);
                    }
                })), (n)=>Dn(()=>n.dispose()))), ht((e)=>new wBe(e))));
    class wBe {
        constructor(e){
            this.client = e;
        }
        client;
        query(e, n) {
            return rAe((r)=>{
                let s;
                const i = this.client.subscribe({
                    query: hJ(e),
                    variables: n
                }, {
                    next: (o)=>s = o,
                    error: (o)=>{
                        const a = o.response?.status ?? 500, c = o.response?.statusText ?? "An unknown error occurred";
                        r(Bs(a >= 400 && a < 500 ? new ta({
                            message: c,
                            cause: o
                        }) : new Fy({
                            message: c
                        })));
                    },
                    complete: ()=>r(s.errors ? Bs(new ta({
                            message: s.errors[0].message,
                            cause: s.errors
                        })) : Gt(s.data))
                });
                return Dn(i);
            });
        }
    }
    function Li(t) {
        return t === null ? "null" : Array.isArray(t) ? "array" : typeof t;
    }
    function Pf(t) {
        return Li(t) === "object";
    }
    function _Be(t) {
        return Array.isArray(t) && t.length > 0 && t.every((e)=>"message" in e);
    }
    function wB(t, e) {
        return t.length < 124 ? t : e;
    }
    const xBe = "graphql-transport-ws";
    var zo = ((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))(zo || {}), Uo = ((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))(Uo || {});
    function mJ(t) {
        if (!Pf(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 && !Pf(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 (!Pf(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 && !Pf(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 && !Pf(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 (!Pf(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 (!_Be(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 vBe(t, e) {
        return mJ(typeof t == "string" ? JSON.parse(t, e) : t);
    }
    function Hb(t, e) {
        return mJ(t), JSON.stringify(t, e);
    }
    function SBe(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(x) {
            const A = Math.pow(2, x);
            await new Promise((R)=>setTimeout(R, A * 1e3 + Math.floor(Math.random() * 2700 + 300)));
        }, shouldRetry: d = CS, on: f, webSocketImpl: p, generateID: h = function() {
            return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (x)=>{
                const A = Math.random() * 16 | 0;
                return (x == "x" ? A : A & 3 | 8).toString(16);
            });
        }, jsonMessageReplacer: b, jsonMessageReviver: y } = t;
        let _;
        if (p) {
            if (!TBe(p)) throw new Error("Invalid WebSocket implementation provided");
            _ = p;
        } else typeof WebSocket < "u" ? _ = WebSocket : typeof globalThis < "u" ? _ = globalThis.WebSocket || globalThis.MozWebSocket : typeof window < "u" && (_ = window.WebSocket || window.MozWebSocket);
        if (!_) throw new Error("WebSocket implementation missing; on Node you can `import WebSocket from 'ws';` and pass `webSocketImpl: WebSocket` to `createClient`");
        const v = _, w = (()=>{
            const g = (()=>{
                const A = {};
                return {
                    on (R, N) {
                        return A[R] = N, ()=>{
                            delete A[R];
                        };
                    },
                    emit (R) {
                        "id" in R && A[R.id]?.(R);
                    }
                };
            })(), x = {
                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 (A, R) {
                    const N = x[A];
                    return N.push(R), ()=>{
                        N.splice(N.indexOf(R), 1);
                    };
                },
                emit (A, ...R) {
                    for (const N of [
                        ...x[A]
                    ])N(...R);
                }
            };
        })();
        function E(g) {
            const x = [
                w.on("error", (A)=>{
                    x.forEach((R)=>R()), g(A);
                }),
                w.on("closed", (A)=>{
                    x.forEach((R)=>R()), g(A);
                })
            ];
        }
        let I, D = 0, U, K = !1, $ = 0, ne = !1;
        async function te() {
            clearTimeout(U);
            const [g, x] = await (I ?? (I = new Promise((N, L)=>(async ()=>{
                    if (K) {
                        if (await u($), !D) return I = void 0, L({
                            code: 1e3,
                            reason: "All Subscriptions Gone"
                        });
                        $++;
                    }
                    w.emit("connecting", K);
                    const z = new v(typeof e == "function" ? await e() : e, xBe);
                    let B, S;
                    function O() {
                        isFinite(o) && o > 0 && (clearTimeout(S), S = setTimeout(()=>{
                            z.readyState === v.OPEN && (z.send(Hb({
                                type: Uo.Ping
                            })), w.emit("ping", !1, void 0));
                        }, o));
                    }
                    E((F)=>{
                        I = void 0, clearTimeout(B), clearTimeout(S), L(F), F instanceof _B && (z.close(4499, "Terminated"), z.onerror = null, z.onclose = null);
                    }), z.onerror = (F)=>w.emit("error", F), z.onclose = (F)=>w.emit("closed", F), z.onopen = async ()=>{
                        try {
                            w.emit("opened", z);
                            const F = typeof n == "function" ? await n() : n;
                            if (z.readyState !== v.OPEN) return;
                            z.send(Hb(F ? {
                                type: Uo.ConnectionInit,
                                payload: F
                            } : {
                                type: Uo.ConnectionInit
                            }, b)), isFinite(c) && c > 0 && (B = setTimeout(()=>{
                                z.close(zo.ConnectionAcknowledgementTimeout, "Connection acknowledgement timeout");
                            }, c)), O();
                        } catch (F) {
                            w.emit("error", F), z.close(zo.InternalClientError, wB(F instanceof Error ? F.message : String(F), "Internal client error"));
                        }
                    };
                    let W = !1;
                    z.onmessage = ({ data: F })=>{
                        try {
                            const G = vBe(F, y);
                            if (w.emit("message", G), G.type === "ping" || G.type === "pong") {
                                w.emit(G.type, !0, G.payload), G.type === "pong" ? O() : a || (z.send(Hb(G.payload ? {
                                    type: Uo.Pong,
                                    payload: G.payload
                                } : {
                                    type: Uo.Pong
                                })), w.emit("pong", !1, G.payload));
                                return;
                            }
                            if (W) return;
                            if (G.type !== Uo.ConnectionAck) throw new Error(`First message cannot be of type ${G.type}`);
                            clearTimeout(B), W = !0, w.emit("connected", z, G.payload, K), K = !1, $ = 0, N([
                                z,
                                new Promise((ee, Q)=>E(Q))
                            ]);
                        } catch (G) {
                            z.onmessage = null, w.emit("error", G), z.close(zo.BadResponse, wB(G instanceof Error ? G.message : String(G), "Bad response"));
                        }
                    };
                })())));
            g.readyState === v.CLOSING && await x;
            let A = ()=>{};
            const R = new Promise((N)=>A = N);
            return [
                g,
                A,
                Promise.race([
                    R.then(()=>{
                        if (!D) {
                            const N = ()=>g.close(1e3, "Normal Closure");
                            isFinite(i) && i > 0 ? U = setTimeout(()=>{
                                g.readyState === v.OPEN && N();
                            }, i) : N();
                        }
                    }),
                    x
                ])
            ];
        }
        function J(g) {
            if (CS(g) && (kBe(g.code) || [
                zo.InternalServerError,
                zo.InternalClientError,
                zo.BadRequest,
                zo.BadResponse,
                zo.Unauthorized,
                zo.SubprotocolNotAcceptable,
                zo.SubscriberAlreadyExists,
                zo.TooManyInitialisationRequests
            ].includes(g.code))) throw g;
            if (ne) return !1;
            if (CS(g) && g.code === 1e3) return D > 0;
            if (!l || $ >= l || !d(g)) throw g;
            return K = !0;
        }
        r || (async ()=>{
            for(D++;;)try {
                const [, , g] = await te();
                await g;
            } catch (g) {
                try {
                    if (!J(g)) return;
                } catch (x) {
                    return s?.(x);
                }
            }
        })();
        function C(g, x) {
            const A = h(g);
            let R = !1, N = !1, L = ()=>{
                D--, R = !0;
            };
            return (async ()=>{
                for(D++;;)try {
                    const [z, B, S] = await te();
                    if (R) return B();
                    const O = w.onMessage(A, (W)=>{
                        switch(W.type){
                            case Uo.Next:
                                {
                                    x.next(W.payload);
                                    return;
                                }
                            case Uo.Error:
                                {
                                    N = !0, R = !0, x.error(W.payload), L();
                                    return;
                                }
                            case Uo.Complete:
                                {
                                    R = !0, L();
                                    return;
                                }
                        }
                    });
                    z.send(Hb({
                        id: A,
                        type: Uo.Subscribe,
                        payload: g
                    }, b)), L = ()=>{
                        !R && z.readyState === v.OPEN && z.send(Hb({
                            id: A,
                            type: Uo.Complete
                        }, b)), D--, R = !0, B();
                    }, await S.finally(O);
                    return;
                } catch (z) {
                    if (!J(z)) return;
                }
            })().then(()=>{
                N || x.complete();
            }).catch((z)=>{
                x.error(z);
            }), ()=>{
                R || L();
            };
        }
        return {
            on: w.on,
            subscribe: C,
            iterate (g) {
                const x = [], A = {
                    done: !1,
                    error: null,
                    resolve: ()=>{}
                }, R = C(g, {
                    next (L) {
                        x.push(L), A.resolve();
                    },
                    error (L) {
                        A.done = !0, A.error = L, A.resolve();
                    },
                    complete () {
                        A.done = !0, A.resolve();
                    }
                }), N = (async function*() {
                    for(;;){
                        for(x.length || await new Promise((z)=>A.resolve = z); x.length;)yield x.shift();
                        if (A.error) throw A.error;
                        if (A.done) return;
                    }
                })();
                return N.throw = async (L)=>(A.done || (A.done = !0, A.error = L, A.resolve()), {
                        done: !0,
                        value: void 0
                    }), N.return = async ()=>(R(), {
                        done: !0,
                        value: void 0
                    }), N;
            },
            async dispose () {
                if (ne = !0, I) {
                    const [g] = await I;
                    g.close(1e3, "Normal Closure");
                }
            },
            terminate () {
                I && w.emit("closed", new _B);
            }
        };
    }
    class _B extends Error {
        name = "TerminatedCloseEvent";
        message = "4499: Terminated";
        code = 4499;
        reason = "Terminated";
        wasClean = !1;
    }
    function CS(t) {
        return Pf(t) && "code" in t && "reason" in t;
    }
    function kBe(t) {
        return [
            1e3,
            1001,
            1006,
            1005,
            1012,
            1013,
            1014
        ].includes(t) ? !1 : t >= 1e3 && t <= 1999;
    }
    function TBe(t) {
        return typeof t == "function" && "constructor" in t && "CLOSED" in t && "CLOSING" in t && "CONNECTING" in t && "OPEN" in t;
    }
    const KA = (t)=>ZX(uJ, c5(t.url).pipe(Ge((e)=>cp(Dn(()=>SBe({
                    url: e.toString(),
                    shouldRetry: ()=>!1,
                    keepAlive: t.keepAlive ?? 15e3
                })), (n)=>Dn(()=>n.dispose()))), ht((e)=>new EBe(e))));
    class EBe {
        constructor(e){
            this.client = e;
        }
        client;
        subscribe(e, n) {
            return tJ((r)=>{
                const s = this.client.subscribe({
                    query: hJ(e),
                    variables: n
                }, {
                    next: (i)=>{
                        if (i.errors) return void r.fail(new ta({
                            message: i.errors[0].message,
                            cause: i.errors
                        }));
                        r.single(i.data);
                    },
                    error: (i)=>{
                        r.fail(Array.isArray(i) ? new ta({
                            message: i[0].message
                        }) : new Fy({
                            message: String(i)
                        }));
                    },
                    complete: ()=>void r.end()
                });
                return Dn(s);
            });
        }
    }
    const CBe = (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", lt(n.toString());
        } catch (n) {
            const r = n instanceof Error ? n : new Error(String(n));
            return Qe(new mBe({
                message: `Failed to derive WebSocket URL from ${e.toString()}`,
                cause: r
            }));
        }
    }, WA = (t, e)=>e ? lt(e) : CBe(t), IBe = (t, e, n)=>t.run(e).pipe(Bd(qA(n)), jI, En), ABe = {
        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"
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }, PBe = {
        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"
                                        }
                                    }
                                }
                            ]
                        }
                    ]
                }
            }
        ]
    }, OBe = {
        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"
                                        }
                                    }
                                }
                            ]
                        }
                    ]
                }
            }
        ]
    }, MBe = {
        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"
                                                                }
                                                            }
                                                        ]
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }, RBe = {
        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"
                                                                }
                                                            }
                                                        ]
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }, NBe = {
        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"
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }, VBe = {
        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"
                                                                }
                                                            }
                                                        ]
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }, BBe = {
        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"
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }, DBe = {
        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"
                                        }
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        ]
    }, FBe = {
        "\n    query BlockHash($offset: BlockOffset) {\n      block(offset: $offset) {\n        height\n        hash\n        ledgerParameters\n        timestamp\n      }\n    }\n  ": ABe,
        "\n    mutation Connect($viewingKey: ViewingKey!) {\n      connect(viewingKey: $viewingKey)\n    }\n  ": PBe,
        "\n    mutation Disconnect($sessionId: HexEncoded!) {\n      disconnect(sessionId: $sessionId)\n    }\n  ": OBe,
        "\n    query FetchTermsAndConditions {\n      block {\n        systemParameters {\n          termsAndConditions {\n            hash\n            url\n          }\n        }\n      }\n    }\n  ": MBe,
        "\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  ": RBe,
        "\n    subscription DustLedgerEvents($id: Int) {\n      dustLedgerEvents(id: $id) {\n        type: __typename\n        id\n        raw\n        maxId\n      }\n    }\n  ": NBe,
        "\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  ": VBe,
        "\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  ": BBe,
        "\n    subscription ZswapEvents($id: Int) {\n      zswapLedgerEvents(id: $id) {\n        id\n        raw\n        maxId\n      }\n    }\n  ": DBe
    };
    function gu(t) {
        return FBe[t] ?? {};
    }
    tw("Connect", gu(`
    mutation Connect($viewingKey: ViewingKey!) {
      connect(viewingKey: $viewingKey)
    }
  `));
    tw("Disconnect", gu(`
    mutation Disconnect($sessionId: HexEncoded!) {
      disconnect(sessionId: $sessionId)
    }
  `));
    const LBe = tw("BlockHash", gu(`
    query BlockHash($offset: BlockOffset) {
      block(offset: $offset) {
        height
        hash
        ledgerParameters
        timestamp
      }
    }
  `)), zBe = tw("FetchTermsAndConditions", gu(`
    query FetchTermsAndConditions {
      block {
        systemParameters {
          termsAndConditions {
            hash
            url
          }
        }
      }
    }
  `)), UBe = tw("TransactionStatus", gu(`
    query TransactionStatus($transactionId: HexEncoded!) {
      transactions(offset: {identifier: $transactionId}) {
        __typename
        ... on RegularTransaction {
          identifiers
          transactionResult {
            segments {
              id
              success
            }
            status
            __typename
          }
        }
      }
    }
  `)), HBe = o5("DustLedgerEvents", gu(`
    subscription DustLedgerEvents($id: Int) {
      dustLedgerEvents(id: $id) {
        type: __typename
        id
        raw
        maxId
      }
    }
  `));
    o5("ShieldedTransactions", gu(`
    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 jBe = o5("UnshieldedTransactions", gu(`
    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
        }
      }
    }
  `)), qBe = o5("ZswapEvents", gu(`
    subscription ZswapEvents($id: Int) {
      zswapLedgerEvents(id: $id) {
        id
        raw
        maxId
      }
    }
  `)), IS = j(2, (t, e)=>t.reduce(e)), yJ = j(2, (t, e)=>Yl(t, e.empty, e.combine)), KBe = {
        empty: 0,
        combine: (t, e)=>t + e
    }, WBe = {
        empty: 0n,
        combine: (t, e)=>t + e
    };
    yJ(KBe);
    const $Be = yJ(WBe), XBe = (t)=>t.arrayBuffer().then((e)=>new Uint8Array(e)), wJ = (t, e)=>new Date(+t + Number(e) * 1e3), Or = (t)=>cr(t, {
            onLeft: (e)=>Bs(e),
            onRight: (e)=>Gt(e)
        });
    j(2, (t, e)=>cr(t, {
            onRight: (n)=>lt(n),
            onLeft: e
        }));
    class Kxt extends wn("LeftError") {
        constructor({ cause: e }){
            super({
                message: "Unexpected left value",
                cause: e
            });
        }
    }
    const $A = (t)=>t.__polyTag__, GBe = (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__)}`);
    }, ZBe = (t, e)=>[
            ...t,
            e
        ];
    function JBe(t, e) {
        return t.length == 0 ? e() : t.at(0);
    }
    const _J = (t)=>JBe(t, ()=>{
            throw new Error("Cannot get head from empty hlist");
        }), YBe = (t)=>t.toSpliced(0, 1);
    class QBe extends wn("LedgerError") {
    }
    const n2 = (t)=>bo({
            try: t,
            catch: (e)=>{
                const n = e instanceof Error ? e.message : `${e?.toString()}`;
                return new QBe({
                    message: `Error from ledger: ${n}`,
                    cause: e
                });
            }
        });
    var dT = function(t, e) {
        return dT = 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]);
        }, dT(t, e);
    };
    function Po(t, e) {
        if (typeof e != "function" && e !== null) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
        dT(t, e);
        function n() {
            this.constructor = t;
        }
        t.prototype = e === null ? Object.create(e) : (n.prototype = e.prototype, new n);
    }
    function eDe(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 xJ(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 bg(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 Uh(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 Hh(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 d0(t) {
        return this instanceof d0 ? (this.v = t, this) : new d0(t);
    }
    function tDe(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(b) {
                return new Promise(function(y, _) {
                    i.push([
                        p,
                        b,
                        y,
                        _
                    ]) > 1 || c(p, b);
                });
            }, h && (s[p] = h(s[p])));
        }
        function c(p, h) {
            try {
                l(r[p](h));
            } catch (b) {
                f(i[0][3], b);
            }
        }
        function l(p) {
            p.value instanceof d0 ? 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 nDe(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 bg == "function" ? bg(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 ur(t) {
        return typeof t == "function";
    }
    function XA(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 AS = XA(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 Nx(t, e) {
        if (t) {
            var n = t.indexOf(e);
            0 <= n && t.splice(n, 1);
        }
    }
    var ru = (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 = bg(o), c = a.next(); !c.done; c = a.next()){
                        var l = c.value;
                        l.remove(this);
                    }
                } catch (b) {
                    e = {
                        error: b
                    };
                } 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 (ur(u)) try {
                    u();
                } catch (b) {
                    i = b instanceof AS ? b.errors : [
                        b
                    ];
                }
                var d = this._finalizers;
                if (d) {
                    this._finalizers = null;
                    try {
                        for(var f = bg(d), p = f.next(); !p.done; p = f.next()){
                            var h = p.value;
                            try {
                                xB(h);
                            } catch (b) {
                                i = i ?? [], b instanceof AS ? i = Hh(Hh([], Uh(i)), Uh(b.errors)) : i.push(b);
                            }
                        }
                    } catch (b) {
                        r = {
                            error: b
                        };
                    } finally{
                        try {
                            p && !p.done && (s = f.return) && s.call(f);
                        } finally{
                            if (r) throw r.error;
                        }
                    }
                }
                if (i) throw new AS(i);
            }
        }, t.prototype.add = function(e) {
            var n;
            if (e && e !== this) if (this.closed) xB(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) && Nx(n, e);
        }, t.prototype.remove = function(e) {
            var n = this._finalizers;
            n && Nx(n, e), e instanceof t && e._removeParent(this);
        }, t.EMPTY = (function() {
            var e = new t;
            return e.closed = !0, e;
        })(), t;
    })(), vJ = ru.EMPTY;
    function SJ(t) {
        return t instanceof ru || t && "closed" in t && ur(t.remove) && ur(t.add) && ur(t.unsubscribe);
    }
    function xB(t) {
        ur(t) ? t() : t.unsubscribe();
    }
    var rDe = {
        Promise: void 0
    }, sDe = {
        setTimeout: function(t, e) {
            for(var n = [], r = 2; r < arguments.length; r++)n[r - 2] = arguments[r];
            return setTimeout.apply(void 0, Hh([
                t,
                e
            ], Uh(n)));
        },
        clearTimeout: function(t) {
            return clearTimeout(t);
        },
        delegate: void 0
    };
    function kJ(t) {
        sDe.setTimeout(function() {
            throw t;
        });
    }
    function vB() {}
    function r2(t) {
        t();
    }
    var GA = (function(t) {
        Po(e, t);
        function e(n) {
            var r = t.call(this) || this;
            return r.isStopped = !1, n ? (r.destination = n, SJ(n) && n.add(r)) : r.destination = aDe, r;
        }
        return e.create = function(n, r, s) {
            return new mg(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;
    })(ru), iDe = (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) {
                r_(r);
            }
        }, t.prototype.error = function(e) {
            var n = this.partialObserver;
            if (n.error) try {
                n.error(e);
            } catch (r) {
                r_(r);
            }
            else r_(e);
        }, t.prototype.complete = function() {
            var e = this.partialObserver;
            if (e.complete) try {
                e.complete();
            } catch (n) {
                r_(n);
            }
        }, t;
    })(), mg = (function(t) {
        Po(e, t);
        function e(n, r, s) {
            var i = t.call(this) || this, o;
            return ur(n) || !n ? o = {
                next: n ?? void 0,
                error: r ?? void 0,
                complete: s ?? void 0
            } : o = n, i.destination = new iDe(o), i;
        }
        return e;
    })(GA);
    function r_(t) {
        kJ(t);
    }
    function oDe(t) {
        throw t;
    }
    var aDe = {
        closed: !0,
        next: vB,
        error: oDe,
        complete: vB
    }, ZA = (function() {
        return typeof Symbol == "function" && Symbol.observable || "@@observable";
    })();
    function up(t) {
        return t;
    }
    function cDe(t) {
        return t.length === 0 ? up : t.length === 1 ? t[0] : function(n) {
            return t.reduce(function(r, s) {
                return s(r);
            }, n);
        };
    }
    var ls = (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 = uDe(e) ? e : new mg(e, n, r);
            return r2(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 = SB(n), new n(function(s, i) {
                var o = new mg({
                    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[ZA] = function() {
            return this;
        }, t.prototype.pipe = function() {
            for(var e = [], n = 0; n < arguments.length; n++)e[n] = arguments[n];
            return cDe(e)(this);
        }, t.prototype.toPromise = function(e) {
            var n = this;
            return e = SB(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 SB(t) {
        var e;
        return (e = t ?? rDe.Promise) !== null && e !== void 0 ? e : Promise;
    }
    function lDe(t) {
        return t && ur(t.next) && ur(t.error) && ur(t.complete);
    }
    function uDe(t) {
        return t && t instanceof GA || lDe(t) && SJ(t);
    }
    function TJ(t) {
        return ur(t?.lift);
    }
    function Fs(t) {
        return function(e) {
            if (TJ(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 Xs(t, e, n, r, s) {
        return new dDe(t, e, n, r, s);
    }
    var dDe = (function(t) {
        Po(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;
    })(GA);
    function JA() {
        return Fs(function(t, e) {
            var n = null;
            t._refCount++;
            var r = Xs(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 fDe = (function(t) {
        Po(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, TJ(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 ru;
                var s = this.getSubject();
                r.add(this.source.subscribe(Xs(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 = ru.EMPTY);
            }
            return r;
        }, e.prototype.refCount = function() {
            return JA()(this);
        }, e;
    })(ls), hDe = XA(function(t) {
        return function() {
            t(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
        };
    }), nw = (function(t) {
        Po(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 kB(this, this);
            return r.operator = n, r;
        }, e.prototype._throwIfClosed = function() {
            if (this.closed) throw new hDe;
        }, e.prototype.next = function(n) {
            var r = this;
            r2(function() {
                var s, i;
                if (r._throwIfClosed(), !r.isStopped) {
                    r.currentObservers || (r.currentObservers = Array.from(r.observers));
                    try {
                        for(var o = bg(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;
            r2(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;
            r2(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 ? vJ : (this.currentObservers = null, a.push(n), new ru(function() {
                r.currentObservers = null, Nx(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 ls;
            return n.source = this, n;
        }, e.create = function(n, r) {
            return new kB(n, r);
        }, e;
    })(ls), kB = (function(t) {
        Po(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 : vJ;
        }, e;
    })(nw), Ly = (function(t) {
        Po(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;
    })(nw), YA = {
        now: function() {
            return (YA.delegate || Date).now();
        },
        delegate: void 0
    }, EJ = (function(t) {
        Po(e, t);
        function e(n, r, s) {
            n === void 0 && (n = 1 / 0), r === void 0 && (r = 1 / 0), s === void 0 && (s = YA);
            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;
    })(nw), pDe = (function(t) {
        Po(e, t);
        function e(n, r) {
            return t.call(this) || this;
        }
        return e.prototype.schedule = function(n, r) {
            return this;
        }, e;
    })(ru), TB = {
        setInterval: function(t, e) {
            for(var n = [], r = 2; r < arguments.length; r++)n[r - 2] = arguments[r];
            return setInterval.apply(void 0, Hh([
                t,
                e
            ], Uh(n)));
        },
        clearInterval: function(t) {
            return clearInterval(t);
        },
        delegate: void 0
    }, gDe = (function(t) {
        Po(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), TB.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 && TB.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, Nx(i, this), r != null && (this.id = this.recycleAsyncId(s, r, null)), this.delay = null, t.prototype.unsubscribe.call(this);
            }
        }, e;
    })(pDe), bDe = 1, PS, fT = {};
    function EB(t) {
        return t in fT ? (delete fT[t], !0) : !1;
    }
    var CJ = {
        setImmediate: function(t) {
            var e = bDe++;
            return fT[e] = !0, PS || (PS = Promise.resolve()), PS.then(function() {
                return EB(e) && t();
            }), e;
        },
        clearImmediate: function(t) {
            EB(t);
        }
    }, mDe = CJ.setImmediate, yDe = CJ.clearImmediate, CB = {
        setImmediate: function() {
            for(var t = [], e = 0; e < arguments.length; e++)t[e] = arguments[e];
            return mDe.apply(void 0, Hh([], Uh(t)));
        },
        clearImmediate: function(t) {
            return yDe(t);
        },
        delegate: void 0
    }, wDe = (function(t) {
        Po(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 = CB.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 && (CB.clearImmediate(r), n._scheduled === r && (n._scheduled = void 0));
        }, e;
    })(gDe), IB = (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 = YA.now, t;
    })(), _De = (function(t) {
        Po(e, t);
        function e(n, r) {
            r === void 0 && (r = IB.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;
    })(IB), xDe = (function(t) {
        Po(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;
    })(_De), vDe = new xDe(wDe), rw = new ls(function(t) {
        return t.complete();
    });
    function SDe(t) {
        return t && ur(t.schedule);
    }
    function IJ(t) {
        return t[t.length - 1];
    }
    function kDe(t) {
        return ur(IJ(t)) ? t.pop() : void 0;
    }
    function l5(t) {
        return SDe(IJ(t)) ? t.pop() : void 0;
    }
    var AJ = (function(t) {
        return t && typeof t.length == "number" && typeof t != "function";
    });
    function PJ(t) {
        return ur(t?.then);
    }
    function OJ(t) {
        return ur(t[ZA]);
    }
    function MJ(t) {
        return Symbol.asyncIterator && ur(t?.[Symbol.asyncIterator]);
    }
    function RJ(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 TDe() {
        return typeof Symbol != "function" || !Symbol.iterator ? "@@iterator" : Symbol.iterator;
    }
    var NJ = TDe();
    function VJ(t) {
        return ur(t?.[NJ]);
    }
    function BJ(t) {
        return tDe(this, arguments, function() {
            var n, r, s, i;
            return xJ(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,
                            d0(n.read())
                        ];
                    case 3:
                        return r = o.sent(), s = r.value, i = r.done, i ? [
                            4,
                            d0(void 0)
                        ] : [
                            3,
                            5
                        ];
                    case 4:
                        return [
                            2,
                            o.sent()
                        ];
                    case 5:
                        return [
                            4,
                            d0(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 DJ(t) {
        return ur(t?.getReader);
    }
    function $c(t) {
        if (t instanceof ls) return t;
        if (t != null) {
            if (OJ(t)) return EDe(t);
            if (AJ(t)) return CDe(t);
            if (PJ(t)) return IDe(t);
            if (MJ(t)) return FJ(t);
            if (VJ(t)) return ADe(t);
            if (DJ(t)) return PDe(t);
        }
        throw RJ(t);
    }
    function EDe(t) {
        return new ls(function(e) {
            var n = t[ZA]();
            if (ur(n.subscribe)) return n.subscribe(e);
            throw new TypeError("Provided object does not correctly implement Symbol.observable");
        });
    }
    function CDe(t) {
        return new ls(function(e) {
            for(var n = 0; n < t.length && !e.closed; n++)e.next(t[n]);
            e.complete();
        });
    }
    function IDe(t) {
        return new ls(function(e) {
            t.then(function(n) {
                e.closed || (e.next(n), e.complete());
            }, function(n) {
                return e.error(n);
            }).then(null, kJ);
        });
    }
    function ADe(t) {
        return new ls(function(e) {
            var n, r;
            try {
                for(var s = bg(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 FJ(t) {
        return new ls(function(e) {
            ODe(t, e).catch(function(n) {
                return e.error(n);
            });
        });
    }
    function PDe(t) {
        return FJ(BJ(t));
    }
    function ODe(t, e) {
        var n, r, s, i;
        return eDe(this, void 0, void 0, function() {
            var o, a;
            return xJ(this, function(c) {
                switch(c.label){
                    case 0:
                        c.trys.push([
                            0,
                            5,
                            6,
                            11
                        ]), n = nDe(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 md(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 LJ(t, e) {
        return e === void 0 && (e = 0), Fs(function(n, r) {
            n.subscribe(Xs(r, function(s) {
                return md(r, t, function() {
                    return r.next(s);
                }, e);
            }, function() {
                return md(r, t, function() {
                    return r.complete();
                }, e);
            }, function(s) {
                return md(r, t, function() {
                    return r.error(s);
                }, e);
            }));
        });
    }
    function zJ(t, e) {
        return e === void 0 && (e = 0), Fs(function(n, r) {
            r.add(t.schedule(function() {
                return n.subscribe(r);
            }, e));
        });
    }
    function MDe(t, e) {
        return $c(t).pipe(zJ(e), LJ(e));
    }
    function RDe(t, e) {
        return $c(t).pipe(zJ(e), LJ(e));
    }
    function NDe(t, e) {
        return new ls(function(n) {
            var r = 0;
            return e.schedule(function() {
                r === t.length ? n.complete() : (n.next(t[r++]), n.closed || this.schedule());
            });
        });
    }
    function VDe(t, e) {
        return new ls(function(n) {
            var r;
            return md(n, e, function() {
                r = t[NJ](), md(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 ur(r?.return) && r.return();
            };
        });
    }
    function UJ(t, e) {
        if (!t) throw new Error("Iterable cannot be null");
        return new ls(function(n) {
            md(n, e, function() {
                var r = t[Symbol.asyncIterator]();
                md(n, e, function() {
                    r.next().then(function(s) {
                        s.done ? n.complete() : n.next(s.value);
                    });
                }, 0, !0);
            });
        });
    }
    function BDe(t, e) {
        return UJ(BJ(t), e);
    }
    function DDe(t, e) {
        if (t != null) {
            if (OJ(t)) return MDe(t, e);
            if (AJ(t)) return NDe(t, e);
            if (PJ(t)) return RDe(t, e);
            if (MJ(t)) return UJ(t, e);
            if (VJ(t)) return VDe(t, e);
            if (DJ(t)) return BDe(t, e);
        }
        throw RJ(t);
    }
    function _c(t, e) {
        return e ? DDe(t, e) : $c(t);
    }
    function xe() {
        for(var t = [], e = 0; e < arguments.length; e++)t[e] = arguments[e];
        var n = l5(t);
        return _c(t, n);
    }
    var QA = XA(function(t) {
        return function() {
            t(this), this.name = "EmptyError", this.message = "no elements in sequence";
        };
    });
    function Mn(t, e) {
        return new Promise(function(n, r) {
            var s = new mg({
                next: function(i) {
                    n(i), s.unsubscribe();
                },
                error: r,
                complete: function() {
                    r(new QA);
                }
            });
            t.subscribe(s);
        });
    }
    function ye(t, e) {
        return Fs(function(n, r) {
            var s = 0;
            n.subscribe(Xs(r, function(i) {
                r.next(t.call(e, i, s++));
            }));
        });
    }
    var FDe = Array.isArray;
    function LDe(t, e) {
        return FDe(e) ? t.apply(void 0, Hh([], Uh(e))) : t(e);
    }
    function zDe(t) {
        return ye(function(e) {
            return LDe(t, e);
        });
    }
    var UDe = Array.isArray, HDe = Object.getPrototypeOf, jDe = Object.prototype, qDe = Object.keys;
    function KDe(t) {
        if (t.length === 1) {
            var e = t[0];
            if (UDe(e)) return {
                args: e,
                keys: null
            };
            if (WDe(e)) {
                var n = qDe(e);
                return {
                    args: n.map(function(r) {
                        return e[r];
                    }),
                    keys: n
                };
            }
        }
        return {
            args: t,
            keys: null
        };
    }
    function WDe(t) {
        return t && typeof t == "object" && HDe(t) === jDe;
    }
    function $De(t, e) {
        return t.reduce(function(n, r, s) {
            return n[r] = e[s], n;
        }, {});
    }
    function Xe() {
        for(var t = [], e = 0; e < arguments.length; e++)t[e] = arguments[e];
        var n = l5(t), r = kDe(t), s = KDe(t), i = s.args, o = s.keys;
        if (i.length === 0) return _c([], n);
        var a = new ls(XDe(i, n, o ? function(c) {
            return $De(o, c);
        } : up));
        return r ? a.pipe(zDe(r)) : a;
    }
    function XDe(t, e, n) {
        return n === void 0 && (n = up), function(r) {
            AB(e, function() {
                for(var s = t.length, i = new Array(s), o = s, a = s, c = function(u) {
                    AB(e, function() {
                        var d = _c(t[u], e), f = !1;
                        d.subscribe(Xs(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 AB(t, e, n) {
        t ? md(n, t, e) : e();
    }
    function GDe(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(b) {
            return l < r ? h(b) : c.push(b);
        }, h = function(b) {
            l++;
            var y = !1;
            $c(n(b, u++)).subscribe(Xs(e, function(_) {
                e.next(_);
            }, function() {
                y = !0;
            }, void 0, function() {
                if (y) try {
                    l--;
                    for(var _ = function() {
                        var v = c.shift();
                        o || h(v);
                    }; c.length && l < r;)_();
                    f();
                } catch (v) {
                    e.error(v);
                }
            }));
        };
        return t.subscribe(Xs(e, p, function() {
            d = !0, f();
        })), function() {};
    }
    function Bc(t, e, n) {
        return n === void 0 && (n = 1 / 0), ur(e) ? Bc(function(r, s) {
            return ye(function(i, o) {
                return e(r, i, s, o);
            })($c(t(r, s)));
        }, n) : (typeof e == "number" && (n = e), Fs(function(r, s) {
            return GDe(r, s, t, n);
        }));
    }
    function ZDe(t) {
        return Bc(up, t);
    }
    function JDe() {
        return ZDe(1);
    }
    function PB() {
        for(var t = [], e = 0; e < arguments.length; e++)t[e] = arguments[e];
        return JDe()(_c(t, l5(t)));
    }
    function bu(t, e) {
        return Fs(function(n, r) {
            var s = 0;
            n.subscribe(Xs(r, function(i) {
                return t.call(e, i, s++) && r.next(i);
            }));
        });
    }
    function su(t) {
        return Fs(function(e, n) {
            var r = null, s = !1, i;
            r = e.subscribe(Xs(n, void 0, void 0, function(o) {
                i = $c(t(o, su(t)(e))), r ? (r.unsubscribe(), r = null, i.subscribe(n)) : s = !0;
            })), s && (r.unsubscribe(), r = null, i.subscribe(n));
        });
    }
    function YDe(t, e, n, r, s) {
        return function(i, o) {
            var a = n, c = e, l = 0;
            i.subscribe(Xs(o, function(u) {
                var d = l++;
                c = a ? t(c, u, d) : (a = !0, u);
            }, (function() {
                a && o.next(c), o.complete();
            })));
        };
    }
    function QDe(t, e) {
        return Fs(YDe(t, e, arguments.length >= 2, !1, !0));
    }
    var eFe = function(t, e) {
        return t.push(e), t;
    };
    function u5() {
        return Fs(function(t, e) {
            QDe(eFe, [])(t).subscribe(e);
        });
    }
    function OB(t, e) {
        return ur(e) ? Bc(t, e, 1) : Bc(t, 1);
    }
    function tFe(t) {
        return new ls(function(e) {
            return t.subscribe(e);
        });
    }
    var nFe = {
        connector: function() {
            return new nw;
        }
    };
    function rFe(t, e) {
        e === void 0 && (e = nFe);
        var n = e.connector;
        return Fs(function(r, s) {
            var i = n();
            $c(t(tFe(i))).subscribe(s), s.add(r.subscribe(i));
        });
    }
    function sFe(t) {
        return Fs(function(e, n) {
            var r = !1;
            e.subscribe(Xs(n, function(s) {
                r = !0, n.next(s);
            }, function() {
                r || n.next(t), n.complete();
            }));
        });
    }
    function iFe(t) {
        return t <= 0 ? function() {
            return rw;
        } : Fs(function(e, n) {
            var r = 0;
            e.subscribe(Xs(n, function(s) {
                ++r <= t && (n.next(s), t <= r && n.complete());
            }));
        });
    }
    function oFe(t, e) {
        return e === void 0 && (e = up), t = t ?? aFe, Fs(function(n, r) {
            var s, i = !0;
            n.subscribe(Xs(r, function(o) {
                var a = e(o);
                (i || !t(s, a)) && (i = !1, s = a, r.next(o));
            }));
        });
    }
    function aFe(t, e) {
        return t === e;
    }
    function cFe(t) {
        return t === void 0 && (t = lFe), Fs(function(e, n) {
            var r = !1;
            e.subscribe(Xs(n, function(s) {
                r = !0, n.next(s);
            }, function() {
                return r ? n.complete() : n.error(t());
            }));
        });
    }
    function lFe() {
        return new QA;
    }
    function MB(t, e) {
        var n = arguments.length >= 2;
        return function(r) {
            return r.pipe(up, iFe(1), n ? sFe(e) : cFe(function() {
                return new QA;
            }));
        };
    }
    function uFe(t, e) {
        var n = ur(t) ? t : function() {
            return t;
        };
        return ur(e) ? rFe(e, {
            connector: n
        }) : function(r) {
            return new fDe(r, n);
        };
    }
    function HJ(t, e, n, r) {
        var s = ur(n) ? n : void 0;
        return function(i) {
            return uFe(new EJ(t, e, r), s)(i);
        };
    }
    function dFe(t) {
        t === void 0 && (t = {});
        var e = t.connector, n = e === void 0 ? function() {
            return new nw;
        } : 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, b = !1, y = function() {
                d?.unsubscribe(), d = void 0;
            }, _ = function() {
                y(), u = f = void 0, h = b = !1;
            }, v = function() {
                var w = u;
                _(), w?.unsubscribe();
            };
            return Fs(function(w, E) {
                p++, !b && !h && y();
                var I = f = f ?? n();
                E.add(function() {
                    p--, p === 0 && !b && !h && (d = OS(v, c));
                }), I.subscribe(E), !u && p > 0 && (u = new mg({
                    next: function(D) {
                        return I.next(D);
                    },
                    error: function(D) {
                        b = !0, y(), d = OS(_, s, D), I.error(D);
                    },
                    complete: function() {
                        h = !0, y(), d = OS(_, o), I.complete();
                    }
                }), $c(w).subscribe(u));
            })(l);
        };
    }
    function OS(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 mg({
                next: function() {
                    s.unsubscribe(), t();
                }
            });
            return $c(e.apply(void 0, Hh([], Uh(n)))).subscribe(s);
        }
    }
    function d5(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, dFe({
            connector: function() {
                return new EJ(o, e, n);
            },
            resetOnError: !0,
            resetOnComplete: !1,
            resetOnRefCountZero: a
        });
    }
    function sw() {
        for(var t = [], e = 0; e < arguments.length; e++)t[e] = arguments[e];
        var n = l5(t);
        return Fs(function(r, s) {
            (n ? PB(t, r, n) : PB(t, r)).subscribe(s);
        });
    }
    function et(t, e) {
        return Fs(function(n, r) {
            var s = null, i = 0, o = !1, a = function() {
                return o && !s && r.complete();
            };
            n.subscribe(Xs(r, function(c) {
                s?.unsubscribe();
                var l = 0, u = i++;
                $c(t(c, u)).subscribe(s = Xs(r, function(d) {
                    return r.next(e ? e(c, d, u, l++) : d);
                }, function() {
                    s = null, a();
                }));
            }, function() {
                o = !0, a();
            }));
        });
    }
    function Ld(t, e, n) {
        var r = ur(t) || e || n ? {
            next: t,
            error: e,
            complete: n
        } : t;
        return r ? Fs(function(s, i) {
            var o;
            (o = r.subscribe) === null || o === void 0 || o.call(r);
            var a = !0;
            s.subscribe(Xs(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);
            }));
        }) : up;
    }
    const jJ = (t)=>new ls((e)=>{
            const n = vx(jI(Gn(function*() {
                const r = yield* EVe(t);
                for(; !(yield* K1(r, {
                    onSuccess (i) {
                        return h3e(i, (o)=>{
                            e.next(o);
                        }), e.closed;
                    },
                    onFailure (i) {
                        return un(i, {
                            onNone () {
                                return e.complete(), !0;
                            },
                            onSome: (o)=>(e.error(o), !0)
                        });
                    }
                })););
            })));
            e.add(()=>vx(Ac(n)));
        }), qJ = (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;
        }, KJ = Mi((t)=>typeof t == "bigint").annotations({
        identifier: "BigIntSchema"
    }), zy = Za(gn, KJ, {
        decode: (t)=>Co({
                try: ()=>BigInt(t),
                catch: (e)=>new Io(e, "Could not parse bigint")
            }),
        encode: (t)=>Gt(t.toString())
    });
    class Dm {
        static init(e) {
            return Dm.initEffect(e).pipe(En);
        }
        static restore(e, n, r) {
            return V(cJ(e, n), Or, xx((s)=>Dm.initEffect({
                    txTrait: n,
                    initialState: s,
                    configuration: r
                })), En);
        }
        static initEffect(e) {
            return Gn(function*() {
                const n = new eP(e.txTrait, e.initialState), r = yield* hg();
                return new Dm(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(En);
        }
        clear(e) {
            return this.#e.clear(e).pipe(En);
        }
        start() {
            return this.#e.startPolling(TVe(hu(1))).pipe(Bd(qA({
                url: this.#n.indexerClientConnection.indexerHttpUrl
            })), Dd(La, this.#t), Bd(LRe), vx, ()=>Promise.resolve());
        }
        state() {
            return this.#e.state().pipe(jJ);
        }
        stop() {
            return V(Nd(this.#t, uo(void 0)), En);
        }
    }
    class eP {
        #e;
        #t;
        static restore(e, n) {
            return V(e, (r)=>cJ(r, n), Or, ht((r)=>new eP(n, r)));
        }
        constructor(e, n){
            this.#t = e, this.#e = jA(n ?? UVe()).pipe(Ki);
        }
        state() {
            return pVe(nu(uh(this.#e)), this.#e.changes);
        }
        startPolling(e) {
            return e.pipe(nf(()=>uh(this.#e)), s5(zVe), wVe((n)=>Gn(this, function*() {
                    const r = yield* KV, s = yield* this.queryForStatus(n.tx);
                    return un(s, {
                        onSome: (i)=>[
                                {
                                    ...n,
                                    result: i
                                }
                            ],
                        onNone: ()=>{
                            const i = {
                                status: "FAILURE",
                                segments: []
                            };
                            return this.#t.hasTTLExpired(n.tx, n.creationTime, r) ? [
                                {
                                    ...n,
                                    result: i
                                }
                            ] : [];
                        }
                    });
                })), i5(V(Z1(as(1)), iMe({
                min: .1,
                max: 1.2
            }), oMe(w1(5)))), hVe((n)=>gVe(PV(n, "Caught error in PendingTransactionsService"))), vVe((n)=>this.saveResult(n.tx, n.result)));
        }
        addPendingTransaction(e) {
            return zh(this.#e, (n)=>KV.pipe(xx((r)=>HVe(n, e, r, this.#t))));
        }
        clear(e) {
            return gB(this.#e, (n)=>jVe(n, e, this.#t));
        }
        saveResult(e, n) {
            switch(n.status){
                case "SUCCESS":
                    return this.clear(e);
                case "FAILURE":
                case "PARTIAL_SUCCESS":
                    return gB(this.#e, (r)=>qVe(r, e, n, this.#t));
            }
        }
        queryForStatus(e) {
            return Gn(this, function*() {
                const r = yield* (yield* UBe)({
                    transactionId: this.#t.firstId(e)
                }).pipe(lb((s)=>{
                    const i = {
                        transactions: []
                    };
                    return V(PV(s, "Observed error in PendingTransactionsService, retrying"), Ba(i));
                }));
                return V(r.transactions, J2e((s)=>s.__typename == "SystemTransaction" || s.transactionResult.status != "SUCCESS" && s.transactionResult.status != "FAILURE" && s.transactionResult.status != "PARTIAL_SUCCESS" ? Ve() : this.#t.areAllTxIdsIncluded(e, s.identifiers) ? Fe({
                        status: s.transactionResult.status,
                        segments: s.transactionResult.segments ?? []
                    }) : Ve()), G2e);
            });
        }
    }
    class fFe extends Xv("@midnight-ntwrk/prover-client#ProverClient")() {
    }
    const WJ = (t, e)=>{
        class n extends TX {
            _tag = e;
        }
        return n.prototype[t] = t, n.prototype.name = e, n;
    }, RB = Symbol.for("@effect/platform/Cookies"), NB = Symbol.for("@effect/platform/Cookies/Cookie"), hFe = {
        [RB]: RB,
        ...Nv,
        toJSON () {
            return {
                _id: "@effect/platform/Cookies",
                cookies: nxe(this.cookies, (t)=>t.toJSON())
            };
        },
        pipe () {
            return xt(this, arguments);
        }
    }, pFe = (t)=>{
        const e = Object.create(hFe);
        return e.cookies = t, e;
    }, gFe = (t)=>{
        const e = {};
        for (const n of t)e[n.name] = n;
        return pFe(e);
    }, bFe = (t)=>{
        const e = typeof t == "string" ? [
            t
        ] : t, n = [];
        for (const r of e){
            const s = mFe(r.trim());
            nr(s) && n.push(s.value);
        }
        return gFe(n);
    };
    function mFe(t) {
        const e = t.split(";").map((a)=>a.trim()).filter((a)=>a !== "");
        if (e.length === 0) return Ve();
        const n = e[0].indexOf("=");
        if (n === -1) return Ve();
        const r = e[0].slice(0, n);
        if (!yFe.test(r)) return Ve();
        const s = e[0].slice(n + 1), i = wFe(s);
        if (e.length === 1) return Fe(Object.assign(Object.create(VB), {
            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 = hu(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 Fe(Object.assign(Object.create(VB), {
            name: r,
            value: i,
            valueEncoded: s,
            options: Object.keys(o).length > 0 ? o : void 0
        }));
    }
    const yFe = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/, VB = {
        [NB]: NB,
        ...Nv,
        toJSON () {
            return {
                _id: "@effect/platform/Cookies/Cookie",
                name: this.name,
                value: this.value,
                options: this.options
            };
        }
    }, wFe = (t)=>{
        try {
            return decodeURIComponent(t);
        } catch  {
            return t;
        }
    }, BB = Symbol.for("@effect/platform/Headers"), Uy = Object.assign(Object.create(null), {
        [BB]: BB,
        [Vv] (t) {
            return pT(this, $W(t, XJ));
        }
    }), f5 = (t)=>Object.assign(Object.create(Uy), t), $J = Object.create(Uy), tP = (t)=>{
        if (t === void 0) return $J;
        if (Symbol.iterator in t) {
            const n = Object.create(Uy);
            for (const [r, s] of t)n[r.toLowerCase()] = s;
            return n;
        }
        const e = Object.create(Uy);
        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;
    }, _Fe = (t)=>Object.setPrototypeOf(t, Uy), hT = j(3, (t, e, n)=>{
        const r = f5(t);
        return r[e.toLowerCase()] = n, r;
    }), xFe = j(2, (t, e)=>f5({
            ...t,
            ...tP(e)
        })), vFe = j(2, (t, e)=>{
        const n = f5(t);
        return Object.assign(n, e), n;
    }), SFe = j(2, (t, e)=>{
        const n = f5(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;
    }), pT = j(2, (t, e)=>{
        const n = {
            ...t
        }, r = (s)=>{
            if (typeof s == "string") {
                const i = s.toLowerCase();
                i in t && (n[i] = eB(t[i]));
            } else for(const i in t)s.test(i) && (n[i] = eB(t[i]));
        };
        if (Array.isArray(e)) for(let s = 0; s < e.length; s++)r(e[s]);
        else r(e);
        return n;
    }), XJ = qt("@effect/platform/Headers/currentRedactedNames", ()=>XI([
            "authorization",
            "cookie",
            "set-cookie",
            "x-api-key"
        ])), kFe = Symbol.for("@effect/platform/HttpClientError"), GJ = kFe;
    class ZJ extends WJ(GJ, "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 mf extends WJ(GJ, "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 nP = (t)=>{
        const e = JJ(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;
    }, JJ = (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 = JJ(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;
    }, TFe = [], EFe = j(2, (t, e)=>{
        const n = nP(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;
    }), CFe = (t, e, n)=>{
        try {
            const r = new URL(t, IFe());
            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), lt(r);
        } catch (r) {
            return Qe(r);
        }
    }, IFe = ()=>{
        if ("location" in globalThis && globalThis.location !== void 0 && globalThis.location.origin !== void 0 && globalThis.location.pathname !== void 0) return location.origin + location.pathname;
    }, Fm = Symbol.for("@effect/platform/HttpIncomingMessage"), AFe = (t, e)=>{
        const n = t.headers["content-type"] ?? "";
        let r;
        if (n.includes("application/json")) try {
            r = Ki(t.json);
        } catch  {}
        else if (n.includes("text/") || n.includes("urlencoded")) try {
            r = Ki(t.text);
        } catch  {}
        const s = {
            ...e,
            headers: HE(t.headers),
            remoteAddress: t.remoteAddress.toJSON()
        };
        return r !== void 0 && (s.body = r), s;
    }, PFe = (t)=>_Fe({
            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"}`
        }), MS = Symbol.for("@effect/platform/HttpBody");
    class YJ {
        [MS];
        constructor(){
            this[MS] = MS;
        }
        [Rn]() {
            return this.toJSON();
        }
        toString() {
            return vr(this);
        }
    }
    class OFe extends YJ {
        _tag = "Empty";
        toJSON() {
            return {
                _id: "@effect/platform/HttpBody",
                _tag: "Empty"
            };
        }
    }
    const MFe = new OFe;
    class RFe extends YJ {
        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 NFe = (t, e)=>new RFe(t, e ?? "application/octet-stream"), gT = Symbol.for("@effect/platform/HttpClientRequest"), VFe = {
        [gT]: gT,
        ...Nv,
        toJSON () {
            return {
                _id: "@effect/platform/HttpClientRequest",
                method: this.method,
                url: this.url,
                urlParams: this.urlParams,
                hash: this.hash,
                headers: HE(this.headers),
                body: this.body.toJSON()
            };
        },
        pipe () {
            return xt(this, arguments);
        }
    };
    function iu(t, e, n, r, s, i) {
        const o = Object.create(VFe);
        return o.method = t, o.url = e, o.urlParams = n, o.hash = r, o.headers = s, o.body = i, o;
    }
    const BFe = (t)=>typeof t == "object" && t !== null && gT in t, DFe = iu("GET", "", TFe, Ve(), $J, MFe), dp = (t)=>(e, n)=>qFe(DFe, {
                method: t,
                url: e,
                ...n ?? void 0
            }), FFe = dp("GET"), QJ = dp("POST"), LFe = dp("PUT"), zFe = dp("PATCH"), UFe = dp("DELETE"), HFe = dp("HEAD"), jFe = dp("OPTIONS"), qFe = j(2, (t, e)=>{
        let n = t;
        return e.method && (n = $Fe(n, e.method)), e.url && (n = XFe(n, e.url)), e.headers && (n = eY(n, e.headers)), e.urlParams && (n = GFe(n, e.urlParams)), e.hash && (n = ZFe(n, e.hash)), e.body && (n = nY(n, e.body)), e.accept && (n = tY(n, e.accept)), e.acceptJson && (n = WFe(n)), n;
    }), KFe = j(3, (t, e, n)=>iu(t.method, t.url, t.urlParams, t.hash, hT(t.headers, e, n), t.body)), eY = j(2, (t, e)=>iu(t.method, t.url, t.urlParams, t.hash, xFe(t.headers, e), t.body)), tY = j(2, (t, e)=>KFe(t, "Accept", e)), WFe = tY("application/json"), $Fe = j(2, (t, e)=>iu(e, t.url, t.urlParams, t.hash, t.headers, t.body)), XFe = j(2, (t, e)=>{
        if (typeof e == "string") return iu(t.method, e, t.urlParams, t.hash, t.headers, t.body);
        const n = new URL(e.toString()), r = nP(n.searchParams), s = n.hash ? Fe(n.hash.slice(1)) : Ve();
        return n.search = "", n.hash = "", iu(t.method, n.toString(), r, s, t.headers, t.body);
    }), GFe = j(2, (t, e)=>iu(t.method, t.url, EFe(t.urlParams, e), t.hash, t.headers, t.body)), ZFe = j(2, (t, e)=>iu(t.method, t.url, t.urlParams, Fe(e), t.headers, t.body)), nY = j(2, (t, e)=>{
        let n = t.headers;
        if (e._tag === "Empty" || e._tag === "FormData") n = SFe(n, [
            "Content-type",
            "Content-length"
        ]);
        else {
            const r = e.contentType;
            r && (n = hT(n, "content-type", r));
            const s = e.contentLength;
            s && (n = hT(n, "content-length", s.toString()));
        }
        return iu(t.method, t.url, t.urlParams, t.hash, n, e);
    }), JFe = j((t)=>BFe(t[0]), (t, e, n = "application/octet-stream")=>nY(t, NFe(e, n))), Lm = Symbol.for("@effect/platform/HttpClientResponse"), YFe = (t, e)=>new QFe(t, e);
    class QFe extends u2e {
        request;
        source;
        [Fm];
        [Lm];
        constructor(e, n){
            super(), this.request = e, this.source = n, this[Fm] = Fm, this[Lm] = Lm;
        }
        toJSON() {
            return AFe(this, {
                _id: "@effect/platform/HttpClientResponse",
                request: this.request.toJSON(),
                status: this.status
            });
        }
        get status() {
            return this.source.status;
        }
        get headers() {
            return tP(this.source.headers);
        }
        cachedCookies;
        get cookies() {
            return this.cachedCookies ? this.cachedCookies : this.cachedCookies = bFe(this.source.headers.getSetCookie());
        }
        get remoteAddress() {
            return Ve();
        }
        get stream() {
            return this.source.body ? yVe(()=>this.source.body, (e)=>new mf({
                    request: this.request,
                    response: this,
                    reason: "Decode",
                    cause: e
                })) : Dy(new mf({
                request: this.request,
                response: this,
                reason: "EmptyBody",
                description: "can not create stream from empty body"
            }));
        }
        get json() {
            return lAe(this.text, {
                try: (e)=>e === "" ? null : JSON.parse(e),
                catch: (e)=>new mf({
                        request: this.request,
                        response: this,
                        reason: "Decode",
                        cause: e
                    })
            });
        }
        textBody;
        get text() {
            return this.textBody ??= pd({
                try: ()=>this.source.text(),
                catch: (e)=>new mf({
                        request: this.request,
                        response: this,
                        reason: "Decode",
                        cause: e
                    })
            }).pipe(lS, Ki);
        }
        get urlParamsBody() {
            return Ge(this.text, (e)=>Co({
                    try: ()=>nP(new URLSearchParams(e)),
                    catch: (n)=>new mf({
                            request: this.request,
                            response: this,
                            reason: "Decode",
                            cause: n
                        })
                }));
        }
        formDataBody;
        get formData() {
            return this.formDataBody ??= pd({
                try: ()=>this.source.formData(),
                catch: (e)=>new mf({
                        request: this.request,
                        response: this,
                        reason: "Decode",
                        cause: e
                    })
            }).pipe(lS, Ki);
        }
        arrayBufferBody;
        get arrayBuffer() {
            return this.arrayBufferBody ??= pd({
                try: ()=>this.source.arrayBuffer(),
                catch: (e)=>new mf({
                        request: this.request,
                        response: this,
                        reason: "Decode",
                        cause: e
                    })
            }).pipe(lS, Ki);
        }
    }
    const eLe = (t)=>`http.request.header.${t}`, tLe = "http.request.method", nLe = (t)=>`http.response.header.${t}`, rLe = "http.response.status_code", sLe = "server.address", iLe = "server.port", oLe = "url.full", aLe = "url.path", cLe = "url.scheme", lLe = "url.query", DB = Symbol.for("@effect/platform/HttpClient"), rY = jc("@effect/platform/HttpClient"), uLe = qt(Symbol.for("@effect/platform/HttpClient/tracerDisabledWhen"), ()=>XI(oy)), dLe = qt(Symbol.for("@effect/platform/HttpClient/currentTracerPropagation"), ()=>XI(!0)), fLe = Hg()("@effect/platform/HttpClient/SpanNameGenerator", {
        defaultValue: ()=>(t)=>`http.client ${t.method}`
    }), hLe = {
        [DB]: DB,
        pipe () {
            return xt(this, arguments);
        },
        ...Nv,
        toJSON () {
            return {
                _id: "@effect/platform/HttpClient"
            };
        },
        get (t, e) {
            return this.execute(FFe(t, e));
        },
        head (t, e) {
            return this.execute(HFe(t, e));
        },
        post (t, e) {
            return this.execute(QJ(t, e));
        },
        put (t, e) {
            return this.execute(LFe(t, e));
        },
        patch (t, e) {
            return this.execute(zFe(t, e));
        },
        del (t, e) {
            return this.execute(UFe(t, e));
        },
        options (t, e) {
            return this.execute(jFe(t, e));
        }
    }, sY = (t, e)=>{
        const n = Object.create(hLe);
        return n.preprocess = e, n.postprocess = t, n.execute = function(r) {
            return t(e(r));
        }, n;
    }, Vx = qt("@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));
            }
        };
    }), pLe = qt("@effect/platform/HttpClient/scopedRequests", ()=>new WeakMap), gLe = (t)=>sY((e)=>Ge(e, (n)=>$k((r)=>{
                    const s = pLe.get(n), i = s ?? new AbortController, o = CFe(n.url, n.urlParams, n.hash);
                    if (o._tag === "Left") return Bs(new ZJ({
                        request: n,
                        reason: "InvalidUrl",
                        cause: o.left
                    }));
                    const a = o.right;
                    if (!r.getFiberRef(EAe) || r.getFiberRef(uLe)(n)) {
                        const u = t(n, a, i.signal, r);
                        return s ? u : Py((d)=>ho(d(u), {
                                onSuccess (f) {
                                    return Vx.register(f, i), Gt(new FB(f, i));
                                },
                                onFailure (f) {
                                    return Sy(f) && i.abort(), xo(f);
                                }
                            }));
                    }
                    const l = Ec(r.currentContext, fLe);
                    return SAe(l(n), {
                        kind: "client",
                        captureStackTrace: !1
                    }, (u)=>{
                        u.attribute(tLe, n.method), u.attribute(sLe, a.origin), a.port !== "" && u.attribute(iLe, +a.port), u.attribute(oLe, a.toString()), u.attribute(aLe, a.pathname), u.attribute(cLe, a.protocol.slice(0, -1));
                        const d = a.search.slice(1);
                        d !== "" && u.attribute(lLe, d);
                        const f = r.getFiberRef(XJ), p = pT(n.headers, f);
                        for(const h in p)u.attribute(eLe(h), String(p[h]));
                        return n = r.getFiberRef(dLe) ? eY(n, PFe(u)) : n, Py((h)=>h(t(n, a, i.signal, r)).pipe(kAe(u), ho({
                                onSuccess: (b)=>{
                                    u.attribute(rLe, b.status);
                                    const y = pT(b.headers, f);
                                    for(const _ in y)u.attribute(nLe(_), String(y[_]));
                                    return s ? Gt(b) : (Vx.register(b, i), Gt(new FB(b, i)));
                                },
                                onFailure (b) {
                                    return !s && Sy(b) && i.abort(), xo(b);
                                }
                            })));
                    });
                })), Gt);
    class FB {
        original;
        controller;
        constructor(e, n){
            this.original = e, this.controller = n;
        }
        [Lm] = Lm;
        [Fm] = Fm;
        applyInterrupt(e) {
            return ar(()=>(Vx.unregister(this.original), uAe(e, ()=>Dn(()=>{
                        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 kVe(()=>(Vx.unregister(this.original), nJ(this.original.stream, Dn(()=>{
                    this.controller.abort();
                }))));
        }
        toJSON() {
            return this.original.toJSON();
        }
        [Rn]() {
            return this.original[Rn]();
        }
    }
    const { del: Wxt, execute: bLe, get: $xt, head: Xxt, options: Gxt, patch: Zxt, post: Jxt, put: Yxt } = bAe(rY), mLe = j(2, (t, e)=>{
        const n = t;
        return sY((r)=>e(n.postprocess(r)), n.preprocess);
    }), yLe = (t)=>GX(rY, Ge(UX(), (e)=>ht(t, (n)=>mLe(n, gAe((r)=>Ug(e, r)))))), wLe = "@effect/platform/FetchHttpClient/Fetch", _Le = "@effect/platform/FetchHttpClient/FetchOptions", xLe = gLe((t, e, n, r)=>{
        const s = r.getFiberRef(TAe), i = s.unsafeMap.get(wLe) ?? globalThis.fetch, o = s.unsafeMap.get(_Le) ?? {}, a = o.headers ? vFe(tP(o.headers), t.headers) : t.headers, c = (l)=>ht(pd({
                try: ()=>i(e, {
                        ...o,
                        method: t.method,
                        headers: a,
                        body: l,
                        duplex: t.body._tag === "Stream" ? "half" : void 0,
                        signal: n
                    }),
                catch: (u)=>new ZJ({
                        request: t,
                        reason: "Transport",
                        cause: u
                    })
            }), (u)=>YFe(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 Ge(CVe(t.body.stream), c);
        }
        return c(void 0);
    }), vLe = yLe(Gt(xLe)), SLe = vLe, kLe = bLe, TLe = QJ, ELe = JFe, CLe = "/prove", ILe = "/check", ALe = (t)=>V(bJ(new URL(t.url)), ti((e)=>new PLe(e)), Or, ht((e)=>fFe.of(e)));
    class PLe {
        constructor(e){
            this.baseUrl = e;
        }
        baseUrl;
        request(e, n, r) {
            const s = (c)=>yl(()=>XBe(new Blob(c.map((l)=>new Uint8Array(l))))), i = (c)=>V(c.stream, xVe, Ge((l)=>s(dC(l)))), o = gJ(new URL(e, this.baseUrl));
            return V(Gt(n), ht((c)=>TLe(o).pipe(ELe(c))), Ge(kLe), Ge((c)=>Gn(function*() {
                    if (c.status !== 200) {
                        const l = yield* c.text;
                        return yield* new ta({
                            message: `${r}: ${l}`
                        });
                    }
                    return yield* i(c);
                })), cAe({
                times: 3,
                while: (c)=>c._tag === "ResponseError" && c.response.status >= 502 && c.response.status <= 504,
                schedule: Z1(hu(2), 2)
            })).pipe(iAe({
                RequestError: (c)=>new ta({
                        message: `Failed to connect to Proof Server: ${c.message}`
                    }),
                ResponseError: (c)=>xAe(c.response.text, ()=>"Unknown server error").pipe(Ge((l)=>new Fy({
                            message: l
                        })))
            }), Bd(SLe));
        }
        serverProverProvider = ()=>({
                check: async (e, n)=>V(Gt(RE(e)), Ge((r)=>this.request(ILe, r, "Failed to check")), ht((r)=>NE(r)), En),
                prove: async (e, n, r)=>V(Gt(VE(e, r)), Ge((s)=>this.request(CLe, s, "Failed to prove")), En)
            });
        proveTransaction(e, n) {
            return V(Gt(this.serverProverProvider()), Ge((r)=>pd({
                    try: ()=>e.prove(r, n),
                    catch: (s)=>s instanceof ta || s instanceof Fy ? s : new ta({
                            message: "Failed to prove transaction",
                            cause: s
                        })
                })));
        }
        asProvingProvider() {
            return this.serverProverProvider();
        }
    }
    const OLe = typeof Worker < "u" ? Worker : void 0, MLe = (t)=>Gt(new jLe(t.keyMaterialProvider)), RLe = 600 * 1e3, NLe = tn({
        op: ii("check"),
        args: By(bd)
    }), VLe = tn({
        op: ii("prove"),
        args: By(bd, Lh(MA, OA))
    }), BLe = tn({
        op: ii("lookupKey"),
        keyLocation: gn
    }), DLe = tn({
        op: ii("getParams"),
        k: Jr
    }), FLe = tn({
        op: ii("result"),
        value: Lh(bd, Ws(Lh(MA, OA)))
    }), LLe = tn({
        proverKey: bd,
        verifierKey: bd,
        ir: bd
    }), zLe = tn({
        op: ii("lookupKey"),
        keyLocation: gn,
        result: lh(LLe)
    }), ULe = tn({
        op: ii("getParams"),
        k: Jr,
        result: bd
    }), HLe = Lh(BLe, DLe, FLe), LB = ({ kmProvider: t, op: e, args: n })=>new Promise((r, s)=>{
            const i = self.location.href, o = new OLe(new URL("../../dist/proof-worker.js", i), {
                type: "module"
            });
            o.postMessage(e === "check" ? cd(NLe)({
                op: e,
                args: [
                    n[0]
                ]
            }) : cd(VLe)({
                op: e,
                args: [
                    n[0],
                    n[1]
                ]
            })), o.addEventListener("message", ({ data: a })=>{
                const c = nNe(HLe)(a), { op: l } = c;
                if (l === "lookupKey") {
                    const { keyLocation: u } = c;
                    t.lookupKey(u).then((d)=>{
                        o.postMessage(cd(zLe)({
                            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(cd(ULe)({
                            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`));
            }, RLe);
        });
    class jLe {
        constructor(e){
            this.keyMaterialProvider = e;
        }
        keyMaterialProvider;
        wasmProverProvider = (e)=>({
                check: async (n, r)=>LB({
                        kmProvider: e ?? this.keyMaterialProvider,
                        op: "check",
                        args: [
                            n
                        ]
                    }),
                prove: async (n, r, s)=>LB({
                        kmProvider: e ?? this.keyMaterialProvider,
                        op: "prove",
                        args: [
                            n,
                            s
                        ]
                    })
            });
        proveTransaction(e, n, r) {
            return V(Gt(this.wasmProverProvider(r)), Ge((s)=>pd({
                    try: ()=>e.prove(s, n),
                    catch: (i)=>i instanceof ta ? i : new ta({
                            message: "Failed to prove transaction",
                            cause: i
                        })
                })));
        }
        asProvingProvider() {
            return this.wasmProverProvider();
        }
    }
    const qLe = ()=>{
        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 KLe extends wn("Wallet.Proving") {
    }
    const rP = (t)=>({
            prove: (e)=>En(t.prove(e))
        }), sP = (t)=>({
            prove (e) {
                return V(t, Ge((n)=>pd({
                        try: ()=>e.prove(n, vd.initialCostModel()),
                        catch: (r)=>r instanceof ta || r instanceof Fy ? r : new ta({
                                message: "Failed to prove transaction",
                                cause: r
                            })
                    })), lb((n)=>Bs(new KLe({
                        message: n.message,
                        cause: n
                    }))));
            }
        }), WLe = (t)=>sP(Gt(t)), iY = (t)=>V(ALe({
            url: t.provingServerUrl
        }), ht((e)=>e.asProvingProvider()), sP), $Le = (t)=>V(MLe({
            keyMaterialProvider: t?.keyMaterialProvider ?? qLe()
        }), ht((e)=>e.asProvingProvider()), sP), XLe = (t)=>iY(t), GLe = (t)=>rP(XLe(t)), ZLe = (t)=>rP(iY(t)), JLe = (t)=>rP($Le(t)), { Submitted: YLe, InBlock: QLe, Finalized: eze, $match: Qxt, $is: tze } = VI();
    let nze = class extends wn("SubmissionError") {
    };
    class zB extends wn("ConnectionError") {
    }
    class oY extends wn("TransactionProgressError") {
    }
    class rze extends wn("ParseError") {
    }
    class sze extends wn("TransactionUsurpedError") {
    }
    class ize extends wn("TransactionDroppedError") {
    }
    class oze extends wn("TransactionInvalidError") {
    }
    class iP extends Xv("@midnight-ntwrk/wallet-node-client#NodeClient")() {
    }
    const aze = (t)=>iP.pipe(nu, Vc((e)=>e.sendMidnightTransaction(t)));
    function cze(t, e) {
        return aze(t).pipe(mVe(tze(e)), iJ, Ge(un({
            onNone: ()=>Bs(new oY({
                    message: "Transaction did not reach desired stage and no other error was reported",
                    txData: t,
                    desiredStage: e
                })),
            onSome: (n)=>Gt(n)
        })));
    }
    function lze(t) {
        return t("return this");
    }
    const la = typeof globalThis < "u" || typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : lze(Function);
    function oP(t, e) {
        return typeof la[t] > "u" ? e : la[t];
    }
    let uze = 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 dze = oP("TextDecoder", uze);
    let fze = 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 hze = oP("TextEncoder", fze);
    function Tt(t) {
        return typeof t == "function";
    }
    function bT(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 f0(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 pze(t, e) {
        if (!t) throw new Error(Tt(e) ? e() : e);
    }
    function rd(t, e) {
        return pze(t != null, e), t;
    }
    function gze(t) {
        throw new Error(`This codepath should be unreachable. Unhandled input: ${t}`);
    }
    function aY(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 bze() {
        return Number.NaN;
    }
    const Zn = oP("BigInt", bze), mze = Zn(0), yze = Zn(1), RS = "0123456789abcdef", Bx = new Uint8Array(256), cY = new Uint8Array(256 * 256);
    for(let t = 0, e = RS.length; t < e; t++)Bx[RS[t].charCodeAt(0) | 0] = t | 0, t > 9 && (Bx[RS[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++)cY[e | n] = Bx[t] << 4 | Bx[n];
    }
    function Dc(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] = cY[t.charCodeAt(n) << 8 | t.charCodeAt(n + 1)];
        return i;
    }
    var s2 = {
        exports: {}
    }, wze = s2.exports, UB;
    function _ze() {
        return UB || (UB = 1, (function(t) {
            (function(e, n) {
                function r(C, g) {
                    if (!C) throw new Error(g || "Assertion failed");
                }
                function s(C, g) {
                    C.super_ = g;
                    var x = function() {};
                    x.prototype = g.prototype, C.prototype = new x, C.prototype.constructor = C;
                }
                function i(C, g, x) {
                    if (i.isBN(C)) return C;
                    this.negative = 0, this.words = null, this.length = 0, this.red = null, C !== null && ((g === "le" || g === "be") && (x = g, g = 10), this._init(C || 0, g || 10, x || "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 = yH().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, x) {
                    return g.cmp(x) > 0 ? g : x;
                }, i.min = function(g, x) {
                    return g.cmp(x) < 0 ? g : x;
                }, i.prototype._init = function(g, x, A) {
                    if (typeof g == "number") return this._initNumber(g, x, A);
                    if (typeof g == "object") return this._initArray(g, x, A);
                    x === "hex" && (x = 16), r(x === (x | 0) && x >= 2 && x <= 36), g = g.toString().replace(/\s+/g, "");
                    var R = 0;
                    g[0] === "-" && (R++, this.negative = 1), R < g.length && (x === 16 ? this._parseHex(g, R, A) : (this._parseBase(g, x, R), A === "le" && this._initArray(this.toArray(), x, A)));
                }, i.prototype._initNumber = function(g, x, A) {
                    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), A === "le" && this._initArray(this.toArray(), x, A);
                }, i.prototype._initArray = function(g, x, A) {
                    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 (A === "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 (A === "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(C, g) {
                    var x = C.charCodeAt(g);
                    if (x >= 48 && x <= 57) return x - 48;
                    if (x >= 65 && x <= 70) return x - 55;
                    if (x >= 97 && x <= 102) return x - 87;
                    r(!1, "Invalid character in " + C);
                }
                function c(C, g, x) {
                    var A = a(C, x);
                    return x - 1 >= g && (A |= a(C, x - 1) << 4), A;
                }
                i.prototype._parseHex = function(g, x, A) {
                    this.length = Math.ceil((g.length - x) / 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 (A === "be") for(R = g.length - 1; R >= x; R -= 2)z = c(g, x, 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 - x;
                        for(R = B % 2 === 0 ? x + 1 : x; R < g.length; R += 2)z = c(g, x, R) << N, this.words[L] |= z & 67108863, N >= 18 ? (N -= 18, L += 1, this.words[L] |= z >>> 26) : N += 8;
                    }
                    this._strip();
                };
                function l(C, g, x, A) {
                    for(var R = 0, N = 0, L = Math.min(C.length, x), z = g; z < L; z++){
                        var B = C.charCodeAt(z) - 48;
                        R *= A, B >= 49 ? N = B - 49 + 10 : B >= 17 ? N = B - 17 + 10 : N = B, r(B >= 0 && N < A, "Invalid character"), R += N;
                    }
                    return R;
                }
                i.prototype._parseBase = function(g, x, A) {
                    this.words = [
                        0
                    ], this.length = 1;
                    for(var R = 0, N = 1; N <= 67108863; N *= x)R++;
                    R--, N = N / x | 0;
                    for(var L = g.length - A, z = L % R, B = Math.min(L, L - z) + A, S = 0, O = A; O < B; O += R)S = l(g, O, O + R, x), this.imuln(N), this.words[0] + S < 67108864 ? this.words[0] += S : this._iaddn(S);
                    if (z !== 0) {
                        var W = 1;
                        for(S = l(g, O, g.length, x), O = 0; O < z; O++)W *= x;
                        this.imuln(W), this.words[0] + S < 67108864 ? this.words[0] += S : this._iaddn(S);
                    }
                    this._strip();
                }, i.prototype.copy = function(g) {
                    g.words = new Array(this.length);
                    for(var x = 0; x < this.length; x++)g.words[x] = this.words[x];
                    g.length = this.length, g.negative = this.negative, g.red = this.red;
                };
                function u(C, g) {
                    C.words = g.words, C.length = g.length, C.negative = g.negative, C.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, x) {
                    g = g || 10, x = x | 0 || 1;
                    var A;
                    if (g === 16 || g === "hex") {
                        A = "";
                        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 ? A = f[6 - B.length] + B + A : A = B + A;
                        }
                        for(N !== 0 && (A = N.toString(16) + A); A.length % x !== 0;)A = "0" + A;
                        return this.negative !== 0 && (A = "-" + A), A;
                    }
                    if (g === (g | 0) && g >= 2 && g <= 36) {
                        var S = p[g], O = h[g];
                        A = "";
                        var W = this.clone();
                        for(W.negative = 0; !W.isZero();){
                            var F = W.modrn(O).toString(g);
                            W = W.idivn(O), W.isZero() ? A = F + A : A = f[S - F.length] + F + A;
                        }
                        for(this.isZero() && (A = "0" + A); A.length % x !== 0;)A = "0" + A;
                        return this.negative !== 0 && (A = "-" + A), A;
                    }
                    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, x) {
                    return this.toArrayLike(o, g, x);
                }), i.prototype.toArray = function(g, x) {
                    return this.toArrayLike(Array, g, x);
                };
                var b = function(g, x) {
                    return g.allocUnsafe ? g.allocUnsafe(x) : new g(x);
                };
                i.prototype.toArrayLike = function(g, x, A) {
                    this._strip();
                    var R = this.byteLength(), N = A || Math.max(1, R);
                    r(R <= N, "byte array longer than desired length"), r(N > 0, "Requested array length <= 0");
                    var L = b(g, N), z = x === "le" ? "LE" : "BE";
                    return this["_toArrayLike" + z](L, R), L;
                }, i.prototype._toArrayLikeLE = function(g, x) {
                    for(var A = 0, R = 0, N = 0, L = 0; N < this.length; N++){
                        var z = this.words[N] << L | R;
                        g[A++] = z & 255, A < g.length && (g[A++] = z >> 8 & 255), A < g.length && (g[A++] = z >> 16 & 255), L === 6 ? (A < g.length && (g[A++] = z >> 24 & 255), R = 0, L = 0) : (R = z >>> 24, L += 2);
                    }
                    if (A < g.length) for(g[A++] = R; A < g.length;)g[A++] = 0;
                }, i.prototype._toArrayLikeBE = function(g, x) {
                    for(var A = g.length - 1, R = 0, N = 0, L = 0; N < this.length; N++){
                        var z = this.words[N] << L | R;
                        g[A--] = z & 255, A >= 0 && (g[A--] = z >> 8 & 255), A >= 0 && (g[A--] = z >> 16 & 255), L === 6 ? (A >= 0 && (g[A--] = z >> 24 & 255), R = 0, L = 0) : (R = z >>> 24, L += 2);
                    }
                    if (A >= 0) for(g[A--] = R; A >= 0;)g[A--] = 0;
                }, Math.clz32 ? i.prototype._countBits = function(g) {
                    return 32 - Math.clz32(g);
                } : i.prototype._countBits = function(g) {
                    var x = g, A = 0;
                    return x >= 4096 && (A += 13, x >>>= 13), x >= 64 && (A += 7, x >>>= 7), x >= 8 && (A += 4, x >>>= 4), x >= 2 && (A += 2, x >>>= 2), A + x;
                }, i.prototype._zeroBits = function(g) {
                    if (g === 0) return 26;
                    var x = g, A = 0;
                    return (x & 8191) === 0 && (A += 13, x >>>= 13), (x & 127) === 0 && (A += 7, x >>>= 7), (x & 15) === 0 && (A += 4, x >>>= 4), (x & 3) === 0 && (A += 2, x >>>= 2), (x & 1) === 0 && A++, A;
                }, i.prototype.bitLength = function() {
                    var g = this.words[this.length - 1], x = this._countBits(g);
                    return (this.length - 1) * 26 + x;
                };
                function y(C) {
                    for(var g = new Array(C.bitLength()), x = 0; x < g.length; x++){
                        var A = x / 26 | 0, R = x % 26;
                        g[x] = C.words[A] >>> R & 1;
                    }
                    return g;
                }
                i.prototype.zeroBits = function() {
                    if (this.isZero()) return 0;
                    for(var g = 0, x = 0; x < this.length; x++){
                        var A = this._zeroBits(this.words[x]);
                        if (g += A, A !== 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 x = 0; x < g.length; x++)this.words[x] = this.words[x] | g.words[x];
                    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 x;
                    this.length > g.length ? x = g : x = this;
                    for(var A = 0; A < x.length; A++)this.words[A] = this.words[A] & g.words[A];
                    return this.length = x.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 x, A;
                    this.length > g.length ? (x = this, A = g) : (x = g, A = this);
                    for(var R = 0; R < A.length; R++)this.words[R] = x.words[R] ^ A.words[R];
                    if (this !== x) for(; R < x.length; R++)this.words[R] = x.words[R];
                    return this.length = x.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 x = Math.ceil(g / 26) | 0, A = g % 26;
                    this._expand(x), A > 0 && x--;
                    for(var R = 0; R < x; R++)this.words[R] = ~this.words[R] & 67108863;
                    return A > 0 && (this.words[R] = ~this.words[R] & 67108863 >> 26 - A), this._strip();
                }, i.prototype.notn = function(g) {
                    return this.clone().inotn(g);
                }, i.prototype.setn = function(g, x) {
                    r(typeof g == "number" && g >= 0);
                    var A = g / 26 | 0, R = g % 26;
                    return this._expand(A + 1), x ? this.words[A] = this.words[A] | 1 << R : this.words[A] = this.words[A] & ~(1 << R), this._strip();
                }, i.prototype.iadd = function(g) {
                    var x;
                    if (this.negative !== 0 && g.negative === 0) return this.negative = 0, x = this.isub(g), this.negative ^= 1, this._normSign();
                    if (this.negative === 0 && g.negative !== 0) return g.negative = 0, x = this.isub(g), g.negative = 1, x._normSign();
                    var A, R;
                    this.length > g.length ? (A = this, R = g) : (A = g, R = this);
                    for(var N = 0, L = 0; L < R.length; L++)x = (A.words[L] | 0) + (R.words[L] | 0) + N, this.words[L] = x & 67108863, N = x >>> 26;
                    for(; N !== 0 && L < A.length; L++)x = (A.words[L] | 0) + N, this.words[L] = x & 67108863, N = x >>> 26;
                    if (this.length = A.length, N !== 0) this.words[this.length] = N, this.length++;
                    else if (A !== this) for(; L < A.length; L++)this.words[L] = A.words[L];
                    return this;
                }, i.prototype.add = function(g) {
                    var x;
                    return g.negative !== 0 && this.negative === 0 ? (g.negative = 0, x = this.sub(g), g.negative ^= 1, x) : g.negative === 0 && this.negative !== 0 ? (this.negative = 0, x = g.sub(this), this.negative = 1, x) : 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 x = this.iadd(g);
                        return g.negative = 1, x._normSign();
                    } else if (this.negative !== 0) return this.negative = 0, this.iadd(g), this.negative = 1, this._normSign();
                    var A = this.cmp(g);
                    if (A === 0) return this.negative = 0, this.length = 1, this.words[0] = 0, this;
                    var R, N;
                    A > 0 ? (R = this, N = g) : (R = g, N = this);
                    for(var L = 0, z = 0; z < N.length; z++)x = (R.words[z] | 0) - (N.words[z] | 0) + L, L = x >> 26, this.words[z] = x & 67108863;
                    for(; L !== 0 && z < R.length; z++)x = (R.words[z] | 0) + L, L = x >> 26, this.words[z] = x & 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 _(C, g, x) {
                    x.negative = g.negative ^ C.negative;
                    var A = C.length + g.length | 0;
                    x.length = A, A = A - 1 | 0;
                    var R = C.words[0] | 0, N = g.words[0] | 0, L = R * N, z = L & 67108863, B = L / 67108864 | 0;
                    x.words[0] = z;
                    for(var S = 1; S < A; S++){
                        for(var O = B >>> 26, W = B & 67108863, F = Math.min(S, g.length - 1), G = Math.max(0, S - C.length + 1); G <= F; G++){
                            var ee = S - G | 0;
                            R = C.words[ee] | 0, N = g.words[G] | 0, L = R * N + W, O += L / 67108864 | 0, W = L & 67108863;
                        }
                        x.words[S] = W | 0, B = O | 0;
                    }
                    return B !== 0 ? x.words[S] = B | 0 : x.length--, x._strip();
                }
                var v = function(g, x, A) {
                    var R = g.words, N = x.words, L = A.words, z = 0, B, S, O, W = R[0] | 0, F = W & 8191, G = W >>> 13, ee = R[1] | 0, Q = ee & 8191, Y = ee >>> 13, ae = R[2] | 0, de = ae & 8191, pe = ae >>> 13, Ae = R[3] | 0, Oe = Ae & 8191, Re = Ae >>> 13, Me = R[4] | 0, Je = Me & 8191, Ee = Me >>> 13, le = R[5] | 0, qe = le & 8191, Ye = le >>> 13, ut = R[6] | 0, Ce = ut & 8191, oe = ut >>> 13, ue = R[7] | 0, Ie = ue & 8191, H = ue >>> 13, T = R[8] | 0, P = T & 8191, Z = T >>> 13, ie = R[9] | 0, ce = ie & 8191, be = ie >>> 13, yt = N[0] | 0, Et = yt & 8191, dt = yt >>> 13, Kt = N[1] | 0, tt = Kt & 8191, vt = Kt >>> 13, Kr = N[2] | 0, Vn = Kr & 8191, _n = Kr >>> 13, Ya = N[3] | 0, jn = Ya & 8191, nt = Ya >>> 13, Wr = N[4] | 0, fn = Wr & 8191, je = Wr >>> 13, dr = N[5] | 0, Wt = dr & 8191, Ut = dr >>> 13, fr = N[6] | 0, Bn = fr & 8191, hn = fr >>> 13, Ri = N[7] | 0, $t = Ri & 8191, Xn = Ri >>> 13, Ni = N[8] | 0, hr = Ni & 8191, pr = Ni >>> 13, ku = N[9] | 0, gr = ku & 8191, br = ku >>> 13;
                    A.negative = g.negative ^ x.negative, A.length = 19, B = Math.imul(F, Et), S = Math.imul(F, dt), S = S + Math.imul(G, Et) | 0, O = Math.imul(G, dt);
                    var Qa = (z + B | 0) + ((S & 8191) << 13) | 0;
                    z = (O + (S >>> 13) | 0) + (Qa >>> 26) | 0, Qa &= 67108863, B = Math.imul(Q, Et), S = Math.imul(Q, dt), S = S + Math.imul(Y, Et) | 0, O = Math.imul(Y, dt), B = B + Math.imul(F, tt) | 0, S = S + Math.imul(F, vt) | 0, S = S + Math.imul(G, tt) | 0, O = O + Math.imul(G, vt) | 0;
                    var Vi = (z + B | 0) + ((S & 8191) << 13) | 0;
                    z = (O + (S >>> 13) | 0) + (Vi >>> 26) | 0, Vi &= 67108863, B = Math.imul(de, Et), S = Math.imul(de, dt), S = S + Math.imul(pe, Et) | 0, O = Math.imul(pe, dt), B = B + Math.imul(Q, tt) | 0, S = S + Math.imul(Q, vt) | 0, S = S + Math.imul(Y, tt) | 0, O = O + Math.imul(Y, vt) | 0, B = B + Math.imul(F, Vn) | 0, S = S + Math.imul(F, _n) | 0, S = S + Math.imul(G, Vn) | 0, O = O + Math.imul(G, _n) | 0;
                    var lf = (z + B | 0) + ((S & 8191) << 13) | 0;
                    z = (O + (S >>> 13) | 0) + (lf >>> 26) | 0, lf &= 67108863, B = Math.imul(Oe, Et), S = Math.imul(Oe, dt), S = S + Math.imul(Re, Et) | 0, O = Math.imul(Re, dt), B = B + Math.imul(de, tt) | 0, S = S + Math.imul(de, vt) | 0, S = S + Math.imul(pe, tt) | 0, O = O + Math.imul(pe, vt) | 0, B = B + Math.imul(Q, Vn) | 0, S = S + Math.imul(Q, _n) | 0, S = S + Math.imul(Y, Vn) | 0, O = O + Math.imul(Y, _n) | 0, B = B + Math.imul(F, jn) | 0, S = S + Math.imul(F, nt) | 0, S = S + Math.imul(G, jn) | 0, O = O + Math.imul(G, nt) | 0;
                    var Mo = (z + B | 0) + ((S & 8191) << 13) | 0;
                    z = (O + (S >>> 13) | 0) + (Mo >>> 26) | 0, Mo &= 67108863, B = Math.imul(Je, Et), S = Math.imul(Je, dt), S = S + Math.imul(Ee, Et) | 0, O = Math.imul(Ee, dt), B = B + Math.imul(Oe, tt) | 0, S = S + Math.imul(Oe, vt) | 0, S = S + Math.imul(Re, tt) | 0, O = O + Math.imul(Re, vt) | 0, B = B + Math.imul(de, Vn) | 0, S = S + Math.imul(de, _n) | 0, S = S + Math.imul(pe, Vn) | 0, O = O + Math.imul(pe, _n) | 0, B = B + Math.imul(Q, jn) | 0, S = S + Math.imul(Q, nt) | 0, S = S + Math.imul(Y, jn) | 0, O = O + Math.imul(Y, nt) | 0, B = B + Math.imul(F, fn) | 0, S = S + Math.imul(F, je) | 0, S = S + Math.imul(G, fn) | 0, O = O + Math.imul(G, je) | 0;
                    var Jc = (z + B | 0) + ((S & 8191) << 13) | 0;
                    z = (O + (S >>> 13) | 0) + (Jc >>> 26) | 0, Jc &= 67108863, B = Math.imul(qe, Et), S = Math.imul(qe, dt), S = S + Math.imul(Ye, Et) | 0, O = Math.imul(Ye, dt), B = B + Math.imul(Je, tt) | 0, S = S + Math.imul(Je, vt) | 0, S = S + Math.imul(Ee, tt) | 0, O = O + Math.imul(Ee, vt) | 0, B = B + Math.imul(Oe, Vn) | 0, S = S + Math.imul(Oe, _n) | 0, S = S + Math.imul(Re, Vn) | 0, O = O + Math.imul(Re, _n) | 0, B = B + Math.imul(de, jn) | 0, S = S + Math.imul(de, nt) | 0, S = S + Math.imul(pe, jn) | 0, O = O + Math.imul(pe, nt) | 0, B = B + Math.imul(Q, fn) | 0, S = S + Math.imul(Q, je) | 0, S = S + Math.imul(Y, fn) | 0, O = O + Math.imul(Y, je) | 0, B = B + Math.imul(F, Wt) | 0, S = S + Math.imul(F, Ut) | 0, S = S + Math.imul(G, Wt) | 0, O = O + Math.imul(G, Ut) | 0;
                    var Tu = (z + B | 0) + ((S & 8191) << 13) | 0;
                    z = (O + (S >>> 13) | 0) + (Tu >>> 26) | 0, Tu &= 67108863, B = Math.imul(Ce, Et), S = Math.imul(Ce, dt), S = S + Math.imul(oe, Et) | 0, O = Math.imul(oe, dt), B = B + Math.imul(qe, tt) | 0, S = S + Math.imul(qe, vt) | 0, S = S + Math.imul(Ye, tt) | 0, O = O + Math.imul(Ye, vt) | 0, B = B + Math.imul(Je, Vn) | 0, S = S + Math.imul(Je, _n) | 0, S = S + Math.imul(Ee, Vn) | 0, O = O + Math.imul(Ee, _n) | 0, B = B + Math.imul(Oe, jn) | 0, S = S + Math.imul(Oe, nt) | 0, S = S + Math.imul(Re, jn) | 0, O = O + Math.imul(Re, nt) | 0, B = B + Math.imul(de, fn) | 0, S = S + Math.imul(de, je) | 0, S = S + Math.imul(pe, fn) | 0, O = O + Math.imul(pe, je) | 0, B = B + Math.imul(Q, Wt) | 0, S = S + Math.imul(Q, Ut) | 0, S = S + Math.imul(Y, Wt) | 0, O = O + Math.imul(Y, Ut) | 0, B = B + Math.imul(F, Bn) | 0, S = S + Math.imul(F, hn) | 0, S = S + Math.imul(G, Bn) | 0, O = O + Math.imul(G, hn) | 0;
                    var uf = (z + B | 0) + ((S & 8191) << 13) | 0;
                    z = (O + (S >>> 13) | 0) + (uf >>> 26) | 0, uf &= 67108863, B = Math.imul(Ie, Et), S = Math.imul(Ie, dt), S = S + Math.imul(H, Et) | 0, O = Math.imul(H, dt), B = B + Math.imul(Ce, tt) | 0, S = S + Math.imul(Ce, vt) | 0, S = S + Math.imul(oe, tt) | 0, O = O + Math.imul(oe, vt) | 0, B = B + Math.imul(qe, Vn) | 0, S = S + Math.imul(qe, _n) | 0, S = S + Math.imul(Ye, Vn) | 0, O = O + Math.imul(Ye, _n) | 0, B = B + Math.imul(Je, jn) | 0, S = S + Math.imul(Je, nt) | 0, S = S + Math.imul(Ee, jn) | 0, O = O + Math.imul(Ee, nt) | 0, B = B + Math.imul(Oe, fn) | 0, S = S + Math.imul(Oe, je) | 0, S = S + Math.imul(Re, fn) | 0, O = O + Math.imul(Re, je) | 0, B = B + Math.imul(de, Wt) | 0, S = S + Math.imul(de, Ut) | 0, S = S + Math.imul(pe, Wt) | 0, O = O + Math.imul(pe, Ut) | 0, B = B + Math.imul(Q, Bn) | 0, S = S + Math.imul(Q, hn) | 0, S = S + Math.imul(Y, Bn) | 0, O = O + Math.imul(Y, hn) | 0, B = B + Math.imul(F, $t) | 0, S = S + Math.imul(F, Xn) | 0, S = S + Math.imul(G, $t) | 0, O = O + Math.imul(G, Xn) | 0;
                    var df = (z + B | 0) + ((S & 8191) << 13) | 0;
                    z = (O + (S >>> 13) | 0) + (df >>> 26) | 0, df &= 67108863, B = Math.imul(P, Et), S = Math.imul(P, dt), S = S + Math.imul(Z, Et) | 0, O = Math.imul(Z, dt), B = B + Math.imul(Ie, tt) | 0, S = S + Math.imul(Ie, vt) | 0, S = S + Math.imul(H, tt) | 0, O = O + Math.imul(H, vt) | 0, B = B + Math.imul(Ce, Vn) | 0, S = S + Math.imul(Ce, _n) | 0, S = S + Math.imul(oe, Vn) | 0, O = O + Math.imul(oe, _n) | 0, B = B + Math.imul(qe, jn) | 0, S = S + Math.imul(qe, nt) | 0, S = S + Math.imul(Ye, jn) | 0, O = O + Math.imul(Ye, nt) | 0, B = B + Math.imul(Je, fn) | 0, S = S + Math.imul(Je, je) | 0, S = S + Math.imul(Ee, fn) | 0, O = O + Math.imul(Ee, je) | 0, B = B + Math.imul(Oe, Wt) | 0, S = S + Math.imul(Oe, Ut) | 0, S = S + Math.imul(Re, Wt) | 0, O = O + Math.imul(Re, Ut) | 0, B = B + Math.imul(de, Bn) | 0, S = S + Math.imul(de, hn) | 0, S = S + Math.imul(pe, Bn) | 0, O = O + Math.imul(pe, hn) | 0, B = B + Math.imul(Q, $t) | 0, S = S + Math.imul(Q, Xn) | 0, S = S + Math.imul(Y, $t) | 0, O = O + Math.imul(Y, Xn) | 0, B = B + Math.imul(F, hr) | 0, S = S + Math.imul(F, pr) | 0, S = S + Math.imul(G, hr) | 0, O = O + Math.imul(G, pr) | 0;
                    var Eu = (z + B | 0) + ((S & 8191) << 13) | 0;
                    z = (O + (S >>> 13) | 0) + (Eu >>> 26) | 0, Eu &= 67108863, B = Math.imul(ce, Et), S = Math.imul(ce, dt), S = S + Math.imul(be, Et) | 0, O = Math.imul(be, dt), B = B + Math.imul(P, tt) | 0, S = S + Math.imul(P, vt) | 0, S = S + Math.imul(Z, tt) | 0, O = O + Math.imul(Z, vt) | 0, B = B + Math.imul(Ie, Vn) | 0, S = S + Math.imul(Ie, _n) | 0, S = S + Math.imul(H, Vn) | 0, O = O + Math.imul(H, _n) | 0, B = B + Math.imul(Ce, jn) | 0, S = S + Math.imul(Ce, nt) | 0, S = S + Math.imul(oe, jn) | 0, O = O + Math.imul(oe, nt) | 0, B = B + Math.imul(qe, fn) | 0, S = S + Math.imul(qe, je) | 0, S = S + Math.imul(Ye, fn) | 0, O = O + Math.imul(Ye, je) | 0, B = B + Math.imul(Je, Wt) | 0, S = S + Math.imul(Je, Ut) | 0, S = S + Math.imul(Ee, Wt) | 0, O = O + Math.imul(Ee, Ut) | 0, B = B + Math.imul(Oe, Bn) | 0, S = S + Math.imul(Oe, hn) | 0, S = S + Math.imul(Re, Bn) | 0, O = O + Math.imul(Re, hn) | 0, B = B + Math.imul(de, $t) | 0, S = S + Math.imul(de, Xn) | 0, S = S + Math.imul(pe, $t) | 0, O = O + Math.imul(pe, Xn) | 0, B = B + Math.imul(Q, hr) | 0, S = S + Math.imul(Q, pr) | 0, S = S + Math.imul(Y, hr) | 0, O = O + Math.imul(Y, pr) | 0, B = B + Math.imul(F, gr) | 0, S = S + Math.imul(F, br) | 0, S = S + Math.imul(G, gr) | 0, O = O + Math.imul(G, br) | 0;
                    var Yc = (z + B | 0) + ((S & 8191) << 13) | 0;
                    z = (O + (S >>> 13) | 0) + (Yc >>> 26) | 0, Yc &= 67108863, B = Math.imul(ce, tt), S = Math.imul(ce, vt), S = S + Math.imul(be, tt) | 0, O = Math.imul(be, vt), B = B + Math.imul(P, Vn) | 0, S = S + Math.imul(P, _n) | 0, S = S + Math.imul(Z, Vn) | 0, O = O + Math.imul(Z, _n) | 0, B = B + Math.imul(Ie, jn) | 0, S = S + Math.imul(Ie, nt) | 0, S = S + Math.imul(H, jn) | 0, O = O + Math.imul(H, nt) | 0, B = B + Math.imul(Ce, fn) | 0, S = S + Math.imul(Ce, je) | 0, S = S + Math.imul(oe, fn) | 0, O = O + Math.imul(oe, je) | 0, B = B + Math.imul(qe, Wt) | 0, S = S + Math.imul(qe, Ut) | 0, S = S + Math.imul(Ye, Wt) | 0, O = O + Math.imul(Ye, Ut) | 0, B = B + Math.imul(Je, Bn) | 0, S = S + Math.imul(Je, hn) | 0, S = S + Math.imul(Ee, Bn) | 0, O = O + Math.imul(Ee, hn) | 0, B = B + Math.imul(Oe, $t) | 0, S = S + Math.imul(Oe, Xn) | 0, S = S + Math.imul(Re, $t) | 0, O = O + Math.imul(Re, Xn) | 0, B = B + Math.imul(de, hr) | 0, S = S + Math.imul(de, pr) | 0, S = S + Math.imul(pe, hr) | 0, O = O + Math.imul(pe, pr) | 0, B = B + Math.imul(Q, gr) | 0, S = S + Math.imul(Q, br) | 0, S = S + Math.imul(Y, gr) | 0, O = O + Math.imul(Y, br) | 0;
                    var ff = (z + B | 0) + ((S & 8191) << 13) | 0;
                    z = (O + (S >>> 13) | 0) + (ff >>> 26) | 0, ff &= 67108863, B = Math.imul(ce, Vn), S = Math.imul(ce, _n), S = S + Math.imul(be, Vn) | 0, O = Math.imul(be, _n), B = B + Math.imul(P, jn) | 0, S = S + Math.imul(P, nt) | 0, S = S + Math.imul(Z, jn) | 0, O = O + Math.imul(Z, nt) | 0, B = B + Math.imul(Ie, fn) | 0, S = S + Math.imul(Ie, je) | 0, S = S + Math.imul(H, fn) | 0, O = O + Math.imul(H, je) | 0, B = B + Math.imul(Ce, Wt) | 0, S = S + Math.imul(Ce, Ut) | 0, S = S + Math.imul(oe, Wt) | 0, O = O + Math.imul(oe, Ut) | 0, B = B + Math.imul(qe, Bn) | 0, S = S + Math.imul(qe, hn) | 0, S = S + Math.imul(Ye, Bn) | 0, O = O + Math.imul(Ye, hn) | 0, B = B + Math.imul(Je, $t) | 0, S = S + Math.imul(Je, Xn) | 0, S = S + Math.imul(Ee, $t) | 0, O = O + Math.imul(Ee, Xn) | 0, B = B + Math.imul(Oe, hr) | 0, S = S + Math.imul(Oe, pr) | 0, S = S + Math.imul(Re, hr) | 0, O = O + Math.imul(Re, pr) | 0, B = B + Math.imul(de, gr) | 0, S = S + Math.imul(de, br) | 0, S = S + Math.imul(pe, gr) | 0, O = O + Math.imul(pe, br) | 0;
                    var Cu = (z + B | 0) + ((S & 8191) << 13) | 0;
                    z = (O + (S >>> 13) | 0) + (Cu >>> 26) | 0, Cu &= 67108863, B = Math.imul(ce, jn), S = Math.imul(ce, nt), S = S + Math.imul(be, jn) | 0, O = Math.imul(be, nt), B = B + Math.imul(P, fn) | 0, S = S + Math.imul(P, je) | 0, S = S + Math.imul(Z, fn) | 0, O = O + Math.imul(Z, je) | 0, B = B + Math.imul(Ie, Wt) | 0, S = S + Math.imul(Ie, Ut) | 0, S = S + Math.imul(H, Wt) | 0, O = O + Math.imul(H, Ut) | 0, B = B + Math.imul(Ce, Bn) | 0, S = S + Math.imul(Ce, hn) | 0, S = S + Math.imul(oe, Bn) | 0, O = O + Math.imul(oe, hn) | 0, B = B + Math.imul(qe, $t) | 0, S = S + Math.imul(qe, Xn) | 0, S = S + Math.imul(Ye, $t) | 0, O = O + Math.imul(Ye, Xn) | 0, B = B + Math.imul(Je, hr) | 0, S = S + Math.imul(Je, pr) | 0, S = S + Math.imul(Ee, hr) | 0, O = O + Math.imul(Ee, pr) | 0, B = B + Math.imul(Oe, gr) | 0, S = S + Math.imul(Oe, br) | 0, S = S + Math.imul(Re, gr) | 0, O = O + Math.imul(Re, br) | 0;
                    var Qc = (z + B | 0) + ((S & 8191) << 13) | 0;
                    z = (O + (S >>> 13) | 0) + (Qc >>> 26) | 0, Qc &= 67108863, B = Math.imul(ce, fn), S = Math.imul(ce, je), S = S + Math.imul(be, fn) | 0, O = Math.imul(be, je), B = B + Math.imul(P, Wt) | 0, S = S + Math.imul(P, Ut) | 0, S = S + Math.imul(Z, Wt) | 0, O = O + Math.imul(Z, Ut) | 0, B = B + Math.imul(Ie, Bn) | 0, S = S + Math.imul(Ie, hn) | 0, S = S + Math.imul(H, Bn) | 0, O = O + Math.imul(H, hn) | 0, B = B + Math.imul(Ce, $t) | 0, S = S + Math.imul(Ce, Xn) | 0, S = S + Math.imul(oe, $t) | 0, O = O + Math.imul(oe, Xn) | 0, B = B + Math.imul(qe, hr) | 0, S = S + Math.imul(qe, pr) | 0, S = S + Math.imul(Ye, hr) | 0, O = O + Math.imul(Ye, pr) | 0, B = B + Math.imul(Je, gr) | 0, S = S + Math.imul(Je, br) | 0, S = S + Math.imul(Ee, gr) | 0, O = O + Math.imul(Ee, br) | 0;
                    var ec = (z + B | 0) + ((S & 8191) << 13) | 0;
                    z = (O + (S >>> 13) | 0) + (ec >>> 26) | 0, ec &= 67108863, B = Math.imul(ce, Wt), S = Math.imul(ce, Ut), S = S + Math.imul(be, Wt) | 0, O = Math.imul(be, Ut), B = B + Math.imul(P, Bn) | 0, S = S + Math.imul(P, hn) | 0, S = S + Math.imul(Z, Bn) | 0, O = O + Math.imul(Z, hn) | 0, B = B + Math.imul(Ie, $t) | 0, S = S + Math.imul(Ie, Xn) | 0, S = S + Math.imul(H, $t) | 0, O = O + Math.imul(H, Xn) | 0, B = B + Math.imul(Ce, hr) | 0, S = S + Math.imul(Ce, pr) | 0, S = S + Math.imul(oe, hr) | 0, O = O + Math.imul(oe, pr) | 0, B = B + Math.imul(qe, gr) | 0, S = S + Math.imul(qe, br) | 0, S = S + Math.imul(Ye, gr) | 0, O = O + Math.imul(Ye, br) | 0;
                    var el = (z + B | 0) + ((S & 8191) << 13) | 0;
                    z = (O + (S >>> 13) | 0) + (el >>> 26) | 0, el &= 67108863, B = Math.imul(ce, Bn), S = Math.imul(ce, hn), S = S + Math.imul(be, Bn) | 0, O = Math.imul(be, hn), B = B + Math.imul(P, $t) | 0, S = S + Math.imul(P, Xn) | 0, S = S + Math.imul(Z, $t) | 0, O = O + Math.imul(Z, Xn) | 0, B = B + Math.imul(Ie, hr) | 0, S = S + Math.imul(Ie, pr) | 0, S = S + Math.imul(H, hr) | 0, O = O + Math.imul(H, pr) | 0, B = B + Math.imul(Ce, gr) | 0, S = S + Math.imul(Ce, br) | 0, S = S + Math.imul(oe, gr) | 0, O = O + Math.imul(oe, br) | 0;
                    var Bi = (z + B | 0) + ((S & 8191) << 13) | 0;
                    z = (O + (S >>> 13) | 0) + (Bi >>> 26) | 0, Bi &= 67108863, B = Math.imul(ce, $t), S = Math.imul(ce, Xn), S = S + Math.imul(be, $t) | 0, O = Math.imul(be, Xn), B = B + Math.imul(P, hr) | 0, S = S + Math.imul(P, pr) | 0, S = S + Math.imul(Z, hr) | 0, O = O + Math.imul(Z, pr) | 0, B = B + Math.imul(Ie, gr) | 0, S = S + Math.imul(Ie, br) | 0, S = S + Math.imul(H, gr) | 0, O = O + Math.imul(H, br) | 0;
                    var tl = (z + B | 0) + ((S & 8191) << 13) | 0;
                    z = (O + (S >>> 13) | 0) + (tl >>> 26) | 0, tl &= 67108863, B = Math.imul(ce, hr), S = Math.imul(ce, pr), S = S + Math.imul(be, hr) | 0, O = Math.imul(be, pr), B = B + Math.imul(P, gr) | 0, S = S + Math.imul(P, br) | 0, S = S + Math.imul(Z, gr) | 0, O = O + Math.imul(Z, br) | 0;
                    var hf = (z + B | 0) + ((S & 8191) << 13) | 0;
                    z = (O + (S >>> 13) | 0) + (hf >>> 26) | 0, hf &= 67108863, B = Math.imul(ce, gr), S = Math.imul(ce, br), S = S + Math.imul(be, gr) | 0, O = Math.imul(be, br);
                    var pf = (z + B | 0) + ((S & 8191) << 13) | 0;
                    return z = (O + (S >>> 13) | 0) + (pf >>> 26) | 0, pf &= 67108863, L[0] = Qa, L[1] = Vi, L[2] = lf, L[3] = Mo, L[4] = Jc, L[5] = Tu, L[6] = uf, L[7] = df, L[8] = Eu, L[9] = Yc, L[10] = ff, L[11] = Cu, L[12] = Qc, L[13] = ec, L[14] = el, L[15] = Bi, L[16] = tl, L[17] = hf, L[18] = pf, z !== 0 && (L[19] = z, A.length++), A;
                };
                Math.imul || (v = _);
                function w(C, g, x) {
                    x.negative = g.negative ^ C.negative, x.length = C.length + g.length;
                    for(var A = 0, R = 0, N = 0; N < x.length - 1; N++){
                        var L = R;
                        R = 0;
                        for(var z = A & 67108863, B = Math.min(N, g.length - 1), S = Math.max(0, N - C.length + 1); S <= B; S++){
                            var O = N - S, W = C.words[O] | 0, F = g.words[S] | 0, G = W * F, ee = G & 67108863;
                            L = L + (G / 67108864 | 0) | 0, ee = ee + z | 0, z = ee & 67108863, L = L + (ee >>> 26) | 0, R += L >>> 26, L &= 67108863;
                        }
                        x.words[N] = z, A = L, L = R;
                    }
                    return A !== 0 ? x.words[N] = A : x.length--, x._strip();
                }
                function E(C, g, x) {
                    return w(C, g, x);
                }
                i.prototype.mulTo = function(g, x) {
                    var A, R = this.length + g.length;
                    return this.length === 10 && g.length === 10 ? A = v(this, g, x) : R < 63 ? A = _(this, g, x) : R < 1024 ? A = w(this, g, x) : A = E(this, g, x), A;
                }, i.prototype.mul = function(g) {
                    var x = new i(null);
                    return x.words = new Array(this.length + g.length), this.mulTo(g, x);
                }, i.prototype.mulf = function(g) {
                    var x = new i(null);
                    return x.words = new Array(this.length + g.length), E(this, g, x);
                }, i.prototype.imul = function(g) {
                    return this.clone().mulTo(g, this);
                }, i.prototype.imuln = function(g) {
                    var x = g < 0;
                    x && (g = -g), r(typeof g == "number"), r(g < 67108864);
                    for(var A = 0, R = 0; R < this.length; R++){
                        var N = (this.words[R] | 0) * g, L = (N & 67108863) + (A & 67108863);
                        A >>= 26, A += N / 67108864 | 0, A += L >>> 26, this.words[R] = L & 67108863;
                    }
                    return A !== 0 && (this.words[R] = A, this.length++), this.length = g === 0 ? 1 : this.length, x ? 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 x = y(g);
                    if (x.length === 0) return new i(1);
                    for(var A = this, R = 0; R < x.length && x[R] === 0; R++, A = A.sqr());
                    if (++R < x.length) for(var N = A.sqr(); R < x.length; R++, N = N.sqr())x[R] !== 0 && (A = A.mul(N));
                    return A;
                }, i.prototype.iushln = function(g) {
                    r(typeof g == "number" && g >= 0);
                    var x = g % 26, A = (g - x) / 26, R = 67108863 >>> 26 - x << 26 - x, N;
                    if (x !== 0) {
                        var L = 0;
                        for(N = 0; N < this.length; N++){
                            var z = this.words[N] & R, B = (this.words[N] | 0) - z << x;
                            this.words[N] = B | L, L = z >>> 26 - x;
                        }
                        L && (this.words[N] = L, this.length++);
                    }
                    if (A !== 0) {
                        for(N = this.length - 1; N >= 0; N--)this.words[N + A] = this.words[N];
                        for(N = 0; N < A; N++)this.words[N] = 0;
                        this.length += A;
                    }
                    return this._strip();
                }, i.prototype.ishln = function(g) {
                    return r(this.negative === 0), this.iushln(g);
                }, i.prototype.iushrn = function(g, x, A) {
                    r(typeof g == "number" && g >= 0);
                    var R;
                    x ? R = (x - x % 26) / 26 : R = 0;
                    var N = g % 26, L = Math.min((g - N) / 26, this.length), z = 67108863 ^ 67108863 >>> N << N, B = A;
                    if (R -= L, R = Math.max(0, R), B) {
                        for(var S = 0; S < L; S++)B.words[S] = this.words[S];
                        B.length = L;
                    }
                    if (L !== 0) if (this.length > L) for(this.length -= L, S = 0; S < this.length; S++)this.words[S] = this.words[S + L];
                    else this.words[0] = 0, this.length = 1;
                    var O = 0;
                    for(S = this.length - 1; S >= 0 && (O !== 0 || S >= R); S--){
                        var W = this.words[S] | 0;
                        this.words[S] = O << 26 - N | W >>> N, O = W & 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, x, A) {
                    return r(this.negative === 0), this.iushrn(g, x, A);
                }, 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 x = g % 26, A = (g - x) / 26, R = 1 << x;
                    if (this.length <= A) return !1;
                    var N = this.words[A];
                    return !!(N & R);
                }, i.prototype.imaskn = function(g) {
                    r(typeof g == "number" && g >= 0);
                    var x = g % 26, A = (g - x) / 26;
                    if (r(this.negative === 0, "imaskn works only with positive numbers"), this.length <= A) return this;
                    if (x !== 0 && A++, this.length = Math.min(A, this.length), x !== 0) {
                        var R = 67108863 ^ 67108863 >>> x << x;
                        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 x = 0; x < this.length && this.words[x] >= 67108864; x++)this.words[x] -= 67108864, x === this.length - 1 ? this.words[x + 1] = 1 : this.words[x + 1]++;
                    return this.length = Math.max(this.length, x + 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 x = 0; x < this.length && this.words[x] < 0; x++)this.words[x] += 67108864, this.words[x + 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, x, A) {
                    var R = g.length + A, N;
                    this._expand(R);
                    var L, z = 0;
                    for(N = 0; N < g.length; N++){
                        L = (this.words[N + A] | 0) + z;
                        var B = (g.words[N] | 0) * x;
                        L -= B & 67108863, z = (L >> 26) - (B / 67108864 | 0), this.words[N + A] = L & 67108863;
                    }
                    for(; N < this.length - A; N++)L = (this.words[N + A] | 0) + z, z = L >> 26, this.words[N + A] = 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, x) {
                    var A = this.length - g.length, R = this.clone(), N = g, L = N.words[N.length - 1] | 0, z = this._countBits(L);
                    A = 26 - z, A !== 0 && (N = N.ushln(A), R.iushln(A), L = N.words[N.length - 1] | 0);
                    var B = R.length - N.length, S;
                    if (x !== "mod") {
                        S = new i(null), S.length = B + 1, S.words = new Array(S.length);
                        for(var O = 0; O < S.length; O++)S.words[O] = 0;
                    }
                    var W = R.clone()._ishlnsubmul(N, 1, B);
                    W.negative === 0 && (R = W, S && (S.words[B] = 1));
                    for(var F = B - 1; F >= 0; F--){
                        var G = (R.words[N.length + F] | 0) * 67108864 + (R.words[N.length + F - 1] | 0);
                        for(G = Math.min(G / L | 0, 67108863), R._ishlnsubmul(N, G, F); R.negative !== 0;)G--, R.negative = 0, R._ishlnsubmul(N, 1, F), R.isZero() || (R.negative ^= 1);
                        S && (S.words[F] = G);
                    }
                    return S && S._strip(), R._strip(), x !== "div" && A !== 0 && R.iushrn(A), {
                        div: S || null,
                        mod: R
                    };
                }, i.prototype.divmod = function(g, x, A) {
                    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, x), x !== "mod" && (R = L.div.neg()), x !== "div" && (N = L.mod.neg(), A && N.negative !== 0 && N.iadd(g)), {
                        div: R,
                        mod: N
                    }) : this.negative === 0 && g.negative !== 0 ? (L = this.divmod(g.neg(), x), x !== "mod" && (R = L.div.neg()), {
                        div: R,
                        mod: L.mod
                    }) : (this.negative & g.negative) !== 0 ? (L = this.neg().divmod(g.neg(), x), x !== "div" && (N = L.mod.neg(), A && 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 ? x === "div" ? {
                        div: this.divn(g.words[0]),
                        mod: null
                    } : x === "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, x);
                }, 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 x = this.divmod(g);
                    if (x.mod.isZero()) return x.div;
                    var A = x.div.negative !== 0 ? x.mod.isub(g) : x.mod, R = g.ushrn(1), N = g.andln(1), L = A.cmp(R);
                    return L < 0 || N === 1 && L === 0 ? x.div : x.div.negative !== 0 ? x.div.isubn(1) : x.div.iaddn(1);
                }, i.prototype.modrn = function(g) {
                    var x = g < 0;
                    x && (g = -g), r(g <= 67108863);
                    for(var A = (1 << 26) % g, R = 0, N = this.length - 1; N >= 0; N--)R = (A * R + (this.words[N] | 0)) % g;
                    return x ? -R : R;
                }, i.prototype.modn = function(g) {
                    return this.modrn(g);
                }, i.prototype.idivn = function(g) {
                    var x = g < 0;
                    x && (g = -g), r(g <= 67108863);
                    for(var A = 0, R = this.length - 1; R >= 0; R--){
                        var N = (this.words[R] | 0) + A * 67108864;
                        this.words[R] = N / g | 0, A = N % g;
                    }
                    return this._strip(), x ? 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 x = this, A = g.clone();
                    x.negative !== 0 ? x = x.umod(g) : x = x.clone();
                    for(var R = new i(1), N = new i(0), L = new i(0), z = new i(1), B = 0; x.isEven() && A.isEven();)x.iushrn(1), A.iushrn(1), ++B;
                    for(var S = A.clone(), O = x.clone(); !x.isZero();){
                        for(var W = 0, F = 1; (x.words[0] & F) === 0 && W < 26; ++W, F <<= 1);
                        if (W > 0) for(x.iushrn(W); W-- > 0;)(R.isOdd() || N.isOdd()) && (R.iadd(S), N.isub(O)), R.iushrn(1), N.iushrn(1);
                        for(var G = 0, ee = 1; (A.words[0] & ee) === 0 && G < 26; ++G, ee <<= 1);
                        if (G > 0) for(A.iushrn(G); G-- > 0;)(L.isOdd() || z.isOdd()) && (L.iadd(S), z.isub(O)), L.iushrn(1), z.iushrn(1);
                        x.cmp(A) >= 0 ? (x.isub(A), R.isub(L), N.isub(z)) : (A.isub(x), L.isub(R), z.isub(N));
                    }
                    return {
                        a: L,
                        b: z,
                        gcd: A.iushln(B)
                    };
                }, i.prototype._invmp = function(g) {
                    r(g.negative === 0), r(!g.isZero());
                    var x = this, A = g.clone();
                    x.negative !== 0 ? x = x.umod(g) : x = x.clone();
                    for(var R = new i(1), N = new i(0), L = A.clone(); x.cmpn(1) > 0 && A.cmpn(1) > 0;){
                        for(var z = 0, B = 1; (x.words[0] & B) === 0 && z < 26; ++z, B <<= 1);
                        if (z > 0) for(x.iushrn(z); z-- > 0;)R.isOdd() && R.iadd(L), R.iushrn(1);
                        for(var S = 0, O = 1; (A.words[0] & O) === 0 && S < 26; ++S, O <<= 1);
                        if (S > 0) for(A.iushrn(S); S-- > 0;)N.isOdd() && N.iadd(L), N.iushrn(1);
                        x.cmp(A) >= 0 ? (x.isub(A), R.isub(N)) : (A.isub(x), N.isub(R));
                    }
                    var W;
                    return x.cmpn(1) === 0 ? W = R : W = N, W.cmpn(0) < 0 && W.iadd(g), W;
                }, i.prototype.gcd = function(g) {
                    if (this.isZero()) return g.abs();
                    if (g.isZero()) return this.abs();
                    var x = this.clone(), A = g.clone();
                    x.negative = 0, A.negative = 0;
                    for(var R = 0; x.isEven() && A.isEven(); R++)x.iushrn(1), A.iushrn(1);
                    do {
                        for(; x.isEven();)x.iushrn(1);
                        for(; A.isEven();)A.iushrn(1);
                        var N = x.cmp(A);
                        if (N < 0) {
                            var L = x;
                            x = A, A = L;
                        } else if (N === 0 || A.cmpn(1) === 0) break;
                        x.isub(A);
                    }while (!0);
                    return A.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 x = g % 26, A = (g - x) / 26, R = 1 << x;
                    if (this.length <= A) return this._expand(A + 1), this.words[A] |= R, this;
                    for(var N = R, L = A; 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 x = g < 0;
                    if (this.negative !== 0 && !x) return -1;
                    if (this.negative === 0 && x) return 1;
                    this._strip();
                    var A;
                    if (this.length > 1) A = 1;
                    else {
                        x && (g = -g), r(g <= 67108863, "Number is too big");
                        var R = this.words[0] | 0;
                        A = R === g ? 0 : R < g ? -1 : 1;
                    }
                    return this.negative !== 0 ? -A | 0 : A;
                }, i.prototype.cmp = function(g) {
                    if (this.negative !== 0 && g.negative === 0) return -1;
                    if (this.negative === 0 && g.negative !== 0) return 1;
                    var x = this.ucmp(g);
                    return this.negative !== 0 ? -x | 0 : x;
                }, i.prototype.ucmp = function(g) {
                    if (this.length > g.length) return 1;
                    if (this.length < g.length) return -1;
                    for(var x = 0, A = this.length - 1; A >= 0; A--){
                        var R = this.words[A] | 0, N = g.words[A] | 0;
                        if (R !== N) {
                            R < N ? x = -1 : R > N && (x = 1);
                            break;
                        }
                    }
                    return x;
                }, 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 te(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 I = {
                    k256: null,
                    p224: null,
                    p192: null,
                    p25519: null
                };
                function D(C, g) {
                    this.name = C, 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();
                }
                D.prototype._tmp = function() {
                    var g = new i(null);
                    return g.words = new Array(Math.ceil(this.n / 13)), g;
                }, D.prototype.ireduce = function(g) {
                    var x = g, A;
                    do this.split(x, this.tmp), x = this.imulK(x), x = x.iadd(this.tmp), A = x.bitLength();
                    while (A > this.n);
                    var R = A < this.n ? -1 : x.ucmp(this.p);
                    return R === 0 ? (x.words[0] = 0, x.length = 1) : R > 0 ? x.isub(this.p) : x.strip !== void 0 ? x.strip() : x._strip(), x;
                }, D.prototype.split = function(g, x) {
                    g.iushrn(this.n, 0, x);
                }, D.prototype.imulK = function(g) {
                    return g.imul(this.k);
                };
                function U() {
                    D.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f");
                }
                s(U, D), U.prototype.split = function(g, x) {
                    for(var A = 4194303, R = Math.min(g.length, 9), N = 0; N < R; N++)x.words[N] = g.words[N];
                    if (x.length = R, g.length <= 9) {
                        g.words[0] = 0, g.length = 1;
                        return;
                    }
                    var L = g.words[9];
                    for(x.words[x.length++] = L & A, N = 10; N < g.length; N++){
                        var z = g.words[N] | 0;
                        g.words[N - 10] = (z & A) << 4 | L >>> 22, L = z;
                    }
                    L >>>= 22, g.words[N - 10] = L, L === 0 && g.length > 10 ? g.length -= 10 : g.length -= 9;
                }, U.prototype.imulK = function(g) {
                    g.words[g.length] = 0, g.words[g.length + 1] = 0, g.length += 2;
                    for(var x = 0, A = 0; A < g.length; A++){
                        var R = g.words[A] | 0;
                        x += R * 977, g.words[A] = x & 67108863, x = R * 64 + (x / 67108864 | 0);
                    }
                    return g.words[g.length - 1] === 0 && (g.length--, g.words[g.length - 1] === 0 && g.length--), g;
                };
                function K() {
                    D.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001");
                }
                s(K, D);
                function $() {
                    D.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff");
                }
                s($, D);
                function ne() {
                    D.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed");
                }
                s(ne, D), ne.prototype.imulK = function(g) {
                    for(var x = 0, A = 0; A < g.length; A++){
                        var R = (g.words[A] | 0) * 19 + x, N = R & 67108863;
                        R >>>= 26, g.words[A] = N, x = R;
                    }
                    return x !== 0 && (g.words[g.length++] = x), g;
                }, i._prime = function(g) {
                    if (I[g]) return I[g];
                    var x;
                    if (g === "k256") x = new U;
                    else if (g === "p224") x = new K;
                    else if (g === "p192") x = new $;
                    else if (g === "p25519") x = new ne;
                    else throw new Error("Unknown prime " + g);
                    return I[g] = x, x;
                };
                function te(C) {
                    if (typeof C == "string") {
                        var g = i._prime(C);
                        this.m = g.p, this.prime = g;
                    } else r(C.gtn(1), "modulus must be greater than 1"), this.m = C, this.prime = null;
                }
                te.prototype._verify1 = function(g) {
                    r(g.negative === 0, "red works only with positives"), r(g.red, "red works only with red numbers");
                }, te.prototype._verify2 = function(g, x) {
                    r((g.negative | x.negative) === 0, "red works only with positives"), r(g.red && g.red === x.red, "red works only with red numbers");
                }, te.prototype.imod = function(g) {
                    return this.prime ? this.prime.ireduce(g)._forceRed(this) : (u(g, g.umod(this.m)._forceRed(this)), g);
                }, te.prototype.neg = function(g) {
                    return g.isZero() ? g.clone() : this.m.sub(g)._forceRed(this);
                }, te.prototype.add = function(g, x) {
                    this._verify2(g, x);
                    var A = g.add(x);
                    return A.cmp(this.m) >= 0 && A.isub(this.m), A._forceRed(this);
                }, te.prototype.iadd = function(g, x) {
                    this._verify2(g, x);
                    var A = g.iadd(x);
                    return A.cmp(this.m) >= 0 && A.isub(this.m), A;
                }, te.prototype.sub = function(g, x) {
                    this._verify2(g, x);
                    var A = g.sub(x);
                    return A.cmpn(0) < 0 && A.iadd(this.m), A._forceRed(this);
                }, te.prototype.isub = function(g, x) {
                    this._verify2(g, x);
                    var A = g.isub(x);
                    return A.cmpn(0) < 0 && A.iadd(this.m), A;
                }, te.prototype.shl = function(g, x) {
                    return this._verify1(g), this.imod(g.ushln(x));
                }, te.prototype.imul = function(g, x) {
                    return this._verify2(g, x), this.imod(g.imul(x));
                }, te.prototype.mul = function(g, x) {
                    return this._verify2(g, x), this.imod(g.mul(x));
                }, te.prototype.isqr = function(g) {
                    return this.imul(g, g.clone());
                }, te.prototype.sqr = function(g) {
                    return this.mul(g, g);
                }, te.prototype.sqrt = function(g) {
                    if (g.isZero()) return g.clone();
                    var x = this.m.andln(3);
                    if (r(x % 2 === 1), x === 3) {
                        var A = this.m.add(new i(1)).iushrn(2);
                        return this.pow(g, A);
                    }
                    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), S = this.m.bitLength();
                    for(S = new i(2 * S * S).toRed(this); this.pow(S, B).cmp(z) !== 0;)S.redIAdd(z);
                    for(var O = this.pow(S, R), W = this.pow(g, R.addn(1).iushrn(1)), F = this.pow(g, R), G = N; F.cmp(L) !== 0;){
                        for(var ee = F, Q = 0; ee.cmp(L) !== 0; Q++)ee = ee.redSqr();
                        r(Q < G);
                        var Y = this.pow(O, new i(1).iushln(G - Q - 1));
                        W = W.redMul(Y), O = Y.redSqr(), F = F.redMul(O), G = Q;
                    }
                    return W;
                }, te.prototype.invm = function(g) {
                    var x = g._invmp(this.m);
                    return x.negative !== 0 ? (x.negative = 0, this.imod(x).redNeg()) : this.imod(x);
                }, te.prototype.pow = function(g, x) {
                    if (x.isZero()) return new i(1).toRed(this);
                    if (x.cmpn(1) === 0) return g.clone();
                    var A = 4, R = new Array(1 << A);
                    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, S = x.bitLength() % 26;
                    for(S === 0 && (S = 26), N = x.length - 1; N >= 0; N--){
                        for(var O = x.words[N], W = S - 1; W >= 0; W--){
                            var F = O >> W & 1;
                            if (L !== R[0] && (L = this.sqr(L)), F === 0 && z === 0) {
                                B = 0;
                                continue;
                            }
                            z <<= 1, z |= F, B++, !(B !== A && (N !== 0 || W !== 0)) && (L = this.mul(L, R[z]), B = 0, z = 0);
                        }
                        S = 26;
                    }
                    return L;
                }, te.prototype.convertTo = function(g) {
                    var x = g.umod(this.m);
                    return x === g ? x.clone() : x;
                }, te.prototype.convertFrom = function(g) {
                    var x = g.clone();
                    return x.red = null, x;
                }, i.mont = function(g) {
                    return new J(g);
                };
                function J(C) {
                    te.call(this, C), 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(J, te), J.prototype.convertTo = function(g) {
                    return this.imod(g.ushln(this.shift));
                }, J.prototype.convertFrom = function(g) {
                    var x = this.imod(g.mul(this.rinv));
                    return x.red = null, x;
                }, J.prototype.imul = function(g, x) {
                    if (g.isZero() || x.isZero()) return g.words[0] = 0, g.length = 1, g;
                    var A = g.imul(x), R = A.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), N = A.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);
                }, J.prototype.mul = function(g, x) {
                    if (g.isZero() || x.isZero()) return new i(0)._forceRed(this);
                    var A = g.mul(x), R = A.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m), N = A.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);
                }, J.prototype.invm = function(g) {
                    var x = this.imod(g._invmp(this.m).mul(this.r2));
                    return x._forceRed(this);
                };
            })(t, wze);
        })(s2)), s2.exports;
    }
    var xze = _ze();
    const at = mH(xze);
    function Ja(t) {
        return at.isBN(t);
    }
    const lY = /^0x[\da-fA-F]+$/, vze = /^[\da-fA-F]+$/;
    function Nn(t, e = -1, n) {
        return typeof t == "string" && (t === "0x" || lY.test(t)) && (e === -1 ? n || t.length % 2 === 0 : t.length === 2 + Math.ceil(e / 4));
    }
    function Yi(t) {
        return !!t && typeof t == "object";
    }
    function uY(...t) {
        return (e)=>(Yi(e) || Tt(e)) && t.every((n)=>Tt(e[n]));
    }
    function Sze(...t) {
        return (e)=>Tt(e) && t.every((n)=>Tt(e[n]));
    }
    function aP(...t) {
        return (e)=>Yi(e) && t.every((n)=>Tt(e[n]));
    }
    const kze = uY("toBigInt"), Tze = uY("toBn"), h5 = typeof Zn == "function" && typeof Zn.asIntN == "function", Eze = typeof la.Buffer == "function" && typeof la.Buffer.isBuffer == "function";
    la.process;
    function dY(t) {
        return Eze && !!t && Tt(t.readDoubleLE) && la.Buffer.isBuffer(t);
    }
    function Rt(t) {
        return (t && t.constructor) === Uint8Array || t instanceof Uint8Array;
    }
    const Cze = new hze;
    function za(t) {
        return t ? Cze.encode(t.toString()) : new Uint8Array;
    }
    function Ot(t, e = !1) {
        if (e && t == null) throw new Error("u8aToU8a: Expected non-null, non-undefined value");
        return Rt(t) ? dY(t) ? new Uint8Array(t) : t : Nn(t) ? Dc(t) : Array.isArray(t) ? new Uint8Array(t) : za(t);
    }
    function Ii(...t) {
        const e = t.length, n = new Array(e);
        let r = 0;
        for(let s = 0; s < e; s++)n[s] = Ot(t[s]), r += n[s].length;
        return Ao(n, r);
    }
    function Ao(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 fY(t, e) {
        const n = Ot(t), r = Ot(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 ou(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 at(0);
            case 1:
                return new at((t[0] ^ 255) * -1 - 1);
            case 2:
                return new at((t[0] + (t[1] << 8) ^ 65535) * -1 - 1);
            case 3:
                return new at((t[0] + (t[1] << 8) + (t[2] << 16) ^ 16777215) * -1 - 1);
            case 4:
                return new at((t[0] + (t[1] << 8) + (t[2] << 16) + t[3] * 16777216 ^ 4294967295) * -1 - 1);
            case 5:
                return new at(((t[0] + (t[1] << 8) + (t[2] << 16) + t[3] * 16777216 ^ 4294967295) + (t[4] ^ 255) * 4294967296) * -1 - 1);
            case 6:
                return new at(((t[0] + (t[1] << 8) + (t[2] << 16) + t[3] * 16777216 ^ 4294967295) + (t[4] + (t[5] << 8) ^ 65535) * 4294967296) * -1 - 1);
            default:
                return new at(t, "le").fromTwos(r * 8);
        }
        switch(r){
            case 0:
                return new at(0);
            case 1:
                return new at(t[0]);
            case 2:
                return new at(t[0] + (t[1] << 8));
            case 3:
                return new at(t[0] + (t[1] << 8) + (t[2] << 16));
            case 4:
                return new at(t[0] + (t[1] << 8) + (t[2] << 16) + t[3] * 16777216);
            case 5:
                return new at(t[0] + (t[1] << 8) + (t[2] << 16) + (t[3] + (t[4] << 8)) * 16777216);
            case 6:
                return new at(t[0] + (t[1] << 8) + (t[2] << 16) + (t[3] + (t[4] << 8) + (t[5] << 16)) * 16777216);
            default:
                return new at(t, "le");
        }
    }
    function Ize(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 Dx = new Array(256), hY = new Array(256 * 256);
    for(let t = 0; t < 256; t++)Dx[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++)hY[e | n] = Dx[t] + Dx[n];
    }
    function NS(t, e) {
        const n = t.length % 2 | 0, r = t.length - n | 0;
        for(let s = 0; s < r; s += 2)e += hY[t[s] << 8 | t[s + 1]];
        return n && (e += Dx[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 `${NS(t.subarray(0, s / 2), r)}…${NS(t.subarray(t.length - s / 2), "")}`;
            }
        } else return r;
        return NS(t, r);
    }
    function Aze(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 Pze = new dze("utf-8");
    function Hl(t) {
        return t ? Pze.decode(t) : "";
    }
    function Oze(t) {
        if (!t || t === "0x") return "";
        if (lY.test(t)) return t.substring(2);
        if (vze.test(t)) return t;
        throw new Error(`Expected hex value to convert, found '${t}'`);
    }
    function cP(t, { isLe: e = !1, isNegative: n = !1 } = {}) {
        if (!t || t === "0x") return new at(0);
        const r = Oze(t), s = new at(r, 16, e ? "le" : "be");
        return n ? s.fromTwos(r.length * 4) : s;
    }
    const i2 = aY((t, e)=>t.gt(e)), Mze = aY((t, e)=>t.lt(e)), es = new at(0), hb = new at(1), p5 = new at(2), Rze = new at(100), Nze = new at(1e6), Fx = new at(1e9), Vze = Fx.mul(Fx), Bze = new at(Number.MAX_SAFE_INTEGER), Dze = new at(94906265);
    function fp(t) {
        return typeof t == "bigint";
    }
    function Ns(t) {
        return t ? at.isBN(t) ? t : Nn(t) ? cP(t.toString()) : fp(t) ? new at(t.toString()) : Tze(t) ? t.toBn() : kze(t) ? new at(t.toBigInt().toString()) : new at(t) : new at(0);
    }
    function pY(t) {
        const e = Ns(t);
        if (e.isNeg()) throw new Error("square root of negative numbers is not supported");
        if (e.lte(Bze)) return new at(~~Math.sqrt(e.toNumber()));
        let n = Dze.clone();
        for(;;){
            const r = e.div(n).iadd(n).ishrn(1);
            if (n.eq(r) || n.eq(r.sub(hb))) return n;
            n = r;
        }
    }
    const Fze = {
        bitLength: -1,
        isLe: !0,
        isNegative: !1
    };
    function jl(t, { bitLength: e = -1, isLe: n = !0, isNegative: r = !1 } = Fze) {
        const s = Ns(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 Lze(t, { bitLength: e = -1, isLe: n = !1, isNegative: r = !1 } = {}) {
        return nn(jl(t, {
            bitLength: e,
            isLe: n,
            isNegative: r
        }));
    }
    const zze = p5.pow(new at(6)).isub(hb), Uze = p5.pow(new at(14)).isub(hb), Hze = p5.pow(new at(30)).isub(hb), jze = {
        bitLength: 16
    }, qze = {
        bitLength: 32
    };
    function Yr(t) {
        const e = Ns(t);
        if (e.lte(zze)) return new Uint8Array([
            e.toNumber() << 2
        ]);
        if (e.lte(Uze)) return jl(e.shln(2).iadd(hb), jze);
        if (e.lte(Hze)) return jl(e.shln(2).iadd(p5), qze);
        const n = jl(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 Ao([
            new Uint8Array([
                (r - 4 << 2) + 3
            ]),
            n.subarray(0, r)
        ]);
    }
    function hp(t) {
        return Ao([
            Yr(t.length),
            t
        ]);
    }
    function g5(t) {
        const e = Ot(t);
        switch(e[0] & 3){
            case 0:
                return [
                    1,
                    new at(e[0] >>> 2)
                ];
            case 1:
                return [
                    2,
                    new at(e[0] + (e[1] << 8) >>> 2)
                ];
            case 2:
                return [
                    4,
                    new at(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 at(e[1] + (e[2] << 8) + (e[3] << 16) + e[4] * 16777216)
                            ];
                        case 6:
                            return [
                                6,
                                new at(e[1] + (e[2] << 8) + (e[3] << 16) + (e[4] + (e[5] << 8)) * 16777216)
                            ];
                        case 7:
                            return [
                                7,
                                new at(e[1] + (e[2] << 8) + (e[3] << 16) + (e[4] + (e[5] << 8) + (e[6] << 16)) * 16777216)
                            ];
                        default:
                            return [
                                n,
                                ou(e.subarray(1, n))
                            ];
                    }
                }
        }
    }
    function pp(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 Lx(t) {
        const [e, n] = g5(t), r = e + n.toNumber();
        return [
            r,
            t.subarray(e, r)
        ];
    }
    function Kze(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 Hy(t) {
        return typeof t == "boolean";
    }
    const HB = new RegExp("(\\d+?)(?=(\\d{3})+(?!\\d)|$)", "g");
    function gY(t, e = ",") {
        const n = t[0].startsWith("-"), r = n ? t.substring(1).match(HB) : t.match(HB);
        return r ? `${n ? "-" : ""}${r.join(e)}` : t;
    }
    function bY(t) {
        return {
            decimal: .1.toLocaleString(t, {
                useGrouping: !1
            }).charAt(1),
            thousand: 1e3.toLocaleString(t, {
                useGrouping: !0
            }).replace(/\d/g, "").charAt(0)
        };
    }
    const iw = 8, Pa = [
        {
            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 mY(t) {
        for(let e = 0, n = Pa.length; e < n; e++)if (Pa[e].value === t) return Pa[e];
        return Pa[iw];
    }
    function yY(t, e, n) {
        if (n) return mY(n);
        const r = iw - 1 + Math.ceil((t.length - e) / 3);
        return Pa[r] || Pa[r < 0 ? 0 : Pa.length - 1];
    }
    const Wze = 0, $ze = Pa[iw].text;
    let yg = Wze, o2 = $ze;
    function Xze(t, { decimals: e = yg, forceUnit: n, locale: r = "en", withAll: s = !1, withSi: i = !0, withSiFull: o = !1, withUnit: a = !0, withZero: c = !0 } = {}) {
        let l = Ns(t).toString();
        if (l.length === 0 || l === "0") return "0";
        let u = "";
        l[0].startsWith("-") && (u = "-", l = l.substring(1));
        const d = yY(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 w = h.length - 1;
            do h[w] === "0" && w--;
            while (h[w] === "0");
            h = h.substring(0, w + 1);
        }
        const b = Hy(a) ? Pa[iw].text : a, y = i || o ? d.value === "-" ? a ? ` ${b}` : "" : ` ${o ? `${d.text}${a ? " " : ""}` : d.value}${a ? b : ""}` : "", { decimal: _, thousand: v } = bY(r);
        return `${u}${gY(p, v)}${h && `${_}${h}`}${y}`;
    }
    const gp = Xze;
    gp.calcSi = (t, e = yg)=>yY(t, e);
    gp.findSi = mY;
    gp.getDefaults = ()=>({
            decimals: yg,
            unit: o2
        });
    gp.getOptions = (t = yg)=>Pa.filter(({ power: e })=>e < 0 ? t + e >= 0 : !0);
    gp.setDefaults = ({ decimals: t, unit: e })=>{
        yg = (Array.isArray(t) ? t[0] : t) ?? yg, o2 = (Array.isArray(e) ? e[0] : e) ?? o2, Pa[iw].text = o2;
    };
    function jb(t) {
        return t.toString().padStart(2, "0");
    }
    function Gze(t) {
        const e = t.getFullYear().toString(), n = jb(t.getMonth() + 1), r = jb(t.getDate()), s = jb(t.getHours()), i = jb(t.getMinutes()), o = jb(t.getSeconds());
        return `${e}-${n}-${r} ${s}:${i}:${o}`;
    }
    function mT(t, { locale: e = "en" } = {}) {
        const { thousand: n } = bY(e);
        return gY(Ns(t).toString(), n);
    }
    function rr(t) {
        return typeof t == "string" || t instanceof String;
    }
    function Zze(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 jB(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 qB(t) {
        return rr(t) ? Nn(t) ? jB(Ot(t)) : Zze(t) : t ? jB(t) : !1;
    }
    const KB = Sze("isPrototypeOf", "hasOwnProperty");
    function Jze(t, e) {
        return KB(e) && KB(t) ? t === e || t.isPrototypeOf(e) : !1;
    }
    const Yze = aP("toHex", "toHuman", "toU8a"), Qze = aP("get");
    function sa(t) {
        return Yze(t) && Qze(t.registry);
    }
    const wY = aP("toBigInt", "toBn", "toNumber", "unwrap");
    function eUe(t, e) {
        return fp(e) ? e.toString() : e;
    }
    function Sn(t, e) {
        return JSON.stringify(t, eUe, e);
    }
    function dh(t) {
        return t === null;
    }
    function Ln(t) {
        return typeof t == "number";
    }
    function kr(t) {
        return t === void 0;
    }
    function tUe(t) {
        if (!t) return rr(t);
        const e = Ot(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 si(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 fh(t, e, n, r) {
        for(let s = 0, i = e.length; s < i; s++)si(t, e[s], n, r, s);
        return t;
    }
    function bp(t) {
        return t;
    }
    function ql() {}
    const nUe = {
        debug: "log",
        error: "error",
        log: "log",
        warn: "warn"
    };
    function rUe(t) {
        if (t && Yi(t) && t.constructor === Object) {
            const e = {};
            for (const [n, r] of Object.entries(t))e[n] = lP(r);
            return e;
        }
        return t;
    }
    function lP(t) {
        return Array.isArray(t) ? t.map(lP) : Ja(t) ? t.toString() : Rt(t) || dY(t) ? nn(Ot(t)) : rUe(t);
    }
    function sUe(t) {
        return (e)=>{
            if (t <= 0) return e;
            const n = `${e}`;
            return n.length < t ? e : `${n.substring(0, t)} ...`;
        };
    }
    function ym(t, e, n, r = -1) {
        if (n.length === 1 && Tt(n[0])) {
            const s = n[0]();
            return ym(t, e, Array.isArray(s) ? s : [
                s
            ], r);
        }
        console[nUe[t]](Gze(new Date), e, ...n.map(lP).map(sUe(r)));
    }
    function iUe(t, e) {
        return !!t && (t === "*" || e === t || t.endsWith("*") && e.startsWith(t.slice(0, -1)));
    }
    function oUe(t, e) {
        return !!t && t.startsWith("-") && (e === t.slice(1) || t.endsWith("*") && e.startsWith(t.slice(1, -1)));
    }
    function aUe(t, e) {
        let n = !1;
        for (const r of t)iUe(r, e) ? n = !0 : oUe(r, e) && (n = !1);
        return n;
    }
    function cUe(t) {
        const e = parseInt(la.process?.env?.DEBUG_MAX || "-1", 10);
        return [
            aUe((la.process?.env?.DEBUG || "").toLowerCase().split(","), t),
            isNaN(e) ? -1 : e
        ];
    }
    function ha(t) {
        const e = `${t.toUpperCase()}:`.padStart(16), [n, r] = cUe(t.toLowerCase());
        return {
            debug: n ? (...s)=>ym("debug", e, s, r) : ql,
            error: (...s)=>ym("error", e, s),
            log: (...s)=>ym("log", e, s),
            noop: ql,
            warn: (...s)=>ym("warn", e, s)
        };
    }
    function lUe() {
        return "none";
    }
    function wm(t, { getInstanceId: e = lUe } = {}) {
        const n = {}, r = (...s)=>{
            const i = Sn(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 = Sn(s), o = e();
            n[o]?.[i] !== void 0 && delete n[o][i];
        }, r;
    }
    function jh(t, e) {
        setTimeout(()=>{
            Promise.resolve().then(()=>{
                t();
            }).catch((n)=>{
                console.error(n);
            });
        }, 0);
    }
    function uUe(t) {
        const e = Object.keys(t);
        for(let n = 0, r = e.length; n < r; n++)delete t[e[n]];
        return t;
    }
    function $e(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 uP(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 zd(t, e, n, r) {
        for(let s = 0, i = e.length; s < i; s++)uP(t, e[s], n, r, s);
    }
    const wg = new Array(256), _Y = new Array(256);
    for(let t = 0, e = wg.length; t < e; t++)_Y[t] = String.fromCharCode(t).toLowerCase(), wg[t] = String.fromCharCode(t).toUpperCase();
    function dUe(t) {
        return t.slice(0, t.length - 1).toLowerCase() + wg[t.charCodeAt(t.length - 1)];
    }
    function xY(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]/, dUe), s);
            }
            return r;
        };
    }
    const $n = xY((t, e)=>(e ? wg[t.charCodeAt(0)] : _Y[t.charCodeAt(0)]) + t.slice(1)), dP = xY((t)=>wg[t.charCodeAt(0)] + t.slice(1));
    function fUe(t) {
        return (e)=>e ? t[e.charCodeAt(0)] + e.slice(1) : "";
    }
    const hUe = fUe(wg);
    function vY(t) {
        return nn(za(t));
    }
    const WB = {
        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"
    }, pUe = la.crypto;
    function gUe(t) {
        return pUe.getRandomValues(t);
    }
    const a2 = {
        getRandomValues: gUe
    }, bUe = {
        crypto: a2
    };
    class mUe {
        #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(bUe);
        __wbg_require_604837428532a733 = (e, n)=>{
            throw new Error(`Unable to require ${this.#e.getString(e, n)}`);
        };
        __wbg_crypto_968f1772287e2df0 = (e)=>this.#e.addObject(a2);
        __wbg_getRandomValues_a3d34b4fee3c2869 = (e)=>this.#e.addObject(a2.getRandomValues);
        __wbg_getRandomValues_f5e14ab7ac8e995d = (e, n, r)=>{
            a2.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 yUe {
        #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 mUe(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 Hl(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(za(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 Hl(this.resultU8a());
        }
    }
    function wUe(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 $B = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", SY = new Array(256);
    for(let t = 0, e = $B.length; t < e; t++)SY[$B.charCodeAt(t)] = t;
    function _Ue(t, e) {
        let n = 0, r = 0, s = -1;
        for(let i = 0, o = e.length - 1; s !== o; i++)n = n << 6 | SY[t.charCodeAt(i)], (r += 6) >= 8 && (e[++s] = n >>> (r -= 8) & 255);
        return e;
    }
    const kc = Uint8Array, hh = Uint16Array, yT = Uint32Array, xUe = new kc([
        16,
        17,
        18,
        0,
        8,
        7,
        9,
        6,
        10,
        5,
        11,
        4,
        12,
        3,
        13,
        2,
        14,
        1,
        15
    ]), kY = new kc([
        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
    ]), TY = new kc([
        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
    ]), EY = (t, e)=>{
        const n = new hh(31);
        for(let s = 0; s < 31; ++s)n[s] = e += 1 << t[s - 1];
        const r = new yT(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
        ];
    }, [CY, vUe] = EY(kY, 2);
    CY[28] = 258, vUe[258] = 28;
    const [SUe] = EY(TY, 0), IY = new hh(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, IY[t] = ((e & 65280) >>> 8 | (e & 255) << 8) >>> 1;
    }
    const zm = ((t, e, n)=>{
        const r = t.length;
        let s = 0;
        const i = new hh(e);
        for(; s < r; ++s)t[s] && ++i[t[s] - 1];
        const o = new hh(e);
        for(s = 1; s < e; ++s)o[s] = o[s - 1] + i[s - 1] << 1;
        let a;
        {
            a = new hh(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[IY[d] >> c] = l;
            }
        }
        return a;
    }), ow = new kc(288);
    for(let t = 0; t < 144; ++t)ow[t] = 8;
    for(let t = 144; t < 256; ++t)ow[t] = 9;
    for(let t = 256; t < 280; ++t)ow[t] = 7;
    for(let t = 280; t < 288; ++t)ow[t] = 8;
    const AY = new kc(32);
    for(let t = 0; t < 32; ++t)AY[t] = 5;
    const kUe = zm(ow, 9), TUe = zm(AY, 5), ma = (t, e, n)=>{
        const r = e >>> 3;
        return (t[r] | t[r + 1] << 8) >>> (e & 7) & n;
    }, VS = (t, e)=>{
        const n = e >>> 3;
        return (t[n] | t[n + 1] << 8 | t[n + 2] << 16) >>> (e & 7);
    }, EUe = (t)=>(t >>> 3) + (t & 7 && 1), CUe = (t, e, n)=>{
        (n == null || n > t.length) && (n = t.length);
        const r = new (t instanceof hh ? hh : t instanceof yT ? yT : kc)(n - e);
        return r.set(t.subarray(e, n)), r;
    }, BS = (t)=>{
        let e = t[0];
        for(let n = 1, r = t.length; n < r; ++n)t[n] > e && (e = t[n]);
        return e;
    }, IUe = (t, e, n)=>{
        const r = !n || n.i;
        n || (n = {});
        const s = t.length, i = !e || !r;
        e || (e = new kc(s * 3));
        const o = (b)=>{
            let y = e.length;
            if (b > y) {
                const _ = new kc(Math.max(y << 1, b));
                _.set(e), e = _;
            }
        };
        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 = ma(t, c, 1);
                const v = ma(t, c + 1, 3);
                if (c += 3, v) if (v == 1) u = kUe, d = TUe, f = 9, p = 5;
                else if (v == 2) {
                    const w = ma(t, c, 31) + 257, E = ma(t, c + 10, 15) + 4, I = w + ma(t, c + 5, 31) + 1;
                    c += 14;
                    const D = new kc(I), U = new kc(19);
                    for(let C = 0; C < E; ++C)U[xUe[C]] = ma(t, c + C * 3, 7);
                    c += E * 3;
                    const K = BS(U), $ = (1 << K) - 1;
                    if (!r && c + I * (K + 7) > h) break;
                    const ne = zm(U, K);
                    for(let C = 0; C < I;){
                        const g = ne[ma(t, c, $)];
                        c += g & 15;
                        const x = g >>> 4;
                        if (x < 16) D[C++] = x;
                        else {
                            let A = 0, R = 0;
                            for(x == 16 ? (R = 3 + ma(t, c, 3), c += 2, A = D[C - 1]) : x == 17 ? (R = 3 + ma(t, c, 7), c += 3) : x == 18 && (R = 11 + ma(t, c, 127), c += 7); R--;)D[C++] = A;
                        }
                    }
                    const te = D.subarray(0, w), J = D.subarray(w);
                    f = BS(te), p = BS(J), u = zm(te, f), d = zm(J, p);
                } else throw "invalid block type";
                else {
                    const w = EUe(c) + 4, E = t[w - 4] | t[w - 3] << 8, I = w + E;
                    if (I > s) {
                        if (r) throw "unexpected EOF";
                        break;
                    }
                    i && o(l + E), e.set(t.subarray(w, I), l), n.b = l += E, n.p = c = I << 3;
                    continue;
                }
                if (c > h) throw "unexpected EOF";
            }
            i && o(l + 131072);
            const b = (1 << f) - 1, y = (1 << p) - 1, _ = f + p + 18;
            for(; r || c + _ < h;){
                const v = u[VS(t, c) & b], w = v >>> 4;
                if (c += v & 15, c > h) throw "unexpected EOF";
                if (!v) throw "invalid length/literal";
                if (w < 256) e[l++] = w;
                else if (w == 256) {
                    u = void 0;
                    break;
                } else {
                    let E = w - 254;
                    if (w > 264) {
                        const $ = w - 257, ne = kY[$];
                        E = ma(t, c, (1 << ne) - 1) + CY[$], c += ne;
                    }
                    const I = d[VS(t, c) & y], D = I >>> 4;
                    if (!I) throw "invalid distance";
                    c += I & 15;
                    let U = SUe[D];
                    if (D > 3) {
                        const $ = TY[D];
                        U += VS(t, c) & (1 << $) - 1, c += $;
                    }
                    if (c > h) throw "unexpected EOF";
                    i && o(l + 131072);
                    const K = l + E;
                    for(; l < K; l += 4)e[l] = e[l - U], e[l + 1] = e[l + 1 - U], e[l + 2] = e[l + 2 - U], e[l + 3] = e[l + 3 - U];
                    l = K;
                }
            }
            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 : CUe(e, 0, l);
    }, AUe = (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 PUe(t, e) {
        return IUe((AUe(t), t.subarray(2, -4)), e);
    }
    var qb = {}, XB;
    function OUe() {
        return XB || (XB = 1, qb.lenIn = 168782, qb.lenOut = 335277, qb.bytes = " "), qb;
    }
    var DS = OUe();
    const MUe = PUe(_Ue(DS.bytes, new Uint8Array(DS.lenIn)), new Uint8Array(DS.lenOut)), RUe = wUe("crypto", MUe), Ti = new yUe(RUe);
    async function NUe(t) {
        return Ti.init(t);
    }
    function aw(t) {
        return (...e)=>{
            if (!Ti.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(Ti.wasm, ...e);
        };
    }
    const VUe = aw((t, e)=>(t.ext_secp_pub_expand(8, ...Ti.allocU8a(e)), Ti.resultU8a())), BUe = aw((t, e, n, r)=>(t.ext_blake2b(8, ...Ti.allocU8a(e), ...Ti.allocU8a(n), r), Ti.resultU8a())), DUe = aw((t, e)=>(t.ext_keccak256(8, ...Ti.allocU8a(e)), Ti.resultU8a())), FUe = aw((t, e)=>(t.ext_keccak512(8, ...Ti.allocU8a(e)), Ti.resultU8a())), LUe = aw((t, e, n)=>(t.ext_twox(8, ...Ti.allocU8a(e), n), Ti.resultU8a()));
    function cw() {
        return !!Ti.wasm;
    }
    async function zUe() {
        try {
            return !!await NUe();
        } catch  {
            return !1;
        }
    }
    function UUe() {
        return zUe().then(()=>{
            if (!cw()) throw new Error("Unable to initialize @polkadot/util-crypto");
            return !0;
        }).catch(()=>!1);
    }
    function HUe(t) {
        return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
    }
    function PY(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 wT(t, e) {
        if (typeof e != "string") throw new Error(`${t}: string expected`);
        return !0;
    }
    function OY(t) {
        if (!Number.isSafeInteger(t)) throw new Error(`invalid integer: ${t}`);
    }
    function _T(t) {
        if (!Array.isArray(t)) throw new Error("array expected");
    }
    function MY(t, e) {
        if (!PY(!0, e)) throw new Error(`${t}: array of strings expected`);
    }
    function jUe(t, e) {
        if (!PY(!1, e)) throw new Error(`${t}: array of numbers expected`);
    }
    function qUe(...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 KUe(t) {
        const e = typeof t == "string" ? t.split("") : t, n = e.length;
        MY("alphabet", e);
        const r = new Map(e.map((s, i)=>[
                s,
                i
            ]));
        return {
            encode: (s)=>(_T(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)=>(_T(s), s.map((i)=>{
                    wT("alphabet.decode", i);
                    const o = r.get(i);
                    if (o === void 0) throw new Error(`Unknown letter: "${i}". Allowed: ${t}`);
                    return o;
                }))
        };
    }
    function WUe(t = "") {
        return wT("join", t), {
            encode: (e)=>(MY("join.decode", e), e.join(t)),
            decode: (e)=>(wT("join.decode", e), e.split(t))
        };
    }
    function GB(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 (_T(t), !t.length) return [];
        let r = 0;
        const s = [], i = Array.from(t, (a)=>{
            if (OY(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 $Ue(t) {
        OY(t);
        const e = 2 ** 8;
        return {
            encode: (n)=>{
                if (!HUe(n)) throw new Error("radix.encode input should be Uint8Array");
                return GB(Array.from(n), e, t);
            },
            decode: (n)=>(jUe("radix.decode", n), Uint8Array.from(GB(n, t, e)))
        };
    }
    const XUe = (t)=>qUe($Ue(58), KUe(t), WUe("")), GUe = XUe("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");
    function ZUe({ coder: t, ipfs: e }, n) {
        return (r, s)=>(n(r, s), t.decode(s ? r.substring(1) : r));
    }
    function JUe({ coder: t, ipfs: e }) {
        return (n, r)=>{
            const s = t.encode(Ot(n));
            return e && r ? `${e}${s}` : s;
        };
    }
    function YUe({ 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 fP = {
        chars: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",
        coder: GUe,
        ipfs: "z",
        type: "base58"
    }, QUe = YUe(fP), eHe = ZUe(fP, QUe), tHe = JUe(fP), Dp = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0;
    function lw(t) {
        return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
    }
    function Ud(t) {
        if (!Number.isSafeInteger(t) || t < 0) throw new Error("positive integer expected, got " + t);
    }
    function Fc(t, ...e) {
        if (!lw(t)) throw new Error("Uint8Array expected");
        if (e.length > 0 && !e.includes(t.length)) throw new Error("Uint8Array expected of length " + e + ", got length=" + t.length);
    }
    function RY(t) {
        if (typeof t != "function" || typeof t.create != "function") throw new Error("Hash should be wrapped by utils.createHasher");
        Ud(t.outputLen), Ud(t.blockLen);
    }
    function Hd(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 hP(t, e) {
        Fc(t);
        const n = e.outputLen;
        if (t.length < n) throw new Error("digestInto() expects output buffer of length at least " + n);
    }
    function jy(t) {
        return new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4));
    }
    function Ua(...t) {
        for(let e = 0; e < t.length; e++)t[e].fill(0);
    }
    function FS(t) {
        return new DataView(t.buffer, t.byteOffset, t.byteLength);
    }
    function rc(t, e) {
        return t << 32 - e | t >>> e;
    }
    const NY = new Uint8Array(new Uint32Array([
        287454020
    ]).buffer)[0] === 68;
    function VY(t) {
        return t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;
    }
    const pl = NY ? (t)=>t : (t)=>VY(t);
    function nHe(t) {
        for(let e = 0; e < t.length; e++)t[e] = VY(t[e]);
        return t;
    }
    const ed = NY ? (t)=>t : nHe, BY = typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function", rHe = Array.from({
        length: 256
    }, (t, e)=>e.toString(16).padStart(2, "0"));
    function ph(t) {
        if (Fc(t), BY) return t.toHex();
        let e = "";
        for(let n = 0; n < t.length; n++)e += rHe[t[n]];
        return e;
    }
    const al = {
        _0: 48,
        _9: 57,
        A: 65,
        F: 70,
        a: 97,
        f: 102
    };
    function ZB(t) {
        if (t >= al._0 && t <= al._9) return t - al._0;
        if (t >= al.A && t <= al.F) return t - (al.A - 10);
        if (t >= al.a && t <= al.f) return t - (al.a - 10);
    }
    function zx(t) {
        if (typeof t != "string") throw new Error("hex string expected, got " + typeof t);
        if (BY) 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 = ZB(t.charCodeAt(i)), a = ZB(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 sHe(t) {
        if (typeof t != "string") throw new Error("string expected");
        return new Uint8Array(new TextEncoder().encode(t));
    }
    function Kl(t) {
        return typeof t == "string" && (t = sHe(t)), Fc(t), t;
    }
    function xc(...t) {
        let e = 0;
        for(let r = 0; r < t.length; r++){
            const s = t[r];
            Fc(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;
    }
    let b5 = class {
    };
    function pP(t) {
        const e = (r)=>t().update(Kl(r)).digest(), n = t();
        return e.outputLen = n.outputLen, e.blockLen = n.blockLen, e.create = ()=>t(), e;
    }
    function iHe(t) {
        const e = (r, s)=>t(s).update(Kl(r)).digest(), n = t({});
        return e.outputLen = n.outputLen, e.blockLen = n.blockLen, e.create = (r)=>t(r), e;
    }
    function gP(t = 32) {
        if (Dp && typeof Dp.getRandomValues == "function") return Dp.getRandomValues(new Uint8Array(t));
        if (Dp && typeof Dp.randomBytes == "function") return Uint8Array.from(Dp.randomBytes(t));
        throw new Error("crypto.getRandomValues must be defined");
    }
    const oHe = Uint8Array.from([
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12,
        13,
        14,
        15,
        14,
        10,
        4,
        8,
        9,
        15,
        13,
        6,
        1,
        12,
        0,
        2,
        11,
        7,
        5,
        3,
        11,
        8,
        12,
        0,
        5,
        2,
        15,
        13,
        10,
        14,
        3,
        6,
        7,
        1,
        9,
        4,
        7,
        9,
        3,
        1,
        13,
        12,
        11,
        14,
        2,
        6,
        5,
        10,
        4,
        0,
        15,
        8,
        9,
        0,
        5,
        7,
        2,
        4,
        10,
        15,
        14,
        1,
        11,
        12,
        6,
        8,
        3,
        13,
        2,
        12,
        6,
        10,
        0,
        11,
        8,
        3,
        4,
        13,
        7,
        5,
        15,
        14,
        1,
        9,
        12,
        5,
        1,
        15,
        14,
        13,
        4,
        10,
        0,
        7,
        6,
        3,
        9,
        2,
        8,
        11,
        13,
        11,
        7,
        14,
        12,
        1,
        3,
        9,
        5,
        0,
        15,
        4,
        8,
        6,
        2,
        10,
        6,
        15,
        14,
        9,
        11,
        3,
        0,
        8,
        12,
        2,
        13,
        7,
        1,
        4,
        10,
        5,
        10,
        2,
        8,
        4,
        7,
        6,
        1,
        5,
        15,
        11,
        9,
        14,
        3,
        12,
        13,
        0,
        0,
        1,
        2,
        3,
        4,
        5,
        6,
        7,
        8,
        9,
        10,
        11,
        12,
        13,
        14,
        15,
        14,
        10,
        4,
        8,
        9,
        15,
        13,
        6,
        1,
        12,
        0,
        2,
        11,
        7,
        5,
        3,
        11,
        8,
        12,
        0,
        5,
        2,
        15,
        13,
        10,
        14,
        3,
        6,
        7,
        1,
        9,
        4,
        7,
        9,
        3,
        1,
        13,
        12,
        11,
        14,
        2,
        6,
        5,
        10,
        4,
        0,
        15,
        8,
        9,
        0,
        5,
        7,
        2,
        4,
        10,
        15,
        14,
        1,
        11,
        12,
        6,
        8,
        3,
        13,
        2,
        12,
        6,
        10,
        0,
        11,
        8,
        3,
        4,
        13,
        7,
        5,
        15,
        14,
        1,
        9
    ]);
    function aHe(t, e, n, r) {
        if (typeof t.setBigUint64 == "function") return t.setBigUint64(e, n, r);
        const s = BigInt(32), i = BigInt(4294967295), o = Number(n >> s & i), a = Number(n & i), c = r ? 4 : 0, l = r ? 0 : 4;
        t.setUint32(e + c, o, r), t.setUint32(e + l, a, r);
    }
    function cHe(t, e, n) {
        return t & e ^ ~t & n;
    }
    function lHe(t, e, n) {
        return t & e ^ t & n ^ e & n;
    }
    let DY = class extends b5 {
        constructor(e, n, r, s){
            super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = e, this.outputLen = n, this.padOffset = r, this.isLE = s, this.buffer = new Uint8Array(e), this.view = FS(this.buffer);
        }
        update(e) {
            Hd(this), e = Kl(e), Fc(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 = FS(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) {
            Hd(this), hP(e, this), this.finished = !0;
            const { buffer: n, view: r, blockLen: s, isLE: i } = this;
            let { pos: o } = this;
            n[o++] = 128, Ua(this.buffer.subarray(o)), this.padOffset > s - o && (this.process(r, 0), o = 0);
            for(let d = o; d < s; d++)n[d] = 0;
            aHe(r, s - 8, BigInt(this.length * 8), i), this.process(r, 0);
            const a = FS(e), c = this.outputLen;
            if (c % 4) throw new Error("_sha2: outputLen should 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 || (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 Vu = Uint32Array.from([
        1779033703,
        3144134277,
        1013904242,
        2773480762,
        1359893119,
        2600822924,
        528734635,
        1541459225
    ]), Js = Uint32Array.from([
        1779033703,
        4089235720,
        3144134277,
        2227873595,
        1013904242,
        4271175723,
        2773480762,
        1595750129,
        1359893119,
        2917565137,
        2600822924,
        725511199,
        528734635,
        4215389547,
        1541459225,
        327033209
    ]), s_ = BigInt(2 ** 32 - 1), JB = BigInt(32);
    function FY(t, e = !1) {
        return e ? {
            h: Number(t & s_),
            l: Number(t >> JB & s_)
        } : {
            h: Number(t >> JB & s_) | 0,
            l: Number(t & s_) | 0
        };
    }
    function LY(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 } = FY(t[i], e);
            [r[i], s[i]] = [
                o,
                a
            ];
        }
        return [
            r,
            s
        ];
    }
    const YB = (t, e, n)=>t >>> n, QB = (t, e, n)=>t << 32 - n | e >>> n, td = (t, e, n)=>t >>> n | e << 32 - n, nd = (t, e, n)=>t << 32 - n | e >>> n, _m = (t, e, n)=>t << 64 - n | e >>> n - 32, xm = (t, e, n)=>t >>> n - 32 | e << 64 - n, uHe = (t, e)=>e, dHe = (t, e)=>t, fHe = (t, e, n)=>t << n | e >>> 32 - n, hHe = (t, e, n)=>e << n | t >>> 32 - n, pHe = (t, e, n)=>e << n - 32 | t >>> 64 - n, gHe = (t, e, n)=>t << n - 32 | e >>> 64 - n;
    function Sa(t, e, n, r) {
        const s = (e >>> 0) + (r >>> 0);
        return {
            h: t + n + (s / 2 ** 32 | 0) | 0,
            l: s | 0
        };
    }
    const bP = (t, e, n)=>(t >>> 0) + (e >>> 0) + (n >>> 0), mP = (t, e, n, r)=>e + n + r + (t / 2 ** 32 | 0) | 0, bHe = (t, e, n, r)=>(t >>> 0) + (e >>> 0) + (n >>> 0) + (r >>> 0), mHe = (t, e, n, r, s)=>e + n + r + s + (t / 2 ** 32 | 0) | 0, yHe = (t, e, n, r, s)=>(t >>> 0) + (e >>> 0) + (n >>> 0) + (r >>> 0) + (s >>> 0), wHe = (t, e, n, r, s, i)=>e + n + r + s + i + (t / 2 ** 32 | 0) | 0, ms = Uint32Array.from([
        4089235720,
        1779033703,
        2227873595,
        3144134277,
        4271175723,
        1013904242,
        1595750129,
        2773480762,
        2917565137,
        1359893119,
        725511199,
        2600822924,
        4215389547,
        528734635,
        327033209,
        1541459225
    ]), rt = new Uint32Array(32);
    function Bu(t, e, n, r, s, i) {
        const o = s[i], a = s[i + 1];
        let c = rt[2 * t], l = rt[2 * t + 1], u = rt[2 * e], d = rt[2 * e + 1], f = rt[2 * n], p = rt[2 * n + 1], h = rt[2 * r], b = rt[2 * r + 1], y = bP(c, u, o);
        l = mP(y, l, d, a), c = y | 0, { Dh: b, Dl: h } = {
            Dh: b ^ l,
            Dl: h ^ c
        }, { Dh: b, Dl: h } = {
            Dh: uHe(b, h),
            Dl: dHe(b)
        }, { h: p, l: f } = Sa(p, f, b, h), { Bh: d, Bl: u } = {
            Bh: d ^ p,
            Bl: u ^ f
        }, { Bh: d, Bl: u } = {
            Bh: td(d, u, 24),
            Bl: nd(d, u, 24)
        }, rt[2 * t] = c, rt[2 * t + 1] = l, rt[2 * e] = u, rt[2 * e + 1] = d, rt[2 * n] = f, rt[2 * n + 1] = p, rt[2 * r] = h, rt[2 * r + 1] = b;
    }
    function Du(t, e, n, r, s, i) {
        const o = s[i], a = s[i + 1];
        let c = rt[2 * t], l = rt[2 * t + 1], u = rt[2 * e], d = rt[2 * e + 1], f = rt[2 * n], p = rt[2 * n + 1], h = rt[2 * r], b = rt[2 * r + 1], y = bP(c, u, o);
        l = mP(y, l, d, a), c = y | 0, { Dh: b, Dl: h } = {
            Dh: b ^ l,
            Dl: h ^ c
        }, { Dh: b, Dl: h } = {
            Dh: td(b, h, 16),
            Dl: nd(b, h, 16)
        }, { h: p, l: f } = Sa(p, f, b, h), { Bh: d, Bl: u } = {
            Bh: d ^ p,
            Bl: u ^ f
        }, { Bh: d, Bl: u } = {
            Bh: _m(d, u, 63),
            Bl: xm(d, u, 63)
        }, rt[2 * t] = c, rt[2 * t + 1] = l, rt[2 * e] = u, rt[2 * e + 1] = d, rt[2 * n] = f, rt[2 * n + 1] = p, rt[2 * r] = h, rt[2 * r + 1] = b;
    }
    function _He(t, e = {}, n, r, s) {
        if (Ud(n), t < 0 || t > n) throw new Error("outputLen bigger than keyLen");
        const { key: i, salt: o, personalization: a } = e;
        if (i !== void 0 && (i.length < 1 || i.length > n)) throw new Error("key length must be undefined or 1.." + n);
        if (o !== void 0 && o.length !== r) throw new Error("salt must be undefined or " + r);
        if (a !== void 0 && a.length !== s) throw new Error("personalization must be undefined or " + s);
    }
    class xHe extends b5 {
        constructor(e, n){
            super(), this.finished = !1, this.destroyed = !1, this.length = 0, this.pos = 0, Ud(e), Ud(n), this.blockLen = e, this.outputLen = n, this.buffer = new Uint8Array(e), this.buffer32 = jy(this.buffer);
        }
        update(e) {
            Hd(this), e = Kl(e), Fc(e);
            const { blockLen: n, buffer: r, buffer32: s } = this, i = e.length, o = e.byteOffset, a = e.buffer;
            for(let c = 0; c < i;){
                this.pos === n && (ed(s), this.compress(s, 0, !1), ed(s), this.pos = 0);
                const l = Math.min(n - this.pos, i - c), u = o + c;
                if (l === n && !(u % 4) && c + l < i) {
                    const d = new Uint32Array(a, u, Math.floor((i - c) / 4));
                    ed(d);
                    for(let f = 0; c + n < i; f += s.length, c += n)this.length += n, this.compress(d, f, !1);
                    ed(d);
                    continue;
                }
                r.set(e.subarray(c, c + l), this.pos), this.pos += l, this.length += l, c += l;
            }
            return this;
        }
        digestInto(e) {
            Hd(this), hP(e, this);
            const { pos: n, buffer32: r } = this;
            this.finished = !0, Ua(this.buffer.subarray(n)), ed(r), this.compress(r, 0, !0), ed(r);
            const s = jy(e);
            this.get().forEach((i, o)=>s[o] = pl(i));
        }
        digest() {
            const { buffer: e, outputLen: n } = this;
            this.digestInto(e);
            const r = e.slice(0, n);
            return this.destroy(), r;
        }
        _cloneInto(e) {
            const { buffer: n, length: r, finished: s, destroyed: i, outputLen: o, pos: a } = this;
            return e || (e = new this.constructor({
                dkLen: o
            })), e.set(...this.get()), e.buffer.set(n), e.destroyed = i, e.finished = s, e.length = r, e.pos = a, e.outputLen = o, e;
        }
        clone() {
            return this._cloneInto();
        }
    }
    class vHe extends xHe {
        constructor(e = {}){
            const n = e.dkLen === void 0 ? 64 : e.dkLen;
            super(128, n), this.v0l = ms[0] | 0, this.v0h = ms[1] | 0, this.v1l = ms[2] | 0, this.v1h = ms[3] | 0, this.v2l = ms[4] | 0, this.v2h = ms[5] | 0, this.v3l = ms[6] | 0, this.v3h = ms[7] | 0, this.v4l = ms[8] | 0, this.v4h = ms[9] | 0, this.v5l = ms[10] | 0, this.v5h = ms[11] | 0, this.v6l = ms[12] | 0, this.v6h = ms[13] | 0, this.v7l = ms[14] | 0, this.v7h = ms[15] | 0, _He(n, e, 64, 16, 16);
            let { key: r, personalization: s, salt: i } = e, o = 0;
            if (r !== void 0 && (r = Kl(r), o = r.length), this.v0l ^= this.outputLen | o << 8 | 65536 | 1 << 24, i !== void 0) {
                i = Kl(i);
                const a = jy(i);
                this.v4l ^= pl(a[0]), this.v4h ^= pl(a[1]), this.v5l ^= pl(a[2]), this.v5h ^= pl(a[3]);
            }
            if (s !== void 0) {
                s = Kl(s);
                const a = jy(s);
                this.v6l ^= pl(a[0]), this.v6h ^= pl(a[1]), this.v7l ^= pl(a[2]), this.v7h ^= pl(a[3]);
            }
            if (r !== void 0) {
                const a = new Uint8Array(this.blockLen);
                a.set(r), this.update(a);
            }
        }
        get() {
            let { v0l: e, v0h: n, v1l: r, v1h: s, v2l: i, v2h: o, v3l: a, v3h: c, v4l: l, v4h: u, v5l: d, v5h: f, v6l: p, v6h: h, v7l: b, v7h: y } = this;
            return [
                e,
                n,
                r,
                s,
                i,
                o,
                a,
                c,
                l,
                u,
                d,
                f,
                p,
                h,
                b,
                y
            ];
        }
        set(e, n, r, s, i, o, a, c, l, u, d, f, p, h, b, y) {
            this.v0l = e | 0, this.v0h = n | 0, this.v1l = r | 0, this.v1h = s | 0, this.v2l = i | 0, this.v2h = o | 0, this.v3l = a | 0, this.v3h = c | 0, this.v4l = l | 0, this.v4h = u | 0, this.v5l = d | 0, this.v5h = f | 0, this.v6l = p | 0, this.v6h = h | 0, this.v7l = b | 0, this.v7h = y | 0;
        }
        compress(e, n, r) {
            this.get().forEach((c, l)=>rt[l] = c), rt.set(ms, 16);
            let { h: s, l: i } = FY(BigInt(this.length));
            rt[24] = ms[8] ^ i, rt[25] = ms[9] ^ s, r && (rt[28] = ~rt[28], rt[29] = ~rt[29]);
            let o = 0;
            const a = oHe;
            for(let c = 0; c < 12; c++)Bu(0, 4, 8, 12, e, n + 2 * a[o++]), Du(0, 4, 8, 12, e, n + 2 * a[o++]), Bu(1, 5, 9, 13, e, n + 2 * a[o++]), Du(1, 5, 9, 13, e, n + 2 * a[o++]), Bu(2, 6, 10, 14, e, n + 2 * a[o++]), Du(2, 6, 10, 14, e, n + 2 * a[o++]), Bu(3, 7, 11, 15, e, n + 2 * a[o++]), Du(3, 7, 11, 15, e, n + 2 * a[o++]), Bu(0, 5, 10, 15, e, n + 2 * a[o++]), Du(0, 5, 10, 15, e, n + 2 * a[o++]), Bu(1, 6, 11, 12, e, n + 2 * a[o++]), Du(1, 6, 11, 12, e, n + 2 * a[o++]), Bu(2, 7, 8, 13, e, n + 2 * a[o++]), Du(2, 7, 8, 13, e, n + 2 * a[o++]), Bu(3, 4, 9, 14, e, n + 2 * a[o++]), Du(3, 4, 9, 14, e, n + 2 * a[o++]);
            this.v0l ^= rt[0] ^ rt[16], this.v0h ^= rt[1] ^ rt[17], this.v1l ^= rt[2] ^ rt[18], this.v1h ^= rt[3] ^ rt[19], this.v2l ^= rt[4] ^ rt[20], this.v2h ^= rt[5] ^ rt[21], this.v3l ^= rt[6] ^ rt[22], this.v3h ^= rt[7] ^ rt[23], this.v4l ^= rt[8] ^ rt[24], this.v4h ^= rt[9] ^ rt[25], this.v5l ^= rt[10] ^ rt[26], this.v5h ^= rt[11] ^ rt[27], this.v6l ^= rt[12] ^ rt[28], this.v6h ^= rt[13] ^ rt[29], this.v7l ^= rt[14] ^ rt[30], this.v7h ^= rt[15] ^ rt[31], Ua(rt);
        }
        destroy() {
            this.destroyed = !0, Ua(this.buffer32), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        }
    }
    const SHe = iHe((t)=>new vHe(t)), Ux = SHe;
    function kHe(t) {
        return (...e)=>nn(t(...e));
    }
    function THe(t, e) {
        return (n, r = 256, s)=>{
            const i = Ot(n);
            return !h5 || !s && cw() ? t[r](i) : e[r](i);
        };
    }
    function Wl(t, e = 256, n, r) {
        const s = Math.ceil(e / 8), i = Ot(t);
        return !h5 || !r && cw() ? BUe(i, Ot(n), s) : n ? Ux(i, {
            dkLen: s,
            key: n
        }) : Ux(i, {
            dkLen: s
        });
    }
    const vm = kHe(Wl), EHe = za("SS58PRE");
    function zY(t) {
        return Wl(Ii(EHe, t), 512);
    }
    function CHe(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 = zY(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 IHe = [
        {
            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/"
        }
    ], AHe = {
        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"
        ]
    }, PHe = {
        centrifuge: "polkadot",
        kusama: "polkadot",
        polkadot: "polkadot",
        sora: "polkadot",
        statemine: "polkadot",
        statemint: "polkadot",
        westmint: "polkadot"
    }, OHe = {
        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
    }, MHe = {
        "": !0,
        "cess-testnet": !0,
        "dock-testnet": !0,
        jupiter: !0,
        "mathchain-testnet": !0,
        p3dt: !0,
        subspace_testnet: !0,
        "zero-alphaville": !0
    }, eD = [
        0,
        2,
        42
    ], RHe = [
        "testnet"
    ];
    function NHe(t) {
        const e = t.network || "", n = e.replace(/_/g, "-").split("-"), r = t;
        return r.slip44 = OHe[e], r.hasLedgerSupport = !!r.slip44, r.genesisHash = AHe[e] || [], r.icon = PHe[e] || "substrate", r.isTestnet = !!MHe[e] || RHe.includes(n[n.length - 1]), r.isIgnored = r.isTestnet || !(t.standardAccount && t.decimals?.length && t.symbols?.length) && t.prefix !== 42, r;
    }
    function VHe({ genesisHash: t, prefix: e }) {
        return !!t.length || e === 42;
    }
    function BHe(t) {
        return !t.isIgnored && !!t.network;
    }
    function DHe(t, e) {
        const n = eD.includes(t.prefix), r = eD.includes(e.prefix);
        return n === r ? n ? 0 : t.displayName.localeCompare(e.displayName) : n ? -1 : 1;
    }
    const FHe = IHe.map(NHe), UY = FHe.filter(BHe).sort(DHe), LHe = UY.filter(VHe), c2 = {
        allowedDecodedLengths: [
            1,
            2,
            4,
            8,
            32,
            33
        ],
        allowedEncodedLengths: [
            3,
            4,
            6,
            10,
            35,
            36,
            37,
            38
        ],
        allowedPrefix: UY.map(({ prefix: t })=>t),
        prefix: 42
    };
    function rf(t, e, n = -1) {
        if (!t) throw new Error("Invalid empty address passed");
        if (Rt(t) || Nn(t)) return Ot(t);
        try {
            const r = eHe(t);
            if (!c2.allowedEncodedLengths.includes(r.length)) throw new Error("Invalid decoded address length");
            const [s, i, o, a] = CHe(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 tD = {
        bitLength: 256,
        isLe: !1
    }, zHe = 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
    ]), Fu = new Uint32Array(64);
    let UHe = class extends DY {
        constructor(e = 32){
            super(64, e, 8, !1), this.A = Vu[0] | 0, this.B = Vu[1] | 0, this.C = Vu[2] | 0, this.D = Vu[3] | 0, this.E = Vu[4] | 0, this.F = Vu[5] | 0, this.G = Vu[6] | 0, this.H = Vu[7] | 0;
        }
        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)Fu[d] = e.getUint32(n, !1);
            for(let d = 16; d < 64; d++){
                const f = Fu[d - 15], p = Fu[d - 2], h = rc(f, 7) ^ rc(f, 18) ^ f >>> 3, b = rc(p, 17) ^ rc(p, 19) ^ p >>> 10;
                Fu[d] = b + Fu[d - 7] + h + Fu[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 = rc(a, 6) ^ rc(a, 11) ^ rc(a, 25), p = u + f + cHe(a, c, l) + zHe[d] + Fu[d] | 0, b = (rc(r, 2) ^ rc(r, 13) ^ rc(r, 22)) + lHe(r, s, i) | 0;
                u = l, l = c, c = a, a = o + p | 0, o = i, i = s, s = r, r = p + b | 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() {
            Ua(Fu);
        }
        destroy() {
            this.set(0, 0, 0, 0, 0, 0, 0, 0), Ua(this.buffer);
        }
    };
    const HY = LY([
        "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))), HHe = HY[0], jHe = HY[1], Lu = new Uint32Array(80), zu = new Uint32Array(80);
    let qHe = class extends DY {
        constructor(e = 64){
            super(128, e, 16, !1), this.Ah = Js[0] | 0, this.Al = Js[1] | 0, this.Bh = Js[2] | 0, this.Bl = Js[3] | 0, this.Ch = Js[4] | 0, this.Cl = Js[5] | 0, this.Dh = Js[6] | 0, this.Dl = Js[7] | 0, this.Eh = Js[8] | 0, this.El = Js[9] | 0, this.Fh = Js[10] | 0, this.Fl = Js[11] | 0, this.Gh = Js[12] | 0, this.Gl = Js[13] | 0, this.Hh = Js[14] | 0, this.Hl = Js[15] | 0;
        }
        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: b, Hl: y } = this;
            return [
                e,
                n,
                r,
                s,
                i,
                o,
                a,
                c,
                l,
                u,
                d,
                f,
                p,
                h,
                b,
                y
            ];
        }
        set(e, n, r, s, i, o, a, c, l, u, d, f, p, h, b, y) {
            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 = b | 0, this.Hl = y | 0;
        }
        process(e, n) {
            for(let w = 0; w < 16; w++, n += 4)Lu[w] = e.getUint32(n), zu[w] = e.getUint32(n += 4);
            for(let w = 16; w < 80; w++){
                const E = Lu[w - 15] | 0, I = zu[w - 15] | 0, D = td(E, I, 1) ^ td(E, I, 8) ^ YB(E, I, 7), U = nd(E, I, 1) ^ nd(E, I, 8) ^ QB(E, I, 7), K = Lu[w - 2] | 0, $ = zu[w - 2] | 0, ne = td(K, $, 19) ^ _m(K, $, 61) ^ YB(K, $, 6), te = nd(K, $, 19) ^ xm(K, $, 61) ^ QB(K, $, 6), J = bHe(U, te, zu[w - 7], zu[w - 16]), C = mHe(J, D, ne, Lu[w - 7], Lu[w - 16]);
                Lu[w] = C | 0, zu[w] = J | 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: b, Gl: y, Hh: _, Hl: v } = this;
            for(let w = 0; w < 80; w++){
                const E = td(d, f, 14) ^ td(d, f, 18) ^ _m(d, f, 41), I = nd(d, f, 14) ^ nd(d, f, 18) ^ xm(d, f, 41), D = d & p ^ ~d & b, U = f & h ^ ~f & y, K = yHe(v, I, U, jHe[w], zu[w]), $ = wHe(K, _, E, D, HHe[w], Lu[w]), ne = K | 0, te = td(r, s, 28) ^ _m(r, s, 34) ^ _m(r, s, 39), J = nd(r, s, 28) ^ xm(r, s, 34) ^ xm(r, s, 39), C = r & i ^ r & a ^ i & a, g = s & o ^ s & c ^ o & c;
                _ = b | 0, v = y | 0, b = p | 0, y = h | 0, p = d | 0, h = f | 0, { h: d, l: f } = Sa(l | 0, u | 0, $ | 0, ne | 0), l = a | 0, u = c | 0, a = i | 0, c = o | 0, i = r | 0, o = s | 0;
                const x = bP(ne, J, g);
                r = mP(x, $, te, C), s = x | 0;
            }
            ({ h: r, l: s } = Sa(this.Ah | 0, this.Al | 0, r | 0, s | 0)), { h: i, l: o } = Sa(this.Bh | 0, this.Bl | 0, i | 0, o | 0), { h: a, l: c } = Sa(this.Ch | 0, this.Cl | 0, a | 0, c | 0), { h: l, l: u } = Sa(this.Dh | 0, this.Dl | 0, l | 0, u | 0), { h: d, l: f } = Sa(this.Eh | 0, this.El | 0, d | 0, f | 0), { h: p, l: h } = Sa(this.Fh | 0, this.Fl | 0, p | 0, h | 0), { h: b, l: y } = Sa(this.Gh | 0, this.Gl | 0, b | 0, y | 0), { h: _, l: v } = Sa(this.Hh | 0, this.Hl | 0, _ | 0, v | 0), this.set(r, s, i, o, a, c, l, u, d, f, p, h, b, y, _, v);
        }
        roundClean() {
            Ua(Lu, zu);
        }
        destroy() {
            Ua(this.buffer), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        }
    };
    const KHe = pP(()=>new UHe), jY = pP(()=>new qHe);
    let qY = class extends b5 {
        constructor(e, n){
            super(), this.finished = !1, this.destroyed = !1, RY(e);
            const r = Kl(n);
            if (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 s = this.blockLen, i = new Uint8Array(s);
            i.set(r.length > s ? e.create().update(r).digest() : r);
            for(let o = 0; o < i.length; o++)i[o] ^= 54;
            this.iHash.update(i), this.oHash = e.create();
            for(let o = 0; o < i.length; o++)i[o] ^= 106;
            this.oHash.update(i), Ua(i);
        }
        update(e) {
            return Hd(this), this.iHash.update(e), this;
        }
        digestInto(e) {
            Hd(this), Fc(e, this.outputLen), 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 || (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 Hx = (t, e, n)=>new qY(t, e).update(n).digest();
    Hx.create = (t, e)=>new qY(t, e);
    const yP = BigInt(0), xT = BigInt(1);
    function qh(t, e = "") {
        if (typeof t != "boolean") {
            const n = e && `"${e}"`;
            throw new Error(n + "expected boolean, got type=" + typeof t);
        }
        return t;
    }
    function Oa(t, e, n = "") {
        const r = lw(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 i_(t) {
        const e = t.toString(16);
        return e.length & 1 ? "0" + e : e;
    }
    function KY(t) {
        if (typeof t != "string") throw new Error("hex string expected, got " + typeof t);
        return t === "" ? yP : BigInt("0x" + t);
    }
    function m5(t) {
        return KY(ph(t));
    }
    function qy(t) {
        return Fc(t), KY(ph(Uint8Array.from(t).reverse()));
    }
    function wP(t, e) {
        return zx(t.toString(16).padStart(e * 2, "0"));
    }
    function WY(t, e) {
        return wP(t, e).reverse();
    }
    function Fr(t, e, n) {
        let r;
        if (typeof e == "string") try {
            r = zx(e);
        } catch (i) {
            throw new Error(t + " must be hex string or Uint8Array, cause: " + i);
        }
        else if (lw(e)) r = Uint8Array.from(e);
        else throw new Error(t + " must be hex string or Uint8Array");
        const s = r.length;
        if (typeof n == "number" && s !== n) throw new Error(t + " of length " + n + " expected, got " + s);
        return r;
    }
    function nD(t) {
        return Uint8Array.from(t);
    }
    const LS = (t)=>typeof t == "bigint" && yP <= t;
    function WHe(t, e, n) {
        return LS(t) && LS(e) && LS(n) && e <= t && t < n;
    }
    function vT(t, e, n, r) {
        if (!WHe(e, n, r)) throw new Error("expected valid " + t + ": " + n + " <= n < " + r + ", got " + e);
    }
    function $Y(t) {
        let e;
        for(e = 0; t > yP; t >>= xT, e += 1);
        return e;
    }
    const uw = (t)=>(xT << BigInt(t)) - xT;
    function $He(t, e, n) {
        if (typeof t != "number" || t < 2) throw new Error("hashLen must be a number");
        if (typeof e != "number" || e < 2) throw new Error("qByteLen must be a number");
        if (typeof n != "function") throw new Error("hmacFn must be a function");
        const r = (p)=>new Uint8Array(p), s = (p)=>Uint8Array.of(p);
        let i = r(t), o = r(t), a = 0;
        const c = ()=>{
            i.fill(1), o.fill(0), a = 0;
        }, l = (...p)=>n(o, i, ...p), u = (p = r(0))=>{
            o = l(s(0), p), i = l(), p.length !== 0 && (o = l(s(1), p), i = l());
        }, d = ()=>{
            if (a++ >= 1e3) throw new Error("drbg: tried 1000 values");
            let p = 0;
            const h = [];
            for(; p < e;){
                i = l();
                const b = i.slice();
                h.push(b), p += i.length;
            }
            return xc(...h);
        };
        return (p, h)=>{
            c(), u(p);
            let b;
            for(; !(b = h(d()));)u();
            return c(), b;
        };
    }
    function dw(t, e, n = {}) {
        if (!t || typeof t != "object") throw new Error("expected valid options object");
        function r(s, i, o) {
            const a = t[s];
            if (o && a === void 0) return;
            const c = typeof a;
            if (c !== i || a === null) throw new Error(`param "${s}" is invalid: expected ${i}, got ${c}`);
        }
        Object.entries(e).forEach(([s, i])=>r(s, i, !1)), Object.entries(n).forEach(([s, i])=>r(s, i, !0));
    }
    function jx(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 Wi = BigInt(0), $s = BigInt(1), Kf = BigInt(2), XY = BigInt(3), GY = BigInt(4), ZY = BigInt(5), XHe = BigInt(7), JY = BigInt(8), GHe = BigInt(9), YY = BigInt(16);
    function ts(t, e) {
        const n = t % e;
        return n >= Wi ? n : e + n;
    }
    function Br(t, e, n) {
        let r = t;
        for(; e-- > Wi;)r *= r, r %= n;
        return r;
    }
    function rD(t, e) {
        if (t === Wi) throw new Error("invert: expected non-zero number");
        if (e <= Wi) throw new Error("invert: expected positive modulus, got " + e);
        let n = ts(t, e), r = e, s = Wi, i = $s;
        for(; n !== Wi;){
            const a = r / n, c = r % n, l = s - i * a;
            r = n, n = c, s = i, i = l;
        }
        if (r !== $s) throw new Error("invert: does not exist");
        return ts(s, e);
    }
    function _P(t, e, n) {
        if (!t.eql(t.sqr(e), n)) throw new Error("Cannot find square root");
    }
    function QY(t, e) {
        const n = (t.ORDER + $s) / GY, r = t.pow(e, n);
        return _P(t, r, e), r;
    }
    function ZHe(t, e) {
        const n = (t.ORDER - ZY) / JY, r = t.mul(e, Kf), s = t.pow(r, n), i = t.mul(e, s), o = t.mul(t.mul(i, Kf), s), a = t.mul(i, t.sub(o, t.ONE));
        return _P(t, a, e), a;
    }
    function JHe(t) {
        const e = mp(t), n = eQ(t), r = n(e, e.neg(e.ONE)), s = n(e, r), i = n(e, e.neg(r)), o = (t + XHe) / YY;
        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 b = a.eql(a.sqr(u), c), y = a.cmov(l, u, b);
            return _P(a, y, c), y;
        };
    }
    function eQ(t) {
        if (t < XY) throw new Error("sqrt is not defined for small field");
        let e = t - $s, n = 0;
        for(; e % Kf === Wi;)e /= Kf, n++;
        let r = Kf;
        const s = mp(t);
        for(; sD(s, r) === 1;)if (r++ > 1e3) throw new Error("Cannot find square root: probably non-prime P");
        if (n === 1) return QY;
        let i = s.pow(r, e);
        const o = (e + $s) / Kf;
        return function(c, l) {
            if (c.is0(l)) return l;
            if (sD(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, b = c.sqr(f);
                for(; !c.eql(b, c.ONE);)if (h++, b = c.sqr(b), h === u) throw new Error("Cannot find square root");
                const y = $s << BigInt(u - h - 1), _ = c.pow(d, y);
                u = h, d = c.sqr(_), f = c.mul(f, d), p = c.mul(p, _);
            }
            return p;
        };
    }
    function YHe(t) {
        return t % GY === XY ? QY : t % JY === ZY ? ZHe : t % YY === GHe ? JHe(t) : eQ(t);
    }
    const QHe = (t, e)=>(ts(t, e) & $s) === $s, eje = [
        "create",
        "isValid",
        "is0",
        "neg",
        "inv",
        "sqrt",
        "sqr",
        "eql",
        "add",
        "sub",
        "mul",
        "pow",
        "div",
        "addN",
        "subN",
        "mulN",
        "sqrN"
    ];
    function tje(t) {
        const e = {
            ORDER: "bigint",
            MASK: "bigint",
            BYTES: "number",
            BITS: "number"
        }, n = eje.reduce((r, s)=>(r[s] = "function", r), e);
        return dw(t, n), t;
    }
    function nje(t, e, n) {
        if (n < Wi) throw new Error("invalid exponent, negatives unsupported");
        if (n === Wi) return t.ONE;
        if (n === $s) return e;
        let r = t.ONE, s = e;
        for(; n > Wi;)n & $s && (r = t.mul(r, s)), s = t.sqr(s), n >>= $s;
        return r;
    }
    function tQ(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 sD(t, e) {
        const n = (t.ORDER - $s) / Kf, 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 nQ(t, e) {
        e !== void 0 && Ud(e);
        const n = e !== void 0 ? e : t.toString(2).length, r = Math.ceil(n / 8);
        return {
            nBitLength: n,
            nByteLength: r
        };
    }
    function mp(t, e, n = !1, r = {}) {
        if (t <= Wi) throw new Error("invalid field: expected ORDER > 0, got " + t);
        let s, i, o = !1, a;
        if (typeof e == "object" && e != null) {
            if (r.sqrt || n) throw new Error("cannot specify opts in two arguments");
            const f = e;
            f.BITS && (s = f.BITS), f.sqrt && (i = f.sqrt), typeof f.isLE == "boolean" && (n = f.isLE), typeof f.modFromBytes == "boolean" && (o = f.modFromBytes), a = f.allowedLengths;
        } else typeof e == "number" && (s = e), r.sqrt && (i = r.sqrt);
        const { nBitLength: c, nByteLength: l } = nQ(t, s);
        if (l > 2048) throw new Error("invalid field: expected ORDER of <= 2048 bytes");
        let u;
        const d = Object.freeze({
            ORDER: t,
            isLE: n,
            BITS: c,
            BYTES: l,
            MASK: uw(c),
            ZERO: Wi,
            ONE: $s,
            allowedLengths: a,
            create: (f)=>ts(f, t),
            isValid: (f)=>{
                if (typeof f != "bigint") throw new Error("invalid field element: expected bigint, got " + typeof f);
                return Wi <= f && f < t;
            },
            is0: (f)=>f === Wi,
            isValidNot0: (f)=>!d.is0(f) && d.isValid(f),
            isOdd: (f)=>(f & $s) === $s,
            neg: (f)=>ts(-f, t),
            eql: (f, p)=>f === p,
            sqr: (f)=>ts(f * f, t),
            add: (f, p)=>ts(f + p, t),
            sub: (f, p)=>ts(f - p, t),
            mul: (f, p)=>ts(f * p, t),
            pow: (f, p)=>nje(d, f, p),
            div: (f, p)=>ts(f * rD(p, t), t),
            sqrN: (f)=>f * f,
            addN: (f, p)=>f + p,
            subN: (f, p)=>f - p,
            mulN: (f, p)=>f * p,
            inv: (f)=>rD(f, t),
            sqrt: i || ((f)=>(u || (u = YHe(t)), u(d, f))),
            toBytes: (f)=>n ? WY(f, l) : wP(f, l),
            fromBytes: (f, p = !0)=>{
                if (a) {
                    if (!a.includes(f.length) || f.length > l) throw new Error("Field.fromBytes: expected " + a + " bytes, got " + f.length);
                    const b = new Uint8Array(l);
                    b.set(f, n ? 0 : b.length - f.length), f = b;
                }
                if (f.length !== l) throw new Error("Field.fromBytes: expected " + l + " bytes, got " + f.length);
                let h = n ? qy(f) : m5(f);
                if (o && (h = ts(h, t)), !p && !d.isValid(h)) throw new Error("invalid field element: outside of range 0..ORDER");
                return h;
            },
            invertBatch: (f)=>tQ(d, f),
            cmov: (f, p, h)=>h ? p : f
        });
        return Object.freeze(d);
    }
    function rQ(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 sQ(t) {
        const e = rQ(t);
        return e + Math.ceil(e / 2);
    }
    function rje(t, e, n = !1) {
        const r = t.length, s = rQ(e), i = sQ(e);
        if (r < 16 || r < i || r > 1024) throw new Error("expected " + i + "-1024 bytes of input, got " + r);
        const o = n ? qy(t) : m5(t), a = ts(o, e - $s) + $s;
        return n ? WY(a, s) : wP(a, s);
    }
    const _g = BigInt(0), Wf = BigInt(1);
    function qx(t, e) {
        const n = e.negate();
        return t ? n : e;
    }
    function $f(t, e) {
        const n = tQ(t.Fp, e.map((r)=>r.Z));
        return e.map((r, s)=>t.fromAffine(r.toAffine(n[s])));
    }
    function iQ(t, e) {
        if (!Number.isSafeInteger(t) || t <= 0 || t > e) throw new Error("invalid window size, expected [1.." + e + "], got W=" + t);
    }
    function zS(t, e) {
        iQ(t, e);
        const n = Math.ceil(e / t) + 1, r = 2 ** (t - 1), s = 2 ** t, i = uw(t), o = BigInt(t);
        return {
            windows: n,
            windowSize: r,
            mask: i,
            maxNumber: s,
            shiftBy: o
        };
    }
    function iD(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 += Wf);
        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
        };
    }
    function sje(t, e) {
        if (!Array.isArray(t)) throw new Error("array expected");
        t.forEach((n, r)=>{
            if (!(n instanceof e)) throw new Error("invalid point at index " + r);
        });
    }
    function ije(t, e) {
        if (!Array.isArray(t)) throw new Error("array of scalars expected");
        t.forEach((n, r)=>{
            if (!e.isValid(n)) throw new Error("invalid scalar at index " + r);
        });
    }
    const US = new WeakMap, oQ = new WeakMap;
    function HS(t) {
        return oQ.get(t) || 1;
    }
    function oD(t) {
        if (t !== _g) throw new Error("invalid wNAF");
    }
    class aQ {
        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 > _g;)n & Wf && (r = r.add(s)), s = s.double(), n >>= Wf;
            return r;
        }
        precomputeWindow(e, n) {
            const { windows: r, windowSize: s } = zS(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 = zS(e, this.bits);
            for(let a = 0; a < o.windows; a++){
                const { nextN: c, offset: l, isZero: u, isNeg: d, isNegF: f, offsetF: p } = iD(r, a, o);
                r = c, u ? i = i.add(qx(f, n[p])) : s = s.add(qx(d, n[l]));
            }
            return oD(r), {
                p: s,
                f: i
            };
        }
        wNAFUnsafe(e, n, r, s = this.ZERO) {
            const i = zS(e, this.bits);
            for(let o = 0; o < i.windows && r !== _g; o++){
                const { nextN: a, offset: c, isZero: l, isNeg: u } = iD(r, o, i);
                if (r = a, !l) {
                    const d = n[c];
                    s = s.add(u ? d.negate() : d);
                }
            }
            return oD(r), s;
        }
        getPrecomputes(e, n, r) {
            let s = US.get(n);
            return s || (s = this.precomputeWindow(n, e), e !== 1 && (typeof r == "function" && (s = r(s)), US.set(n, s))), s;
        }
        cached(e, n, r) {
            const s = HS(e);
            return this.wNAF(s, this.getPrecomputes(s, e, r), n);
        }
        unsafe(e, n, r, s) {
            const i = HS(e);
            return i === 1 ? this._unsafeLadder(e, n, s) : this.wNAFUnsafe(i, this.getPrecomputes(i, e, r), n, s);
        }
        createCache(e, n) {
            iQ(n, this.bits), oQ.set(e, n), US.delete(e);
        }
        hasCache(e) {
            return HS(e) !== 1;
        }
    }
    function oje(t, e, n, r) {
        let s = e, i = t.ZERO, o = t.ZERO;
        for(; n > _g || r > _g;)n & Wf && (i = i.add(s)), r & Wf && (o = o.add(s)), s = s.double(), n >>= Wf, r >>= Wf;
        return {
            p1: i,
            p2: o
        };
    }
    function cQ(t, e, n, r) {
        sje(n, t), ije(r, e);
        const s = n.length, i = r.length;
        if (s !== i) throw new Error("arrays of points and scalars must have equal length");
        const o = t.ZERO, a = $Y(BigInt(s));
        let c = 1;
        a > 12 ? c = a - 3 : a > 4 ? c = a - 2 : a > 0 && (c = 2);
        const l = uw(c), u = new Array(Number(l) + 1).fill(o), d = Math.floor((e.BITS - 1) / c) * c;
        let f = o;
        for(let p = d; p >= 0; p -= c){
            u.fill(o);
            for(let b = 0; b < i; b++){
                const y = r[b], _ = Number(y >> BigInt(p) & l);
                u[_] = u[_].add(n[b]);
            }
            let h = o;
            for(let b = u.length - 1, y = o; b > 0; b--)y = y.add(u[b]), h = h.add(y);
            if (f = f.add(h), p !== 0) for(let b = 0; b < c; b++)f = f.double();
        }
        return f;
    }
    function aD(t, e, n) {
        if (e) {
            if (e.ORDER !== t) throw new Error("Field.ORDER must match order: Fp == p, Fn == n");
            return tje(e), e;
        } else return mp(t, {
            isLE: n
        });
    }
    function lQ(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 > _g)) throw new Error(`CURVE.${c} must be positive bigint`);
        }
        const s = aD(e.p, n.Fp, r), i = aD(e.n, n.Fn, r), a = [
            "Gx",
            "Gy",
            "a",
            t === "weierstrass" ? "b" : "d"
        ];
        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
        };
    }
    const cD = (t, e)=>(t + (t >= 0 ? e : -e) / uQ) / e;
    function aje(t, e, n) {
        const [[r, s], [i, o]] = e, a = cD(o * t, n), c = cD(-s * t, n);
        let l = t - a * r - c * i, u = -a * s - c * o;
        const d = l < Rl, f = u < Rl;
        d && (l = -l), f && (u = -u);
        const p = uw(Math.ceil($Y(n) / 2)) + h0;
        if (l < Rl || l >= p || u < Rl || u >= p) throw new Error("splitScalar (endomorphism): failed, k=" + t);
        return {
            k1neg: d,
            k1: l,
            k2neg: f,
            k2: u
        };
    }
    function ST(t) {
        if (![
            "compact",
            "recovered",
            "der"
        ].includes(t)) throw new Error('Signature format must be "compact", "recovered", or "der"');
        return t;
    }
    function jS(t, e) {
        const n = {};
        for (let r of Object.keys(e))n[r] = t[r] === void 0 ? e[r] : t[r];
        return qh(n.lowS, "lowS"), qh(n.prehash, "prehash"), n.format !== void 0 && ST(n.format), n;
    }
    class cje extends Error {
        constructor(e = ""){
            super(e);
        }
    }
    const vl = {
        Err: cje,
        _tlv: {
            encode: (t, e)=>{
                const { Err: n } = vl;
                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 = i_(r);
                if (s.length / 2 & 128) throw new n("tlv.encode: long form length too big");
                const i = r > 127 ? i_(s.length / 2 | 128) : "";
                return i_(t) + i + s + e;
            },
            decode (t, e) {
                const { Err: n } = vl;
                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 } = vl;
                if (t < Rl) throw new e("integer: negative integers are not allowed");
                let n = i_(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 } = vl;
                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 m5(t);
            }
        },
        toSig (t) {
            const { Err: e, _int: n, _tlv: r } = vl, s = Fr("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 } = vl, r = e.encode(2, n.encode(t.r)), s = e.encode(2, n.encode(t.s)), i = r + s;
            return e.encode(48, i);
        }
    }, Rl = BigInt(0), h0 = BigInt(1), uQ = BigInt(2), o_ = BigInt(3), lje = BigInt(4);
    function Yp(t, e) {
        const { BYTES: n } = t;
        let r;
        if (typeof e == "bigint") r = e;
        else {
            let s = Fr("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 uje(t, e = {}) {
        const n = lQ("weierstrass", t, e), { Fp: r, Fn: s } = n;
        let i = n.CURVE;
        const { h: o, n: a } = i;
        dw(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 = fQ(r, s);
        function u() {
            if (!r.isOdd) throw new Error("compression is not supported: Field does not have .isOdd()");
        }
        function d(J, C, g) {
            const { x, y: A } = C.toAffine(), R = r.toBytes(x);
            if (qh(g, "isCompressed"), g) {
                u();
                const N = !r.isOdd(A);
                return xc(dQ(N), R);
            } else return xc(Uint8Array.of(4), R, r.toBytes(A));
        }
        function f(J) {
            Oa(J, void 0, "Point");
            const { publicKey: C, publicKeyUncompressed: g } = l, x = J.length, A = J[0], R = J.subarray(1);
            if (x === C && (A === 2 || A === 3)) {
                const N = r.fromBytes(R);
                if (!r.isValid(N)) throw new Error("bad point: is not on curve, wrong x");
                const L = b(N);
                let z;
                try {
                    z = r.sqrt(L);
                } catch (O) {
                    const W = O instanceof Error ? ": " + O.message : "";
                    throw new Error("bad point: is not on curve, sqrt error" + W);
                }
                u();
                const B = r.isOdd(z);
                return (A & 1) === 1 !== B && (z = r.neg(z)), {
                    x: N,
                    y: z
                };
            } else if (x === g && A === 4) {
                const N = r.BYTES, L = r.fromBytes(R.subarray(0, N)), z = r.fromBytes(R.subarray(N, N * 2));
                if (!y(L, z)) throw new Error("bad point: is not on curve");
                return {
                    x: L,
                    y: z
                };
            } else throw new Error(`bad point: got length ${x}, expected compressed=${C} or uncompressed=${g}`);
        }
        const p = e.toBytes || d, h = e.fromBytes || f;
        function b(J) {
            const C = r.sqr(J), g = r.mul(C, J);
            return r.add(r.add(g, r.mul(J, i.a)), i.b);
        }
        function y(J, C) {
            const g = r.sqr(C), x = b(J);
            return r.eql(g, x);
        }
        if (!y(i.Gx, i.Gy)) throw new Error("bad curve params: generator point");
        const _ = r.mul(r.pow(i.a, o_), lje), v = r.mul(r.sqr(i.b), BigInt(27));
        if (r.is0(r.add(_, v))) throw new Error("bad curve params: a or b");
        function w(J, C, g = !1) {
            if (!r.isValid(C) || g && r.is0(C)) throw new Error(`bad point coordinate ${J}`);
            return C;
        }
        function E(J) {
            if (!(J instanceof $)) throw new Error("ProjectivePoint expected");
        }
        function I(J) {
            if (!c || !c.basises) throw new Error("no endo");
            return aje(J, c.basises, s.ORDER);
        }
        const D = jx((J, C)=>{
            const { X: g, Y: x, Z: A } = J;
            if (r.eql(A, r.ONE)) return {
                x: g,
                y: x
            };
            const R = J.is0();
            C == null && (C = R ? r.ONE : r.inv(A));
            const N = r.mul(g, C), L = r.mul(x, C), z = r.mul(A, C);
            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
            };
        }), U = jx((J)=>{
            if (J.is0()) {
                if (e.allowInfinityPoint && !r.is0(J.Y)) return;
                throw new Error("bad point: ZERO");
            }
            const { x: C, y: g } = J.toAffine();
            if (!r.isValid(C) || !r.isValid(g)) throw new Error("bad point: x or y not field elements");
            if (!y(C, g)) throw new Error("bad point: equation left != right");
            if (!J.isTorsionFree()) throw new Error("bad point: not in prime-order subgroup");
            return !0;
        });
        function K(J, C, g, x, A) {
            return g = new $(r.mul(g.X, J), g.Y, g.Z), C = qx(x, C), g = qx(A, g), C.add(g);
        }
        class $ {
            constructor(C, g, x){
                this.X = w("x", C), this.Y = w("y", g, !0), this.Z = w("z", x), Object.freeze(this);
            }
            static CURVE() {
                return i;
            }
            static fromAffine(C) {
                const { x: g, y: x } = C || {};
                if (!C || !r.isValid(g) || !r.isValid(x)) throw new Error("invalid affine point");
                if (C instanceof $) throw new Error("projective point not allowed");
                return r.is0(g) && r.is0(x) ? $.ZERO : new $(g, x, r.ONE);
            }
            static fromBytes(C) {
                const g = $.fromAffine(h(Oa(C, void 0, "point")));
                return g.assertValidity(), g;
            }
            static fromHex(C) {
                return $.fromBytes(Fr("pointHex", C));
            }
            get x() {
                return this.toAffine().x;
            }
            get y() {
                return this.toAffine().y;
            }
            precompute(C = 8, g = !0) {
                return te.createCache(this, C), g || this.multiply(o_), this;
            }
            assertValidity() {
                U(this);
            }
            hasEvenY() {
                const { y: C } = this.toAffine();
                if (!r.isOdd) throw new Error("Field doesn't support isOdd");
                return !r.isOdd(C);
            }
            equals(C) {
                E(C);
                const { X: g, Y: x, Z: A } = this, { X: R, Y: N, Z: L } = C, z = r.eql(r.mul(g, L), r.mul(R, A)), B = r.eql(r.mul(x, L), r.mul(N, A));
                return z && B;
            }
            negate() {
                return new $(this.X, r.neg(this.Y), this.Z);
            }
            double() {
                const { a: C, b: g } = i, x = r.mul(g, o_), { X: A, Y: R, Z: N } = this;
                let L = r.ZERO, z = r.ZERO, B = r.ZERO, S = r.mul(A, A), O = r.mul(R, R), W = r.mul(N, N), F = r.mul(A, R);
                return F = r.add(F, F), B = r.mul(A, N), B = r.add(B, B), L = r.mul(C, B), z = r.mul(x, W), z = r.add(L, z), L = r.sub(O, z), z = r.add(O, z), z = r.mul(L, z), L = r.mul(F, L), B = r.mul(x, B), W = r.mul(C, W), F = r.sub(S, W), F = r.mul(C, F), F = r.add(F, B), B = r.add(S, S), S = r.add(B, S), S = r.add(S, W), S = r.mul(S, F), z = r.add(z, S), W = r.mul(R, N), W = r.add(W, W), S = r.mul(W, F), L = r.sub(L, S), B = r.mul(W, O), B = r.add(B, B), B = r.add(B, B), new $(L, z, B);
            }
            add(C) {
                E(C);
                const { X: g, Y: x, Z: A } = this, { X: R, Y: N, Z: L } = C;
                let z = r.ZERO, B = r.ZERO, S = r.ZERO;
                const O = i.a, W = r.mul(i.b, o_);
                let F = r.mul(g, R), G = r.mul(x, N), ee = r.mul(A, L), Q = r.add(g, x), Y = r.add(R, N);
                Q = r.mul(Q, Y), Y = r.add(F, G), Q = r.sub(Q, Y), Y = r.add(g, A);
                let ae = r.add(R, L);
                return Y = r.mul(Y, ae), ae = r.add(F, ee), Y = r.sub(Y, ae), ae = r.add(x, A), z = r.add(N, L), ae = r.mul(ae, z), z = r.add(G, ee), ae = r.sub(ae, z), S = r.mul(O, Y), z = r.mul(W, ee), S = r.add(z, S), z = r.sub(G, S), S = r.add(G, S), B = r.mul(z, S), G = r.add(F, F), G = r.add(G, F), ee = r.mul(O, ee), Y = r.mul(W, Y), G = r.add(G, ee), ee = r.sub(F, ee), ee = r.mul(O, ee), Y = r.add(Y, ee), F = r.mul(G, Y), B = r.add(B, F), F = r.mul(ae, Y), z = r.mul(Q, z), z = r.sub(z, F), F = r.mul(Q, G), S = r.mul(ae, S), S = r.add(S, F), new $(z, B, S);
            }
            subtract(C) {
                return this.add(C.negate());
            }
            is0() {
                return this.equals($.ZERO);
            }
            multiply(C) {
                const { endo: g } = e;
                if (!s.isValidNot0(C)) throw new Error("invalid scalar: out of range");
                let x, A;
                const R = (N)=>te.cached(this, N, (L)=>$f($, L));
                if (g) {
                    const { k1neg: N, k1: L, k2neg: z, k2: B } = I(C), { p: S, f: O } = R(L), { p: W, f: F } = R(B);
                    A = O.add(F), x = K(g.beta, S, W, N, z);
                } else {
                    const { p: N, f: L } = R(C);
                    x = N, A = L;
                }
                return $f($, [
                    x,
                    A
                ])[0];
            }
            multiplyUnsafe(C) {
                const { endo: g } = e, x = this;
                if (!s.isValid(C)) throw new Error("invalid scalar: out of range");
                if (C === Rl || x.is0()) return $.ZERO;
                if (C === h0) return x;
                if (te.hasCache(this)) return this.multiply(C);
                if (g) {
                    const { k1neg: A, k1: R, k2neg: N, k2: L } = I(C), { p1: z, p2: B } = oje($, x, R, L);
                    return K(g.beta, z, B, A, N);
                } else return te.unsafe(x, C);
            }
            multiplyAndAddUnsafe(C, g, x) {
                const A = this.multiplyUnsafe(g).add(C.multiplyUnsafe(x));
                return A.is0() ? void 0 : A;
            }
            toAffine(C) {
                return D(this, C);
            }
            isTorsionFree() {
                const { isTorsionFree: C } = e;
                return o === h0 ? !0 : C ? C($, this) : te.unsafe(this, a).is0();
            }
            clearCofactor() {
                const { clearCofactor: C } = e;
                return o === h0 ? this : C ? C($, this) : this.multiplyUnsafe(o);
            }
            isSmallOrder() {
                return this.multiplyUnsafe(o).is0();
            }
            toBytes(C = !0) {
                return qh(C, "isCompressed"), this.assertValidity(), p($, this, C);
            }
            toHex(C = !0) {
                return ph(this.toBytes(C));
            }
            toString() {
                return `<Point ${this.is0() ? "ZERO" : this.toHex()}>`;
            }
            get px() {
                return this.X;
            }
            get py() {
                return this.X;
            }
            get pz() {
                return this.Z;
            }
            toRawBytes(C = !0) {
                return this.toBytes(C);
            }
            _setWindowSize(C) {
                this.precompute(C);
            }
            static normalizeZ(C) {
                return $f($, C);
            }
            static msm(C, g) {
                return cQ($, s, C, g);
            }
            static fromPrivateKey(C) {
                return $.BASE.multiply(Yp(s, C));
            }
        }
        $.BASE = new $(i.Gx, i.Gy, r.ONE), $.ZERO = new $(r.ZERO, r.ONE, r.ZERO), $.Fp = r, $.Fn = s;
        const ne = s.BITS, te = new aQ($, e.endo ? Math.ceil(ne / 2) : ne);
        return $.BASE.precompute(8), $;
    }
    function dQ(t) {
        return Uint8Array.of(t ? 2 : 3);
    }
    function fQ(t, e) {
        return {
            secretKey: e.BYTES,
            publicKey: 1 + t.BYTES,
            publicKeyUncompressed: 1 + 2 * t.BYTES,
            publicKeyHasPrefix: !0,
            signature: 2 * e.BYTES
        };
    }
    function dje(t, e = {}) {
        const { Fn: n } = t, r = e.randomBytes || gP, s = Object.assign(fQ(t.Fp, n), {
            seed: sQ(n.ORDER)
        });
        function i(p) {
            try {
                return !!Yp(n, p);
            } catch  {
                return !1;
            }
        }
        function o(p, h) {
            const { publicKey: b, publicKeyUncompressed: y } = s;
            try {
                const _ = p.length;
                return h === !0 && _ !== b || h === !1 && _ !== y ? !1 : !!t.fromBytes(p);
            } catch  {
                return !1;
            }
        }
        function a(p = r(s.seed)) {
            return rje(Oa(p, s.seed, "seed"), n.ORDER);
        }
        function c(p, h = !0) {
            return t.BASE.multiply(Yp(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: b, publicKeyUncompressed: y } = s;
            if (n.allowedLengths || h === b) return;
            const _ = Fr("key", p).length;
            return _ === b || _ === y;
        }
        function d(p, h, b = !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 y = Yp(n, p);
            return t.fromHex(h).multiply(y).toBytes(b);
        }
        return Object.freeze({
            getPublicKey: c,
            getSharedSecret: d,
            keygen: l,
            Point: t,
            utils: {
                isValidSecretKey: i,
                isValidPublicKey: o,
                randomSecretKey: a,
                isValidPrivateKey: i,
                randomPrivateKey: a,
                normPrivateKeyToScalar: (p)=>Yp(n, p),
                precompute (p = 8, h = t.BASE) {
                    return h.precompute(p, !1);
                }
            },
            lengths: s
        });
    }
    function fje(t, e, n = {}) {
        RY(e), dw(n, {}, {
            hmac: "function",
            lowS: "boolean",
            randomBytes: "function",
            bits2int: "function",
            bits2int_modN: "function"
        });
        const r = n.randomBytes || gP, s = n.hmac || ((g, ...x)=>Hx(e, g, xc(...x))), { Fp: i, Fn: o } = t, { ORDER: a, BITS: c } = o, { keygen: l, getPublicKey: u, getSharedSecret: d, utils: f, lengths: p } = dje(t, n), h = {
            prehash: !1,
            lowS: typeof n.lowS == "boolean" ? n.lowS : !1,
            format: void 0,
            extraEntropy: !1
        }, b = "compact";
        function y(g) {
            const x = a >> h0;
            return g > x;
        }
        function _(g, x) {
            if (!o.isValidNot0(x)) throw new Error(`invalid signature ${g}: out of range 1..Point.Fn.ORDER`);
            return x;
        }
        function v(g, x) {
            ST(x);
            const A = p.signature, R = x === "compact" ? A : x === "recovered" ? A + 1 : void 0;
            return Oa(g, R, `${x} signature`);
        }
        class w {
            constructor(x, A, R){
                this.r = _("r", x), this.s = _("s", A), R != null && (this.recovery = R), Object.freeze(this);
            }
            static fromBytes(x, A = b) {
                v(x, A);
                let R;
                if (A === "der") {
                    const { r: B, s: S } = vl.toSig(Oa(x));
                    return new w(B, S);
                }
                A === "recovered" && (R = x[0], A = "compact", x = x.subarray(1));
                const N = o.BYTES, L = x.subarray(0, N), z = x.subarray(N, N * 2);
                return new w(o.fromBytes(L), o.fromBytes(z), R);
            }
            static fromHex(x, A) {
                return this.fromBytes(zx(x), A);
            }
            addRecoveryBit(x) {
                return new w(this.r, this.s, x);
            }
            recoverPublicKey(x) {
                const A = 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 * uQ < A && 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 S = i.toBytes(B), O = t.fromBytes(xc(dQ((L & 1) === 0), S)), W = o.inv(B), F = I(Fr("msgHash", x)), G = o.create(-F * W), ee = o.create(N * W), Q = t.BASE.multiplyUnsafe(G).add(O.multiplyUnsafe(ee));
                if (Q.is0()) throw new Error("point at infinify");
                return Q.assertValidity(), Q;
            }
            hasHighS() {
                return y(this.s);
            }
            toBytes(x = b) {
                if (ST(x), x === "der") return zx(vl.hexFromSig(this));
                const A = o.toBytes(this.r), R = o.toBytes(this.s);
                if (x === "recovered") {
                    if (this.recovery == null) throw new Error("recovery bit must be present");
                    return xc(Uint8Array.of(this.recovery), A, R);
                }
                return xc(A, R);
            }
            toHex(x) {
                return ph(this.toBytes(x));
            }
            assertValidity() {}
            static fromCompact(x) {
                return w.fromBytes(Fr("sig", x), "compact");
            }
            static fromDER(x) {
                return w.fromBytes(Fr("sig", x), "der");
            }
            normalizeS() {
                return this.hasHighS() ? new w(this.r, o.neg(this.s), this.recovery) : this;
            }
            toDERRawBytes() {
                return this.toBytes("der");
            }
            toDERHex() {
                return ph(this.toBytes("der"));
            }
            toCompactRawBytes() {
                return this.toBytes("compact");
            }
            toCompactHex() {
                return ph(this.toBytes("compact"));
            }
        }
        const E = n.bits2int || function(x) {
            if (x.length > 8192) throw new Error("input is too large");
            const A = m5(x), R = x.length * 8 - c;
            return R > 0 ? A >> BigInt(R) : A;
        }, I = n.bits2int_modN || function(x) {
            return o.create(E(x));
        }, D = uw(c);
        function U(g) {
            return vT("num < 2^" + c, g, Rl, D), o.toBytes(g);
        }
        function K(g, x) {
            return Oa(g, void 0, "message"), x ? Oa(e(g), void 0, "prehashed message") : g;
        }
        function $(g, x, A) {
            if ([
                "recovered",
                "canonical"
            ].some((G)=>G in A)) throw new Error("sign() legacy options not supported");
            const { lowS: R, prehash: N, extraEntropy: L } = jS(A, h);
            g = K(g, N);
            const z = I(g), B = Yp(o, x), S = [
                U(B),
                U(z)
            ];
            if (L != null && L !== !1) {
                const G = L === !0 ? r(p.secretKey) : L;
                S.push(Fr("extraEntropy", G));
            }
            const O = xc(...S), W = z;
            function F(G) {
                const ee = E(G);
                if (!o.isValidNot0(ee)) return;
                const Q = o.inv(ee), Y = t.BASE.multiply(ee).toAffine(), ae = o.create(Y.x);
                if (ae === Rl) return;
                const de = o.create(Q * o.create(W + ae * B));
                if (de === Rl) return;
                let pe = (Y.x === ae ? 0 : 2) | Number(Y.y & h0), Ae = de;
                return R && y(de) && (Ae = o.neg(de), pe ^= 1), new w(ae, Ae, pe);
            }
            return {
                seed: O,
                k2sig: F
            };
        }
        function ne(g, x, A = {}) {
            g = Fr("message", g);
            const { seed: R, k2sig: N } = $(g, x, A);
            return $He(e.outputLen, o.BYTES, s)(R, N);
        }
        function te(g) {
            let x;
            const A = typeof g == "string" || lw(g), R = !A && g !== null && typeof g == "object" && typeof g.r == "bigint" && typeof g.s == "bigint";
            if (!A && !R) throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");
            if (R) x = new w(g.r, g.s);
            else if (A) {
                try {
                    x = w.fromBytes(Fr("sig", g), "der");
                } catch (N) {
                    if (!(N instanceof vl.Err)) throw N;
                }
                if (!x) try {
                    x = w.fromBytes(Fr("sig", g), "compact");
                } catch  {
                    return !1;
                }
            }
            return x || !1;
        }
        function J(g, x, A, R = {}) {
            const { lowS: N, prehash: L, format: z } = jS(R, h);
            if (A = Fr("publicKey", A), x = K(Fr("message", x), L), "strict" in R) throw new Error("options.strict was renamed to lowS");
            const B = z === void 0 ? te(g) : w.fromBytes(Fr("sig", g), z);
            if (B === !1) return !1;
            try {
                const S = t.fromBytes(A);
                if (N && B.hasHighS()) return !1;
                const { r: O, s: W } = B, F = I(x), G = o.inv(W), ee = o.create(F * G), Q = o.create(O * G), Y = t.BASE.multiplyUnsafe(ee).add(S.multiplyUnsafe(Q));
                return Y.is0() ? !1 : o.create(Y.x) === O;
            } catch  {
                return !1;
            }
        }
        function C(g, x, A = {}) {
            const { prehash: R } = jS(A, h);
            return x = K(x, R), w.fromBytes(g, "recovered").recoverPublicKey(x).toBytes();
        }
        return Object.freeze({
            keygen: l,
            getPublicKey: u,
            getSharedSecret: d,
            utils: f,
            lengths: p,
            Point: t,
            sign: ne,
            verify: J,
            recoverPublicKey: C,
            Signature: w,
            hash: e
        });
    }
    function hje(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 = mp(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 pje(t) {
        const { CURVE: e, curveOpts: n } = hje(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 gje(t, e) {
        const n = e.Point;
        return Object.assign({}, e, {
            ProjectivePoint: n,
            CURVE: Object.assign({}, t, nQ(n.Fn.ORDER, n.Fn.BITS))
        });
    }
    function bje(t) {
        const { CURVE: e, curveOpts: n, hash: r, ecdsaOpts: s } = pje(t), i = uje(e, n), o = fje(i, r, s);
        return gje(t, o);
    }
    function mje(t, e) {
        const n = (r)=>bje({
                ...t,
                hash: r
            });
        return {
            ...n(e),
            create: n
        };
    }
    const xP = {
        p: BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),
        n: BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),
        h: BigInt(1),
        a: BigInt(0),
        b: BigInt(7),
        Gx: BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),
        Gy: BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")
    }, yje = {
        beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),
        basises: [
            [
                BigInt("0x3086d221a7d46bcde86c90e49284eb15"),
                -BigInt("0xe4437ed6010e88286f547fa90abfe4c3")
            ],
            [
                BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),
                BigInt("0x3086d221a7d46bcde86c90e49284eb15")
            ]
        ]
    }, lD = BigInt(2);
    function wje(t) {
        const e = xP.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 = Br(u, n, e) * u % e, f = Br(d, n, e) * u % e, p = Br(f, lD, e) * l % e, h = Br(p, s, e) * p % e, b = Br(h, i, e) * h % e, y = Br(b, a, e) * b % e, _ = Br(y, c, e) * y % e, v = Br(_, a, e) * b % e, w = Br(v, n, e) * u % e, E = Br(w, o, e) * h % e, I = Br(E, r, e) * l % e, D = Br(I, lD, e);
        if (!kT.eql(kT.sqr(D), t)) throw new Error("Cannot find square root");
        return D;
    }
    const kT = mp(xP.p, {
        sqrt: wje
    }), _je = mje({
        ...xP,
        Fp: kT,
        lowS: !0,
        endo: yje
    }, KHe);
    const Uu = BigInt(0), Cs = BigInt(1), qS = BigInt(2), xje = BigInt(8);
    function vje(t, e, n, r) {
        const s = t.sqr(n), i = t.sqr(r), o = t.add(t.mul(e.a, s), i), a = t.add(t.ONE, t.mul(e.d, t.mul(s, i)));
        return t.eql(o, a);
    }
    function Sje(t, e = {}) {
        const n = lQ("edwards", t, e, e.FpFnLE), { Fp: r, Fn: s } = n;
        let i = n.CURVE;
        const { h: o } = i;
        dw(e, {}, {
            uvRatio: "function"
        });
        const a = qS << BigInt(s.BYTES * 8) - Cs, c = (y)=>r.create(y), l = e.uvRatio || ((y, _)=>{
            try {
                return {
                    isValid: !0,
                    value: r.sqrt(r.div(y, _))
                };
            } catch  {
                return {
                    isValid: !1,
                    value: Uu
                };
            }
        });
        if (!vje(r, i, i.Gx, i.Gy)) throw new Error("bad curve params: generator point");
        function u(y, _, v = !1) {
            const w = v ? Cs : Uu;
            return vT("coordinate " + y, _, w, a), _;
        }
        function d(y) {
            if (!(y instanceof h)) throw new Error("ExtendedPoint expected");
        }
        const f = jx((y, _)=>{
            const { X: v, Y: w, Z: E } = y, I = y.is0();
            _ == null && (_ = I ? xje : r.inv(E));
            const D = c(v * _), U = c(w * _), K = r.mul(E, _);
            if (I) return {
                x: Uu,
                y: Cs
            };
            if (K !== Cs) throw new Error("invZ was invalid");
            return {
                x: D,
                y: U
            };
        }), p = jx((y)=>{
            const { a: _, d: v } = i;
            if (y.is0()) throw new Error("bad point: ZERO");
            const { X: w, Y: E, Z: I, T: D } = y, U = c(w * w), K = c(E * E), $ = c(I * I), ne = c($ * $), te = c(U * _), J = c($ * c(te + K)), C = c(ne + c(v * c(U * K)));
            if (J !== C) throw new Error("bad point: equation left != right (1)");
            const g = c(w * E), x = c(I * D);
            if (g !== x) throw new Error("bad point: equation left != right (2)");
            return !0;
        });
        class h {
            constructor(_, v, w, E){
                this.X = u("x", _), this.Y = u("y", v), this.Z = u("z", w, !0), this.T = u("t", E), Object.freeze(this);
            }
            static CURVE() {
                return i;
            }
            static fromAffine(_) {
                if (_ instanceof h) throw new Error("extended point not allowed");
                const { x: v, y: w } = _ || {};
                return u("x", v), u("y", w), new h(v, w, Cs, c(v * w));
            }
            static fromBytes(_, v = !1) {
                const w = r.BYTES, { a: E, d: I } = i;
                _ = nD(Oa(_, w, "point")), qh(v, "zip215");
                const D = nD(_), U = _[w - 1];
                D[w - 1] = U & -129;
                const K = qy(D), $ = v ? a : r.ORDER;
                vT("point.y", K, Uu, $);
                const ne = c(K * K), te = c(ne - Cs), J = c(I * ne - E);
                let { isValid: C, value: g } = l(te, J);
                if (!C) throw new Error("bad point: invalid y coordinate");
                const x = (g & Cs) === Cs, A = (U & 128) !== 0;
                if (!v && g === Uu && A) throw new Error("bad point: x=0 and x_0=1");
                return A !== x && (g = c(-g)), h.fromAffine({
                    x: g,
                    y: K
                });
            }
            static fromHex(_, v = !1) {
                return h.fromBytes(Fr("point", _), v);
            }
            get x() {
                return this.toAffine().x;
            }
            get y() {
                return this.toAffine().y;
            }
            precompute(_ = 8, v = !0) {
                return b.createCache(this, _), v || this.multiply(qS), this;
            }
            assertValidity() {
                p(this);
            }
            equals(_) {
                d(_);
                const { X: v, Y: w, Z: E } = this, { X: I, Y: D, Z: U } = _, K = c(v * U), $ = c(I * E), ne = c(w * U), te = c(D * E);
                return K === $ && ne === te;
            }
            is0() {
                return this.equals(h.ZERO);
            }
            negate() {
                return new h(c(-this.X), this.Y, this.Z, c(-this.T));
            }
            double() {
                const { a: _ } = i, { X: v, Y: w, Z: E } = this, I = c(v * v), D = c(w * w), U = c(qS * c(E * E)), K = c(_ * I), $ = v + w, ne = c(c($ * $) - I - D), te = K + D, J = te - U, C = K - D, g = c(ne * J), x = c(te * C), A = c(ne * C), R = c(J * te);
                return new h(g, x, R, A);
            }
            add(_) {
                d(_);
                const { a: v, d: w } = i, { X: E, Y: I, Z: D, T: U } = this, { X: K, Y: $, Z: ne, T: te } = _, J = c(E * K), C = c(I * $), g = c(U * w * te), x = c(D * ne), A = c((E + I) * (K + $) - J - C), R = x - g, N = x + g, L = c(C - v * J), z = c(A * R), B = c(N * L), S = c(A * L), O = c(R * N);
                return new h(z, B, O, S);
            }
            subtract(_) {
                return this.add(_.negate());
            }
            multiply(_) {
                if (!s.isValidNot0(_)) throw new Error("invalid scalar: expected 1 <= sc < curve.n");
                const { p: v, f: w } = b.cached(this, _, (E)=>$f(h, E));
                return $f(h, [
                    v,
                    w
                ])[0];
            }
            multiplyUnsafe(_, v = h.ZERO) {
                if (!s.isValid(_)) throw new Error("invalid scalar: expected 0 <= sc < curve.n");
                return _ === Uu ? h.ZERO : this.is0() || _ === Cs ? this : b.unsafe(this, _, (w)=>$f(h, w), v);
            }
            isSmallOrder() {
                return this.multiplyUnsafe(o).is0();
            }
            isTorsionFree() {
                return b.unsafe(this, i.n).is0();
            }
            toAffine(_) {
                return f(this, _);
            }
            clearCofactor() {
                return o === Cs ? this : this.multiplyUnsafe(o);
            }
            toBytes() {
                const { x: _, y: v } = this.toAffine(), w = r.toBytes(v);
                return w[w.length - 1] |= _ & Cs ? 128 : 0, w;
            }
            toHex() {
                return ph(this.toBytes());
            }
            toString() {
                return `<Point ${this.is0() ? "ZERO" : this.toHex()}>`;
            }
            get ex() {
                return this.X;
            }
            get ey() {
                return this.Y;
            }
            get ez() {
                return this.Z;
            }
            get et() {
                return this.T;
            }
            static normalizeZ(_) {
                return $f(h, _);
            }
            static msm(_, v) {
                return cQ(h, s, _, v);
            }
            _setWindowSize(_) {
                this.precompute(_);
            }
            toRawBytes() {
                return this.toBytes();
            }
        }
        h.BASE = new h(i.Gx, i.Gy, Cs, c(i.Gx * i.Gy)), h.ZERO = new h(Uu, Cs, Cs, Uu), h.Fp = r, h.Fn = s;
        const b = new aQ(h, s.BITS);
        return h.BASE.precompute(8), h;
    }
    function kje(t, e, n = {}) {
        if (typeof e != "function") throw new Error('"hash" function param is required');
        dw(n, {}, {
            adjustScalarBytes: "function",
            randomBytes: "function",
            domain: "function",
            prehash: "function",
            mapToCurve: "function"
        });
        const { prehash: r } = n, { BASE: s, Fp: i, Fn: o } = t, a = n.randomBytes || gP, c = n.adjustScalarBytes || (($)=>$), l = n.domain || (($, ne, te)=>{
            if (qh(te, "phflag"), ne.length || te) throw new Error("Contexts/pre-hash are not supported");
            return $;
        });
        function u($) {
            return o.create(qy($));
        }
        function d($) {
            const ne = w.secretKey;
            $ = Fr("private key", $, ne);
            const te = Fr("hashed private key", e($), 2 * ne), J = c(te.slice(0, ne)), C = te.slice(ne, 2 * ne), g = u(J);
            return {
                head: J,
                prefix: C,
                scalar: g
            };
        }
        function f($) {
            const { head: ne, prefix: te, scalar: J } = d($), C = s.multiply(J), g = C.toBytes();
            return {
                head: ne,
                prefix: te,
                scalar: J,
                point: C,
                pointBytes: g
            };
        }
        function p($) {
            return f($).pointBytes;
        }
        function h($ = Uint8Array.of(), ...ne) {
            const te = xc(...ne);
            return u(e(l(te, Fr("context", $), !!r)));
        }
        function b($, ne, te = {}) {
            $ = Fr("message", $), r && ($ = r($));
            const { prefix: J, scalar: C, pointBytes: g } = f(ne), x = h(te.context, J, $), A = s.multiply(x).toBytes(), R = h(te.context, A, g, $), N = o.create(x + R * C);
            if (!o.isValid(N)) throw new Error("sign failed: invalid s");
            const L = xc(A, o.toBytes(N));
            return Oa(L, w.signature, "result");
        }
        const y = {
            zip215: !0
        };
        function _($, ne, te, J = y) {
            const { context: C, zip215: g } = J, x = w.signature;
            $ = Fr("signature", $, x), ne = Fr("message", ne), te = Fr("publicKey", te, w.publicKey), g !== void 0 && qh(g, "zip215"), r && (ne = r(ne));
            const A = x / 2, R = $.subarray(0, A), N = qy($.subarray(A, x));
            let L, z, B;
            try {
                L = t.fromBytes(te, g), z = t.fromBytes(R, g), B = s.multiplyUnsafe(N);
            } catch  {
                return !1;
            }
            if (!g && L.isSmallOrder()) return !1;
            const S = h(C, z.toBytes(), L.toBytes(), ne);
            return z.add(L.multiplyUnsafe(S)).subtract(B).clearCofactor().is0();
        }
        const v = i.BYTES, w = {
            secretKey: v,
            publicKey: v,
            signature: 2 * v,
            seed: v
        };
        function E($ = a(w.seed)) {
            return Oa($, w.seed, "seed");
        }
        function I($) {
            const ne = K.randomSecretKey($);
            return {
                secretKey: ne,
                publicKey: p(ne)
            };
        }
        function D($) {
            return lw($) && $.length === o.BYTES;
        }
        function U($, ne) {
            try {
                return !!t.fromBytes($, ne);
            } catch  {
                return !1;
            }
        }
        const K = {
            getExtendedPublicKey: f,
            randomSecretKey: E,
            isValidSecretKey: D,
            isValidPublicKey: U,
            toMontgomery ($) {
                const { y: ne } = t.fromBytes($), te = w.publicKey, J = te === 32;
                if (!J && te !== 57) throw new Error("only defined for 25519 and 448");
                const C = J ? i.div(Cs + ne, Cs - ne) : i.div(ne - Cs, ne + Cs);
                return i.toBytes(C);
            },
            toMontgomerySecret ($) {
                const ne = w.secretKey;
                Oa($, ne);
                const te = e($.subarray(0, ne));
                return c(te).subarray(0, ne);
            },
            randomPrivateKey: E,
            precompute ($ = 8, ne = t.BASE) {
                return ne.precompute($, !1);
            }
        };
        return Object.freeze({
            keygen: I,
            getPublicKey: p,
            sign: b,
            verify: _,
            utils: K,
            Point: t,
            lengths: w
        });
    }
    function Tje(t) {
        const e = {
            a: t.a,
            d: t.d,
            p: t.Fp.ORDER,
            n: t.n,
            h: t.h,
            Gx: t.Gx,
            Gy: t.Gy
        }, n = t.Fp, r = mp(e.n, t.nBitLength, !0), s = {
            Fp: n,
            Fn: r,
            uvRatio: t.uvRatio
        }, i = {
            randomBytes: t.randomBytes,
            adjustScalarBytes: t.adjustScalarBytes,
            domain: t.domain,
            prehash: t.prehash,
            mapToCurve: t.mapToCurve
        };
        return {
            CURVE: e,
            curveOpts: s,
            hash: t.hash,
            eddsaOpts: i
        };
    }
    function Eje(t, e) {
        const n = e.Point;
        return Object.assign({}, e, {
            ExtendedPoint: n,
            CURVE: t,
            nBitLength: n.Fn.BITS,
            nByteLength: n.Fn.BYTES
        });
    }
    function Cje(t) {
        const { CURVE: e, curveOpts: n, hash: r, eddsaOpts: s } = Tje(t), i = Sje(e, n), o = kje(i, r, s);
        return Eje(t, o);
    }
    const Ije = BigInt(1), uD = BigInt(2);
    BigInt(3);
    const Aje = BigInt(5), Pje = BigInt(8), vP = BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"), hQ = {
        p: vP,
        n: BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),
        h: Pje,
        a: BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),
        d: BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),
        Gx: BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),
        Gy: BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")
    };
    function Oje(t) {
        const e = BigInt(10), n = BigInt(20), r = BigInt(40), s = BigInt(80), i = vP, a = t * t % i * t % i, c = Br(a, uD, i) * a % i, l = Br(c, Ije, i) * t % i, u = Br(l, Aje, i) * l % i, d = Br(u, e, i) * u % i, f = Br(d, n, i) * d % i, p = Br(f, r, i) * f % i, h = Br(p, s, i) * p % i, b = Br(h, s, i) * p % i, y = Br(b, e, i) * u % i;
        return {
            pow_p_5_8: Br(y, uD, i) * t % i,
            b2: a
        };
    }
    function Mje(t) {
        return t[0] &= 248, t[31] &= 127, t[31] |= 64, t;
    }
    const dD = BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");
    function Rje(t, e) {
        const n = vP, r = ts(e * e * e, n), s = ts(r * r * e, n), i = Oje(t * s).pow_p_5_8;
        let o = ts(t * r * i, n);
        const a = ts(e * o * o, n), c = o, l = ts(o * dD, n), u = a === t, d = a === ts(-t, n), f = a === ts(-t * dD, n);
        return u && (o = c), (d || f) && (o = l), QHe(o, n) && (o = ts(-o, n)), {
            isValid: u || d,
            value: o
        };
    }
    const Nje = mp(hQ.p, {
        isLE: !0
    }), Vje = {
        ...hQ,
        Fp: Nje,
        hash: jY,
        adjustScalarBytes: Mje,
        uvRatio: Rje
    }, Bje = Cje(Vje), Dje = BigInt(0), Kb = BigInt(1), Fje = BigInt(2), Lje = BigInt(7), zje = BigInt(256), Uje = BigInt(113), pQ = [], gQ = [], bQ = [];
    for(let t = 0, e = Kb, n = 1, r = 0; t < 24; t++){
        [n, r] = [
            r,
            (2 * n + 3 * r) % 5
        ], pQ.push(2 * (5 * r + n)), gQ.push((t + 1) * (t + 2) / 2 % 64);
        let s = Dje;
        for(let i = 0; i < 7; i++)e = (e << Kb ^ (e >> Lje) * Uje) % zje, e & Fje && (s ^= Kb << (Kb << BigInt(i)) - Kb);
        bQ.push(s);
    }
    const mQ = LY(bQ, !0), Hje = mQ[0], jje = mQ[1], fD = (t, e, n)=>n > 32 ? pHe(t, e, n) : fHe(t, e, n), hD = (t, e, n)=>n > 32 ? gHe(t, e, n) : hHe(t, e, n);
    function qje(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 = fD(l, u, 1) ^ n[a], f = hD(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 = gQ[o], c = fD(s, i, a), l = hD(s, i, a), u = pQ[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] ^= Hje[r], t[1] ^= jje[r];
        }
        Ua(n);
    }
    class SP extends b5 {
        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, Ud(r), !(0 < e && e < 200)) throw new Error("only keccak-f1600 function is supported");
            this.state = new Uint8Array(200), this.state32 = jy(this.state);
        }
        clone() {
            return this._cloneInto();
        }
        keccak() {
            ed(this.state32), qje(this.state32, this.rounds), ed(this.state32), this.posOut = 0, this.pos = 0;
        }
        update(e) {
            Hd(this), e = Kl(e), Fc(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) {
            Hd(this, !1), Fc(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 Ud(e), this.xofInto(new Uint8Array(e));
        }
        digestInto(e) {
            if (hP(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, Ua(this.state);
        }
        _cloneInto(e) {
            const { blockLen: n, suffix: r, outputLen: s, rounds: i, enableXOF: o } = this;
            return e || (e = new SP(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;
        }
    }
    const yQ = (t, e, n)=>pP(()=>new SP(e, t, n)), Kje = yQ(1, 136, 256 / 8), Wje = yQ(1, 72, 512 / 8), pD = jY;
    function wQ(t, e = c2.prefix) {
        const n = rf(t);
        if (e < 0 || e > 16383 && !$je.includes(e) || [
            46,
            47
        ].includes(e)) throw new Error("Out of range ss58Format specified");
        if (!c2.allowedDecodedLengths.includes(n.length)) throw new Error(`Expected a valid key to convert, with length ${c2.allowedDecodedLengths.join(", ")}`);
        const r = Ii(e < 64 ? [
            e
        ] : [
            (e & 252) >> 2 | 64,
            e >> 8 | (e & 3) << 6
        ], n);
        return tHe(Ii(r, zY(r).subarray(0, [
            32,
            33
        ].includes(n.length) ? 2 : 1)));
    }
    const $je = [
        29972
    ], kP = THe({
        256: DUe,
        512: FUe
    }, {
        256: Kje,
        512: Wje
    });
    function Xje(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 (!h5 || cw()) return VUe(t).subarray(1);
        const { x: n, y: r } = _je.ProjectivePoint.fromHex(t);
        return Ii(jl(n, tD), jl(r, tD));
    }
    function Gje(t) {
        return [
            33,
            65
        ].includes(t.length) && (t = kP(Xje(t))), t.slice(-20);
    }
    function Zje(t) {
        if (!t) return "0x";
        const e = Ot(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(Gje(e), -1, !1), r = nn(kP(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 Jje(t, e) {
        return t !== (e > 7 ? t.toUpperCase() : t.toLowerCase());
    }
    function Yje(t) {
        const e = t.replace("0x", ""), n = nn(kP(e.toLowerCase()), -1, !1);
        for(let r = 0; r < 40; r++)if (Jje(e[r], parseInt(n[r], 16))) return !1;
        return !0;
    }
    function Qje(t) {
        return !t || t.length !== 42 || !Nn(t) ? !1 : /^(0x)?[0-9a-f]{40}$/.test(t) || /^(0x)?[0-9A-F]{40}$/.test(t) ? !0 : Yje(t);
    }
    const hi = Zn("11400714785074694791"), pc = Zn("14029467366897019727"), gD = Zn("1609587929392839161"), Wb = Zn("9650029242287828579"), bD = Zn("2870177450012600261"), wl = Zn("0xffffffffffffffff"), eqe = Zn(7), tqe = Zn(11), nqe = Zn(12), rqe = Zn(16), sqe = Zn(18), iqe = Zn(23), oqe = Zn(27), aqe = Zn(29), Xp = Zn(31), cqe = Zn(32), lqe = Zn(33), uqe = Zn(64), mD = Zn(256);
    function ro(t, e) {
        const n = t & wl;
        return (n << e | n >> uqe - e) & wl;
    }
    function TT(t, e, n) {
        const r = new Array(n);
        let s = 0;
        for(let o = 0; o < n; o++, s += 2)r[o] = Zn(t[e + s] | t[e + 1 + s] << 8);
        let i = mze;
        for(let o = n - 1; o >= 0; o--)i = (i << rqe) + r[o];
        return i;
    }
    function dqe(t, e) {
        const n = {
            seed: t,
            u8a: new Uint8Array(32),
            u8asize: 0,
            v1: t + hi + pc,
            v2: t + pc,
            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 * ro(o + pc * TT(e, s, 4), Xp);
            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 fqe(t, e) {
        const { seed: n, u8a: r, u8asize: s, v1: i, v2: o, v3: a, v4: c } = dqe(Zn(e), t);
        let l = 0, u = wl & Zn(t.length) + (t.length >= 32 ? ((((ro(i, yze) + ro(o, eqe) + ro(a, nqe) + ro(c, sqe) ^ hi * ro(i * pc, Xp)) * hi + Wb ^ hi * ro(o * pc, Xp)) * hi + Wb ^ hi * ro(a * pc, Xp)) * hi + Wb ^ hi * ro(c * pc, Xp)) * hi + Wb : n + bD);
        for(; l <= s - 8;)u = wl & Wb + hi * ro(u ^ hi * ro(pc * TT(r, l, 4), Xp), oqe), l += 8;
        for(l + 4 <= s && (u = wl & gD + pc * ro(u ^ hi * TT(r, l, 2), iqe), l += 4); l < s;)u = wl & hi * ro(u ^ bD * Zn(r[l++]), tqe);
        u = wl & pc * (u ^ u >> lqe), u = wl & gD * (u ^ u >> aqe), u = wl & (u ^ u >> cqe);
        const d = new Uint8Array(8);
        for(let f = 7; f >= 0; f--)d[f] = Number(u % mD), u = u / mD;
        return d;
    }
    function p0(t, e = 64, n) {
        const r = Math.ceil(e / 64), s = Ot(t);
        if (!h5 || !n && cw()) return LUe(s, r);
        const i = new Uint8Array(r * 8);
        for(let o = 0; o < r; o++)i.set(fqe(s, o).reverse(), o * 8);
        return i;
    }
    const yD = -99999;
    function $b(t, e, n) {
        Object.defineProperty(t, e, {
            configurable: !0,
            enumerable: !1,
            value: n
        });
    }
    class hqe extends Error {
        code;
        data;
        message;
        name;
        stack;
        constructor(e = "", n = yD, r){
            if (super(), $b(this, "message", String(e)), $b(this, "name", this.constructor.name), $b(this, "data", r), $b(this, "code", n), Tt(Error.captureStackTrace)) Error.captureStackTrace(this, this.constructor);
            else {
                const { stack: s } = new Error(e);
                s && $b(this, "stack", s);
            }
        }
        static CODES = {
            ASSERT: -90009,
            INVALID_JSONRPC: -99998,
            METHOD_NOT_FOUND: -32601,
            UNKNOWN: yD
        };
    }
    function pqe(t) {
        if (kr(t)) return "";
        const e = `: ${rr(t) ? t.replace(/Error\("/g, "").replace(/\("/g, "(").replace(/"\)/g, ")").replace(/\(/g, ", ").replace(/\)/g, "") : Sn(t)}`;
        return e.length <= 256 ? e : `${e.substring(0, 255)}…`;
    }
    function wD(t) {
        if (t) {
            const { code: e, data: n, message: r } = t;
            throw new hqe(`${e}: ${r}${pqe(n)}`, e, n);
        }
    }
    class gqe {
        #e = 0;
        decodeResponse(e) {
            if (!e || e.jsonrpc !== "2.0") throw new Error("Invalid jsonrpc field in decoded object");
            const n = !kr(e.params) && !kr(e.method);
            if (!Ln(e.id) && (!n || !Ln(e.params.subscription) && !rr(e.params.subscription))) throw new Error("Invalid id field in decoded object");
            if (wD(e.error), e.result === void 0 && !n) throw new Error("No result found in jsonrpc response");
            return n ? (wD(e.params.error), e.params.result) : e.result;
        }
        encodeJson(e, n) {
            const [r, s] = this.encodeObject(e, n);
            return [
                r,
                Sn(s)
            ];
        }
        encodeObject(e, n) {
            const r = ++this.#e;
            return [
                r,
                {
                    id: r,
                    jsonrpc: "2.0",
                    method: e,
                    params: n
                }
            ];
        }
    }
    const bqe = "ws://127.0.0.1:9944", mqe = {
        WS_URL: bqe
    }, ET = 1024, _Q = 3e4, _D = 18e5, yqe = 31536e6;
    class KS {
        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 xQ {
        capacity;
        #e = new Map;
        #t = new Map;
        #n = 0;
        #r;
        #s;
        #i;
        constructor(e = ET, n = _Q){
            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 > _D)) throw new Error(`LRUCache initialization error: 'ttl' must be between 0 and ${_D} ms or null to disable. Received: ${n}`);
            this.capacity = e, n ? this.#i = n : this.#i = yqe, this.#r = this.#s = new KS("<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 KS(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 KS("<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 WS = {
        exports: {}
    }, xD;
    function wqe() {
        return xD || (xD = 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 b = n ? n + l : l;
                if (!this._events[b]) return !1;
                var y = this._events[b], _ = arguments.length, v, w;
                if (y.fn) {
                    switch(y.once && this.removeListener(l, y.fn, void 0, !0), _){
                        case 1:
                            return y.fn.call(y.context), !0;
                        case 2:
                            return y.fn.call(y.context, u), !0;
                        case 3:
                            return y.fn.call(y.context, u, d), !0;
                        case 4:
                            return y.fn.call(y.context, u, d, f), !0;
                        case 5:
                            return y.fn.call(y.context, u, d, f, p), !0;
                        case 6:
                            return y.fn.call(y.context, u, d, f, p, h), !0;
                    }
                    for(w = 1, v = new Array(_ - 1); w < _; w++)v[w - 1] = arguments[w];
                    y.fn.apply(y.context, v);
                } else {
                    var E = y.length, I;
                    for(w = 0; w < E; w++)switch(y[w].once && this.removeListener(l, y[w].fn, void 0, !0), _){
                        case 1:
                            y[w].fn.call(y[w].context);
                            break;
                        case 2:
                            y[w].fn.call(y[w].context, u);
                            break;
                        case 3:
                            y[w].fn.call(y[w].context, u, d);
                            break;
                        case 4:
                            y[w].fn.call(y[w].context, u, d, f);
                            break;
                        default:
                            if (!v) for(I = 1, v = new Array(_ - 1); I < _; I++)v[I - 1] = arguments[I];
                            y[w].fn.apply(y[w].context, v);
                    }
                }
                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 b = 0, y = [], _ = h.length; b < _; b++)(h[b].fn !== u || f && !h[b].once || d && h[b].context !== d) && y.push(h[b]);
                    y.length ? this._events[p] = y.length === 1 ? y[0] : y : 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;
        })(WS)), WS.exports;
    }
    var _qe = wqe();
    const vQ = mH(_qe), $S = la.WebSocket, xqe = {
        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 vqe(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 xqe[t] || "(Unknown)";
    }
    const Sqe = {
        chain_finalisedHead: "chain_finalizedHead",
        chain_subscribeFinalisedHeads: "chain_subscribeFinalizedHeads",
        chain_unsubscribeFinalisedHeads: "chain_unsubscribeFinalizedHeads"
    }, kqe = 2500, Tqe = 60 * 1e3, Eqe = 5e3, eo = ha("api-ws");
    function vD(t, e) {
        Object.keys(t).forEach((n)=>{
            e && e(t[n]), delete t[n];
        });
    }
    function XS() {
        return {
            bytesRecv: 0,
            bytesSent: 0,
            cached: 0,
            errors: 0,
            requests: 0,
            subscriptions: 0,
            timeout: 0
        };
    }
    class y5 {
        #e;
        #t;
        #n;
        #r;
        #s;
        #i = {};
        #o;
        #a;
        #l = {};
        #f;
        #y;
        #h;
        #p;
        #u;
        #b = !1;
        #d = {};
        #g = null;
        #c;
        #w;
        constructor(e = mqe.WS_URL, n = kqe, 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 ? _Q : o;
            this.#e = new xQ(i === 0 ? 0 : i || ET, c), this.#y = o, this.#f = i || ET, this.#s = new vQ, this.#h = n || 0, this.#t = new gqe, this.#p = -1, this.#n = a, this.#r = r, this.#c = null, this.#a = {
                active: {
                    requests: 0,
                    subscriptions: 0
                },
                total: XS()
            }, this.#u = XS(), this.#w = s || Tqe, n && n > 0 && this.connectWithRetry().catch(ql), 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.#p];
        }
        clone() {
            return new y5(this.#n);
        }
        selectEndpointIndex(e) {
            return (this.#p + 1) % e.length;
        }
        async connect() {
            if (this.#c) throw new Error("WebSocket is already connected");
            try {
                this.#p = this.selectEndpointIndex(this.#n), this.#c = typeof la.WebSocket < "u" && Jze(la.WebSocket, $S) ? new $S(this.endpoint) : new $S(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.#E), this.#g = setInterval(()=>this.#I(), Eqe);
            } catch (e) {
                throw eo.error(e), this.#m("error", e), e;
            }
        }
        async connectWithRetry() {
            if (this.#h > 0) try {
                await this.connect();
            } catch  {
                setTimeout(()=>{
                    this.connectWithRetry().catch(ql);
                }, this.#h);
            }
        }
        async disconnect() {
            this.#h = 0;
            try {
                this.#c && this.#c.close(1e3);
            } catch (e) {
                throw eo.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}::${Sn(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);
                    };
                    eo.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 (kr(this.#d[s])) return eo.debug(()=>`Unable to find active subscription=${s}`), !1;
            delete this.#d[s];
            try {
                return this.isConnected && !dh(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 || vqe(e.code)}`);
            this.#h > 0 && eo.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), vD(this.#i, (r)=>{
                try {
                    r.callback(n, void 0);
                } catch (s) {
                    eo.error(s);
                }
            }), vD(this.#l), this.#u = XS(), this.#m("disconnected"), this.#h > 0 && setTimeout(()=>{
                this.connectWithRetry().catch(ql);
            }, this.#h);
        };
        #v = (e)=>{
            eo.debug(()=>[
                    "socket error",
                    e
                ]), this.#m("error", e);
        };
        #k = (e)=>{
            eo.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 kr(r.method) ? this.#T(r) : this.#S(r);
        };
        #T = (e)=>{
            const n = this.#i[e.id];
            if (!n) {
                eo.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] = $e({}, 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 = `${Sqe[e.method] || e.method}::${e.params.subscription}`, s = this.#d[r];
            if (!s) {
                this.#l[r] = e, eo.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);
            }
        };
        #E = ()=>{
            if (this.#c === null) throw new Error("WebSocket cannot be null in onOpen");
            return eo.debug(()=>[
                    "connected to",
                    this.endpoint
                ]), this.#b = !0, this.#C(), this.#m("connected"), !0;
        };
        #C = ()=>{
            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) {
                    eo.error(a);
                }
            })).catch(eo.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 Cqe = ha("api/util");
    function Iqe(t, { block: { extrinsics: e, header: n } }, r, s) {
        for (const [i, o] of e.entries())if (o.hash.eq(t)) return {
            blockNumber: wY(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());
            Cqe.warn(`block ${n.hash.toHex()}: Unable to find extrinsic ${t.toHex()} inside ${i.join(", ")}`);
        }
        return {};
    }
    function GS(t) {
        return Tt(t.sign);
    }
    const Aqe = {
        Blake2_128: null,
        Blake2_256: null,
        Blake2_128Concat: null,
        Twox128: null,
        Twox256: null,
        Twox64Concat: null,
        Identity: null
    }, SD = {
        metadata: {
            description: "Returns the metadata of a runtime",
            params: [],
            type: "OpaqueMetadata"
        }
    }, Pqe = {
        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>"
                    },
                    ...SD
                },
                version: 2
            },
            {
                methods: {
                    ...SD
                },
                version: 1
            }
        ]
    }, Oqe = {
        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>"
        }
    }, Mqe = {
        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
            }
        }
    }, Rqe = {
        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: Aqe
        }
    }, Nqe = {
        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"
    }, Vqe = {
        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"
    }, l2 = {
        name: "Text",
        fields: "Vec<Si1Field>",
        index: "u8",
        docs: "Vec<Text>"
    }, Bqe = {
        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: l2
    }, Dqe = {
        PortableTypeV14: {
            id: "Si1LookupTypeId",
            type: "Si1Type"
        },
        ErrorMetadataV14: {
            ...l2,
            args: "Vec<Type>"
        },
        EventMetadataV14: {
            ...l2,
            args: "Vec<Type>"
        },
        FunctionArgumentMetadataV14: {
            name: "Text",
            type: "Type",
            typeName: "Option<Type>"
        },
        FunctionMetadataV14: {
            ...l2,
            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"
    }, Fqe = {
        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"
        }
    }, Lqe = {
        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"
        }
    }, zqe = {
        rpc: {},
        runtime: Pqe,
        types: {
            ...Oqe,
            ...Mqe,
            ...Rqe,
            ...Nqe,
            ...Vqe,
            ...Dqe,
            ...Fqe,
            ...Lqe,
            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"
                }
            }
        }
    }, Sm = {
        execute_block: {
            description: "Execute the given block.",
            params: [
                {
                    name: "block",
                    type: "Block"
                }
            ],
            type: "Null"
        }
    }, kD = {
        version: {
            description: "Returns the version of the runtime.",
            params: [],
            type: "RuntimeVersionPre3"
        }
    }, ZS = {
        initialize_block: {
            description: "Initialize a block with the given header.",
            params: [
                {
                    name: "header",
                    type: "Header"
                }
            ],
            type: "Null"
        }
    }, TD = {
        version: {
            description: "Returns the version of the runtime.",
            params: [],
            type: "RuntimeVersion"
        }
    }, Uqe = {
        ...Sm,
        initialize_block: {
            description: "Initialize a block with the given header.",
            params: [
                {
                    name: "header",
                    type: "Header"
                }
            ],
            type: "ExtrinsicInclusionMode"
        }
    }, Hqe = {
        Core: [
            {
                methods: {
                    ...TD,
                    ...Uqe
                },
                version: 5
            },
            {
                methods: {
                    ...TD,
                    ...Sm,
                    ...ZS
                },
                version: 4
            },
            {
                methods: {
                    version: {
                        description: "Returns the version of the runtime.",
                        params: [],
                        type: "RuntimeVersionPre4"
                    },
                    ...Sm,
                    ...ZS
                },
                version: 3
            },
            {
                methods: {
                    ...kD,
                    ...Sm,
                    ...ZS
                },
                version: 2
            },
            {
                methods: {
                    initialise_block: {
                        description: "Initialize a block with the given header.",
                        params: [
                            {
                                name: "header",
                                type: "Header"
                            }
                        ],
                        type: "Null"
                    },
                    ...kD,
                    ...Sm
                },
                version: 1
            }
        ]
    }, jqe = {
        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>"
    }, qqe = {
        Council: "CollectiveOrigin",
        System: "SystemOrigin",
        TechnicalCommittee: "CollectiveOrigin",
        Xcm: "XcmOrigin",
        XcmPallet: "XcmOrigin",
        Authority: "AuthorityOrigin",
        GeneralCouncil: "CollectiveOrigin"
    }, Kqe = {
        rpc: {},
        runtime: Hqe,
        types: {
            ...jqe,
            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"
                ]
            }
        }
    }, Wqe = {
        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>"
        }
    }, $qe = {
        rpc: {},
        types: {
            ...Wqe,
            ...Bqe,
            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"
        }
    }, Xqe = {
        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
            }
        ]
    }, Gqe = {
        rpc: {},
        runtime: Xqe,
        types: {
            TAssetConversion: "Option<MultiLocation>"
        }
    }, Zqe = {
        AssetsApi: [
            {
                methods: {
                    account_balances: {
                        description: "Return the current set of authorities.",
                        params: [
                            {
                                name: "account",
                                type: "AccountId"
                            }
                        ],
                        type: "Vec<(u32, TAssetBalance)>"
                    }
                },
                version: 1
            }
        ]
    }, Jqe = {
        rpc: {},
        runtime: Zqe,
        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"
        }
    }, Yqe = {
        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
            }
        ]
    }, Qqe = {
        rpc: {},
        runtime: Yqe,
        types: {
            RawAuraPreDigest: {
                slotNumber: "u64"
            }
        }
    }, eKe = {
        rpc: {},
        types: {
            UncleEntryItem: {
                _enum: {
                    InclusionHeight: "BlockNumber",
                    Uncle: "(Hash, Option<AccountId>)"
                }
            }
        }
    }, tKe = {
        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>"
        }
    }, ED = {
        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>"
        }
    }, nKe = {
        BabeApi: [
            {
                methods: {
                    configuration: {
                        description: "Return the genesis configuration for BABE. The configuration is only read on genesis.",
                        params: [],
                        type: "BabeGenesisConfiguration"
                    },
                    ...ED
                },
                version: 2
            },
            {
                methods: {
                    configuration: {
                        description: "Return the configuration for BABE. Version 1.",
                        params: [],
                        type: "BabeGenesisConfigurationV1"
                    },
                    ...ED
                },
                version: 1
            }
        ]
    }, rKe = {
        rpc: tKe,
        runtime: nKe,
        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]"
        }
    }, sKe = {
        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
                }
            }
        }
    }, iKe = {
        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"
        }
    }, SQ = {
        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>"
        }
    }, JS = {
        ...SQ,
        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>"
        }
    }, oKe = {
        ...SQ,
        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>"
        }
    }, aKe = {
        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"
        }
    }, cKe = {
        BeefyApi: [
            {
                methods: oKe,
                version: 4
            },
            {
                methods: JS,
                version: 3
            },
            {
                methods: JS,
                version: 2
            },
            {
                methods: JS,
                version: 1
            }
        ],
        BeefyMmrApi: [
            {
                methods: aKe,
                version: 1
            }
        ]
    }, lKe = {
        rpc: iKe,
        runtime: cKe,
        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"
            }
        }
    }, uKe = {
        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
            }
        ]
    }, dKe = {
        rpc: {},
        runtime: uKe,
        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)>"
            }
        }
    }, YS = {
        random_seed: {
            description: "Generate a random seed.",
            params: [],
            type: "Hash"
        }
    }, CD = {
        apply_extrinsic: {
            description: "Apply the given extrinsic.",
            params: [
                {
                    name: "extrinsic",
                    type: "Extrinsic"
                }
            ],
            type: "ApplyExtrinsicResultPre6"
        }
    }, Xb = {
        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>"
        }
    }, a_ = {
        finalize_block: {
            description: "Finish the current block.",
            params: [],
            type: "Header"
        }
    }, fKe = {
        BlockBuilder: [
            {
                methods: {
                    apply_extrinsic: {
                        description: "Apply the given extrinsic.",
                        params: [
                            {
                                name: "extrinsic",
                                type: "Extrinsic"
                            }
                        ],
                        type: "ApplyExtrinsicResult"
                    },
                    ...Xb,
                    ...a_
                },
                version: 6
            },
            {
                methods: {
                    ...CD,
                    ...Xb,
                    ...a_
                },
                version: 5
            },
            {
                methods: {
                    ...YS,
                    ...CD,
                    ...Xb,
                    ...a_
                },
                version: 4
            },
            {
                methods: {
                    ...YS,
                    ...Xb,
                    ...a_
                },
                version: 3
            },
            {
                methods: {
                    finalise_block: {
                        description: "Finish the current block.",
                        params: [],
                        type: "Header"
                    },
                    ...YS,
                    ...Xb
                },
                version: 2
            }
        ]
    }, hKe = {
        rpc: {},
        runtime: fKe,
        types: {
            CheckInherentsResult: {
                okay: "bool",
                fatalError: "bool",
                errors: "InherentData"
            },
            InherentData: {
                data: "BTreeMap<InherentIdentifier, Bytes>"
            },
            InherentIdentifier: "[u8; 8]"
        }
    }, pKe = {
        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"
            }
        }
    }, gKe = {
        rpc: {},
        types: {
            AuthorityId: "AccountId",
            RawVRFOutput: "[u8; 32]"
        }
    }, bKe = {
        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"
        }
    }, ID = {
        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"
        }
    }, mKe = {
        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"
                    },
                    ...ID
                },
                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"
                    },
                    ...ID
                },
                version: 1
            }
        ]
    }, yKe = {
        rpc: bKe,
        runtime: mKe,
        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"
        }
    }, wKe = [
        "None",
        "Locked1x",
        "Locked2x",
        "Locked3x",
        "Locked4x",
        "Locked5x",
        "Locked6x"
    ], _Ke = {
        rpc: {},
        types: {
            AccountVote: {
                _enum: {
                    Standard: "AccountVoteStandard",
                    Split: "AccountVoteSplit"
                }
            },
            AccountVoteSplit: {
                aye: "Balance",
                nay: "Balance"
            },
            AccountVoteStandard: {
                vote: "Vote",
                balance: "Balance"
            },
            Conviction: {
                _enum: wKe
            },
            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"
            }
        }
    }, xKe = {
        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>"
        }
    }, vKe = {
        rpc: xKe,
        types: {
            BlockStats: {
                witnessLen: "u64",
                witnessCompactLen: "u64",
                blockLen: "u64",
                blockNumExtrinsics: "u64"
            }
        }
    }, SKe = {
        AuthorityDiscoveryApi: [
            {
                methods: {
                    authorities: {
                        description: "Retrieve authority identifiers of the current and next authority set.",
                        params: [],
                        type: "Vec<AuthorityId>"
                    }
                },
                version: 1
            }
        ]
    }, kKe = {
        rpc: {},
        runtime: SKe,
        types: {}
    }, TKe = {
        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"
                ]
            }
        }
    }, EKe = {
        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"
        }
    }, CKe = {
        rpc: EKe,
        types: {
            CreatedBlock: {
                _alias: {
                    blockHash: "hash"
                },
                blockHash: "BlockHash",
                aux: "ImportedAux"
            },
            ImportedAux: {
                headerOnly: "bool",
                clearJustificationRequests: "bool",
                needsJustification: "bool",
                badJustification: "bool",
                needsFinalityProof: "bool",
                isNewBest: "bool"
            }
        }
    }, IKe = {
        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"
                ]
            }
        }
    }, AKe = {
        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"
        }
    }, PKe = {
        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
            }
        ]
    }, OKe = {
        rpc: {},
        runtime: PKe,
        types: {
            FungiblesAccessError: {
                _enum: [
                    "AssetIdConversionFailed",
                    "AmountToBalanceConversionFailed"
                ]
            }
        }
    }, MKe = {
        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"
        }
    }, RKe = {
        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
            }
        ]
    }, NKe = {
        rpc: {},
        runtime: RKe,
        types: {
            GenesisBuildErr: "Text"
        }
    }, VKe = {
        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"
            }
        }
    }, BKe = {
        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"
        }
    }, AD = {
        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>"
        }
    }, DKe = {
        GrandpaApi: [
            {
                methods: {
                    current_set_id: {
                        description: "Get current GRANDPA authority set id.",
                        params: [],
                        type: "SetId"
                    },
                    ...AD
                },
                version: 3
            },
            {
                methods: AD,
                version: 2
            }
        ]
    }, FKe = {
        rpc: BKe,
        runtime: DKe,
        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"
                }
            }
        }
    }, LKe = {
        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"
            }
        }
    }, zKe = {
        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>"
            }
        }
    }, UKe = {
        rpc: {},
        types: {
            CallIndex: "(u8, u8)",
            LotteryConfig: {
                price: "Balance",
                start: "BlockNumber",
                length: "BlockNumber",
                delay: "BlockNumber",
                repeat: "bool"
            }
        }
    }, HKe = {
        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
            }
        ]
    }, jKe = {
        rpc: {},
        runtime: HKe,
        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"
            }
        }
    }, qKe = {
        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"
        }
    }, KKe = {
        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>"
        }
    }, WKe = {
        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>"
        }
    }, $Ke = {
        MmrApi: [
            {
                methods: KKe,
                version: 2
            },
            {
                methods: WKe,
                version: 1
            }
        ]
    }, XKe = {
        rpc: qKe,
        runtime: $Ke,
        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>"
            }
        }
    }, GKe = {
        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
            }
        ]
    }, ZKe = {
        rpc: {},
        runtime: GKe,
        types: {
            NftCollectionId: "u32",
            NftItemId: "u32"
        }
    }, JKe = {
        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
            }
        ]
    }, YKe = {
        rpc: {},
        runtime: JKe,
        types: {
            NpApiError: {
                _enum: [
                    "MemberNotFound",
                    "OverflowInPendingRewards"
                ]
            },
            NpPoolId: "u32"
        }
    }, QKe = {
        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"
        }
    }, eWe = {
        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
            }
        ]
    }, tWe = {
        rpc: {},
        runtime: eWe,
        types: {}
    }, nWe = {
        rpc: {},
        types: {
            ProxyDefinition: {
                delegate: "AccountId",
                proxyType: "ProxyType",
                delay: "BlockNumber"
            },
            ProxyType: {
                _enum: [
                    "Any",
                    "NonTransfer",
                    "Governance",
                    "Staking"
                ]
            },
            ProxyAnnouncement: {
                real: "AccountId",
                callHash: "Hash",
                height: "BlockNumber"
            }
        }
    }, rWe = {
        rpc: {},
        types: {
            ActiveRecovery: {
                created: "BlockNumber",
                deposit: "Balance",
                friends: "Vec<AccountId>"
            },
            RecoveryConfig: {
                delayPeriod: "BlockNumber",
                deposit: "Balance",
                friends: "Vec<AccountId>",
                threshold: "u16"
            }
        }
    }, sWe = {
        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)"
        }
    }, iWe = {
        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
            }
        ]
    }, oWe = {
        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)"
    }, aWe = {
        rpc: {},
        runtime: iWe,
        types: {
            ...oWe,
            FullIdentification: "Exposure",
            IdentificationTuple: "(ValidatorId, FullIdentification)",
            MembershipProof: {
                session: "SessionIndex",
                trieNodes: "Vec<Bytes>",
                validatorCount: "ValidatorCount"
            },
            SessionIndex: "u32",
            ValidatorCount: "u32"
        }
    }, cWe = {
        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"
                ]
            }
        }
    }, lWe = {
        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
            }
        ]
    }, uWe = {
        Points: "u32",
        EraPoints: {
            total: "Points",
            individual: "Vec<Points>"
        }
    }, dWe = {
        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"
    }, fWe = {
        rpc: {},
        runtime: lWe,
        types: {
            ...uWe,
            ...dWe,
            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>"
            }
        }
    }, hWe = {
        ValidateStatement: [
            {
                methods: {
                    valdate_statement: {
                        description: "Validate the statement.",
                        params: [
                            {
                                name: "source",
                                type: "StatementStoreStatementSource"
                            },
                            {
                                name: "statement",
                                type: "SpStatementStoreStatement"
                            }
                        ],
                        type: "Result<StatementStoreValidStatement, StatementStoreInvalidStatement>"
                    }
                },
                version: 1
            }
        ]
    }, pWe = {
        rpc: {},
        runtime: hWe,
        types: {
            StatementStoreStatementSource: {
                _enum: [
                    "Chain",
                    "Network",
                    "Local"
                ]
            },
            StatementStoreValidStatement: {
                maxCount: "u32",
                maxSize: "u32"
            },
            StatementStoreInvalidStatement: {
                _enum: [
                    "BadProof",
                    "NoProof",
                    "InternalError"
                ]
            }
        }
    }, gWe = {
        rpc: {},
        types: {
            WeightToFeeCoefficient: {
                coeffInteger: "Balance",
                coeffFrac: "Perbill",
                negative: "bool",
                degree: "u8"
            }
        }
    }, bWe = {
        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"
        }
    }, mWe = {
        rpc: bWe,
        types: {}
    }, yWe = {
        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"
        }
    }, wWe = {
        AccountNonceApi: [
            {
                methods: {
                    account_nonce: {
                        description: "The API to query account nonce (aka transaction index)",
                        params: [
                            {
                                name: "accountId",
                                type: "AccountId"
                            }
                        ],
                        type: "Index"
                    }
                },
                version: 1
            }
        ]
    }, _We = {
        rpc: yWe,
        runtime: wWe,
        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>"
            }
        }
    }, xWe = {
        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"
            }
        }
    }, vWe = {
        rpc: {},
        types: {
            Multiplier: "Fixed128"
        }
    }, SWe = {
        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
            }
        ]
    }, kWe = {
        rpc: {},
        runtime: SWe,
        types: {
            TransactionSource: {
                _enum: [
                    "InBlock",
                    "Local",
                    "External"
                ]
            },
            TransactionValidity: "Result<ValidTransaction, TransactionValidityError>",
            ValidTransaction: {
                priority: "TransactionPriority",
                requires: "Vec<TransactionTag>",
                provides: "Vec<TransactionTag>",
                longevity: "TransactionLongevity",
                propagate: "bool"
            }
        }
    }, TWe = {
        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"
            }
        }
    }, EWe = {
        rpc: {},
        types: {
            Multisig: {
                when: "Timepoint",
                deposit: "Balance",
                depositor: "AccountId",
                approvals: "Vec<AccountId>"
            },
            Timepoint: {
                height: "BlockNumber",
                index: "u32"
            }
        }
    }, CWe = {
        rpc: {},
        types: {
            VestingInfo: {
                locked: "Balance",
                perBlock: "Balance",
                startingBlock: "BlockNumber"
            }
        }
    }, IWe = {
        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: {}
        }
    }, AWe = {
        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"
            }
        }
    }, PWe = {
        rpc: {},
        types: {
            StatementKind: {
                _enum: [
                    "Regular",
                    "Saft"
                ]
            }
        }
    }, OWe = {
        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"
        }
    }, MWe = {
        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
            }
        ]
    }, RWe = {
        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"
        }
    }, NWe = {
        rpc: {},
        runtime: MWe,
        types: RWe
    }, c_ = {
        methods: {
            best_finalized: {
                description: "Returns number and hash of the best finalized header known to the bridge module.",
                params: [],
                type: "(BlockNumber, Hash)"
            }
        },
        version: 1
    }, VWe = {
        KusamaFinalityApi: [
            c_
        ],
        PolkadotFinalityApi: [
            c_
        ],
        RococoFinalityApi: [
            c_
        ],
        WestendFinalityApi: [
            c_
        ]
    }, BWe = {
        rpc: {},
        runtime: VWe,
        types: {}
    }, DWe = {
        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"
        }
    }, ya = {
        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>"
        }
    }, sc = {
        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>"
        }
    }, cl = {
        disputes: {
            description: "Returns all onchain disputes.",
            params: [],
            type: "Vec<(SessionIndex, CandidateHash, DisputeState)>"
        }
    }, Hu = {
        session_executor_params: {
            description: "Returns execution parameters for the session.",
            params: [
                {
                    name: "sessionIndex",
                    type: "SessionIndex"
                }
            ],
            type: "Option<ExecutorParams>"
        }
    }, yf = {
        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)>"
        }
    }, Fp = {
        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"
        }
    }, Gb = {
        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>"
        }
    }, l_ = {
        disabled_validators: {
            description: "Returns a list of all disabled validators at the given block",
            params: [],
            type: "ValidatorIndex"
        }
    }, QS = {
        node_features: {
            description: "Get node features. This is a staging method! Do not use on production runtimes!",
            params: [],
            type: "NodeFeatures"
        }
    }, PD = {
        approval_voting_params: {
            description: "Approval voting configuration parameters",
            params: [],
            type: "ApprovalVotingParams"
        }
    }, FWe = {
        claim_queue: {
            description: "Claim queue",
            params: [],
            type: "BTreeMap<CoreIndex, Vec<u32>>"
        }
    }, LWe = {
        ParachainHost: [
            {
                methods: {
                    ...ya,
                    ...sc,
                    ...cl,
                    ...Hu,
                    ...yf,
                    ...Fp,
                    ...Gb,
                    ...l_,
                    ...QS,
                    ...PD,
                    ...FWe
                },
                version: 11
            },
            {
                methods: {
                    ...ya,
                    ...sc,
                    ...cl,
                    ...Hu,
                    ...yf,
                    ...Fp,
                    ...Gb,
                    ...l_,
                    ...QS,
                    ...PD
                },
                version: 10
            },
            {
                methods: {
                    ...ya,
                    ...sc,
                    ...cl,
                    ...Hu,
                    ...yf,
                    ...Fp,
                    ...Gb,
                    ...l_,
                    ...QS
                },
                version: 9
            },
            {
                methods: {
                    ...ya,
                    ...sc,
                    ...cl,
                    ...Hu,
                    ...yf,
                    ...Fp,
                    ...Gb,
                    ...l_
                },
                version: 8
            },
            {
                methods: {
                    ...ya,
                    ...sc,
                    ...cl,
                    ...Hu,
                    ...yf,
                    ...Fp,
                    ...Gb
                },
                version: 7
            },
            {
                methods: {
                    ...ya,
                    ...sc,
                    ...cl,
                    ...Hu,
                    ...yf,
                    ...Fp
                },
                version: 6
            },
            {
                methods: {
                    ...ya,
                    ...sc,
                    ...cl,
                    ...Hu,
                    ...yf
                },
                version: 5
            },
            {
                methods: {
                    ...ya,
                    ...sc,
                    ...cl,
                    ...Hu
                },
                version: 4
            },
            {
                methods: {
                    ...ya,
                    ...sc,
                    ...cl
                },
                version: 3
            },
            {
                methods: {
                    ...ya,
                    ...sc
                },
                version: 2
            },
            {
                methods: {
                    session_info: {
                        description: "Get the session info for the given session, if stored.",
                        params: [
                            {
                                name: "index",
                                type: "SessionIndex"
                            }
                        ],
                        type: "Option<OldV1SessionInfo>"
                    },
                    ...ya
                },
                version: 1
            }
        ]
    }, OD = {
        _enum: [
            "ZeroZero",
            "ZeroOne",
            "ZeroTwo",
            "ZeroThree",
            "OneOne",
            "OneTwo",
            "OneThree",
            "TwoTwo",
            "TwoThree",
            "ThreeThree"
        ]
    }, MD = {
        _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"
        ]
    }, zWe = {
        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"
    }, UWe = {
        ...zWe,
        AuctionIndex: "u32",
        LeasePeriod: "BlockNumber",
        LeasePeriodOf: "BlockNumber",
        SlotRange10: OD,
        SlotRange: MD,
        WinningData10: `[WinningDataEntry; ${OD._enum.length}]`,
        WinningData: `[WinningDataEntry; ${MD._enum.length}]`,
        WinningDataEntry: "Option<(AccountId, ParaId, BalanceOf)>",
        WinnersData10: "Vec<WinnersDataTuple10>",
        WinnersData: "Vec<WinnersDataTuple>",
        WinnersDataTuple10: "(AccountId, ParaId, BalanceOf, SlotRange10)",
        WinnersDataTuple: "(AccountId, ParaId, BalanceOf, SlotRange)"
    }, HWe = {
        ParachainProposal: {
            proposer: "AccountId",
            genesisHead: "HeadData",
            validators: "Vec<ValidatorId>",
            name: "Bytes",
            balance: "Balance"
        },
        RegisteredParachainInfo: {
            validators: "Vec<ValidatorId>",
            proposer: "AccountId"
        }
    }, jWe = {
        ServiceQuality: {
            _enum: [
                "Ordered",
                "Fast"
            ]
        }
    }, qWe = {
        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"
            }
        }
    }, KWe = {
        rpc: {},
        runtime: LWe,
        types: {
            ...jWe,
            ...qWe,
            ...DWe,
            ...HWe,
            ...UWe,
            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>"
        }
    }, WWe = {
        rpc: {},
        types: {
            Approvals: "[bool; 4]"
        }
    }, $We = {
        rpc: {},
        types: {
            AccountStatus: {
                validity: "AccountValidity",
                freeBalance: "Balance",
                lockedBalance: "Balance",
                signature: "Vec<u8>",
                vat: "Permill"
            },
            AccountValidity: {
                _enum: [
                    "Invalid",
                    "Initiated",
                    "Pending",
                    "ValidLow",
                    "ValidHigh",
                    "Completed"
                ]
            }
        }
    }, XWe = {
        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
            }
        ]
    }, GWe = {
        rpc: {},
        runtime: XWe,
        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 we;
    (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";
    })(we || (we = {}));
    function kQ(t) {
        return Tt(t.eq);
    }
    function TQ(t, e) {
        return Array.isArray(e) ? t.length === e.length && kr(t.find((n, r)=>kQ(n) ? !n.eq(e[r]) : n !== e[r])) : !1;
    }
    class w5 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 = Yr(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 TQ(this, e);
        }
        inspect() {
            return {
                inner: this.inspectInner(),
                outer: [
                    Yr(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 Ao(e ? n : [
                Yr(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 _5 {
        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 ZWe = 64, RD = 52, JWe = new at(1e4), YWe = [
        [
            "Perquintill",
            Vze
        ],
        [
            "Perbill",
            Fx
        ],
        [
            "Permill",
            Nze
        ],
        [
            "Percent",
            Rze
        ]
    ];
    function QWe(t) {
        return Tt(t.toBn);
    }
    function e$e(t, e) {
        return `${(t.mul(JWe).div(e).toNumber() / 100).toFixed(2)}%`;
    }
    function EQ(t, e) {
        if (Ln(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 (rr(t)) {
            if (Nn(t, -1, !0)) return cP(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 (Ja(t) || fp(t)) return t.toString();
            if (Yi(t)) {
                if (QWe(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 EQ(t[n[0]], e);
            } else if (!t) return 0;
        }
        throw new Error(`Unable to create BN from unknown type ${typeof t}`);
    }
    class CQ extends at {
        registry;
        encodedLength;
        isUnsigned;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e;
        constructor(e, n = 0, r = ZWe, s = !1){
            super(Rt(n) ? r <= 48 ? Aze(n.subarray(0, r / 8), {
                isNegative: s
            }) : ou(n.subarray(0, r / 8), {
                isLe: !0,
                isNegative: s
            }).toString() : EQ(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(Nn(e) ? cP(e.toString(), {
                isLe: !1,
                isNegative: !this.isUnsigned
            }) : Ns(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 Lze(this, {
                bitLength: this.bitLength(),
                isLe: e,
                isNegative: !this.isUnsigned
            });
        }
        toHuman(e) {
            const n = this.toRawType();
            if (n === "Balance") return this.isMax() ? "everything" : gp(this, {
                decimals: this.registry.chainDecimals[0],
                withSi: !0,
                withUnit: this.registry.chainTokens[0]
            });
            const [, r] = YWe.find(([s])=>s === n) || [];
            return r ? e$e(this, r) : mT(this);
        }
        toJSON(e = !1) {
            return e || this.#e > 128 || super.bitLength() > RD ? this.toHex() : this.toNumber();
        }
        toPrimitive() {
            return super.bitLength() > RD ? 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 jl(this, {
                bitLength: this.bitLength(),
                isLe: !0,
                isNegative: !this.isUnsigned
            });
        }
    }
    function t$e(t, e) {
        return kr(t) || (kQ(t) ? !t.eq(e) : t !== e);
    }
    function n$e(t) {
        return !Array.isArray(t) || t.length !== 2;
    }
    function e4(t, e) {
        return t.size === e.length && !e.some((n)=>n$e(n) || t$e(t.get(n[0]), n[1]));
    }
    function TP(t, e) {
        return Array.isArray(e) ? e4(t, e) : e instanceof Map ? e4(t, [
            ...e.entries()
        ]) : Yi(e) ? e4(t, Object.entries(e)) : !1;
    }
    function t4(t, e) {
        return t.size === e.length && !e.some((n)=>!t.has(n));
    }
    function r$e(t, e) {
        return Array.isArray(e) ? t4(t, e) : e instanceof Set ? t4(t, [
            ...e.values()
        ]) : Yi(e) ? t4(t, Object.values(e)) : !1;
    }
    const Kx = 1024;
    function IQ(t) {
        const e = t.name?.toLowerCase() || "";
        return [
            "enum",
            "hashmap",
            "linkage",
            "null",
            "option",
            "range",
            "rangeinclusive",
            "result",
            "struct",
            "tuple",
            "vec",
            "vecfixed"
        ].includes(e);
    }
    function EP(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 CP(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(EP(t, "decodeU8a", e, c, n.subarray(o), a, i, r[a], s[a]));
        }
        return [
            e,
            o
        ];
    }
    function s$e(t, e, n, [r, s]) {
        const i = e.length;
        let o = 0, a = 0;
        if (i > Kx && IQ(r[a])) throw new Error(`decodeU8aStruct: Maximum depth exceeded, received ${i} elements, limit ${Kx}`);
        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(EP(t, "decodeU8aStruct", e, c, n.subarray(o), a, i, r[a], s[a]));
        }
        return [
            e,
            o
        ];
    }
    function x5(t, e, n, r, s) {
        const i = e.length;
        if (i > Kx && IQ(s)) throw new Error(`decodeU8aVec: Maximum depth exceeded, received ${i} elements, limit ${Kx}`);
        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(EP(t, "decodeU8aVec", e, c, n.subarray(o), a, i, s));
        }
        return [
            o,
            o - r
        ];
    }
    const CT = [
        "BTreeMap",
        "BTreeSet",
        "HashMap",
        "Vec"
    ], i$e = CT.concat([
        "Compact",
        "DoNotConstruct",
        "Int",
        "Linkage",
        "Range",
        "RangeInclusive",
        "Result",
        "Opaque",
        "Option",
        "UInt",
        "WrapperKeepOpaque",
        "WrapperOpaque"
    ]), Wx = [
        "<",
        "(",
        "[",
        '"',
        ",",
        " "
    ], ND = [
        ic("<T::InherentOfflineReport as InherentOfflineReport>::Inherent", "InherentOfflineReport", !1),
        ic("VecDeque<", "Vec<", !1),
        a$e(),
        VD("Bounded", !0),
        VD("Weak", !1),
        f$e(),
        d$e(),
        h$e("Box<"),
        u$e(),
        ic("String", "Text"),
        ic("Vec<u8>", "Bytes"),
        ic("&\\[u8\\]", "Bytes"),
        ic("&'static\\[u8\\]", "Bytes"),
        ic("RawAddress", "Address"),
        ic("Lookup::Source", "LookupSource"),
        ic("Lookup::Target", "LookupTarget"),
        ic("exec::StorageKey", "ContractStorageKey"),
        c$e(),
        l$e(),
        o$e()
    ];
    function o$e() {
        return (t)=>t.trim();
    }
    function IP(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 ic(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 a$e() {
        return (t)=>{
            if (t.includes(" as HasCompact")) {
                for(let e = 0, n = t.length; e < n; e++)if (t[e] === "<") {
                    const r = IP(t, e + 1) - 14;
                    t.substring(r, r + 14) === " as HasCompact" && (t = `Compact<${t.substring(e + 1, r)}>`);
                }
            }
            return t;
        };
    }
    function c$e() {
        const t = /,\)/g, e = /\(([^,]+)\)/;
        return (n)=>(t.lastIndex = 0, n.replace(t, ")").replace(e, "$1"));
    }
    function AP(t, e, n) {
        let r = -1;
        for(;;){
            if (r = t.indexOf(e, r + 1), r === -1) return t;
            const s = r + e.length, i = IP(t, s);
            t = `${t.substring(0, r)}${n(t.substring(s, i))}${t.substring(i + 1)}`;
        }
    }
    function VD(t, e) {
        return (n)=>{
            for(let r = 0, s = CT.length; r < s; r++){
                const i = CT[r];
                n = AP(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 l$e() {
        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 u$e() {
        return (t)=>{
            for(let e = 0, n = t.length; e < n; e++)if (t[e] === "<" && !i$e.find((s)=>{
                const i = e - s.length;
                return i >= 0 && t.substring(i, e) === s && (i === 0 || Wx.includes(t[i - 1]));
            })) {
                const s = IP(t, e + 1);
                t = `${t.substring(0, e)}${t.substring(s + 1)}`;
            }
            return t;
        };
    }
    function d$e() {
        const t = (e)=>`(${e},${e})`;
        return (e)=>AP(e, "PairOf<", t);
    }
    function f$e() {
        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 h$e(t) {
        const e = (n)=>n;
        return (n)=>AP(n, t, e);
    }
    const BD = new Map;
    function $x(t) {
        const e = t.toString(), n = BD.get(e);
        if (n) return n;
        let r = e;
        for(let s = 0, i = ND.length; s < i; s++)r = ND[s](r);
        return BD.set(e, r), r;
    }
    function DD(t) {
        return t instanceof Uint8Array || Array.isArray(t);
    }
    function FD(t) {
        return sa(t) && Ln(t.index) && sa(t.value);
    }
    function LD(t) {
        return sa(t) && Hy(t.isSome) && sa(t.value);
    }
    function zD(t) {
        return Ln(t) || Ja(t) || fp(t);
    }
    function p$e(t, e) {
        let n = 0;
        const r = Math.min(t.length, e.length);
        for(let s = 0; s < r; ++s)if (n = Sl(t[s], e[s]), n !== 0) return n;
        return t.length - e.length;
    }
    function AQ(t, e, n) {
        if (sa(n)) {
            const r = n.toHex();
            if (e.has(r)) throw new Error(`Duplicate value in ${t}: ${Sn(n)}`);
            e.add(r);
        }
        return !0;
    }
    function Sl(t, e) {
        if (zD(t) && zD(e)) return Ns(t).cmp(Ns(e));
        if (t instanceof Map && e instanceof Map) return Sl(Array.from(t.values()), Array.from(e.values()));
        if (FD(t) && FD(e)) return Sl(t.index, e.index) || Sl(t.value, e.value);
        if (LD(t) && LD(e)) return Sl(t.isNone ? 0 : 1, e.isNone ? 0 : 1) || Sl(t.value, e.value);
        if (DD(t) && DD(e)) return p$e(t, e);
        if (sa(t) && sa(e)) return Sl(t.toU8a(!0), e.toU8a(!0));
        throw new Error(`Attempting to sort unrecognized values: ${Sn(t)} (typeof ${typeof t}) <-> ${Sn(e)} (typeof ${typeof e})`);
    }
    function g$e(t) {
        const e = new Set;
        return new Set(Array.from(t).filter((n)=>AQ("BTreeSet", e, n)).sort(Sl));
    }
    function b$e(t) {
        const e = new Set;
        return new Map(Array.from(t.entries()).filter(([n])=>AQ("BTreeMap", e, n)).sort(([n], [r])=>Sl(n, r)));
    }
    function Ha(t, e) {
        return typeof e == "function" ? e : t.createClassUnsafe(e);
    }
    function m$e(t, e) {
        const n = e.length, r = new Array(n);
        for(let s = 0; s < n; s++)r[s] = Ha(t, e[s]);
        return r;
    }
    function PP(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] = Ha(t, n[i][1]);
        return s;
    }
    function PQ(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 y$e(t, e, n) {
        if (Rt(n)) {
            const [r, s] = (n[0] & 3) < 3 ? pp(n) : g5(n);
            return [
                new e(t, s),
                r
            ];
        } else if (n instanceof Ky) {
            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 Ky {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e;
        #t;
        constructor(e, n, r = 0, { definition: s, setDefinition: i = bp } = {}){
            this.registry = e, this.#e = s || i(Ha(e, n));
            const [o, a] = y$e(e, this.#e, r);
            this.initialU8aLength = a, this.#t = o;
        }
        static with(e) {
            let n;
            const r = (s)=>n = s;
            return class extends Ky {
                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 Ky ? 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 Yr(this.#t.toBn());
        }
        unwrap() {
            return this.#t;
        }
    }
    class v5 {
        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 v5 {
                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 Pc {
        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 Pc || dh(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 w$e(t) {
        const e = Object.values(t);
        if (e.some((n)=>Ln(n))) {
            if (!e.every((n)=>Ln(n) && n >= 0 && n <= 255)) throw new Error("Invalid number-indexed enum definition");
            return !1;
        }
        return !0;
    }
    function _$e(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: Pc,
                index: i
            };
            r = !0, s = !1;
        } else if (w$e(e)) {
            const [i, o] = PP(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 !== Pc), 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: Pc,
                    index: l
                };
            }
            r = !0, s = !0;
        }
        return {
            def: n,
            isBasic: r,
            isIndexed: s
        };
    }
    function OQ(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 MQ(t, e, n, r) {
        const s = OQ(e, n);
        return {
            index: n,
            value: new s(t, r)
        };
    }
    function km(t, e, n = 0, r) {
        const s = OQ(e, n);
        return {
            index: n,
            value: r instanceof s ? r : new s(t, r)
        };
    }
    function UD(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 km(t, e, Object.values(e)[o].index, r);
        } catch (a) {
            throw new Error(`Enum(${n}):: ${a.message}`);
        }
    }
    function x$e(t, e, n, r) {
        if (Ln(r)) return km(t, e, r, n);
        if (Rt(n) || Nn(n)) {
            const s = Ot(n);
            if (s.length) return MQ(t, e, s[0], s.subarray(1));
        } else {
            if (n instanceof ua) return km(t, e, n.index, n.value);
            if (Ln(n)) return km(t, e, n);
            if (rr(n)) return UD(t, e, n.toString());
            if (Yi(n)) {
                const s = Object.keys(n)[0];
                return UD(t, e, s, n[s]);
            }
        }
        return km(t, e, Object.values(e)[0].index);
    }
    class ua {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e;
        #t;
        #n;
        #r;
        #s;
        #i;
        constructor(e, n, r, s, { definition: i, setDefinition: o = bp } = {}){
            const { def: a, isBasic: c, isIndexed: l } = i || o(_$e(e, n)), u = Rt(r) && r.length && !Ln(s) ? MQ(e, a, r[0], r.subarray(1)) : x$e(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 ua {
                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 = dP(s[c]);
                        o[c] = `as${l}`, a[c] = `is${l}`;
                    }
                    zd(this.prototype, a, (c, l, u)=>u.type === s[l]), zd(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 Pc;
        }
        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 Rt(e) ? !this.toU8a().some((n, r)=>n !== e[r]) : Ln(e) ? this.toNumber() === e : this.#r && rr(e) ? this.type === e : Nn(e) ? this.toHex() === e : e instanceof ua ? this.index === e.index && this.value.eq(e.value) : Yi(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 : {
                [$n(this.type)]: this.#i.toJSON()
            };
        }
        toNumber() {
            return this.index;
        }
        toPrimitive(e) {
            return this.#r ? this.type : {
                [$n(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 PQ(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 Sn({
                _enum: this._toRawStruct()
            });
        }
        toString() {
            return this.isNone ? this.type : Sn(this.toJSON());
        }
        toU8a(e) {
            return e ? this.#i.toU8a(e) : Ao([
                new Uint8Array([
                    this.index
                ]),
                this.#i.toU8a(e)
            ]);
        }
    }
    class mu extends CQ {
        constructor(e, n = 0, r){
            super(e, n, r, !0);
        }
        static with(e, n) {
            return class extends mu {
                constructor(r, s){
                    super(r, s, e);
                }
                toRawType() {
                    return n || super.toRawType();
                }
            };
        }
    }
    class Qp extends Pc {
        toRawType() {
            return "None";
        }
    }
    function v$e(t, e, n) {
        return n instanceof e ? n : n instanceof jd ? n.value instanceof e ? n.value : n.isNone ? new Qp(t) : new e(t, n.value) : dh(n) || kr(n) || n === "0x" || n instanceof Qp ? new Qp(t) : Rt(n) ? !n.length || n[0] === 0 ? new Qp(t) : new e(t, n.subarray(1)) : new e(t, n);
    }
    class jd {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e;
        #t;
        constructor(e, n, r, { definition: s, setDefinition: i = bp } = {}){
            const o = s || i(Ha(e, n)), a = Rt(r) && r.length && !sa(r) ? r[0] === 0 ? new Qp(e) : new o(e, r.subarray(1)) : v$e(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 jd {
                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 Qp;
        }
        get isSome() {
            return !this.isNone;
        }
        get value() {
            return this.#t;
        }
        eq(e) {
            return e instanceof jd ? 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 OP extends ua {
        constructor(e, n, r, s){
            super(e, {
                Ok: n,
                Err: r
            }, s);
        }
        static with(e) {
            return class extends OP {
                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 S$e(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 (Nn(n)) return CP(t, e, Ot(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}: ${Sn(n)}`);
    }
    class pb extends w5 {
        #e;
        constructor(e, n, r, { definition: s, setDefinition: i = bp } = {}){
            const o = s || i(Array.isArray(n) ? [
                m$e(e, n),
                []
            ] : Tt(n) || rr(n) ? [
                [
                    Ha(e, n)
                ],
                []
            ] : PP(e, n));
            super(e, o[0].length), this.initialU8aLength = (Rt(r) ? CP(e, this, r, o) : S$e(e, this, r, o))[1], this.#e = o;
        }
        static with(e) {
            let n;
            const r = (s)=>n = s;
            return class extends pb {
                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 Sn(this.toJSON());
        }
        toU8a(e) {
            return Ao(this.toU8aInner(e));
        }
    }
    class yu extends CQ {
        static with(e, n) {
            return class extends yu {
                constructor(r, s){
                    super(r, s, e);
                }
                toRawType() {
                    return n || super.toRawType();
                }
            };
        }
    }
    const HD = 512 * 1024, k$e = ha("Vec");
    function T$e(t) {
        if (Array.isArray(t)) return [
            t,
            t.length,
            0
        ];
        if (Rt(t) || Nn(t)) {
            const e = Ot(t), [n, r] = pp(e);
            if (r > HD) throw new Error(`Vec length ${r.toString()} exceeds ${HD}`);
            return [
                e,
                r,
                n
            ];
        } else if (!t) return [
            null,
            0,
            0
        ];
        throw new Error(`Expected array/hex input to Vec<*> decoding, found ${typeof t}: ${Sn(t)}`);
    }
    function RQ(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 k$e.error(`Unable to decode on index ${o}`, c.message), c;
                }
            }
            return [
                0,
                0
            ];
        } else if (!n) return [
            0,
            0
        ];
        return x5(t, e, Ot(n), r, s);
    }
    class MP extends w5 {
        #e;
        constructor(e, n, r = [], { definition: s, setDefinition: i = bp } = {}){
            const [o, a, c] = T$e(r);
            super(e, a), this.#e = s || i(Ha(e, n)), this.initialU8aLength = (Rt(o) ? x5(e, this, o, c, this.#e) : RQ(e, this, o, c, this.#e))[0];
        }
        static with(e) {
            let n;
            const r = (s)=>n = s;
            return class extends MP {
                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 RP extends w5 {
        #e;
        constructor(e, n, r, s = [], { definition: i, setDefinition: o = bp } = {}){
            super(e, r), this.#e = i || o(Ha(e, n)), this.initialU8aLength = (Rt(s) ? x5(e, this, s, 0, this.#e) : RQ(e, this, s, 0, this.#e))[1];
        }
        static with(e, n) {
            let r;
            const s = (i)=>r = i;
            return class extends RP {
                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 ? Ao(e) : new Uint8Array([]);
        }
        toRawType() {
            return `[${this.Type};${this.length}]`;
        }
    }
    class da extends Uint8Array {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        static get [Symbol.species]() {
            return Uint8Array;
        }
        constructor(e, n, r){
            super(Ot(n)), this.registry = e, this.initialU8aLength = r;
        }
        get encodedLength() {
            return this.length;
        }
        get hash() {
            return this.registry.hash(this.toU8a());
        }
        get isAscii() {
            return qB(this);
        }
        get isEmpty() {
            return !this.length || kr(this.find((e)=>!!e));
        }
        get isUtf8() {
            return tUe(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(Ot(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 (qB(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 Hl(this);
        }
    }
    function E$e(t) {
        if (!t?.length) return [
            0,
            new Uint8Array
        ];
        const [e, n] = pp(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 C$e(t) {
        if (Array.isArray(t) || rr(t)) {
            const e = Ot(t);
            return [
                e.length * 8,
                e
            ];
        }
        return E$e(t);
    }
    class I$e extends da {
        #e;
        #t;
        constructor(e, n, r = !1){
            const [s, i] = C$e(n);
            super(e, i), this.#e = s, this.#t = r;
        }
        get encodedLength() {
            return this.length + Yr(this.#e).length;
        }
        inspect() {
            return {
                outer: [
                    Yr(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 : Ao([
                Yr(this.#e),
                n
            ]);
        }
    }
    function A$e(t) {
        return t;
    }
    function P$e(t, [e, n], r, s) {
        let i;
        const o = Array.isArray(r), a = r instanceof Map, c = n.length;
        if (!o && !a && !Yi(r)) throw new Error(`Struct: Cannot decode value ${Sn(r)} (typeof ${typeof r}), expected an input object, map or array`);
        if (o && r.length !== c) throw new Error(`Struct: Unable to map ${Sn(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, kr(h)) {
                    if (kr(i)) {
                        const b = Object.entries(r);
                        i = {};
                        for(let y = 0, _ = b.length; y < _; y++)Object.prototype.hasOwnProperty.call(r, b[y][0]) && (i[$n(b[y][0])] = b[y][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 (b) {
                let y = p.name;
                try {
                    y = new p(t).toRawType();
                } catch  {}
                throw new Error(`Struct: failed on ${f}: ${y}:: ${b.message}`);
            }
        }
        return [
            l,
            0
        ];
    }
    class qr extends Map {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e;
        #t;
        constructor(e, n, r, s = new Map, { definition: i, setDefinition: o = A$e } = {}){
            const a = i || o(PP(e, n)), [c, l] = Rt(r) || Nn(r) ? s$e(e, new Array(a[0].length), Ot(r), a) : r instanceof qr ? [
                r,
                0
            ] : P$e(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 qr {
                static{
                    const i = Object.keys(e);
                    zd(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 TP(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 || Hy(e) ? e : e[r]),
                name: $n(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 Sn(PQ(this.registry, this.#t));
        }
        toString() {
            return Sn(this.toJSON());
        }
        toU8a(e) {
            const n = [];
            for (const [r, s] of this.entries())n.push(s.toU8a(!e || Hy(e) ? e : e[r]));
            return Ao(n);
        }
    }
    const O$e = ha("Map");
    function M$e(t, e, n, r) {
        const s = new Map, [i, o] = pp(r), a = [];
        for(let u = 0; u < o; u++)a.push(e, n);
        const [c, l] = CP(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 jD(t, e, n, r) {
        const s = new Map;
        for (const [i, o] of r.entries()){
            const a = e.prototype instanceof w5 || e.prototype instanceof qr || e.prototype instanceof ua;
            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 O$e.error("Failed to decode key or value:", c.message), c;
            }
        }
        return [
            e,
            n,
            s,
            0
        ];
    }
    function R$e(t, e, n, r) {
        const s = Ha(t, e), i = Ha(t, n);
        if (r) {
            if (Rt(r) || Nn(r)) return M$e(t, s, i, Ot(r));
            if (r instanceof Map) return jD(t, s, i, r);
            if (Yi(r)) return jD(t, s, i, new Map(Object.entries(r)));
        } else return [
            s,
            i,
            new Map,
            0
        ];
        throw new Error("Map: cannot decode type");
    }
    class NQ extends Map {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e;
        #t;
        #n;
        constructor(e, n, r, s, i = "HashMap"){
            const [o, a, c, l] = R$e(e, n, r, s);
            super(i === "BTreeMap" ? b$e(c) : c), this.registry = e, this.initialU8aLength = l, this.#e = o, this.#t = a, this.#n = i;
        }
        get encodedLength() {
            let e = Yr(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 TP(this, e);
        }
        inspect() {
            const e = [];
            for (const [n, r] of this.entries())e.push(n.inspect()), e.push(r.inspect());
            return {
                inner: e,
                outer: [
                    Yr(this.size)
                ]
            };
        }
        toHex() {
            return nn(this.toU8a());
        }
        toHuman(e, n) {
            const r = {};
            for (const [s, i] of this.entries())r[s instanceof da && !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 da && !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 Sn(this.toJSON());
        }
        toU8a(e) {
            const n = [];
            e || n.push(Yr(this.size));
            for (const [r, s] of this.entries())n.push(r.toU8a(e), s.toU8a(e));
            return Ao(n);
        }
    }
    class NP extends NQ {
        static with(e, n) {
            return class extends NP {
                constructor(r, s){
                    super(r, e, n, s, "BTreeMap");
                }
            };
        }
    }
    const N$e = ha("BTreeSet");
    function V$e(t, e, n) {
        const r = new Set, [s, i] = pp(n), o = new Array(i), [a] = x5(t, o, n, s, e);
        for(let c = 0; c < i; c++)r.add(o[c]);
        return [
            e,
            r,
            a
        ];
    }
    function B$e(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 N$e.error("Failed to decode key or value:", i.message), i;
            }
        }), [
            e,
            r,
            0
        ];
    }
    function D$e(t, e, n) {
        const r = Ha(t, e);
        if (n) {
            if (Rt(n) || Nn(n)) return V$e(t, r, Ot(n));
            if (Array.isArray(n) || n instanceof Set) return B$e(t, r, n);
        } else return [
            r,
            new Set,
            0
        ];
        throw new Error("BTreeSet: cannot decode type");
    }
    class VP extends Set {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e;
        constructor(e, n, r){
            const [s, i, o] = D$e(e, n, r);
            super(g$e(i)), this.registry = e, this.initialU8aLength = o, this.#e = s;
        }
        static with(e) {
            return class extends VP {
                constructor(n, r){
                    super(n, e, r);
                }
            };
        }
        get encodedLength() {
            let e = Yr(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 r$e(this, e);
        }
        inspect() {
            const e = [];
            for (const n of this.values())e.push(n.inspect());
            return {
                inner: e,
                outer: [
                    Yr(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 Sn(this.toJSON());
        }
        toU8a(e) {
            const n = [];
            e || n.push(Yr(this.size));
            for (const r of this.values())n.push(r.toU8a(e));
            return Ao(n);
        }
    }
    const qD = 10 * 1024 * 1024;
    function F$e(t) {
        if (!t.length) return [
            new Uint8Array,
            0
        ];
        const [e, n] = pp(t), r = e + n;
        if (n > qD) throw new Error(`Bytes length ${n.toString()} exceeds ${qD}`);
        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 S5 extends da {
        constructor(e, n){
            const [r, s] = Rt(n) && !(n instanceof da) ? F$e(n) : Array.isArray(n) || rr(n) ? [
                Ot(n),
                0
            ] : [
                n,
                0
            ];
            super(e, r, s);
        }
        get encodedLength() {
            return this.length + Yr(this.length).length;
        }
        inspect(e) {
            const n = Yr(this.length);
            return {
                outer: e ? [
                    super.toU8a()
                ] : this.length ? [
                    n,
                    super.toU8a()
                ] : [
                    n
                ]
            };
        }
        toRawType() {
            return "Bytes";
        }
        toU8a(e) {
            return e ? super.toU8a(e) : hp(this);
        }
    }
    class BP extends NQ {
        static with(e, n) {
            return class extends BP {
                constructor(r, s){
                    super(r, e, n, s);
                }
            };
        }
    }
    class xg extends Boolean {
        registry;
        createdAtHash;
        initialU8aLength = 1;
        isStorageFallback;
        constructor(e, n = !1){
            super(Rt(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 L$e(t, e) {
        return e[0] === 0 ? null : new xg(t, e[0] === 1);
    }
    class z$e extends jd {
        constructor(e, n){
            super(e, xg, Rt(n) || Nn(n) ? L$e(e, Ot(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 k5 extends pb {
        #e;
        constructor(e, n, r, { rangeName: s = "Range" } = {}){
            super(e, [
                n,
                n
            ], r), this.#e = s;
        }
        static with(e) {
            return class extends k5 {
                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 DP extends k5 {
        constructor(e, n, r){
            super(e, n, r, {
                rangeName: "RangeInclusive"
            });
        }
        static with(e) {
            return class extends DP {
                constructor(n, r){
                    super(n, e, r);
                }
            };
        }
    }
    const KD = 128 * 1024;
    function U$e(t) {
        if (Rt(t)) {
            if (!t.length) return [
                "",
                0
            ];
            if (t instanceof da) return [
                Hl(t),
                0
            ];
            const [e, n] = pp(t), r = e + n;
            if (n > KD) throw new Error(`Text: length ${n.toString()} exceeds ${KD}`);
            if (r > t.length) throw new Error(`Text: required length less than remainder, expected at least ${r}, found ${t.length}`);
            return [
                Hl(t.subarray(e, r)),
                r
            ];
        } else if (Nn(t)) return [
            Hl(Dc(t)),
            0
        ];
        return [
            t ? t.toString() : "",
            0
        ];
    }
    class VQ extends String {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e = null;
        constructor(e, n){
            const [r, s] = U$e(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 rr(e) ? this.toString() === e.toString() : !1;
        }
        inspect() {
            const e = za(super.toString());
            return {
                outer: e.length ? [
                    Yr(e.length),
                    e
                ] : [
                    Yr(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 = za(super.toString());
            return e ? n : hp(n);
        }
    }
    class H$e extends VQ {
        constructor(e, n = ""){
            super(e, n), this.setOverride($x(this.toString()));
        }
        toRawType() {
            return "Type";
        }
    }
    function j$e(t, e) {
        const n = Ot(t), r = e / 8;
        if (!n.length) return [
            new Uint8Array(r),
            0
        ];
        if (Rt(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 sf extends da {
        constructor(e, n = new Uint8Array, r = 256){
            const [s, i] = j$e(n, r);
            super(e, s, i);
        }
        static with(e, n) {
            return class extends sf {
                constructor(r, s){
                    super(r, s, e);
                }
                toRawType() {
                    return n || super.toRawType();
                }
            };
        }
        toRawType() {
            return `[u8;${this.length}]`;
        }
    }
    function q$e(t, e, n) {
        const r = Ha(t, e);
        if (Rt(n) || Nn(n)) try {
            const [, i] = Nn(n) ? [
                0,
                Ot(n)
            ] : n instanceof da ? [
                0,
                n.subarray()
            ] : Lx(n);
            return [
                r,
                new r(t, i),
                n
            ];
        } catch  {
            return [
                r,
                null,
                n
            ];
        }
        const s = new r(t, n);
        return [
            r,
            s,
            hp(s.toU8a())
        ];
    }
    class T5 extends S5 {
        #e;
        #t;
        #n;
        constructor(e, n, r, { opaqueName: s = "WrapperKeepOpaque" } = {}){
            const [i, o, a] = q$e(e, n, r);
            super(e, a), this.#e = i, this.#t = o, this.#n = s;
        }
        static with(e) {
            return class extends T5 {
                constructor(n, r){
                    super(n, e, r);
                }
            };
        }
        get isDecoded() {
            return !!this.#t;
        }
        inspect() {
            return this.#t ? {
                inner: [
                    this.#t.inspect()
                ],
                outer: [
                    Yr(this.length)
                ]
            } : {
                outer: [
                    Yr(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 FP extends T5 {
        constructor(e, n, r){
            super(e, n, r, {
                opaqueName: "WrapperOpaque"
            });
        }
        static with(e) {
            return class extends FP {
                constructor(n, r){
                    super(n, e, r);
                }
            };
        }
        get inner() {
            return this.unwrap();
        }
    }
    class E5 extends Number {
        encodedLength;
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e;
        constructor(e, n, { bitLength: r = 32 } = {}){
            super(Rt(n) || Nn(n) ? n.length === 0 ? 0 : Ize(Ot(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 E5 {
                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 Kze(this, {
                bitLength: this.#e
            });
        }
    }
    function K$e(t) {
        return Object.entries(t || {});
    }
    class BQ extends Map {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        constructor(e, n){
            const r = K$e(n);
            super(r), this.registry = e, zd(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 TP(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] = Tt(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] = Tt(s.toPrimitive) ? s.toPrimitive(e) : s, n), {});
        }
        toRawType() {
            return "Json";
        }
        toString() {
            return Sn(this.toJSON());
        }
        toU8a(e) {
            throw new Error("Unimplemented");
        }
    }
    function DQ(t, e) {
        const n = new at(0);
        for(let r = 0, s = e.length; r < s; r++)n.ior(Ns(t[e[r]] || 0));
        return n;
    }
    function W$e(t, e) {
        const n = e.length, r = new Array(n);
        for(let s = 0; s < n; s++){
            const i = e[s];
            if (kr(t[i])) throw new Error(`Set: Invalid key '${i}' passed to Set, allowed ${Object.keys(t).join(", ")}`);
            r[s] = i;
        }
        return r;
    }
    function WD(t, e) {
        const n = Ns(e), r = Object.keys(t), s = [];
        for(let o = 0, a = r.length; o < a; o++){
            const c = r[o];
            n.and(Ns(t[c])).eq(Ns(t[c])) && s.push(c);
        }
        const i = DQ(t, s);
        if (!n.eq(i)) throw new Error(`Set: Mismatch decoding '${n.toString()}', computed as '${i.toString()}' with ${s.join(", ")}`);
        return s;
    }
    function FQ(t, e = 0, n) {
        if (n % 8 !== 0) throw new Error(`Expected valid bitLength, power of 8, found ${n}`);
        const r = n / 8;
        if (Rt(e)) return e.length === 0 ? [] : WD(t, ou(e.subarray(0, r), {
            isLe: !0
        }));
        if (rr(e)) return FQ(t, Ot(e), r);
        if (e instanceof Set || Array.isArray(e)) {
            const s = Array.isArray(e) ? e : [
                ...e.values()
            ];
            return W$e(t, s);
        }
        return WD(t, e);
    }
    class LP extends Set {
        registry;
        createdAtHash;
        initialU8aLength;
        isStorageFallback;
        #e;
        #t;
        constructor(e, n, r, s = 8){
            super(FQ(n, r, s)), this.registry = e, this.#e = n, this.#t = s / 8;
        }
        static with(e, n) {
            return class extends LP {
                static{
                    const r = Object.keys(e), s = r.length, i = new Array(s);
                    for(let o = 0; o < s; o++)i[o] = `is${dP(r[o])}`;
                    zd(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 DQ(this.#e, this.strings);
        }
        add = (e)=>{
            if (this.#e && kr(this.#e[e])) throw new Error(`Set: Invalid key '${e}' on add`);
            return super.add(e), this;
        };
        eq(e) {
            return Array.isArray(e) ? TQ(this.strings.sort(), e.sort()) : e instanceof Set ? this.eq([
                ...e.values()
            ]) : Ln(e) || Ja(e) ? this.valueEncoded.eq(Ns(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 Sn({
                _set: this.#e
            });
        }
        toString() {
            return `[${this.strings.join(", ")}]`;
        }
        toU8a(e) {
            return jl(this.valueEncoded, {
                bitLength: this.#t * 8,
                isLe: !0
            });
        }
    }
    class $D extends E5.with(32) {
        __FloatType = "f32";
    }
    class XD extends E5.with(64) {
        __FloatType = "f64";
    }
    class GD extends mu.with(8) {
        __IntType = "i8";
    }
    class ZD extends mu.with(16) {
        __IntType = "i16";
    }
    class IT extends mu.with(32) {
        __IntType = "i32";
    }
    class JD extends mu.with(64) {
        __IntType = "i64";
    }
    class YD extends mu.with(128) {
        __IntType = "i128";
    }
    class QD extends mu.with(256) {
        __IntType = "i256";
    }
    class eF extends IT {
        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 tF extends yu.with(8) {
        __UIntType = "u8";
    }
    class nF extends yu.with(16) {
        __UIntType = "u16";
    }
    class Wy extends yu.with(32) {
        __UIntType = "u32";
    }
    let na = class extends yu.with(64) {
        __UIntType = "u64";
    };
    class rF extends yu.with(128) {
        __UIntType = "u128";
    }
    class sF extends yu.with(256) {
        __UIntType = "u256";
    }
    class iF extends Wy {
        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 $$e(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 X$e = [
        "_alias",
        "_fallback"
    ];
    function LQ(t) {
        return rr(t) ? t.toString() : Sn(t);
    }
    function G$e(t) {
        const e = Object.values(t);
        if (e.some((n)=>Ln(n))) {
            if (!e.every((n)=>Ln(n) && n >= 0 && n <= 255)) throw new Error("Invalid number-indexed enum definition");
            return !1;
        }
        return !0;
    }
    function Z$e(t, e, n, r) {
        return t.info = we.Enum, t.fallbackType = r, Array.isArray(e) ? t.sub = e.map((s, i)=>({
                index: i,
                info: we.Plain,
                name: s,
                type: "Null"
            })) : G$e(e) ? t.sub = Object.entries(e).map(([s, i], o)=>$e({}, wu(LQ(i || "Null"), {
                name: s
            }, n), {
                index: o
            })) : t.sub = Object.entries(e).map(([s, i])=>({
                index: i,
                info: we.Plain,
                name: s,
                type: "Null"
            })), t;
    }
    function J$e(t, e, n) {
        return t.info = we.Set, t.fallbackType = n, t.length = e._bitLength, t.sub = Object.entries(e).filter(([r])=>!r.startsWith("_")).map(([r, s])=>({
                index: s,
                info: we.Plain,
                name: r,
                type: "Null"
            })), t;
    }
    function Y$e(t, e, n, r) {
        const s = JSON.parse(e), i = Object.keys(s);
        return s._enum ? Z$e(t, s._enum, r, s._fallback) : s._set ? J$e(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)=>!X$e.includes(o)).map((o)=>wu(LQ(s[o]), {
                name: o
            }, r)), t);
    }
    function Q$e(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 = wu(a, {}, r), t;
    }
    function u_(t, e, n, r) {
        return t.sub = n.length === 0 ? [] : $$e(n).map((s)=>wu(s, {}, r)), t;
    }
    function zQ(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 eXe(t, e, n) {
        return zQ(t, e, n, "Int");
    }
    function tXe(t, e, n) {
        return zQ(t, e, n, "UInt");
    }
    function nXe(t, e, n) {
        return t.displayName = e.substring(15, e.length - 1), t;
    }
    function oF(t, [e, n]) {
        return t.startsWith(e) && t.slice(-1 * n.length) === n;
    }
    const rXe = [
        [
            "[",
            "]",
            we.VecFixed,
            Q$e
        ],
        [
            "{",
            "}",
            we.Struct,
            Y$e
        ],
        [
            "(",
            ")",
            we.Tuple,
            u_
        ],
        [
            "BTreeMap<",
            ">",
            we.BTreeMap,
            u_
        ],
        [
            "HashMap<",
            ">",
            we.HashMap,
            u_
        ],
        [
            "Int<",
            ">",
            we.Int,
            eXe
        ],
        [
            "Result<",
            ">",
            we.Result,
            u_
        ],
        [
            "UInt<",
            ">",
            we.UInt,
            tXe
        ],
        [
            "DoNotConstruct<",
            ">",
            we.DoNotConstruct,
            nXe
        ]
    ], sXe = [
        [
            "BTreeSet<",
            ">",
            we.BTreeSet
        ],
        [
            "Compact<",
            ">",
            we.Compact
        ],
        [
            "Linkage<",
            ">",
            we.Linkage
        ],
        [
            "Opaque<",
            ">",
            we.WrapperOpaque
        ],
        [
            "Option<",
            ">",
            we.Option
        ],
        [
            "Range<",
            ">",
            we.Range
        ],
        [
            "RangeInclusive<",
            ">",
            we.RangeInclusive
        ],
        [
            "Vec<",
            ">",
            we.Vec
        ],
        [
            "WrapperKeepOpaque<",
            ">",
            we.WrapperKeepOpaque
        ],
        [
            "WrapperOpaque<",
            ">",
            we.WrapperOpaque
        ]
    ];
    function aF(t, [e, n]) {
        return t.substring(e.length, t.length - n.length);
    }
    function wu(t, { displayName: e, name: n } = {}, r = 0) {
        const s = $x(t), i = {
            displayName: e,
            info: we.Plain,
            name: n,
            type: s
        };
        if (++r > 64) throw new Error("getTypeDef: Maximum nested limit reached");
        const o = rXe.find((c)=>oF(s, c));
        if (o) return i.info = o[2], o[3](i, s, aF(s, o), r);
        const a = sXe.find((c)=>oF(s, c));
        return a && (i.info = a[2], i.sub = wu(aF(s, a), {}, r)), i;
    }
    function $y({ lookupName: t, type: e }) {
        return t || e;
    }
    function Xx(t) {
        if (!Array.isArray(t.sub)) throw new Error(`Expected subtype as TypeDef[] in ${Sn(t)}`);
        return t.sub;
    }
    function iXe(t) {
        if (!t.sub || Array.isArray(t.sub)) throw new Error(`Expected subtype as TypeDef in ${Sn(t)}`);
        return t.sub;
    }
    function UQ(t) {
        return $y(iXe(t));
    }
    function cF(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 ${Sn(i)}`);
            n[i.name] = $y(i);
        }
        return n;
    }
    function AT(t) {
        return Xx(t).map($y);
    }
    function lF(t, { displayName: e, length: n }) {
        if (!Ln(n)) throw new Error(`Expected bitLength information for ${e || t.constructor.name}<bitLength>`);
        return t.with(n, e);
    }
    function uF(t, e) {
        const [n, r] = AT(e);
        return t.with(n, r);
    }
    function wf(t, e) {
        return t.with(UQ(e));
    }
    const oXe = {
        [we.BTreeMap]: (t, e)=>uF(NP, e),
        [we.BTreeSet]: (t, e)=>wf(VP, e),
        [we.Compact]: (t, e)=>wf(Ky, e),
        [we.DoNotConstruct]: (t, e)=>v5.with(e.displayName || e.type),
        [we.Enum]: (t, e)=>{
            const n = Xx(e);
            return ua.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;
            }, {}) : cF(e));
        },
        [we.HashMap]: (t, e)=>uF(BP, e),
        [we.Int]: (t, e)=>lF(mu, e),
        [we.Linkage]: (t, e)=>{
            const n = `Option<${UQ(e)}>`, r = qr.with({
                previous: n,
                next: n
            });
            return r.prototype.toRawType = function() {
                return `Linkage<${this.next.toRawType(!0)}>`;
            }, r;
        },
        [we.Null]: (t, e)=>Pc,
        [we.Option]: (t, e)=>{
            if (!e.sub || Array.isArray(e.sub)) throw new Error("Expected type information for Option");
            return wf(jd, e);
        },
        [we.Plain]: (t, e)=>t.getOrUnknown(e.type),
        [we.Range]: (t, e)=>wf(k5, e),
        [we.RangeInclusive]: (t, e)=>wf(DP, e),
        [we.Result]: (t, e)=>{
            const [n, r] = AT(e);
            return OP.with({
                Err: r,
                Ok: n
            });
        },
        [we.Set]: (t, e)=>LP.with(Xx(e).reduce((n, { index: r, name: s })=>{
                if (!s || !Ln(r)) throw new Error("No name found in sub definition");
                return n[s] = r, n;
            }, {}), e.length),
        [we.Si]: (t, e)=>HQ(t, t.lookup.getTypeDef(e.type)),
        [we.Struct]: (t, e)=>qr.with(cF(e), e.alias),
        [we.Tuple]: (t, e)=>pb.with(AT(e)),
        [we.UInt]: (t, e)=>lF(yu, e),
        [we.Vec]: (t, { sub: e })=>{
            if (!e || Array.isArray(e)) throw new Error("Expected type information for vector");
            return e.type === "u8" ? S5 : MP.with($y(e));
        },
        [we.VecFixed]: (t, { displayName: e, length: n, sub: r })=>{
            if (!Ln(n) || !r || Array.isArray(r)) throw new Error("Expected length & type information for fixed vector");
            return r.type === "u8" ? sf.with(n * 8, e) : RP.with($y(r), n);
        },
        [we.WrapperKeepOpaque]: (t, e)=>wf(T5, e),
        [we.WrapperOpaque]: (t, e)=>wf(FP, e)
    };
    function aXe(t, e) {
        try {
            const n = oXe[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 ${Sn(e)}: ${n.message}`);
        }
    }
    function HQ(t, e) {
        return t.getUnsafe(e.type, !1, e);
    }
    function Um(t, e) {
        return t.getUnsafe(e) || HQ(t, t.isLookupType(e) ? t.lookup.getTypeDef(e) : wu(e));
    }
    function dF(t, e) {
        const n = t.toU8a(), r = t.toRawType();
        if (!(fY(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 cXe(t, [e]) {
        Rt(e) ? dF(t, e) : Nn(e) && dF(t, Ot(e));
    }
    function fF(t, e, n = [], { blockHash: r, isFallback: s, isOptional: i, isPedantic: o } = {}) {
        const a = new (i ? jd.with(e) : e)(t, ...n);
        return o && cXe(a, n), r && (a.createdAtHash = PT(t, "BlockHash", [
            r
        ])), s && (a.isStorageFallback = !0), a;
    }
    function PT(t, e, n = [], r = {}) {
        let s = null, i = null;
        try {
            return s = Um(t, e), fF(t, s, n, r);
        } catch (o) {
            i = new Error(`createType(${e}):: ${o.message}`);
        }
        if (s?.__fallbackType) try {
            return s = Um(t, s.__fallbackType), fF(t, s, n, r);
        } catch  {}
        throw i;
    }
    const lXe = (t)=>t.toString(), uXe = [
        "BTreeMap",
        "BTreeSet",
        "Compact",
        "HashMap",
        "Option",
        "Result",
        "Vec"
    ];
    function dXe(t, e, n = lXe) {
        return `${t}${e ? `<${(Array.isArray(e) ? e : [
            e
        ]).map(n).join(", ")}>` : ""}`;
    }
    function Vo(t, e, n) {
        const { info: r, sub: s } = e;
        switch(r){
            case we.BTreeMap:
            case we.BTreeSet:
            case we.Compact:
            case we.HashMap:
            case we.Linkage:
            case we.Option:
            case we.Range:
            case we.RangeInclusive:
            case we.Result:
            case we.Vec:
            case we.WrapperKeepOpaque:
            case we.WrapperOpaque:
                return dXe(n, s, (i)=>zP(t, i));
        }
        throw new Error(`Unable to encode ${Sn(e)} with params`);
    }
    function hF(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 = $e({}, 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 ${Sn(c)}`);
            i[c.name] = zP(t, c);
        }
        return Sn(n ? {
            _enum: i
        } : i);
    }
    const fXe = {
        [we.BTreeMap]: (t, e)=>Vo(t, e, "BTreeMap"),
        [we.BTreeSet]: (t, e)=>Vo(t, e, "BTreeSet"),
        [we.Compact]: (t, e)=>Vo(t, e, "Compact"),
        [we.DoNotConstruct]: (t, { displayName: e, lookupIndex: n, lookupName: r })=>`DoNotConstruct<${r || e || (kr(n) ? "Unknown" : t.createLookupType(n))}>`,
        [we.Enum]: (t, { sub: e })=>{
            if (!Array.isArray(e)) throw new Error("Unable to encode Enum type");
            return e.every(({ type: n })=>n === "Null") ? Sn({
                _enum: e.map(({ name: n }, r)=>`${n || `Empty${r}`}`)
            }) : hF(t, e, !0);
        },
        [we.HashMap]: (t, e)=>Vo(t, e, "HashMap"),
        [we.Int]: (t, { length: e = 32 })=>`Int<${e}>`,
        [we.Linkage]: (t, e)=>Vo(t, e, "Linkage"),
        [we.Null]: (t, e)=>"Null",
        [we.Option]: (t, e)=>Vo(t, e, "Option"),
        [we.Plain]: (t, { displayName: e, type: n })=>e || n,
        [we.Range]: (t, e)=>Vo(t, e, "Range"),
        [we.RangeInclusive]: (t, e)=>Vo(t, e, "RangeInclusive"),
        [we.Result]: (t, e)=>Vo(t, e, "Result"),
        [we.Set]: (t, { length: e = 8, sub: n })=>{
            if (!Array.isArray(n)) throw new Error("Unable to encode Set type");
            return Sn({
                _set: n.reduce((r, { index: s, name: i }, o)=>$e(r, {
                        [`${i || `Unknown${s || o}`}`]: s || o
                    }), {
                    _bitLength: e || 8
                })
            });
        },
        [we.Si]: (t, { lookupName: e, type: n })=>e || n,
        [we.Struct]: (t, { alias: e, sub: n })=>{
            if (!Array.isArray(n)) throw new Error("Unable to encode Struct type");
            return hF(t, n, !1, e ? {
                _alias: [
                    ...e.entries()
                ].reduce((r, [s, i])=>$e(r, {
                        [s]: i
                    }), {})
            } : {});
        },
        [we.Tuple]: (t, { sub: e })=>{
            if (!Array.isArray(e)) throw new Error("Unable to encode Tuple type");
            return `(${e.map((n)=>zP(t, n)).join(",")})`;
        },
        [we.UInt]: (t, { length: e = 32 })=>`UInt<${e}>`,
        [we.Vec]: (t, e)=>Vo(t, e, "Vec"),
        [we.VecFixed]: (t, { length: e, sub: n })=>{
            if (!Ln(e) || !n || Array.isArray(n)) throw new Error("Unable to encode VecFixed type");
            return `[${n.type};${e}]`;
        },
        [we.WrapperKeepOpaque]: (t, e)=>Vo(t, e, "WrapperKeepOpaque"),
        [we.WrapperOpaque]: (t, e)=>Vo(t, e, "WrapperOpaque")
    };
    function jQ(t, e, n = !0) {
        return n && e.lookupName ? e.lookupName : fXe[e.info](t, e);
    }
    function zP(t, e) {
        return e.displayName && !uXe.some((n)=>e.displayName === n) ? e.displayName : jQ(t, e);
    }
    function to(t, e) {
        return $e({}, e, {
            type: jQ(t, e, !1)
        });
    }
    const hXe = [
        "AssetInstance",
        "Fungibility",
        "Junction",
        "Junctions",
        "MultiAsset",
        "MultiAssetFilter",
        "MultiLocation",
        "Response",
        "WildFungibility",
        "WildMultiAsset",
        "Xcm",
        "XcmError"
    ];
    function Xi(t) {
        return hXe.reduce((e, n)=>$e(e, {
                [n]: `${n}${t}`
            }), {});
    }
    const pXe = {
        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>"
                }
            }
        }
    }, gXe = {
        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>"
                }
            }
        }
    }, bXe = {
        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"
            }
        }
    }, mXe = {
        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>"
    }, yXe = {
        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"
    }, wXe = {
        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"
    }, _Xe = "V5", xXe = {
        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>"
    }, vXe = {
        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"
            }
        }
    }, SXe = {
        rpc: {},
        types: {
            ...vXe,
            ...xXe,
            ...pXe,
            ...gXe,
            ...bXe,
            ...mXe,
            ...yXe,
            ...wXe,
            ...Xi(_Xe),
            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"
        }
    }, kXe = {
        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
            }
        ]
    }, TXe = {
        rpc: {},
        runtime: kXe,
        types: {
            XcmPaymentApiError: {
                _enum: [
                    "Unimplemented",
                    "VersionedConversionFailed",
                    "WeightNotComputable",
                    "UnhandledXcmVersion",
                    "AssetNotFound"
                ]
            }
        }
    }, EXe = {
        LocationToAccountApi: [
            {
                methods: {
                    convert_location: {
                        description: "Converts `Location` to `AccountId`",
                        params: [
                            {
                                name: "location",
                                type: "XcmVersionedLocation"
                            }
                        ],
                        type: "Result<AccountId, Error>"
                    }
                },
                version: 1
            }
        ]
    }, CXe = {
        rpc: {},
        runtime: EXe,
        types: {
            Error: {
                _enum: [
                    "Unsupported",
                    "VersionedConversionFailed"
                ]
            }
        }
    }, IXe = {
        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"
            }
        }
    }, AXe = {
        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"
        }
    }, PXe = {
        ContractConstructorSpecLatest: "ContractConstructorSpecV4",
        ContractEventSpecLatest: "ContractEventSpecV3",
        ContractEventParamSpecLatest: "ContractEventParamSpecV2",
        ContractMessageParamSpecLatest: "ContractMessageParamSpecV2",
        ContractMessageSpecLatest: "ContractMessageSpecV3",
        ContractMetadataLatest: "ContractMetadataV6"
    }, OXe = {
        rpc: {},
        types: {
            ...IXe,
            ...AXe,
            ...PXe,
            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>"
            }
        }
    }, MXe = {
        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"
        }
    }, RXe = {
        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"
        }
    }, NXe = {
        ...MXe,
        ...RXe,
        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"
        }
    }, pF = {
        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"
        }
    }, VXe = {
        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>"
        }
    }, BXe = {
        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: {
                    ...pF
                },
                version: 4
            },
            {
                methods: {
                    ...pF,
                    ...VXe
                },
                version: 5
            }
        ]
    }, DXe = {
        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"
    }, FXe = {
        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"
            }
        }
    }, LXe = {
        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"
            }
        }
    }, zXe = {
        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"
            }
        }
    }, UXe = {
        ...DXe,
        ...FXe,
        ...LXe,
        ...zXe,
        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>"
        }
    }, HXe = {
        rpc: NXe,
        runtime: BXe,
        types: UXe
    }, jXe = {
        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
            }
        ]
    }, qXe = {
        rpc: {},
        runtime: jXe,
        types: {}
    }, KXe = {
        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
            }
        ]
    }, WXe = {
        rpc: {},
        runtime: KXe,
        types: {}
    }, $Xe = {
        TokensApi: [
            {
                methods: {
                    query_existential_deposit: {
                        description: "Query the existential amount for a specific currency",
                        params: [
                            {
                                name: "currencyId",
                                type: "Raw"
                            }
                        ],
                        type: "u128"
                    }
                },
                version: 1
            }
        ]
    }, XXe = {
        rpc: {},
        runtime: $Xe,
        types: {}
    }, GXe = {
        methods: {
            description: "Retrieves the list of RPC methods that are exposed by the node",
            params: [],
            type: "RpcMethods"
        }
    }, ZXe = {
        rpc: GXe,
        types: {
            RpcMethods: {
                version: "u32",
                methods: "Vec<Text>"
            }
        }
    }, JXe = {
        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"
        }
    }, YXe = {
        rpc: JXe,
        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"
                }
            }
        }
    }, QXe = {
        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"
        }
    }, eGe = {
        rpc: QXe,
        types: {
            BlockHash: "Hash"
        }
    }, tGe = {
        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>"
        }
    }, nGe = {
        rpc: tGe,
        types: {
            PrefixedStorageKey: "StorageKey"
        }
    }, rGe = {
        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"
        }
    }, sGe = {
        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
            }
        ]
    }, iGe = {
        rpc: rGe,
        runtime: sGe,
        types: {
            StorageKind: {
                _enum: {
                    PERSISTENT: 1,
                    LOCAL: 2
                }
            }
        }
    }, oGe = {
        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"
        }
    }, d_ = {
        query_fee_details: {
            description: "The transaction fee details",
            params: [
                {
                    name: "uxt",
                    type: "Extrinsic"
                },
                {
                    name: "len",
                    type: "u32"
                }
            ],
            type: "FeeDetails"
        }
    }, n4 = {
        query_call_fee_details: {
            description: "The call fee details",
            params: [
                {
                    name: "call",
                    type: "Call"
                },
                {
                    name: "len",
                    type: "u32"
                }
            ],
            type: "FeeDetails"
        }
    }, r4 = {
        query_info: {
            description: "The transaction info",
            params: [
                {
                    name: "uxt",
                    type: "Extrinsic"
                },
                {
                    name: "len",
                    type: "u32"
                }
            ],
            type: "RuntimeDispatchInfo"
        }
    }, gF = {
        query_call_info: {
            description: "The call info",
            params: [
                {
                    name: "call",
                    type: "Call"
                },
                {
                    name: "len",
                    type: "u32"
                }
            ],
            type: "RuntimeDispatchInfo"
        }
    }, s4 = {
        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"
        }
    }, aGe = {
        TransactionPaymentApi: [
            {
                methods: {
                    ...s4,
                    ...r4,
                    ...d_
                },
                version: 4
            },
            {
                methods: {
                    ...s4,
                    ...r4,
                    ...d_
                },
                version: 3
            },
            {
                methods: {
                    ...r4,
                    ...d_
                },
                version: 2
            },
            {
                methods: {
                    query_info: {
                        description: "The transaction info",
                        params: [
                            {
                                name: "uxt",
                                type: "Extrinsic"
                            },
                            {
                                name: "len",
                                type: "u32"
                            }
                        ],
                        type: "RuntimeDispatchInfo"
                    },
                    ...d_
                },
                version: 1
            }
        ],
        TransactionPaymentCallApi: [
            {
                methods: {
                    ...s4,
                    ...gF,
                    ...n4
                },
                version: 3
            },
            {
                methods: {
                    ...gF,
                    ...n4
                },
                version: 2
            },
            {
                methods: {
                    CALL: {
                        description: "The call info",
                        params: [
                            {
                                name: "call",
                                type: "Call"
                            },
                            {
                                name: "len",
                                type: "u32"
                            }
                        ],
                        type: "RuntimeDispatchInfo"
                    },
                    ...n4
                },
                version: 1
            }
        ]
    }, cGe = {
        rpc: oGe,
        runtime: aGe,
        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"
            }
        }
    }, lGe = {
        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"
        }
    }, uGe = {
        rpc: lGe,
        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"
            }
        }
    }, Gx = Object.freeze(Object.defineProperty({
        __proto__: null,
        assetConversion: Gqe,
        assets: Jqe,
        attestations: IWe,
        aura: Qqe,
        author: YXe,
        authorship: eKe,
        babe: rKe,
        balances: sKe,
        beefy: lKe,
        benchmark: dKe,
        blockbuilder: hKe,
        bridges: AWe,
        chain: eGe,
        childstate: nGe,
        claims: PWe,
        collective: pKe,
        consensus: gKe,
        contracts: yKe,
        contractsAbi: OXe,
        crowdloan: OWe,
        cumulus: NWe,
        democracy: _Ke,
        dev: vKe,
        discovery: kKe,
        dryRunApi: GWe,
        elections: TKe,
        engine: CKe,
        eth: HXe,
        evm: IKe,
        extrinsics: AKe,
        finality: BWe,
        fungibles: OKe,
        genericAsset: MKe,
        genesisBuilder: NKe,
        gilt: VKe,
        grandpa: FKe,
        identity: LKe,
        imOnline: zKe,
        lottery: UKe,
        metadata: zqe,
        mixnet: jKe,
        mmr: XKe,
        nfts: ZKe,
        nimbus: qXe,
        nompools: YKe,
        offchain: iGe,
        offences: QKe,
        ormlOracle: WXe,
        ormlTokens: XXe,
        parachains: KWe,
        payment: cGe,
        poll: WWe,
        pow: tWe,
        proxy: nWe,
        purchase: $We,
        recovery: rWe,
        rpc: ZXe,
        runtime: Kqe,
        scaleInfo: $qe,
        scheduler: sWe,
        session: aWe,
        society: cWe,
        staking: fWe,
        state: uGe,
        statement: pWe,
        support: gWe,
        syncstate: mWe,
        system: _We,
        treasury: xWe,
        txpayment: vWe,
        txqueue: kWe,
        uniques: TWe,
        utility: EWe,
        vesting: CWe,
        xcm: SXe,
        xcmPaymentApi: TXe,
        xcmRuntimeApi: CXe
    }, Symbol.toStringTag, {
        value: "Module"
    })), Hm = {};
    Object.keys(Gx).forEach((t)=>Object.entries(Gx[t].rpc || {}).forEach(([e, n])=>{
            const r = n.aliasSection || t;
            Hm[r] || (Hm[r] = {}), Hm[r][e] = $e({}, n, {
                isSubscription: !!n.pubsub,
                jsonrpc: `${r}_${e}`,
                method: e,
                section: r
            });
        }));
    const bF = ha("PortableRegistry"), mF = {
        toNumber: ()=>-1
    }, dGe = {
        Char: "u32",
        Str: "Text"
    }, fGe = KQ([
        "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::*"
    ]), hGe = KQ([
        "pallet_identity::types::BitFlags"
    ]), qQ = [
        "bitvec::order::Lsb0",
        "BitOrderLsb0"
    ], pGe = [
        "bitvec::order::Msb0",
        "BitOrderMsb0"
    ], yF = [
        ...qQ,
        ...pGe
    ], gGe = [
        "BoundedBTreeMap",
        "BoundedBTreeSet",
        "BoundedVec",
        "Box",
        "BTreeMap",
        "BTreeSet",
        "Cow",
        "Option",
        "Range",
        "RangeInclusive",
        "Result",
        "WeakBoundedVec",
        "WrapperKeepOpaque",
        "WrapperOpaque"
    ], bGe = [
        "entries",
        "keys",
        "new",
        "size",
        "hash",
        "registry"
    ], mGe = [
        "generic",
        "misc",
        "pallet",
        "traits",
        "types"
    ];
    function wF(t) {
        const e = t.length, n = new Array(e);
        for(let r = 0; r < e; r++)n[r] = t[r].toString();
        return n;
    }
    function KQ(t) {
        const e = t.length, n = new Array(e);
        for(let r = 0; r < e; r++)n[r] = t[r].split("::");
        return n;
    }
    function UP(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 : UP(i, o);
            }
            return !1;
        });
    }
    function yGe({ 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 && fGe.some((n)=>UP(n, e)) ? e[e.length - 1].toString() : null;
    }
    function WQ(t, e, n, r, s = !1) {
        const i = r.length;
        if (i === 0 || gGe.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 = dP(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 || !mGe.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 wGe(t, e, { type: { params: n, path: r } }) {
        return WQ(t, e, n, r);
    }
    function _Ge(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 _F(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 xGe(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 = _Ge(a, i, n);
            if (l.length === 1 || !l.some((h)=>c.length !== h.params.length || c.some((b, y)=>!b.name.eq(h.params[y].name) || b.type.unwrapOr(mF).toNumber() !== h.params[y].type.unwrapOr(mF).toNumber()))) return s;
            const d = c.findIndex(({ type: h }, b)=>l.every(({ params: y }, _)=>y[b].type.isSome && (_ === 0 || !y[b].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: b, name: y, params: _ } = l[h], { def: v, path: w } = t.getSiType(_[d].type.unwrap());
                if (!v.isPrimitive && !w.length) return null;
                p[h] = {
                    lookupIndex: b,
                    name: v.isPrimitive ? `${y}${v.asPrimitive.toString()}` : `${y}${w[w.length - 1].toString()}`
                };
            }
            if (_F(p, r)) return s;
            for(let h = 0; h < f; h++){
                const { lookupIndex: b, name: y, params: _ } = l[h], { def: v, path: w } = t.getSiType(_[d].type.unwrap()), E = WQ(e, b, _, w, !0);
                if (v.isPrimitive || !E) return null;
                p[h] = {
                    lookupIndex: b,
                    name: `${y}${E.name}`
                };
            }
            return _F(p, r) ? s : null;
        }).filter((s)=>!!s).map(({ lookupIndex: s, name: i, params: o })=>({
                lookupIndex: s,
                name: r[s] || i,
                params: o
            }));
    }
    function vGe(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 SGe(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 && bF.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 && bF.warn("Unable to determine runtime Event type, cannot inspect frame_system::EventRecord");
        return r;
    }
    function kGe(t, e) {
        const n = [], r = {};
        for(let c = 0, l = e.length; c < l; c++){
            const u = e[c], d = u.id.toNumber(), f = wGe(e, d, e[c]);
            f && n.push(f), r[d] = u;
        }
        const s = {}, i = {}, o = {}, a = xGe(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 TGe extends qr {
        #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 } = kGe(this, this.types);
            this.#e = SGe(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() {
            vGe(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: we.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 === we.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 = $n(e.unwrap()), n.includes("#") ? (r = n, n = r.replace(/#/g, "_")) : bGe.includes(n) && (r = n, n = `${n}_`)), [
                n,
                r
            ];
        }
        #o(e) {
            const n = this.getTypeDef(e), r = e.toNumber();
            return [
                we.DoNotConstruct,
                we.Enum,
                we.Struct
            ].includes(n.info) && n.lookupName ? {
                docs: n.docs,
                info: we.Si,
                lookupIndex: r,
                lookupName: this.#n[r],
                type: this.registry.createLookupType(e)
            } : n;
        }
        #a(e) {
            if (rr(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 (Ln(e)) return e;
            return e.toNumber();
        }
        #l(e, n) {
            const r = e.path.join("::");
            let s;
            const i = this.#e[n] || yGe(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.#h(n, e.def.asCompact);
                        break;
                    case "Composite":
                        s = this.#p(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:
                        gze(e.def.type);
                }
            } catch (o) {
                throw new Error(`PortableRegistry: ${n}${r ? ` (${r})` : ""}: Error extracting ${Sn(e)}: ${o.message}`);
            }
            return $e({
                docs: wF(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 to(this.registry, {
                info: we.VecFixed,
                length: s,
                sub: this.#o(r)
            });
        }
        #y(e, { bitOrderType: n, bitStoreType: r }) {
            const s = this.#o(n), i = this.#o(r), [o, a] = yF.includes(s.namespace || "") ? [
                s,
                i
            ] : [
                i,
                s
            ];
            if (!o.namespace || !yF.includes(o.namespace)) throw new Error(`Unexpected bitOrder found as ${o.namespace || "<unknown>"}`);
            if (a.info !== we.Plain || a.type !== "u8") throw new Error(`Only u8 bitStore is currently supported, found ${a.type}`);
            return qQ.includes(o.namespace), {
                info: we.Plain,
                type: "BitVec"
            };
        }
        #h(e, { type: n }) {
            return to(this.registry, {
                info: we.Compact,
                sub: this.#o(n)
            });
        }
        #p(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 to(this.registry, {
                        info: we.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 to(this.registry, {
                        info: we.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 to(this.registry, {
                        info: i === "Range" ? we.Range : we.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 to(this.registry, {
                        info: o === "WrapperKeepOpaque" ? we.WrapperKeepOpaque : we.WrapperOpaque,
                        sub: this.#o(n[0].type.unwrap()),
                        type: o
                    });
                }
            }
            return hGe.some((i)=>UP(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 to(this.registry, {
                info: we.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: we.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: we.Null,
                type: "Null"
            };
            if (s && i === 1) {
                const c = this.#o(n[0].type);
                return $e({}, 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 to(this.registry, $e({
                info: s ? we.Tuple : we.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] = $e({
                        docs: wF(o),
                        name: d
                    }, u, l.isSome ? {
                        typeName: $x(l.unwrap())
                    } : null);
                }
            }
            return [
                s,
                n
            ];
        }
        #g(e, n) {
            return $e({
                displayName: n.toString(),
                isFromSi: !0
            }, wu(n));
        }
        #c(e, n) {
            const r = n.def.asPrimitive.type.toString();
            return {
                info: we.Plain,
                type: dGe[r] || r.toLowerCase()
            };
        }
        #w(e, n) {
            return {
                info: we.Plain,
                type: n
            };
        }
        #_(e, { type: n }) {
            const r = this.#o(n);
            return r.type === "u8" ? {
                info: we.Plain,
                type: "Bytes"
            } : to(this.registry, {
                info: we.Vec,
                lookupIndex: e,
                lookupName: this.#n[e],
                sub: r
            });
        }
        #m(e, n) {
            if (n.length === 0) return {
                info: we.Null,
                type: "Null"
            };
            if (n.length === 1) return this.getTypeDef(n[0]);
            const r = n.map((s)=>this.#o(s));
            return to(this.registry, {
                info: we.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 to(this.registry, {
                        info: we.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 to(this.registry, {
                        info: we.Result,
                        sub: n.map(({ type: o }, a)=>$e({
                                name: [
                                    "Ok",
                                    "Error"
                                ][a]
                            }, this.#o(o.unwrap())))
                    });
                }
            }
            return s.length === 0 ? {
                info: we.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: we.Null,
                    name: `__Unused${r.length}`,
                    type: "Null"
                });
                r.push($e(this.#b(-1, s), {
                    index: a,
                    name: o.toString()
                }));
            }), to(this.registry, {
                info: we.Enum,
                lookupIndex: e,
                lookupName: this.#n[e],
                sub: r
            });
        }
    }
    function HP(t, e = []) {
        for(let n = 0, r = t.length; n < r; n++){
            const s = t[n];
            Array.isArray(s) ? HP(s, e) : e.push(s);
        }
        return [
            ...new Set(e)
        ];
    }
    function Xy(t, e) {
        const n = t.getTypeDef(e);
        return n.lookupName || n.type;
    }
    function oc(t, { sub: e }) {
        const { lookupName: n, type: r } = e;
        return jP([
            n || r
        ]);
    }
    function _f(t, { sub: e }) {
        return jP(e.map(({ lookupName: n, type: r })=>n || r));
    }
    function Zb(t, { info: e }) {
        throw new Error(`Unhandled: Unable to create and validate type from ${t} (info=${we[e]})`);
    }
    const EGe = {
        [we.BTreeMap]: _f,
        [we.BTreeSet]: oc,
        [we.Compact]: oc,
        [we.DoNotConstruct]: Zb,
        [we.Enum]: _f,
        [we.HashMap]: _f,
        [we.Int]: Zb,
        [we.Linkage]: oc,
        [we.Null]: Zb,
        [we.Option]: oc,
        [we.Plain]: (t, e)=>e.lookupName || e.type,
        [we.Range]: oc,
        [we.RangeInclusive]: oc,
        [we.Result]: _f,
        [we.Set]: _f,
        [we.Si]: Zb,
        [we.Struct]: _f,
        [we.Tuple]: _f,
        [we.UInt]: Zb,
        [we.Vec]: oc,
        [we.VecFixed]: oc,
        [we.WrapperKeepOpaque]: oc,
        [we.WrapperOpaque]: oc
    };
    function jP(t) {
        const e = t.length, n = new Array(e);
        for(let r = 0; r < e; r++){
            const s = t[r], i = wu(s);
            n[r] = EGe[i.info](s, i);
        }
        return n;
    }
    const CGe = ha("metadata");
    function IGe(t, e, n) {
        const r = HP(jP(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);
            CGe.warn(s);
        }
        return n;
    }
    function $Q(t, e) {
        return e.map(({ type: n })=>t.getTypeDef(n).type);
    }
    function xF(t, e) {
        return t.getSiType(e).def.asVariant.variants.map(({ fields: n })=>$Q(t, n));
    }
    function AGe({ lookup: t, pallets: e }) {
        return e.reduce((n, { calls: r, constants: s, events: i, storage: o })=>(n.push([
                $Q(t, s)
            ]), r.isSome && n.push(xF(t, r.unwrap().type)), i.isSome && n.push(xF(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 PGe(t, e, n) {
        return IGe(t, n, HP(AGe(e)));
    }
    function OGe(t) {
        const e = t.map((r)=>r.toString().trim()), n = e.findIndex((r)=>!r.length);
        return n === -1 ? e : e.slice(0, n);
    }
    function MGe(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: $e({}, i, {
                                    docs: OGe(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 XQ(t) {
        return t.isPlain ? t.asPlain : t.asMap.value;
    }
    function OT(t, e, n) {
        const r = Xy(t.lookup, XQ(e));
        return n ? `Option<${r}>` : r;
    }
    function gb(t, { type: e }, n, r) {
        const s = {}, i = t.getSiType(e).def.asVariant.variants;
        for(let o = 0, a = i.length; o < a; o++)si(s, i[o], r, n, o);
        return s;
    }
    const oo = {
        extrinsic: {},
        payload: {}
    }, RGe = {
        LimitParathreadCommits: oo,
        OnlyStakingAndClaims: oo,
        PrevalidateAttests: oo,
        RestrictFunctionality: oo,
        TransactionCallFilter: oo,
        ValidateDoubleVoteReports: oo
    }, NGe = {
        DisallowSigned: oo
    }, VGe = {
        ChargeAssetTxPayment: {
            extrinsic: {
                tip: "Compact<Balance>",
                assetId: "TAssetConversion"
            },
            payload: {}
        }
    }, BGe = {
        extrinsic: {
            mode: "u8"
        },
        payload: {
            metadataHash: "Option<[u8;32]>"
        }
    }, vF = {
        extrinsic: {
            era: "ExtrinsicEra"
        },
        payload: {
            blockHash: "Hash"
        }
    }, SF = {
        extrinsic: {
            tip: "Compact<Balance>"
        },
        payload: {}
    }, DGe = {
        ChargeTransactionPayment: SF,
        CheckBlockGasLimit: oo,
        CheckEra: vF,
        CheckGenesis: {
            extrinsic: {},
            payload: {
                genesisHash: "Hash"
            }
        },
        CheckMetadataHash: BGe,
        CheckMortality: vF,
        CheckNonZeroSender: oo,
        CheckNonce: {
            extrinsic: {
                nonce: "Compact<Index>"
            },
            payload: {}
        },
        CheckSpecVersion: {
            extrinsic: {},
            payload: {
                specVersion: "u32"
            }
        },
        CheckTxVersion: {
            extrinsic: {},
            payload: {
                transactionVersion: "u32"
            }
        },
        CheckVersion: {
            extrinsic: {},
            payload: {
                specVersion: "u32"
            }
        },
        CheckWeight: oo,
        LockStakingStatus: oo,
        SkipCheckIfFeeless: SF,
        ValidateEquivocationReport: oo,
        WeightReclaim: oo
    }, GQ = $e({}, DGe, RGe, NGe, VGe), i4 = [
        "CheckVersion",
        "CheckGenesis",
        "CheckEra",
        "CheckNonce",
        "CheckWeight",
        "ChargeTransactionPayment",
        "CheckBlockGasLimit"
    ];
    function FGe(t, e = {}) {
        const n = [
            ...Object.keys(GQ),
            ...Object.keys(e)
        ];
        return t.filter((r)=>!n.includes(r));
    }
    function kF(t, e, n = {}) {
        return t.map((r)=>n[r] || GQ[r]).filter((r)=>!!r).reduce((r, s)=>$e(r, s[e]), {});
    }
    function LGe(t, e) {
        if (!e?.length) return {
            DataType: Pc
        };
        const n = e.subarray(0, 2);
        return {
            DataType: t.findMetaEvent(n),
            value: {
                data: e.subarray(2),
                index: n
            }
        };
    }
    class ZQ extends pb {
        #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, zd(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 zGe extends qr {
        constructor(e, n){
            const { DataType: r, value: s } = LGe(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 $e({
                method: this.method,
                section: this.section
            }, e ? {
                docs: this.meta.docs.map((r)=>r.toString())
            } : null, super.toHuman(e, n));
        }
    }
    const MT = 128, UGe = 0, gh = new Uint8Array, qP = new Uint8Array([
        0
    ]), JQ = 127, YQ = "bare", KP = 4, TF = 63, QQ = 192, HGe = 0, jGe = 64, eee = 4, EF = [
        "ExtrinsicUnknown",
        "ExtrinsicUnknown",
        "ExtrinsicUnknown",
        "ExtrinsicUnknown",
        "ExtrinsicV4",
        "ExtrinsicV5"
    ], qGe = {
        bare: "ExtrinsicV5",
        general: "GeneralExtrinsic"
    }, CF = {
        bare: HGe,
        general: jGe
    }, u2 = {
        0: "bare",
        64: "general"
    };
    function jm(t, e, n, r) {
        if (e instanceof WP) return e.unwrap();
        const s = (n & MT) === MT, i = (n & TF) === 5 ? qGe[r] : EF[n & TF] || EF[0];
        return t.createTypeUnsafe(i, [
            e,
            {
                isSigned: s,
                version: n
            }
        ]);
    }
    function KGe(t, e, n = eee, r = YQ) {
        return Rt(e) || Array.isArray(e) || Nn(e) ? WGe(t, Ot(e), n, r) : e instanceof t.createClassUnsafe("Call") ? jm(t, {
            method: e
        }, n, r) : jm(t, e, n, r);
    }
    function WGe(t, e, n, r) {
        if (!e.length) return jm(t, new Uint8Array, n, r);
        const [s, i] = g5(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] & QQ;
        return u2[`${c}`] === "general" ? jm(t, e, a[0], u2[`${c}`] || r) : jm(t, a.subarray(1), a[0], u2[`${c}`] || r);
    }
    class $Ge extends _5 {
        #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++)uP(this, i[c], a);
            }
            const o = this.type & QQ;
            this.#e = s || u2[`${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 <= eee) return this.type | (this.isSigned ? MT : UGe);
            if (this.isSigned) throw new Error("Signed Extrinsics are currently only available for ExtrinsicV4");
            return this.type | (this.isGeneral() ? CF.general : CF.bare);
        }
        is(e) {
            return this.method.is(e);
        }
        unwrap() {
            return super.unwrap();
        }
    }
    class WP extends $Ge {
        #e;
        static LATEST_EXTRINSIC_VERSION = KP;
        constructor(e, n, { preamble: r, version: s } = {}){
            const o = e.metadata.extrinsic.versions.length ? e.metadata.extrinsic.versions[0] : void 0;
            super(e, KGe(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 = Ii(...this.toU8aInner());
            return {
                inner: this.isSigned ? this.inner.inspect().inner : this.inner.method.inspect().inner,
                outer: [
                    Yr(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 $e({}, {
                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 = Ii(...this.toU8aInner());
            return e ? n : hp(n);
        }
        toU8aInner() {
            return [
                new Uint8Array([
                    this.version
                ]),
                this.inner.toU8a()
            ];
        }
    }
    function XGe(t) {
        const e = t.toString(2);
        let n = 0;
        for(; e[e.length - 1 - n] === "0";)n++;
        return n;
    }
    function GGe(t, e) {
        if (Rt(e) || Nn(e) || Array.isArray(e)) return JGe(t, Ot(e));
        if (e) {
            if (Yi(e)) return ZGe(t, e);
        } else return [
            new na(t),
            new na(t)
        ];
        throw new Error("Invalid data passed to Mortal era");
    }
    function ZGe(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 na(t, s),
            new na(t, a)
        ];
    }
    function JGe(t, e) {
        if (e.length === 0) return [
            new na(t),
            new na(t)
        ];
        const n = ou(e.subarray(0, 1)).toNumber(), r = ou(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 na(t, i),
            new na(t, a)
        ];
    }
    function RT(t = new Uint8Array) {
        if (Rt(t)) return !t.length || t[0] === 0 ? new Uint8Array([
            0
        ]) : new Uint8Array([
            1,
            t[0],
            t[1]
        ]);
        if (t) {
            if (t instanceof ree) return RT(t.toU8a());
            if (Nn(t)) return RT(Dc(t));
            if (Yi(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 tee extends da {
        constructor(e, n){
            super(e, qP);
        }
    }
    class nee extends pb {
        constructor(e, n){
            super(e, {
                period: na,
                phase: na
            }, GGe(e, n));
        }
        get encodedLength() {
            return 2;
        }
        get period() {
            return this[0];
        }
        get phase() {
            return this[1];
        }
        toHuman() {
            return {
                period: mT(this.period),
                phase: mT(this.phase)
            };
        }
        toJSON() {
            return this.toHex();
        }
        toU8a(e) {
            const n = this.period.toNumber(), r = Math.min(15, Math.max(1, XGe(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(Ns(e).toNumber(), n) - n) / r) * r + n;
        }
        death(e) {
            return this.birth(e) + this.period.toNumber();
        }
    }
    class ree extends ua {
        constructor(e, n){
            super(e, {
                ImmortalEra: tee,
                MortalEra: nee
            }, RT(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 IF = [
        "ExtrinsicPayloadUnknown",
        "ExtrinsicPayloadUnknown",
        "ExtrinsicPayloadUnknown",
        "ExtrinsicPayloadUnknown",
        "ExtrinsicPayloadV4",
        "ExtrinsicPayloadV5"
    ], YGe = {
        bare: "ExtrinsicPayloadV5",
        general: "ExtrinsicPayloadV5"
    };
    function see(t, e) {
        const n = e?.assetId;
        if (n && Nn(n)) {
            const r = t.createType("TAssetConversion", Dc(n));
            if (n === "0x00" || n === "0x01" + r.toHex().slice(2)) return {
                ...e,
                assetId: r.toJSON()
            };
        }
        return e;
    }
    function QGe(t, e, n = KP, r = YQ) {
        if (e instanceof iee) return e.unwrap();
        const s = n === 5 ? YGe[r] : IF[n] || IF[0], i = see(t, e);
        return t.createTypeUnsafe(s, [
            i,
            {
                version: n
            }
        ]);
    }
    class iee extends _5 {
        constructor(e, n, { preamble: r, version: s } = {}){
            super(e, QGe(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 eZe extends qr {
        constructor(e, n, { version: r = 0 } = {}){
            throw super(e, {}), new Error(`Unsupported extrinsic payload version ${r}`);
        }
    }
    class tZe extends qr {
        constructor(e, n, { isSigned: r = !1, version: s = 0 } = {}){
            throw super(e, {}), new Error(`Unsupported ${r ? "" : "un"}signed extrinsic version ${s & JQ}`);
        }
    }
    const AF = {
        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 nZe extends qr {
        #e;
        constructor(e, n){
            const r = $e({}, e.getSignedExtensionTypes(), e.getSignedExtensionExtra());
            super(e, $e({}, r, AF, {
                withSignedTransaction: "bool"
            }), n), this.#e = {};
            const s = (i)=>this.get(i);
            for (const [i, o] of Object.entries(r))AF[i] || (this.#e[i] = o), uP(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 jd) || o.isSome) && (e[i] = o.toJSON());
            }
            return $e(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 rZe = 4;
    class Zx extends qr {
        constructor(e, n, { isSigned: r } = {}){
            super(e, {
                signature: "ExtrinsicSignatureV4",
                method: "Call"
            }, Zx.decodeExtrinsic(e, n, r));
        }
        static decodeExtrinsic(e, n, r = !1) {
            if (n instanceof Zx) return n;
            if (n instanceof e.createClassUnsafe("Call")) return {
                method: n
            };
            if (Rt(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 rZe;
        }
        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 sZe(t, e, n, r) {
        const s = n.length > 256 ? Wl(n) : n;
        return e.sign(s, r);
    }
    class NT extends qr {
        #e;
        constructor(e, n){
            super(e, $e({
                method: "Bytes"
            }, e.getSignedExtensionTypes(), e.getSignedExtensionExtra()), see(e, n)), this.#e = {
                withType: e.createTypeUnsafe("ExtrinsicSignature", []) instanceof ua
            };
        }
        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 sZe(this.registry, e, this.toU8a({
                method: !0
            }), this.#e);
        }
    }
    const iZe = new Uint8Array(256).fill(1);
    function o4(t, e) {
        return t.createTypeUnsafe("Address", [
            Rt(e) ? nn(e) : e
        ]);
    }
    class Jx extends qr {
        #e;
        constructor(e, n, { isSigned: r } = {}){
            const s = e.getSignedExtensionTypes();
            super(e, $e({
                signer: "Address",
                signature: "ExtrinsicSignature"
            }, s), Jx.decodeExtrinsicSignature(n, r)), this.#e = Object.keys(s), zd(this, this.#e, (i)=>this.get(i));
        }
        static decodeExtrinsicSignature(e, n = !1) {
            if (e) {
                if (e instanceof Jx) return e;
            } else return gh;
            return n ? e : gh;
        }
        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);
                kr(a) || this.set(o, a);
            }
            return this.set("signer", e), this.set("signature", n), this;
        }
        addSignature(e, n, r) {
            return this._injectSignature(o4(this.registry, e), this.registry.createTypeUnsafe("ExtrinsicSignature", [
                n
            ]), new NT(this.registry, r));
        }
        createPayload(e, n) {
            const { era: r, runtimeVersion: { specVersion: s, transactionVersion: i } } = n;
            return new NT(this.registry, $e({}, n, {
                era: r || qP,
                method: e.toHex(),
                specVersion: s,
                transactionVersion: i
            }));
        }
        sign(e, n, r) {
            if (!n?.addressRaw) throw new Error(`Expected a valid keypair for signing, found ${Sn(n)}`);
            const s = this.createPayload(e, r);
            return this._injectSignature(o4(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 ${Sn(n)}`);
            const s = this.createPayload(e, r);
            return this._injectSignature(o4(this.registry, n), this.registry.createTypeUnsafe("ExtrinsicSignature", [
                iZe
            ]), s);
        }
        toU8a(e) {
            return this.isSigned ? super.toU8a(e) : gh;
        }
    }
    const oZe = 5;
    class Yx extends qr {
        constructor(e, n, { isSigned: r } = {}){
            super(e, {
                signature: "ExtrinsicSignatureV5",
                method: "Call"
            }, Yx.decodeExtrinsic(e, n, r));
        }
        static decodeExtrinsic(e, n, r = !1) {
            if (n instanceof Yx) return n;
            if (n instanceof e.createClassUnsafe("Call")) return {
                method: n
            };
            if (Rt(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 oZe;
        }
        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 oee extends qr {
        constructor(e, n){
            super(e, $e({
                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 Qx extends qr {
        #e;
        constructor(e, n, { isSigned: r } = {}){
            const s = e.getSignedExtensionTypes();
            super(e, $e({
                signer: "Address",
                signature: "ExtrinsicSignature",
                transactionExtensionVersion: "u8"
            }, s), Qx.decodeExtrinsicSignature(n, r)), this.#e = Object.keys(s), zd(this, this.#e, (i)=>this.get(i));
        }
        static decodeExtrinsicSignature(e, n = !1) {
            if (e) {
                if (e instanceof Qx) return e;
            } else return gh;
            return n ? e : gh;
        }
        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 oee(this.registry, $e({}, n, {
                era: r || qP,
                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) : gh;
        }
    }
    function aZe(t) {
        if (!t.length) return new Uint8Array;
        const [e, n] = g5(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] & JQ}`);
        return s.subarray(1);
    }
    class ev extends qr {
        #e;
        #t;
        constructor(e, n, r){
            const s = e.getSignedExtensionTypes();
            super(e, $e({
                transactionExtensionVersion: "u8"
            }, s, {
                method: "Call"
            }), ev.decodeExtrinsic(e, n)), this.#e = r?.version || 5, this.#t = 64;
        }
        static decodeExtrinsic(e, n) {
            if (n) {
                if (n instanceof ev) return n;
                if (Rt(n) || Array.isArray(n) || Nn(n)) return aZe(Ot(n));
                if (Yi(n)) {
                    const { payload: r, transactionExtensionVersion: s } = n;
                    return $e(r || {}, {
                        transactionExtensionVersion: s || e.getTransactionExtensionVersion()
                    });
                }
            } else return gh;
            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() : hp(this.encode());
        }
        toRawType() {
            return "GeneralExt";
        }
        encode() {
            return Ii(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 PF(t) {
        if (Rt(t) || Array.isArray(t)) return Ot(t);
        if (t) {
            if (Nn(t)) return Dc(t);
            if (rr(t)) return rf(t.toString());
        } else return new Uint8Array;
        throw new Error(`Unknown type passed to AccountId constructor, found typeof ${typeof t}`);
    }
    class aee extends sf {
        constructor(e, n = 264, r){
            const s = PF(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(PF(e));
        }
        toHuman() {
            return this.toJSON();
        }
        toJSON() {
            return this.toString();
        }
        toPrimitive() {
            return this.toJSON();
        }
        toString() {
            return wQ(this, this.registry.chainSS58);
        }
        toRawType() {
            return "AccountId";
        }
    }
    class tv extends aee {
        constructor(e, n){
            super(e, 256, n);
        }
    }
    class cZe extends aee {
        constructor(e, n){
            super(e, 264, n);
        }
    }
    const lZe = 239, OF = 252, MF = 253, RF = 254, uZe = new at(lZe), dZe = new at(1).shln(16), fZe = new at(1).shln(32);
    function cee(t) {
        return t instanceof _s ? t.toBn() : Ja(t) || Ln(t) || Nn(t) || Rt(t) || fp(t) ? t : cee(rf(t));
    }
    class _s extends Wy {
        constructor(e, n = new at(0)){
            super(e, cee(n));
        }
        static calcLength(e) {
            const n = Ns(e);
            return n.lte(uZe) ? 1 : n.lt(dZe) ? 2 : n.lt(fZe) ? 4 : 8;
        }
        static readLength(e) {
            const n = e[0];
            return n === OF ? [
                1,
                2
            ] : n === MF ? [
                1,
                4
            ] : n === RF ? [
                1,
                8
            ] : [
                0,
                1
            ];
        }
        static writeLength(e) {
            switch(e.length){
                case 2:
                    return new Uint8Array([
                        OF
                    ]);
                case 4:
                    return new Uint8Array([
                        MF
                    ]);
                case 8:
                    return new Uint8Array([
                        RF
                    ]);
                default:
                    return new Uint8Array([]);
            }
        }
        eq(e) {
            return Ja(e) || Ln(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 = _s.calcLength(this);
            return wQ(this.toU8a().subarray(0, e), this.registry.chainSS58);
        }
        toRawType() {
            return "AccountIndex";
        }
    }
    class hZe extends qr {
        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 $P(t, e) {
        return e.fields.reduce((n, { name: r, type: s }, i)=>(n[r.unwrapOr(`param${i}`).toString()] = t.createLookupType(s), n), {});
    }
    function pZe(t, e, n) {
        const { args: r, callIndex: s } = e, i = s instanceof lee ? s.toU8a() : s, o = n || t.findMetaCall(i).meta;
        return {
            args: r,
            argsDef: $P(t, o),
            callIndex: s,
            meta: o
        };
    }
    function gZe(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: $P(t, s),
            callIndex: r,
            meta: s
        };
    }
    function bZe(t, e = new Uint8Array, n) {
        if (Rt(e) || Nn(e)) return gZe(t, Ot(e), n);
        if (Yi(e) && e.callIndex && e.args) return pZe(t, e, n);
        throw new Error(`Call: Cannot decode value '${e}' of type ${typeof e}`);
    }
    class lee extends sf {
        constructor(e, n){
            super(e, n, 16);
        }
        toPrimitive() {
            return this.toHex();
        }
    }
    class mZe extends qr {
        _meta;
        constructor(e, n, r){
            const s = bZe(e, n, r);
            try {
                super(e, {
                    callIndex: lee,
                    args: qr.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 $P(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 $e({
                args: this.argsEntries.reduce((s, [i, o])=>$e(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 f_(t, e, n, r = !0) {
        return n && Tt(n.unwrapOrDefault) ? n : t.createTypeUnsafe(e, [
            r ? dh(n) || kr(n) ? null : Array.isArray(n) ? n : [
                n
            ] : n
        ]);
    }
    function yZe(t, e, n) {
        return e === "ss58Format" ? f_(t, "Option<u32>", n, !1) : e === "tokenDecimals" ? f_(t, "Option<Vec<u32>>", n) : e === "tokenSymbol" ? f_(t, "Option<Vec<Text>>", n) : e === "isEthereum" ? f_(t, "Bool", n, !1) : n;
    }
    function wZe(t, e) {
        return (e && Tt(e.entries) ? [
            ...e.entries()
        ] : Object.entries(e || {})).reduce((n, [r, s])=>(n[r] = yZe(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 _Ze extends BQ {
        constructor(e, n){
            super(e, wZe(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 xZe = za("aura"), vZe = za("BABE"), SZe = za("FRNK"), kZe = za("pow_"), TZe = za("nmbs");
    function EZe(t, e, n) {
        return n[t.createTypeUnsafe("RawAuraPreDigest", [
            e.toU8a(!0)
        ]).slotNumber.mod(new at(n.length)).toNumber()];
    }
    function CZe(t, e, n) {
        const r = t.createTypeUnsafe("RawBabePreDigestCompat", [
            e.toU8a(!0)
        ]);
        return n[r.value.toNumber()];
    }
    function IZe(t, e) {
        return t.createTypeUnsafe("AccountId", [
            e
        ]);
    }
    class AZe extends sf {
        constructor(e, n){
            super(e, Ln(n) ? jl(n, {
                isLe: !1
            }) : n, 32);
        }
        get isAura() {
            return this.eq(xZe);
        }
        get isBabe() {
            return this.eq(vZe);
        }
        get isGrandpa() {
            return this.eq(SZe);
        }
        get isPow() {
            return this.eq(kZe);
        }
        get isNimbus() {
            return this.eq(TZe);
        }
        extractAuthor(e, n) {
            if (n?.length) {
                if (this.isAura) return EZe(this.registry, e, n);
                if (this.isBabe) return CZe(this.registry, e, n);
            }
            if (this.isPow || this.isNimbus) return IZe(this.registry, e);
        }
        toHuman() {
            return this.toString();
        }
        toRawType() {
            return "ConsensusEngineId";
        }
        toString() {
            return this.isAscii ? Hl(this) : nn(this);
        }
    }
    const NF = new Uint8Array([
        255
    ]);
    function PZe(t, e) {
        const n = rf(e);
        return n.length === 32 ? t.createTypeUnsafe("AccountId", [
            n
        ]) : t.createTypeUnsafe("AccountIndex", [
            ou(n)
        ]);
    }
    function OZe(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] = _s.readLength(e);
        return t.createTypeUnsafe("AccountIndex", [
            ou(e.subarray(n, n + r))
        ]);
    }
    function MZe(t, e) {
        return e instanceof uee ? e.inner : e instanceof tv || e instanceof _s ? e : Ja(e) || Ln(e) || fp(e) ? t.createTypeUnsafe("AccountIndex", [
            e
        ]) : Array.isArray(e) || Nn(e) || Rt(e) ? OZe(t, Ot(e)) : PZe(t, e);
    }
    class uee extends _5 {
        constructor(e, n = new Uint8Array){
            super(e, MZe(e, n));
        }
        get encodedLength() {
            const e = this._rawLength;
            return e + (e > 1 ? 1 : 0);
        }
        get _rawLength() {
            return this.inner instanceof _s ? _s.calcLength(this.inner) : this.inner.encodedLength;
        }
        inspect() {
            const e = this.inner.toU8a().subarray(0, this._rawLength);
            return {
                outer: [
                    new Uint8Array(this.inner instanceof _s ? _s.writeLength(e) : NF),
                    e
                ]
            };
        }
        toHex() {
            return nn(this.toU8a());
        }
        toRawType() {
            return "Address";
        }
        toU8a(e) {
            const n = this.inner.toU8a().subarray(0, this._rawLength);
            return e ? n : Ii(this.inner instanceof _s ? _s.writeLength(n) : NF, n);
        }
    }
    function VF(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 RZe(t, e) {
        return e instanceof tv ? {
            Id: e
        } : Rt(e) ? VF(t, e) : e instanceof VT ? e : e instanceof _s || Ja(e) || Ln(e) ? {
            Index: Ln(e) ? e : e.toNumber()
        } : rr(e) ? VF(t, rf(e.toString())) : e;
    }
    class VT extends ua {
        constructor(e, n){
            super(e, {
                Id: "AccountId",
                Index: "Compact<AccountIndex>",
                Raw: "Bytes",
                Address32: "H256",
                Address20: "H160"
            }, RZe(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 nv = 128, XP = 0, NZe = 127, dee = 0;
    function BF(t) {
        return t ? new Uint8Array([
            nv | dee
        ]) : new Uint8Array([
            XP
        ]);
    }
    function VZe(t) {
        return t.length ? t.subarray(0, 1) : new Uint8Array([
            XP
        ]);
    }
    function BZe(t, e) {
        return new Uint8Array([
            (new xg(t, e.aye).isTrue ? nv : XP) | t.createTypeUnsafe("Conviction", [
                e.conviction || dee
            ]).index
        ]);
    }
    function DZe(t, e) {
        return Rt(e) ? VZe(e) : kr(e) || e instanceof Boolean || Hy(e) ? BF(new xg(t, e).isTrue) : Ln(e) ? BF(e < 0) : BZe(t, e);
    }
    class FZe extends sf {
        #e;
        #t;
        constructor(e, n){
            const r = DZe(e, n);
            super(e, r, 8), this.#e = (r[0] & nv) === nv, this.#t = this.registry.createTypeUnsafe("Conviction", [
                r[0] & NZe
            ]);
        }
        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 DF(t) {
        return Rt(t) || Array.isArray(t) ? Ot(t) : Nn(t) || Qje(t.toString()) ? Dc(t.toString()) : rr(t) ? Ot(t) : t;
    }
    class fee extends sf {
        constructor(e, n = new Uint8Array){
            super(e, DF(n), 160);
        }
        eq(e) {
            return !!e && super.eq(DF(e));
        }
        toHuman() {
            return this.toJSON();
        }
        toJSON() {
            return this.toString();
        }
        toPrimitive() {
            return this.toJSON();
        }
        toString() {
            return Zje(this);
        }
        toRawType() {
            return "AccountId";
        }
    }
    const LZe = new Uint8Array([
        255
    ]);
    function zZe(t, e) {
        const n = rf(e);
        return n.length === 20 ? t.createTypeUnsafe("EthereumAccountId", [
            n
        ]) : t.createTypeUnsafe("AccountIndex", [
            ou(n)
        ]);
    }
    function UZe(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] = _s.readLength(e);
        return t.createTypeUnsafe("AccountIndex", [
            ou(e.subarray(n, n + r))
        ]);
    }
    function HZe(t, e) {
        return e instanceof hee ? e.inner : e instanceof fee || e instanceof _s ? e : Rt(e) || Array.isArray(e) || Nn(e) ? UZe(t, Ot(e)) : Ja(e) || Ln(e) || fp(e) ? t.createTypeUnsafe("AccountIndex", [
            e
        ]) : zZe(t, e);
    }
    class hee extends _5 {
        constructor(e, n = new Uint8Array){
            super(e, HZe(e, n));
        }
        get encodedLength() {
            const e = this._rawLength;
            return e + (e > 1 ? 1 : 0);
        }
        get _rawLength() {
            return this.inner instanceof _s ? _s.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 : Ii(this.inner instanceof _s ? _s.writeLength(n) : LZe, n);
        }
    }
    function jZe(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 qZe(t, e) {
        return Rt(e) || rr(e) ? jZe(t, Ot(e)) : e ? [
            e,
            void 0
        ] : [
            void 0,
            void 0
        ];
    }
    class KZe extends ua {
        constructor(e, n){
            if (super(e, {
                None: "Null",
                Raw: "Bytes",
                BlakeTwo256: "H256",
                Sha256: "H256",
                Keccak256: "H256",
                ShaThree256: "H256"
            }, ...qZe(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 WZe = {
        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 $Ze(t) {
        if (Rt(t) || !t || rr(t)) return {
            key: t
        };
        if (t instanceof C5) return {
            key: t,
            method: t.method,
            section: t.section
        };
        if (Tt(t)) return {
            key: t(),
            method: t.method,
            section: t.section
        };
        if (Array.isArray(t)) {
            const [e, n = []] = t;
            if (!Tt(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 XZe(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] = WZe[a.type], d = u ? t.createTypeUnsafe(Xy(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 GZe(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 XZe(t, e, r.map((o, a)=>[
                o,
                i[a]
            ]));
    }
    function ZZe(t) {
        if (t instanceof C5) return t.meta;
        if (Tt(t)) return t.meta;
        if (Array.isArray(t)) {
            const [e] = t;
            return e.meta;
        }
    }
    function JZe(t, e) {
        if (e instanceof C5) return e.outputType;
        if (Tt(e)) return OT(t, e.meta.type);
        if (Array.isArray(e)) {
            const [n] = e;
            if (n.meta) return OT(t, n.meta.type);
        }
        return "Raw";
    }
    class C5 extends S5 {
        #e;
        #t;
        #n;
        #r;
        #s;
        constructor(e, n, r = {}){
            const { key: s, method: i, section: o } = $Ze(n);
            super(e, s), this.#n = JZe(e, n), this.setMeta(ZZe(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 = OT(this.registry, e.type));
            try {
                this.#e = GZe(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 YZe = Object.freeze(Object.defineProperty({
        __proto__: null,
        BitVec: I$e,
        Bool: xg,
        Bytes: S5,
        Data: KZe,
        F32: $D,
        F64: XD,
        GeneralExtrinsic: ev,
        GenericAccountId: tv,
        GenericAccountId32: tv,
        GenericAccountId33: cZe,
        GenericAccountIndex: _s,
        GenericAddress: VT,
        GenericBlock: hZe,
        GenericCall: mZe,
        GenericChainProperties: _Ze,
        GenericConsensusEngineId: AZe,
        GenericEthereumAccountId: fee,
        GenericEthereumLookupSource: hee,
        GenericEvent: zGe,
        GenericEventData: ZQ,
        GenericExtrinsic: WP,
        GenericExtrinsicEra: ree,
        GenericExtrinsicPayload: iee,
        GenericExtrinsicPayloadUnknown: eZe,
        GenericExtrinsicPayloadV4: NT,
        GenericExtrinsicPayloadV5: oee,
        GenericExtrinsicSignatureV4: Jx,
        GenericExtrinsicSignatureV5: Qx,
        GenericExtrinsicUnknown: tZe,
        GenericExtrinsicV4: Zx,
        GenericExtrinsicV5: Yx,
        GenericImmortalEra: tee,
        GenericLookupSource: uee,
        GenericMortalEra: nee,
        GenericMultiAddress: VT,
        GenericSignerPayload: nZe,
        GenericVote: FZe,
        I128: YD,
        I16: ZD,
        I256: QD,
        I32: IT,
        I64: JD,
        I8: GD,
        ISize: eF,
        Null: Pc,
        OptionBool: z$e,
        StorageKey: C5,
        Text: VQ,
        Type: H$e,
        U128: rF,
        U16: nF,
        U256: sF,
        U32: Wy,
        U64: na,
        U8: tF,
        USize: iF,
        bool: xg,
        f32: $D,
        f64: XD,
        i128: YD,
        i16: ZD,
        i256: QD,
        i32: IT,
        i64: JD,
        i8: GD,
        isize: eF,
        u128: rF,
        u16: nF,
        u256: sF,
        u32: Wy,
        u64: na,
        u8: tF,
        usize: iF
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function pee(t) {
        return ({ name: e })=>t(e);
    }
    const GP = pee($n), gee = pee((t)=>t.toString());
    function QZe(t, e) {
        return t.callIndex[0] === e[0] && t.callIndex[1] === e[1];
    }
    function eJe(t, e, n, r) {
        const s = r.fields, i = $n(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)=>QZe(a, n), o.callIndex = n, o.meta = r, o.method = i, o.section = e, o.toJSON = ()=>r.toJSON(), o;
    }
    function bee({ calls: t }) {
        return t.isSome;
    }
    function mee(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] = $e({
                name: $n(u.unwrapOr(`param${l}`)),
                type: Xy(e, d)
            }, f.isSome ? {
                typeName: f.unwrap()
            } : null);
        }
        return eJe(t, r, new Uint8Array([
            s,
            o.toNumber()
        ]), t.createTypeUnsafe("FunctionMetadataLatest", [
            $e({
                args: c
            }, n)
        ]));
    }
    function tJe(t, { lookup: e, pallets: n }, r) {
        const s = {}, i = n.filter(bee);
        for(let o = 0, a = i.length; o < a; o++){
            const { calls: c, index: l, name: u } = i[o], d = $n(u), f = r >= 12 ? l.toNumber() : o;
            si(s, d, ()=>gb(e, c.unwrap(), GP, (p)=>mee(t, e, p, d, f)));
        }
        return s;
    }
    function a4(t, e) {
        return e.toNumber() >= 2 ? t.createTypeUnsafe("StorageHasherV10", [
            e.toNumber() + 1
        ]) : t.createTypeUnsafe("StorageHasherV10", [
            e
        ]);
    }
    function nJe(t, e) {
        return e.isMap ? [
            $e({}, e.asMap, {
                hasher: a4(t, e.asMap.hasher)
            }),
            1
        ] : e.isDoubleMap ? [
            $e({}, e.asDoubleMap, {
                hasher: a4(t, e.asDoubleMap.hasher),
                key2Hasher: a4(t, e.asDoubleMap.key2Hasher)
            }),
            2
        ] : [
            e.asPlain,
            0
        ];
    }
    function rJe(t, e) {
        const n = e.storage.unwrapOr(null);
        return t.createTypeUnsafe("ModuleMetadataV10", [
            $e({}, e, {
                storage: n ? $e({}, n, {
                    items: n.items.map((r)=>$e({}, r, {
                            type: t.createTypeUnsafe("StorageEntryTypeV10", nJe(t, r.type))
                        }))
                }) : null
            })
        ]);
    }
    function sJe(t, { modules: e }) {
        return t.createTypeUnsafe("MetadataV10", [
            {
                modules: e.map((n)=>rJe(t, n))
            }
        ]);
    }
    function iJe(t, { modules: e }) {
        return t.createTypeUnsafe("MetadataV11", [
            {
                extrinsic: {
                    signedExtensions: [],
                    version: 0
                },
                modules: e
            }
        ]);
    }
    function oJe(t, { extrinsic: e, modules: n }) {
        return t.createTypeUnsafe("MetadataV12", [
            {
                extrinsic: e,
                modules: n.map((r)=>t.createTypeUnsafe("ModuleMetadataV12", [
                        $e({}, r, {
                            index: 255
                        })
                    ]))
            }
        ]);
    }
    function aJe(t, e) {
        return t.createTypeUnsafe("MetadataV13", [
            e
        ]);
    }
    const cJe = {
        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 lJe({ knownTypes: t }, e) {
        return {
            ...cJe[e] ?? {},
            ...t.typesAlias?.[e] ?? {}
        };
    }
    const uJe = [
        [
            "<",
            ">"
        ],
        [
            "<",
            ","
        ],
        [
            ",",
            ">"
        ],
        [
            "(",
            ")"
        ],
        [
            "(",
            ","
        ],
        [
            ",",
            ","
        ],
        [
            ",",
            ")"
        ]
    ];
    function Nl(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 dJe(t, ...e) {
        for(let n = 0, r = e.length; n < r; n++)Nl(t, e[n]);
    }
    function fJe(t, e) {
        return t.push({
            def: {
                Tuple: e
            }
        }) - 1;
    }
    function ZP(t, e, n, r) {
        return n.push({
            def: {
                Variant: {
                    variants: r
                }
            },
            path: [
                `pallet_${t.toString()}`,
                "pallet",
                e
            ]
        }) - 1;
    }
    function hJe(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] = qqe[s] || "Null", r;
                }, {})
            }
        });
    }
    function fw(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])=>uJe.reduce((l, [u, d])=>l.replace(`${u}${a}${d}`, `${u}${c}${d}`), o), s);
                s !== i && n.setOverride(i);
            }
        });
    }
    function pJe(t, e, n, r, s) {
        const i = r.map(({ args: o, docs: a, name: c }, l)=>(fw(s, o.map(({ type: u })=>u)), e.createTypeUnsafe("SiVariant", [
                {
                    docs: a,
                    fields: o.map(({ name: u, type: d })=>e.createTypeUnsafe("SiField", [
                            {
                                name: u,
                                type: Nl(t, d)
                            }
                        ])),
                    index: l,
                    name: c
                }
            ])));
        return e.createTypeUnsafe("PalletCallMetadataV14", [
            {
                type: ZP(n, "Call", t, i)
            }
        ]);
    }
    function gJe(t, e, n, r) {
        return n.map(({ docs: s, name: i, type: o, value: a })=>(fw(r, [
                o
            ]), e.createTypeUnsafe("PalletConstantMetadataV14", [
                {
                    docs: s,
                    name: i,
                    type: Nl(t, o),
                    value: a
                }
            ])));
    }
    function bJe(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: ZP(n, "Error", t, i)
            }
        ]);
    }
    function mJe(t, e, n, r, s) {
        const i = r.map(({ args: o, docs: a, name: c }, l)=>(fw(s, o), e.createTypeUnsafe("SiVariant", [
                {
                    docs: a,
                    fields: o.map((u)=>e.createTypeUnsafe("SiField", [
                            {
                                type: Nl(t, u)
                            }
                        ])),
                    index: l,
                    name: c
                }
            ])));
        return e.createTypeUnsafe("PalletEventMetadataV14", [
            {
                type: ZP(n, "Event", t, i)
            }
        ]);
    }
    function c4(t, e, n, { hashers: r, isLinked: s, isOptional: i, keys: o, value: a }) {
        return fw(n, [
            a,
            ...Array.isArray(o) ? o : [
                o
            ]
        ]), e.createTypeUnsafe("StorageEntryTypeV14", [
            {
                Map: {
                    hashers: r,
                    key: r.length === 1 ? Nl(t, o[0]) : fJe(t, o.map((c)=>Nl(t, c))),
                    value: s ? Nl(t, `(${i ? `Option<${a.toString()}>` : a.toString()}, Linkage<${o[0].toString()}>)`) : Nl(t, a)
                }
            }
        ]);
    }
    function yJe(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;
                        fw(s, [
                            d
                        ]), u = e.createTypeUnsafe("StorageEntryTypeV14", [
                            {
                                Plain: Nl(t, d)
                            }
                        ]);
                    } else if (l.isMap) {
                        const d = l.asMap;
                        u = c4(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 = c4(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 = c4(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 wJe(t, { signedExtensions: e, version: n }) {
        return t.createTypeUnsafe("ExtrinsicMetadataV14", [
            {
                signedExtensions: e.map((r)=>({
                        identifier: r,
                        type: 0
                    })),
                type: 0,
                version: n
            }
        ]);
    }
    function _Je(t, e, n, { calls: r, constants: s, errors: i, events: o, storage: a }) {
        const c = lJe(e, $n(n.name));
        return e.createTypeUnsafe("PalletMetadataV14", [
            {
                calls: r && pJe(t, e, n.name, r, c),
                constants: gJe(t, e, s, c),
                errors: i && bJe(t, e, n.name, i),
                events: o && mJe(t, e, n.name, o, c),
                index: n.index,
                name: n.name,
                storage: a && yJe(t, e, a, c)
            }
        ]);
    }
    function xJe(t, e, n) {
        const r = [];
        dJe(r, "Null", "u8", "u16", "u32", "u64"), hJe(t, e.modules, n);
        const s = wJe(t, e.extrinsic), i = e.modules.map((o)=>_Je(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 vJe(t, e, n) {
        const r = e.lookup.paramTypes.SpRuntimeUncheckedExtrinsic;
        return t.createTypeUnsafe("MetadataV15", [
            $e({}, e, {
                extrinsic: t.createTypeUnsafe("ExtrinsicMetadataV15", [
                    $e({}, 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 SJe(t, e) {
        const n = t.createTypeUnsafe("ItemDeprecationInfoV16", [
            "NotDeprecated"
        ]), r = t.createTypeUnsafe("Vec<PalletAssociatedTypeMetadataV16>", [
            []
        ]), s = t.createTypeUnsafe("Vec<PalletViewFunctionMetadataV16>", [
            []
        ]);
        return t.createTypeUnsafe("PalletMetadataV16", [
            $e({}, e, {
                associatedTypes: r,
                calls: e.calls.isSome ? TJe(t, e.calls.unwrap()) : null,
                constants: CJe(t, e.constants),
                deprecationInfo: n,
                errors: e.errors.isSome ? IJe(t, e.errors.unwrap()) : null,
                events: e.events.isSome ? EJe(t, e.events.unwrap()) : null,
                storage: e.storage.isSome ? kJe(t, e.storage.unwrap()) : null,
                viewFunctions: s
            })
        ]);
    }
    function kJe(t, e) {
        const n = t.createTypeUnsafe("ItemDeprecationInfoV16", [
            "NotDeprecated"
        ]), r = e.items.map((s)=>t.createTypeUnsafe("StorageEntryMetadataV16", [
                $e({}, s, {
                    deprecationInfo: n
                })
            ]));
        return t.createTypeUnsafe("PalletStorageMetadataV16", [
            {
                items: t.createTypeUnsafe("Vec<StorageEntryMetadataV16>", [
                    r
                ]),
                prefix: e.prefix
            }
        ]);
    }
    function TJe(t, e) {
        const n = t.createTypeUnsafe("EnumDeprecationInfoV16", []);
        return t.createTypeUnsafe("PalletCallMetadataV16", [
            {
                deprecationInfo: n,
                type: e.type
            }
        ]);
    }
    function EJe(t, e) {
        const n = t.createTypeUnsafe("EnumDeprecationInfoV16", []);
        return t.createTypeUnsafe("PalletEventMetadataV16", [
            {
                deprecationInfo: n,
                type: e.type
            }
        ]);
    }
    function CJe(t, e) {
        const n = t.createTypeUnsafe("ItemDeprecationInfoV16", [
            "NotDeprecated"
        ]);
        return t.createTypeUnsafe("Vec<PalletConstantMetadataV16>", [
            e.map((r)=>t.createTypeUnsafe("PalletConstantMetadataV16", [
                    $e({}, r, {
                        deprecationInfo: n
                    })
                ]))
        ]);
    }
    function IJe(t, e) {
        const n = t.createTypeUnsafe("EnumDeprecationInfoV16", []);
        return t.createTypeUnsafe("PalletErrorMetadataV16", [
            {
                deprecationInfo: n,
                type: e.type
            }
        ]);
    }
    function AJe(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 PJe(t, e) {
        const n = t.createTypeUnsafe("ItemDeprecationInfoV16", [
            "NotDeprecated"
        ]), r = e.methods.map((s)=>t.createTypeUnsafe("RuntimeApiMethodMetadataV16", [
                $e({}, s, {
                    deprecationInfo: n
                })
            ]));
        return t.createTypeUnsafe("RuntimeApiMetadataV16", [
            $e({}, e, {
                deprecationInfo: n,
                methods: r,
                version: t.createTypeUnsafe("Compact<u32>", [
                    0
                ])
            })
        ]);
    }
    function OJe(t, e, n) {
        const r = e.pallets.map((o)=>SJe(t, o)), s = AJe(t, e.extrinsic), i = e.apis.map((o)=>PJe(t, o));
        return t.createTypeUnsafe("MetadataV16", [
            $e({}, e, {
                apis: i,
                extrinsic: s,
                pallets: r
            })
        ]);
    }
    function MJe(t, e, n) {
        return e;
    }
    const FF = 1635018093;
    class RJe extends Wy {
        constructor(e, n){
            if (super(e, n), !this.isEmpty && !this.eq(FF)) throw new Error(`MagicNumber mismatch: expected ${e.createTypeUnsafe("u32", [
                FF
            ]).toHex()}, found ${this.toHex()}`);
        }
    }
    const NJe = [
        16,
        15,
        14,
        13,
        12,
        11,
        10,
        9
    ], VJe = NJe[0], BJe = 14;
    class I5 extends qr {
        #e = new Map;
        constructor(e, n){
            super(e, {
                magicNumber: RJe,
                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${VJe}` : `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 I5(this.registry, {
                magicNumber: this.magicNumber,
                metadata: this.registry.createTypeUnsafe("MetadataAll", [
                    MGe(this.registry, this.asLatest),
                    BJe
                ])
            });
        }
        get asV9() {
            return this.#t(9), this.#r().asV9;
        }
        get asV10() {
            return this.#n(10, sJe);
        }
        get asV11() {
            return this.#n(11, iJe);
        }
        get asV12() {
            return this.#n(12, oJe);
        }
        get asV13() {
            return this.#n(13, aJe);
        }
        get asV14() {
            return this.#n(14, xJe);
        }
        get asV15() {
            return this.#n(15, vJe);
        }
        get asV16() {
            return this.#n(16, OJe);
        }
        get asLatest() {
            return this.#n("latest", MJe);
        }
        get magicNumber() {
            return this.getT("magicNumber");
        }
        get version() {
            return this.#r().index;
        }
        getUniqTypes(e) {
            return PGe(this.registry, this.asLatest, e);
        }
        toJSON() {
            return this.asLatest, super.toJSON();
        }
    }
    const yee = new Uint8Array([
        109,
        101,
        116,
        97,
        9
    ]), LF = yee.length - 1;
    function DJe(t, e) {
        if (e.length === 0) return yee;
        if (e[LF] === 9) try {
            return new I5(t, e);
        } catch  {
            e[LF] = 10;
        }
        return e;
    }
    class e0 extends I5 {
        constructor(e, n){
            super(e, Rt(n) || rr(n) ? DJe(e, Ot(n)) : n);
        }
    }
    function wee(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 || si(r, $n(a), ()=>fh({}, o, (c)=>{
                    const l = t.createTypeUnsafe(t.createLookupType(c.type), [
                        Dc(c.value.toHex())
                    ]);
                    return l.meta = c, l;
                }, GP));
        }
        return r;
    }
    function _ee(t, e) {
        return $e({
            args: e.fields.map(({ type: n })=>t.getTypeDef(n).type)
        }, e);
    }
    function FJe(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;
                si(s, $n(l), ()=>gb(e, a.unwrap(), gee, (d)=>({
                            is: (f)=>sa(f) && sa(f.index) && f.index.eq(u) && (Rt(f.error) ? f.error[0] === d.index.toNumber() : sa(f.error) && f.error.eq(d.index)),
                            meta: t.createTypeUnsafe("ErrorMetadataLatest", [
                                _ee(e, d)
                            ])
                        })));
            }
        }
        return s;
    }
    function xee({ events: t }) {
        return t.isSome;
    }
    function LJe(t, { lookup: e, pallets: n }, r) {
        const s = {}, i = n.filter(xee);
        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;
            si(s, $n(u), ()=>gb(e, c.unwrap(), gee, (f)=>({
                        is: (p)=>sa(p) && Rt(p.index) && d === p.index[0] && f.index.eq(p.index[1]),
                        meta: t.createTypeUnsafe("EventMetadataLatest", [
                            _ee(e, f)
                        ])
                    })));
        }
        return s;
    }
    const zJe = (t)=>p0(t, 128), UJe = {
        Blake2_128: (t)=>Wl(t, 128),
        Blake2_128Concat: (t)=>Ii(Wl(t, 128), Ot(t)),
        Blake2_256: (t)=>Wl(t, 256),
        Identity: (t)=>Ot(t),
        Twox128: (t)=>p0(t, 128),
        Twox256: (t)=>p0(t, 256),
        Twox64Concat: (t)=>Ii(p0(t, 64), Ot(t))
    };
    function HJe(t) {
        return UJe[t.type] || zJe;
    }
    const A5 = {
        args: [],
        hashers: [],
        keys: []
    };
    function jJe(t) {
        return !kr(t);
    }
    function vee({ method: t, section: e }, { args: n, keys: r }) {
        if (Array.isArray(n)) {
            if (n.filter(jJe).length !== r.length) throw new Error(`Call to ${$n(e || "unknown")}.${$n(t || "unknown")} needs ${r.length} arguments, found [${n.join(", ")}]`);
        } else throw new Error(`Call to ${$n(e || "unknown")}.${$n(t || "unknown")} needs ${r.length} arguments`);
    }
    function See(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] = HJe(r[a])(t.createTypeUnsafe(t.createLookupType(s[a]), [
            n[a]
        ]).toU8a());
        return [
            [
                p0(e.prefix, 128),
                p0(e.method, 128)
            ],
            o
        ];
    }
    function l4(t, e, n) {
        vee(e, n);
        const { meta: r } = e, [s, i] = See(t, e, n);
        let o = [];
        if (r.type.isMap) {
            const { hashers: c, key: l } = r.type.asMap;
            o = c.length === 1 ? [
                `${c[0].type}(${Xy(t.lookup, l)})`
            ] : t.lookup.getSiType(l).def.asTuple.map((u, d)=>`${c[d].type}(${Xy(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 rv(t, e, n) {
        const [r, s] = See(t, e, n);
        return Ii(...r, ...s);
    }
    function u4(t, e, n) {
        return vee(e, n), hp(rv(t, e, n));
    }
    function qJe(t, e, n) {
        const { meta: { type: r } } = e;
        return (...s)=>{
            if (r.isPlain) return n.skipHashing ? {
                inner: [],
                name: "wellKnown",
                outer: [
                    Ot(n.key)
                ]
            } : l4(t, e, A5);
            const { hashers: i, key: o } = r.asMap;
            return i.length === 1 ? l4(t, e, {
                args: s,
                hashers: i,
                keys: [
                    o
                ]
            }) : l4(t, e, {
                args: s,
                hashers: i,
                keys: t.lookup.getSiType(o).def.asTuple
            });
        };
    }
    function KJe(t, e, n) {
        const { meta: { type: r } } = e;
        let s = null;
        return (...i)=>{
            if (r.isPlain) return s || (s = n.skipHashing ? hp(Ot(n.key)) : u4(t, e, A5)), s;
            const { hashers: o, key: a } = r.asMap;
            return o.length === 1 ? u4(t, e, {
                args: i,
                hashers: o,
                keys: [
                    a
                ]
            }) : u4(t, e, {
                args: i,
                hashers: o,
                keys: t.lookup.getSiType(a).def.asTuple
            });
        };
    }
    function WJe(t, e, n) {
        const { meta: r, method: s, prefix: i, section: o } = e, a = KJe(t, e, n);
        return a.inspect = qJe(t, e, n), a.meta = r, a.method = $n(s), a.prefix = i, a.section = o, a.toJSON = ()=>$e({
                storage: {
                    method: s,
                    prefix: i,
                    section: o
                }
            }, r.toJSON()), a;
    }
    function $Je(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 XJe(t, e, n) {
        const { meta: { type: r }, method: s, section: i } = e;
        return n.iterKey = $Je(t, e, n, (...o)=>{
            if (o.length && (r.isPlain || o.length >= r.asMap.hashers.length)) throw new Error(`Iteration of ${$n(i || "unknown")}.${$n(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 da(t, rv(t, e, {
                    args: o,
                    hashers: a.slice(0, o.length),
                    keys: l.slice(0, o.length)
                }));
            }
            return new da(t, rv(t, e, A5));
        }), n;
    }
    function kee(t, e, n) {
        const { meta: { type: r } } = e, s = WJe(t, e, n);
        return r.isMap && XJe(t, e, s), s.keyPrefix = (...i)=>s.iterKey && s.iterKey(...i) || Lx(s())[1], s;
    }
    function zF(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 GJe(t, e) {
        let n = zF(t, e);
        if (!n && (e === "Bytes" || e.startsWith("[u8;"))) {
            const r = zF(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 = wu(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 Tee({ method: t, prefix: e, section: n }, r, { docs: s, type: i }) {
        return (o)=>kee(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: GJe(o, i)?.id || 0
                            }
                        ])
                    }
                ]),
                method: t,
                prefix: e,
                section: n
            }, {
                key: r,
                skipHashing: !0
            });
    }
    const ZJe = "Substrate", JJe = "substrate";
    function ll(t, e, n) {
        return Tee({
            method: t,
            prefix: ZJe,
            section: JJe
        }, e, n);
    }
    const YJe = {
        changesTrieConfig: ll("changesTrieConfig", ":changes_trie", {
            docs: "Changes trie configuration is stored under this key.",
            type: "u32"
        }),
        childStorageKeyPrefix: ll("childStorageKeyPrefix", ":child_storage:", {
            docs: "Prefix of child storage keys.",
            type: "u32"
        }),
        code: ll("code", ":code", {
            docs: "Wasm code of the runtime.",
            type: "Bytes"
        }),
        defaultChildStorageKeyPrefix: ll("defaultChildStorageKeyPrefix", ":child_storage:default:", {
            docs: "Prefix of the default child storage keys in the top trie.",
            type: "u32"
        }),
        extrinsicIndex: ll("extrinsicIndex", ":extrinsic_index", {
            docs: "Current extrinsic index (u32) is stored under this key.",
            type: "u32"
        }),
        heapPages: ll("heapPages", ":heappages", {
            docs: "Number of wasm linear memory pages required for execution of the runtime.",
            type: "u64"
        }),
        intrablockEntropy: ll("intrablockEntropy", ":intrablock_entropy", {
            docs: "Current intra-block entropy (a universally unique `[u8; 32]` value) is stored here.",
            type: "[u8; 32]"
        }),
        storageVersionStorageKeyPostfix: ll("storageVersionStorageKeyPostfix", ":__STORAGE_VERSION__:", {
            docs: "The storage key postfix that is used to store the [`StorageVersion`] per pallet.",
            type: "u16"
        }),
        transactionLevelKey: ll("transactionLevelKey", ":transaction_level:", {
            docs: "The key that holds the current number of active layers.",
            type: "u32"
        })
    };
    function QJe(t) {
        const e = {}, n = Object.entries(YJe);
        for(let r = 0, s = n.length; r < s; r++)e[n[r][0]] = n[r][1](t);
        return {
            substrate: e
        };
    }
    const eYe = "palletVersion", tYe = ":__STORAGE_VERSION__:", nYe = {
        docs: "Returns the current pallet version from storage",
        type: "u16"
    };
    function rYe(t, { pallets: e }, n) {
        const r = QJe(t);
        for(let s = 0, i = e.length; s < i; s++){
            const { name: o, storage: a } = e[s];
            if (a.isSome) {
                const c = $n(o), { items: l, prefix: u } = a.unwrap(), d = u.toString();
                si(r, c, ()=>fh({
                        palletVersion: Tee({
                            method: eYe,
                            prefix: d,
                            section: c
                        }, rv(t, {
                            method: tYe,
                            prefix: o.toString()
                        }, A5), nYe)(t)
                    }, l, (f)=>kee(t, {
                            meta: f,
                            method: f.name.toString(),
                            prefix: d,
                            section: c
                        }, {}), GP));
            }
        }
        return r;
    }
    function sYe(t, e) {
        if (!(e instanceof e0)) throw new Error("You need to pass a valid Metadata instance to Decorated");
        const n = e.asLatest, r = e.version;
        return {
            consts: wee(t, n),
            errors: FJe(t, n, r),
            events: LJe(t, n, r),
            query: rYe(t, n),
            registry: t,
            tx: tJe(t, n, r)
        };
    }
    const iYe = new Uint8Array(2), UF = ha("registry");
    function HF(t, e) {
        return parseInt(t, 10) - parseInt(e, 10);
    }
    function Eee(t) {
        return t.toString();
    }
    function Cee(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 sv(t) {
        const e = Object.keys(t);
        for(let n = 0, r = e.length; n < r; n++)delete t[e[n]];
    }
    function JP({ index: t }) {
        return t.toString();
    }
    function oYe(t, { lookup: e, pallets: n }, r, s) {
        sv(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 = $n(l);
                si(s, r >= 12 ? c.toNumber() : i, ()=>gb(e, a.unwrap(), JP, ({ docs: d, fields: f, index: p, name: h })=>({
                            args: Cee(e, f),
                            docs: d.map(Eee),
                            fields: f,
                            index: p.toNumber(),
                            method: h.toString(),
                            name: h.toString(),
                            section: u
                        })));
            }
        }
    }
    function aYe(t, { lookup: e, pallets: n }, r, s) {
        const i = n.filter(xee);
        sv(s);
        for(let o = 0, a = i.length; o < a; o++){
            const { events: c, index: l, name: u } = i[o];
            si(s, r >= 12 ? l.toNumber() : o, ()=>gb(e, c.unwrap(), JP, (d)=>{
                    const f = t.createType("EventMetadataLatest", $e({}, d, {
                        args: Cee(e, d.fields)
                    }));
                    return class extends ZQ {
                        constructor(p, h){
                            super(p, h, f, $n(u), d.name.toString());
                        }
                    };
                }));
        }
    }
    function cYe(t, { lookup: e, pallets: n }, r, s, i) {
        const o = n.filter(bee);
        sv(s), sv(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 = $n(d), h = l.unwrap();
            si(s, f, ()=>gb(e, h, JP, (_)=>mee(t, e, _, p, f)));
            const { path: b } = t.lookup.getSiType(h.type), y = b.findIndex((_)=>_.eq("pallet"));
            if (y !== -1) {
                const _ = $n(b.slice(0, y).map((v, w)=>w === 0 ? v.replace(/^(frame|pallet)_/, "") : v).join(" "));
                i[_] ? i[_].push(p) : i[_] = [
                    p
                ];
            }
        }
    }
    function lYe(t, e) {
        const n = t.getChainProperties(), r = wee(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 Iee {
        #e;
        #t = new Map;
        #n = new Map;
        #r = null;
        #s = Wl;
        #i = {};
        #o;
        #a;
        #l = 0;
        #f = i4;
        #y = new Map;
        #h;
        #p;
        #u;
        #b;
        #d = {};
        #g = {};
        #c = {};
        #w = {};
        createdAtHash;
        constructor(e){
            this.#p = new Map(Object.entries({
                Json: BQ,
                Metadata: e0,
                PortableRegistry: TGe,
                Raw: da,
                ...YZe
            })), this.#u = Array.from(this.#p.entries()), this.#b = Gx;
            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(Eee);
            }
            return [
                gp.getDefaults().unit
            ];
        }
        get firstCallIndex() {
            return this.#r || iYe;
        }
        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 rd(this.#o, "PortableRegistry has not been set on this registry");
        }
        get metadata() {
            return rd(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 Um(this, e);
        }
        createClassUnsafe(e) {
            return Um(this, e);
        }
        createType(e, ...n) {
            return PT(this, e, n);
        }
        createTypeUnsafe(e, n, r) {
            return PT(this, e, n, r);
        }
        findMetaCall(e) {
            const [n, r] = [
                e[0],
                e[1]
            ];
            return rd(this.#d[`${n}`] && this.#d[`${n}`][`${r}`], ()=>`findMetaCall: Unable to find Call with index [${n}, ${r}]/[${e.toString()}]`);
        }
        findMetaError(e) {
            const [n, r] = Rt(e) ? [
                e[0],
                e[1]
            ] : [
                e.index.toNumber(),
                Rt(e.error) ? e.error[0] : e.error.toNumber()
            ];
            return rd(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 rd(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.#p.get(e);
            if (!s) {
                const i = this.#n.get(e);
                let o;
                i ? o = Um(this, i) : r ? o = aXe(this, r) : n && (UF.warn(`Unable to resolve type ${e}, it will fail on construction`), this.#y.set(e, !0), o = v5.with(e)), o && (s = class extends o {
                }, this.#t.set(e, s), r && Ln(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 kF(this.#f, "payload", this.#h);
        }
        getSignedExtensionTypes() {
            return kF(this.#f, "extrinsic", this.#h);
        }
        hasClass(e) {
            return this.#t.has(e) || !!this.#p.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 (Tt(e)) this.#t.set(e.name, e);
            else if (rr(e)) {
                if (Tt(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 (Tt(o)) this.#t.set(i, o);
                else {
                    const a = rr(o) ? o : Sn(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 || Wl;
        }
        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 Ja(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), cYe(this, this.#a, this.#l, this.#d, this.#w), oYe(this, this.#a, this.#l, this.#g), aYe(this, this.#a, this.#l, this.#c);
            const [i] = Object.keys(this.#d).sort(HF);
            if (i) {
                const [o] = Object.keys(this.#d[i]).sort(HF);
                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()) : i4), r, s), this.setChainProperties(lYe(this, e));
        }
        setSignedExtensions(e = i4, n, r) {
            if (this.#f = e, this.#h = n, !r) {
                const s = FGe(this.#f, this.#h);
                s.length && UF.warn(`Unknown signed extensions ${s.join(", ")} found, treating them as no-effect`);
            }
        }
    }
    function Aee(t = 1750) {
        return (e)=>{
            let [n, r, s, i] = [
                0,
                0,
                ru.EMPTY,
                ru.EMPTY
            ];
            return new ls((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 = vDe.schedule(()=>{
                        n = 0, s.unsubscribe();
                    }, t)));
                }));
        };
    }
    function uYe(t, e) {
        return Sn({
            t
        }) === Sn({
            t: e
        });
    }
    function dYe(t) {
        throw t;
    }
    function fYe() {}
    function YP({ delay: t, skipChange: e = !1, skipTimeout: n = !1 } = {}) {
        return (r)=>r.pipe(su(dYe), e ? Ld(fYe) : oFe(uYe), HJ(1), n ? JA() : Aee(t));
    }
    function Pe(t, e) {
        const r = wm((...s)=>new ls((i)=>{
                const o = e(...s).subscribe(i);
                return ()=>{
                    r.unmemoize(...s), o.unsubscribe();
                };
            }).pipe(YP()), {
            getInstanceId: ()=>t
        });
        return r;
    }
    const hYe = ha("rpc-core"), pYe = {
        fallback: void 0,
        modifier: {
            isOptional: !0
        },
        type: {
            asMap: {
                linked: {
                    isTrue: !1
                }
            },
            isMap: !1
        }
    }, gYe = 1024 * 10 * 10;
    function h_(t, { noErrorLog: e, params: n, type: r }, s) {
        e || hYe.error(`${t}(${n.map(({ isOptional: i, name: o, type: a })=>`${o}${i ? "?" : ""}: ${a}`).join(", ")}): ${r}:: ${s.message}`);
    }
    function jF(t) {
        return [
            "0x3a636f6465"
        ].includes(t.toHex());
    }
    class bYe {
        #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 || !Tt(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(Hm);
            this.sections.push(...c), this.#r = new xQ(i || gYe, 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 = wm(e, {
                getInstanceId: ()=>this.#e
            });
        }
        setResolveBlockHash(e) {
            this.#o = wm(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 = $e({}, Hm[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, $e({}, u, {
                            isSubscription: f,
                            jsonrpc: d,
                            method: l,
                            section: s
                        })), si(this[s], l, ()=>f ? this._createMethodSubscribe(s, l, u) : this._createMethodSend(s, l, u));
                    }
                }
            }
        }
        _memomize(e, n) {
            const r = {
                getInstanceId: ()=>this.#e
            }, s = wm(e(!0), r);
            return s.raw = wm(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(Ot(f)) : {
                    registry: this.#n
                }, h = this._formatParams(p, null, r, u), b = await this.provider.send(s, h.map((y)=>y.toJSON()), !!f);
                return this._formatResult(l, p, f, n, r, h, b);
            }, c = (l)=>(...u)=>{
                    const d = l && i !== -1 && !!u[i];
                    return new ls((f)=>(a(l, u).then((p)=>{
                            f.next(p), f.complete();
                        }).catch((p)=>{
                            h_(n, r, p), f.error(p), f.complete();
                        }), ()=>{
                            l ? o?.unmemoize(...u) : o?.raw.unmemoize(...u);
                        })).pipe(HJ(1), d ? Aee() : JA());
                };
            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 ls((h)=>{
                        let b = Promise.resolve(null);
                        const y = this.#n, _ = (v)=>{
                            h_(n, r, v), h.error(v);
                        };
                        try {
                            const v = this._formatParams(y, null, r, p), w = (E, I)=>{
                                if (E) {
                                    h_(n, r, E);
                                    return;
                                }
                                try {
                                    h.next(this._formatResult(f, y, null, n, r, v, I));
                                } catch (D) {
                                    h.error(D);
                                }
                            };
                            b = this._createSubscriber({
                                paramsJson: v.map((E)=>E.toJSON()),
                                subName: a,
                                subType: l,
                                update: w
                            }, _);
                        } catch (v) {
                            _(v);
                        }
                        return ()=>{
                            f ? u?.unmemoize(...p) : u?.raw.unmemoize(...p), b.then((v)=>dh(v) ? Promise.resolve(!1) : this.provider.unsubscribe(l, c, v)).catch((v)=>h_(n, r, v));
                        };
                    }).pipe(YP());
            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 = dh(s), o = i ? null : jF(r) ? s : Ot(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 = kr(c);
            if (l && i) {
                const h = this.#r.get(a);
                if (h) return this.#s++, h;
            }
            const u = l ? null : c[1], d = dh(u), f = d || jF(r) ? u : Ot(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(XQ(r.meta.type)) : r.outputType || "Raw", c = r.meta || pYe, l = o === -1 ? "" : ` entry ${o}:`;
            try {
                return e.createTypeUnsafe(a, [
                    i ? c.fallback ? a.includes("Linkage<") ? Ii(Dc(c.fallback.toHex()), new Uint8Array(2)) : Dc(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 BT(t) {
        return wY(t.number) ? t.number.unwrap() : t.number;
    }
    const mYe = {
        del: ()=>{},
        forEach: ()=>{},
        get: ()=>{},
        set: (t, e)=>e
    };
    let hw;
    function yYe(t = "", e) {
        hw = mYe;
    }
    yYe();
    function Pee(t) {
        return t.pipe(ye(([e])=>e));
    }
    function _u(t) {
        return (e, n)=>Pe(e, (...r)=>Pee(t(n, ...r)));
    }
    function Oee(t, e, n, r) {
        si(t, e, ()=>fh({}, n(e), (s)=>r(e, s)));
    }
    function wYe(t, e) {
        return Pe(t, (n)=>{
            const r = Rt(n) ? n : rf((n || "").toString());
            if (r.length > 8) return xe(e.registry.createType(r.length === 20 ? "AccountId20" : "AccountId", r));
            const s = e.registry.createType("AccountIndex", r);
            return e.derive.accounts.indexToId(s.toString()).pipe(ye((i)=>rd(i, "Unable to retrieve accountId")));
        });
    }
    function _Ye(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 xYe(t, e) {
        return Pe(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(ye((i)=>{
                let o = -1;
                for(let a = 0, c = r.length; a < c; a++)Tt(r[a]) && (n[a] = i[++o]);
                return n;
            })) : xe(n);
        });
    }
    function vYe(t, e) {
        return Pe(t, (n)=>e.derive.accounts._flags().pipe(ye((r)=>_Ye(n, r))));
    }
    function SYe(t, e) {
        return Pe(t, (n)=>{
            try {
                const r = Rt(n) ? n : rf((n || "").toString());
                if (r.length > 8) {
                    const i = e.registry.createType(r.length === 20 ? "AccountId20" : "AccountId", r);
                    return e.derive.accounts.idToIndex(i).pipe(ye((o)=>[
                            i,
                            o
                        ]));
                }
                const s = e.registry.createType("AccountIndex", r);
                return e.derive.accounts.indexToId(s.toString()).pipe(ye((i)=>[
                        i,
                        s
                    ]));
            } catch  {
                return xe([
                    void 0,
                    void 0
                ]);
            }
        });
    }
    const kYe = {
        toHex: ()=>{}
    };
    function zi(t) {
        return t && (t.isRaw ? Hl(t.asRaw.toU8a(!0)) : t.isNone ? void 0 : t.toHex());
    }
    function TYe(t) {
        return t.reduce((e, [n, r])=>{
            const s = zi(n), i = zi(r);
            return s && i && (e[s] = i), e;
        }, {});
    }
    function Mee(t) {
        const e = t.unwrap();
        return Array.isArray(e) ? e[0] : e;
    }
    function EYe(t, e) {
        if (!t?.isSome) return {
            judgements: []
        };
        const { info: n, judgements: r } = Mee(t), s = zi(n.display);
        return {
            discord: zi(n.discord),
            display: e && zi(e[1]) || s,
            displayParent: e && s,
            email: zi(n.email),
            github: zi(n.github),
            image: zi(n.image),
            judgements: r,
            legal: zi(n.legal),
            matrix: zi(n.matrix),
            other: n.additional ? TYe(n.additional) : {},
            parent: e?.[0],
            pgp: n.pgpFingerprint.unwrapOr(kYe).toHex(),
            riot: zi(n.riot),
            twitter: zi(n.twitter),
            web: zi(n.web)
        };
    }
    function CYe(t, e, n) {
        if (e?.isSome) return xe([
            e,
            void 0
        ]);
        if (n?.isSome) {
            const r = n.unwrap();
            return Xe([
                t.derive.accounts._identity(r[0]).pipe(ye(([s])=>s)),
                xe(r)
            ]);
        }
        return xe([
            void 0,
            void 0
        ]);
    }
    function IYe(t, e) {
        return Pe(t, (n)=>n && e.query.identity?.identityOf ? Xe([
                e.query.identity.identityOf(n),
                e.query.identity.superOf(n)
            ]) : xe([
                void 0,
                void 0
            ]));
    }
    function AYe(t, e) {
        return Pe(t, (n)=>e.derive.accounts._identity(n).pipe(et(([r, s])=>CYe(e, r, s)), ye(([r, s])=>EYe(r, s)), et((r)=>PYe(r, e, n))));
    }
    function PYe(t, e, n) {
        const r = t.parent || n;
        return !r || !e.query.identity ? xe(t) : e.query.identity.subsOf(r).pipe(ye((s)=>{
            const i = s[1];
            return {
                ...t,
                subs: i
            };
        }));
    }
    const OYe = _u((t, e)=>t.derive.accounts.hasIdentityMulti([
            e
        ]));
    function MYe(t, e) {
        return Pe(t, (n)=>e.query.identity?.identityOf ? Xe([
                e.query.identity.identityOf.multi(n),
                e.query.identity.superOf.multi(n)
            ]).pipe(ye(([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 = zi(Mee(i).info.display);
                        u && !Nn(u) && (l = u);
                    }
                    return {
                        display: l,
                        hasIdentity: !!(l || c),
                        parentId: c
                    };
                }))) : xe(n.map(()=>({
                    hasIdentity: !1
                }))));
    }
    function RYe(t, e) {
        return Pe(t, (n)=>e.derive.accounts.indexes().pipe(ye((r)=>r[n.toString()])));
    }
    let d4 = null;
    function NYe(t) {
        return t.query.indices.accounts.entries().pipe(ye((e)=>e.reduce((n, [r, s])=>(s.isSome && (n[s.unwrap()[0].toString()] = t.registry.createType("AccountIndex", r.args[0])), n), {})));
    }
    function VYe(t, e) {
        return Pe(t, ()=>d4 ? xe(d4) : (e.query.indices ? NYe(e).pipe(sw({})) : xe({})).pipe(ye((n)=>(d4 = n, n))));
    }
    function BYe(t, e) {
        return Pe(t, (n)=>e.query.indices ? e.query.indices.accounts(n).pipe(ye((r)=>r.unwrapOr([])[0])) : xe(void 0));
    }
    function DYe(t, e) {
        return (e && t.query.nicks?.nameOf ? t.query.nicks.nameOf(e) : xe(void 0)).pipe(ye((n)=>n?.isSome ? Hl(n.unwrap()[0]).substring(0, t.consts.nicks.maxLength.toNumber()) : void 0));
    }
    function FYe(t, e) {
        return Pe(t, (n)=>e.derive.accounts.idAndIndex(n).pipe(et(([r, s])=>Xe([
                    xe({
                        accountId: r,
                        accountIndex: s
                    }),
                    e.derive.accounts.identity(r),
                    DYe(e, r)
                ])), ye(([{ accountId: r, accountIndex: s }, i, o])=>({
                    accountId: r,
                    accountIndex: s,
                    identity: i,
                    nickname: o
                }))));
    }
    const LYe = Object.freeze(Object.defineProperty({
        __proto__: null,
        _flags: xYe,
        _identity: IYe,
        accountId: wYe,
        flags: vYe,
        hasIdentity: OYe,
        hasIdentityMulti: MYe,
        idAndIndex: SYe,
        idToIndex: RYe,
        identity: AYe,
        indexToId: BYe,
        indexes: VYe,
        info: FYe
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function zYe(t, e) {
        const n = t.registry.getModuleInstances(t.runtimeVersion.specName, e), r = n?.length ? n[0] : e;
        return t.query[r];
    }
    function pw(t, e) {
        return (n, r)=>Pe(n, e(zYe(r, t), r, n));
    }
    function QP(t, e) {
        return (n)=>pw(n, (r)=>()=>Tt(r?.[t]) ? r[t]() : xe(e));
    }
    const P5 = QP("members", []);
    function O5(t) {
        return pw(t, (e)=>()=>Tt(e?.prime) ? e.prime().pipe(ye((n)=>n.unwrapOr(null))) : xe(null));
    }
    function UYe(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 Ree(t, e, n) {
        return (Tt(e?.proposals) && n.length ? Xe([
            xe(n),
            e.proposalOf.multi(n).pipe(su(()=>xe(n.map(()=>null)))),
            e.voting.multi(n)
        ]) : xe([
            [],
            [],
            []
        ])).pipe(ye((r)=>UYe(t, r)));
    }
    function M5(t) {
        return pw(t, (e)=>()=>xe(Tt(e?.proposals)));
    }
    function R5(t) {
        return pw(t, (e, n)=>()=>n.derive[t].proposalHashes().pipe(et((r)=>Ree(n, e, r))));
    }
    function N5(t) {
        return pw(t, (e, n)=>(r)=>Tt(e?.proposals) ? Pee(Ree(n, e, [
                    r
                ])) : xe(null));
    }
    const V5 = QP("proposalCount", null), B5 = QP("proposals", []), HYe = P5("allianceMotion"), jYe = M5("allianceMotion"), qYe = N5("allianceMotion"), KYe = V5("allianceMotion"), WYe = B5("allianceMotion"), $Ye = R5("allianceMotion"), XYe = O5("allianceMotion"), GYe = Object.freeze(Object.defineProperty({
        __proto__: null,
        hasProposals: jYe,
        members: HYe,
        prime: XYe,
        proposal: qYe,
        proposalCount: KYe,
        proposalHashes: WYe,
        proposals: $Ye
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function eO(t) {
        return t.query.voterList || t.query.voterBagsList || t.query.bagsList;
    }
    function ZYe(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)=>$e(s, {
                bagLower: i === r ? es : n[i + 1].id,
                bagUpper: s.id,
                index: i
            }));
    }
    function JYe(t, e) {
        const n = eO(e);
        return Pe(t, (r)=>{
            const s = r.map((i)=>Ns(i));
            return s.length ? n.listBags.multi(s).pipe(ye((i)=>ZYe(s, i))) : xe([]);
        });
    }
    function YYe(t, e) {
        const n = eO(e);
        return Pe(t, ()=>n.listBags.keys().pipe(et((r)=>e.derive.bagsList._getIds(r.map(({ args: [s] })=>s))), ye((r)=>r.filter(({ bag: s })=>s))));
    }
    function QYe(t, e) {
        return Pe(t, (n)=>e.derive.bagsList._getIds([
                Ns(n)
            ]).pipe(ye((r)=>r[0])));
    }
    function eQe(t, e) {
        return Pe(t, (n)=>e.derive.bagsList.listNodes(n.bag).pipe(ye((r)=>$e({
                    nodes: r
                }, n))));
    }
    function tQe(t, e) {
        return Pe(t, (n)=>e.derive.bagsList.get(n).pipe(et((r)=>e.derive.bagsList.expand(r))));
    }
    function nQe(t, e) {
        const n = new Ly(e), r = eO(t);
        return n.pipe(et((s)=>r.listNodes(s)), Ld((s)=>{
            jh(()=>{
                s.isSome && s.value.next.isSome ? n.next(s.unwrap().next.unwrap()) : n.complete();
            });
        }), u5(), ye((s)=>s.map((i)=>i.unwrap())));
    }
    function rQe(t, e) {
        return Pe(t, (n)=>n && n.head.isSome ? nQe(e, n.head.unwrap()) : xe([]));
    }
    const sQe = Object.freeze(Object.defineProperty({
        __proto__: null,
        _getIds: JYe,
        all: YYe,
        expand: eQe,
        get: QYe,
        getExpanded: tQe,
        listNodes: rQe
    }, Symbol.toStringTag, {
        value: "Module"
    })), iQe = "0x76657374696e6720";
    function oQe(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(iQe)).reduce((c, { amount: l })=>c.iadd(l), new at(0)));
            const a = s.filter(({ amount: c })=>c && !c.isMax());
            a.length && (r = t.registry.createType("Balance", i2(...a.map(({ amount: c })=>c))));
        }
        return {
            allLocked: o,
            lockedBalance: r,
            lockedBreakdown: s,
            vestingLocked: i
        };
    }
    function qF(t, e, n, r) {
        const { allLocked: s, lockedBalance: i, lockedBreakdown: o, vestingLocked: a } = oQe(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 at(0) : p, b = l.frozen.sub(d);
            c = t.registry.createType("Balance", s ? 0 : i2(new at(0), u.sub(i2(h, b))));
        }
        return $e({}, n, {
            availableBalance: t.registry.createType("Balance", s ? 0 : i2(new at(0), n?.freeBalance ? n.freeBalance.sub(i) : new at(0))),
            lockedBalance: i,
            lockedBreakdown: o,
            transferable: c,
            vestingLocked: a
        });
    }
    function aQe(t, e, n) {
        const r = n || [], s = !e.vestingLocked.isZero(), i = r.map(({ locked: c, perBlock: l, startingBlock: u })=>t.gt(u) ? Mze(c, l.mul(t.sub(u))) : es), o = i.reduce((c, l)=>c.iadd(l), new at(0)), a = r.reduce((c, { locked: l })=>c.iadd(l), new at(0));
        return {
            isVesting: s,
            vestedBalance: o,
            vestedClaimable: s ? e.vestingLocked.sub(a.sub(o)) : es,
            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 cQe(t, e) {
        const [n, [r, s, i], o] = e, a = qF(t, o, n, s[0]);
        return $e(a, aQe(o, a, r), {
            accountId: n.accountId,
            accountNonce: n.accountNonce,
            additional: s.slice(1).map((c, l)=>qF(t, o, n.additional[l], c)),
            namedReserves: i
        });
    }
    function lQe(t, e) {
        return Xe([
            t.query.balances.locks(e),
            t.query.balances.vesting(e)
        ]).pipe(ye(([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 uQe = (t)=>!!t;
    function KF(t) {
        return [
            t.map((e)=>!e),
            t.filter(uQe)
        ];
    }
    function dQe(t, e, n = [
        "balances"
    ]) {
        const [r, s] = KF(n.map((a)=>t.derive[a]?.customLocks || t.query[a]?.locks)), [i, o] = KF(n.map((a)=>t.query[a]?.reserves));
        return Xe([
            t.query.vesting?.vesting ? t.query.vesting.vesting(e) : xe(t.registry.createType("Option<VestingInfo>")),
            s.length ? Xe(s.map((a)=>a(e))) : xe([]),
            o.length ? Xe(o.map((a)=>a(e))) : xe([])
        ]).pipe(ye(([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 Nee(t, e) {
        const n = e.registry.getModuleInstances(e.runtimeVersion.specName, "balances");
        return Pe(t, (r)=>Xe([
                e.derive.balances.account(r),
                Tt(e.query.system?.account) || Tt(e.query.balances?.account) ? dQe(e, r, n) : lQe(e, r)
            ]).pipe(et(([s, i])=>Xe([
                    xe(s),
                    xe(i),
                    e.derive.chain.bestNumber()
                ])), ye((s)=>cQe(e, s))));
    }
    function $i(t) {
        return t.registry.createType("Balance");
    }
    function WF(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 fQe(t, [e, [n, [r, ...s], i]]) {
        return $e({
            accountId: e,
            accountNonce: n,
            additional: s.map((o)=>WF(t, o, i))
        }, WF(t, r, i));
    }
    function hQe(t, e) {
        return Xe([
            t.query.balances.freeBalance(e),
            t.query.balances.reservedBalance(e),
            t.query.system.accountNonce(e)
        ]).pipe(ye(([n, r, s])=>[
                s,
                [
                    [
                        n,
                        r,
                        $i(t),
                        $i(t)
                    ]
                ],
                {
                    isFrameAccountData: !1
                }
            ]));
    }
    function Vee(t, e) {
        const n = (r)=>[
                r,
                [
                    [
                        $i(t),
                        $i(t),
                        $i(t),
                        $i(t)
                    ]
                ],
                {
                    isFrameAccountData: !1
                }
            ];
        return Tt(t.query.system.account) ? t.query.system.account(e).pipe(ye(({ nonce: r })=>n(r))) : Tt(t.query.system.accountNonce) ? t.query.system.accountNonce(e).pipe(ye((r)=>n(r))) : xe(n(t.registry.createType("Index")));
    }
    function $F(t, e, n = [
        "balances"
    ]) {
        const r = n.map((i)=>t.derive[i]?.customAccount || t.query[i]?.account).filter((i)=>Tt(i)), s = (i, o)=>[
                i,
                o.map(({ feeFrozen: a, free: c, miscFrozen: l, reserved: u })=>[
                        c,
                        u,
                        a,
                        l
                    ]),
                {
                    isFrameAccountData: !1
                }
            ];
        return r.length ? Tt(t.query.system.account) ? Xe([
            t.query.system.account(e),
            ...r.map((i)=>i(e))
        ]).pipe(ye(([{ nonce: i }, ...o])=>s(i, o))) : Xe([
            t.query.system.accountNonce(e),
            ...r.map((i)=>i(e))
        ]).pipe(ye(([i, ...o])=>s(i, o))) : Vee(t, e);
    }
    function pQe(t, e) {
        return t.query.system.account(e).pipe(ye((n)=>{
            const r = n.nonce ? n.data : n[1], s = n.nonce || n[0];
            if (!r || r.isEmpty) return [
                s,
                [
                    [
                        $i(t),
                        $i(t),
                        $i(t),
                        $i(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 gQe(t, e) {
        const n = e.registry.getModuleInstances(e.runtimeVersion.specName, "balances"), r = n && n[0] !== "balances";
        return Pe(t, (s)=>e.derive.accounts.accountId(s).pipe(et((i)=>i ? Xe([
                    xe(i),
                    r ? $F(e, i, n) : Tt(e.query.system?.account) ? pQe(e, i) : Tt(e.query.balances?.account) ? $F(e, i) : Tt(e.query.balances?.freeBalance) ? hQe(e, i) : Vee(e, i)
                ]) : xe([
                    e.registry.createType("AccountId"),
                    [
                        e.registry.createType("Index"),
                        [
                            [
                                $i(e),
                                $i(e),
                                $i(e),
                                $i(e)
                            ]
                        ],
                        {
                            isFrameAccountData: !1
                        }
                    ]
                ])), ye((i)=>fQe(e, i))));
    }
    function bQe(t, e) {
        return Pe(t, (n)=>n?.length ? Xe(n.map((r)=>e.derive.balances.account(r))) : xe([]));
    }
    const mQe = Nee, yQe = Object.freeze(Object.defineProperty({
        __proto__: null,
        account: gQe,
        all: Nee,
        votingBalance: mQe,
        votingBalances: bQe
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function wQe(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 XF([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 _Qe(t, e) {
        const n = e.query.bounties || e.query.treasury;
        return Pe(t, ()=>n.bounties ? Xe([
                n.bountyCount(),
                e.query.council ? e.query.council.proposalCount() : xe(0)
            ]).pipe(et(()=>Xe([
                    n.bounties.keys(),
                    e.derive.council ? e.derive.council.proposals() : xe([])
                ])), et(([r, s])=>{
                const i = r.map(({ args: [o] })=>o);
                return Xe([
                    n.bounties.multi(i),
                    n.bountyDescriptions.multi(i),
                    xe(i),
                    xe(wQe(e, s))
                ]);
            }), ye(XF)) : xe(XF([
                [],
                [],
                [],
                []
            ])));
    }
    const xQe = Object.freeze(Object.defineProperty({
        __proto__: null,
        bounties: _Qe
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function Bee(t) {
        return (e, n)=>Pe(e, ()=>t(n).pipe(ye(BT)));
    }
    function vQe(t, e) {
        const n = e.session?.validators ? e.session.validators() : xe(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 Xe([
                xe(t),
                n,
                e.authorMapping.mappingWithDeposit(s).pipe(ye((i)=>i.unwrapOr({
                        account: null
                    }).account))
            ]);
            if (e.parachainStaking?.selectedCandidates && e.session?.nextKeys) {
                const i = s.toHex();
                return Xe([
                    xe(t),
                    n,
                    e.parachainStaking.selectedCandidates().pipe(Bc((o)=>Xe([
                            xe(o),
                            e.session.nextKeys.multi(o).pipe(ye((a)=>a.findIndex((c)=>c.unwrapOrDefault().nimbus.toHex() === i)))
                        ])), ye(([o, a])=>a === -1 ? null : o[a]))
                ]);
            }
        }
        return Xe([
            xe(t),
            n,
            xe(null)
        ]);
    }
    function tO(t, e, n) {
        return t.queryAt(e.parentHash.isEmpty ? n || e.hash : e.parentHash).pipe(et((r)=>vQe(e, r)));
    }
    const SQe = Bee((t)=>t.rpc.chain.subscribeNewHeads()), kQe = Bee((t)=>t.rpc.chain.subscribeFinalizedHeads());
    function TQe(t, e) {
        return Pe(t, ()=>Xe([
                e.derive.chain.bestNumber(),
                e.derive.chain.bestNumberFinalized()
            ]).pipe(ye(([n, r])=>e.registry.createType("BlockNumber", n.sub(r)))));
    }
    function Dee(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 Fee(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 || Dee(this.digest, l || []), this.createdAtHash = c?.createdAtHash;
            }
            get author() {
                return this.#e;
            }
        }
        return new i(t, e, n, r);
    }
    function EQe(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 CQe(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 || Dee(this.block.header.digest, d || []), this.#t = u || [], this.#n = EQe(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 IQe(t, e) {
        return Pe(t, (n)=>Xe([
                e.rpc.chain.getBlock(n),
                e.queryAt(n)
            ]).pipe(et(([r, s])=>Xe([
                    xe(r),
                    s.system.events(),
                    tO(e, r.block.header, n)
                ])), ye(([r, s, [, i, o]])=>CQe(s.registry, r, s, i, o))));
    }
    function AQe(t, e) {
        return Pe(t, (n)=>e.rpc.chain.getBlockHash(n).pipe(et((r)=>e.derive.chain.getBlock(r))));
    }
    function PQe(t, e) {
        return Pe(t, (n)=>e.rpc.chain.getHeader(n).pipe(et((r)=>tO(e, r, n)), ye(([r, s, i])=>Fee((s || r).registry, r, s, i))));
    }
    function OQe(t, e) {
        return Pe(t, ()=>e.derive.chain.subscribeFinalizedHeads().pipe(Bc((n)=>e.derive.chain.getBlock(n.createdAtHash || n.hash))));
    }
    function MQe(t, e) {
        return Pe(t, (n, r, s = [])=>e.rpc.chain.getHeader(n).pipe(et((i)=>i.parentHash.eq(r) ? xe([
                    i,
                    ...s
                ]) : e.derive.chain._getHeaderRange(i.parentHash, r, [
                    i,
                    ...s
                ]))));
    }
    function RQe(t, e) {
        return Pe(t, ()=>{
            let n = null;
            return e.rpc.chain.subscribeFinalizedHeads().pipe(Bc((r)=>{
                const s = n, i = r.parentHash;
                return n = r.createdAtHash = r.hash, s === null || i.eq(s) ? xe(r) : e.derive.chain._getHeaderRange(i, s, [
                    r
                ]).pipe(et((o)=>_c(o)));
            }));
        });
    }
    function NQe(t, e) {
        return Pe(t, ()=>e.derive.chain.subscribeNewHeads().pipe(Bc((n)=>e.derive.chain.getBlock(n.createdAtHash || n.hash))));
    }
    function VQe(t, e) {
        return Pe(t, ()=>e.rpc.chain.subscribeNewHeads().pipe(Bc((n)=>tO(e, n)), ye(([n, r, s])=>(n.createdAtHash = n.hash, Fee(n.registry, n, r, s)))));
    }
    const BQe = Object.freeze(Object.defineProperty({
        __proto__: null,
        _getHeaderRange: MQe,
        bestNumber: SQe,
        bestNumberFinalized: kQe,
        bestNumberLag: TQe,
        getBlock: IQe,
        getBlockByNumber: AQe,
        getHeader: PQe,
        subscribeFinalizedBlocks: OQe,
        subscribeFinalizedHeads: RQe,
        subscribeNewBlocks: NQe,
        subscribeNewHeads: VQe
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function DQe(t) {
        return xe([
            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 FQe(t, e) {
        return Pe(t, ()=>DQe(e).pipe(ye(([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 LQe = Object.freeze(Object.defineProperty({
        __proto__: null,
        fees: FQe
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function zQe(t) {
        return !Array.isArray(t);
    }
    function UQe(t) {
        return t.stakeOf.entries().pipe(ye((e)=>e.map(([{ args: [n] }, r])=>[
                    n,
                    r
                ])));
    }
    function HQe(t) {
        return t.votesOf.entries().pipe(ye((e)=>e.map(([{ args: [n] }, r])=>[
                    n,
                    r
                ])));
    }
    function jQe(t, e) {
        return Xe([
            UQe(e),
            HQe(e)
        ]).pipe(ye(([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 qQe(t) {
        return t.voting.entries().pipe(ye((e)=>e.map(([{ args: [n] }, r])=>[
                    n,
                    zQe(r) ? {
                        stake: r.stake,
                        votes: r.votes
                    } : {
                        stake: r[0],
                        votes: r[1]
                    }
                ])));
    }
    function KQe(t, e) {
        const n = e.query.elections || e.query.phragmenElection || e.query.electionsPhragmen;
        return Pe(t, ()=>n ? n.stakeOf ? jQe(e, n) : qQe(n) : xe([]));
    }
    function WQe(t, e) {
        return Pe(t, (n)=>e.derive.council.votes().pipe(ye((r)=>(r.find(([s])=>s.eq(n)) || [
                    null,
                    {
                        stake: e.registry.createType("Balance"),
                        votes: []
                    }
                ])[1])));
    }
    const $Qe = P5("council"), XQe = M5("council"), GQe = N5("council"), ZQe = V5("council"), JQe = B5("council"), YQe = R5("council"), QQe = O5("council"), eet = Object.freeze(Object.defineProperty({
        __proto__: null,
        hasProposals: XQe,
        members: $Qe,
        prime: QQe,
        proposal: GQe,
        proposalCount: ZQe,
        proposalHashes: JQe,
        proposals: YQe,
        votes: KQe,
        votesOf: WQe
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function tet(t) {
        return nn(Ii(":child_storage:default:", Wl(Ii("crowdloan", (t.fundIndex || t.trieIndex).toU8a()))));
    }
    function net(t, e) {
        return Pe(t, (n)=>e.query.crowdloan.funds(n).pipe(ye((r)=>r.isSome ? tet(r.unwrap()) : null)));
    }
    function Lee(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 f4 = 1e3;
    function ret(t, e) {
        let n = [], r = [];
        return t.query.system.events().pipe(et((s)=>{
            const i = Lee(e, s);
            return i.added.length || i.removed.length ? (n = n.concat(...i.added), r = r.concat(...i.removed), xe({
                added: n,
                addedDelta: i.added,
                blockHash: s.createdAtHash?.toHex() || "-",
                removed: r,
                removedDelta: i.removed
            })) : rw;
        }), sw({
            added: n,
            addedDelta: [],
            blockHash: "-",
            removed: r,
            removedDelta: []
        }));
    }
    function set(t, e) {
        return t.query.system.events().pipe(et((n)=>n.filter(({ event: { data: [s], method: i, section: o } })=>o === "crowdloan" && [
                    "AllRefunded",
                    "Dissolved",
                    "PartiallyRefunded"
                ].includes(i) && s.eq(e)).length ? xe(n.createdAtHash?.toHex() || "-") : rw), sw("-"));
    }
    function iet(t, e) {
        const n = new Ly(void 0);
        return n.pipe(et((r)=>t.rpc.childstate.getKeysPaged(e, "0x", f4, r)), Ld((r)=>{
            jh(()=>{
                r.length === f4 ? n.next(r[f4 - 1].toHex()) : n.complete();
            });
        }), u5(), ye((r)=>f0(r)));
    }
    function oet(t, e, n) {
        return set(t, e).pipe(et(()=>Tt(t.rpc.childstate.getKeysPaged) ? iet(t, n) : t.rpc.childstate.getKeys(n, "0x")), ye((r)=>r.map((s)=>s.toHex())));
    }
    function aet(t, e, n) {
        return Xe([
            oet(t, e, n),
            ret(t, e)
        ]).pipe(ye(([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 cet(t, e) {
        return Pe(t, (n)=>e.derive.crowdloan.childKey(n).pipe(et((r)=>r ? aet(e, n, r) : xe({
                    blockHash: "-",
                    contributorsHex: []
                }))));
    }
    function zee(t, e, n) {
        return Xe(n.map((r)=>t.rpc.childstate.getStorage(e, r))).pipe(ye((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)=>$e(s, {
                    [n[o]]: i
                }), {})));
    }
    function uet(t, e, n, r) {
        return t.query.system.events().pipe(et((s)=>{
            const i = Lee(e, s), o = r.filter((a)=>i.added.includes(a) || i.removed.includes(a));
            return o.length ? zee(t, n, o) : rw;
        }), sw({}));
    }
    function det(t, e, n, r) {
        return Xe([
            zee(t, n, r),
            uet(t, e, n, r)
        ]).pipe(ye(([s, i])=>$e({}, s, i)));
    }
    function fet(t, e) {
        return Pe(t, (n, r)=>e.derive.crowdloan.childKey(n).pipe(et((s)=>s && r.length ? det(e, n, s, r) : xe({}))));
    }
    const het = Object.freeze(Object.defineProperty({
        __proto__: null,
        childKey: net,
        contributions: cet,
        ownContributions: fet
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function pet(t) {
        return !!t.proposalHash;
    }
    function get(t) {
        return !!t.tally;
    }
    function GF(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 bet(t, e, { votedAye: n, votedNay: r, votedTotal: s }) {
        const i = pY(s);
        return i.isZero() ? !1 : t.isSuperMajorityApprove ? GF(r, i, n, e) : GF(r, e, n, i);
    }
    function met(t, e, n) {
        return t.isSimpleMajority ? n.votedAye.gt(n.votedNay) : bet(t, e, n);
    }
    function yet(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 at(0),
            votedNay: new at(0),
            votedTotal: new at(0)
        });
    }
    function wet(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 _et(t, e, n) {
        const r = get(e.status) ? wet(e.status.tally, n) : yet(n);
        return $e({}, r, {
            isPassing: met(e.status.threshold, t, r),
            votes: n
        });
    }
    function xet(t) {
        if (t.isNone) return null;
        const e = t.unwrap();
        return pet(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() : rr(t) ? Nn(t) ? t : vY(t) : Rt(t) ? nn(t) : t.toHex();
    }
    function vet(t) {
        return yp(t.proposal || t.proposalHash);
    }
    const ket = vY("democrac");
    function Tet(t) {
        return t instanceof ua;
    }
    function Eet(t) {
        return t.isInline || t.isLegacy || t.isLookup;
    }
    function Cet(t) {
        return t.query.democracy.dispatchQueue().pipe(et((e)=>Xe([
                xe(e),
                t.derive.democracy.preimages(e.map(([, n])=>n))
            ])), ye(([e, n])=>e.map(([r, s, i], o)=>({
                    at: r,
                    image: n[o],
                    imageHash: yp(s),
                    index: i
                }))));
    }
    function Iet(t) {
        return t.derive.democracy.referendumsFinished().pipe(et(()=>t.query.scheduler.agenda.keys()), et((e)=>{
            const n = e.map(({ args: [r] })=>r);
            return n.length ? Xe([
                xe(n),
                t.query.scheduler.agenda.multi(n).pipe(su(()=>xe(n.map(()=>[]))))
            ]) : xe([
                [],
                []
            ]);
        }));
    }
    function Aet(t) {
        return Iet(t).pipe(et(([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(ket)) {
                            const l = Tet(a.call) ? Eet(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]
                            });
                        }
                    }
                });
            }), Xe([
                xe(r),
                r.length ? t.derive.democracy.preimages(r.map(({ imageHash: s })=>s)) : xe([])
            ]);
        }), ye(([e, n])=>e.map((r, s)=>$e({
                    image: n[s]
                }, r))));
    }
    function Pet(t, e) {
        return Pe(t, ()=>Tt(e.query.scheduler?.agenda) ? Aet(e) : e.query.democracy.dispatchQueue ? Cet(e) : xe([]));
    }
    const Uee = [
        0,
        1,
        2,
        4,
        8,
        16,
        32
    ];
    function Oet(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(Uee[e.conviction.index])) : es
        ];
    }
    function Met(t, [e, n], r) {
        const { balance: s, vote: i } = n.asStandard, [o, a] = r.isFinished ? Oet(t, i, r.asFinished) : [
            es,
            es
        ];
        return {
            balance: s,
            isDelegated: !1,
            isFinished: r.isFinished,
            referendumEnd: o,
            referendumId: e,
            unlockAt: a,
            vote: i
        };
    }
    function Ret(t, { balance: e, conviction: n, target: r }) {
        return t.derive.democracy.locks(r).pipe(ye((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(Uee[n.index])),
                    vote: t.registry.createType("Vote", {
                        aye: l.isAye,
                        conviction: n
                    })
                }))));
    }
    function Net(t, { votes: e }) {
        return e.length ? t.query.democracy.referendumInfoOf.multi(e.map(([n])=>n)).pipe(ye((n)=>e.map((r, s)=>[
                    r,
                    n[s].unwrapOr(null)
                ]).filter((r)=>!!r[1] && kr(r[1].end) && r[0][1].isStandard).map(([r, s])=>Met(t, r, s)))) : xe([]);
    }
    function Vet(t, e) {
        return Pe(t, (n)=>e.query.democracy.votingOf ? e.query.democracy.votingOf(n).pipe(et((r)=>r.isDirect ? Net(e, r.asDirect) : r.isDelegating ? Ret(e, r.asDelegating) : xe([]))) : xe([]));
    }
    function Bet(t, e) {
        if (e.isNone) return xe(null);
        const [n, r] = e.unwrap();
        return t.derive.democracy.preimage(n).pipe(ye((s)=>({
                image: s,
                imageHash: yp(n),
                threshold: r
            })));
    }
    function Det(t, e) {
        return Pe(t, ()=>e.query.democracy?.nextExternal ? e.query.democracy.nextExternal().pipe(et((n)=>Bet(e, n))) : xe(null));
    }
    function Fet(t) {
        return t.ticket || t.deposit;
    }
    function Let(t) {
        return (t.maybeTicket || t.deposit).unwrapOrDefault();
    }
    function zet(t, e) {
        return !!e && !t.query.democracy.dispatchQueue;
    }
    function ZF(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 Uet(t, e) {
        if (!e.isNone) {
            if (zet(t, e)) {
                const n = e.unwrap();
                if (n.isMissing) return;
                const { data: r, deposit: s, provider: i, since: o } = n.asAvailable;
                return ZF(t, [
                    r,
                    i,
                    s,
                    o
                ]);
            }
            return ZF(t, e.unwrap());
        }
    }
    function Het(t, [e, n, r]) {
        if (!n) return;
        const [s, i] = n.isUnrequested ? Fet(n.asUnrequested) : Let(n.asRequested);
        let o;
        if (r) try {
            o = t.registry.createType("Call", r.toU8a(!0));
        } catch (a) {
            console.error(a);
        }
        return {
            at: es,
            balance: i,
            proposal: o,
            proposalHash: e,
            proposer: s
        };
    }
    function jet(t, e) {
        const n = e.map((r)=>yp(r));
        return t.query.democracy.preimages.multi(n).pipe(ye((r)=>r.map((s)=>Uet(t, s))));
    }
    function qet(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(et((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(ye((a)=>{
                let c = -1;
                return i.map((l, u)=>l ? [
                        n[u],
                        l,
                        a[++c].unwrapOr(null)
                    ] : [
                        n[u],
                        null,
                        null
                    ]).map((l)=>Het(t, l));
            }));
        }));
    }
    function Ket(t, e) {
        return Pe(t, (n)=>n.length ? Tt(e.query.democracy.preimages) ? jet(e, n) : Tt(e.query.preimage.preimageFor) ? qet(e, n) : xe([]) : xe([]));
    }
    const Wet = _u((t, e)=>t.derive.democracy.preimages([
            e
        ]));
    function $et(t) {
        return Tt(t[1].mul);
    }
    function Xet([t, e, n]) {
        return t.filter(([, , r], s)=>!!n[s]?.isSome && !r.isEmpty).map(([r, s, i], o)=>{
            const a = n[o].unwrap();
            return $e({
                image: e[o],
                imageHash: yp(s),
                index: r,
                proposer: i
            }, $et(a) ? {
                balance: a[1],
                seconds: a[0]
            } : {
                balance: a[0],
                seconds: a[1]
            });
        });
    }
    function Get(t, e) {
        return Pe(t, ()=>Tt(e.query.democracy?.publicProps) ? e.query.democracy.publicProps().pipe(et((n)=>n.length ? Xe([
                    xe(n),
                    e.derive.democracy.preimages(n.map(([, r])=>r)),
                    e.query.democracy.depositOf.multi(n.map(([r])=>r))
                ]) : xe([
                    [],
                    [],
                    []
                ])), ye(Xet)) : xe([]));
    }
    function Zet(t, e) {
        return Pe(t, ()=>e.query.democracy?.lowestUnbaked ? e.queryMulti([
                e.query.democracy.lowestUnbaked,
                e.query.democracy.referendumCount
            ]).pipe(ye(([n, r])=>r.gt(n) ? [
                    ...Array(r.sub(n).toNumber())
                ].map((s, i)=>n.addn(i)) : [])) : xe([]));
    }
    function Jet(t, e) {
        return Pe(t, ()=>e.derive.democracy.referendumsActive().pipe(et((n)=>n.length ? Xe([
                    xe(n),
                    e.derive.democracy._referendumsVotes(n)
                ]) : xe([
                    [],
                    []
                ])), ye(([n, r])=>n.map((s, i)=>$e({}, s, r[i])))));
    }
    function Yet(t, e) {
        return Pe(t, ()=>e.derive.democracy.referendumIds().pipe(et((n)=>n.length ? e.derive.democracy.referendumsInfo(n) : xe([]))));
    }
    function Qet(t, e) {
        return Pe(t, ()=>e.derive.democracy.referendumIds().pipe(et((n)=>e.query.democracy.referendumInfoOf.multi(n)), ye((n)=>n.map((r)=>r.unwrapOr(null)).filter((r)=>!!r && r.isFinished).map((r)=>r.asFinished))));
    }
    function ett(t, e) {
        return t.query.democracy.votersFor(e).pipe(et((n)=>Xe([
                xe(n),
                n.length ? t.query.democracy.voteOf.multi(n.map((r)=>[
                        e,
                        r
                    ])) : xe([]),
                t.derive.balances.votingBalances(n)
            ])), ye(([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 ttt(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($e({
                    accountId: r,
                    isDelegating: !1
                }, o.asStandard)), i), n), []);
    }
    function ntt(t, e) {
        return t.query.democracy.votingOf.entries().pipe(ye((n)=>{
            const r = n.map(([{ args: [o] }, a])=>[
                    o,
                    a
                ]), s = ttt(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 rtt(t, e) {
        return Pe(t, (n)=>Xe([
                e.derive.democracy.sqrtElectorate(),
                Tt(e.query.democracy.votingOf) ? ntt(e, n.index) : ett(e, n.index)
            ]).pipe(ye(([r, s])=>_et(r, n, s))));
    }
    function stt(t, e) {
        return Pe(t, (n)=>n.length ? Xe(n.map((r)=>e.derive.democracy._referendumVotes(r))) : xe([]));
    }
    function itt(t, e) {
        return Pe(t, (n, r)=>{
            const s = xet(r);
            return s ? e.derive.democracy.preimage(s.proposal || s.proposalHash).pipe(ye((i)=>({
                    image: i,
                    imageHash: vet(s),
                    index: e.registry.createType("ReferendumIndex", n),
                    status: s
                }))) : xe(null);
        });
    }
    function ott(t, e) {
        return Pe(t, (n)=>n.length ? e.query.democracy.referendumInfoOf.multi(n).pipe(et((r)=>Xe(n.map((s, i)=>e.derive.democracy._referendumInfo(s, r[i])))), ye((r)=>r.filter((s)=>!!s))) : xe([]));
    }
    function att(t, e) {
        return Pe(t, ()=>e.query.balances.totalIssuance().pipe(ye(pY)));
    }
    const ctt = Object.freeze(Object.defineProperty({
        __proto__: null,
        _referendumInfo: itt,
        _referendumVotes: rtt,
        _referendumsVotes: stt,
        dispatchQueue: Pet,
        locks: Vet,
        nextExternal: Det,
        preimage: Wet,
        preimages: Ket,
        proposals: Get,
        referendumIds: Zet,
        referendums: Jet,
        referendumsActive: Yet,
        referendumsFinished: Qet,
        referendumsInfo: ott,
        sqrtElectorate: att
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function ltt(t) {
        return !Array.isArray(t);
    }
    function utt(t) {
        return Array.isArray(t);
    }
    function JF(t) {
        return ltt(t) ? [
            t.who,
            t.stake
        ] : t;
    }
    function dtt(t) {
        return utt(t) ? t[0] : t;
    }
    function YF([, t], [, e]) {
        return e.cmp(t);
    }
    function ftt(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 htt(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 ptt(t, e, n) {
        return t.queryMulti([
            t.query[e].members,
            t.query[n].candidates,
            t.query[n].members,
            t.query[n].runnersUp
        ]);
    }
    function gtt(t, e) {
        return Xe([
            t.query[e].members(),
            xe([]),
            xe([]),
            xe([])
        ]);
    }
    function btt(t, e) {
        return Pe(t, ()=>{
            const [n, r] = htt(e);
            return (r ? ptt(e, n, r) : gtt(e, n)).pipe(ye(([s, i, o, a])=>$e({}, ftt(e, r), {
                    candidateCount: e.registry.createType("u32", i.length),
                    candidates: i.map(dtt),
                    members: o.length ? o.map(JF).sort(YF) : s.map((c)=>[
                            c,
                            e.registry.createType("Balance")
                        ]),
                    runnersUp: a.map(JF).sort(YF)
                })));
        });
    }
    const mtt = Object.freeze(Object.defineProperty({
        __proto__: null,
        info: btt
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function ytt([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(es)
            });
        }), t;
    }
    function wtt(t, e) {
        return Pe(t, ()=>e.query.imOnline?.receivedHeartbeats ? e.derive.staking.overview().pipe(et(({ currentIndex: n, validators: r })=>Xe([
                    xe({}),
                    xe(r),
                    e.query.imOnline.receivedHeartbeats.multi(r.map((s, i)=>[
                            n,
                            i
                        ])),
                    e.query.imOnline.authoredBlocks.multi(r.map((s)=>[
                            n,
                            s
                        ]))
                ])), ye(ytt)) : xe({}));
    }
    const _tt = Object.freeze(Object.defineProperty({
        __proto__: null,
        receivedHeartbeats: wtt
    }, Symbol.toStringTag, {
        value: "Module"
    })), xtt = P5("membership"), vtt = M5("membership"), Stt = N5("membership"), ktt = V5("membership"), Ttt = B5("membership"), Ett = R5("membership"), Ctt = O5("membership"), Itt = Object.freeze(Object.defineProperty({
        __proto__: null,
        hasProposals: vtt,
        members: xtt,
        prime: Ctt,
        proposal: Stt,
        proposalCount: ktt,
        proposalHashes: Ttt,
        proposals: Ett
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function Hee(t, e) {
        return t.isSome ? t.unwrap().some((n)=>n.eq(e)) : !1;
    }
    function Att(t, e) {
        const n = e.find(([r])=>r === t);
        if (n && n[1].isSome) {
            const [r, s] = n[1].unwrap();
            return $e({
                collatorId: r
            }, s.isWithRetries ? {
                isRetriable: !0,
                retries: s.asWithRetries.toNumber()
            } : {
                isRetriable: !1,
                retries: 0
            });
        }
        return null;
    }
    function QF(t, e) {
        return e.map((n)=>{
            const r = n.find(([s])=>s === t);
            return r ? r[1] : null;
        });
    }
    function Ptt(t, [e, n, r, s, i, o, a, c]) {
        return i.isNone ? null : {
            active: Att(t, e),
            didUpdate: Hee(s, t),
            heads: a,
            id: t,
            info: $e({
                id: t
            }, i.unwrap()),
            pendingSwapId: o.unwrapOr(null),
            relayDispatchQueue: c,
            retryCollators: QF(t, n),
            selectedCollators: QF(t, r)
        };
    }
    function Ott(t, e) {
        return Pe(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(ye((r)=>Ptt(e.registry.createType("ParaId", n), r))) : xe(null));
    }
    function Mtt([t, e, n, r, s]) {
        return t.map((i, o)=>({
                didUpdate: Hee(e, i),
                id: i,
                info: $e({
                    id: i
                }, r[o].unwrapOr(null)),
                pendingSwapId: s[o].unwrapOr(null),
                relayDispatchQueueSize: n[o][0].toNumber()
            }));
    }
    function Rtt(t, e) {
        return Pe(t, ()=>e.query.registrar?.parachains && e.query.parachains ? e.query.registrar.parachains().pipe(et((n)=>Xe([
                    xe(n),
                    e.query.parachains.didUpdate(),
                    e.query.parachains.relayDispatchQueueSize.multi(n),
                    e.query.registrar.paras.multi(n),
                    e.query.registrar.pendingSwap.multi(n)
                ])), ye(Mtt)) : xe([]));
    }
    const Ntt = Object.freeze(Object.defineProperty({
        __proto__: null,
        info: Ott,
        overview: Rtt
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function nO([t, e, n, r, s]) {
        return {
            activeEra: e,
            activeEraStart: n,
            currentEra: r,
            currentIndex: t,
            validatorCount: s
        };
    }
    function Vtt(t) {
        return t.queryMulti([
            t.query.session.currentIndex,
            t.query.staking.activeEra,
            t.query.staking.currentEra,
            t.query.staking.validatorCount
        ]).pipe(ye(([e, n, r, s])=>{
            const { index: i, start: o } = n.unwrapOrDefault();
            return nO([
                e,
                i,
                o,
                r.unwrapOrDefault(),
                s
            ]);
        }));
    }
    function Btt(t) {
        return t.query.session.currentIndex().pipe(ye((e)=>nO([
                e,
                t.registry.createType("EraIndex"),
                t.registry.createType("Option<Moment>"),
                t.registry.createType("EraIndex"),
                t.registry.createType("u32")
            ])));
    }
    function Dtt(t) {
        return xe(nO([
            t.registry.createType("SessionIndex", 1),
            t.registry.createType("EraIndex"),
            t.registry.createType("Option<Moment>"),
            t.registry.createType("EraIndex"),
            t.registry.createType("u32")
        ]));
    }
    function Ftt(t, e) {
        return Pe(t, ()=>e.query.session ? e.query.staking ? Vtt(e) : Btt(e) : Dtt(e));
    }
    function Ltt(t, e) {
        return Pe(t, ()=>e.derive.session.indexes().pipe(ye((n)=>{
                const r = e.consts?.babe?.epochDuration || e.registry.createType("u64", 1), s = e.consts?.staking?.sessionsPerEra || e.registry.createType("SessionIndex", 1);
                return $e({
                    eraLength: e.registry.createType("BlockNumber", s.mul(r)),
                    isEpoch: !!e.query.babe,
                    sessionLength: r,
                    sessionsPerEra: s
                }, n);
            })));
    }
    function rO(t) {
        return (e, n)=>Pe(e, ()=>n.derive.session.progress().pipe(ye((r)=>r[t])));
    }
    function ztt(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 $e({
            eraProgress: t.registry.createType("BlockNumber", c),
            sessionProgress: t.registry.createType("BlockNumber", a)
        }, e);
    }
    function Utt(t) {
        return t.derive.session.info().pipe(ye((e)=>$e({
                eraProgress: t.registry.createType("BlockNumber"),
                sessionProgress: t.registry.createType("BlockNumber")
            }, e)));
    }
    function Htt(t) {
        return t.derive.session.info().pipe(et((e)=>Xe([
                xe(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
                ])
            ])), ye(([e, [n, r, s, i]])=>[
                e,
                [
                    n,
                    r,
                    s,
                    i && i.isSome ? i.unwrap() : t.registry.createType("SessionIndex", 1)
                ]
            ]));
    }
    function jtt(t, e) {
        return Pe(t, ()=>e.query.babe ? Htt(e).pipe(ye(([n, r])=>ztt(e, n, r))) : Utt(e));
    }
    const qtt = rO("eraLength"), Ktt = rO("eraProgress"), Wtt = rO("sessionProgress"), $tt = Object.freeze(Object.defineProperty({
        __proto__: null,
        eraLength: qtt,
        eraProgress: Ktt,
        indexes: Ftt,
        info: Ltt,
        progress: jtt,
        sessionProgress: Wtt
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function Xtt(t) {
        return t.query.society.candidates().pipe(et((e)=>Xe([
                xe(e),
                t.query.society.suspendedCandidates.multi(e.map(({ who: n })=>n))
            ])), ye(([e, n])=>e.map(({ kind: r, value: s, who: i }, o)=>({
                    accountId: i,
                    isSuspended: n[o].isSome,
                    kind: r,
                    value: s
                }))));
    }
    function Gtt(t) {
        return t.query.society.candidates.entries().pipe(ye((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 Ztt(t, e) {
        return Pe(t, ()=>e.query.society.suspendedCandidates && e.query.society.candidates.creator.meta.type.isPlain ? Xtt(e) : Gtt(e));
    }
    function Jtt(t, e) {
        return Pe(t, ()=>Xe([
                e.query.society.bids(),
                e.query.society.defender ? e.query.society.defender() : xe(void 0),
                e.query.society.founder(),
                e.query.society.head(),
                e.query.society.maxMembers ? e.query.society.maxMembers() : xe(void 0),
                e.query.society.pot()
            ]).pipe(ye(([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 Ytt(t, e) {
        return Pe(t, (n)=>e.derive.society._members([
                n
            ]).pipe(ye(([r])=>r)));
    }
    function Qtt(t, e) {
        return Xe([
            xe(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(ye(([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 ent(t, e) {
        return Xe([
            xe(e),
            t.query.society.members.multi(e),
            t.query.society.payouts.multi(e),
            t.query.society.challengeRoundCount().pipe(et((n)=>t.query.society.defenderVotes.multi(e.map((r)=>[
                        n,
                        r
                    ])))),
            t.query.society.suspendedMembers.multi(e)
        ]).pipe(ye(([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 tnt(t, e) {
        return Pe(t, (n)=>e.query.society.members.creator.meta.type.isMap ? ent(e, n) : Qtt(e, n));
    }
    function nnt(t, e) {
        return Pe(t, ()=>e.query.society.members.creator.meta.type.isMap ? e.query.society.members.keys().pipe(et((n)=>e.derive.society._members(n.map(({ args: [r] })=>r)))) : e.query.society.members().pipe(et((n)=>e.derive.society._members(n))));
    }
    const rnt = Object.freeze(Object.defineProperty({
        __proto__: null,
        _members: tnt,
        candidates: Ztt,
        info: Jtt,
        member: Ytt,
        members: nnt
    }, Symbol.toStringTag, {
        value: "Module"
    })), snt = {
        withDestination: !0,
        withLedger: !0,
        withNominations: !0,
        withPrefs: !0
    };
    function int(t) {
        return t.reduce((e, { era: n, value: r })=>{
            const s = n.toString();
            return e[s] = (e[s] || es).add(r.unwrap()), e;
        }, {});
    }
    function ont(t, e, n) {
        const r = Object.entries(int((e?.unlocking || []).filter(({ era: s })=>s.unwrap().gt(n.activeEra)))).map(([s, i])=>({
                remainingEras: new at(s).isub(n.activeEra),
                value: t.registry.createType("Balance", i)
            }));
        return r.length ? r : void 0;
    }
    function ant(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 at(0)));
    }
    function cnt(t, e, n, r) {
        return $e({}, n, r, {
            redeemable: ant(t, r.stakingLedger, e),
            unlocking: ont(t, r.stakingLedger, e)
        });
    }
    function lnt(t, e) {
        return Pe(t, (n, r = snt)=>e.derive.session.info().pipe(et((s)=>Xe([
                    e.derive.staking.keysMulti(n),
                    e.derive.staking.queryMulti(n, r)
                ]).pipe(ye(([i, o])=>o.map((a, c)=>cnt(e, s, i[c], a)))))));
    }
    const unt = _u((t, e, n)=>t.derive.staking.accounts([
            e
        ], n));
    function dnt(t, e) {
        return Pe(t, ()=>e.derive.session.indexes().pipe(et(({ activeEra: n })=>e.query.staking.erasRewardPoints(n))));
    }
    const fnt = {
        withController: !0,
        withExposure: !0,
        withPrefs: !0
    };
    function hnt(t, e) {
        return f0([
            t,
            e.filter((n)=>!t.find((r)=>r.eq(n)))
        ]);
    }
    function pnt(t, e) {
        return Pe(t, (n = fnt, r = 0)=>e.derive.staking.validators().pipe(et(({ nextElected: s, validators: i })=>e.derive.staking.queryMulti(hnt(s, i), n, r).pipe(ye((o)=>({
                        info: o,
                        nextElected: s,
                        validators: i
                    }))))));
    }
    function sO(t, e, n) {
        const r = `${t}-${e.toString()}`;
        return [
            r,
            n ? void 0 : hw.get(r)
        ];
    }
    function jee(t, e, n) {
        return n ? [] : e.map((s)=>hw.get(`${t}-${s.toString()}`)).filter((s)=>!!s);
    }
    function iv(t, e, n) {
        return !e && hw.set(t, n), n;
    }
    function qee(t, e, n) {
        return !e && n.forEach((r)=>hw.set(`${t}-${r.era.toString()}`, r)), n;
    }
    function Kee(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 gnt = 14;
    function bnt(t, e) {
        const n = bT(t, gnt);
        let r = 0;
        const s = new Ly(n[r]);
        return s.pipe(et(e), Ld(()=>{
            jh(()=>{
                r++, r === n.length ? s.complete() : s.next(n[r]);
            });
        }), u5(), ye(f0));
    }
    function Wee(t, e) {
        return t.filter((n)=>!e.some(({ era: r })=>n.eq(r)));
    }
    function gw(t) {
        return (e, n)=>Pe(e, (r = !1)=>n.derive.staking.erasHistoric(r).pipe(et((s)=>n.derive.staking[t](s, r))));
    }
    function bw(t) {
        return (e, n)=>Pe(e, (r, s = !1, i)=>n.derive.staking.erasHistoric(s).pipe(et((o)=>n.derive.staking[t](r, o, s, i || 0))));
    }
    function iO(t) {
        return (e, n)=>Pe(e, (r)=>n.derive.staking[t](r, !0));
    }
    function oO(t) {
        return (e, n)=>Pe(e, (r, s)=>r.length ? bnt(r, (i)=>Xe(i.map((o)=>n.derive.staking[t](o, s)))) : xe([]));
    }
    const mnt = "eraExposure";
    function ynt(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 wnt(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 _nt(t, e) {
        return Pe(t, (n, r = !1)=>{
            const [s, i] = sO(mnt, n, r);
            return i ? xe(i) : e.query.staking.erasStakersPaged ? e.query.staking.erasStakersPaged.entries(n).pipe(ye((o)=>iv(s, r, wnt(n, o)))) : e.query.staking.erasStakersClipped.entries(n).pipe(ye((o)=>iv(s, r, ynt(n, o))));
        });
    }
    const xnt = iO("_eraExposure"), vnt = oO("_eraExposure"), Snt = gw("_erasExposure");
    function knt(t, e) {
        return Pe(t, (n)=>Xe([
                e.query.staking.activeEra(),
                e.consts.staking.historyDepth ? xe(e.consts.staking.historyDepth) : e.query.staking.historyDepth()
            ]).pipe(ye(([r, s])=>{
                const i = [], o = s.toNumber(), a = r.unwrapOrDefault().index;
                let c = a;
                for(; c.gte(es) && i.length < o;)(c !== a || n === !0) && i.push(e.registry.createType("EraIndex", c)), c = c.sub(hb);
                return i.reverse();
            })));
    }
    const eL = "eraPoints";
    function Tnt({ individual: t }) {
        return [
            ...t.entries()
        ].filter(([, e])=>e.gt(es)).reduce((e, [n, r])=>(e[n.toString()] = r, e), {});
    }
    function Ent(t, e) {
        return t.map((n, r)=>({
                era: n,
                eraPoints: e[r].total,
                validators: Tnt(e[r])
            }));
    }
    function Cnt(t, e) {
        return Pe(t, (n, r)=>{
            if (!n.length) return xe([]);
            const s = jee(eL, n, r), i = Wee(n, s);
            return i.length ? e.query.staking.erasRewardPoints.multi(i).pipe(ye((o)=>Kee(n, s, qee(eL, r, Ent(i, o))))) : xe(s);
        });
    }
    const Int = gw("_erasPoints"), Ant = "eraPrefs";
    function Pnt(t, e) {
        const n = {};
        return e.forEach(([r, s])=>{
            n[r.args[1].toString()] = s;
        }), {
            era: t,
            validators: n
        };
    }
    function Ont(t, e) {
        return Pe(t, (n, r)=>{
            const [s, i] = sO(Ant, n, r);
            return i ? xe(i) : e.query.staking.erasValidatorPrefs.entries(n).pipe(ye((o)=>iv(s, r, Pnt(n, o))));
        });
    }
    const Mnt = iO("_eraPrefs"), Rnt = oO("_eraPrefs"), Nnt = gw("_erasPrefs"), tL = "eraRewards";
    function Vnt(t, e) {
        return t.map((n, r)=>({
                era: n,
                eraReward: e[r].unwrapOrDefault()
            }));
    }
    function Bnt(t, e) {
        return Pe(t, (n, r)=>{
            if (!n.length) return xe([]);
            const s = jee(tL, n, r), i = Wee(n, s);
            return i.length ? e.query.staking.erasValidatorReward.multi(i).pipe(ye((o)=>Kee(n, s, qee(tL, r, Vnt(i, o))))) : xe(s);
        });
    }
    const Dnt = gw("_erasRewards"), Fnt = "eraSlashes";
    function Lnt(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 znt(t, e) {
        return Pe(t, (n, r)=>{
            const [s, i] = sO(Fnt, n, r);
            return i ? xe(i) : Xe([
                e.query.staking.nominatorSlashInEra.entries(n),
                e.query.staking.validatorSlashInEra.entries(n)
            ]).pipe(ye(([o, a])=>iv(s, r, Lnt(n, o, a))));
        });
    }
    const Unt = iO("_eraSlashes"), Hnt = oO("_eraSlashes"), jnt = gw("_erasSlashes");
    function qnt(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 Knt = _u((t, e)=>t.derive.staking.keysMulti([
            e
        ]));
    function Wnt(t, e) {
        return Pe(t, (n)=>n.length ? e.query.session.queuedKeys().pipe(et((r)=>Xe([
                    xe(r),
                    e.consts.session?.dedupKeyPrefix ? e.query.session.nextKeys.multi(n.map((s)=>[
                            e.consts.session.dedupKeyPrefix,
                            s
                        ])) : Xe(n.map((s)=>e.query.session.nextKeys(s)))
                ])), ye(([r, s])=>n.map((i, o)=>qnt(i, r, s[o])))) : xe([]));
    }
    function $nt(t, e) {
        return Pe(t, ()=>Xe([
                e.derive.session.indexes(),
                e.derive.staking.validators()
            ]).pipe(ye(([n, { nextElected: r, validators: s }])=>$e({}, n, {
                    nextElected: r,
                    validators: s
                }))));
    }
    function Xnt(t, e) {
        return Pe(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 ? Xe([
                e.query.staking.erasStakersClipped ? Xe(r.map((l)=>e.query.staking.erasStakersClipped(l, n))) : xe(r.map((l)=>o)),
                e.query.staking.erasStakers ? Xe(r.map((l)=>e.query.staking.erasStakers(l, n))) : xe(r.map((l)=>o)),
                e.query.staking.erasStakersPaged ? Xe(r.map((l)=>e.query.staking.erasStakersPaged(l, n, i))) : xe(r.map((l)=>a)),
                e.query.staking.erasStakersOverview ? Xe(r.map((l)=>e.query.staking.erasStakersOverview(l, n))) : xe(r.map((l)=>c))
            ]).pipe(ye(([l, u, d, f])=>r.map((p, h)=>({
                        clipped: l[h],
                        era: p,
                        exposure: u[h],
                        exposureMeta: f[h],
                        exposurePaged: d[h]
                    })))) : xe([]);
        });
    }
    const Gnt = _u((t, e, n, r)=>t.derive.staking._ownExposures(e, [
            n
        ], !0, r || 0)), Znt = bw("_ownExposures");
    function Jnt(t, e) {
        return Pe(t, (n, r, s)=>r.length ? Xe([
                Xe(r.map((i)=>e.query.staking.validatorSlashInEra(i, n))),
                Xe(r.map((i)=>e.query.staking.nominatorSlashInEra(i, n)))
            ]).pipe(ye(([i, o])=>r.map((a, c)=>({
                        era: a,
                        total: i[c].isSome ? i[c].unwrap()[1] : o[c].unwrapOrDefault()
                    })))) : xe([]));
    }
    const Ynt = _u((t, e, n)=>t.derive.staking._ownSlashes(e, [
            n
        ], !0)), Qnt = bw("_ownSlashes");
    function ert(t) {
        return typeof t.isSome == "boolean" ? t.unwrapOr(null) : t;
    }
    function trt(t, e) {
        return t.registry.createType("Vec<u32>", e.filter((n)=>n !== -1));
    }
    function nrt(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 rrt(t, e, n, r, s, i, o, a, c, l, u) {
        return {
            accountId: e,
            claimedRewardsEras: trt(t, l),
            controllerId: n?.unwrapOr(null) || null,
            exposureEraStakers: u,
            exposureMeta: c,
            exposurePaged: o,
            nominators: r.isSome ? r.unwrap().targets : [],
            rewardDestination: ert(s),
            stakingLedger: a.unwrapOrDefault(),
            stashId: e,
            validatorPrefs: i
        };
    }
    function srt(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 ? Xe(r.map((i)=>t.query.staking.ledger(i))) : xe([])).pipe(ye((i)=>{
            let o = -1;
            return e.map((a)=>a && a.isSome && i[++o] || s);
        }));
    }
    function irt(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"), b = t.registry.createType("Exposure"), y = t.registry.createType("ValidatorPrefs"), _ = t.registry.createType("Option<Null>"), v = t.registry.createType("Option<Null>"), w = [
            -1
        ], E = Number(t.consts.staking.historyDepth.toNumber()), I = new Array(E).fill(0).map((D, U)=>U === 0 ? n.toNumber() - 1 : n.toNumber() - U - 1);
        return Xe([
            s || l ? Xe(e.map((D)=>t.query.staking.bonded(D))) : xe(e.map(()=>null)),
            u ? Xe(e.map((D)=>t.query.staking.nominators(D))) : xe(e.map(()=>p)),
            i ? Xe(e.map((D)=>t.query.staking.payee(D))) : xe(e.map(()=>h)),
            d ? Xe(e.map((D)=>t.query.staking.validators(D))) : xe(e.map(()=>y)),
            o && t.query.staking.erasStakersPaged ? Xe(e.map((D)=>t.query.staking.erasStakersPaged(n, D, f))) : xe(e.map(()=>_)),
            c && t.query.staking.erasStakersOverview ? Xe(e.map((D)=>t.query.staking.erasStakersOverview(n, D))) : xe(e.map(()=>v)),
            r && t.query.staking.claimedRewards ? Xe([
                t.query.staking.claimedRewards.entries(),
                t.query.staking.erasStakersOverview.entries()
            ]).pipe(ye(([D, U])=>nrt(e, I, D, U))) : xe(e.map(()=>w)),
            a && t.query.staking.erasStakers ? Xe(e.map((D)=>t.query.staking.erasStakers(n, D))) : xe(e.map(()=>b))
        ]);
    }
    function ort(t, e, n, r, s) {
        return irt(t, n, e, r, s).pipe(et(([i, o, a, c, l, u, d, f])=>srt(t, i, r).pipe(ye((p)=>n.map((h, b)=>rrt(t, h, i[b], o[b], a[b], c[b], l[b], p[b], u[b], d[b], f[b]))))));
    }
    const art = _u((t, e, n, r)=>t.derive.staking.queryMulti([
            e
        ], n, r));
    function crt(t, e) {
        return Pe(t, (n, r, s)=>e.derive.session.indexes().pipe(et(({ activeEra: i })=>{
                const o = n.map((c)=>e.registry.createType("AccountId", c)), a = s || 0;
                return o.length ? ort(e, i, o, r, a) : xe([]);
            })));
    }
    function lrt(t, e) {
        return Pe(t, (n, r, s = !1)=>{
            const i = n.map((o)=>e.registry.createType("AccountId", o).toString());
            return e.derive.staking._erasExposure(r, s).pipe(ye((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 urt(t, e) {
        return Pe(t, (n, r = !1)=>e.derive.staking.erasHistoric(r).pipe(et((s)=>e.derive.staking._stakerExposures(n, s, r))));
    }
    const drt = _u((t, e, n)=>t.derive.staking.stakerExposures([
            e
        ], n));
    function frt(t, e) {
        return Pe(t, (n, r, s)=>{
            const i = e.registry.createType("AccountId", n).toString();
            return e.derive.staking._erasPoints(r, s).pipe(ye((o)=>o.map(({ era: a, eraPoints: c, validators: l })=>({
                        era: a,
                        eraPoints: c,
                        points: l[i] || e.registry.createType("RewardPoint")
                    }))));
        });
    }
    const hrt = bw("_stakerPoints");
    function prt(t, e) {
        return Pe(t, (n, r, s)=>e.query.staking.erasValidatorPrefs.multi(r.map((i)=>[
                    i,
                    n
                ])).pipe(ye((i)=>i.map((o, a)=>({
                        era: r[a],
                        validatorPrefs: o
                    })))));
    }
    const grt = bw("_stakerPrefs");
    function $ee(t, e) {
        const n = e ? (e.legacyClaimedRewards || e.claimedRewards)?.toArray() : [];
        return (t.toArray() || []).concat(n);
    }
    function brt(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((v)=>v.era.eq(a)) || {
                eraPoints: es,
                validators: {}
            }, { eraReward: h } = s.find((v)=>v.era.eq(a)) || {
                eraReward: t.registry.createType("Balance")
            }, { validators: b } = r.find((v)=>v.era.eq(a)) || {
                validators: {}
            }, y = {}, _ = e.toString();
            return Object.entries(d).forEach(([v, w])=>{
                const E = p[v] || es, I = b[v]?.commission.unwrap() || es, D = w.total ? w.total?.unwrap() : w.pageTotal ? w.pageTotal?.unwrap() : es;
                let U = es, K;
                if (!(D.isZero() || E.isZero() || f.isZero())) {
                    U = h.mul(E).div(f);
                    const $ = I.mul(U).div(Fx);
                    let ne;
                    if (v === _) if (w.own) ne = w.own.unwrap();
                    else {
                        const te = w.others.find(({ who: J })=>J.eq(v));
                        ne = te ? te.value.unwrap() : es;
                    }
                    else {
                        const te = w.others.find(({ who: J })=>J.eq(_));
                        ne = te ? te.value.unwrap() : es;
                    }
                    K = U.sub($).imul(ne).div(D).iadd(v === _ ? $ : es);
                }
                y[v] = {
                    total: t.registry.createType("Balance", U),
                    value: t.registry.createType("Balance", K)
                };
            }), {
                era: a,
                eraReward: h,
                isClaimed: o.some((v)=>v.eq(a)),
                isEmpty: c,
                isValidator: l,
                nominating: u,
                validators: y
            };
        });
    }
    function mrt(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 yrt(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;
                $ee(r, a).some((c)=>n.era?.eq(c)) && s.push(i);
            }
        }), s.forEach((i)=>{
            delete n.validators[i];
        });
    }
    function wrt(t, e, { claimedRewardsEras: n, rewards: r, stakingLedger: s }) {
        const i = t.filter((c)=>!$ee(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)) ? (yrt(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 $e({}, c, {
                isClaimed: l,
                nominators: c.nominating.filter((d)=>c.validators[d.validatorId])
            });
        });
    }
    function _rt(t, e) {
        return Pe(t, (n, r = !1)=>Xe([
                e.derive.staking._erasPoints(n, r),
                e.derive.staking._erasPrefs(n, r),
                e.derive.staking._erasRewards(n, r)
            ]));
    }
    function xrt(t, e) {
        return Pe(t, (n, r, s = !1)=>{
            const i = r.map((o)=>typeof o == "number" || typeof o == "string" ? e.registry.createType("u32", o) : o);
            return Xe([
                e.derive.staking.queryMulti(n, {
                    withClaimedRewardsEras: !0,
                    withLedger: !0
                }),
                e.derive.staking._stakerExposures(n, i, s),
                e.derive.staking._stakerRewardsEras(i, s)
            ]).pipe(et(([o, a, c])=>{
                const l = o.map(({ claimedRewardsEras: f, stakingLedger: p, stashId: h }, b)=>!h || !p && !f ? [] : brt(e, h, c, a[b], f));
                if (s) return xe(l);
                const [u, d] = mrt(l);
                return e.derive.staking.queryMulti(u, {
                    withClaimedRewardsEras: !0,
                    withLedger: !0
                }).pipe(ye((f)=>o.map(({ claimedRewardsEras: p, stakingLedger: h }, b)=>wrt(r, d[b].map((y)=>[
                                y,
                                f.find((_)=>_.accountId.eq(y))
                            ]).filter((y)=>!!y[1]), {
                            claimedRewardsEras: p,
                            rewards: l[b],
                            stakingLedger: h
                        }))));
            }));
        });
    }
    const vrt = _u((t, e, n)=>t.derive.staking.erasHistoric(n).pipe(et((r)=>t.derive.staking._stakerRewards([
                e
            ], r, n))));
    function Srt(t, e) {
        return Pe(t, (n, r)=>n.length && r.length ? e.derive.staking._stakerRewards(n, r, !1) : xe([]));
    }
    function krt(t, e) {
        return Pe(t, (n, r = !1)=>e.derive.staking.erasHistoric(r).pipe(et((s)=>e.derive.staking.stakerRewardsMultiEras(n, s))));
    }
    function Trt(t, e) {
        return Pe(t, (n, r, s)=>{
            const i = e.registry.createType("AccountId", n).toString();
            return e.derive.staking._erasSlashes(r, s).pipe(ye((o)=>o.map(({ era: a, nominators: c, validators: l })=>({
                        era: a,
                        total: c[i] || l[i] || e.registry.createType("Balance")
                    }))));
        });
    }
    const Ert = bw("_stakerSlashes");
    function Crt(t) {
        let e = Date.now();
        return t.query.system.events().pipe(ye((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)), sw(e), YP({
            skipTimeout: !0
        }));
    }
    function Irt(t, e) {
        return Pe(t, ()=>Crt(e).pipe(et(()=>e.query.staking.validators.keys()), ye((n)=>n.map(({ args: [r] })=>r).filter((r)=>r))));
    }
    function Art(t, e) {
        return Pe(t, ()=>e.query.staking.erasStakersOverview ? e.derive.session.indexes().pipe(et(({ currentEra: n })=>e.query.staking.erasStakersOverview.keys(n)), ye((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(et(({ currentEra: n })=>e.query.staking.erasStakers.keys(n)), ye((n)=>[
                    ...new Set(n.map(({ args: [, r] })=>r.toString()))
                ].map((r)=>e.registry.createType("AccountId", r)))) : e.query.staking.currentElected());
    }
    function Prt(t, e) {
        return Pe(t, ()=>Xe([
                e.query.session ? e.query.session.validators() : xe([]),
                e.query.staking ? e.derive.staking.nextElected() : xe([])
            ]).pipe(ye(([n, r])=>({
                    nextElected: r.length ? r : n,
                    validators: n
                }))));
    }
    const Ort = {
        withController: !0,
        withPrefs: !0
    };
    function Mrt(t, e) {
        return Pe(t, (n = Ort)=>Xe([
                e.derive.staking.validators(),
                e.derive.staking.stashes()
            ]).pipe(et(([{ 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(ye((a)=>({
                        info: a,
                        waiting: o
                    })));
            })));
    }
    const Rrt = Object.freeze(Object.defineProperty({
        __proto__: null,
        _eraExposure: _nt,
        _eraPrefs: Ont,
        _eraSlashes: znt,
        _erasExposure: vnt,
        _erasPoints: Cnt,
        _erasPrefs: Rnt,
        _erasRewards: Bnt,
        _erasSlashes: Hnt,
        _ownExposures: Xnt,
        _ownSlashes: Jnt,
        _stakerExposures: lrt,
        _stakerPoints: frt,
        _stakerPrefs: prt,
        _stakerRewards: xrt,
        _stakerRewardsEras: _rt,
        _stakerSlashes: Trt,
        account: unt,
        accounts: lnt,
        currentPoints: dnt,
        electedInfo: pnt,
        eraExposure: xnt,
        eraPrefs: Mnt,
        eraSlashes: Unt,
        erasExposure: Snt,
        erasHistoric: knt,
        erasPoints: Int,
        erasPrefs: Nnt,
        erasRewards: Dnt,
        erasSlashes: jnt,
        keys: Knt,
        keysMulti: Wnt,
        nextElected: Art,
        overview: $nt,
        ownExposure: Gnt,
        ownExposures: Znt,
        ownSlash: Ynt,
        ownSlashes: Qnt,
        query: art,
        queryMulti: crt,
        stakerExposure: drt,
        stakerExposures: urt,
        stakerPoints: hrt,
        stakerPrefs: grt,
        stakerRewards: vrt,
        stakerRewardsMulti: krt,
        stakerRewardsMultiEras: Srt,
        stakerSlashes: Ert,
        stashes: Irt,
        validators: Prt,
        waitingInfo: Mrt
    }, Symbol.toStringTag, {
        value: "Module"
    })), Nrt = P5("technicalCommittee"), Vrt = M5("technicalCommittee"), Brt = N5("technicalCommittee"), Drt = V5("technicalCommittee"), Frt = B5("technicalCommittee"), Lrt = R5("technicalCommittee"), zrt = O5("technicalCommittee"), Urt = Object.freeze(Object.defineProperty({
        __proto__: null,
        hasProposals: Vrt,
        members: Nrt,
        prime: zrt,
        proposal: Brt,
        proposalCount: Drt,
        proposalHashes: Frt,
        proposals: Lrt
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function Hrt(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, b)=>h.proposal && b.proposal ? h.proposal.method.localeCompare(b.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 jrt(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 Xe([
            t.query.treasury.proposals.multi(i),
            t.derive.council ? t.derive.council.proposals() : xe([])
        ]).pipe(ye(([o, a])=>Hrt(t, {
                allIds: i,
                allProposals: o,
                approvalIds: n,
                councilProposals: a,
                proposalCount: e
            })));
    }
    function qrt(t, e) {
        return Pe(t, ()=>e.query.treasury ? Xe([
                e.query.treasury.proposalCount(),
                e.query.treasury.approvals()
            ]).pipe(et(([n, r])=>jrt(e, n, r))) : xe({
                approvals: [],
                proposalCount: e.registry.createType("ProposalIndex"),
                proposals: []
            }));
    }
    const Krt = Object.freeze(Object.defineProperty({
        __proto__: null,
        proposals: qrt
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    function Wrt(t, e) {
        return Pe(t, (n)=>Xe([
                e.rpc.chain.getBlock(n),
                e.queryAt(n).pipe(et((r)=>r.system.events()))
            ]).pipe(ye(([r, s])=>({
                    block: r,
                    events: s
                }))));
    }
    function $rt(t, e) {
        return Pe(t, (n, r)=>e.derive.tx.events(n).pipe(ye(({ 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 Xrt(t, e) {
        return Pe(t, (n, r)=>e.derive.tx.events(n).pipe(ye(({ 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 Grt = 250, Zrt = new at(6 * 1e3), Xee = new at(5), Jrt = new at(300 * 1e3);
    function Gee(t, e) {
        return t.derive.balances.account(e).pipe(ye(({ accountNonce: n })=>n));
    }
    function Yrt(t, e) {
        return t.call.accountNonceApi ? t.call.accountNonceApi.accountNonce(e) : t.rpc.system?.accountNextIndex ? t.rpc.system.accountNextIndex(e) : Gee(t, e);
    }
    function Qrt(t) {
        return Xe([
            t.rpc.chain.getHeader().pipe(et((e)=>e.parentHash.isEmpty ? xe(e) : t.rpc.chain.getHeader(e.parentHash).pipe(su(()=>xe(e))))),
            t.rpc.chain.getFinalizedHead().pipe(et((e)=>t.rpc.chain.getHeader(e).pipe(su(()=>xe(null)))))
        ]).pipe(ye(([e, n])=>!n || BT(e).sub(BT(n)).gt(Xee) ? e : n));
    }
    function est(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 tst(t, e) {
        return (n, r, s)=>Xe([
                kr(r) ? Gee(e, n) : r === -1 ? Yrt(e, n) : xe(e.registry.createType("Index", r)),
                kr(s) || Ln(s) && s > 0 ? Qrt(e) : xe(null)
            ]).pipe(ye(([i, o])=>({
                    header: o,
                    mortalLength: Math.min(e.consts.system?.blockHashCount?.toNumber() || Grt, Jrt.div(est(e) || Zrt).iadd(Xee).toNumber()),
                    nonce: i
                })));
    }
    const nst = Object.freeze(Object.defineProperty({
        __proto__: null,
        accountExtrinsics: Xrt,
        events: Wrt,
        extrinsicInfo: $rt,
        signingInfo: tst
    }, Symbol.toStringTag, {
        value: "Module"
    })), rst = {
        accounts: LYe,
        alliance: GYe,
        bagsList: sQe,
        balances: yQe,
        bounties: xQe,
        chain: BQe,
        contracts: LQe,
        council: eet,
        crowdloan: het,
        democracy: ctt,
        elections: mtt,
        imOnline: _tt,
        membership: Itt,
        parachains: Ntt,
        session: $tt,
        society: rnt,
        staking: Rrt,
        technicalCommittee: Urt,
        treasury: Krt,
        tx: nst
    }, xf = {
        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 sst(t, e, n) {
        return t.registry.getModuleInstances(e, n) || [];
    }
    function nL(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)=>sst(e, o, p).some(a), l = (p)=>(h)=>p.some((b)=>i.includes(b) && e.query[b][h]), u = (p)=>Object.keys(n[p]), d = (p, h)=>n[p][h](t, e), f = (p)=>!xf[p] || xf[p].instances.some(a) && (!xf[p].methods.length || xf[p].methods.every(l(xf[p].instances))) || xf[p].withDetect && xf[p].instances.some(c);
        for(let p = 0, h = s.length; p < h; p++){
            const b = s[p];
            f(b) && Oee(r, b, u, d);
        }
        return r;
    }
    function ist(t, e, n = {}) {
        return {
            ...nL(t, e, rst),
            ...nL(t, e, n)
        };
    }
    function rL(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++)Oee(s, i[o], n, r);
        return s;
    }
    const ost = (t)=>t;
    function aO(t, e, n, r) {
        return t.filter(({ event: s })=>e === s.section && n.includes(s.method)).map((s)=>r(s));
    }
    function ast({ event: { data: [t] } }) {
        return t;
    }
    function cst({ event: { data: t, method: e } }) {
        return e === "ExtrinsicSuccess" ? t[0] : t[1];
    }
    function lst(t = []) {
        return aO(t, "system", [
            "ExtrinsicFailed"
        ], ast)[0];
    }
    function ust(t = []) {
        return aO(t, "system", [
            "ExtrinsicFailed",
            "ExtrinsicSuccess"
        ], cst)[0];
    }
    class h4 {
        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 || lst(s), this.dispatchInfo = r || ust(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 aO(this.events, e, Array.isArray(n) ? n : [
                n
            ], ost);
        }
        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 sL(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 Ln(n.era) && (delete n.era, delete n.blockHash), DT(t, n, {
                nonce: i
            });
        }
        return DT(t, n, {
            blockHash: r.hash,
            era: e.createTypeUnsafe("ExtrinsicEra", [
                {
                    current: r.number,
                    period: n.era || s
                }
            ]),
            nonce: i
        });
    }
    function iL(t, e) {
        let n = {};
        return Tt(t) ? e = t : n = $e({}, t), [
            n,
            e
        ];
    }
    function DT(t, e, n) {
        return $e({
            blockHash: t.genesisHash,
            genesisHash: t.genesisHash
        }, e, n, {
            runtimeVersion: t.runtimeVersion,
            signedExtensions: t.registry.signedExtensions,
            version: t.extrinsicType
        });
    }
    function dst(t = {}) {
        return Ja(t) || Ln(t) ? {
            nonce: t
        } : t;
    }
    function fst({ api: t, apiType: e, blockHash: n, decorateMethod: r }) {
        const s = t.registry.createClass("Extrinsic"), i = new WeakMap;
        class o extends s {
            #e;
            #t = bp;
            constructor(c, l){
                super(c, l, {
                    version: t.extrinsicType
                }), this.#e = e === "rxjs";
            }
            get hasDryRun() {
                return Tt(t.rpc.system?.dryRun);
            }
            get hasPaymentInfo() {
                return Tt(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 || rr(l) || Rt(l) ? r(()=>t.rpc.system.dryRun(this.toHex(), n || l)) : r(()=>this.#n(c, l).pipe(et(()=>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 || rr(l) || Rt(l)) return r(()=>t.callAt(n || l).pipe(et((f)=>{
                        const p = this.toU8a();
                        return f.transactionPaymentApi.queryInfo(p, p.length);
                    })));
                const [u] = iL(l), d = GS(c) ? c.address : c.toString();
                return r(()=>t.derive.tx.signingInfo(d, u.nonce, u.era).pipe(MB(), et((f)=>{
                        const p = sL(t, this.registry, u, f), h = DT(t, p, {}), b = t.tx(this.toU8a()).signFake(d, h).toU8a();
                        return t.call.transactionPaymentApi.queryInfo(b, b.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(ye((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] = iL(l, u), p = t.hasSubscriptions && (this.#e || !!f);
                return r(()=>this.#n(c, d).pipe(et((h)=>p ? this.#i(h) : this.#s(h))))(f);
            }
            withResultTransform(c) {
                return this.#t = c, this;
            }
            #n = (c, l)=>{
                const u = GS(c) ? c.address : c.toString(), d = dst(l);
                return t.derive.tx.signingInfo(u, d.nonce, d.era).pipe(MB(), Bc(async (f)=>{
                    const p = sL(t, this.registry, d, f);
                    let h = -1, b = null;
                    if (GS(c)) this.sign(c, p);
                    else {
                        const y = await this.#o(u, p, f.header);
                        h = y.id, y.signedTransaction && (b = y.signedTransaction);
                    }
                    return {
                        options: p,
                        signedTransaction: b,
                        updateId: h
                    };
                }));
            };
            #r = (c, l)=>{
                if (!l.isFinalized && !l.isInBlock) return xe(this.#t(new h4({
                    status: l,
                    txHash: c
                })));
                const u = l.isInBlock ? l.asInBlock : l.asFinalized;
                return t.derive.tx.events(u).pipe(ye(({ block: d, events: f })=>this.#t(new h4({
                        ...Iqe(c, d, f, l),
                        status: l,
                        txHash: c
                    }))), su((d)=>xe(this.#t(new h4({
                        internalError: d,
                        status: l,
                        txHash: c
                    })))));
            };
            #s = (c)=>t.rpc.author.submitExtrinsic(c?.signedTransaction || this).pipe(Ld((l)=>{
                    this.#a(l, c);
                }));
            #i = (c)=>{
                const l = this.hash;
                return t.rpc.author.submitAndWatchExtrinsic(c?.signedTransaction || this).pipe(et((u)=>this.#r(l, u)), Ld((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", [
                    $e({}, l, {
                        address: c,
                        blockNumber: u ? u.number : 0,
                        method: this.method
                    })
                ]);
                let h;
                if (Tt(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 b = this.registry.createTypeUnsafe("Extrinsic", [
                            h.signedTransaction
                        ]), y = this.registry.createTypeUnsafe("SignerPayload", [
                            $e({}, {
                                address: c,
                                assetId: b.assetId && b.assetId.isSome ? b.assetId.toHex() : null,
                                blockHash: p.blockHash,
                                blockNumber: u ? u.number : 0,
                                era: b.era.toHex(),
                                genesisHash: p.genesisHash,
                                metadataHash: b.metadataHash ? b.metadataHash.toHex() : null,
                                method: b.method.toHex(),
                                mode: b.mode ? b.mode.toHex() : null,
                                nonce: b.nonce.toHex(),
                                runtimeVersion: p.runtimeVersion,
                                signedExtensions: p.signedExtensions,
                                tip: b.tip ? b.tip.toHex() : null,
                                version: p.version
                            })
                        ]);
                        if (!b.isSigned) throw new Error(`When using the signedTransaction field, the transaction must be signed. Recieved isSigned: ${b.isSigned}`);
                        return f || this.#l(p, b), super.addSignature(c, h.signature, y.toPayload()), {
                            id: h.id,
                            signedTransaction: h.signedTransaction
                        };
                    }
                } else if (Tt(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 && Tt(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 oL(t, e, n, r, s) {
        const i = fst({
            api: e,
            apiType: t,
            blockHash: s,
            decorateMethod: n
        });
        return (o)=>new i(r || e.registry, o);
    }
    function Zee(t, e) {
        return t.findMetaCall(Ot(e));
    }
    function Jee(t, e) {
        return t.findMetaError(Ot(e));
    }
    const hst = {}, Yee = {
        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"
            ]
        }
    }, aL = {
        ...Yee,
        AccountInfo: "AccountInfoWithRefCount",
        Address: "LookupSource",
        LookupSource: "IndicesLookupSource",
        Multiplier: "Fixed64",
        RefCount: "RefCountTo259"
    }, pst = [
        {
            minmax: [
                240,
                243
            ],
            types: {
                ...aL,
                ProxyType: {
                    _enum: [
                        "Any",
                        "NonTransfer",
                        "Governance",
                        "Staking",
                        "Vesting"
                    ]
                }
            }
        },
        {
            minmax: [
                244,
                999
            ],
            types: {
                ...aL
            }
        },
        {
            minmax: [
                1e3,
                void 0
            ],
            types: {
                ...Yee
            }
        }
    ], Bo = {
        CompactAssignments: "CompactAssignmentsWith24",
        DispatchErrorModule: "DispatchErrorModuleU8",
        RawSolution: "RawSolutionWith24",
        Keys: "SessionKeys6",
        ProxyType: {
            _enum: [
                "Any",
                "NonTransfer",
                "Governance",
                "Staking",
                "IdentityJudgement",
                "CancelProxy",
                "Auction"
            ]
        },
        Weight: "WeightV1"
    }, p4 = {
        AccountInfo: "AccountInfoWithRefCount",
        Address: "LookupSource",
        CompactAssignments: "CompactAssignmentsWith16",
        DispatchErrorModule: "DispatchErrorModuleU8",
        RawSolution: "RawSolutionWith16",
        Keys: "SessionKeys5",
        LookupSource: "IndicesLookupSource",
        ValidatorPrefs: "ValidatorPrefsWithCommission"
    }, ju = {
        AccountInfo: "AccountInfoWithRefCount",
        Address: "AccountId",
        CompactAssignments: "CompactAssignmentsWith16",
        DispatchErrorModule: "DispatchErrorModuleU8",
        RawSolution: "RawSolutionWith16",
        Keys: "SessionKeys5",
        LookupSource: "AccountId",
        ValidatorPrefs: "ValidatorPrefsWithCommission"
    }, gst = [
        {
            minmax: [
                1019,
                1031
            ],
            types: {
                ...p4,
                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: {
                ...p4,
                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: {
                ...p4,
                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: {
                ...Bo,
                ...ju,
                CompactAssignments: "CompactAssignmentsTo257",
                DispatchInfo: "DispatchInfoTo244",
                Heartbeat: "HeartbeatTo244",
                Multiplier: "Fixed64",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259",
                ReferendumInfo: "ReferendumInfoTo239",
                Scheduled: "ScheduledTo254",
                StakingLedger: "StakingLedgerTo223",
                Weight: "u32"
            }
        },
        {
            minmax: [
                1050,
                1054
            ],
            types: {
                ...Bo,
                ...ju,
                CompactAssignments: "CompactAssignmentsTo257",
                DispatchInfo: "DispatchInfoTo244",
                Heartbeat: "HeartbeatTo244",
                Multiplier: "Fixed64",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259",
                ReferendumInfo: "ReferendumInfoTo239",
                Scheduled: "ScheduledTo254",
                StakingLedger: "StakingLedgerTo240",
                Weight: "u32"
            }
        },
        {
            minmax: [
                1055,
                1056
            ],
            types: {
                ...Bo,
                ...ju,
                CompactAssignments: "CompactAssignmentsTo257",
                DispatchInfo: "DispatchInfoTo244",
                Heartbeat: "HeartbeatTo244",
                Multiplier: "Fixed64",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259",
                Scheduled: "ScheduledTo254",
                StakingLedger: "StakingLedgerTo240",
                Weight: "u32"
            }
        },
        {
            minmax: [
                1057,
                1061
            ],
            types: {
                ...Bo,
                ...ju,
                CompactAssignments: "CompactAssignmentsTo257",
                DispatchInfo: "DispatchInfoTo244",
                Heartbeat: "HeartbeatTo244",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259",
                Scheduled: "ScheduledTo254"
            }
        },
        {
            minmax: [
                1062,
                2012
            ],
            types: {
                ...Bo,
                ...ju,
                CompactAssignments: "CompactAssignmentsTo257",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259"
            }
        },
        {
            minmax: [
                2013,
                2022
            ],
            types: {
                ...Bo,
                ...ju,
                CompactAssignments: "CompactAssignmentsTo257",
                RefCount: "RefCountTo259"
            }
        },
        {
            minmax: [
                2023,
                2024
            ],
            types: {
                ...Bo,
                ...ju,
                RefCount: "RefCountTo259"
            }
        },
        {
            minmax: [
                2025,
                2027
            ],
            types: {
                ...Bo,
                ...ju
            }
        },
        {
            minmax: [
                2028,
                2029
            ],
            types: {
                ...Bo,
                AccountInfo: "AccountInfoWithDualRefCount",
                CompactAssignments: "CompactAssignmentsWith16",
                RawSolution: "RawSolutionWith16"
            }
        },
        {
            minmax: [
                2030,
                9e3
            ],
            types: {
                ...Bo,
                CompactAssignments: "CompactAssignmentsWith16",
                RawSolution: "RawSolutionWith16"
            }
        },
        {
            minmax: [
                9010,
                9099
            ],
            types: {
                ...Bo,
                ...Xi("V0")
            }
        },
        {
            minmax: [
                9100,
                9105
            ],
            types: {
                ...Bo,
                ...Xi("V1")
            }
        },
        {
            minmax: [
                9106,
                void 0
            ],
            types: {
                Weight: "WeightV1"
            }
        }
    ], bst = [
        {
            minmax: [
                0,
                void 0
            ],
            types: {
                Weight: "WeightV2"
            }
        }
    ], mst = [
        {
            minmax: [
                0,
                void 0
            ],
            types: {
                Weight: "WeightV2"
            }
        }
    ], vf = {
        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"
    }, Jb = {
        AccountInfo: "AccountInfoWithRefCount",
        Address: "AccountId",
        DispatchErrorModule: "DispatchErrorModuleU8",
        Keys: "SessionKeys5",
        LookupSource: "AccountId",
        ValidatorPrefs: "ValidatorPrefsWithCommission"
    }, yst = [
        {
            minmax: [
                0,
                10
            ],
            types: {
                ...vf,
                ...Jb,
                CompactAssignments: "CompactAssignmentsTo257",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259",
                ElectionResult: "ElectionResultToSpec10"
            }
        },
        {
            minmax: [
                11,
                12
            ],
            types: {
                ...vf,
                ...Jb,
                CompactAssignments: "CompactAssignmentsTo257",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259"
            }
        },
        {
            minmax: [
                13,
                22
            ],
            types: {
                ...vf,
                ...Jb,
                CompactAssignments: "CompactAssignmentsTo257",
                RefCount: "RefCountTo259"
            }
        },
        {
            minmax: [
                23,
                24
            ],
            types: {
                ...vf,
                ...Jb,
                RefCount: "RefCountTo259"
            }
        },
        {
            minmax: [
                25,
                27
            ],
            types: {
                ...vf,
                ...Jb
            }
        },
        {
            minmax: [
                28,
                29
            ],
            types: {
                ...vf,
                AccountInfo: "AccountInfoWithDualRefCount"
            }
        },
        {
            minmax: [
                30,
                9109
            ],
            types: {
                ...vf
            }
        },
        {
            minmax: [
                9110,
                void 0
            ],
            types: {
                Weight: "WeightV1"
            }
        }
    ], Yb = {
        DispatchErrorModule: "DispatchErrorModuleU8",
        FullIdentification: "()",
        Keys: "SessionKeys7B",
        Weight: "WeightV1"
    }, wst = [
        {
            minmax: [
                0,
                200
            ],
            types: {
                ...Yb,
                AccountInfo: "AccountInfoWithDualRefCount",
                Address: "AccountId",
                LookupSource: "AccountId"
            }
        },
        {
            minmax: [
                201,
                214
            ],
            types: {
                ...Yb,
                AccountInfo: "AccountInfoWithDualRefCount"
            }
        },
        {
            minmax: [
                215,
                228
            ],
            types: {
                ...Yb,
                Keys: "SessionKeys6"
            }
        },
        {
            minmax: [
                229,
                9099
            ],
            types: {
                ...Yb,
                ...Xi("V0")
            }
        },
        {
            minmax: [
                9100,
                9105
            ],
            types: {
                ...Yb,
                ...Xi("V1")
            }
        },
        {
            minmax: [
                9106,
                void 0
            ],
            types: {
                Weight: "WeightV1"
            }
        }
    ], _st = [
        {
            minmax: [
                0,
                void 0
            ],
            types: {}
        }
    ], cL = {
        DispatchErrorModule: "DispatchErrorModuleU8",
        TAssetBalance: "u128",
        ProxyType: {
            _enum: [
                "Any",
                "NonTransfer",
                "CancelProxy",
                "Assets",
                "AssetOwner",
                "AssetManager",
                "Staking"
            ]
        },
        Weight: "WeightV1"
    }, xst = [
        {
            minmax: [
                0,
                3
            ],
            types: {
                DispatchError: "DispatchErrorPre6First",
                ...cL,
                ...Xi("V0")
            }
        },
        {
            minmax: [
                4,
                5
            ],
            types: {
                DispatchError: "DispatchErrorPre6First",
                ...cL,
                ...Xi("V1")
            }
        },
        {
            minmax: [
                500,
                9999
            ],
            types: {
                Weight: "WeightV1",
                TAssetConversion: "Option<AssetId>"
            }
        },
        {
            minmax: [
                1e4,
                void 0
            ],
            types: {
                Weight: "WeightV1"
            }
        }
    ], lL = {
        DispatchErrorModule: "DispatchErrorModuleU8",
        TAssetBalance: "u128",
        ProxyType: {
            _enum: [
                "Any",
                "NonTransfer",
                "CancelProxy",
                "Assets",
                "AssetOwner",
                "AssetManager",
                "Staking"
            ]
        },
        Weight: "WeightV1"
    }, vst = [
        {
            minmax: [
                0,
                3
            ],
            types: {
                DispatchError: "DispatchErrorPre6First",
                ...lL,
                ...Xi("V0")
            }
        },
        {
            minmax: [
                4,
                5
            ],
            types: {
                DispatchError: "DispatchErrorPre6First",
                ...lL,
                ...Xi("V1")
            }
        },
        {
            minmax: [
                500,
                1001003
            ],
            types: {
                Weight: "WeightV1",
                TAssetConversion: "Option<AssetId>"
            }
        },
        {
            minmax: [
                1002e3,
                void 0
            ],
            types: {
                Weight: "WeightV1",
                ...Xi("V4")
            }
        }
    ], qu = {
        CompactAssignments: "CompactAssignmentsWith16",
        DispatchErrorModule: "DispatchErrorModuleU8",
        RawSolution: "RawSolutionWith16",
        Keys: "SessionKeys6",
        ProxyType: {
            _enum: [
                "Any",
                "NonTransfer",
                "Staking",
                "SudoBalances",
                "IdentityJudgement",
                "CancelProxy"
            ]
        },
        Weight: "WeightV1"
    }, Qb = {
        AccountInfo: "AccountInfoWithRefCount",
        Address: "AccountId",
        CompactAssignments: "CompactAssignmentsWith16",
        DispatchErrorModule: "DispatchErrorModuleU8",
        LookupSource: "AccountId",
        Keys: "SessionKeys5",
        RawSolution: "RawSolutionWith16",
        ValidatorPrefs: "ValidatorPrefsWithCommission"
    }, Sst = [
        {
            minmax: [
                1,
                2
            ],
            types: {
                ...qu,
                ...Qb,
                CompactAssignments: "CompactAssignmentsTo257",
                DispatchInfo: "DispatchInfoTo244",
                Heartbeat: "HeartbeatTo244",
                Multiplier: "Fixed64",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259",
                Weight: "u32"
            }
        },
        {
            minmax: [
                3,
                22
            ],
            types: {
                ...qu,
                ...Qb,
                CompactAssignments: "CompactAssignmentsTo257",
                DispatchInfo: "DispatchInfoTo244",
                Heartbeat: "HeartbeatTo244",
                OpenTip: "OpenTipTo225",
                RefCount: "RefCountTo259"
            }
        },
        {
            minmax: [
                23,
                42
            ],
            types: {
                ...qu,
                ...Qb,
                CompactAssignments: "CompactAssignmentsTo257",
                DispatchInfo: "DispatchInfoTo244",
                Heartbeat: "HeartbeatTo244",
                RefCount: "RefCountTo259"
            }
        },
        {
            minmax: [
                43,
                44
            ],
            types: {
                ...qu,
                ...Qb,
                DispatchInfo: "DispatchInfoTo244",
                Heartbeat: "HeartbeatTo244",
                RefCount: "RefCountTo259"
            }
        },
        {
            minmax: [
                45,
                47
            ],
            types: {
                ...qu,
                ...Qb
            }
        },
        {
            minmax: [
                48,
                49
            ],
            types: {
                ...qu,
                AccountInfo: "AccountInfoWithDualRefCount"
            }
        },
        {
            minmax: [
                50,
                9099
            ],
            types: {
                ...qu,
                ...Xi("V0")
            }
        },
        {
            minmax: [
                9100,
                9105
            ],
            types: {
                ...qu,
                ...Xi("V1")
            }
        },
        {
            minmax: [
                9106,
                void 0
            ],
            types: {
                Weight: "WeightV1"
            }
        }
    ], uL = {
        DispatchErrorModule: "DispatchErrorModuleU8",
        TAssetBalance: "u128",
        ProxyType: {
            _enum: [
                "Any",
                "NonTransfer",
                "CancelProxy",
                "Assets",
                "AssetOwner",
                "AssetManager",
                "Staking"
            ]
        },
        Weight: "WeightV1"
    }, kst = [
        {
            minmax: [
                0,
                3
            ],
            types: {
                DispatchError: "DispatchErrorPre6First",
                ...uL,
                ...Xi("V0")
            }
        },
        {
            minmax: [
                4,
                5
            ],
            types: {
                DispatchError: "DispatchErrorPre6First",
                ...uL,
                ...Xi("V1")
            }
        },
        {
            minmax: [
                500,
                9434
            ],
            types: {
                Weight: "WeightV1",
                TAssetConversion: "Option<AssetId>"
            }
        },
        {
            minmax: [
                9435,
                void 0
            ],
            types: {
                Weight: "WeightV1"
            }
        }
    ], Tst = {
        "centrifuge-chain": pst,
        kusama: gst,
        node: bst,
        "node-template": mst,
        polkadot: yst,
        rococo: wst,
        shell: _st,
        statemine: xst,
        statemint: vst,
        westend: Sst,
        westmint: kst
    }, Est = [
        [
            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
                ]
            ]
        ]
    ], Cst = [
        [
            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
                ]
            ]
        ]
    ], Ist = [
        [
            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
                ]
            ]
        ]
    ], Ast = Object.freeze(Object.defineProperty({
        __proto__: null,
        kusama: Est,
        polkadot: Cst,
        westend: Ist
    }, Symbol.toStringTag, {
        value: "Module"
    })), Pst = {
        westend: {
            genesisHash: [
                "0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e"
            ]
        }
    };
    function Ost([t, e]) {
        const n = LHe.find((r)=>r.network === t) || Pst[t];
        if (!n) throw new Error(`Unable to find info for chain ${t}`);
        return {
            genesisHash: Dc(n.genesisHash[0]),
            network: t,
            versions: e.map(([r, s, i])=>({
                    apis: i,
                    blockNumber: new at(r),
                    specVersion: new at(s)
                }))
        };
    }
    const Mst = Object.entries(Ast).map(Ost);
    function bb(t, e, n) {
        return n(t.toString(), e.toString());
    }
    function p_(t = [], e) {
        return t.filter(({ minmax: [n, r] })=>(n == null || e >= n) && (r == null || e <= r)).reduce((n, { types: r })=>({
                ...n,
                ...r
            }), {});
    }
    function Rst({ knownTypes: t }, e, n) {
        return bb(e, n, (r, s)=>({
                ...t.typesBundle?.spec?.[s]?.signedExtensions ?? {},
                ...t.typesBundle?.chain?.[r]?.signedExtensions ?? {}
            }));
    }
    function Nst({ knownTypes: t }, e, n, r) {
        const s = Ns(r).toNumber();
        return bb(e, n, (i, o)=>({
                ...p_(Tst[o], s),
                ...p_(hst[i], s),
                ...p_(t.typesBundle?.spec?.[o]?.types, s),
                ...p_(t.typesBundle?.chain?.[i]?.types, s),
                ...t.typesSpec?.[o] ?? {},
                ...t.typesChain?.[i] ?? {},
                ...t.types ?? {}
            }));
    }
    function Vst({ knownTypes: t }, e, n) {
        return bb(e, n, (r, s)=>t.hasher || t.typesBundle?.chain?.[r]?.hasher || t.typesBundle?.spec?.[s]?.hasher || null);
    }
    function dL({ knownTypes: t }, e, n) {
        return bb(e, n, (r, s)=>({
                ...t.typesBundle?.spec?.[s]?.rpc ?? {},
                ...t.typesBundle?.chain?.[r]?.rpc ?? {}
            }));
    }
    function Bst({ knownTypes: t }, e, n) {
        return bb(e, n, (r, s)=>({
                ...t.typesBundle?.spec?.[s]?.runtime ?? {},
                ...t.typesBundle?.chain?.[r]?.runtime ?? {}
            }));
    }
    function Dst({ knownTypes: t }, e, n) {
        return bb(e, n, (r, s)=>({
                ...t.typesBundle?.spec?.[s]?.alias ?? {},
                ...t.typesBundle?.chain?.[r]?.alias ?? {},
                ...t.typesAlias ?? {}
            }));
    }
    function Fst(t, e) {
        const n = Mst.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 Lst = ha("api/augment");
    function fL(t, e, n = []) {
        return e.length ? ` ${e.length} ${t}${n.length ? " and" : ""}` : "";
    }
    function hL(t, e) {
        return e.length ? `
	${t.padStart(7)}: ${e.sort().join(", ")}` : "";
    }
    function pL(t, e, [n, r]) {
        (n.length || r.length) && Lst.warn(`api.${t}: Found${fL("added", n, r)}${fL("removed", r)} ${e}:${hL("added", n)}${hL("removed", r)}`);
    }
    function gL(t, e) {
        return t.filter((n)=>!e.includes(n));
    }
    function zst(t, e) {
        return t.filter((n)=>e.includes(n));
    }
    function Ust(t, e) {
        const n = Object.keys(t), r = Object.keys(e);
        return [
            gL(n, r),
            gL(r, n)
        ];
    }
    function bL(t, e) {
        const n = Object.keys(t), r = zst(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 Hst(t, e) {
        return [
            bL(e, t),
            bL(t, e)
        ];
    }
    function ac(t, e, n, r = !1) {
        r && uUe(n), t && Object.keys(n).length && (pL(t, "modules", Ust(e, n)), pL(t, "calls", Hst(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] = {}), fh(n[a], Object.keys(c), (l)=>c[l]);
        }
        return n;
    }
    function mL({ lookup: t }, { method: e, section: n }, r) {
        return `${n}.${e}(${r.map((s)=>t.getTypeDef(s).type).join(", ")})`;
    }
    function g_(t, e, n) {
        const r = n.filter((s)=>!kr(s));
        if (e.meta.type.isPlain) {
            if (r.length !== 0) throw new Error(`${mL(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(`${mL(t, e, o)} is a map, requiring ${o.length} arguments, ${r.length} found`);
        }
        return [
            e,
            r
        ];
    }
    class jst {
        #e = new vQ;
        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 b_ = 1e3, g4 = 250, qst = 50, b4 = ha("api/init");
    let Kst = 0;
    function m4(t, { method: e, section: n }) {
        return rd(t.rx.query[n] && t.rx.query[n][e], ()=>`query.${n}.${e} is not available in this version of the metadata`);
    }
    class Wst extends jst {
        #e;
        #t = {};
        #n;
        #r = [];
        #s = [];
        __phantom = new at(0);
        _type;
        _call = {};
        _consts = {};
        _derive;
        _errors = {};
        _events = {};
        _extrinsics;
        _extrinsicType = WP.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 = `${++Kst}`, this.#n = e.source?.registry || e.registry || new Iee, this._rx.callAt = (i, o)=>_c(this.at(i, o)).pipe(ye((a)=>a.rx.call)), this._rx.queryAt = (i, o)=>_c(this.at(i, o)).pipe(ye((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 y5;
            this._rpcCore = new bYe(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 Ly(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: oL(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 = sYe(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 ac("consts", e.decoratedMeta.consts, r.consts, n), ac("errors", e.decoratedMeta.errors, r.errors, n), ac("events", e.decoratedMeta.events, r.events, n), ac("query", a, r.query, n), ac("query", c, r.rx.query, n), ac("call", i, r.call, n), ac("call", o, r.rx.call, n), r.findCall = (l)=>Zee(e.registry, l), r.findError = (l)=>Jee(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) : (ac("tx", i, this._extrinsics, !1), ac(null, o, this._rx.tx, !1)), ac(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 = hUe(s[i]), c = `${a}Api`;
                this._runtimeMap[vm(a, 64)] = a, this._runtimeMap[vm(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 && b4.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)=>_c(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] = {}), si(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 ? $e(d.methods, u.methods) : e[o].push(u);
                }
                else e[o] = a;
            }
        }
        _getRuntimeDefs(e, n, r = "") {
            const s = {}, i = Object.values(Gx);
            for(let o = 0, a = i.length; o < a; o++)this._addRuntimeDef(s, i[o].runtime);
            return this._addRuntimeDef(s, Bst(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 v = 0, w = d.length; v < w; v++){
                const [E, I] = d[v], D = I[0], U = vm(E, 64), K = $n(E), $ = Object.entries(D.methods);
                c[K] || (c[K] = {});
                for(let ne = 0, te = $.length; ne < te; ne++){
                    const [J, C] = $[ne], g = $n(J);
                    c[K][g] = $e({
                        method: g,
                        name: `${E}_${J}`,
                        section: K,
                        sectionHash: U
                    }, C);
                }
            }
            else {
                for(let w = 0, E = d.length; w < E; w++){
                    const [I, D] = d[w], U = vm(I, 64), K = n.find(([$])=>$.eq(U));
                    if (l[U] = !0, K) {
                        const $ = D.map(({ version: te })=>te).sort(), ne = D.find(({ version: te })=>K[1].eq(te));
                        if (ne) {
                            const te = $n(I), J = Object.entries(ne.methods);
                            if (J.length) {
                                c[te] || (c[te] = {});
                                for(let C = 0, g = J.length; C < g; C++){
                                    const [x, A] = J[C], R = $n(x);
                                    c[te][R] = $e({
                                        method: R,
                                        name: `${I}_${x}`,
                                        section: te,
                                        sectionHash: U
                                    }, A);
                                }
                            }
                        } else f.push(`${I}/${K[1].toString()} (${$.join("/")} known)`);
                    }
                }
                const v = n.map(([w, E])=>[
                        w.toHex(),
                        E.toString()
                    ]).filter(([w])=>!l[w]).map(([w, E])=>`${this._runtimeMap[w] || w}/${E}`);
                !this._options.noInitWarn && !h && (f.length && b4.warn(`${p}: Not decorating runtime apis without matching versions: ${f.join(", ")}`), v.length && b4.warn(`${p}: Not decorating unknown runtime apis: ${v.join(", ")}`));
            }
            const b = o ? (v, w)=>this._rpcCore.state.call(v, w, o) : (v, w)=>this._rpcCore.state.call(v, w), y = (v)=>fh({}, Object.keys(c[v]), (w)=>this._decorateCall(e, c[v][w], b, i)), _ = Object.keys(c);
            for(let v = 0, w = _.length; v < w; v++)si(a, _[v], y);
            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", Ao(o.map((c, l)=>e.createTypeUnsafe(n.params[l].type, [
                        c
                    ]).toU8a())));
                return r(n.name, a).pipe(ye((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
                    ])) : xe([]));
        }
        _decorateMultiAt(e, n, r) {
            return n((s)=>s.length ? this._rpcCore.state.queryStorageAt(s.map((i)=>{
                    if (Array.isArray(i)) {
                        const { creator: o } = m4(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 [
                        m4(e, i.creator).creator
                    ];
                }), r) : xe([]));
        }
        _decorateExtrinsics({ tx: e }, n) {
            const r = oL(this._type, this._rx, n), s = (o)=>fh({}, 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++)si(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)=>fh({}, 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++)si(i, a[c], o);
            return i;
        }
        _decorateStorageEntry(e, n) {
            const r = (o, a)=>g_(a || this.#n, e, o), s = (o)=>_c(this.at(o)).pipe(ye((a)=>m4(a, e))), i = this._decorateStorageCall(e, n);
            return i.creator = e, i.at = n((o, ...a)=>s(o).pipe(et((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(Lx(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(et((c)=>this._rpcCore.state.getStorageSize(r(a, c.creator.meta.registry), o)))), e.iterKey && e.meta.type.isMap && (i.entries = n(Pe(this.#e, (...o)=>this._retrieveMapEntries(e, null, o))), i.entriesAt = n(Pe(this.#e, (o, ...a)=>s(o).pipe(et((c)=>this._retrieveMapEntries(c.creator, o, a))))), i.entriesPaged = n(Pe(this.#e, (o)=>this._retrieveMapEntriesPaged(e, void 0, o))), i.keys = n(Pe(this.#e, (...o)=>this._retrieveMapKeys(e, null, o))), i.keysAt = n(Pe(this.#e, (o, ...a)=>s(o).pipe(et((c)=>this._retrieveMapKeys(c.creator, o, a))))), i.keysPaged = n(Pe(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)=>g_(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(Lx(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(Pe(this.#e, (...a)=>this._retrieveMapEntries(n, s, a))), o.entriesPaged = r(Pe(this.#e, (a)=>this._retrieveMapEntriesPaged(n, s, a))), o.keys = r(Pe(this.#e, (...a)=>this._retrieveMapKeys(n, s, a))), o.keysPaged = r(Pe(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 === qst ? (s++, o = _c(new Promise((a)=>{
                jh(()=>{
                    const c = n[s][1];
                    delete n[s], a(c);
                });
            })).pipe(et((a)=>r(a))), n.push([
                o,
                [
                    e
                ]
            ])) : (o = n[s][0], i = n[s][1].length, n[s][1].push(e)), o.pipe(ye((a)=>a[i]));
        }
        _decorateStorageCall(e, n) {
            const r = Pe(this.#e, (...s)=>{
                const i = g_(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(g_(this.#n, e, s), this.#r)
            });
        }
        _retrieveMulti(e, n) {
            if (!e.length) return xe([]);
            const r = this.hasSubscriptions && !n ? this._rpcCore.state.subscribeStorage : this._rpcCore.state.queryStorageAt;
            return e.length <= g4 ? n ? r(e, n) : r(e) : Xe(bT(e, g4).map((s)=>n ? r(s, n) : r(s))).pipe(ye(f0));
        }
        _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 Ly(a), l = i ? (d)=>this._rpcCore.state.getKeysPaged(a, b_, d, i) : (d)=>this._rpcCore.state.getKeysPaged(a, b_, d), u = (d)=>d.setMeta(n, s, r);
            return c.pipe(et(l), ye((d)=>d.map(u)), Ld((d)=>jh(()=>{
                    d.length === b_ ? c.next(d[b_ - 1].toHex()) : c.complete();
                })), u5(), ye(f0));
        }
        _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(ye((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(et((i)=>i.length ? Xe(bT(i, g4).map(s)).pipe(ye((o)=>f0(o).map((a, c)=>[
                            i[c],
                            a
                        ]))) : xe([])));
        }
        _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(et((i)=>i.length ? s(i).pipe(ye((o)=>o.map((a, c)=>[
                            i[c],
                            a
                        ]))) : xe([])));
        }
        _decorateDeriveRx(e) {
            const n = this._runtimeVersion?.specName.toString(), r = ist(this.#e, this._rx, $e({}, this._options.derives, this._options.typesBundle?.spec?.[n || ""]?.derives));
            return rL(e, r);
        }
        _decorateDerive(e) {
            return rL(e, this._rx.derive);
        }
        _rxDecorateMethod = (e)=>e;
    }
    const $st = 1e4, yL = [
        16,
        15,
        14
    ], ul = ha("api/init");
    function Xst(t) {
        return t.toString();
    }
    class Gst extends Wst {
        #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)=>Mn(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 || ul.warn("Api will be available in a limited mode since the provider does not support subscriptions"), this._rpcCore.provider.isConnected && this.#i().catch(ql);
        }
        _initRegistry(e, n, r, s, i) {
            e.clearCache(), e.setChainProperties(i || this.registry.getChainProperties()), e.setKnownTypes(this._options), e.register(Nst(e, n, r.specName, r.specVersion)), e.setHasher(Vst(e, n, r.specName)), e.knownTypes.typesBundle && (e.knownTypes.typesAlias = Dst(e, n, r.specName)), e.setMetadata(s, void 0, $e({}, Rst(e, n, r.specName), this._options.signedExtensions), this._options.noInitWarn);
        }
        _getDefaultRegistry() {
            return rd(this.#n.find(({ isDefault: e })=>e), "Initialization error, cannot find the default registry");
        }
        async at(e, n) {
            const r = Ot(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 Iee(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 kr(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: es,
                parentHash: this._genesisHash
            } : await Mn(this._rpcCore.chain.getHeader.raw(e)));
            if (n.parentHash.isEmpty) throw ul.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");
            Fst(this._genesisHash, n.number);
            const r = this.registry.createType("RuntimeVersionPartial", await Mn(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 && fY(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, dL(this.registry, e.runtimeChain, e.runtimeVersion.specName)), [
                e.genesisHash,
                e.runtimeMetadata
            ];
        }
        _subscribeUpdates() {
            this.#r || !this.hasSubscriptions || (this.#r = this._rpcCore.state.subscribeRuntimeVersion().pipe(et((e)=>this._runtimeVersion?.specVersion.eq(e.specVersion) ? xe(!1) : this._rpcCore.state.getMetadata().pipe(ye((n)=>{
                    ul.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([
                Mn(this._rpcCore.chain.getBlockHash(0)),
                Mn(this._rpcCore.state.getRuntimeVersion()),
                Mn(this._rpcCore.system.chain()),
                Mn(this._rpcCore.system.properties()),
                Mn(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 e0(this.registry, e[a]) : await this._retrieveMetadata(r.apis);
            return this._initRegistry(this.registry, s, r, c, i), this._filterRpc(o.methods.map(Xst), dL(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) || KP, 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(vm("Metadata", 64))), o = r || this.registry;
            if (!i || i[1].toNumber() < 2) return ul.warn("MetadataApi not available, rpc::state::get_metadata will be used."), n ? new e0(o, await Mn(this._rpcCore.state.getMetadata.raw(n))) : await Mn(this._rpcCore.state.getMetadata());
            try {
                const a = n ? await Mn(this._rpcCore.state.call.raw("Metadata_metadata_versions", "0x", n)) : await Mn(this._rpcCore.state.call("Metadata_metadata_versions", "0x"));
                s = o.createType("Vec<u32>", a).filter((l)=>yL.includes(l.toNumber())).reduce((l, u)=>u.gt(l) ? u : l);
            } catch (a) {
                ul.debug(a.message), ul.warn("error with state_call::Metadata_metadata_versions, rpc::state::get_metadata will be used");
            }
            if (s && !yL.includes(s.toNumber()) && (s = null), s) try {
                const a = n ? await Mn(this._rpcCore.state.call.raw("Metadata_metadata_at_version", nn(s.toU8a()), n)) : await Mn(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 e0(o, l.toHex());
            } catch (a) {
                ul.debug(a.message), ul.warn("error with state_call::Metadata_metadata_at_version, rpc::state::get_metadata will be used");
            }
            return n ? new e0(o, await Mn(this._rpcCore.state.getMetadata.raw(n))) : await Mn(this._rpcCore.state.getMetadata());
        }
        _subscribeHealth() {
            this._unsubscribeHealth(), this.#t = this.hasSubscriptions ? setInterval(()=>{
                Mn(this._rpcCore.system.health.raw()).catch(ql);
            }, $st) : 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 UUe(), 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}`);
                ul.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 Zst extends Gst {
        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 `${WB.name} v${WB.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 Zee(this.registry, e);
        }
        findError(e) {
            return Jee(this.registry, e);
        }
    }
    class Jst extends Zst {
        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 (rr(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($e({
                    type: "bytes"
                }, n, {
                    address: e
                }))).signature;
            }
            return nn(e.sign(Ot(n.data)));
        }
    }
    class Yst {
        #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 || !Tt(this.#t) || !this._allHasFired())) try {
                Promise.resolve(this.#t(this.#i)).catch(ql);
            } catch  {}
        }
        unsubscribe() {
            this.#s && (this.#s = !1, Promise.all(this.#o.map(async (e)=>{
                try {
                    const n = await e;
                    Tt(n) && n();
                } catch  {}
            })).catch(()=>{}));
        }
    }
    function cO(t, e) {
        let n = !1;
        return {
            reject: (r)=>(n || (n = !0, e(r)), rw),
            resolve: (r)=>{
                n || (n = !0, t(r));
            }
        };
    }
    function Qst(t, e) {
        const n = t.slice(), r = t.length && Tt(t[t.length - 1]) ? n.pop() : void 0;
        if (e && !Tt(r)) throw new Error("Expected a callback to be passed with subscriptions");
        return [
            n,
            r
        ];
    }
    function eit(t, e) {
        return new Promise((n, r)=>{
            const s = cO(n, r), i = t(...e).pipe(su((o)=>s.reject(o))).subscribe((o)=>{
                s.resolve(o), jh(()=>i.unsubscribe());
            });
        });
    }
    function tit(t, e, n) {
        return new Promise((r, s)=>{
            const i = cO(r, s), o = t(...e).pipe(su((a)=>i.reject(a)), Ld(()=>i.resolve(()=>o.unsubscribe()))).subscribe((a)=>{
                jh(()=>n(a));
            });
        });
    }
    function nit(t, e) {
        const n = !!(e?.methodName && e.methodName.includes("subscribe"));
        return function(...r) {
            const [s, i] = Qst(r, n);
            return i ? tit(t, s, i) : eit(e?.overrideNoSub || t, s);
        };
    }
    class ov extends Jst {
        #e;
        #t;
        constructor(e){
            super(e, "promise", nit), this.#e = new Promise((n)=>{
                super.once("ready", ()=>n(this));
            }), this.#t = new Promise((n, r)=>{
                const s = cO(n, r);
                super.once("ready", ()=>s.resolve(this)), super.once("error", (i)=>s.reject(i));
            });
        }
        static create(e) {
            const n = new ov(e);
            return e && e.throwOnConnect ? n.isReadyOrError : (n.isReadyOrError.catch(ql), n.isReady);
        }
        get isReady() {
            return this.#e;
        }
        get isReadyOrError() {
            return this.#t;
        }
        clone() {
            return new ov($e({}, this._options, {
                source: this
            }));
        }
        async combineLatest(e, n) {
            const r = new Yst(e, n);
            return ()=>{
                r.unsubscribe();
            };
        }
    }
    const Qee = $v(), rit = bd.pipe(PA(Qee));
    CA(rit);
    const ete = (t)=>Qee(Buffer.from(t, "hex")), sit = $v(), iit = gn.pipe(PA(sit));
    CA(iit);
    const tte = $v(), oit = (t)=>tte(t), ait = (t)=>{
        const e = t.serialize();
        return tte(e);
    }, ja = $v(), cit = (t, e)=>{
        if (e - t < 1) throw new TypeError("Invalid protocol version range.");
        return [
            t,
            e
        ];
    }, lit = (t, e)=>{
        const [n, r] = e;
        return t >= n && t < r;
    }, uit = Ul.pipe(PA(ja));
    CA(uit);
    const Kh = ja(0n), dit = ja(BigInt(Number.MAX_SAFE_INTEGER)), wL = {
        isCompleteWithin (t, e = 50n) {
            const n = BigInt(Math.abs(Number(t.highestRelevantWalletIndex - t.appliedIndex)));
            return t.isConnected && n <= e;
        }
    }, sd = (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 wL.isCompleteWithin(this, 0n);
            },
            isCompleteWithin (a) {
                return wL.isCompleteWithin(this, a);
            }
        };
    }, fit = {
        reconnectionTimeout: dK,
        reconnectionDelay: hu(1)
    }, hit = (t)=>({
            ...fit,
            ...t
        });
    class av {
        static make(e) {
            const n = hit(e);
            return cp(yl(async ()=>{
                const r = await ov.create({
                    provider: new y5(n.nodeURL.toString()),
                    throwOnConnect: !1,
                    noInitWarn: !0
                });
                return await r.disconnect(), r;
            }), (r)=>yl(()=>r.disconnect())).pipe(ht((r)=>new av(n, r)));
        }
        static layer(e) {
            return ZX(iP, av.make(e));
        }
        config;
        api;
        constructor(e, n){
            this.config = e, this.api = n;
        }
        ensureConnection() {
            return V(yl(async ()=>{
                if (!this.api.isConnected) try {
                    await this.api.connect();
                } catch (e) {
                    if (!(e instanceof Error && e.message === "WebSocket is already connected")) throw e;
                }
            }), xx(Dn(()=>this.api.isConnected)), Gk({
                until: (e)=>e,
                schedule: J1(this.config.reconnectionDelay)
            }), pAe(this.config.reconnectionTimeout), ub, Vd((e)=>new zB({
                    message: "Could not connect within specified time range (5s)",
                    cause: e
                })));
        }
        sendMidnightTransaction(e) {
            const n = tJ((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 nze({
                        message: "Transaction submission failed",
                        txData: e,
                        cause: o
                    })).then(()=>()=>{}));
                return yl(s);
            });
            return V(nu(this.ensureConnection()), Vc(()=>n), nJ(yl(()=>this.api.disconnect())));
        }
        getGenesis() {
            return V(this.ensureConnection(), xx(()=>yl(()=>this.api.rpc.chain.getBlock(this.api.genesisHash))), ht(({ block: e })=>({
                    transactions: e.extrinsics.filter(({ method: n })=>n.section === "midnight" && n.method === "sendMnTransaction").map(({ method: n })=>n.args[0].toU8a()).map(oit)
                })), Vd((e)=>new zB({
                    message: "Failed to retrieve genesis transactions",
                    cause: e
                })), Hf(yl(()=>this.api.disconnect())));
        }
        #e = (e, n, r)=>{
            const s = tn({
                blockNumber: ANe(at)
            }), i = (a)=>n.fail(new rze({
                    message: "Failed to parse result provided by node",
                    cause: a
                })), o = Wc(s, {
                errors: "all",
                onExcessProperty: "ignore"
            });
            return async (a)=>{
                const c = a.status;
                c.isReady || c.isFuture || c.isBroadcast || c.isRetracted ? await n.single(YLe({
                    tx: e,
                    txHash: a.txHash.toString()
                })) : c.isInBlock ? await V(o(a), cr({
                    onLeft: i,
                    onRight: (l)=>n.single(QLe({
                            tx: e,
                            blockHash: c.asInBlock.toString(),
                            blockHeight: BigInt(l.blockNumber.toString(10)),
                            txHash: a.txHash.toString()
                        }))
                })) : c.isFinalized ? (await V(o(a), cr({
                    onLeft: i,
                    onRight: (l)=>n.single(eze({
                            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 oY({
                    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 sze({
                    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 ize({
                    message: "Transaction got dropped, the mempool likely is full and network congested",
                    txData: e
                })), await r()) : c.isInvalid && (await n.fail(new oze({
                    message: "Transaction is invalid and was rejected by the node",
                    txData: e
                })), await r());
            };
        };
    }
    let pit = class extends wn("SubmissionError") {
    };
    const git = (t)=>{
        const e = ri().pipe(Ki), n = Gn(function*() {
            const s = yield* hg(), i = yield* av.make({
                nodeURL: t.relayURL
            }).pipe(Dd(La, s));
            return {
                scope: s,
                client: i
            };
        });
        return V(e, HSe(n), En), {
            submitTransaction: (s, i = "InBlock")=>V(cze(ait(s), i), HX(iP, V(e, Ar, ht(({ client: o })=>o))), Vd((o)=>new pit({
                        message: "Transaction submission error",
                        cause: o
                    }))),
            close () {
                return V(e, Ar, Ge(({ scope: s })=>Nd(s, x3)), aAe);
            }
        };
    }, bit = (t)=>{
        const e = git(t);
        return {
            submitTransaction: (r, s = "InBlock")=>e.submitTransaction(r, s).pipe(En),
            close: ()=>e.close().pipe(En)
        };
    }, mit = {
        areAllTxIdsIncluded (t, e) {
            const n = lm(t.identifiers()), r = lm(e);
            return _5e(n, r);
        },
        deserialize (t) {
            return xn.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() ?? [], Rs((c)=>c.ttl), Hv(NRe)), i = V(t.intents?.values().toArray() ?? [], Dg((c)=>c.dustActions?.spends ?? []), Om), o = t.guaranteedOffer != null || (t.fallibleOffer?.size ?? 0) == 0, a = i || o ? V(e, DRe(hu(Number(r))), Ho) : Jl();
            return V(s, Uv(a), (c)=>Rr(c) ? Fe(Sxe(c, Th(B2e, BRe))) : Ve(), un({
                onNone: ()=>!1,
                onSome: (c)=>VRe(c, n) > 0
            }));
        },
        ids (t) {
            return t.identifiers();
        },
        isOneIncludedInOther (t, e) {
            const n = lm(t.identifiers()), r = lm(e.identifiers()), s = lq(Lv)(i0(n), i0(r)), i = x5e(n, r);
            return i0(i) == s;
        },
        isTx (t) {
            return t instanceof xn;
        },
        serialize (t) {
            return t.serialize();
        }
    }, y4 = 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")
                }));
    }, _L = {
        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 xL {
        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 yit = 3600 * 1e3;
    class ld {
        static makeDefaultSubmissionService(e) {
            return bit(e);
        }
        static makeDefaultPendingTransactionsService(e) {
            return Dm.init({
                configuration: e,
                txTrait: mit
            });
        }
        static makeDefaultProvingService(e) {
            if (e.provingServerUrl) return GLe({
                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 IBe(zBe, {}, {
                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) : ld.makeDefaultSubmissionService(e.configuration)), r = await Promise.resolve(e.pendingTransactionsService ? e.pendingTransactionsService(e.configuration) : ld.makeDefaultPendingTransactionsService(e.configuration)), s = await Promise.resolve(e.provingService ? e.provingService(e.configuration) : ld.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 ld(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(OB((a)=>LVe(a)), OB((a)=>this.revert(a.tx))).subscribe();
        }
        defaultTtl() {
            return new Date(Date.now() + yit);
        }
        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 Xe([
                this.shielded.state,
                this.unshielded.state,
                this.dust.state,
                this.pendingTransactionsService.state()
            ]).pipe(ye(([e, n, r, s])=>new xL(e, n, r, s)));
        }
        async waitForSyncedState() {
            const [e, n, r, s] = await Promise.all([
                this.shielded.waitForSyncedState(),
                this.unshielded.waitForSyncedState(),
                this.dust.waitForSyncedState(),
                Mn(this.pendingTransactionsService.state())
            ]);
            return new xL(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 } = y4.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, b = this.mergeUnprovenTransactions(p, h);
            if (!b) throw new Error("No balancing transaction was created. Please check your transaction.");
            return {
                type: "FINALIZED_TRANSACTION",
                originalTransaction: e,
                balancingTransaction: b
            };
        }
        async balanceUnboundTransaction(e, n, r) {
            const { shieldedSecretKeys: s, dustSecretKey: i } = n, { ttl: o, tokenKindsToBalance: a = "all" } = r, { shouldBalanceDust: c, shouldBalanceShielded: l, shouldBalanceUnshielded: u } = y4.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, b = this.mergeUnprovenTransactions(d, h);
            if (!b && !f) throw new Error("No balancing transaction was created. Please check your transaction.");
            return {
                type: "UNBOUND_TRANSACTION",
                baseTransaction: p,
                balancingTransaction: b ?? 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 } = y4.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), b = c ? await this.dust.balanceTransactions(i, [
                h
            ], o) : void 0;
            return {
                type: "UNPROVEN_TRANSACTION",
                transaction: this.mergeUnprovenTransactions(h, b)
            };
        }
        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((b)=>b.type === "unshielded").flatMap((b)=>b.outputs), l = e.filter((b)=>b.type === "shielded").flatMap((b)=>b.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, Rs(({ 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 = uae(), o = Pj(i), c = (await this.registerNightUtxosForDustGeneration(e, o, (u)=>Oj(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((E)=>E.type === "shielded").flatMap((E)=>E.outputs), f = n.filter((E)=>E.type === "unshielded").flatMap((E)=>E.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 b = p && l !== void 0 ? await this.shielded.initSwap(i, l, d) : void 0, y = h && u !== void 0 ? await this.unshielded.initSwap(u, f, a) : void 0, _ = this.mergeUnprovenTransactions(b, y);
            if (!_) throw Error("Unexpected transaction state.");
            const v = c ? await this.dust.balanceTransactions(o, [
                _
            ], a) : void 0;
            return {
                type: "UNPROVEN_TRANSACTION",
                transaction: this.mergeUnprovenTransactions(_, v)
            };
        }
        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 = _L.isRecipe(e) ? _L.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())
            ]);
        }
    }
    function qm(t) {
        if (!Number.isSafeInteger(t) || t < 0) throw new Error(`positive integer expected, not ${t}`);
    }
    function wit(t) {
        return t instanceof Uint8Array || t != null && typeof t == "object" && t.constructor.name === "Uint8Array";
    }
    function D5(t, ...e) {
        if (!wit(t)) throw new Error("Uint8Array expected");
        if (e.length > 0 && !e.includes(t.length)) throw new Error(`Uint8Array expected of length ${e}, not of length=${t.length}`);
    }
    function nte(t) {
        if (typeof t != "function" || typeof t.create != "function") throw new Error("Hash should be wrapped by utils.wrapConstructor");
        qm(t.outputLen), qm(t.blockLen);
    }
    function cv(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 _it(t, e) {
        D5(t);
        const n = e.outputLen;
        if (t.length < n) throw new Error(`digestInto() expects output buffer of length at least ${n}`);
    }
    const d2 = (t)=>new DataView(t.buffer, t.byteOffset, t.byteLength), cc = (t, e)=>t << 32 - e | t >>> e;
    new Uint8Array(new Uint32Array([
        287454020
    ]).buffer)[0];
    function xit(t) {
        if (typeof t != "string") throw new Error(`utf8ToBytes expected string, got ${typeof t}`);
        return new Uint8Array(new TextEncoder().encode(t));
    }
    function Gy(t) {
        return typeof t == "string" && (t = xit(t)), D5(t), t;
    }
    class rte {
        clone() {
            return this._cloneInto();
        }
    }
    const vit = {}.toString;
    function Sit(t, e) {
        if (e !== void 0 && vit.call(e) !== "[object Object]") throw new Error("Options should be object or undefined");
        return Object.assign(t, e);
    }
    function ste(t) {
        const e = (r)=>t().update(Gy(r)).digest(), n = t();
        return e.outputLen = n.outputLen, e.blockLen = n.blockLen, e.create = ()=>t(), e;
    }
    class ite extends rte {
        constructor(e, n){
            super(), this.finished = !1, this.destroyed = !1, nte(e);
            const r = Gy(n);
            if (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 s = this.blockLen, i = new Uint8Array(s);
            i.set(r.length > s ? e.create().update(r).digest() : r);
            for(let o = 0; o < i.length; o++)i[o] ^= 54;
            this.iHash.update(i), this.oHash = e.create();
            for(let o = 0; o < i.length; o++)i[o] ^= 106;
            this.oHash.update(i), i.fill(0);
        }
        update(e) {
            return cv(this), this.iHash.update(e), this;
        }
        digestInto(e) {
            cv(this), D5(e, this.outputLen), 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 || (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;
        }
        destroy() {
            this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy();
        }
    }
    const ote = (t, e, n)=>new ite(t, e).update(n).digest();
    ote.create = (t, e)=>new ite(t, e);
    function kit(t, e, n, r) {
        nte(t);
        const s = Sit({
            dkLen: 32,
            asyncTick: 10
        }, r), { c: i, dkLen: o, asyncTick: a } = s;
        if (qm(i), qm(o), qm(a), i < 1) throw new Error("PBKDF2: iterations (c) should be >= 1");
        const c = Gy(e), l = Gy(n), u = new Uint8Array(o), d = ote.create(t, c), f = d._cloneInto().update(l);
        return {
            c: i,
            dkLen: o,
            asyncTick: a,
            DK: u,
            PRF: d,
            PRFSalt: f
        };
    }
    function Tit(t, e, n, r, s) {
        return t.destroy(), e.destroy(), r && r.destroy(), s.fill(0), n;
    }
    function Eit(t, e, n, r) {
        const { c: s, dkLen: i, DK: o, PRF: a, PRFSalt: c } = kit(t, e, n, r);
        let l;
        const u = new Uint8Array(4), d = d2(u), f = new Uint8Array(a.outputLen);
        for(let p = 1, h = 0; h < i; p++, h += a.outputLen){
            const b = o.subarray(h, h + a.outputLen);
            d.setInt32(0, p, !1), (l = c._cloneInto(l)).update(u).digestInto(f), b.set(f.subarray(0, b.length));
            for(let y = 1; y < s; y++){
                a._cloneInto(l).update(f).digestInto(f);
                for(let _ = 0; _ < b.length; _++)b[_] ^= f[_];
            }
        }
        return Tit(a, c, o, l, f);
    }
    function Cit(t, e, n, r) {
        if (typeof t.setBigUint64 == "function") return t.setBigUint64(e, n, r);
        const s = BigInt(32), i = BigInt(4294967295), o = Number(n >> s & i), a = Number(n & i), c = r ? 4 : 0, l = r ? 0 : 4;
        t.setUint32(e + c, o, r), t.setUint32(e + l, a, r);
    }
    const Iit = (t, e, n)=>t & e ^ ~t & n, Ait = (t, e, n)=>t & e ^ t & n ^ e & n;
    class ate extends rte {
        constructor(e, n, r, s){
            super(), this.blockLen = e, this.outputLen = n, this.padOffset = r, this.isLE = s, this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.buffer = new Uint8Array(e), this.view = d2(this.buffer);
        }
        update(e) {
            cv(this);
            const { view: n, buffer: r, blockLen: s } = this;
            e = Gy(e);
            const i = e.length;
            for(let o = 0; o < i;){
                const a = Math.min(s - this.pos, i - o);
                if (a === s) {
                    const c = d2(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) {
            cv(this), _it(e, this), this.finished = !0;
            const { buffer: n, view: r, blockLen: s, isLE: i } = this;
            let { pos: o } = this;
            n[o++] = 128, this.buffer.subarray(o).fill(0), this.padOffset > s - o && (this.process(r, 0), o = 0);
            for(let d = o; d < s; d++)n[d] = 0;
            Cit(r, s - 8, BigInt(this.length * 8), i), this.process(r, 0);
            const a = d2(e), c = this.outputLen;
            if (c % 4) throw new Error("_sha2: outputLen should 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 || (e = new this.constructor), e.set(...this.get());
            const { blockLen: n, buffer: r, length: s, finished: i, destroyed: o, pos: a } = this;
            return e.length = s, e.pos = a, e.finished = i, e.destroyed = o, s % n && e.buffer.set(r), e;
        }
    }
    const Pit = new Uint32Array([
        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
    ]), Ku = new Uint32Array([
        1779033703,
        3144134277,
        1013904242,
        2773480762,
        1359893119,
        2600822924,
        528734635,
        1541459225
    ]), Wu = new Uint32Array(64);
    class Oit extends ate {
        constructor(){
            super(64, 32, 8, !1), this.A = Ku[0] | 0, this.B = Ku[1] | 0, this.C = Ku[2] | 0, this.D = Ku[3] | 0, this.E = Ku[4] | 0, this.F = Ku[5] | 0, this.G = Ku[6] | 0, this.H = Ku[7] | 0;
        }
        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)Wu[d] = e.getUint32(n, !1);
            for(let d = 16; d < 64; d++){
                const f = Wu[d - 15], p = Wu[d - 2], h = cc(f, 7) ^ cc(f, 18) ^ f >>> 3, b = cc(p, 17) ^ cc(p, 19) ^ p >>> 10;
                Wu[d] = b + Wu[d - 7] + h + Wu[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 = cc(a, 6) ^ cc(a, 11) ^ cc(a, 25), p = u + f + Iit(a, c, l) + Pit[d] + Wu[d] | 0, b = (cc(r, 2) ^ cc(r, 13) ^ cc(r, 22)) + Ait(r, s, i) | 0;
                u = l, l = c, c = a, a = o + p | 0, o = i, i = s, s = r, r = p + b | 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() {
            Wu.fill(0);
        }
        destroy() {
            this.set(0, 0, 0, 0, 0, 0, 0, 0), this.buffer.fill(0);
        }
    }
    const Mit = ste(()=>new Oit), m_ = BigInt(2 ** 32 - 1), FT = BigInt(32);
    function cte(t, e = !1) {
        return e ? {
            h: Number(t & m_),
            l: Number(t >> FT & m_)
        } : {
            h: Number(t >> FT & m_) | 0,
            l: Number(t & m_) | 0
        };
    }
    function Rit(t, e = !1) {
        let n = new Uint32Array(t.length), r = new Uint32Array(t.length);
        for(let s = 0; s < t.length; s++){
            const { h: i, l: o } = cte(t[s], e);
            [n[s], r[s]] = [
                i,
                o
            ];
        }
        return [
            n,
            r
        ];
    }
    const Nit = (t, e)=>BigInt(t >>> 0) << FT | BigInt(e >>> 0), Vit = (t, e, n)=>t >>> n, Bit = (t, e, n)=>t << 32 - n | e >>> n, Dit = (t, e, n)=>t >>> n | e << 32 - n, Fit = (t, e, n)=>t << 32 - n | e >>> n, Lit = (t, e, n)=>t << 64 - n | e >>> n - 32, zit = (t, e, n)=>t >>> n - 32 | e << 64 - n, Uit = (t, e)=>e, Hit = (t, e)=>t, jit = (t, e, n)=>t << n | e >>> 32 - n, qit = (t, e, n)=>e << n | t >>> 32 - n, Kit = (t, e, n)=>e << n - 32 | t >>> 64 - n, Wit = (t, e, n)=>t << n - 32 | e >>> 64 - n;
    function $it(t, e, n, r) {
        const s = (e >>> 0) + (r >>> 0);
        return {
            h: t + n + (s / 2 ** 32 | 0) | 0,
            l: s | 0
        };
    }
    const Xit = (t, e, n)=>(t >>> 0) + (e >>> 0) + (n >>> 0), Git = (t, e, n, r)=>e + n + r + (t / 2 ** 32 | 0) | 0, Zit = (t, e, n, r)=>(t >>> 0) + (e >>> 0) + (n >>> 0) + (r >>> 0), Jit = (t, e, n, r, s)=>e + n + r + s + (t / 2 ** 32 | 0) | 0, Yit = (t, e, n, r, s)=>(t >>> 0) + (e >>> 0) + (n >>> 0) + (r >>> 0) + (s >>> 0), Qit = (t, e, n, r, s, i)=>e + n + r + s + i + (t / 2 ** 32 | 0) | 0, rn = {
        fromBig: cte,
        split: Rit,
        toBig: Nit,
        shrSH: Vit,
        shrSL: Bit,
        rotrSH: Dit,
        rotrSL: Fit,
        rotrBH: Lit,
        rotrBL: zit,
        rotr32H: Uit,
        rotr32L: Hit,
        rotlSH: jit,
        rotlSL: qit,
        rotlBH: Kit,
        rotlBL: Wit,
        add: $it,
        add3L: Xit,
        add3H: Git,
        add4L: Zit,
        add4H: Jit,
        add5H: Qit,
        add5L: Yit
    }, [eot, tot] = rn.split([
        "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))), $u = new Uint32Array(80), Xu = new Uint32Array(80);
    class not extends ate {
        constructor(){
            super(128, 64, 16, !1), this.Ah = 1779033703, this.Al = -205731576, this.Bh = -1150833019, this.Bl = -2067093701, this.Ch = 1013904242, this.Cl = -23791573, this.Dh = -1521486534, this.Dl = 1595750129, this.Eh = 1359893119, this.El = -1377402159, this.Fh = -1694144372, this.Fl = 725511199, this.Gh = 528734635, this.Gl = -79577749, this.Hh = 1541459225, this.Hl = 327033209;
        }
        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: b, Hl: y } = this;
            return [
                e,
                n,
                r,
                s,
                i,
                o,
                a,
                c,
                l,
                u,
                d,
                f,
                p,
                h,
                b,
                y
            ];
        }
        set(e, n, r, s, i, o, a, c, l, u, d, f, p, h, b, y) {
            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 = b | 0, this.Hl = y | 0;
        }
        process(e, n) {
            for(let w = 0; w < 16; w++, n += 4)$u[w] = e.getUint32(n), Xu[w] = e.getUint32(n += 4);
            for(let w = 16; w < 80; w++){
                const E = $u[w - 15] | 0, I = Xu[w - 15] | 0, D = rn.rotrSH(E, I, 1) ^ rn.rotrSH(E, I, 8) ^ rn.shrSH(E, I, 7), U = rn.rotrSL(E, I, 1) ^ rn.rotrSL(E, I, 8) ^ rn.shrSL(E, I, 7), K = $u[w - 2] | 0, $ = Xu[w - 2] | 0, ne = rn.rotrSH(K, $, 19) ^ rn.rotrBH(K, $, 61) ^ rn.shrSH(K, $, 6), te = rn.rotrSL(K, $, 19) ^ rn.rotrBL(K, $, 61) ^ rn.shrSL(K, $, 6), J = rn.add4L(U, te, Xu[w - 7], Xu[w - 16]), C = rn.add4H(J, D, ne, $u[w - 7], $u[w - 16]);
                $u[w] = C | 0, Xu[w] = J | 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: b, Gl: y, Hh: _, Hl: v } = this;
            for(let w = 0; w < 80; w++){
                const E = rn.rotrSH(d, f, 14) ^ rn.rotrSH(d, f, 18) ^ rn.rotrBH(d, f, 41), I = rn.rotrSL(d, f, 14) ^ rn.rotrSL(d, f, 18) ^ rn.rotrBL(d, f, 41), D = d & p ^ ~d & b, U = f & h ^ ~f & y, K = rn.add5L(v, I, U, tot[w], Xu[w]), $ = rn.add5H(K, _, E, D, eot[w], $u[w]), ne = K | 0, te = rn.rotrSH(r, s, 28) ^ rn.rotrBH(r, s, 34) ^ rn.rotrBH(r, s, 39), J = rn.rotrSL(r, s, 28) ^ rn.rotrBL(r, s, 34) ^ rn.rotrBL(r, s, 39), C = r & i ^ r & a ^ i & a, g = s & o ^ s & c ^ o & c;
                _ = b | 0, v = y | 0, b = p | 0, y = h | 0, p = d | 0, h = f | 0, { h: d, l: f } = rn.add(l | 0, u | 0, $ | 0, ne | 0), l = a | 0, u = c | 0, a = i | 0, c = o | 0, i = r | 0, o = s | 0;
                const x = rn.add3L(ne, J, g);
                r = rn.add3H(x, $, te, C), s = x | 0;
            }
            ({ h: r, l: s } = rn.add(this.Ah | 0, this.Al | 0, r | 0, s | 0)), { h: i, l: o } = rn.add(this.Bh | 0, this.Bl | 0, i | 0, o | 0), { h: a, l: c } = rn.add(this.Ch | 0, this.Cl | 0, a | 0, c | 0), { h: l, l: u } = rn.add(this.Dh | 0, this.Dl | 0, l | 0, u | 0), { h: d, l: f } = rn.add(this.Eh | 0, this.El | 0, d | 0, f | 0), { h: p, l: h } = rn.add(this.Fh | 0, this.Fl | 0, p | 0, h | 0), { h: b, l: y } = rn.add(this.Gh | 0, this.Gl | 0, b | 0, y | 0), { h: _, l: v } = rn.add(this.Hh | 0, this.Hl | 0, _ | 0, v | 0), this.set(r, s, i, o, a, c, l, u, d, f, p, h, b, y, _, v);
        }
        roundClean() {
            $u.fill(0), Xu.fill(0);
        }
        destroy() {
            this.buffer.fill(0), this.set(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
        }
    }
    const rot = ste(()=>new not);
    function lv(t) {
        return t instanceof Uint8Array || t != null && typeof t == "object" && t.constructor.name === "Uint8Array";
    }
    function sot(...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 iot(t) {
        return {
            encode: (e)=>{
                if (!Array.isArray(e) || e.length && typeof e[0] != "number") throw new Error("alphabet.encode input should be an array of numbers");
                return e.map((n)=>{
                    if (n < 0 || n >= t.length) throw new Error(`Digit index outside alphabet: ${n} (alphabet: ${t.length})`);
                    return t[n];
                });
            },
            decode: (e)=>{
                if (!Array.isArray(e) || e.length && typeof e[0] != "string") throw new Error("alphabet.decode input should be array of strings");
                return e.map((n)=>{
                    if (typeof n != "string") throw new Error(`alphabet.decode: not string element=${n}`);
                    const r = t.indexOf(n);
                    if (r === -1) throw new Error(`Unknown letter: "${n}". Allowed: ${t}`);
                    return r;
                });
            }
        };
    }
    function oot(t = "") {
        if (typeof t != "string") throw new Error("join separator should be string");
        return {
            encode: (e)=>{
                if (!Array.isArray(e) || e.length && typeof e[0] != "string") throw new Error("join.encode input should be array of strings");
                for (let n of e)if (typeof n != "string") throw new Error(`join.encode: non-string input=${n}`);
                return e.join(t);
            },
            decode: (e)=>{
                if (typeof e != "string") throw new Error("join.decode input should be string");
                return e.split(t);
            }
        };
    }
    function aot(t, e = "=") {
        if (typeof e != "string") throw new Error("padding chr should be string");
        return {
            encode (n) {
                if (!Array.isArray(n) || n.length && typeof n[0] != "string") throw new Error("padding.encode input should be array of strings");
                for (let r of n)if (typeof r != "string") throw new Error(`padding.encode: non-string input=${r}`);
                for(; n.length * t % 8;)n.push(e);
                return n;
            },
            decode (n) {
                if (!Array.isArray(n) || n.length && typeof n[0] != "string") throw new Error("padding.encode input should be array of strings");
                for (let s of n)if (typeof s != "string") throw new Error(`padding.decode: non-string input=${s}`);
                let r = n.length;
                if (r * t % 8) throw new Error("Invalid padding: string should have whole number of bytes");
                for(; r > 0 && n[r - 1] === e; r--)if (!((r - 1) * t % 8)) throw new Error("Invalid padding: string has too much padding");
                return n.slice(0, r);
            }
        };
    }
    function LT(t, e, n) {
        if (e < 2) throw new Error(`convertRadix: wrong from=${e}, base cannot be less than 2`);
        if (n < 2) throw new Error(`convertRadix: wrong to=${n}, base cannot be less than 2`);
        if (!Array.isArray(t)) throw new Error("convertRadix: data should be array");
        if (!t.length) return [];
        let r = 0;
        const s = [], i = Array.from(t);
        for(i.forEach((o)=>{
            if (o < 0 || o >= e) throw new Error(`Wrong integer: ${o}`);
        });;){
            let o = 0, a = !0;
            for(let c = r; c < i.length; c++){
                const l = i[c], u = e * o + l;
                if (!Number.isSafeInteger(u) || e * o / e !== o || u - l !== e * o) throw new Error("convertRadix: carry overflow");
                o = u % n;
                const d = Math.floor(u / n);
                if (i[c] = d, !Number.isSafeInteger(d) || d * n + o !== u) throw new Error("convertRadix: carry overflow");
                if (a) d ? a = !1 : r = c;
                else continue;
            }
            if (s.push(o), a) break;
        }
        for(let o = 0; o < t.length - 1 && t[o] === 0; o++)s.push(0);
        return s.reverse();
    }
    const lte = (t, e)=>e ? lte(e, t % e) : t, uv = (t, e)=>t + (e - lte(t, e));
    function zT(t, e, n, r) {
        if (!Array.isArray(t)) throw new Error("convertRadix2: data should be array");
        if (e <= 0 || e > 32) throw new Error(`convertRadix2: wrong from=${e}`);
        if (n <= 0 || n > 32) throw new Error(`convertRadix2: wrong to=${n}`);
        if (uv(e, n) > 32) throw new Error(`convertRadix2: carry overflow from=${e} to=${n} carryBits=${uv(e, n)}`);
        let s = 0, i = 0;
        const o = 2 ** n - 1, a = [];
        for (const c of t){
            if (c >= 2 ** e) throw new Error(`convertRadix2: invalid data word=${c} from=${e}`);
            if (s = s << e | c, i + e > 32) throw new Error(`convertRadix2: carry overflow pos=${i} from=${e}`);
            for(i += e; i >= n; i -= n)a.push((s >> i - n & o) >>> 0);
            s &= 2 ** i - 1;
        }
        if (s = s << n - i & o, !r && i >= e) throw new Error("Excess padding");
        if (!r && s) throw new Error(`Non-zero padding: ${s}`);
        return r && i > 0 && a.push(s >>> 0), a;
    }
    function cot(t) {
        return {
            encode: (e)=>{
                if (!lv(e)) throw new Error("radix.encode input should be Uint8Array");
                return LT(Array.from(e), 2 ** 8, t);
            },
            decode: (e)=>{
                if (!Array.isArray(e) || e.length && typeof e[0] != "number") throw new Error("radix.decode input should be array of numbers");
                return Uint8Array.from(LT(e, t, 2 ** 8));
            }
        };
    }
    function lot(t, e = !1) {
        if (t <= 0 || t > 32) throw new Error("radix2: bits should be in (0..32]");
        if (uv(8, t) > 32 || uv(t, 8) > 32) throw new Error("radix2: carry overflow");
        return {
            encode: (n)=>{
                if (!lv(n)) throw new Error("radix2.encode input should be Uint8Array");
                return zT(Array.from(n), 8, t, !e);
            },
            decode: (n)=>{
                if (!Array.isArray(n) || n.length && typeof n[0] != "number") throw new Error("radix2.decode input should be array of numbers");
                return Uint8Array.from(zT(n, t, 8, e));
            }
        };
    }
    function uot(t, e) {
        if (typeof e != "function") throw new Error("checksum fn should be function");
        return {
            encode (n) {
                if (!lv(n)) throw new Error("checksum.encode: input should be Uint8Array");
                const r = e(n).slice(0, t), s = new Uint8Array(n.length + t);
                return s.set(n), s.set(r, n.length), s;
            },
            decode (n) {
                if (!lv(n)) throw new Error("checksum.decode: input should be Uint8Array");
                const r = n.slice(0, -t), s = e(r).slice(0, t), i = n.slice(-t);
                for(let o = 0; o < t; o++)if (s[o] !== i[o]) throw new Error("Invalid checksum");
                return r;
            }
        };
    }
    const y_ = {
        alphabet: iot,
        chain: sot,
        checksum: uot,
        convertRadix: LT,
        convertRadix2: zT,
        radix: cot,
        radix2: lot,
        join: oot,
        padding: aot
    };
    function ute(t) {
        if (typeof t != "string") throw new TypeError(`Invalid mnemonic type: ${typeof t}`);
        return t.normalize("NFKD");
    }
    function dte(t) {
        const e = ute(t), n = e.split(" ");
        if (![
            12,
            15,
            18,
            21,
            24
        ].includes(n.length)) throw new Error("Invalid mnemonic");
        return {
            nfkd: e,
            words: n
        };
    }
    function dot(t) {
        D5(t, 16, 20, 24, 28, 32);
    }
    const fot = (t)=>{
        const e = 8 - t.length / 4;
        return new Uint8Array([
            Mit(t)[0] >> e << e
        ]);
    };
    function hot(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}`);
        }), y_.chain(y_.checksum(1, fot), y_.radix2(11, !0), y_.alphabet(t));
    }
    function lO(t, e) {
        const { words: n } = dte(t), r = hot(e).decode(n);
        return dot(r), r;
    }
    fte = function(t, e) {
        try {
            lO(t, e);
        } catch  {
            return !1;
        }
        return !0;
    };
    const pot = (t)=>ute(`mnemonic${t}`);
    function got(t, e = "") {
        return Eit(rot, dte(t).nfkd, pot(e), {
            c: 2048,
            dkLen: 64
        });
    }
    const bot = (t)=>$A(t.variant), mot = (t)=>t.reduce((e, n)=>({
                ...e,
                [bot(n)]: n
            }), {});
    class uO extends wn("WalletRuntimeError") {
    }
    const F5 = VI();
    F5.$is("State");
    F5.$is("ProgressUpdate");
    F5.$is("VersionChange");
    const { $match: yot, State: dO, ProgressUpdate: fO, VersionChange: hO } = F5, pO = VI();
    pO.$is("Version");
    pO.$is("Next");
    const { $match: wot, Version: gO, Next: uvt } = pO, _ot = (t)=>{
        const e = t.progress?.appliedId ?? 0n, r = (t.progress?.highestTransactionId ?? 0n) - e, s = e - e;
        return [
            fO({
                sourceGap: r,
                applyGap: s
            })
        ];
    }, xot = (t, e)=>t.protocolVersion != e.protocolVersion ? [
            hO({
                change: gO({
                    version: ja(e.protocolVersion)
                })
            })
        ] : [], io = Symbol("V1");
    let vot = class {
        __polyTag__ = io;
        #e;
        #t;
        #n;
        state;
        constructor(e, n, r){
            this.#e = e, this.#t = n, this.#n = r, this.state = nu(n.stateRef.get).pipe(Vc((s)=>n.stateRef.changes.pipe(LA(s, (i, o)=>[
                        o,
                        [
                            i,
                            o
                        ]
                    ]))), s5(([s, i])=>[
                    dO({
                        state: i
                    }),
                    ..._ot(i),
                    ...xot(s, i)
                ]));
        }
        startSyncInBackground() {
            return this.startSync().pipe(UA(FA), q1, Dd(La, this.#e));
        }
        startSync() {
            return V(uh(this.#t.stateRef), nu, Vc((e)=>this.#n.syncService.updates(e)), nf((e)=>zh(this.#t.stateRef, (n)=>V(this.#n.syncCapability.applyUpdate(n, e), Or))), HA((e)=>xA(e)), i5(V(Z1(hu(1), 2), hA((e)=>{
                const n = w1(2), r = as(Math.floor(Math.random() * 1e3)), s = Si(e) + Si(r);
                return as(Math.min(s, Si(n)));
            }))));
        }
        balanceFinalizedTransaction(e) {
            return El(this.#t.stateRef, (n)=>V(this.#n.transactingCapability.balanceFinalizedTransaction(n, e), Or));
        }
        balanceUnboundTransaction(e) {
            return El(this.#t.stateRef, (n)=>V(this.#n.transactingCapability.balanceUnboundTransaction(n, e), Or));
        }
        balanceUnprovenTransaction(e) {
            return El(this.#t.stateRef, (n)=>V(this.#n.transactingCapability.balanceUnprovenTransaction(n, e), Or));
        }
        transferTransaction(e, n) {
            return El(this.#t.stateRef, (r)=>V(this.#n.transactingCapability.makeTransfer(r, e, n), Or, ht(({ transaction: s, newState: i })=>[
                        s,
                        i
                    ])));
        }
        initSwap(e, n, r) {
            return El(this.#t.stateRef, (s)=>V(this.#n.transactingCapability.initSwap(s, e, n, r), ht(({ 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 zh(this.#t.stateRef, (n)=>V(this.#n.transactingCapability.revertTransaction(n, e), Or));
        }
        serializeState(e) {
            return this.#n.serializationCapability.serialize(e);
        }
    }, hte = class extends wn("Wallet.Other") {
    }, w_ = class extends wn("Wallet.Sync") {
    }, Sot = class extends wn("Wallet.InsufficientFunds") {
    }, gvt = class extends wn("Wallet.Address") {
    }, bi = class extends wn("Wallet.Transacting") {
    };
    class kot extends wn("Wallet.Sign") {
    }
    class dv extends wn("Wallet.ApplyTransaction") {
    }
    class Tot extends wn("Wallet.RollbackUtxo") {
    }
    class vL extends wn("Wallet.SpendUtxo") {
    }
    class SL extends wn("UtxoNotFoundError") {
    }
    const kL = {
        isCompleteWithin (t, e = 50n) {
            const n = BigInt(Math.abs(Number(t.highestTransactionId - t.appliedId)));
            return t.isConnected && n <= e;
        }
    }, w4 = (t = {})=>{
        const { appliedId: e = 0n, highestTransactionId: n = 0n, isConnected: r = !1 } = t;
        return {
            ...{
                appliedId: e,
                highestTransactionId: n,
                isConnected: r
            },
            isStrictlyComplete () {
                return kL.isCompleteWithin(this, 0n);
            },
            isCompleteWithin (i) {
                return kL.isCompleteWithin(this, i);
            }
        };
    }, wa = (t)=>`${t.intentHash}#${t.outputNo}`, Wo = {
        empty: ()=>({
                availableUtxos: Q0(),
                pendingUtxos: Q0()
            }),
        restore: (t, e)=>({
                availableUtxos: um(t.map((n)=>[
                        wa(n.utxo),
                        n
                    ])),
                pendingUtxos: um(e.map((n)=>[
                        wa(n.utxo),
                        n
                    ]))
            }),
        spend: (t, e)=>Hs(function*() {
                const n = wa(e.utxo);
                return gN(t.availableUtxos, n) ? {
                    availableUtxos: yN(t.availableUtxos, n),
                    pendingUtxos: tx(t.pendingUtxos, n, e)
                } : yield* Qe(new SL({
                    utxo: e.utxo
                }));
            }),
        rollbackSpend: (t, e)=>{
            const n = wa(e.utxo);
            return gN(t.pendingUtxos, n) ? lt({
                availableUtxos: tx(t.availableUtxos, n, e),
                pendingUtxos: yN(t.pendingUtxos, n)
            }) : lt(t);
        },
        spendByUtxo: (t, e)=>Hs(function*() {
                const n = wa(e), r = yield* GE(ex(t.availableUtxos, n), ()=>new SL({
                        utxo: e
                    }));
                return yield* Wo.spend(t, r);
            }),
        rollbackSpendByUtxo: (t, e)=>V(ex(t.pendingUtxos, wa(e)), un({
                onNone: ()=>lt(t),
                onSome: (n)=>Wo.rollbackSpend(t, n)
            })),
        applyUpdate: (t, e)=>Hs(function*() {
                return [
                    "SUCCESS",
                    "PARTIAL_SUCCESS"
                ].includes(e.status) ? {
                    availableUtxos: mN(Q8(t.availableUtxos, e.spentUtxos.map((n)=>wa(n.utxo))), um(e.createdUtxos.map((n)=>[
                            wa(n.utxo),
                            n
                        ]))),
                    pendingUtxos: Q8(t.pendingUtxos, e.spentUtxos.map((n)=>wa(n.utxo)))
                } : yield* Qe(new dv({
                    message: `Invalid status: ${e.status}`
                }));
            }),
        applyFailedUpdate: (t, e)=>Hs(function*() {
                return e.status !== "FAILURE" ? yield* Qe(new dv({
                    message: `Invalid status: ${e.status}`
                })) : {
                    availableUtxos: mN(t.availableUtxos, um(e.spentUtxos.map((n)=>[
                            wa(n.utxo),
                            n
                        ]))),
                    pendingUtxos: Q8(t.pendingUtxos, e.spentUtxos.map((n)=>wa(n.utxo)))
                };
            }),
        toArrays: (t)=>({
                availableUtxos: bN(t.availableUtxos),
                pendingUtxos: bN(t.pendingUtxos)
            })
    }, Vl = {
        init (t, e) {
            return {
                state: Wo.empty(),
                publicKey: t,
                protocolVersion: Kh,
                progress: w4(),
                networkId: e
            };
        },
        restore (t, e, n, r, s) {
            return {
                state: t,
                publicKey: e,
                protocolVersion: r,
                progress: w4(n),
                networkId: s
            };
        },
        updateProgress (t, { appliedId: e, highestTransactionId: n, isConnected: r }) {
            const s = w4({
                appliedId: e ?? t.progress.appliedId,
                highestTransactionId: n ?? t.progress.highestTransactionId,
                isConnected: r ?? t.progress.isConnected
            });
            return {
                ...t,
                progress: s
            };
        },
        applyUpdate (t, e) {
            return Wo.applyUpdate(t.state, e).pipe(ti((n)=>({
                    ...t,
                    state: n
                })), qs((n)=>new dv(n)));
        },
        applyFailedUpdate (t, e) {
            return Wo.applyFailedUpdate(t.state, e).pipe(ti((n)=>({
                    ...t,
                    state: n
                })), qs((n)=>new dv(n)));
        },
        rollbackUtxo (t, e) {
            return Wo.rollbackSpendByUtxo(t.state, e).pipe(ti((n)=>({
                    ...t,
                    state: n
                })), qs((n)=>new Tot(n)));
        },
        spend (t, e) {
            return Wo.spendByUtxo(t.state, e).pipe(ti((n)=>({
                    ...t,
                    state: n
                })), qs((n)=>new vL(n)));
        },
        spendUtxos (t, e) {
            return V(e, Yl(lt([
                [],
                t.state
            ]), (n, r)=>n.pipe(Bg(([s, i])=>Wo.spendByUtxo(i, r).pipe(ti((o)=>[
                            s.concat([
                                r
                            ]),
                            o
                        ]), qs((o)=>new vL(o)))))), ti(([n, r])=>[
                    n,
                    {
                        ...t,
                        state: r
                    }
                ]));
        }
    }, Eot = ()=>{
        const t = tn({
            utxo: tn({
                value: Ul,
                owner: gn,
                type: gn,
                intentHash: gn,
                outputNo: Jr
            }),
            meta: tn({
                ctime: eJ,
                registeredForDustGeneration: e5
            })
        }), e = tn({
            publicKey: tn({
                publicKey: gn,
                addressHex: gn,
                address: gn
            }),
            state: tn({
                availableUtxos: Ws(t),
                pendingUtxos: Ws(t)
            }),
            protocolVersion: Ul,
            appliedId: lh(Ul),
            networkId: gn
        });
        return {
            serialize: (n)=>V(n, (s)=>({
                        publicKey: s.publicKey,
                        state: Wo.toArrays(s.state),
                        protocolVersion: s.protocolVersion,
                        networkId: s.networkId,
                        appliedId: s.progress?.appliedId
                    }), cd(e), JSON.stringify),
            deserialize: (n)=>V(n, Wc(Q1(e)), qs((r)=>new hte(r)), ti((r)=>Vl.restore(Wo.restore(r.state.availableUtxos, r.state.pendingUtxos), r.publicKey, {
                        highestTransactionId: r.appliedId ?? 0n,
                        appliedId: r.appliedId ?? 0n
                    }, ja(r.protocolVersion), r.networkId)))
        };
    }, Cot = tf(Jr, VA, {
        strict: !0,
        decode: (t)=>new Date(t),
        encode: (t)=>t.getTime()
    }), Iot = tn({
        value: zy,
        owner: gn,
        tokenType: gn,
        intentHash: gn,
        outputIndex: Jr,
        ctime: Jr,
        registeredForDustGeneration: e5
    }), fv = tf(Iot, ch(tn({
        utxo: tn({
            value: KJ,
            owner: gn,
            type: gn,
            intentHash: gn,
            outputNo: Jr
        }),
        meta: tn({
            ctime: VA,
            registeredForDustGeneration: e5
        })
    })), {
        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
            })
    }), pte = dVe(tn({
        id: Jr,
        hash: gn,
        type: ii("RegularTransaction", "SystemTransaction"),
        protocolVersion: Jr,
        identifiers: lh(Ws(gn)),
        block: tn({
            timestamp: Cot
        }),
        fees: lh(tn({
            paidFees: zy,
            estimatedFees: zy
        })),
        transactionResult: lh(tn({
            status: ii("SUCCESS", "FAILURE", "PARTIAL_SUCCESS"),
            segments: UZ(Ws(tn({
                id: Jr,
                success: e5
            })))
        }))
    })), Aot = tn({
        type: ii("UnshieldedTransaction"),
        transaction: pte,
        createdUtxos: Ws(fv),
        spentUtxos: Ws(fv)
    }), Pot = tf(Aot, ch(tn({
        type: ii("UnshieldedTransaction"),
        transaction: pte,
        createdUtxos: Ws(ch(fv)),
        spentUtxos: Ws(ch(fv)),
        status: ii("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
    }), Oot = tn({
        type: ii("UnshieldedTransactionsProgress"),
        highestTransactionId: Jr
    }), Mot = Lh(Pot, Oot), Rot = (t)=>({
            updates: (e)=>{
                const { indexerClientConnection: n } = t, r = WA(n.indexerHttpUrl, n.indexerWsUrl);
                if (Qn(r)) return Dy(new w_(new Error(`Could not derive WebSocket URL from indexer HTTP URL: ${r.left.message}`)));
                const s = c5(r.right);
                if (Qn(s)) return Dy(new w_(new Error(`Invalid indexer WS URL: ${s.left.message}`)));
                const i = s.right, { appliedId: o } = e.progress, { address: a } = e.publicKey;
                return V(jBe.run({
                    address: a,
                    transactionId: Number(o)
                }), sJ(KA({
                    url: i,
                    keepAlive: n.keepAlive
                })), zA((c)=>new w_(c)), nf((c)=>{
                    const { unshieldedTransactions: l } = c;
                    return V(Wc(Mot)(l), qs((u)=>new w_(u)), Or);
                }));
            }
        }), Not = (t, e)=>({
            applyUpdate: (n, r)=>{
                if (r.type === "UnshieldedTransactionsProgress") return lt(Vl.updateProgress(n, {
                    highestTransactionId: BigInt(r.highestTransactionId),
                    isConnected: !0
                }));
                {
                    const s = {
                        createdUtxos: r.createdUtxos,
                        spentUtxos: r.spentUtxos,
                        status: r.status
                    };
                    return (r.status === "FAILURE" ? Vl.applyFailedUpdate(n, s) : Vl.applyUpdate(n, s)).pipe(ti((o)=>{
                        const a = Vl.updateProgress(o, {
                            appliedId: BigInt(r.transaction.id)
                        }), { transactionHistoryService: c } = e();
                        return c.create(r), a;
                    }));
                }
            }
        }), Tm = {
        getSignatureData (t, e) {
            if (!t.intents) return Qe(new bi({
                message: "Transaction has no intents"
            }));
            const n = t.intents.get(e);
            return n ? bo({
                try: ()=>n.signatureData(e),
                catch: (r)=>new bi({
                        message: "Failed to get offer signature data",
                        cause: r
                    })
            }) : Qe(new bi({
                message: `Intent with segment ${e} was not found`
            }));
        },
        getSegments (t) {
            return t.intents?.keys().toArray() ?? [];
        },
        addSignature (t, e, n) {
            return Hs(function*() {
                if (!t.intents || t.intents.size === 0) return yield* Qe(new bi({
                    message: "No intents found in the transaction"
                }));
                const r = t.intents?.get(n);
                return r ? Tm.isIntentBound(r) ? yield* Qe(new bi({
                    message: `Intent at segment ${n} is already bound`
                })) : (r.fallibleUnshieldedOffer && (r.fallibleUnshieldedOffer = yield* Tm.addSignaturesToOffer(r.fallibleUnshieldedOffer, e, n, "fallible")), r.guaranteedUnshieldedOffer && (r.guaranteedUnshieldedOffer = yield* Tm.addSignaturesToOffer(r.guaranteedUnshieldedOffer, e, n, "guaranteed")), t.intents = t.intents.set(n, r), t) : yield* Qe(new bi({
                    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 Is.fromEntries(n);
        },
        addSignaturesToOffer (t, e, n, r) {
            return V(t.inputs, Rs((s, i)=>t.signatures.at(i) ?? e), (s)=>bo({
                    try: ()=>t.addSignatures(s),
                    catch: (i)=>new bi({
                            message: `Failed to add ${r} signature at segment ${n}`,
                            cause: i
                        })
                }));
        },
        isIntentBound (t) {
            return t.binding.instance === "binding";
        },
        extractOwnInputs (t, e) {
            const n = Tm.getSegments(t);
            return V(n, Dg((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
                ];
            }));
        }
    }, em = 0, Vot = (t, e)=>new Bot(t.networkId, ()=>e().coinSelection, ()=>e().coinsAndBalancesCapability, ()=>e().keysCapability, Tm);
    let Bot = 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 Hs(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* Qe(new bi({
                        message: `Intent with id ${u} is not bound`
                    }));
                }
                const s = n.intents?.get(r[0]), i = this.txOps.getImbalances(n, em);
                if (i.size === 0) return [
                    void 0,
                    e
                ];
                const o = yield* this.#t(e, i, Is.empty(), this.getCoinSelection()), { newState: a, offer: c } = yield* this.#n(e, o), l = Gr.new(s.ttl);
                return l.guaranteedUnshieldedOffer = c, [
                    xn.fromPartsRandomized(this.networkId, void 0, void 0, l),
                    a
                ];
            });
        }
        makeTransfer(e, n, r) {
            return Hs(this, function*() {
                const { networkId: s } = this;
                if (!n.every((f)=>f.amount > 0n)) return yield* Qe(new bi({
                    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, Is.empty(), Is.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 = Gr.new(r);
                return o.some((f)=>f.type === Av().raw) ? u.fallibleUnshieldedOffer = l : u.guaranteedUnshieldedOffer = l, {
                    newState: c,
                    transaction: xn.fromParts(s, void 0, void 0, u)
                };
            });
        }
        initSwap(e, n, r, s) {
            return Hs(this, function*() {
                const { networkId: i } = this;
                if (!r.every((b)=>b.amount > 0n)) return yield* Qe(new bi({
                    message: "The amount of all outputs needs to be positive"
                }));
                if (!Object.entries(n).every(([, b])=>b > 0n)) return yield* Qe(new bi({
                    message: "The amount of all inputs needs to be positive"
                }));
                const c = r.map((b)=>({
                        value: b.amount,
                        owner: b.receiverAddress.data.toString("hex"),
                        type: b.type
                    })), l = Is.fromEntries(Object.entries(n)), u = yield* this.#t(e, Is.empty(), l, this.getCoinSelection()), { newState: d, offer: f } = yield* this.#n(e, {
                    inputs: u.inputs,
                    outputs: [
                        ...u.outputs,
                        ...c
                    ]
                }), p = Gr.new(s);
                p.guaranteedUnshieldedOffer = f;
                const h = xn.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 Hs(this, function*() {
                const r = this.txOps.getSegments(e);
                if (!r.length) throw new kot({
                    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), Yl(lt(e), (r, s)=>V(r, Bg((i)=>Vl.rollbackUtxo(i, s)))));
        }
        #t(e, n, r, s) {
            return bo({
                try: ()=>F2({
                        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 iy ? new Sot({
                        message: "Insufficient funds",
                        tokenType: i.tokenType,
                        amount: n.get(i.tokenType) ?? 0n
                    }) : new hte({
                        message: "Balancing unshielded segment failed",
                        cause: i
                    })
            });
        }
        #n(e, n) {
            return Hs(function*() {
                const [r, s] = yield* Vl.spendUtxos(e, n.inputs), { publicKey: i } = e.publicKey, o = r.map((c)=>({
                        ...c,
                        intentHash: c.intentHash,
                        owner: i
                    })), a = yield* bo({
                    try: ()=>go.new(o, [
                            ...n.outputs
                        ], []),
                    catch: (c)=>new bi({
                            message: "Failed to create counter offer",
                            cause: c
                        })
                });
                return {
                    newState: s,
                    offer: a
                };
            });
        }
        #r(e, n) {
            return V(Yh(n), un({
                onNone: ()=>lt(e),
                onSome: (r)=>bo({
                        try: ()=>go.new([
                                ...r.inputs,
                                ...e.inputs
                            ], [
                                ...r.outputs,
                                ...e.outputs
                            ], [
                                ...r.signatures,
                                ...e.signatures
                            ]),
                        catch: (s)=>new bi({
                                message: "Failed to merge offers",
                                cause: s
                            })
                    })
            }));
        }
        #s(e, n) {
            return Hs(this, function*() {
                const r = this.txOps.getSegments(n);
                if (r.length === 0) return [
                    void 0,
                    e
                ];
                for (const s of [
                    ...r,
                    em
                ]){
                    const i = this.txOps.getImbalances(n, s);
                    if (i.size === 0) continue;
                    const o = s === em ? r[0] : s, a = n.intents?.get(o);
                    if (!a) return yield* Qe(new bi({
                        message: `Intent with id ${s} was not found`
                    }));
                    if (this.txOps.isIntentBound(a)) return yield* Qe(new bi({
                        message: `Intent with id ${s} is already bound`
                    }));
                    const l = yield* this.#t(e, i, Is.empty(), this.getCoinSelection()), { offer: u } = yield* this.#n(e, l), d = s !== em ? a.fallibleUnshieldedOffer : a.guaranteedUnshieldedOffer, f = yield* this.#r(u, d);
                    s !== em ? a.fallibleUnshieldedOffer = f : a.guaranteedUnshieldedOffer = f, n.intents = n.intents.set(o, a);
                }
                return [
                    n,
                    e
                ];
            });
        }
    };
    const TL = (t)=>t.reduce((e, { utxo: n })=>({
                ...e,
                [n.type]: e[n.type] === void 0 ? n.value : e[n.type] + n.value
            }), {}), Dot = ()=>{
        const t = (o)=>{
            const a = r(o);
            return TL(a);
        }, e = (o)=>{
            const a = s(o);
            return TL(a);
        }, n = (o)=>{
            const a = t(o), c = e(o);
            return V([
                a,
                c
            ], qJ(0n, (l, u)=>l + u));
        }, r = (o)=>Wo.toArrays(o.state).availableUtxos, s = (o)=>Wo.toArrays(o.state).pendingUtxos;
        return {
            getAvailableBalances: t,
            getPendingBalances: e,
            getTotalBalances: n,
            getAvailableCoins: r,
            getPendingCoins: s,
            getTotalCoins: (o)=>[
                    ...r(o),
                    ...s(o)
                ]
        };
    };
    var Sf = {}, tm = {}, EL;
    function L5() {
        if (EL) return tm;
        EL = 1, Object.defineProperty(tm, "__esModule", {
            value: !0
        }), tm.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 || (tm.TypeKind = t = {})), tm;
    }
    var kf = {}, _a = {}, _4 = {
        exports: {}
    }, x4 = {}, v4 = {}, S4 = {}, k4, CL;
    function bO() {
        return CL || (CL = 1, k4 = 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;
        }), k4;
    }
    var T4, IL;
    function z5() {
        if (IL) return T4;
        IL = 1;
        var t = bO();
        return T4 = function() {
            return t() && !!Symbol.toStringTag;
        }, T4;
    }
    var E4, AL;
    function mO() {
        return AL || (AL = 1, E4 = Object), E4;
    }
    var C4, PL;
    function Fot() {
        return PL || (PL = 1, C4 = Error), C4;
    }
    var I4, OL;
    function Lot() {
        return OL || (OL = 1, I4 = EvalError), I4;
    }
    var A4, ML;
    function zot() {
        return ML || (ML = 1, A4 = RangeError), A4;
    }
    var P4, RL;
    function Uot() {
        return RL || (RL = 1, P4 = ReferenceError), P4;
    }
    var O4, NL;
    function gte() {
        return NL || (NL = 1, O4 = SyntaxError), O4;
    }
    var M4, VL;
    function mw() {
        return VL || (VL = 1, M4 = TypeError), M4;
    }
    var R4, BL;
    function Hot() {
        return BL || (BL = 1, R4 = URIError), R4;
    }
    var N4, DL;
    function jot() {
        return DL || (DL = 1, N4 = Math.abs), N4;
    }
    var V4, FL;
    function qot() {
        return FL || (FL = 1, V4 = Math.floor), V4;
    }
    var B4, LL;
    function Kot() {
        return LL || (LL = 1, B4 = Math.max), B4;
    }
    var D4, zL;
    function Wot() {
        return zL || (zL = 1, D4 = Math.min), D4;
    }
    var F4, UL;
    function $ot() {
        return UL || (UL = 1, F4 = Math.pow), F4;
    }
    var L4, HL;
    function Xot() {
        return HL || (HL = 1, L4 = Math.round), L4;
    }
    var z4, jL;
    function Got() {
        return jL || (jL = 1, z4 = Number.isNaN || function(e) {
            return e !== e;
        }), z4;
    }
    var U4, qL;
    function Zot() {
        if (qL) return U4;
        qL = 1;
        var t = Got();
        return U4 = function(n) {
            return t(n) || n === 0 ? n : n < 0 ? -1 : 1;
        }, U4;
    }
    var H4, KL;
    function Jot() {
        return KL || (KL = 1, H4 = Object.getOwnPropertyDescriptor), H4;
    }
    var j4, WL;
    function mb() {
        if (WL) return j4;
        WL = 1;
        var t = Jot();
        if (t) try {
            t([], "length");
        } catch  {
            t = null;
        }
        return j4 = t, j4;
    }
    var q4, $L;
    function U5() {
        if ($L) return q4;
        $L = 1;
        var t = Object.defineProperty || !1;
        if (t) try {
            t({}, "a", {
                value: 1
            });
        } catch  {
            t = !1;
        }
        return q4 = t, q4;
    }
    var K4, XL;
    function Yot() {
        if (XL) return K4;
        XL = 1;
        var t = typeof Symbol < "u" && Symbol, e = bO();
        return K4 = function() {
            return typeof t != "function" || typeof Symbol != "function" || typeof t("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : e();
        }, K4;
    }
    var W4, GL;
    function bte() {
        return GL || (GL = 1, W4 = typeof Reflect < "u" && Reflect.getPrototypeOf || null), W4;
    }
    var $4, ZL;
    function mte() {
        if (ZL) return $4;
        ZL = 1;
        var t = mO();
        return $4 = t.getPrototypeOf || null, $4;
    }
    var X4, JL;
    function Qot() {
        if (JL) return X4;
        JL = 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 X4 = 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 _ = l.apply(this, s(u, arguments));
                    return Object(_) === _ ? _ : this;
                }
                return l.apply(c, s(u, arguments));
            }, p = n(0, l.length - u.length), h = [], b = 0; b < p; b++)h[b] = "$" + b;
            if (d = Function("binder", "return function (" + o(h, ",") + "){ return binder.apply(this,arguments); }")(f), l.prototype) {
                var y = function() {};
                y.prototype = l.prototype, d.prototype = new y, y.prototype = null;
            }
            return d;
        }, X4;
    }
    var G4, YL;
    function yw() {
        if (YL) return G4;
        YL = 1;
        var t = Qot();
        return G4 = Function.prototype.bind || t, G4;
    }
    var Z4, QL;
    function yO() {
        return QL || (QL = 1, Z4 = Function.prototype.call), Z4;
    }
    var J4, ez;
    function wO() {
        return ez || (ez = 1, J4 = Function.prototype.apply), J4;
    }
    var Y4, tz;
    function eat() {
        return tz || (tz = 1, Y4 = typeof Reflect < "u" && Reflect && Reflect.apply), Y4;
    }
    var Q4, nz;
    function yte() {
        if (nz) return Q4;
        nz = 1;
        var t = yw(), e = wO(), n = yO(), r = eat();
        return Q4 = r || t.call(n, e), Q4;
    }
    var e7, rz;
    function _O() {
        if (rz) return e7;
        rz = 1;
        var t = yw(), e = mw(), n = yO(), r = yte();
        return e7 = function(i) {
            if (i.length < 1 || typeof i[0] != "function") throw new e("a function is required");
            return r(t, n, i);
        }, e7;
    }
    var t7, sz;
    function tat() {
        if (sz) return t7;
        sz = 1;
        var t = _O(), e = mb(), 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 t7 = r && typeof r.get == "function" ? t([
            r.get
        ]) : typeof i == "function" ? function(a) {
            return i(a == null ? a : s(a));
        } : !1, t7;
    }
    var n7, iz;
    function xO() {
        if (iz) return n7;
        iz = 1;
        var t = bte(), e = mte(), n = tat();
        return n7 = 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, n7;
    }
    var r7, oz;
    function wte() {
        if (oz) return r7;
        oz = 1;
        var t = Function.prototype.call, e = Object.prototype.hasOwnProperty, n = yw();
        return r7 = n.call(t, e), r7;
    }
    var s7, az;
    function vO() {
        if (az) return s7;
        az = 1;
        var t, e = mO(), n = Fot(), r = Lot(), s = zot(), i = Uot(), o = gte(), a = mw(), c = Hot(), l = jot(), u = qot(), d = Kot(), f = Wot(), p = $ot(), h = Xot(), b = Zot(), y = Function, _ = function(Y) {
            try {
                return y('"use strict"; return (' + Y + ").constructor;")();
            } catch  {}
        }, v = mb(), w = U5(), E = function() {
            throw new a;
        }, I = v ? (function() {
            try {
                return arguments.callee, E;
            } catch  {
                try {
                    return v(arguments, "callee").get;
                } catch  {
                    return E;
                }
            }
        })() : E, D = Yot()(), U = xO(), K = mte(), $ = bte(), ne = wO(), te = yO(), J = {}, C = typeof Uint8Array > "u" || !U ? t : U(Uint8Array), g = {
            __proto__: null,
            "%AggregateError%": typeof AggregateError > "u" ? t : AggregateError,
            "%Array%": Array,
            "%ArrayBuffer%": typeof ArrayBuffer > "u" ? t : ArrayBuffer,
            "%ArrayIteratorPrototype%": D && U ? U([][Symbol.iterator]()) : t,
            "%AsyncFromSyncIteratorPrototype%": t,
            "%AsyncFunction%": J,
            "%AsyncGenerator%": J,
            "%AsyncGeneratorFunction%": J,
            "%AsyncIteratorPrototype%": J,
            "%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%": y,
            "%GeneratorFunction%": J,
            "%Int8Array%": typeof Int8Array > "u" ? t : Int8Array,
            "%Int16Array%": typeof Int16Array > "u" ? t : Int16Array,
            "%Int32Array%": typeof Int32Array > "u" ? t : Int32Array,
            "%isFinite%": isFinite,
            "%isNaN%": isNaN,
            "%IteratorPrototype%": D && U ? U(U([][Symbol.iterator]())) : t,
            "%JSON%": typeof JSON == "object" ? JSON : t,
            "%Map%": typeof Map > "u" ? t : Map,
            "%MapIteratorPrototype%": typeof Map > "u" || !D || !U ? t : U(new Map()[Symbol.iterator]()),
            "%Math%": Math,
            "%Number%": Number,
            "%Object%": e,
            "%Object.getOwnPropertyDescriptor%": v,
            "%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" || !D || !U ? t : U(new Set()[Symbol.iterator]()),
            "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? t : SharedArrayBuffer,
            "%String%": String,
            "%StringIteratorPrototype%": D && U ? U(""[Symbol.iterator]()) : t,
            "%Symbol%": D ? Symbol : t,
            "%SyntaxError%": o,
            "%ThrowTypeError%": I,
            "%TypedArray%": C,
            "%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%": te,
            "%Function.prototype.apply%": ne,
            "%Object.defineProperty%": w,
            "%Object.getPrototypeOf%": K,
            "%Math.abs%": l,
            "%Math.floor%": u,
            "%Math.max%": d,
            "%Math.min%": f,
            "%Math.pow%": p,
            "%Math.round%": h,
            "%Math.sign%": b,
            "%Reflect.getPrototypeOf%": $
        };
        if (U) try {
            null.error;
        } catch (Y) {
            var x = U(U(Y));
            g["%Error.prototype%"] = x;
        }
        var A = function Y(ae) {
            var de;
            if (ae === "%AsyncFunction%") de = _("async function () {}");
            else if (ae === "%GeneratorFunction%") de = _("function* () {}");
            else if (ae === "%AsyncGeneratorFunction%") de = _("async function* () {}");
            else if (ae === "%AsyncGenerator%") {
                var pe = Y("%AsyncGeneratorFunction%");
                pe && (de = pe.prototype);
            } else if (ae === "%AsyncIteratorPrototype%") {
                var Ae = Y("%AsyncGenerator%");
                Ae && U && (de = U(Ae.prototype));
            }
            return g[ae] = de, de;
        }, 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 = yw(), L = wte(), z = N.call(te, Array.prototype.concat), B = N.call(ne, Array.prototype.splice), S = N.call(te, String.prototype.replace), O = N.call(te, String.prototype.slice), W = N.call(te, RegExp.prototype.exec), F = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, G = /\\(\\)?/g, ee = function(ae) {
            var de = O(ae, 0, 1), pe = O(ae, -1);
            if (de === "%" && pe !== "%") throw new o("invalid intrinsic syntax, expected closing `%`");
            if (pe === "%" && de !== "%") throw new o("invalid intrinsic syntax, expected opening `%`");
            var Ae = [];
            return S(ae, F, function(Oe, Re, Me, Je) {
                Ae[Ae.length] = Me ? S(Je, G, "$1") : Re || Oe;
            }), Ae;
        }, Q = function(ae, de) {
            var pe = ae, Ae;
            if (L(R, pe) && (Ae = R[pe], pe = "%" + Ae[0] + "%"), L(g, pe)) {
                var Oe = g[pe];
                if (Oe === J && (Oe = A(pe)), typeof Oe > "u" && !de) throw new a("intrinsic " + ae + " exists, but is not available. Please file an issue!");
                return {
                    alias: Ae,
                    name: pe,
                    value: Oe
                };
            }
            throw new o("intrinsic " + ae + " does not exist!");
        };
        return s7 = function(ae, de) {
            if (typeof ae != "string" || ae.length === 0) throw new a("intrinsic name must be a non-empty string");
            if (arguments.length > 1 && typeof de != "boolean") throw new a('"allowMissing" argument must be a boolean');
            if (W(/^%?[^%]*%?$/, ae) === null) throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
            var pe = ee(ae), Ae = pe.length > 0 ? pe[0] : "", Oe = Q("%" + Ae + "%", de), Re = Oe.name, Me = Oe.value, Je = !1, Ee = Oe.alias;
            Ee && (Ae = Ee[0], B(pe, z([
                0,
                1
            ], Ee)));
            for(var le = 1, qe = !0; le < pe.length; le += 1){
                var Ye = pe[le], ut = O(Ye, 0, 1), Ce = O(Ye, -1);
                if ((ut === '"' || ut === "'" || ut === "`" || Ce === '"' || Ce === "'" || Ce === "`") && ut !== Ce) throw new o("property names with quotes must have matching quotes");
                if ((Ye === "constructor" || !qe) && (Je = !0), Ae += "." + Ye, Re = "%" + Ae + "%", L(g, Re)) Me = g[Re];
                else if (Me != null) {
                    if (!(Ye in Me)) {
                        if (!de) throw new a("base intrinsic for " + ae + " exists, but the property is not available.");
                        return;
                    }
                    if (v && le + 1 >= pe.length) {
                        var oe = v(Me, Ye);
                        qe = !!oe, qe && "get" in oe && !("originalValue" in oe.get) ? Me = oe.get : Me = Me[Ye];
                    } else qe = L(Me, Ye), Me = Me[Ye];
                    qe && !Je && (g[Re] = Me);
                }
            }
            return Me;
        }, s7;
    }
    var i7, cz;
    function yb() {
        if (cz) return i7;
        cz = 1;
        var t = vO(), e = _O(), n = e([
            t("%String.prototype.indexOf%")
        ]);
        return i7 = function(s, i) {
            var o = t(s, !!i);
            return typeof o == "function" && n(s, ".prototype.") > -1 ? e([
                o
            ]) : o;
        }, i7;
    }
    var o7, lz;
    function nat() {
        if (lz) return o7;
        lz = 1;
        var t = z5()(), e = yb(), 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, o7 = i ? r : s, o7;
    }
    var a7, uz;
    function rat() {
        if (uz) return a7;
        uz = 1;
        var t = yb(), e = z5()(), n = wte(), r = mb(), 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 (b) {
                    return b === 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 a7 = s, a7;
    }
    var c7, dz;
    function sat() {
        if (dz) return c7;
        dz = 1;
        var t = yb(), e = rat(), n = t("RegExp.prototype.exec"), r = mw();
        return c7 = function(i) {
            if (!e(i)) throw new r("`regex` must be a RegExp");
            return function(a) {
                return n(i, a) !== null;
            };
        }, c7;
    }
    var l7, fz;
    function iat() {
        if (fz) return l7;
        fz = 1;
        const t = function*() {}.constructor;
        return l7 = ()=>t, l7;
    }
    var u7, hz;
    function oat() {
        if (hz) return u7;
        hz = 1;
        var t = yb(), e = sat(), n = e(/^\s*(?:function)?\*/), r = z5()(), s = xO(), i = t("Object.prototype.toString"), o = t("Function.prototype.toString"), a = iat();
        return u7 = 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;
        }, u7;
    }
    var d7, pz;
    function aat() {
        if (pz) return d7;
        pz = 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 (v) {
            v !== r && (e = null);
        }
        else e = null;
        var s = /^\s*class\b/, i = function(w) {
            try {
                var E = t.call(w);
                return s.test(E);
            } catch  {
                return !1;
            }
        }, o = function(w) {
            try {
                return i(w) ? !1 : (t.call(w), !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, b = !(0 in [
            , 
        ]), y = function() {
            return !1;
        };
        if (typeof document == "object") {
            var _ = document.all;
            a.call(_) === a.call(document.all) && (y = function(w) {
                if ((b || !w) && (typeof w > "u" || typeof w == "object")) try {
                    var E = a.call(w);
                    return (E === d || E === f || E === p || E === c) && w("") == null;
                } catch  {}
                return !1;
            });
        }
        return d7 = e ? function(w) {
            if (y(w)) return !0;
            if (!w || typeof w != "function" && typeof w != "object") return !1;
            try {
                e(w, null, n);
            } catch (E) {
                if (E !== r) return !1;
            }
            return !i(w) && o(w);
        } : function(w) {
            if (y(w)) return !0;
            if (!w || typeof w != "function" && typeof w != "object") return !1;
            if (h) return o(w);
            if (i(w)) return !1;
            var E = a.call(w);
            return E !== l && E !== u && !/^\[object HTML/.test(E) ? !1 : o(w);
        }, d7;
    }
    var f7, gz;
    function cat() {
        if (gz) return f7;
        gz = 1;
        var t = aat(), 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 f7 = 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);
        }, f7;
    }
    var h7, bz;
    function lat() {
        return bz || (bz = 1, h7 = [
            "Float16Array",
            "Float32Array",
            "Float64Array",
            "Int8Array",
            "Int16Array",
            "Int32Array",
            "Uint8Array",
            "Uint8ClampedArray",
            "Uint16Array",
            "Uint32Array",
            "BigInt64Array",
            "BigUint64Array"
        ]), h7;
    }
    var p7, mz;
    function uat() {
        if (mz) return p7;
        mz = 1;
        var t = lat(), e = globalThis;
        return p7 = function() {
            for(var r = [], s = 0; s < t.length; s++)typeof e[t[s]] == "function" && (r[r.length] = t[s]);
            return r;
        }, p7;
    }
    var g7 = {
        exports: {}
    }, b7, yz;
    function _te() {
        if (yz) return b7;
        yz = 1;
        var t = U5(), e = gte(), n = mw(), r = mb();
        return b7 = 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.");
        }, b7;
    }
    var m7, wz;
    function xte() {
        if (wz) return m7;
        wz = 1;
        var t = U5(), e = function() {
            return !!t;
        };
        return e.hasArrayLengthDefineBug = function() {
            if (!t) return null;
            try {
                return t([], "length", {
                    value: 1
                }).length !== 1;
            } catch  {
                return !0;
            }
        }, m7 = e, m7;
    }
    var y7, _z;
    function dat() {
        if (_z) return y7;
        _z = 1;
        var t = vO(), e = _te(), n = xte()(), r = mb(), s = mw(), i = t("%Math.floor%");
        return y7 = 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;
        }, y7;
    }
    var w7, xz;
    function fat() {
        if (xz) return w7;
        xz = 1;
        var t = yw(), e = wO(), n = yte();
        return w7 = function() {
            return n(t, e, arguments);
        }, w7;
    }
    var vz;
    function H5() {
        return vz || (vz = 1, (function(t) {
            var e = dat(), n = U5(), r = _O(), s = fat();
            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;
        })(g7)), g7.exports;
    }
    var _7, Sz;
    function vte() {
        if (Sz) return _7;
        Sz = 1;
        var t = cat(), e = uat(), n = H5(), r = yb(), s = mb(), i = xO(), o = r("Object.prototype.toString"), a = z5()(), c = globalThis, l = e(), u = r("String.prototype.slice"), d = r("Array.prototype.indexOf", !0) || function(y, _) {
            for(var v = 0; v < y.length; v += 1)if (y[v] === _) return v;
            return -1;
        }, f = {
            __proto__: null
        };
        a && s && i ? t(l, function(b) {
            var y = new c[b];
            if (Symbol.toStringTag in y && i) {
                var _ = i(y), v = s(_, Symbol.toStringTag);
                if (!v && _) {
                    var w = i(_);
                    v = s(w, Symbol.toStringTag);
                }
                if (v && v.get) {
                    var E = n(v.get);
                    f["$" + b] = E;
                }
            }
        }) : t(l, function(b) {
            var y = new c[b], _ = y.slice || y.set;
            if (_) {
                var v = n(_);
                f["$" + b] = v;
            }
        });
        var p = function(y) {
            var _ = !1;
            return t(f, function(v, w) {
                if (!_) try {
                    "$" + v(y) === w && (_ = u(w, 1));
                } catch  {}
            }), _;
        }, h = function(y) {
            var _ = !1;
            return t(f, function(v, w) {
                if (!_) try {
                    v(y), _ = u(w, 1);
                } catch  {}
            }), _;
        };
        return _7 = function(y) {
            if (!y || typeof y != "object") return !1;
            if (!a) {
                var _ = u(o(y), 8, -1);
                return d(l, _) > -1 ? _ : _ !== "Object" ? !1 : h(y);
            }
            return s ? p(y) : null;
        }, _7;
    }
    var x7, kz;
    function hat() {
        if (kz) return x7;
        kz = 1;
        var t = vte();
        return x7 = function(n) {
            return !!t(n);
        }, x7;
    }
    var Tz;
    function pat() {
        return Tz || (Tz = 1, (function(t) {
            var e = nat(), n = oat(), r = vte(), s = hat();
            function i(le) {
                return le.call.bind(le);
            }
            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(le, qe) {
                if (typeof le != "object") return !1;
                try {
                    return qe(le), !0;
                } catch  {
                    return !1;
                }
            }
            t.isArgumentsObject = e, t.isGeneratorFunction = n, t.isTypedArray = s;
            function b(le) {
                return typeof Promise < "u" && le instanceof Promise || le !== null && typeof le == "object" && typeof le.then == "function" && typeof le.catch == "function";
            }
            t.isPromise = b;
            function y(le) {
                return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? ArrayBuffer.isView(le) : s(le) || O(le);
            }
            t.isArrayBufferView = y;
            function _(le) {
                return r(le) === "Uint8Array";
            }
            t.isUint8Array = _;
            function v(le) {
                return r(le) === "Uint8ClampedArray";
            }
            t.isUint8ClampedArray = v;
            function w(le) {
                return r(le) === "Uint16Array";
            }
            t.isUint16Array = w;
            function E(le) {
                return r(le) === "Uint32Array";
            }
            t.isUint32Array = E;
            function I(le) {
                return r(le) === "Int8Array";
            }
            t.isInt8Array = I;
            function D(le) {
                return r(le) === "Int16Array";
            }
            t.isInt16Array = D;
            function U(le) {
                return r(le) === "Int32Array";
            }
            t.isInt32Array = U;
            function K(le) {
                return r(le) === "Float32Array";
            }
            t.isFloat32Array = K;
            function $(le) {
                return r(le) === "Float64Array";
            }
            t.isFloat64Array = $;
            function ne(le) {
                return r(le) === "BigInt64Array";
            }
            t.isBigInt64Array = ne;
            function te(le) {
                return r(le) === "BigUint64Array";
            }
            t.isBigUint64Array = te;
            function J(le) {
                return c(le) === "[object Map]";
            }
            J.working = typeof Map < "u" && J(new Map);
            function C(le) {
                return typeof Map > "u" ? !1 : J.working ? J(le) : le instanceof Map;
            }
            t.isMap = C;
            function g(le) {
                return c(le) === "[object Set]";
            }
            g.working = typeof Set < "u" && g(new Set);
            function x(le) {
                return typeof Set > "u" ? !1 : g.working ? g(le) : le instanceof Set;
            }
            t.isSet = x;
            function A(le) {
                return c(le) === "[object WeakMap]";
            }
            A.working = typeof WeakMap < "u" && A(new WeakMap);
            function R(le) {
                return typeof WeakMap > "u" ? !1 : A.working ? A(le) : le instanceof WeakMap;
            }
            t.isWeakMap = R;
            function N(le) {
                return c(le) === "[object WeakSet]";
            }
            N.working = typeof WeakSet < "u" && N(new WeakSet);
            function L(le) {
                return N(le);
            }
            t.isWeakSet = L;
            function z(le) {
                return c(le) === "[object ArrayBuffer]";
            }
            z.working = typeof ArrayBuffer < "u" && z(new ArrayBuffer);
            function B(le) {
                return typeof ArrayBuffer > "u" ? !1 : z.working ? z(le) : le instanceof ArrayBuffer;
            }
            t.isArrayBuffer = B;
            function S(le) {
                return c(le) === "[object DataView]";
            }
            S.working = typeof ArrayBuffer < "u" && typeof DataView < "u" && S(new DataView(new ArrayBuffer(1), 0, 1));
            function O(le) {
                return typeof DataView > "u" ? !1 : S.working ? S(le) : le instanceof DataView;
            }
            t.isDataView = O;
            var W = typeof SharedArrayBuffer < "u" ? SharedArrayBuffer : void 0;
            function F(le) {
                return c(le) === "[object SharedArrayBuffer]";
            }
            function G(le) {
                return typeof W > "u" ? !1 : (typeof F.working > "u" && (F.working = F(new W)), F.working ? F(le) : le instanceof W);
            }
            t.isSharedArrayBuffer = G;
            function ee(le) {
                return c(le) === "[object AsyncFunction]";
            }
            t.isAsyncFunction = ee;
            function Q(le) {
                return c(le) === "[object Map Iterator]";
            }
            t.isMapIterator = Q;
            function Y(le) {
                return c(le) === "[object Set Iterator]";
            }
            t.isSetIterator = Y;
            function ae(le) {
                return c(le) === "[object Generator]";
            }
            t.isGeneratorObject = ae;
            function de(le) {
                return c(le) === "[object WebAssembly.Module]";
            }
            t.isWebAssemblyCompiledModule = de;
            function pe(le) {
                return h(le, l);
            }
            t.isNumberObject = pe;
            function Ae(le) {
                return h(le, u);
            }
            t.isStringObject = Ae;
            function Oe(le) {
                return h(le, d);
            }
            t.isBooleanObject = Oe;
            function Re(le) {
                return o && h(le, f);
            }
            t.isBigIntObject = Re;
            function Me(le) {
                return a && h(le, p);
            }
            t.isSymbolObject = Me;
            function Je(le) {
                return pe(le) || Ae(le) || Oe(le) || Re(le) || Me(le);
            }
            t.isBoxedPrimitive = Je;
            function Ee(le) {
                return typeof Uint8Array < "u" && (B(le) || G(le));
            }
            t.isAnyArrayBuffer = Ee, [
                "isProxy",
                "isExternal",
                "isModuleNamespaceObject"
            ].forEach(function(le) {
                Object.defineProperty(t, le, {
                    enumerable: !1,
                    value: function() {
                        throw new Error(le + " is not supported in userland");
                    }
                });
            });
        })(S4)), S4;
    }
    var v7, Ez;
    function gat() {
        return Ez || (Ez = 1, v7 = function(e) {
            return e && typeof e == "object" && typeof e.copy == "function" && typeof e.fill == "function" && typeof e.readUInt8 == "function";
        }), v7;
    }
    var __ = {
        exports: {}
    }, Cz;
    function bat() {
        return Cz || (Cz = 1, typeof Object.create == "function" ? __.exports = function(e, n) {
            n && (e.super_ = n, e.prototype = Object.create(n.prototype, {
                constructor: {
                    value: e,
                    enumerable: !1,
                    writable: !0,
                    configurable: !0
                }
            }));
        } : __.exports = function(e, n) {
            if (n) {
                e.super_ = n;
                var r = function() {};
                r.prototype = n.prototype, e.prototype = new r, e.prototype.constructor = e;
            }
        }), __.exports;
    }
    var Iz;
    function Zy() {
        return Iz || (Iz = 1, (function(t) {
            var e = {}, n = Object.getOwnPropertyDescriptors || function(W) {
                for(var F = Object.keys(W), G = {}, ee = 0; ee < F.length; ee++)G[F[ee]] = Object.getOwnPropertyDescriptor(W, F[ee]);
                return G;
            }, r = /%[sdj%]/g;
            t.format = function(O) {
                if (!D(O)) {
                    for(var W = [], F = 0; F < arguments.length; F++)W.push(a(arguments[F]));
                    return W.join(" ");
                }
                for(var F = 1, G = arguments, ee = G.length, Q = String(O).replace(r, function(ae) {
                    if (ae === "%%") return "%";
                    if (F >= ee) return ae;
                    switch(ae){
                        case "%s":
                            return String(G[F++]);
                        case "%d":
                            return Number(G[F++]);
                        case "%j":
                            try {
                                return JSON.stringify(G[F++]);
                            } catch  {
                                return "[Circular]";
                            }
                        default:
                            return ae;
                    }
                }), Y = G[F]; F < ee; Y = G[++F])w(Y) || !ne(Y) ? Q += " " + Y : Q += " " + a(Y);
                return Q;
            }, t.deprecate = function(O, W) {
                if (typeof process < "u" && process.noDeprecation === !0) return O;
                if (typeof process > "u") return function() {
                    return t.deprecate(O, W).apply(this, arguments);
                };
                var F = !1;
                function G() {
                    if (!F) {
                        if (process.throwDeprecation) throw new Error(W);
                        process.traceDeprecation ? console.trace(W) : console.error(W), F = !0;
                    }
                    return O.apply(this, arguments);
                }
                return G;
            };
            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 W = process.pid;
                    s[O] = function() {
                        var F = t.format.apply(t, arguments);
                        console.error("%s %d: %s", O, W, F);
                    };
                } else s[O] = function() {};
                return s[O];
            };
            function a(O, W) {
                var F = {
                    seen: [],
                    stylize: l
                };
                return arguments.length >= 3 && (F.depth = arguments[2]), arguments.length >= 4 && (F.colors = arguments[3]), v(W) ? F.showHidden = W : W && t._extend(F, W), K(F.showHidden) && (F.showHidden = !1), K(F.depth) && (F.depth = 2), K(F.colors) && (F.colors = !1), K(F.customInspect) && (F.customInspect = !0), F.colors && (F.stylize = c), d(F, O, F.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, W) {
                var F = a.styles[W];
                return F ? "\x1B[" + a.colors[F][0] + "m" + O + "\x1B[" + a.colors[F][1] + "m" : O;
            }
            function l(O, W) {
                return O;
            }
            function u(O) {
                var W = {};
                return O.forEach(function(F, G) {
                    W[F] = !0;
                }), W;
            }
            function d(O, W, F) {
                if (O.customInspect && W && C(W.inspect) && W.inspect !== t.inspect && !(W.constructor && W.constructor.prototype === W)) {
                    var G = W.inspect(F, O);
                    return D(G) || (G = d(O, G, F)), G;
                }
                var ee = f(O, W);
                if (ee) return ee;
                var Q = Object.keys(W), Y = u(Q);
                if (O.showHidden && (Q = Object.getOwnPropertyNames(W)), J(W) && (Q.indexOf("message") >= 0 || Q.indexOf("description") >= 0)) return p(W);
                if (Q.length === 0) {
                    if (C(W)) {
                        var ae = W.name ? ": " + W.name : "";
                        return O.stylize("[Function" + ae + "]", "special");
                    }
                    if ($(W)) return O.stylize(RegExp.prototype.toString.call(W), "regexp");
                    if (te(W)) return O.stylize(Date.prototype.toString.call(W), "date");
                    if (J(W)) return p(W);
                }
                var de = "", pe = !1, Ae = [
                    "{",
                    "}"
                ];
                if (_(W) && (pe = !0, Ae = [
                    "[",
                    "]"
                ]), C(W)) {
                    var Oe = W.name ? ": " + W.name : "";
                    de = " [Function" + Oe + "]";
                }
                if ($(W) && (de = " " + RegExp.prototype.toString.call(W)), te(W) && (de = " " + Date.prototype.toUTCString.call(W)), J(W) && (de = " " + p(W)), Q.length === 0 && (!pe || W.length == 0)) return Ae[0] + de + Ae[1];
                if (F < 0) return $(W) ? O.stylize(RegExp.prototype.toString.call(W), "regexp") : O.stylize("[Object]", "special");
                O.seen.push(W);
                var Re;
                return pe ? Re = h(O, W, F, Y, Q) : Re = Q.map(function(Me) {
                    return b(O, W, F, Y, Me, pe);
                }), O.seen.pop(), y(Re, de, Ae);
            }
            function f(O, W) {
                if (K(W)) return O.stylize("undefined", "undefined");
                if (D(W)) {
                    var F = "'" + JSON.stringify(W).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
                    return O.stylize(F, "string");
                }
                if (I(W)) return O.stylize("" + W, "number");
                if (v(W)) return O.stylize("" + W, "boolean");
                if (w(W)) return O.stylize("null", "null");
            }
            function p(O) {
                return "[" + Error.prototype.toString.call(O) + "]";
            }
            function h(O, W, F, G, ee) {
                for(var Q = [], Y = 0, ae = W.length; Y < ae; ++Y)L(W, String(Y)) ? Q.push(b(O, W, F, G, String(Y), !0)) : Q.push("");
                return ee.forEach(function(de) {
                    de.match(/^\d+$/) || Q.push(b(O, W, F, G, de, !0));
                }), Q;
            }
            function b(O, W, F, G, ee, Q) {
                var Y, ae, de;
                if (de = Object.getOwnPropertyDescriptor(W, ee) || {
                    value: W[ee]
                }, de.get ? de.set ? ae = O.stylize("[Getter/Setter]", "special") : ae = O.stylize("[Getter]", "special") : de.set && (ae = O.stylize("[Setter]", "special")), L(G, ee) || (Y = "[" + ee + "]"), ae || (O.seen.indexOf(de.value) < 0 ? (w(F) ? ae = d(O, de.value, null) : ae = d(O, de.value, F - 1), ae.indexOf(`
`) > -1 && (Q ? ae = ae.split(`
`).map(function(pe) {
                    return "  " + pe;
                }).join(`
`).slice(2) : ae = `
` + ae.split(`
`).map(function(pe) {
                    return "   " + pe;
                }).join(`
`))) : ae = O.stylize("[Circular]", "special")), K(Y)) {
                    if (Q && ee.match(/^\d+$/)) return ae;
                    Y = JSON.stringify("" + ee), Y.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (Y = Y.slice(1, -1), Y = O.stylize(Y, "name")) : (Y = Y.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), Y = O.stylize(Y, "string"));
                }
                return Y + ": " + ae;
            }
            function y(O, W, F) {
                var G = O.reduce(function(ee, Q) {
                    return Q.indexOf(`
`) >= 0, ee + Q.replace(/\u001b\[\d\d?m/g, "").length + 1;
                }, 0);
                return G > 60 ? F[0] + (W === "" ? "" : W + `
 `) + " " + O.join(`,
  `) + " " + F[1] : F[0] + W + " " + O.join(", ") + " " + F[1];
            }
            t.types = pat();
            function _(O) {
                return Array.isArray(O);
            }
            t.isArray = _;
            function v(O) {
                return typeof O == "boolean";
            }
            t.isBoolean = v;
            function w(O) {
                return O === null;
            }
            t.isNull = w;
            function E(O) {
                return O == null;
            }
            t.isNullOrUndefined = E;
            function I(O) {
                return typeof O == "number";
            }
            t.isNumber = I;
            function D(O) {
                return typeof O == "string";
            }
            t.isString = D;
            function U(O) {
                return typeof O == "symbol";
            }
            t.isSymbol = U;
            function K(O) {
                return O === void 0;
            }
            t.isUndefined = K;
            function $(O) {
                return ne(O) && x(O) === "[object RegExp]";
            }
            t.isRegExp = $, t.types.isRegExp = $;
            function ne(O) {
                return typeof O == "object" && O !== null;
            }
            t.isObject = ne;
            function te(O) {
                return ne(O) && x(O) === "[object Date]";
            }
            t.isDate = te, t.types.isDate = te;
            function J(O) {
                return ne(O) && (x(O) === "[object Error]" || O instanceof Error);
            }
            t.isError = J, t.types.isNativeError = J;
            function C(O) {
                return typeof O == "function";
            }
            t.isFunction = C;
            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 = gat();
            function x(O) {
                return Object.prototype.toString.call(O);
            }
            function A(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, W = [
                    A(O.getHours()),
                    A(O.getMinutes()),
                    A(O.getSeconds())
                ].join(":");
                return [
                    O.getDate(),
                    R[O.getMonth()],
                    W
                ].join(" ");
            }
            t.log = function() {
                N(), t.format.apply(t, arguments);
            }, t.inherits = bat(), t._extend = function(O, W) {
                if (!W || !ne(W)) return O;
                for(var F = Object.keys(W), G = F.length; G--;)O[F[G]] = W[F[G]];
                return O;
            };
            function L(O, W) {
                return Object.prototype.hasOwnProperty.call(O, W);
            }
            var z = typeof Symbol < "u" ? Symbol("util.promisify.custom") : void 0;
            t.promisify = function(W) {
                if (typeof W != "function") throw new TypeError('The "original" argument must be of type Function');
                if (z && W[z]) {
                    var F = W[z];
                    if (typeof F != "function") throw new TypeError('The "util.promisify.custom" argument must be of type Function');
                    return Object.defineProperty(F, z, {
                        value: F,
                        enumerable: !1,
                        writable: !1,
                        configurable: !0
                    }), F;
                }
                function F() {
                    for(var G, ee, Q = new Promise(function(de, pe) {
                        G = de, ee = pe;
                    }), Y = [], ae = 0; ae < arguments.length; ae++)Y.push(arguments[ae]);
                    Y.push(function(de, pe) {
                        de ? ee(de) : G(pe);
                    });
                    try {
                        W.apply(this, Y);
                    } catch (de) {
                        ee(de);
                    }
                    return Q;
                }
                return Object.setPrototypeOf(F, Object.getPrototypeOf(W)), z && Object.defineProperty(F, z, {
                    value: F,
                    enumerable: !1,
                    writable: !1,
                    configurable: !0
                }), Object.defineProperties(F, n(W));
            }, t.promisify.custom = z;
            function B(O, W) {
                if (!O) {
                    var F = new Error("Promise was rejected with a falsy value");
                    F.reason = O, O = F;
                }
                return W(O);
            }
            function S(O) {
                if (typeof O != "function") throw new TypeError('The "original" argument must be of type Function');
                function W() {
                    for(var F = [], G = 0; G < arguments.length; G++)F.push(arguments[G]);
                    var ee = F.pop();
                    if (typeof ee != "function") throw new TypeError("The last argument must be of type Function");
                    var Q = this, Y = function() {
                        return ee.apply(Q, arguments);
                    };
                    O.apply(this, F).then(function(ae) {
                        process.nextTick(Y.bind(null, null, ae));
                    }, function(ae) {
                        process.nextTick(B.bind(null, ae, Y));
                    });
                }
                return Object.setPrototypeOf(W, Object.getPrototypeOf(O)), Object.defineProperties(W, n(O)), W;
            }
            t.callbackify = S;
        })(v4)), v4;
    }
    var Az;
    function Ste() {
        if (Az) return x4;
        Az = 1;
        function t(v) {
            "@babel/helpers - typeof";
            return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(w) {
                return typeof w;
            } : function(w) {
                return w && typeof Symbol == "function" && w.constructor === Symbol && w !== Symbol.prototype ? "symbol" : typeof w;
            }, t(v);
        }
        function e(v, w, E) {
            return Object.defineProperty(v, "prototype", {
                writable: !1
            }), v;
        }
        function n(v, w) {
            if (!(v instanceof w)) throw new TypeError("Cannot call a class as a function");
        }
        function r(v, w) {
            if (typeof w != "function" && w !== null) throw new TypeError("Super expression must either be null or a function");
            v.prototype = Object.create(w && w.prototype, {
                constructor: {
                    value: v,
                    writable: !0,
                    configurable: !0
                }
            }), Object.defineProperty(v, "prototype", {
                writable: !1
            }), w && s(v, w);
        }
        function s(v, w) {
            return s = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(I, D) {
                return I.__proto__ = D, I;
            }, s(v, w);
        }
        function i(v) {
            var w = c();
            return function() {
                var I = l(v), D;
                if (w) {
                    var U = l(this).constructor;
                    D = Reflect.construct(I, arguments, U);
                } else D = I.apply(this, arguments);
                return o(this, D);
            };
        }
        function o(v, w) {
            if (w && (t(w) === "object" || typeof w == "function")) return w;
            if (w !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
            return a(v);
        }
        function a(v) {
            if (v === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
            return v;
        }
        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(v) {
            return l = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(E) {
                return E.__proto__ || Object.getPrototypeOf(E);
            }, l(v);
        }
        var u = {}, d, f;
        function p(v, w, E) {
            E || (E = Error);
            function I(U, K, $) {
                return typeof w == "string" ? w : w(U, K, $);
            }
            var D = (function(U) {
                r($, U);
                var K = i($);
                function $(ne, te, J) {
                    var C;
                    return n(this, $), C = K.call(this, I(ne, te, J)), C.code = v, C;
                }
                return e($);
            })(E);
            u[v] = D;
        }
        function h(v, w) {
            if (Array.isArray(v)) {
                var E = v.length;
                return v = v.map(function(I) {
                    return String(I);
                }), E > 2 ? "one of ".concat(w, " ").concat(v.slice(0, E - 1).join(", "), ", or ") + v[E - 1] : E === 2 ? "one of ".concat(w, " ").concat(v[0], " or ").concat(v[1]) : "of ".concat(w, " ").concat(v[0]);
            } else return "of ".concat(w, " ").concat(String(v));
        }
        function b(v, w, E) {
            return v.substr(0, w.length) === w;
        }
        function y(v, w, E) {
            return (E === void 0 || E > v.length) && (E = v.length), v.substring(E - w.length, E) === w;
        }
        function _(v, w, E) {
            return typeof E != "number" && (E = 0), E + w.length > v.length ? !1 : v.indexOf(w, E) !== -1;
        }
        return p("ERR_AMBIGUOUS_ARGUMENT", 'The "%s" argument is ambiguous. %s', TypeError), p("ERR_INVALID_ARG_TYPE", function(v, w, E) {
            d === void 0 && (d = au()), d(typeof v == "string", "'name' must be a string");
            var I;
            typeof w == "string" && b(w, "not ") ? (I = "must not be", w = w.replace(/^not /, "")) : I = "must be";
            var D;
            if (y(v, " argument")) D = "The ".concat(v, " ").concat(I, " ").concat(h(w, "type"));
            else {
                var U = _(v, ".") ? "property" : "argument";
                D = 'The "'.concat(v, '" ').concat(U, " ").concat(I, " ").concat(h(w, "type"));
            }
            return D += ". Received type ".concat(t(E)), D;
        }, TypeError), p("ERR_INVALID_ARG_VALUE", function(v, w) {
            var E = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "is invalid";
            f === void 0 && (f = Zy());
            var I = f.inspect(w);
            return I.length > 128 && (I = "".concat(I.slice(0, 128), "...")), "The argument '".concat(v, "' ").concat(E, ". Received ").concat(I);
        }, TypeError), p("ERR_INVALID_RETURN_VALUE", function(v, w, E) {
            var I;
            return E && E.constructor && E.constructor.name ? I = "instance of ".concat(E.constructor.name) : I = "type ".concat(t(E)), "Expected ".concat(v, ' to be returned from the "').concat(w, '"') + " function but got ".concat(I, ".");
        }, TypeError), p("ERR_MISSING_ARGS", function() {
            for(var v = arguments.length, w = new Array(v), E = 0; E < v; E++)w[E] = arguments[E];
            d === void 0 && (d = au()), d(w.length > 0, "At least one arg needs to be specified");
            var I = "The ", D = w.length;
            switch(w = w.map(function(U) {
                return '"'.concat(U, '"');
            }), D){
                case 1:
                    I += "".concat(w[0], " argument");
                    break;
                case 2:
                    I += "".concat(w[0], " and ").concat(w[1], " arguments");
                    break;
                default:
                    I += w.slice(0, D - 1).join(", "), I += ", and ".concat(w[D - 1], " arguments");
                    break;
            }
            return "".concat(I, " must be specified");
        }, TypeError), x4.codes = u, x4;
    }
    var S7, Pz;
    function mat() {
        if (Pz) return S7;
        Pz = 1;
        function t(L, z) {
            var B = Object.keys(L);
            if (Object.getOwnPropertySymbols) {
                var S = Object.getOwnPropertySymbols(L);
                z && (S = S.filter(function(O) {
                    return Object.getOwnPropertyDescriptor(L, O).enumerable;
                })), B.push.apply(B, S);
            }
            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(S) {
                    n(L, S, B[S]);
                }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(L, Object.getOwnPropertyDescriptors(B)) : t(Object(B)).forEach(function(S) {
                    Object.defineProperty(L, S, Object.getOwnPropertyDescriptor(B, S));
                });
            }
            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 S = z[B];
                S.enumerable = S.enumerable || !1, S.configurable = !0, "value" in S && (S.writable = !0), Object.defineProperty(L, o(S.key), S);
            }
        }
        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 v(z) === "symbol" ? z : String(z);
        }
        function a(L, z) {
            if (v(L) !== "object" || L === null) return L;
            var B = L[Symbol.toPrimitive];
            if (B !== void 0) {
                var S = B.call(L, z);
                if (v(S) !== "object") return S;
                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 && y(L, z);
        }
        function l(L) {
            var z = h();
            return function() {
                var S = _(L), O;
                if (z) {
                    var W = _(this).constructor;
                    O = Reflect.construct(S, arguments, W);
                } else O = S.apply(this, arguments);
                return u(this, O);
            };
        }
        function u(L, z) {
            if (z && (v(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(S) {
                if (S === null || !b(S)) return S;
                if (typeof S != "function") throw new TypeError("Super expression must either be null or a function");
                if (typeof z < "u") {
                    if (z.has(S)) return z.get(S);
                    z.set(S, O);
                }
                function O() {
                    return p(S, arguments, _(this).constructor);
                }
                return O.prototype = Object.create(S.prototype, {
                    constructor: {
                        value: O,
                        enumerable: !1,
                        writable: !0,
                        configurable: !0
                    }
                }), y(O, S);
            }, f(L);
        }
        function p(L, z, B) {
            return h() ? p = Reflect.construct.bind() : p = function(O, W, F) {
                var G = [
                    null
                ];
                G.push.apply(G, W);
                var ee = Function.bind.apply(O, G), Q = new ee;
                return F && y(Q, F.prototype), Q;
            }, 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 b(L) {
            return Function.toString.call(L).indexOf("[native code]") !== -1;
        }
        function y(L, z) {
            return y = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(S, O) {
                return S.__proto__ = O, S;
            }, y(L, z);
        }
        function _(L) {
            return _ = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(B) {
                return B.__proto__ || Object.getPrototypeOf(B);
            }, _(L);
        }
        function v(L) {
            "@babel/helpers - typeof";
            return v = 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;
            }, v(L);
        }
        var w = Zy(), E = w.inspect, I = Ste(), D = I.codes.ERR_INVALID_ARG_TYPE;
        function U(L, z, B) {
            return (B === void 0 || B > L.length) && (B = L.length), L.substring(B - z.length, B) === z;
        }
        function K(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 $ = "", ne = "", te = "", J = "", C = {
            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 x(L) {
            var z = Object.keys(L), B = Object.create(Object.getPrototypeOf(L));
            return z.forEach(function(S) {
                B[S] = L[S];
            }), Object.defineProperty(B, "message", {
                value: L.message
            }), B;
        }
        function A(L) {
            return E(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 S = "", O = "", W = 0, F = "", G = !1, ee = A(L), Q = ee.split(`
`), Y = A(z).split(`
`), ae = 0, de = "";
            if (B === "strictEqual" && v(L) === "object" && v(z) === "object" && L !== null && z !== null && (B = "strictEqualObject"), Q.length === 1 && Y.length === 1 && Q[0] !== Y[0]) {
                var pe = Q[0].length + Y[0].length;
                if (pe <= g) {
                    if ((v(L) !== "object" || L === null) && (v(z) !== "object" || z === null) && (L !== 0 || z !== 0)) return "".concat(C[B], `

`) + "".concat(Q[0], " !== ").concat(Y[0], `
`);
                } else if (B !== "strictEqualObject") {
                    var Ae = process.stderr && process.stderr.isTTY ? process.stderr.columns : 80;
                    if (pe < Ae) {
                        for(; Q[0][ae] === Y[0][ae];)ae++;
                        ae > 2 && (de = `
  `.concat(K(" ", ae), "^"), ae = 0);
                    }
                }
            }
            for(var Oe = Q[Q.length - 1], Re = Y[Y.length - 1]; Oe === Re && (ae++ < 2 ? F = `
  `.concat(Oe).concat(F) : S = Oe, Q.pop(), Y.pop(), !(Q.length === 0 || Y.length === 0));)Oe = Q[Q.length - 1], Re = Y[Y.length - 1];
            var Me = Math.max(Q.length, Y.length);
            if (Me === 0) {
                var Je = ee.split(`
`);
                if (Je.length > 30) for(Je[26] = "".concat($, "...").concat(J); Je.length > 27;)Je.pop();
                return "".concat(C.notIdentical, `

`).concat(Je.join(`
`), `
`);
            }
            ae > 3 && (F = `
`.concat($, "...").concat(J).concat(F), G = !0), S !== "" && (F = `
  `.concat(S).concat(F), S = "");
            var Ee = 0, le = C[B] + `
`.concat(ne, "+ actual").concat(J, " ").concat(te, "- expected").concat(J), qe = " ".concat($, "...").concat(J, " Lines skipped");
            for(ae = 0; ae < Me; ae++){
                var Ye = ae - W;
                if (Q.length < ae + 1) Ye > 1 && ae > 2 && (Ye > 4 ? (O += `
`.concat($, "...").concat(J), G = !0) : Ye > 3 && (O += `
  `.concat(Y[ae - 2]), Ee++), O += `
  `.concat(Y[ae - 1]), Ee++), W = ae, S += `
`.concat(te, "-").concat(J, " ").concat(Y[ae]), Ee++;
                else if (Y.length < ae + 1) Ye > 1 && ae > 2 && (Ye > 4 ? (O += `
`.concat($, "...").concat(J), G = !0) : Ye > 3 && (O += `
  `.concat(Q[ae - 2]), Ee++), O += `
  `.concat(Q[ae - 1]), Ee++), W = ae, O += `
`.concat(ne, "+").concat(J, " ").concat(Q[ae]), Ee++;
                else {
                    var ut = Y[ae], Ce = Q[ae], oe = Ce !== ut && (!U(Ce, ",") || Ce.slice(0, -1) !== ut);
                    oe && U(ut, ",") && ut.slice(0, -1) === Ce && (oe = !1, Ce += ","), oe ? (Ye > 1 && ae > 2 && (Ye > 4 ? (O += `
`.concat($, "...").concat(J), G = !0) : Ye > 3 && (O += `
  `.concat(Q[ae - 2]), Ee++), O += `
  `.concat(Q[ae - 1]), Ee++), W = ae, O += `
`.concat(ne, "+").concat(J, " ").concat(Ce), S += `
`.concat(te, "-").concat(J, " ").concat(ut), Ee += 2) : (O += S, S = "", (Ye === 1 || ae === 0) && (O += `
  `.concat(Ce), Ee++));
                }
                if (Ee > 20 && ae < Me - 2) return "".concat(le).concat(qe, `
`).concat(O, `
`).concat($, "...").concat(J).concat(S, `
`) + "".concat($, "...").concat(J);
            }
            return "".concat(le).concat(G ? qe : "", `
`).concat(O).concat(S).concat(F).concat(de);
        }
        var N = (function(L, z) {
            c(S, L);
            var B = l(S);
            function S(O) {
                var W;
                if (r(this, S), v(O) !== "object" || O === null) throw new D("options", "Object", O);
                var F = O.message, G = O.operator, ee = O.stackStartFn, Q = O.actual, Y = O.expected, ae = Error.stackTraceLimit;
                if (Error.stackTraceLimit = 0, F != null) W = B.call(this, String(F));
                else if (process.stderr && process.stderr.isTTY && (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1 ? ($ = "\x1B[34m", ne = "\x1B[32m", J = "\x1B[39m", te = "\x1B[31m") : ($ = "", ne = "", J = "", te = "")), v(Q) === "object" && Q !== null && v(Y) === "object" && Y !== null && "stack" in Q && Q instanceof Error && "stack" in Y && Y instanceof Error && (Q = x(Q), Y = x(Y)), G === "deepStrictEqual" || G === "strictEqual") W = B.call(this, R(Q, Y, G));
                else if (G === "notDeepStrictEqual" || G === "notStrictEqual") {
                    var de = C[G], pe = A(Q).split(`
`);
                    if (G === "notStrictEqual" && v(Q) === "object" && Q !== null && (de = C.notStrictEqualObject), pe.length > 30) for(pe[26] = "".concat($, "...").concat(J); pe.length > 27;)pe.pop();
                    pe.length === 1 ? W = B.call(this, "".concat(de, " ").concat(pe[0])) : W = B.call(this, "".concat(de, `

`).concat(pe.join(`
`), `
`));
                } else {
                    var Ae = A(Q), Oe = "", Re = C[G];
                    G === "notDeepEqual" || G === "notEqual" ? (Ae = "".concat(C[G], `

`).concat(Ae), Ae.length > 1024 && (Ae = "".concat(Ae.slice(0, 1021), "..."))) : (Oe = "".concat(A(Y)), Ae.length > 512 && (Ae = "".concat(Ae.slice(0, 509), "...")), Oe.length > 512 && (Oe = "".concat(Oe.slice(0, 509), "...")), G === "deepEqual" || G === "equal" ? Ae = "".concat(Re, `

`).concat(Ae, `

should equal

`) : Oe = " ".concat(G, " ").concat(Oe)), W = B.call(this, "".concat(Ae).concat(Oe));
                }
                return Error.stackTraceLimit = ae, W.generatedMessage = !F, Object.defineProperty(d(W), "name", {
                    value: "AssertionError [ERR_ASSERTION]",
                    enumerable: !1,
                    writable: !0,
                    configurable: !0
                }), W.code = "ERR_ASSERTION", W.actual = Q, W.expected = Y, W.operator = G, Error.captureStackTrace && Error.captureStackTrace(d(W), ee), W.stack, W.name = "AssertionError", u(W);
            }
            return i(S, [
                {
                    key: "toString",
                    value: function() {
                        return "".concat(this.name, " [").concat(this.code, "]: ").concat(this.message);
                    }
                },
                {
                    key: z,
                    value: function(W, F) {
                        return E(this, e(e({}, F), {}, {
                            customInspect: !1,
                            depth: 0
                        }));
                    }
                }
            ]), S;
        })(f(Error), E.custom);
        return S7 = N, S7;
    }
    var k7, Oz;
    function kte() {
        if (Oz) return k7;
        Oz = 1;
        var t = Object.prototype.toString;
        return k7 = 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;
        }, k7;
    }
    var T7, Mz;
    function yat() {
        if (Mz) return T7;
        Mz = 1;
        var t;
        if (!Object.keys) {
            var e = Object.prototype.hasOwnProperty, n = Object.prototype.toString, r = kte(), 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", b = n.call(p) === "[object Function]", y = r(p), _ = h && n.call(p) === "[object String]", v = [];
                if (!h && !b && !y) throw new TypeError("Object.keys called on a non-object");
                var w = o && b;
                if (_ && p.length > 0 && !e.call(p, 0)) for(var E = 0; E < p.length; ++E)v.push(String(E));
                if (y && p.length > 0) for(var I = 0; I < p.length; ++I)v.push(String(I));
                else for(var D in p)!(w && D === "prototype") && e.call(p, D) && v.push(String(D));
                if (i) for(var U = d(p), K = 0; K < a.length; ++K)!(U && a[K] === "constructor") && e.call(p, a[K]) && v.push(a[K]);
                return v;
            };
        }
        return T7 = t, T7;
    }
    var E7, Rz;
    function Tte() {
        if (Rz) return E7;
        Rz = 1;
        var t = Array.prototype.slice, e = kte(), n = Object.keys, r = n ? function(o) {
            return n(o);
        } : yat(), 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;
        }, E7 = r, E7;
    }
    var C7, Nz;
    function wat() {
        if (Nz) return C7;
        Nz = 1;
        var t = Tte(), e = bO()(), n = yb(), r = mO(), s = n("Array.prototype.push"), i = n("Object.prototype.propertyIsEnumerable"), o = e ? r.getOwnPropertySymbols : null;
        return C7 = 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 b = h(f), y = 0; y < b.length; ++y){
                    var _ = b[y];
                    i(f, _) && s(p, _);
                }
                for(var v = 0; v < p.length; ++v){
                    var w = p[v];
                    if (i(f, w)) {
                        var E = f[w];
                        u[w] = E;
                    }
                }
            }
            return u;
        }, C7;
    }
    var I7, Vz;
    function _at() {
        if (Vz) return I7;
        Vz = 1;
        var t = wat(), 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 I7 = function() {
            return !Object.assign || e() || n() ? t : Object.assign;
        }, I7;
    }
    var A7, Bz;
    function Ete() {
        if (Bz) return A7;
        Bz = 1;
        var t = function(e) {
            return e !== e;
        };
        return A7 = function(n, r) {
            return n === 0 && r === 0 ? 1 / n === 1 / r : !!(n === r || t(n) && t(r));
        }, A7;
    }
    var P7, Dz;
    function SO() {
        if (Dz) return P7;
        Dz = 1;
        var t = Ete();
        return P7 = function() {
            return typeof Object.is == "function" ? Object.is : t;
        }, P7;
    }
    var O7, Fz;
    function xat() {
        if (Fz) return O7;
        Fz = 1;
        var t = vO(), e = H5(), n = e(t("String.prototype.indexOf"));
        return O7 = function(s, i) {
            var o = t(s, !!i);
            return typeof o == "function" && n(s, ".prototype.") > -1 ? e(o) : o;
        }, O7;
    }
    var M7, Lz;
    function j5() {
        if (Lz) return M7;
        Lz = 1;
        var t = Tte(), e = typeof Symbol == "function" && typeof Symbol("foo") == "symbol", n = Object.prototype.toString, r = Array.prototype.concat, s = _te(), i = function(l) {
            return typeof l == "function" && n.call(l) === "[object Function]";
        }, o = xte()(), 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, M7 = c, M7;
    }
    var R7, zz;
    function vat() {
        if (zz) return R7;
        zz = 1;
        var t = SO(), e = j5();
        return R7 = function() {
            var r = t();
            return e(Object, {
                is: r
            }, {
                is: function() {
                    return Object.is !== r;
                }
            }), r;
        }, R7;
    }
    var N7, Uz;
    function Sat() {
        if (Uz) return N7;
        Uz = 1;
        var t = j5(), e = H5(), n = Ete(), r = SO(), s = vat(), i = e(r(), Object);
        return t(i, {
            getPolyfill: r,
            implementation: n,
            shim: s
        }), N7 = i, N7;
    }
    var V7, Hz;
    function Cte() {
        return Hz || (Hz = 1, V7 = function(e) {
            return e !== e;
        }), V7;
    }
    var B7, jz;
    function Ite() {
        if (jz) return B7;
        jz = 1;
        var t = Cte();
        return B7 = function() {
            return Number.isNaN && Number.isNaN(NaN) && !Number.isNaN("a") ? Number.isNaN : t;
        }, B7;
    }
    var D7, qz;
    function kat() {
        if (qz) return D7;
        qz = 1;
        var t = j5(), e = Ite();
        return D7 = function() {
            var r = e();
            return t(Number, {
                isNaN: r
            }, {
                isNaN: function() {
                    return Number.isNaN !== r;
                }
            }), r;
        }, D7;
    }
    var F7, Kz;
    function Tat() {
        if (Kz) return F7;
        Kz = 1;
        var t = H5(), e = j5(), n = Cte(), r = Ite(), s = kat(), i = t(r(), Number);
        return e(i, {
            getPolyfill: r,
            implementation: n,
            shim: s
        }), F7 = i, F7;
    }
    var L7, Wz;
    function Eat() {
        if (Wz) return L7;
        Wz = 1;
        function t(oe, ue) {
            return i(oe) || s(oe, ue) || n(oe, ue) || 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(oe, ue) {
            if (oe) {
                if (typeof oe == "string") return r(oe, ue);
                var Ie = Object.prototype.toString.call(oe).slice(8, -1);
                if (Ie === "Object" && oe.constructor && (Ie = oe.constructor.name), Ie === "Map" || Ie === "Set") return Array.from(oe);
                if (Ie === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ie)) return r(oe, ue);
            }
        }
        function r(oe, ue) {
            (ue == null || ue > oe.length) && (ue = oe.length);
            for(var Ie = 0, H = new Array(ue); Ie < ue; Ie++)H[Ie] = oe[Ie];
            return H;
        }
        function s(oe, ue) {
            var Ie = oe == null ? null : typeof Symbol < "u" && oe[Symbol.iterator] || oe["@@iterator"];
            if (Ie != null) {
                var H, T, P, Z, ie = [], ce = !0, be = !1;
                try {
                    if (P = (Ie = Ie.call(oe)).next, ue !== 0) for(; !(ce = (H = P.call(Ie)).done) && (ie.push(H.value), ie.length !== ue); ce = !0);
                } catch (yt) {
                    be = !0, T = yt;
                } finally{
                    try {
                        if (!ce && Ie.return != null && (Z = Ie.return(), Object(Z) !== Z)) return;
                    } finally{
                        if (be) throw T;
                    }
                }
                return ie;
            }
        }
        function i(oe) {
            if (Array.isArray(oe)) return oe;
        }
        function o(oe) {
            "@babel/helpers - typeof";
            return o = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(ue) {
                return typeof ue;
            } : function(ue) {
                return ue && typeof Symbol == "function" && ue.constructor === Symbol && ue !== Symbol.prototype ? "symbol" : typeof ue;
            }, o(oe);
        }
        var a = /a/g.flags !== void 0, c = function(ue) {
            var Ie = [];
            return ue.forEach(function(H) {
                return Ie.push(H);
            }), Ie;
        }, l = function(ue) {
            var Ie = [];
            return ue.forEach(function(H, T) {
                return Ie.push([
                    T,
                    H
                ]);
            }), Ie;
        }, u = Object.is ? Object.is : Sat(), d = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function() {
            return [];
        }, f = Number.isNaN ? Number.isNaN : Tat();
        function p(oe) {
            return oe.call.bind(oe);
        }
        var h = p(Object.prototype.hasOwnProperty), b = p(Object.prototype.propertyIsEnumerable), y = p(Object.prototype.toString), _ = Zy().types, v = _.isAnyArrayBuffer, w = _.isArrayBufferView, E = _.isDate, I = _.isMap, D = _.isRegExp, U = _.isSet, K = _.isNativeError, $ = _.isBoxedPrimitive, ne = _.isNumberObject, te = _.isStringObject, J = _.isBooleanObject, C = _.isBigIntObject, g = _.isSymbolObject, x = _.isFloat32Array, A = _.isFloat64Array;
        function R(oe) {
            if (oe.length === 0 || oe.length > 10) return !0;
            for(var ue = 0; ue < oe.length; ue++){
                var Ie = oe.charCodeAt(ue);
                if (Ie < 48 || Ie > 57) return !0;
            }
            return oe.length === 10 && oe >= Math.pow(2, 32);
        }
        function N(oe) {
            return Object.keys(oe).filter(R).concat(d(oe).filter(Object.prototype.propertyIsEnumerable.bind(oe)));
        }
        function L(oe, ue) {
            if (oe === ue) return 0;
            for(var Ie = oe.length, H = ue.length, T = 0, P = Math.min(Ie, H); T < P; ++T)if (oe[T] !== ue[T]) {
                Ie = oe[T], H = ue[T];
                break;
            }
            return Ie < H ? -1 : H < Ie ? 1 : 0;
        }
        var z = !0, B = !1, S = 0, O = 1, W = 2, F = 3;
        function G(oe, ue) {
            return a ? oe.source === ue.source && oe.flags === ue.flags : RegExp.prototype.toString.call(oe) === RegExp.prototype.toString.call(ue);
        }
        function ee(oe, ue) {
            if (oe.byteLength !== ue.byteLength) return !1;
            for(var Ie = 0; Ie < oe.byteLength; Ie++)if (oe[Ie] !== ue[Ie]) return !1;
            return !0;
        }
        function Q(oe, ue) {
            return oe.byteLength !== ue.byteLength ? !1 : L(new Uint8Array(oe.buffer, oe.byteOffset, oe.byteLength), new Uint8Array(ue.buffer, ue.byteOffset, ue.byteLength)) === 0;
        }
        function Y(oe, ue) {
            return oe.byteLength === ue.byteLength && L(new Uint8Array(oe), new Uint8Array(ue)) === 0;
        }
        function ae(oe, ue) {
            return ne(oe) ? ne(ue) && u(Number.prototype.valueOf.call(oe), Number.prototype.valueOf.call(ue)) : te(oe) ? te(ue) && String.prototype.valueOf.call(oe) === String.prototype.valueOf.call(ue) : J(oe) ? J(ue) && Boolean.prototype.valueOf.call(oe) === Boolean.prototype.valueOf.call(ue) : C(oe) ? C(ue) && BigInt.prototype.valueOf.call(oe) === BigInt.prototype.valueOf.call(ue) : g(ue) && Symbol.prototype.valueOf.call(oe) === Symbol.prototype.valueOf.call(ue);
        }
        function de(oe, ue, Ie, H) {
            if (oe === ue) return oe !== 0 ? !0 : Ie ? u(oe, ue) : !0;
            if (Ie) {
                if (o(oe) !== "object") return typeof oe == "number" && f(oe) && f(ue);
                if (o(ue) !== "object" || oe === null || ue === null || Object.getPrototypeOf(oe) !== Object.getPrototypeOf(ue)) return !1;
            } else {
                if (oe === null || o(oe) !== "object") return ue === null || o(ue) !== "object" ? oe == ue : !1;
                if (ue === null || o(ue) !== "object") return !1;
            }
            var T = y(oe), P = y(ue);
            if (T !== P) return !1;
            if (Array.isArray(oe)) {
                if (oe.length !== ue.length) return !1;
                var Z = N(oe), ie = N(ue);
                return Z.length !== ie.length ? !1 : Ae(oe, ue, Ie, H, O, Z);
            }
            if (T === "[object Object]" && (!I(oe) && I(ue) || !U(oe) && U(ue))) return !1;
            if (E(oe)) {
                if (!E(ue) || Date.prototype.getTime.call(oe) !== Date.prototype.getTime.call(ue)) return !1;
            } else if (D(oe)) {
                if (!D(ue) || !G(oe, ue)) return !1;
            } else if (K(oe) || oe instanceof Error) {
                if (oe.message !== ue.message || oe.name !== ue.name) return !1;
            } else if (w(oe)) {
                if (!Ie && (x(oe) || A(oe))) {
                    if (!ee(oe, ue)) return !1;
                } else if (!Q(oe, ue)) return !1;
                var ce = N(oe), be = N(ue);
                return ce.length !== be.length ? !1 : Ae(oe, ue, Ie, H, S, ce);
            } else {
                if (U(oe)) return !U(ue) || oe.size !== ue.size ? !1 : Ae(oe, ue, Ie, H, W);
                if (I(oe)) return !I(ue) || oe.size !== ue.size ? !1 : Ae(oe, ue, Ie, H, F);
                if (v(oe)) {
                    if (!Y(oe, ue)) return !1;
                } else if ($(oe) && !ae(oe, ue)) return !1;
            }
            return Ae(oe, ue, Ie, H, S);
        }
        function pe(oe, ue) {
            return ue.filter(function(Ie) {
                return b(oe, Ie);
            });
        }
        function Ae(oe, ue, Ie, H, T, P) {
            if (arguments.length === 5) {
                P = Object.keys(oe);
                var Z = Object.keys(ue);
                if (P.length !== Z.length) return !1;
            }
            for(var ie = 0; ie < P.length; ie++)if (!h(ue, P[ie])) return !1;
            if (Ie && arguments.length === 5) {
                var ce = d(oe);
                if (ce.length !== 0) {
                    var be = 0;
                    for(ie = 0; ie < ce.length; ie++){
                        var yt = ce[ie];
                        if (b(oe, yt)) {
                            if (!b(ue, yt)) return !1;
                            P.push(yt), be++;
                        } else if (b(ue, yt)) return !1;
                    }
                    var Et = d(ue);
                    if (ce.length !== Et.length && pe(ue, Et).length !== be) return !1;
                } else {
                    var dt = d(ue);
                    if (dt.length !== 0 && pe(ue, dt).length !== 0) return !1;
                }
            }
            if (P.length === 0 && (T === S || T === O && oe.length === 0 || oe.size === 0)) return !0;
            if (H === void 0) H = {
                val1: new Map,
                val2: new Map,
                position: 0
            };
            else {
                var Kt = H.val1.get(oe);
                if (Kt !== void 0) {
                    var tt = H.val2.get(ue);
                    if (tt !== void 0) return Kt === tt;
                }
                H.position++;
            }
            H.val1.set(oe, H.position), H.val2.set(ue, H.position);
            var vt = Ye(oe, ue, Ie, P, H, T);
            return H.val1.delete(oe), H.val2.delete(ue), vt;
        }
        function Oe(oe, ue, Ie, H) {
            for(var T = c(oe), P = 0; P < T.length; P++){
                var Z = T[P];
                if (de(ue, Z, Ie, H)) return oe.delete(Z), !0;
            }
            return !1;
        }
        function Re(oe) {
            switch(o(oe)){
                case "undefined":
                    return null;
                case "object":
                    return;
                case "symbol":
                    return !1;
                case "string":
                    oe = +oe;
                case "number":
                    if (f(oe)) return !1;
            }
            return !0;
        }
        function Me(oe, ue, Ie) {
            var H = Re(Ie);
            return H ?? (ue.has(H) && !oe.has(H));
        }
        function Je(oe, ue, Ie, H, T) {
            var P = Re(Ie);
            if (P != null) return P;
            var Z = ue.get(P);
            return Z === void 0 && !ue.has(P) || !de(H, Z, !1, T) ? !1 : !oe.has(P) && de(H, Z, !1, T);
        }
        function Ee(oe, ue, Ie, H) {
            for(var T = null, P = c(oe), Z = 0; Z < P.length; Z++){
                var ie = P[Z];
                if (o(ie) === "object" && ie !== null) T === null && (T = new Set), T.add(ie);
                else if (!ue.has(ie)) {
                    if (Ie || !Me(oe, ue, ie)) return !1;
                    T === null && (T = new Set), T.add(ie);
                }
            }
            if (T !== null) {
                for(var ce = c(ue), be = 0; be < ce.length; be++){
                    var yt = ce[be];
                    if (o(yt) === "object" && yt !== null) {
                        if (!Oe(T, yt, Ie, H)) return !1;
                    } else if (!Ie && !oe.has(yt) && !Oe(T, yt, Ie, H)) return !1;
                }
                return T.size === 0;
            }
            return !0;
        }
        function le(oe, ue, Ie, H, T, P) {
            for(var Z = c(oe), ie = 0; ie < Z.length; ie++){
                var ce = Z[ie];
                if (de(Ie, ce, T, P) && de(H, ue.get(ce), T, P)) return oe.delete(ce), !0;
            }
            return !1;
        }
        function qe(oe, ue, Ie, H) {
            for(var T = null, P = l(oe), Z = 0; Z < P.length; Z++){
                var ie = t(P[Z], 2), ce = ie[0], be = ie[1];
                if (o(ce) === "object" && ce !== null) T === null && (T = new Set), T.add(ce);
                else {
                    var yt = ue.get(ce);
                    if (yt === void 0 && !ue.has(ce) || !de(be, yt, Ie, H)) {
                        if (Ie || !Je(oe, ue, ce, be, H)) return !1;
                        T === null && (T = new Set), T.add(ce);
                    }
                }
            }
            if (T !== null) {
                for(var Et = l(ue), dt = 0; dt < Et.length; dt++){
                    var Kt = t(Et[dt], 2), tt = Kt[0], vt = Kt[1];
                    if (o(tt) === "object" && tt !== null) {
                        if (!le(T, oe, tt, vt, Ie, H)) return !1;
                    } else if (!Ie && (!oe.has(tt) || !de(oe.get(tt), vt, !1, H)) && !le(T, oe, tt, vt, !1, H)) return !1;
                }
                return T.size === 0;
            }
            return !0;
        }
        function Ye(oe, ue, Ie, H, T, P) {
            var Z = 0;
            if (P === W) {
                if (!Ee(oe, ue, Ie, T)) return !1;
            } else if (P === F) {
                if (!qe(oe, ue, Ie, T)) return !1;
            } else if (P === O) for(; Z < oe.length; Z++)if (h(oe, Z)) {
                if (!h(ue, Z) || !de(oe[Z], ue[Z], Ie, T)) return !1;
            } else {
                if (h(ue, Z)) return !1;
                for(var ie = Object.keys(oe); Z < ie.length; Z++){
                    var ce = ie[Z];
                    if (!h(ue, ce) || !de(oe[ce], ue[ce], Ie, T)) return !1;
                }
                return ie.length === Object.keys(ue).length;
            }
            for(Z = 0; Z < H.length; Z++){
                var be = H[Z];
                if (!de(oe[be], ue[be], Ie, T)) return !1;
            }
            return !0;
        }
        function ut(oe, ue) {
            return de(oe, ue, B);
        }
        function Ce(oe, ue) {
            return de(oe, ue, z);
        }
        return L7 = {
            isDeepEqual: ut,
            isDeepStrictEqual: Ce
        }, L7;
    }
    var $z;
    function au() {
        if ($z) return _4.exports;
        $z = 1;
        function t(W) {
            "@babel/helpers - typeof";
            return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(F) {
                return typeof F;
            } : function(F) {
                return F && typeof Symbol == "function" && F.constructor === Symbol && F !== Symbol.prototype ? "symbol" : typeof F;
            }, t(W);
        }
        function e(W, F, G) {
            return Object.defineProperty(W, "prototype", {
                writable: !1
            }), W;
        }
        function n(W, F) {
            if (!(W instanceof F)) throw new TypeError("Cannot call a class as a function");
        }
        var r = Ste(), 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 = mat(), d = Zy(), f = d.inspect, p = Zy().types, h = p.isPromise, b = p.isRegExp, y = _at()(), _ = SO()(), v = xat()("RegExp.prototype.test"), w, E;
        function I() {
            var W = Eat();
            w = W.isDeepEqual, E = W.isDeepStrictEqual;
        }
        var D = !1, U = _4.exports = J, K = {};
        function $(W) {
            throw W.message instanceof Error ? W.message : new u(W);
        }
        function ne(W, F, G, ee, Q) {
            var Y = arguments.length, ae;
            if (Y === 0) ae = "Failed";
            else if (Y === 1) G = W, W = void 0;
            else {
                if (D === !1) {
                    D = !0;
                    var de = process.emitWarning ? process.emitWarning : console.warn.bind(console);
                    de("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.", "DeprecationWarning", "DEP0094");
                }
                Y === 2 && (ee = "!=");
            }
            if (G instanceof Error) throw G;
            var pe = {
                actual: W,
                expected: F,
                operator: ee === void 0 ? "fail" : ee,
                stackStartFn: Q || ne
            };
            G !== void 0 && (pe.message = G);
            var Ae = new u(pe);
            throw ae && (Ae.message = ae, Ae.generatedMessage = !0), Ae;
        }
        U.fail = ne, U.AssertionError = u;
        function te(W, F, G, ee) {
            if (!G) {
                var Q = !1;
                if (F === 0) Q = !0, ee = "No value argument passed to `assert.ok()`";
                else if (ee instanceof Error) throw ee;
                var Y = new u({
                    actual: G,
                    expected: !0,
                    message: ee,
                    operator: "==",
                    stackStartFn: W
                });
                throw Y.generatedMessage = Q, Y;
            }
        }
        function J() {
            for(var W = arguments.length, F = new Array(W), G = 0; G < W; G++)F[G] = arguments[G];
            te.apply(void 0, [
                J,
                F.length
            ].concat(F));
        }
        U.ok = J, U.equal = function W(F, G, ee) {
            if (arguments.length < 2) throw new l("actual", "expected");
            F != G && $({
                actual: F,
                expected: G,
                message: ee,
                operator: "==",
                stackStartFn: W
            });
        }, U.notEqual = function W(F, G, ee) {
            if (arguments.length < 2) throw new l("actual", "expected");
            F == G && $({
                actual: F,
                expected: G,
                message: ee,
                operator: "!=",
                stackStartFn: W
            });
        }, U.deepEqual = function W(F, G, ee) {
            if (arguments.length < 2) throw new l("actual", "expected");
            w === void 0 && I(), w(F, G) || $({
                actual: F,
                expected: G,
                message: ee,
                operator: "deepEqual",
                stackStartFn: W
            });
        }, U.notDeepEqual = function W(F, G, ee) {
            if (arguments.length < 2) throw new l("actual", "expected");
            w === void 0 && I(), w(F, G) && $({
                actual: F,
                expected: G,
                message: ee,
                operator: "notDeepEqual",
                stackStartFn: W
            });
        }, U.deepStrictEqual = function W(F, G, ee) {
            if (arguments.length < 2) throw new l("actual", "expected");
            w === void 0 && I(), E(F, G) || $({
                actual: F,
                expected: G,
                message: ee,
                operator: "deepStrictEqual",
                stackStartFn: W
            });
        }, U.notDeepStrictEqual = C;
        function C(W, F, G) {
            if (arguments.length < 2) throw new l("actual", "expected");
            w === void 0 && I(), E(W, F) && $({
                actual: W,
                expected: F,
                message: G,
                operator: "notDeepStrictEqual",
                stackStartFn: C
            });
        }
        U.strictEqual = function W(F, G, ee) {
            if (arguments.length < 2) throw new l("actual", "expected");
            _(F, G) || $({
                actual: F,
                expected: G,
                message: ee,
                operator: "strictEqual",
                stackStartFn: W
            });
        }, U.notStrictEqual = function W(F, G, ee) {
            if (arguments.length < 2) throw new l("actual", "expected");
            _(F, G) && $({
                actual: F,
                expected: G,
                message: ee,
                operator: "notStrictEqual",
                stackStartFn: W
            });
        };
        var g = e(function W(F, G, ee) {
            var Q = this;
            n(this, W), G.forEach(function(Y) {
                Y in F && (ee !== void 0 && typeof ee[Y] == "string" && b(F[Y]) && v(F[Y], ee[Y]) ? Q[Y] = ee[Y] : Q[Y] = F[Y]);
            });
        });
        function x(W, F, G, ee, Q, Y) {
            if (!(G in W) || !E(W[G], F[G])) {
                if (!ee) {
                    var ae = new g(W, Q), de = new g(F, Q, W), pe = new u({
                        actual: ae,
                        expected: de,
                        operator: "deepStrictEqual",
                        stackStartFn: Y
                    });
                    throw pe.actual = W, pe.expected = F, pe.operator = Y.name, pe;
                }
                $({
                    actual: W,
                    expected: F,
                    message: ee,
                    operator: Y.name,
                    stackStartFn: Y
                });
            }
        }
        function A(W, F, G, ee) {
            if (typeof F != "function") {
                if (b(F)) return v(F, W);
                if (arguments.length === 2) throw new o("expected", [
                    "Function",
                    "RegExp"
                ], F);
                if (t(W) !== "object" || W === null) {
                    var Q = new u({
                        actual: W,
                        expected: F,
                        message: G,
                        operator: "deepStrictEqual",
                        stackStartFn: ee
                    });
                    throw Q.operator = ee.name, Q;
                }
                var Y = Object.keys(F);
                if (F instanceof Error) Y.push("name", "message");
                else if (Y.length === 0) throw new a("error", F, "may not be an empty object");
                return w === void 0 && I(), Y.forEach(function(ae) {
                    typeof W[ae] == "string" && b(F[ae]) && v(F[ae], W[ae]) || x(W, F, ae, G, Y, ee);
                }), !0;
            }
            return F.prototype !== void 0 && W instanceof F ? !0 : Error.isPrototypeOf(F) ? !1 : F.call({}, W) === !0;
        }
        function R(W) {
            if (typeof W != "function") throw new o("fn", "Function", W);
            try {
                W();
            } catch (F) {
                return F;
            }
            return K;
        }
        function N(W) {
            return h(W) || W !== null && t(W) === "object" && typeof W.then == "function" && typeof W.catch == "function";
        }
        function L(W) {
            return Promise.resolve().then(function() {
                var F;
                if (typeof W == "function") {
                    if (F = W(), !N(F)) throw new c("instance of Promise", "promiseFn", F);
                } else if (N(W)) F = W;
                else throw new o("promiseFn", [
                    "Function",
                    "Promise"
                ], W);
                return Promise.resolve().then(function() {
                    return F;
                }).then(function() {
                    return K;
                }).catch(function(G) {
                    return G;
                });
            });
        }
        function z(W, F, G, ee) {
            if (typeof G == "string") {
                if (arguments.length === 4) throw new o("error", [
                    "Object",
                    "Error",
                    "Function",
                    "RegExp"
                ], G);
                if (t(F) === "object" && F !== null) {
                    if (F.message === G) throw new i("error/message", 'The error message "'.concat(F.message, '" is identical to the message.'));
                } else if (F === G) throw new i("error/message", 'The error "'.concat(F, '" is identical to the message.'));
                ee = G, G = void 0;
            } else if (G != null && t(G) !== "object" && typeof G != "function") throw new o("error", [
                "Object",
                "Error",
                "Function",
                "RegExp"
            ], G);
            if (F === K) {
                var Q = "";
                G && G.name && (Q += " (".concat(G.name, ")")), Q += ee ? ": ".concat(ee) : ".";
                var Y = W.name === "rejects" ? "rejection" : "exception";
                $({
                    actual: void 0,
                    expected: G,
                    operator: W.name,
                    message: "Missing expected ".concat(Y).concat(Q),
                    stackStartFn: W
                });
            }
            if (G && !A(F, G, ee, W)) throw F;
        }
        function B(W, F, G, ee) {
            if (F !== K) {
                if (typeof G == "string" && (ee = G, G = void 0), !G || A(F, G)) {
                    var Q = ee ? ": ".concat(ee) : ".", Y = W.name === "doesNotReject" ? "rejection" : "exception";
                    $({
                        actual: F,
                        expected: G,
                        operator: W.name,
                        message: "Got unwanted ".concat(Y).concat(Q, `
`) + 'Actual message: "'.concat(F && F.message, '"'),
                        stackStartFn: W
                    });
                }
                throw F;
            }
        }
        U.throws = function W(F) {
            for(var G = arguments.length, ee = new Array(G > 1 ? G - 1 : 0), Q = 1; Q < G; Q++)ee[Q - 1] = arguments[Q];
            z.apply(void 0, [
                W,
                R(F)
            ].concat(ee));
        }, U.rejects = function W(F) {
            for(var G = arguments.length, ee = new Array(G > 1 ? G - 1 : 0), Q = 1; Q < G; Q++)ee[Q - 1] = arguments[Q];
            return L(F).then(function(Y) {
                return z.apply(void 0, [
                    W,
                    Y
                ].concat(ee));
            });
        }, U.doesNotThrow = function W(F) {
            for(var G = arguments.length, ee = new Array(G > 1 ? G - 1 : 0), Q = 1; Q < G; Q++)ee[Q - 1] = arguments[Q];
            B.apply(void 0, [
                W,
                R(F)
            ].concat(ee));
        }, U.doesNotReject = function W(F) {
            for(var G = arguments.length, ee = new Array(G > 1 ? G - 1 : 0), Q = 1; Q < G; Q++)ee[Q - 1] = arguments[Q];
            return L(F).then(function(Y) {
                return B.apply(void 0, [
                    W,
                    Y
                ].concat(ee));
            });
        }, U.ifError = function W(F) {
            if (F != null) {
                var G = "ifError got unwanted exception: ";
                t(F) === "object" && typeof F.message == "string" ? F.message.length === 0 && F.constructor ? G += F.constructor.name : G += F.message : G += f(F);
                var ee = new u({
                    actual: F,
                    expected: null,
                    operator: "ifError",
                    message: G,
                    stackStartFn: W
                }), Q = F.stack;
                if (typeof Q == "string") {
                    var Y = Q.split(`
`);
                    Y.shift();
                    for(var ae = ee.stack.split(`
`), de = 0; de < Y.length; de++){
                        var pe = ae.indexOf(Y[de]);
                        if (pe !== -1) {
                            ae = ae.slice(0, pe);
                            break;
                        }
                    }
                    ee.stack = "".concat(ae.join(`
`), `
`).concat(Y.join(`
`));
                }
                throw ee;
            }
        };
        function S(W, F, G, ee, Q) {
            if (!b(F)) throw new o("regexp", "RegExp", F);
            var Y = Q === "match";
            if (typeof W != "string" || v(F, W) !== Y) {
                if (G instanceof Error) throw G;
                var ae = !G;
                G = G || (typeof W != "string" ? 'The "string" argument must be of type string. Received type ' + "".concat(t(W), " (").concat(f(W), ")") : (Y ? "The input did not match the regular expression " : "The input was expected to not match the regular expression ") + "".concat(f(F), `. Input:

`).concat(f(W), `
`));
                var de = new u({
                    actual: W,
                    expected: F,
                    message: G,
                    operator: Q,
                    stackStartFn: ee
                });
                throw de.generatedMessage = ae, de;
            }
        }
        U.match = function W(F, G, ee) {
            S(F, G, ee, W, "match");
        }, U.doesNotMatch = function W(F, G, ee) {
            S(F, G, ee, W, "doesNotMatch");
        };
        function O() {
            for(var W = arguments.length, F = new Array(W), G = 0; G < W; G++)F[G] = arguments[G];
            te.apply(void 0, [
                O,
                F.length
            ].concat(F));
        }
        return U.strict = y(O, U, {
            equal: U.strictEqual,
            deepEqual: U.deepStrictEqual,
            notEqual: U.notStrictEqual,
            notDeepEqual: U.notDeepStrictEqual
        }), U.strict.strict = U.strict, _4.exports;
    }
    var Xz;
    function q5() {
        if (Xz) return _a;
        Xz = 1;
        var t = _a && _a.__importDefault || function(i) {
            return i && i.__esModule ? i : {
                default: i
            };
        };
        Object.defineProperty(_a, "__esModule", {
            value: !0
        }), _a.decodeHex = _a.isHex = _a.toHex = void 0;
        const e = t(au());
        function n(i) {
            return Buffer.isBuffer(i) ? "0x" + i.toString("hex") : "0x" + Buffer.from(i.buffer, i.byteOffset, i.byteLength).toString("hex");
        }
        _a.toHex = n;
        function r(i) {
            return typeof i == "string" && i.length % 2 == 0 && /^0x[a-f\d]*$/i.test(i);
        }
        _a.isHex = r;
        function s(i) {
            return (0, e.default)(r(i)), Buffer.from(i.slice(2), "hex");
        }
        return _a.decodeHex = s, _a;
    }
    var Kn = {}, Gz;
    function ww() {
        if (Gz) return Kn;
        Gz = 1;
        var t = Kn && Kn.__importDefault || function(h) {
            return h && h.__esModule ? h : {
                default: h
            };
        };
        Object.defineProperty(Kn, "__esModule", {
            value: !0
        }), Kn.isObject = Kn.unsignedIntByteLength = Kn.UTF8_ENCODER = Kn.UTF8_DECODER = Kn.toUnsignedBigInt = Kn.toSignedBigInt = Kn.checkUnsignedBigInt = Kn.checkUnsignedInt = Kn.checkSignedBigInt = Kn.checkSignedInt = Kn.throwUnexpectedCase = Kn.assertNotNull = void 0;
        const e = t(au());
        function n(h, b) {
            return (0, e.default)(h != null, b), h;
        }
        Kn.assertNotNull = n;
        function r(h) {
            throw new Error(h ? `Unexpected case: ${h}` : "Unexpected case");
        }
        Kn.throwUnexpectedCase = r;
        function s(h, b, y, _, v) {
            if (!(Number.isInteger(h) && _ <= h && v >= h)) throw new Error(`Invalid ${b}${y}: ${h}`);
        }
        function i(h, b, y, _, v) {
            if (!(typeof h == "bigint" && _ <= h && v >= h)) throw new Error(`Invalid ${b}${y}: ${h}`);
        }
        function o(h, b) {
            let y, _;
            switch(b){
                case 8:
                    y = -128, _ = 127;
                    break;
                case 16:
                    y = -32768, _ = 32767;
                    break;
                case 32:
                    y = -2147483648, _ = 2147483647;
                    break;
                default:
                    r(b);
            }
            s(h, "I", b, y, _);
        }
        Kn.checkSignedInt = o;
        function a(h, b) {
            let y, _;
            switch(b){
                case 64:
                    y = -(2n ** 63n), _ = 2n ** 63n - 1n;
                    break;
                case 128:
                    y = -(2n ** 127n), _ = 2n ** 127n - 1n;
                    break;
                case 256:
                    y = -(2n ** 255n), _ = 2n ** 255n - 1n;
                    break;
                default:
                    r(b);
            }
            i(h, "I", b, y, _);
        }
        Kn.checkSignedBigInt = a;
        function c(h, b) {
            let y;
            switch(b){
                case 8:
                    y = 255;
                    break;
                case 16:
                    y = 65535;
                    break;
                case 32:
                    y = 4294967295;
                    break;
                default:
                    r(b);
            }
            s(h, "U", b, 0, y);
        }
        Kn.checkUnsignedInt = c;
        function l(h, b) {
            let y;
            switch(b){
                case 64:
                    y = 0xffffffffffffffffn;
                    break;
                case 128:
                    y = 2n ** 128n - 1n;
                    break;
                case 256:
                    y = 2n ** 256n - 1n;
                    break;
                default:
                    r(b);
            }
            i(h, "U", b, 0n, y);
        }
        Kn.checkUnsignedBigInt = l;
        function u(h, b) {
            return (0, e.default)(typeof h == "string" || typeof h == "number"), h = BigInt(h), a(h, b), h;
        }
        Kn.toSignedBigInt = u;
        function d(h, b) {
            return (0, e.default)(typeof h == "string" || typeof h == "number"), h = BigInt(h), l(h, b), h;
        }
        Kn.toUnsignedBigInt = d, Kn.UTF8_DECODER = new TextDecoder("utf-8", {
            fatal: !0,
            ignoreBOM: !1
        }), Kn.UTF8_ENCODER = new TextEncoder;
        function f(h) {
            let b = 0;
            for(; h > 0n;)h = h >> 8n, b += 1;
            return b;
        }
        Kn.unsignedIntByteLength = f;
        function p(h) {
            return h != null && typeof h == "object";
        }
        return Kn.isObject = p, Kn;
    }
    var Zz;
    function Ate() {
        if (Zz) return kf;
        Zz = 1;
        var t = kf && kf.__importDefault || function(o) {
            return o && o.__esModule ? o : {
                default: o
            };
        };
        Object.defineProperty(kf, "__esModule", {
            value: !0
        }), kf.Src = void 0;
        const e = q5(), n = t(au()), r = ww();
        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");
            }
        }
        kf.Src = s;
        function i() {
            return new Error("Unexpected EOF");
        }
        return kf;
    }
    var xa = {}, Jz;
    function Pte() {
        if (Jz) return xa;
        Jz = 1;
        var t = xa && xa.__importDefault || function(o) {
            return o && o.__esModule ? o : {
                default: o
            };
        };
        Object.defineProperty(xa, "__esModule", {
            value: !0
        }), xa.ByteSink = xa.HexSink = xa.Sink = void 0;
        const e = t(au()), n = ww();
        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`);
            }
        }
        xa.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;
            }
        }
        xa.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 xa.ByteSink = i, xa;
    }
    var Tf = {}, dl = {}, Yz;
    function Ote() {
        if (Yz) return dl;
        Yz = 1;
        var t = dl && dl.__importDefault || function(o) {
            return o && o.__esModule ? o : {
                default: o
            };
        };
        Object.defineProperty(dl, "__esModule", {
            value: !0
        }), dl.toCodecTypes = dl.getCodecType = void 0;
        const e = t(au()), n = L5(), r = ww();
        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, b)=>Math.max(h, b.index), 0) + 1, p = new Array(f);
                        return l.forEach((h)=>{
                            let b;
                            if (h.fields[0]?.name == null) switch(h.fields.length){
                                case 0:
                                    b = {
                                        kind: "empty",
                                        name: h.name,
                                        index: h.index
                                    };
                                    break;
                                case 1:
                                    b = {
                                        kind: "value",
                                        name: h.name,
                                        index: h.index,
                                        type: h.fields[0].type
                                    };
                                    break;
                                default:
                                    b = {
                                        kind: "tuple",
                                        name: h.name,
                                        index: h.index,
                                        def: {
                                            kind: n.TypeKind.Tuple,
                                            tuple: h.fields.map((y)=>((0, e.default)(y.name == null), y.type))
                                        }
                                    };
                            }
                            else b = {
                                kind: "struct",
                                name: h.name,
                                index: h.index,
                                def: {
                                    kind: n.TypeKind.Struct,
                                    fields: h.fields.map((y)=>({
                                            name: (0, r.assertNotNull)(y.name),
                                            type: y.type
                                        }))
                                }
                            };
                            p[h.index] = b, u[b.name] = b;
                        }), {
                            kind: n.TypeKind.Variant,
                            variants: p,
                            variantsByName: u
                        };
                    }
                default:
                    return c;
            }
        }
        dl.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 dl.toCodecTypes = i, dl;
    }
    var Qz;
    function Cat() {
        if (Qz) return Tf;
        Qz = 1;
        var t = Tf && Tf.__importDefault || function(w) {
            return w && w.__esModule ? w : {
                default: w
            };
        };
        Object.defineProperty(Tf, "__esModule", {
            value: !0
        }), Tf.Codec = void 0;
        const e = q5(), n = t(au()), r = Pte(), s = Ate(), i = L5(), o = Ote(), a = ww();
        class c {
            constructor(E){
                this.types = (0, o.toCodecTypes)(E);
            }
            decodeBinary(E, I) {
                let D = new s.Src(I), U = this.decode(E, D);
                return D.assertEOF(), U;
            }
            encodeToHex(E, I) {
                let D = new r.HexSink;
                return this.encode(E, I, D), D.toHex();
            }
            encodeToBinary(E, I) {
                let D = new r.ByteSink;
                return this.encode(E, I, D), D.toBytes();
            }
            decode(E, I) {
                let D = this.types[E];
                switch(D.kind){
                    case i.TypeKind.Primitive:
                        return _(D.primitive, I);
                    case i.TypeKind.Compact:
                        return y(D, I);
                    case i.TypeKind.BitSequence:
                        return f(I);
                    case i.TypeKind.Array:
                        return this.decodeArray(D, I);
                    case i.TypeKind.Sequence:
                        return this.decodeSequence(D, I);
                    case i.TypeKind.Tuple:
                        return this.decodeTuple(D, I);
                    case i.TypeKind.Struct:
                        return this.decodeStruct(D, I);
                    case i.TypeKind.Variant:
                        return this.decodeVariant(D, I);
                    case i.TypeKind.Option:
                        return this.decodeOption(D, I);
                    case i.TypeKind.BooleanOption:
                        return h(I);
                    case i.TypeKind.Bytes:
                        return l(I);
                    case i.TypeKind.BytesArray:
                        return I.bytes(D.len);
                    case i.TypeKind.HexBytes:
                        return (0, e.toHex)(l(I));
                    case i.TypeKind.HexBytesArray:
                        return (0, e.toHex)(I.bytes(D.len));
                    case i.TypeKind.DoNotConstruct:
                        (0, a.throwUnexpectedCase)("DoNotConstruct type reached");
                    default:
                        (0, a.throwUnexpectedCase)(D.kind);
                }
            }
            decodeArray(E, I) {
                let { len: D, type: U } = E, K = new Array(D);
                for(let $ = 0; $ < D; $++)K[$] = this.decode(U, I);
                return K;
            }
            decodeSequence(E, I) {
                let D = I.compactLength(), U = new Array(D);
                for(let K = 0; K < D; K++)U[K] = this.decode(E.type, I);
                return U;
            }
            decodeTuple(E, I) {
                if (E.tuple.length == 0) return null;
                let D = new Array(E.tuple.length);
                for(let U = 0; U < E.tuple.length; U++)D[U] = this.decode(E.tuple[U], I);
                return D;
            }
            decodeStruct(E, I) {
                let D = {};
                for(let U = 0; U < E.fields.length; U++){
                    let K = E.fields[U];
                    D[K.name] = this.decode(K.type, I);
                }
                return D;
            }
            decodeVariant(E, I) {
                let D = I.u8(), U = E.variants[D];
                switch(U == null && (0, a.throwUnexpectedCase)(`unknown variant index: ${D}`), U.kind){
                    case "empty":
                        return {
                            __kind: U.name
                        };
                    case "tuple":
                        return {
                            __kind: U.name,
                            value: this.decodeTuple(U.def, I)
                        };
                    case "value":
                        return {
                            __kind: U.name,
                            value: this.decode(U.type, I)
                        };
                    case "struct":
                        {
                            let K = this.decodeStruct(U.def, I);
                            return K.__kind = U.name, K;
                        }
                    default:
                        (0, a.throwUnexpectedCase)();
                }
            }
            decodeOption(E, I) {
                let D = I.u8();
                switch(D){
                    case 0:
                        return;
                    case 1:
                        return this.decode(E.type, I);
                    default:
                        (0, a.throwUnexpectedCase)(D.toString());
                }
            }
            encode(E, I, D) {
                let U = this.types[E];
                switch(U.kind){
                    case i.TypeKind.Primitive:
                        v(U.primitive, I, D);
                        break;
                    case i.TypeKind.Compact:
                        D.compact(I);
                        break;
                    case i.TypeKind.BitSequence:
                        p(I, D);
                        break;
                    case i.TypeKind.Array:
                        this.encodeArray(U, I, D);
                        break;
                    case i.TypeKind.Sequence:
                        this.encodeSequence(U, I, D);
                        break;
                    case i.TypeKind.Tuple:
                        this.encodeTuple(U, I, D);
                        break;
                    case i.TypeKind.Struct:
                        this.encodeStruct(U, I, D);
                        break;
                    case i.TypeKind.Variant:
                        this.encodeVariant(U, I, D);
                        break;
                    case i.TypeKind.BytesArray:
                        d(U, I, D);
                        break;
                    case i.TypeKind.HexBytesArray:
                        d(U, (0, e.decodeHex)(I), D);
                        break;
                    case i.TypeKind.Bytes:
                        u(I, D);
                        break;
                    case i.TypeKind.HexBytes:
                        u((0, e.decodeHex)(I), D);
                        break;
                    case i.TypeKind.BooleanOption:
                        b(I, D);
                        break;
                    case i.TypeKind.Option:
                        this.encodeOption(U, I, D);
                        break;
                    default:
                        (0, a.throwUnexpectedCase)(U.kind);
                }
            }
            encodeArray(E, I, D) {
                (0, n.default)(Array.isArray(I) && I.length == E.len);
                for(let U = 0; U < I.length; U++)this.encode(E.type, I[U], D);
            }
            encodeSequence(E, I, D) {
                (0, n.default)(Array.isArray(I)), D.compact(I.length);
                for(let U = 0; U < I.length; U++)this.encode(E.type, I[U], D);
            }
            encodeTuple(E, I, D) {
                if (E.tuple.length == 0) {
                    (0, n.default)(I == null);
                    return;
                }
                (0, n.default)(Array.isArray(I) && E.tuple.length == I.length);
                for(let U = 0; U < I.length; U++)this.encode(E.tuple[U], I[U], D);
            }
            encodeStruct(E, I, D) {
                for(let U = 0; U < E.fields.length; U++){
                    let K = E.fields[U];
                    this.encode(K.type, I[K.name], D);
                }
            }
            encodeVariant(E, I, D) {
                (0, n.default)(typeof I?.__kind == "string", "not a variant type value");
                let U = E.variantsByName[I.__kind];
                if (U == null) throw new Error(`Unknown variant: ${I.__kind}`);
                switch(D.u8(U.index), U.kind){
                    case "empty":
                        break;
                    case "value":
                        this.encode(U.type, I.value, D);
                        break;
                    case "tuple":
                        this.encodeTuple(U.def, I.value, D);
                        break;
                    case "struct":
                        this.encodeStruct(U.def, I, D);
                        break;
                    default:
                        (0, a.throwUnexpectedCase)();
                }
            }
            encodeOption(E, I, D) {
                I === void 0 ? D.u8(0) : (D.u8(1), this.encode(E.type, I, D));
            }
        }
        Tf.Codec = c;
        function l(w) {
            let E = w.compactLength();
            return w.bytes(E);
        }
        function u(w, E) {
            (0, n.default)(w instanceof Uint8Array), E.compact(w.length), E.bytes(w);
        }
        function d(w, E, I) {
            (0, n.default)(E instanceof Uint8Array && E.length == w.len), I.bytes(E);
        }
        function f(w) {
            let E = w.compactLength(), I = Math.ceil(E / 8);
            return {
                bytes: w.bytes(I),
                bitLength: E
            };
        }
        function p(w, E) {
            (0, n.default)(w && typeof w == "object" && Number.isInteger(w.bitLength) && w.bytes instanceof Uint8Array);
            let I = w;
            (0, n.default)(Math.ceil(I.bitLength / 8) == I.bytes.length), E.compact(I.bitLength), E.bytes(I.bytes);
        }
        function h(w) {
            let E = w.u8();
            switch(E){
                case 0:
                    return null;
                case 1:
                    return !0;
                case 2:
                    return !1;
                default:
                    (0, a.throwUnexpectedCase)(E.toString());
            }
        }
        function b(w, E) {
            w == null ? E.u8(0) : ((0, n.default)(typeof w == "boolean"), E.u8(w ? 1 : 2));
        }
        function y(w, E) {
            let I = E.compact();
            switch(w.integer){
                case "U8":
                case "U16":
                case "U32":
                    return I;
                default:
                    return BigInt(I);
            }
        }
        function _(w, E) {
            switch(w){
                case "I8":
                    return E.i8();
                case "U8":
                    return E.u8();
                case "I16":
                    return E.i16();
                case "U16":
                    return E.u16();
                case "I32":
                    return E.i32();
                case "U32":
                    return E.u32();
                case "I64":
                    return E.i64();
                case "U64":
                    return E.u64();
                case "I128":
                    return E.i128();
                case "U128":
                    return E.u128();
                case "I256":
                    return E.i256();
                case "U256":
                    return E.u256();
                case "Bool":
                    return E.bool();
                case "Str":
                    return E.str();
                default:
                    (0, a.throwUnexpectedCase)(w);
            }
        }
        function v(w, E, I) {
            switch(w){
                case "I8":
                    I.i8(E);
                    break;
                case "U8":
                    I.u8(E);
                    break;
                case "I16":
                    I.i16(E);
                    break;
                case "U16":
                    I.u16(E);
                    break;
                case "I32":
                    I.i32(E);
                    break;
                case "U32":
                    I.u32(E);
                    break;
                case "I64":
                    I.i64(E);
                    break;
                case "U64":
                    I.u64(E);
                    break;
                case "I128":
                    I.i128(E);
                    break;
                case "U128":
                    I.u128(E);
                    break;
                case "I256":
                    I.i256(E);
                    break;
                case "U256":
                    I.u256(E);
                    break;
                case "Bool":
                    I.bool(E);
                    break;
                case "Str":
                    I.str(E);
                    break;
                default:
                    (0, a.throwUnexpectedCase)(w);
            }
        }
        return Tf;
    }
    var fl = {}, nm = {}, eU;
    function Iat() {
        if (eU) return nm;
        eU = 1, Object.defineProperty(nm, "__esModule", {
            value: !0
        }), nm.toJSON = void 0;
        const t = q5();
        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;
            }
        }
        nm.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 nm;
    }
    var tU;
    function Aat() {
        if (tU) return fl;
        tU = 1;
        var t = fl && fl.__importDefault || function(d) {
            return d && d.__esModule ? d : {
                default: d
            };
        };
        Object.defineProperty(fl, "__esModule", {
            value: !0
        }), fl.decodeBinaryArray = fl.JsonCodec = void 0;
        const e = q5(), n = Iat(), r = t(au()), s = L5(), i = Ote(), o = ww();
        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: b } = f;
                (0, r.default)(Array.isArray(p)), (0, r.default)(p.length == h);
                let y = new Array(h);
                for(let _ = 0; _ < h; _++)y[_] = this.decode(b, p[_]);
                return y;
            }
            decodeSequence(f, p) {
                (0, r.default)(Array.isArray(p));
                let h = new Array(p.length);
                for(let b = 0; b < p.length; b++)h[b] = this.decode(f.type, p[b]);
                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 b = new Array(h.length);
                    for(let y = 0; y < h.length; y++)b[y] = this.decode(h[y], p[y]);
                    return b;
                }
            }
            decodeStruct(f, p) {
                (0, r.default)((0, o.isObject)(p));
                let h = {};
                for(let b = 0; b < f.fields.length; b++){
                    let y = f.fields[b];
                    h[y.name] = this.decode(y.type, p[y.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 b = this.decodeStruct(h.def, p);
                            return b.__kind = p.__kind, b;
                        }
                    default:
                        (0, o.throwUnexpectedCase)(h.kind);
                }
            }
            decodeOption(f, p) {
                return p == null ? void 0 : this.decode(f.type, p);
            }
        }
        fl.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 fl.decodeBinaryArray = u, fl;
    }
    var nU;
    function Pat() {
        return nU || (nU = 1, (function(t) {
            var e = Sf && Sf.__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 = Sf && Sf.__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(L5(), t), n(Ate(), t), n(Pte(), t), n(Cat(), t), n(Aat(), t);
        })(Sf)), Sf;
    }
    var rU = Pat();
    const t0 = Symbol("Mainnet"), sU = {
        toString: (t)=>t === t0 ? "mainnet" : t
    }, Oat = {
        modulus: BigInt("0x73eda753299d7d483339d80809a1d80553bda402fffe5bfeffffffff00000001")
    }, iU = {
        encode: (t)=>{
            const e = new rU.ByteSink;
            return e.compact(t), Buffer.from(e.toBytes());
        },
        decode: (t)=>{
            const e = new rU.Src(t), n = e.compact();
            return e.assertEOF(), BigInt(n);
        }
    }, qd = Symbol("MidnightBech32m");
    class ns {
        static prefix = "mn";
        static encode(e, n) {
            return n[qd].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 = zf.decodeToBytes(e), [r, s, i = t0] = n.prefix.split("_");
            if (r != ns.prefix) throw new Error(`Expected prefix ${ns.prefix}`);
            return ns.validateSegment("type", s), i != t0 && ns.validateSegment("network", i), new ns(s, i, Buffer.from(n.bytes));
        }
        type;
        network;
        data;
        constructor(e, n, r){
            this.data = r, this.network = n, this.type = e, ns.validateSegment("type", e), n != t0 && ns.validateSegment("network", n);
        }
        decode(e, n) {
            return e[qd].decode(n, this);
        }
        asString() {
            const e = this.network == t0 ? "" : `_${this.network}`;
            return zf.encode(`${ns.prefix}_${this.type}${e}`, zf.toWords(this.data), !1);
        }
        toString() {
            return this.asString();
        }
    }
    class Kd {
        type;
        dataToBytes;
        dataFromBytes;
        constructor(e, n, r){
            this.dataFromBytes = r, this.dataToBytes = n, this.type = e;
        }
        encode(e, n) {
            const r = Kd.createContext(e);
            return new ns(this.type, r.networkId, this.dataToBytes(n));
        }
        decode(e, n) {
            const r = Kd.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 ${sU.toString(r.networkId)} address, got ${sU.toString(n.network)} one`);
            return this.dataFromBytes(n.data);
        }
        static createContext(e) {
            return e === "mainnet" ? {
                networkId: t0
            } : {
                networkId: e
            };
        }
    }
    class $l {
        static codec = new Kd("shield-addr", (e)=>Buffer.concat([
                e.coinPublicKey.data,
                e.encryptionPublicKey.data
            ]), (e)=>{
            const n = new ra(e.subarray(0, ra.keyLength)), r = new Xl(e.subarray(ra.keyLength));
            return new $l(n, r);
        });
        static [qd] = $l.codec;
        [qd] = $l.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 ra {
        static keyLength = 32;
        static codec = new Kd("shield-cpk", (e)=>e.data, (e)=>new ra(e));
        static fromHexString(e) {
            return new ra(Buffer.from(e, "hex"));
        }
        data;
        constructor(e){
            if (this.data = e, e.length != ra.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" ? ra.fromHexString(e) : e).data.equals(this.data);
        }
    }
    class Xl {
        static keyLength = 32;
        static codec = new Kd("shield-epk", (e)=>e.data, (e)=>new Xl(e));
        static fromHexString(e) {
            return new Xl(Buffer.from(e, "hex"));
        }
        data;
        constructor(e){
            this.data = e;
        }
        toHexString() {
            return this.data.toString("hex");
        }
        equals(e) {
            return (typeof e == "string" ? Xl.fromHexString(e) : e).data.equals(this.data);
        }
    }
    class Hi {
        data;
        static keyLength = 32;
        static codec = new Kd("addr", (e)=>e.data, (e)=>new Hi(e));
        static [qd] = Hi.codec;
        [qd] = Hi.codec;
        constructor(e){
            if (e.length != Hi.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 Hi(Buffer.from(e, "hex")) : e).data.equals(this.data);
        }
    }
    class Df {
        data;
        static codec = new Kd("dust", (e)=>e.serialize(), (e)=>new Df(iU.decode(e)));
        static [qd] = Df.codec;
        [qd] = Df.codec;
        static encodePublicKey = (e, n)=>Df.codec.encode(e, new Df(n)).asString();
        constructor(e){
            if (e >= Oat.modulus) throw new Error("Dust address is too large");
            this.data = e;
        }
        serialize() {
            return iU.encode(this.data);
        }
        equals(e) {
            return (typeof e == "bigint" ? e : e.data) === this.data;
        }
    }
    const Mat = ()=>({
            getPublicKey: (t)=>t.publicKey.publicKey,
            getAddress: (t)=>new Hi(Buffer.from(t.publicKey.addressHex, "hex"))
        }), Rat = ({ 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
                }))
        }), Nat = (t, e)=>{
        const { txHistoryStorage: n } = t;
        return {
            create: async (r)=>{
                const s = Rat(r);
                await n.create(s);
            },
            get: async (r)=>await n.get(r),
            getAll: ()=>n.getAll(),
            delete: async (r)=>n.delete(r)
        };
    }, Mte = {
        fromKeyStore: (t)=>({
                publicKey: t.getPublicKey(),
                addressHex: t.getAddress(),
                address: t.getBech32Address().asString()
            })
    }, yd = (t, e)=>{
        const n = {
            getSecretKey: ()=>Buffer.from(t),
            getBech32Address: ()=>{
                const r = n.getAddress(), s = Buffer.from(r, "hex");
                return Hi.codec.encode(e, new Hi(s));
            },
            getPublicKey: ()=>Pj(n.getSecretKey().toString("hex")),
            getAddress: ()=>Aj(n.getPublicKey()),
            signData: (r)=>Oj(n.getSecretKey().toString("hex"), r)
        };
        return n;
    };
    let Vat = class Ju {
        #e;
        constructor(e = {}){
            this.#e = e;
        }
        withDefaults() {
            return this.withSyncDefaults().withSerializationDefaults().withTransactingDefaults().withCoinsAndBalancesDefaults().withTransactionHistoryDefaults().withKeysDefaults().withCoinSelectionDefaults();
        }
        withSyncDefaults() {
            return this.withSync(Rot, Not);
        }
        withSync(e, n) {
            return new Ju({
                ...this.#e,
                syncService: e,
                syncCapability: n
            });
        }
        withSerializationDefaults() {
            return this.withSerialization(Eot);
        }
        withSerialization(e) {
            return new Ju({
                ...this.#e,
                serializationCapability: e
            });
        }
        withTransactingDefaults() {
            return this.withTransacting(Vot);
        }
        withTransacting(e) {
            return new Ju({
                ...this.#e,
                transactingCapability: e
            });
        }
        withCoinSelection(e) {
            return new Ju({
                ...this.#e,
                coinSelection: e
            });
        }
        withCoinSelectionDefaults() {
            return this.withCoinSelection(()=>BE);
        }
        withCoinsAndBalancesDefaults() {
            return this.withCoinsAndBalances(Dot);
        }
        withCoinsAndBalances(e) {
            return new Ju({
                ...this.#e,
                coinsAndBalancesCapability: e
            });
        }
        withTransactionHistoryDefaults() {
            return this.withTransactionHistory(Nat);
        }
        withTransactionHistory(e) {
            return new Ju({
                ...this.#e,
                transactionHistoryService: e
            });
        }
        withKeysDefaults() {
            return this.withKeys(Mat);
        }
        withKeys(e) {
            return new Ju({
                ...this.#e,
                keysCapability: e
            });
        }
        build(e) {
            const n = this.#t(e), { networkId: r } = e;
            return {
                __polyTag__: io,
                coinsAndBalances: n.coinsAndBalancesCapability,
                keys: n.keysCapability,
                serialization: n.serializationCapability,
                transactionHistory: n.transactionHistoryService,
                start (s) {
                    return Gn(function*() {
                        const i = yield* La;
                        return new vot(i, s, n);
                    });
                },
                migrateState (s) {
                    const i = ete("0000000000000000000000000000000000000000000000000000000000000001");
                    return Gt(Vl.init(Mte.fromKeyStore(yd(i, r)), r));
                },
                deserializeState: (s)=>n.serializationCapability.deserialize(s)
            };
        }
        #t(e) {
            if (!Bat(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 Bat = (t)=>[
            "syncService",
            "syncCapability",
            "transactingCapability",
            "coinSelection",
            "serializationCapability",
            "coinsAndBalancesCapability",
            "keysCapability",
            "transactionHistoryService"
        ].every((n)=>typeof t[n] == "function"), Dat = gn, oU = tn({
        value: zy,
        owner: gn,
        tokenType: gn,
        intentHash: gn,
        outputIndex: Jr
    }), Fat = tn({
        id: Jr,
        hash: Dat,
        protocolVersion: Jr,
        identifiers: Ws(gn),
        timestamp: eJ,
        fees: UZ(zy),
        status: ii("SUCCESS", "FAILURE", "PARTIAL_SUCCESS"),
        createdUtxos: Ws(oU),
        spentUtxos: Ws(oU)
    }), Rte = aVe({
        key: gn,
        value: Fat
    }), Lat = cd(Rte), zat = Wc(Rte);
    class bh {
        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 = Lat(this.entries);
            return JSON.stringify(e);
        }
        reset() {
            this.entries.clear();
        }
        static fromSerialized(e) {
            const n = JSON.parse(e), r = M2e(zat(n), (s)=>{
                throw new Error(`Failed to decode transaction history: ${s.message}`);
            });
            return new bh(r);
        }
    }
    const Uat = (t)=>{
        const e = _J(t.variants);
        return Nte({
            variants: t.variants,
            tag: $A(e.variant),
            state: t.state
        });
    }, Nte = (t)=>qX.pipe(Vf("initiatedFirstVariant", ()=>qat(t)), Vf("currentStateRef", ({ initiatedFirstVariant: e })=>e.currentStateRef.get.pipe(Ge((n)=>jA(lt({
                    version: e.initProtocolVersion,
                    state: n
                }))))), Vf("progressRef", ()=>hB({
                applyGap: 0n,
                sourceGap: 0n
            })), Vf("currentVariantRef", ({ initiatedFirstVariant: e })=>cp(hB(e), (n, r)=>Gn(function*() {
                    const s = yield* AVe(n);
                    yield* Nd(s.variantScope, r);
                }))), Vf("runningStream", ({ initiatedFirstVariant: e, currentStateRef: n, progressRef: r, currentVariantRef: s })=>Bte(e, n, r, s).pipe(lb((i)=>aJ(n, Qe(i))), q1)), Ge(({ currentStateRef: e, progressRef: n, currentVariantRef: r })=>Gn(function*() {
                const i = {
                    stateChanges: yield* e.changes.pipe(nf((o)=>Or(o)), fVe({
                        capacity: "unbounded",
                        replay: 1
                    })),
                    progress: n.get,
                    currentVariant: r.get,
                    dispatch: (o)=>Hat(i, o)
                };
                return i;
            }))), Hat = (t, e)=>t.currentVariant.pipe(Ge((n)=>GBe(n.runningVariant, e))), jat = (t)=>Gn(function*() {
            const [e] = t.variants;
            e || (yield* Bs(new uO({
                message: "No variant to init"
            })));
            const n = yield* e.variant.migrateState(t.state);
            return yield* Vte({
                variants: t.variants,
                state: n,
                initProtocolVersion: t.initProtocolVersion
            });
        }), qat = (t)=>Gn(function*() {
            const e = t.variants.findIndex((r)=>$A(r.variant) === t.tag), n = t.variants.toSpliced(0, e);
            return yield* Vte({
                variants: n,
                state: t.state,
                initProtocolVersion: void 0
            });
        }), Vte = (t)=>Gn(function*() {
            const [e, n] = t.variants;
            e || (yield* Bs(new uO({
                message: "No variant to init"
            })));
            const r = e, s = t.initProtocolVersion ?? r.sinceVersion, i = n ? n.sinceVersion : dit, o = cit(r.sinceVersion, i), a = yield* jA(t.state), c = yield* hg(), l = yield* r.variant.start({
                stateRef: a
            }).pipe(Dd(La, c));
            return {
                __polyTag__: r.variant.__polyTag__,
                variant: r,
                initialState: t.state,
                runningVariant: l,
                currentStateRef: a,
                restVariants: YBe(t.variants),
                initProtocolVersion: s,
                validVersionRange: o,
                nextProtocolVersion: n ? n.sinceVersion : null,
                variantScope: c
            };
        }), Bte = (t, e, n, r)=>{
        const s = {
            protocolVersion: t.initProtocolVersion,
            shouldInitChange: !1,
            followEffect: an,
            lastState: t.initialState
        };
        return t.runningVariant.state.pipe(SVe(s, (i, o)=>yot(o, {
                State: ({ state: a })=>aJ(e, lt({
                        version: i.protocolVersion,
                        state: a
                    })).pipe(Ba({
                        ...i,
                        lastState: a
                    })),
                ProgressUpdate: (a)=>pB(n, a).pipe(Ba(i)),
                VersionChange: ({ change: a })=>{
                    const c = wot(a, {
                        Version: ({ version: l })=>l,
                        Next: ()=>t.nextProtocolVersion
                    });
                    return c != null && !lit(c, t.validVersionRange) ? Gt({
                        ...i,
                        protocolVersion: c,
                        shouldInitChange: !0,
                        followEffect: Gn(function*() {
                            yield* Nd(t.variantScope, x3);
                            const l = yield* jat({
                                variants: t.restVariants,
                                state: i.lastState,
                                initProtocolVersion: c
                            });
                            return yield* pB(r, l), yield* Bte(l, e, n, r);
                        })
                    }) : Gt({
                        ...i,
                        protocolVersion: c ?? i.protocolVersion
                    });
                }
            })), bVe((i)=>i.shouldInitChange), iJ, Ge((i)=>un(i, {
                onSome: (o)=>o.followEffect,
                onNone: ()=>an
            })));
    };
    class vg {
        constructor(e){
            this.#e = e;
        }
        static init() {
            return new vg({
                variants: []
            });
        }
        #e;
        withVariant(e, n) {
            const { sinceVersion: r } = this.#e.variants.at(-1) ?? {
                sinceVersion: ja(-1n)
            };
            if (e <= r) throw new Error("ProtocolMismatch: sinceVersion is prior to previously registered version");
            const s = {
                sinceVersion: e,
                variantBuilder: n
            };
            return new vg({
                variants: ZBe(this.#e.variants, s)
            });
        }
        build(...[e]) {
            if (this.#e.variants.length == 0) throw new uO({
                message: "Empty variants list"
            });
            const n = this.#e.variants.map(({ sinceVersion: r, variantBuilder: s })=>({
                    sinceVersion: r,
                    variant: s.build(e ?? {})
                }));
            return class f2 {
                static configuration = e ?? {};
                static allVariants() {
                    return n;
                }
                static allVariantsRecord() {
                    return mot(f2.allVariants());
                }
                static startEmpty(s) {
                    return Gn(this, function*() {
                        const i = yield* _J(f2.allVariants()).variant.migrateState(null);
                        return f2.startFirst(s, i);
                    }).pipe(Ki);
                }
                static startFirst(s, i) {
                    return Gn(this, function*() {
                        const o = yield* hg(), a = yield* Uat({
                            variants: n,
                            state: i
                        }).pipe(Dd(La, o));
                        return new s(a, o);
                    }).pipe(Ki);
                }
                static start(s, i, o) {
                    return Gn(this, function*() {
                        const a = yield* hg(), c = yield* Nte({
                            variants: n,
                            tag: i,
                            state: o
                        }).pipe(Dd(La, a));
                        return new s(c, a);
                    }).pipe(Ki);
                }
                runtime;
                runtimeScope;
                rawState;
                get syncComplete() {
                    const { sourceGap: s, applyGap: i } = Ki(this.runtime.progress);
                    return s === 0n && i === 0n;
                }
                constructor(s, i){
                    this.runtime = s, this.runtimeScope = i, this.rawState = jJ(s.stateChanges).pipe(d5({
                        refCount: !0,
                        bufferSize: 1
                    }));
                }
                stop() {
                    return Nd(this.runtimeScope, x3).pipe(En);
                }
            };
        }
    }
    class kO {
        static mapState = (e)=>(n)=>new kO(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 UT(t) {
        return Kat(t, new Vat().withDefaults());
    }
    function Kat(t, e) {
        const n = [
            t
        ], r = vg.init().withVariant(Kh, e).build(...n);
        return class Of extends r {
            static startWithPublicKey(i) {
                return Of.startFirst(Of, Vl.init(i, t.networkId));
            }
            static restore(i) {
                const o = Of.allVariantsRecord()[io].variant.deserializeState(i).pipe(Dv);
                return Of.startFirst(Of, o);
            }
            state;
            constructor(i, o){
                super(i, o), this.state = this.rawState.pipe(ye(kO.mapState(Of.allVariantsRecord()[io].variant)), d5({
                    refCount: !0,
                    bufferSize: 1
                }));
            }
            start() {
                return this.runtime.dispatch({
                    [io]: (i)=>i.startSyncInBackground()
                }).pipe(En);
            }
            balanceFinalizedTransaction(i) {
                return this.runtime.dispatch({
                    [io]: (o)=>o.balanceFinalizedTransaction(i)
                }).pipe(En);
            }
            balanceUnboundTransaction(i) {
                return this.runtime.dispatch({
                    [io]: (o)=>o.balanceUnboundTransaction(i)
                }).pipe(En);
            }
            balanceUnprovenTransaction(i) {
                return this.runtime.dispatch({
                    [io]: (o)=>o.balanceUnprovenTransaction(i)
                }).pipe(En);
            }
            transferTransaction(i, o) {
                return this.runtime.dispatch({
                    [io]: (a)=>a.transferTransaction(i, o)
                }).pipe(En);
            }
            initSwap(i, o, a) {
                return this.runtime.dispatch({
                    [io]: (c)=>c.initSwap(i, o, a)
                }).pipe(En);
            }
            signUnprovenTransaction(i, o) {
                return this.runtime.dispatch({
                    [io]: (a)=>a.signUnprovenTransaction(i, o)
                }).pipe(En);
            }
            signUnboundTransaction(i, o) {
                return this.runtime.dispatch({
                    [io]: (a)=>a.signUnboundTransaction(i, o)
                }).pipe(En);
            }
            revertTransaction(i) {
                return this.runtime.dispatch({
                    [io]: (o)=>o.revertTransaction(i)
                }).pipe(En);
            }
            waitForSyncedState(i = 0n) {
                return Mn(this.state.pipe(bu((o)=>o.state.progress.isCompleteWithin(i))));
            }
            serializeState() {
                return Mn(this.state).then((i)=>i.serialize());
            }
            getAddress() {
                return Mn(this.state).then((i)=>i.address);
            }
        };
    }
    const Wat = {
        other (t) {
            let e;
            return t ? typeof t == "object" && "message" in t ? e = String(t.message) : typeof t == "string" ? e = t : e = "" : e = "", new fc({
                message: `Other wallet error: ${e}`,
                cause: t
            });
        },
        submission (t) {
            const e = t && typeof t == "object" && "message" in t ? String(t.message) : "";
            return new $at({
                message: `Transaction submission error: ${e}`,
                cause: t
            });
        }
    };
    let fc = class extends wn("Wallet.Other") {
    }, x_ = class extends wn("Wallet.Sync") {
    };
    class $at extends wn("Wallet.SubmissionWalletError") {
    }
    let aU = class extends wn("Wallet.InsufficientFunds") {
    };
    class vvt extends wn("Wallet.Address") {
    }
    class Xat extends wn("Wallet.InvalidCoinHashes") {
    }
    let Svt = class extends wn("Wallet.Transacting") {
    };
    const Gat = (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 [
            fO({
                sourceGap: i,
                applyGap: o
            })
        ];
    }, Zat = (t, e)=>t.protocolVersion != e.protocolVersion ? [
            hO({
                change: gO({
                    version: ja(e.protocolVersion)
                })
            })
        ] : [], _l = Symbol("V1");
    let Jat = class {
        __polyTag__ = _l;
        #e;
        #t;
        #n;
        state;
        constructor(e, n, r){
            this.#e = e, this.#t = n, this.#n = r, this.state = nu(n.stateRef.get).pipe(Vc((s)=>n.stateRef.changes.pipe(LA(s, (i, o)=>[
                        o,
                        [
                            i,
                            o
                        ]
                    ]))), s5(([s, i])=>[
                    dO({
                        state: i
                    }),
                    ...Gat(i),
                    ...Zat(s, i)
                ]));
        }
        startSyncInBackground(e) {
            return this.startSync(e).pipe(UA(FA), q1, Dd(La, this.#e));
        }
        startSync(e) {
            return V(uh(this.#t.stateRef), nu, Vc((n)=>this.#n.syncService.updates(n, e)), nf((n)=>zh(this.#t.stateRef, (r)=>Co({
                        try: ()=>this.#n.syncCapability.applyUpdate(r, n),
                        catch: (s)=>new fc({
                                message: "Error while applying sync update",
                                cause: s
                            })
                    }))), HA((n)=>xA(n)), i5(V(Z1(hu(1), 2), hA((n)=>{
                const r = w1(2), s = as(Math.floor(Math.random() * 1e3)), i = Si(n) + Si(s);
                return as(Math.min(i, Si(r)));
            }))));
        }
        balanceTransaction(e, n) {
            return El(this.#t.stateRef, (r)=>V(this.#n.transactingCapability.balanceTransaction(e, r, n), Or));
        }
        transferTransaction(e, n) {
            return El(this.#t.stateRef, (r)=>V(this.#n.transactingCapability.makeTransfer(e, r, n), Or));
        }
        initSwap(e, n, r) {
            return El(this.#t.stateRef, (s)=>V(this.#n.transactingCapability.initSwap(e, s, n, r), Or));
        }
        revertTransaction(e) {
            return zh(this.#t.stateRef, (n)=>V(this.#n.transactingCapability.revertTransaction(n, e), Or));
        }
        serializeState(e) {
            return this.#n.serializationCapability.serialize(e);
        }
    };
    const h2 = {
        fromSecretKeys: (t)=>({
                coinPublicKey: t.coinPublicKey,
                encryptionPublicKey: t.encryptionPublicKey
            })
    }, pi = {
        empty: {},
        pickAllCoins (t) {
            return [
                ...t.coins,
                ...t.pendingOutputs.values().map(([e])=>e)
            ];
        },
        assertValid (t, e) {
            const n = pi.pickAllCoins(e), r = new Set(K6(n, (o)=>o.nonce)), s = new Set(Object.keys(t)), i = r.difference(s);
            return i.size === 0 ? A2e : Qe(i);
        },
        updateWithCoins (t, e, n) {
            return Q2e(n, (r)=>[
                    r.nonce,
                    e[r.nonce] ?? {
                        commitment: cae(r, t.coinPublicKey),
                        nullifier: lae(r, t.coinSecretKey)
                    }
                ]);
        },
        updateWithNewCoins (t, e, n) {
            const r = pi.updateWithCoins(t, pi.empty, n);
            return rxe(e, r, (s)=>s);
        },
        init (t, e) {
            return pi.updateWithCoins(t, {}, e);
        }
    }, Go = {
        init (t, e, n) {
            const r = h2.fromSecretKeys(e), s = pi.init(e, pi.pickAllCoins(t)), i = sd();
            return {
                state: t,
                publicKeys: r,
                networkId: n,
                coinHashes: s,
                progress: i,
                protocolVersion: Kh
            };
        },
        empty (t, e) {
            return {
                state: new zs,
                publicKeys: t,
                networkId: e,
                coinHashes: pi.empty,
                progress: sd(),
                protocolVersion: Kh
            };
        },
        restore (t, e, n, r, s) {
            const i = h2.fromSecretKeys(e), o = pi.init(e, pi.pickAllCoins(t));
            return {
                state: t,
                publicKeys: i,
                networkId: s,
                coinHashes: o,
                progress: sd(n),
                protocolVersion: ja(r)
            };
        },
        restoreWithCoinHashes (t, e, n, r, s, i) {
            return pi.assertValid(n, e).pipe(aq({
                onLeft: (o)=>new Xat({
                        message: "Missing coin hashes for coins present in the state",
                        missingNonces: o
                    }),
                onRight: ()=>({
                        state: e,
                        publicKeys: t,
                        networkId: i,
                        coinHashes: n,
                        progress: sd(r),
                        protocolVersion: ja(s)
                    })
            }));
        },
        initEmpty (t, e) {
            return this.empty(h2.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 = pi.updateWithCoins(e, t.coinHashes, pi.pickAllCoins(r));
            return {
                ...t,
                state: r,
                coinHashes: s
            };
        },
        replayEvents (t, e, n) {
            const r = t.state.replayEvents(e, n), s = pi.updateWithCoins(e, t.coinHashes, pi.pickAllCoins(r));
            return {
                ...t,
                state: r,
                coinHashes: s
            };
        },
        updateProgress (t, { appliedIndex: e, highestRelevantWalletIndex: n, highestIndex: r, highestRelevantIndex: s, isConnected: i }) {
            const o = sd({
                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, Yl([
                [],
                t.state
            ], ([a, c], l)=>{
                const [u, d] = c.spend(e, l, r), f = rs.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 = pi.updateWithNewCoins(e, t.coinHashes, n);
            return {
                ...t,
                state: r,
                coinHashes: s
            };
        }
    }, Yat = Mi((t)=>t instanceof zs).annotations({
        identifier: "ledger.ZswapLocalState"
    }), Qat = Mi((t)=>t instanceof Uint8Array).annotations({
        identifier: "Uint8Array"
    }), ect = ()=>Za(Qat, Yat, {
            encode: (t)=>Co({
                    try: ()=>t.serialize(),
                    catch: (e)=>new Io(e, "Could not serialize local state")
                }),
            decode: (t)=>Co({
                    try: ()=>zs.deserialize(t),
                    catch: (e)=>new Io(e, "Could not deserialize local state")
                })
        }), tct = ()=>V(ew, Y1(ect())), nct = ()=>{
        const t = tn({
            publicKeys: tn({
                coinPublicKey: gn,
                encryptionPublicKey: gn
            }),
            state: tct(),
            protocolVersion: Ul,
            offset: lh(Ul),
            networkId: gn,
            coinHashes: jNe({
                key: gn,
                value: tn({
                    nullifier: gn,
                    commitment: gn
                })
            })
        });
        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
                    }), cd(t), JSON.stringify),
            deserialize: (e, n)=>V(n, Wc(Q1(t)), qs((r)=>Wat.other(r)), Bg((r)=>Go.restoreWithCoinHashes(r.publicKeys, r.state, r.coinHashes, {
                        appliedIndex: r.offset ?? 0n,
                        highestRelevantWalletIndex: 0n,
                        highestIndex: 0n,
                        highestRelevantIndex: 0n,
                        isConnected: !1
                    }, r.protocolVersion, r.networkId)))
        };
    }, rct = Mi((t)=>t instanceof Uint8Array).annotations({
        identifier: "Uint8Array"
    }), sct = {
        create: (t, e)=>({
                updates: t,
                secretKeys: e
            })
    }, Dte = Mi((t)=>t instanceof kd).annotations({
        identifier: "ledger.Event"
    }), ict = Za(rct, Dte, {
        encode: (t)=>Co({
                try: ()=>t.serialize(),
                catch: (e)=>new Io(e, "Could not serialize ledger event")
            }),
        decode: (t)=>Co({
                try: ()=>kd.deserialize(t),
                catch: (e)=>new Io(e, "Could not deserialize ledger event")
            })
    }), cU = V(ew, Y1(ict)), oct = tn({
        id: Jr,
        raw: gn,
        maxId: Jr
    }), act = HNe("EventsSyncUpdate", {
        id: Jr,
        maxId: Jr,
        event: Dte
    }), cct = Za(oct, act, {
        decode: (t)=>V(Wc(cU)(t.raw), ti((e)=>({
                    _tag: "EventsSyncUpdate",
                    id: t.id,
                    maxId: t.maxId,
                    event: e
                })), qs((e)=>new Io(e, "Failed to decode ledger event payload")), Or),
        encode: (t)=>V(TNe(cU)(t.event), ti((e)=>({
                    id: t.id,
                    raw: e,
                    maxId: t.maxId
                })), qs((e)=>new Io(e, "Failed to encode ledger event payload")), Or)
    }), lct = (t)=>({
            updates: (e, n)=>{
                const { indexerClientConnection: r } = t, s = WA(r.indexerHttpUrl, r.indexerWsUrl);
                if (Qn(s)) return Dy(new x_(new Error(`Could not derive WebSocket URL from indexer HTTP URL: ${s.left.message}`)));
                const i = c5(s.right);
                if (Qn(i)) return Dy(new x_(new Error(`Invalid indexer WS URL: ${i.left.message}`)));
                const o = i.right, a = e.progress?.appliedIndex ?? 0n, c = t.batchSize ?? 10;
                return V(qBe.run({
                    id: Number(a)
                }), sJ(KA({
                    url: o,
                    keepAlive: t.indexerClientConnection.keepAlive
                })), zA((l)=>new x_(l)), nf((l)=>V(l.zswapLedgerEvents, Wc(cct), qs((u)=>new x_(u)), Or)), rJ(c, as(1)), Rx(dC), Rx((l)=>sct.create(l, n)), oJ(J1(as(4))));
            }
        }), uct = ()=>({
            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 ? Go.updateProgress(t, {
                    highestRelevantWalletIndex: s,
                    isConnected: !0
                }) : Go.updateProgress(Go.replayEvents(t, e.secretKeys, e.updates.map((i)=>i.event)), {
                    highestRelevantWalletIndex: s,
                    appliedIndex: r,
                    isConnected: !0
                });
            }
        }), lU = {
        inputFeeOverhead: 0n,
        outputFeeOverhead: 0n
    }, z7 = new class {
        empty = ()=>({
                guaranteed: Is.empty(),
                fallible: Is.empty()
            });
        areBalanced = (t)=>{
            const e = t.fallible.entries().every(([, r])=>r === 0n), n = t.guaranteed.entries().every(([, r])=>r === 0n);
            return e && n;
        };
    }, id = new class {
        default = {
            getImbalances (t) {
                return id.shared.getImbalances(t);
            },
            id (t) {
                return t.identifiers().at(0);
            }
        };
        proofErased = {
            getImbalances (t) {
                return id.shared.getImbalances(t);
            },
            id (t) {
                return t.identifiers().at(0);
            }
        };
        unproven = {
            getImbalances (t) {
                return id.shared.getImbalances(t);
            },
            id (t) {
                return t.identifiers().at(0);
            }
        };
        shared = {
            getImbalances (t) {
                const e = id.shared.getGuaranteedImbalances(t), n = id.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 Is.fromEntries(e);
            },
            getFallibleImbalances: (t)=>{
                try {
                    const e = t.imbalances(1).entries().filter(([n])=>n.tag === "shielded").map(([n, r])=>[
                            n.raw.toString(),
                            r
                        ]);
                    return Is.fromEntries(e);
                } catch  {
                    return Is.empty();
                }
            }
        };
    }, dct = (t, e)=>new fct(t.networkId, ()=>e().coinSelection, ()=>e().coinsAndBalancesCapability, ()=>e().keysCapability, id.default);
    let fct = 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 Hs(this, function*() {
                const s = this.getCoinSelection(), i = this.txOps.getImbalances(r);
                if (z7.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, Is.empty());
                return [
                    xn.fromParts(this.networkId, l, a),
                    c
                ];
            });
        }
        makeTransfer(e, n, r) {
            return Hs(this, function*() {
                const s = yield* V(r, g1((b)=>b.amount > 0n), X8({
                    onEmpty: ()=>Qe(new fc({
                            message: "The amount needs to be positive"
                        })),
                    onNonEmpty: (b)=>lt(b)
                })), i = this.networkId, { initialOffersAndCoins: o, selfCoins: a } = yield* this.#n(n, s), c = V(o, Rs((b)=>b.outputOffer), IS((b, y)=>b.merge(y))), l = xn.fromParts(i, c), u = id.unproven.getImbalances(l), { offer: d, newState: f } = yield* this.#t(e, n, u, this.getCoinSelection(), Is.empty()), p = Go.watchCoins(f, e, a);
                return [
                    l.merge(xn.fromParts(i, d)),
                    p
                ];
            });
        }
        initSwap(e, n, r, s) {
            return Hs(this, function*() {
                if (!s.every((b)=>b.amount > 0n)) return yield* Qe(new fc({
                    message: "The amount needs to be positive"
                }));
                if (!Object.entries(r).every(([, b])=>b > 0n)) return yield* Qe(new fc({
                    message: "The input amounts need to be positive"
                }));
                const a = yield* this.#r(n, s), c = Is.fromEntries(txe(r)), l = this.networkId, { offer: u, newState: d } = yield* this.#t(e, n, z7.empty(), this.getCoinSelection(), c), f = Go.watchCoins(d, e, a.selfCoins), p = xn.fromParts(l, u);
                return [
                    a.unprovenTxToBalance ? a.unprovenTxToBalance.merge(p) : p,
                    f
                ];
            });
        }
        revertTransaction(e, n) {
            return bo({
                try: ()=>Go.revertTransaction(e, n),
                catch: (r)=>new fc({
                        message: `Error while reverting transaction ${n.identifiers().at(0)}`,
                        cause: r
                    })
            });
        }
        #e(e, n, r, s) {
            const [i, o] = Go.spendCoins(n, e, r.inputs, s), a = Go.watchCoins(o, e, r.outputs), c = r.outputs.map((l)=>{
                const u = qi.new(l, s, this.getKeys().getCoinPublicKey(n).toHexString(), this.getKeys().getEncryptionPublicKey(n).toHexString());
                return rs.fromOutput(u, l.type, l.value);
            });
            return V(Uv(i, c), X8({
                onEmpty: ()=>Ve(),
                onNonEmpty: (l)=>V(l, IS((u, d)=>u.merge(d)), Fe)
            }), Tc((l)=>({
                    offer: l,
                    newState: a
                })));
        }
        balanceFallibleSection(e, n, r, s) {
            return bo({
                try: ()=>{
                    const i = F2({
                        coins: this.getCoins().getAvailableCoins(n).map((o)=>o.coin),
                        initialImbalances: r.fallible,
                        transactionCostModel: lU,
                        feeTokenType: "",
                        coinSelection: s,
                        createOutput: (o)=>H9(o.type, o.value),
                        isCoinEqual: (o, a)=>o.type === a.type && o.value === a.value
                    });
                    return V(this.#e(e, n, i, 1), un({
                        onNone: ()=>({
                                newState: n,
                                offer: void 0
                            }),
                        onSome: (o)=>o
                    }));
                },
                catch: (i)=>i instanceof iy ? new aU({
                        message: "Insufficient funds",
                        tokenType: i.tokenType,
                        amount: r.fallible.get(i.tokenType) ?? 0n
                    }) : new fc({
                        message: "Balancing fallible section failed",
                        cause: i
                    })
            });
        }
        #t(e, n, r, s, i) {
            return Hs(this, function*() {
                const o = yield* bo({
                    try: ()=>F2({
                            coins: this.getCoins().getAvailableCoins(n).map((a)=>a.coin),
                            initialImbalances: r.guaranteed,
                            transactionCostModel: lU,
                            feeTokenType: "",
                            coinSelection: s,
                            createOutput: (a)=>H9(a.type, a.value),
                            isCoinEqual: (a, c)=>a.nonce === c.nonce,
                            targetImbalances: i
                        }),
                    catch: (a)=>a instanceof iy ? new aU({
                            message: "Insufficient funds",
                            tokenType: a.tokenType,
                            amount: r.guaranteed.get(a.tokenType) ?? 0n
                        }) : new fc({
                            message: "Balancing guaranteed section failed",
                            cause: a
                        })
                });
                return yield* V(this.#e(e, n, o, 0), GE(()=>new fc({
                        message: "Could not create a valid guaranteed offer"
                    })));
            });
        }
        #n(e, n) {
            return bo({
                try: ()=>{
                    const r = V(n, Rs((i)=>{
                        const { receiverAddress: o, type: a, amount: c } = i, l = H9(a, c), u = qi.new(l, 0, o.coinPublicKey.toHexString(), o.encryptionPublicKey.toHexString()), d = rs.fromOutput(u, a, c);
                        return {
                            coin: l,
                            outputOffer: d,
                            isForSelf: o.coinPublicKey.equals(this.getKeys().getCoinPublicKey(e))
                        };
                    })), s = Dg(r, ({ coin: i, isForSelf: o })=>o ? [
                            i
                        ] : []);
                    return {
                        initialOffersAndCoins: r,
                        selfCoins: s
                    };
                },
                catch: (r)=>new fc({
                        message: "Failed to process desired outputs",
                        cause: r
                    })
            });
        }
        #r(e, n) {
            return V(n, X8({
                onEmpty: ()=>lt({
                        imbalances: z7.empty(),
                        selfCoins: [],
                        unprovenTxToBalance: null
                    }),
                onNonEmpty: (r)=>V(this.#n(e, r), ti(({ initialOffersAndCoins: s, selfCoins: i })=>{
                        const o = this.networkId, a = V(s, Rs((u)=>u.outputOffer), IS((u, d)=>u.merge(d))), c = xn.fromParts(o, a);
                        return {
                            imbalances: id.unproven.getImbalances(c),
                            selfCoins: i,
                            unprovenTxToBalance: c
                        };
                    }))
            }));
        }
    };
    const uU = (t)=>t.reduce((e, { coin: n })=>({
                ...e,
                [n.type]: e[n.type] === void 0 ? n.value : e[n.type] + n.value
            }), {}), hct = ()=>{
        const t = (o)=>{
            const a = r(o);
            return uU(a);
        }, e = (o)=>{
            const a = s(o);
            return uU(a);
        }, n = (o)=>{
            const a = t(o), c = e(o);
            return V([
                a,
                c
            ], qJ(0n, (l, u)=>l + u));
        }, r = (o)=>{
            const a = new Set([
                ...o.state.pendingSpends.values()
            ].map(([c])=>c.nonce));
            return V([
                ...o.state.coins
            ], g1((c)=>!a.has(c.nonce)), Rs((c)=>({
                    coin: c,
                    commitment: o.coinHashes[c.nonce].commitment,
                    nullifier: o.coinHashes[c.nonce].nullifier
                })));
        }, s = (o)=>V([
                ...o.state.pendingOutputs.values()
            ], Rs(([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)
                ]
        };
    }, pct = ()=>({
            getCoinPublicKey: (t)=>new ra(Buffer.from(t.publicKeys.coinPublicKey, "hex")),
            getEncryptionPublicKey: (t)=>new Xl(Buffer.from(t.publicKeys.encryptionPublicKey, "hex")),
            getAddress: (t)=>{
                const e = new ra(Buffer.from(t.publicKeys.coinPublicKey, "hex")), n = new Xl(Buffer.from(t.publicKeys.encryptionPublicKey, "hex"));
                return new $l(e, n);
            }
        }), gct = ()=>({
            updateTxHistory: (t, e)=>e.reduce((n, r)=>Go.addTransaction(n, r), t),
            transactionHistory: (t)=>[]
        });
    let bct = class gl {
        #e;
        constructor(e = {}){
            this.#e = e;
        }
        withDefaults() {
            return this.withDefaultTransactionType().withSyncDefaults().withSerializationDefaults().withTransactingDefaults().withCoinsAndBalancesDefaults().withTransactionHistoryDefaults().withKeysDefaults().withCoinSelectionDefaults();
        }
        withTransactionType() {
            return new gl({
                ...this.#e,
                transactingCapability: void 0,
                transactionHistoryCapability: void 0
            });
        }
        withDefaultTransactionType() {
            return this.withTransactionType();
        }
        withSyncDefaults() {
            return this.withSync(lct, uct);
        }
        withSync(e, n) {
            return new gl({
                ...this.#e,
                syncService: e,
                syncCapability: n
            });
        }
        withSerializationDefaults() {
            return this.withSerialization(nct);
        }
        withSerialization(e) {
            return new gl({
                ...this.#e,
                serializationCapability: e
            });
        }
        withTransactingDefaults() {
            return this.withTransacting(dct);
        }
        withTransacting(e) {
            return new gl({
                ...this.#e,
                transactingCapability: e
            });
        }
        withCoinSelection(e) {
            return new gl({
                ...this.#e,
                coinSelection: e
            });
        }
        withCoinSelectionDefaults() {
            return this.withCoinSelection(()=>BE);
        }
        withCoinsAndBalancesDefaults() {
            return this.withCoinsAndBalances(hct);
        }
        withCoinsAndBalances(e) {
            return new gl({
                ...this.#e,
                coinsAndBalancesCapability: e
            });
        }
        withTransactionHistoryDefaults() {
            return this.withTransactionHistory(gct);
        }
        withTransactionHistory(e) {
            return new gl({
                ...this.#e,
                transactionHistoryCapability: e
            });
        }
        withKeysDefaults() {
            return this.withKeys(pct);
        }
        withKeys(e) {
            return new gl({
                ...this.#e,
                keysCapability: e
            });
        }
        build(e) {
            const n = this.#t(e), { networkId: r } = e;
            return {
                __polyTag__: _l,
                coinsAndBalances: n.coinsAndBalancesCapability,
                keys: n.keysCapability,
                serialization: n.serializationCapability,
                transactionHistory: n.transactionHistoryCapability,
                start (s) {
                    return Gn(function*() {
                        const i = yield* La;
                        return new Jat(i, s, n);
                    });
                },
                migrateState (s) {
                    const i = ete("0000000000000000000000000000000000000000000000000000000000000001");
                    return Gt(Go.empty(h2.fromSecretKeys(Ui.fromSeed(i)), r));
                },
                deserializeState: (s)=>n.serializationCapability.deserialize(null, s)
            };
        }
        #t(e) {
            if (!mct(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 mct = (t)=>[
            "syncService",
            "syncCapability",
            "transactingCapability",
            "coinSelection",
            "serializationCapability",
            "coinsAndBalancesCapability",
            "keysCapability",
            "transactionHistoryCapability"
        ].every((n)=>typeof t[n] == "function");
    class TO {
        static mapState = (e)=>(n)=>new TO(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 HT(t) {
        return yct(t, new bct().withDefaults());
    }
    function yct(t, e) {
        const n = [
            t
        ], r = vg.init().withVariant(Kh, e).build(...n);
        return class bl extends r {
            static startWithSecretKeys(i) {
                return bl.startFirst(bl, Go.initEmpty(i, bl.configuration.networkId));
            }
            static startWithSeed(i) {
                const o = Ui.fromSeed(i);
                return bl.startWithSecretKeys(o);
            }
            static restore(i) {
                const o = bl.allVariantsRecord()[_l].variant.deserializeState(i).pipe(Dv);
                return bl.startFirst(bl, o);
            }
            state;
            constructor(i, o){
                super(i, o), this.state = this.rawState.pipe(ye(TO.mapState(bl.allVariantsRecord()[_l].variant)), d5({
                    refCount: !0,
                    bufferSize: 1
                }));
            }
            start(i) {
                return this.runtime.dispatch({
                    [_l]: (o)=>o.startSyncInBackground(i)
                }).pipe(En);
            }
            balanceTransaction(i, o) {
                return this.runtime.dispatch({
                    [_l]: (a)=>a.balanceTransaction(i, o)
                }).pipe(En);
            }
            transferTransaction(i, o) {
                return this.runtime.dispatch({
                    [_l]: (a)=>a.transferTransaction(i, o)
                }).pipe(En);
            }
            initSwap(i, o, a) {
                return this.runtime.dispatch({
                    [_l]: (c)=>c.initSwap(i, o, a)
                }).pipe(En);
            }
            revertTransaction(i) {
                return this.runtime.dispatch({
                    [_l]: (o)=>o.revertTransaction(i)
                }).pipe(En);
            }
            waitForSyncedState(i = 0n) {
                return Mn(this.state.pipe(bu((o)=>o.state.progress.isCompleteWithin(i))));
            }
            serializeState() {
                return Mn(this.state).then((i)=>i.serialize());
            }
            getAddress() {
                return Mn(this.state).then((i)=>i.address);
            }
        };
    }
    const dU = {
        fromSecretKey: (t)=>({
                publicKey: t.publicKey
            })
    }, mo = {
        init (t, e, n) {
            return mo.empty(t, dU.fromSecretKey(e), n);
        },
        initEmpty (t, e, n) {
            return mo.empty(new Yo(t), dU.fromSecretKey(e), n);
        },
        empty (t, e, n) {
            return {
                state: t,
                publicKey: e,
                networkId: n,
                pendingDust: [],
                progress: sd(),
                protocolVersion: Kh
            };
        },
        restore (t, e, n, r, s, i) {
            return {
                state: t,
                publicKey: e,
                networkId: i,
                pendingDust: n,
                progress: sd(r),
                protocolVersion: ja(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 = mo.pendingDustToMap(t.pendingDust), r = V([
                ...e.intents?.values() ?? []
            ], Dg((o)=>{
                const a = o.dustActions?.ctime;
                return (o.dustActions?.spends ?? []).map((c)=>({
                        spend: c,
                        spendTime: a
                    }));
            }), Hv(({ spend: o, spendTime: a })=>V(Yh(n.get(o.oldNullifier)), Tc(()=>({
                        spend: o,
                        spendTime: a
                    }))))), [s, i] = V(r, Yl([
                t.state,
                []
            ], ([o, a], { spend: c, spendTime: l })=>[
                    o.processTtls(wJ(l, t.state.params.dustGracePeriodSeconds)),
                    ly(a, c.oldNullifier)
                ]));
            return {
                ...t,
                state: s,
                pendingDust: t.pendingDust.filter((o)=>!i.includes(o.nullifier))
            };
        },
        revertTransaction (t, e) {
            return mo.applyFailed(t, e);
        },
        updateProgress (t, { appliedIndex: e, highestRelevantWalletIndex: n, highestIndex: r, highestRelevantIndex: s, isConnected: i }) {
            const o = sd({
                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, Yl([
                [],
                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 [
                    ly(a, p),
                    f,
                    h
                ];
            }));
            return [
                s,
                {
                    ...t,
                    state: i,
                    pendingDust: o
                }
            ];
        },
        pendingDustToMap (t) {
            return new Map(t.map(({ nullifier: e, ...n })=>[
                    e,
                    n
                ]));
        }
    };
    class cu extends wn("Wallet.Other") {
    }
    class U7 extends wn("Wallet.Sync") {
    }
    class v_ extends wn("Wallet.Transacting") {
    }
    class wct extends wn("Wallet.InsufficientFunds") {
    }
    const _ct = (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 [
            fO({
                sourceGap: i,
                applyGap: o
            })
        ];
    }, xct = (t, e)=>t.protocolVersion != e.protocolVersion ? [
            hO({
                change: gO({
                    version: ja(e.protocolVersion)
                })
            })
        ] : [], ka = Symbol("V1");
    class vct {
        __polyTag__ = ka;
        #e;
        #t;
        #n;
        state;
        constructor(e, n, r){
            this.#e = e, this.#t = n, this.#n = r, this.state = nu(n.stateRef.get).pipe(Vc((s)=>n.stateRef.changes.pipe(LA(s, (i, o)=>[
                        o,
                        [
                            i,
                            o
                        ]
                    ]))), s5(([s, i])=>[
                    dO({
                        state: i
                    }),
                    ..._ct(i),
                    ...xct(s, i)
                ]));
        }
        startSyncInBackground(e) {
            return this.startSync(e).pipe(UA(FA), q1, Dd(La, this.#e));
        }
        startSync(e) {
            return V(uh(this.#t.stateRef), nu, Vc((n)=>this.#n.syncService.updates(n, e)), nf((n)=>zh(this.#t.stateRef, (r)=>Co({
                        try: ()=>this.#n.syncCapability.applyUpdate(r, n),
                        catch: (s)=>new cu({
                                message: "Error while applying sync update",
                                cause: s
                            })
                    }))), HA((n)=>xA(n)), i5(V(Z1(hu(1), 2), hA((n)=>{
                const r = w1(2), s = as(Math.floor(Math.random() * 1e3)), i = Si(n) + Si(s);
                return as(Math.min(i, Si(r)));
            }))));
        }
        createDustGenerationTransaction(e, n, r, s, i) {
            return r.some((o)=>o.type !== Av().raw) ? Bs(new cu({
                message: "Token of a non-Night type received"
            })) : qX.pipe(Vf("currentState", ()=>uh(this.#t.stateRef)), Vf("blockData", ()=>this.#n.syncService.blockData()), AV("currentTime", ({ blockData: o })=>e ?? o.timestamp), AV("utxosWithDustValue", ({ currentState: o, currentTime: a })=>this.#n.coinsAndBalancesCapability.estimateDustGeneration(o, r, a)), Ge(({ utxosWithDustValue: o, currentTime: a })=>this.#n.transactingCapability.createDustGenerationTransaction(a, n, o, s, i).pipe(Or)));
        }
        addDustGenerationSignature(e, n) {
            return this.#n.transactingCapability.addDustGenerationSignature(e, n).pipe(Or);
        }
        calculateFee(e) {
            return V(this.#n.syncService.blockData(), ht((n)=>V(e, Rs((r)=>this.#n.transactingCapability.calculateFee(r, n.ledgerParameters)), $Be)));
        }
        estimateFee(e, n, r, s) {
            return V(Ay([
                uh(this.#t.stateRef),
                this.#n.syncService.blockData()
            ]), Ge(([i, o])=>V(this.#n.transactingCapability.estimateFee(e, i, n, r, s ?? o.timestamp, o.ledgerParameters), Or)));
        }
        balanceTransactions(e, n, r, s) {
            return El(this.#t.stateRef, (i)=>V(this.#n.syncService.blockData(), Ge((o)=>this.#n.transactingCapability.balanceTransactions(e, i, n, r, s ?? o.timestamp, o.ledgerParameters))));
        }
        revertTransaction(e) {
            return zh(this.#t.stateRef, (n)=>V(this.#n.transactingCapability.revertTransaction(n, e), Or));
        }
    }
    const Sct = Mi((t)=>t instanceof Yo).annotations({
        identifier: "ledger.DustLocalState"
    }), Fte = Mi((t)=>t instanceof Uint8Array).annotations({
        identifier: "Uint8Array"
    }), kct = Za(Fte, Sct, {
        encode: (t)=>Co({
                try: ()=>t.serialize(),
                catch: (e)=>new Io(e, "Could not serialize local state")
            }),
        decode: (t)=>Co({
                try: ()=>Yo.deserialize(t),
                catch: (e)=>new Io(e, "Could not deserialize local state")
            })
    }), Tct = V(ew, Y1(kct)), fU = tn({
        publicKey: tn({
            publicKey: Ul
        }),
        state: Tct,
        protocolVersion: Ul,
        networkId: gn,
        offset: lh(Ul)
    }), Ect = ()=>({
            serialize: (t)=>V(t, (n)=>({
                        publicKey: n.publicKey,
                        state: n.state,
                        protocolVersion: n.protocolVersion,
                        networkId: n.networkId,
                        offset: n.progress?.appliedIndex
                    }), cd(fU), JSON.stringify),
            deserialize: (t, e)=>V(e, Wc(Q1(fU)), qs((n)=>new cu({
                        message: "Error while deserializing snapshot",
                        cause: n
                    })), Bg((n)=>bo({
                        try: ()=>mo.restore(n.state, n.publicKey, [], {
                                appliedIndex: n.offset ?? 0n,
                                highestRelevantWalletIndex: 0n,
                                highestIndex: 0n,
                                highestRelevantIndex: 0n
                            }, n.protocolVersion, n.networkId),
                        catch: (r)=>new cu({
                                message: "Error while restoring core wallet",
                                cause: r
                            })
                    })))
        }), Cct = Mi((t)=>t instanceof kd).annotations({
        identifier: "ledger.Event"
    }), Ict = Za(Fte, Cct, {
        encode: (t)=>Co({
                try: ()=>t.serialize(),
                catch: (e)=>new Io(e, "Could not serialize Ledger Event")
            }),
        decode: (t)=>Co({
                try: ()=>kd.deserialize(t),
                catch: (e)=>new Io(e, "Could not deserialize Ledger Event")
            })
    }), Act = V(ew, Y1(Ict)), Pct = tn({
        id: Jr,
        raw: Act,
        maxId: Jr
    }), Oct = {
        create: (t, e, n)=>({
                updates: t,
                secretKey: e,
                timestamp: n
            })
    }, Mct = (t)=>{
        const e = Rct(t);
        return {
            updates: (n, r)=>{
                const i = as(1);
                return V(e.subscribeWallet(n), rJ(10, i), Rx(dC), Rx((o)=>Oct.create(o, r, new Date)), oJ(J1(as(4))), _Ve(e.connectionLayer()));
            },
            blockData: ()=>Gn(function*() {
                    return (yield* (yield* LBe)({
                        offset: null
                    })).block;
                }).pipe(Bd(e.queryClient()), jI, lb((n)=>Bs(new cu({
                        message: `Encountered unexpected error: ${n.message}`,
                        cause: n
                    }))), Ge((n)=>{
                    if (!n) throw new cu({
                        message: "Unable to fetch block data"
                    });
                    return n2(()=>({
                            hash: n.hash,
                            height: n.height,
                            ledgerParameters: wi.deserialize(Buffer.from(n.ledgerParameters, "hex")),
                            timestamp: new Date(n.timestamp)
                        }));
                }))
        };
    }, Rct = (t)=>({
            queryClient () {
                return V(qA({
                    url: t.indexerClientConnection.indexerHttpUrl
                }), OV((e)=>new cu(e)));
            },
            connectionLayer () {
                const { indexerClientConnection: e } = t;
                return WA(e.indexerHttpUrl, e.indexerWsUrl).pipe(Bg((n)=>c5(n)), cr({
                    onLeft: (n)=>AAe(n),
                    onRight: (n)=>KA({
                            url: n,
                            keepAlive: e.keepAlive
                        })
                }), OV((n)=>new U7({
                        message: "Failed to to obtain correct indexer URLs",
                        cause: n
                    })));
            },
            subscribeWallet (e) {
                const { appliedIndex: n } = e.progress;
                return V(HBe.run({
                    id: Number(n)
                }), nf((r)=>V(Wc(Pct)(r.dustLedgerEvents), qs((s)=>new U7(s)), Or)), zA((r)=>new U7(r)));
            }
        }), Nct = ()=>({
            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 mo.updateProgress(t, {
                    highestRelevantWalletIndex: o,
                    isConnected: !0
                });
                const a = n.map((c)=>c.raw).filter((c)=>c !== null);
                return mo.updateProgress(mo.applyEvents(t, r, a, e.timestamp), {
                    appliedIndex: i,
                    highestRelevantWalletIndex: o,
                    isConnected: !0
                });
            }
        }), Vct = ()=>({
            getPublicKey: (t)=>t.publicKey.publicKey,
            getAddress: (t)=>new Df(t.publicKey.publicKey)
        }), Bct = (t)=>t.toSorted((e, n)=>Number(e.value - n.value)).at(0), Dct = "0".repeat(64), Fct = (t, e)=>{
        const n = (h, b)=>h.state.walletBalance(b), r = (h)=>{
            const b = new Set([
                ...h.pendingDust.values()
            ].map((y)=>y.nonce));
            return V(h.state.utxos, g1((y)=>!b.has(y.nonce)));
        }, s = (h)=>h.pendingDust, i = (h)=>[
                ...r(h),
                ...s(h)
            ], o = (h, b)=>{
            const y = h.state.generationInfo(b);
            return y && y.dtime ? {
                ...y,
                dtime: new Date(+y.dtime)
            } : y;
        }, a = (h, b)=>{
            const y = [], _ = r(h);
            for (const v of _){
                const w = o(h, v);
                if (w) {
                    const E = RR(v.ctime, v.initialValue, w, b, h.state.params);
                    y.push({
                        token: v,
                        value: E
                    });
                }
            }
            return y;
        }, c = (h, b)=>{
            const y = [], _ = r(h);
            for (const v of _){
                const w = o(h, v);
                w && y.push({
                    token: v,
                    ...l(h.state.params, w, v, b)
                });
            }
            return y;
        }, l = (h, b, y, _)=>{
            const v = RR(y.ctime, y.initialValue, b, _, h);
            return {
                dtime: b.dtime,
                maxCap: b.value * h.nightDustRatio,
                maxCapReachedAt: wJ(y.ctime, h.timeToCapSeconds),
                generatedNow: v,
                rate: b.value * h.generationDecayRate
            };
        }, u = (h, b, y)=>{
            const _ = e().keysCapability.getPublicKey(h);
            return V(b, Rs((v)=>{
                const w = d(v, _), E = f(_, v), I = l(h.state.params, w, E, y);
                return {
                    utxo: v,
                    dust: I
                };
            }));
        }, d = (h, b)=>({
                value: h.value,
                owner: b,
                nonce: Dct,
                dtime: void 0
            }), f = (h, b)=>({
                initialValue: 0n,
                owner: h,
                nonce: 0n,
                seq: 0,
                ctime: b.ctime,
                backingNight: "",
                mtIndex: 0n
            });
        return {
            getWalletBalance: n,
            getAvailableCoins: r,
            getPendingCoins: s,
            getTotalCoins: i,
            getAvailableCoinsWithGeneratedDust: a,
            getAvailableCoinsWithFullInfo: c,
            getGenerationInfo: o,
            estimateDustGeneration: u,
            splitNightUtxos: (h)=>{
                const [b, y] = V(h, K0(V(N2e, V2e, Th((_)=>_.dust.generatedNow))), JE(1));
                return {
                    guaranteed: b,
                    fallible: y
                };
            }
        };
    }, S_ = {
        signature: "signature"
    }, Lp = {
        preProof: "pre-proof"
    }, hU = {
        preBinding: "pre-binding"
    }, Lct = (t, e)=>new EO(t.networkId, t.costParameters, ()=>e().coinSelection, ()=>e().coinsAndBalancesCapability, ()=>e().keysCapability), zct = (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 EO {
        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 Ve();
                const c = V(a, K6((d)=>d.utxo.value), aN), l = a.map(({ utxo: d })=>({
                        ...d,
                        owner: s
                    })), u = {
                    owner: Aj(s),
                    type: Av().raw,
                    value: c
                };
                return Fe(go.new(l, [
                    u
                ], []));
            };
            return Hs(this, function*() {
                const a = i ? i.data : void 0;
                return yield* n2(()=>{
                    const c = this.networkId, l = this.getCoins().splitNightUtxos(r), u = a ? V(l.guaranteed, Y2e((y)=>!y.utxo.registeredForDustGeneration), K6((y)=>y.dust.generatedNow), aN) : 0n, d = o(l.guaranteed), f = o(l.fallible), p = new Gl(S_.signature, s, a, u), h = new Ca(S_.signature, Lp.preProof, e, [], [
                        p
                    ]), b = V(Gr.new(n), (y)=>un(d, {
                            onNone: ()=>y,
                            onSome: (_)=>(y.guaranteedUnshieldedOffer = _, y)
                        }), (y)=>un(f, {
                            onNone: ()=>y,
                            onSome: (_)=>(y.fallibleUnshieldedOffer = _, y)
                        }), (y)=>(y.dustActions = h, y));
                    return xn.fromParts(c, void 0, void 0, b);
                });
            });
        }
        addDustGenerationSignature(e, n) {
            return Hs(this, function*() {
                const r = e.intents?.get(1);
                if (!r) return yield* Qe(new v_({
                    message: "No intent found in the transaction intents with segment = 1"
                }));
                const { dustActions: s, guaranteedUnshieldedOffer: i, fallibleUnshieldedOffer: o } = r;
                if (!s) return yield* Qe(new v_({
                    message: "No dustActions found in intent"
                }));
                if (!i) return yield* Qe(new v_({
                    message: "No guaranteedUnshieldedOffer found in intent"
                }));
                const [a, ...c] = s.registrations;
                return a ? yield* n2(()=>{
                    const l = new Ed(n), u = new Gl(l.instance, a.nightKey, a.dustAddress, a.allowFeePayment, l), d = new Ca(l.instance, Lp.preProof, s.ctime, s.spends, [
                        u,
                        ...c
                    ]), f = Gr.deserialize(l.instance, Lp.preProof, hU.preBinding, r.serialize());
                    f.dustActions = d;
                    const p = i.inputs.length, h = [];
                    for(let y = 0; y < p; ++y)h.push(i.signatures.at(y) ?? n);
                    if (f.guaranteedUnshieldedOffer = i.addSignatures(h), o) {
                        const y = o.inputs.length, _ = [];
                        for(let v = 0; v < y; ++v)_.push(o.signatures.at(v) ?? n);
                        f.fallibleUnshieldedOffer = o.addSignatures(_);
                    }
                    const b = xn.deserialize(l.instance, Lp.preProof, hU.preBinding, e.serialize());
                    return b.intents = b.intents.set(1, f), b;
                }) : yield* Qe(new v_({
                    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] = mo.spendCoins(s, r, e, o), u = Gr.new(i);
            u.dustActions = new Ca(S_.signature, Lp.preProof, o, [
                ...l
            ], []);
            const f = xn.fromPartsRandomized(c, void 0, void 0, u).eraseProofs(), p = n.reduce((h, b)=>h.merge(b.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 + EO.feeImbalance(u, this.calculateFee(u, o)), 0n), c = this.getCoins().getAvailableCoinsWithGeneratedDust(n, i);
            return V(wAe({
                currentFee: a,
                recipeInputs: [],
                converged: !1
            }, {
                while: (l)=>!l.converged,
                body: ({ currentFee: l })=>Co({
                        try: ()=>{
                            const d = F2({
                                coins: c.map((h)=>({
                                        type: "dust",
                                        value: h.value,
                                        token: h.token
                                    })),
                                initialImbalances: Is.fromEntry("dust", l),
                                feeTokenType: "dust",
                                transactionCostModel: {
                                    inputFeeOverhead: 0n,
                                    outputFeeOverhead: 0n
                                },
                                createOutput: (h)=>h,
                                isCoinEqual: (h, b)=>h.type === b.type && h.value === b.value
                            }).inputs.map((h)=>({
                                    token: h.token,
                                    value: h.value
                                })), f = this.dryRunFee(d, r, e, n, s, i, o), p = d.reduce((h, b)=>h + b.value, 0n);
                            return {
                                currentFee: f,
                                recipeInputs: d,
                                converged: f <= p
                            };
                        },
                        catch: (u)=>u instanceof iy ? new wct({
                                message: u.message,
                                tokenType: u.tokenType
                            }) : new cu({
                                message: u instanceof Error ? u.message : "Dust balancing failed",
                                cause: u
                            })
                    })
            }), If, Ki, ti(({ currentFee: l, recipeInputs: u })=>({
                    fee: l,
                    recipeInputs: zct(u, l)
                })));
        }
        estimateFee(e, n, r, s, i, o) {
            return V(this.computeBalancingRecipe(e, n, r, s, i, o), ti(({ fee: a })=>a));
        }
        balanceTransactions(e, n, r, s, i, o) {
            const a = this.networkId;
            return V(this.computeBalancingRecipe(e, n, r, s, i, o), Bg(({ recipeInputs: c })=>n2(()=>{
                    const l = Gr.new(s), [u, d] = mo.spendCoins(n, e, c, i);
                    return l.dustActions = new Ca(S_.signature, Lp.preProof, i, [
                        ...u
                    ], []), [
                        xn.fromPartsRandomized(a, void 0, void 0, l),
                        d
                    ];
                })));
        }
        revertTransaction(e, n) {
            return bo({
                try: ()=>mo.revertTransaction(e, n),
                catch: (r)=>new cu({
                        message: `Error while reverting transaction ${n.identifiers().at(0)}`,
                        cause: r
                    })
            });
        }
    }
    class xl {
        #e;
        constructor(e = {}){
            this.#e = e;
        }
        withDefaults() {
            return this.withDefaultTransactionType().withSyncDefaults().withSerializationDefaults().withTransactingDefaults().withCoinsAndBalancesDefaults().withKeysDefaults().withCoinSelectionDefaults();
        }
        withTransactionType() {
            return new xl({
                ...this.#e,
                transactingCapability: void 0
            });
        }
        withDefaultTransactionType() {
            return this.withTransactionType();
        }
        withSyncDefaults() {
            return this.withSync(Mct, Nct);
        }
        withSync(e, n) {
            return new xl({
                ...this.#e,
                syncService: e,
                syncCapability: n
            });
        }
        withSerializationDefaults() {
            return this.withSerialization(Ect);
        }
        withSerialization(e) {
            return new xl({
                ...this.#e,
                serializationCapability: e
            });
        }
        withTransactingDefaults() {
            return this.withTransacting(Lct);
        }
        withTransacting(e) {
            return new xl({
                ...this.#e,
                transactingCapability: e
            });
        }
        withCoinSelection(e) {
            return new xl({
                ...this.#e,
                coinSelection: e
            });
        }
        withCoinSelectionDefaults() {
            return this.withCoinSelection(()=>Bct);
        }
        withCoinsAndBalancesDefaults() {
            return this.withCoinsAndBalances(Fct);
        }
        withCoinsAndBalances(e) {
            return new xl({
                ...this.#e,
                coinsAndBalancesCapability: e
            });
        }
        withKeysDefaults() {
            return this.withKeys(Vct);
        }
        withKeys(e) {
            return new xl({
                ...this.#e,
                keysCapability: e
            });
        }
        build(e) {
            const n = this.#t(e);
            return {
                __polyTag__: ka,
                coinsAndBalances: n.coinsAndBalancesCapability,
                keys: n.keysCapability,
                serialization: n.serializationCapability,
                start (r) {
                    return Gn(function*() {
                        const s = yield* La;
                        return new vct(s, r, n);
                    });
                },
                migrateState (r) {
                    return Gt(r);
                },
                deserializeState: (r)=>n.serializationCapability.deserialize(null, r)
            };
        }
        #t(e) {
            if (!Uct(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 Uct = (t)=>[
            "syncService",
            "syncCapability",
            "transactingCapability",
            "coinSelection",
            "serializationCapability",
            "coinsAndBalancesCapability",
            "keysCapability"
        ].every((n)=>typeof t[n] == "function");
    class CO {
        static mapState = (e)=>(n)=>new CO(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 jT(t) {
        const e = vg.init().withVariant(Kh, new xl().withDefaults()).build(t);
        return class ml extends e {
            static startWithSeed(r, s) {
                const i = Ma.fromSeed(r);
                return ml.startFirst(ml, mo.initEmpty(s, i, t.networkId));
            }
            static startWithSecretKey(r, s) {
                return ml.startFirst(ml, mo.initEmpty(s, r, t.networkId));
            }
            static restore(r) {
                const s = ml.allVariantsRecord()[ka].variant.deserializeState(r).pipe(Dv);
                return ml.startFirst(ml, s);
            }
            state;
            constructor(r, s){
                super(r, s), this.state = this.rawState.pipe(ye(CO.mapState(ml.allVariantsRecord()[ka].variant)), d5({
                    refCount: !0,
                    bufferSize: 1
                }));
            }
            start(r) {
                return this.runtime.dispatch({
                    [ka]: (s)=>s.startSyncInBackground(r)
                }).pipe(En);
            }
            async createDustGenerationTransaction(r, s, i, o, a) {
                return this.runtime.dispatch({
                    [ka]: (c)=>c.createDustGenerationTransaction(r, s, i, o, a)
                }).pipe(En);
            }
            addDustGenerationSignature(r, s) {
                return this.runtime.dispatch({
                    [ka]: (i)=>i.addDustGenerationSignature(r, s)
                }).pipe(En);
            }
            calculateFee(r) {
                return this.runtime.dispatch({
                    [ka]: (s)=>s.calculateFee(r)
                }).pipe(En);
            }
            estimateFee(r, s, i, o) {
                const a = i ?? new Date(Date.now() + 36e5);
                return this.runtime.dispatch({
                    [ka]: (c)=>c.estimateFee(r, s, a, o)
                }).pipe(En);
            }
            balanceTransactions(r, s, i, o) {
                return this.runtime.dispatch({
                    [ka]: (a)=>a.balanceTransactions(r, s, i, o)
                }).pipe(En);
            }
            revertTransaction(r) {
                return this.runtime.dispatch({
                    [ka]: (s)=>s.revertTransaction(r)
                }).pipe(En);
            }
            waitForSyncedState(r = 0n) {
                return Mn(this.state.pipe(bu((s)=>s.state.progress.isCompleteWithin(r))));
            }
            serializeState() {
                return Mn(this.state).then((r)=>r.serialize());
            }
            getAddress() {
                return Mn(this.state).then((r)=>r.address);
            }
        };
    }
    function Hct(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 = VE(i, a);
                return s(n, c);
            },
            async check (i, o) {
                const a = RE(i), c = await s(r, a);
                return NE(c);
            }
        };
    }
    function qT(t) {
        switch(t.mode){
            case "proofstation":
                {
                    if (!t.apiKey) throw new Error("Proof Station requires an API key. Get one at proofstation.io");
                    const e = {
                        "X-API-Key": t.apiKey
                    };
                    t.clientId && (e["X-Client-ID"] = t.clientId);
                    const n = Hct(t.url, e), r = WLe(n);
                    return {
                        prove (s) {
                            return En(r.prove(s));
                        }
                    };
                }
            case "wasm":
                return JLe({});
            case "local":
            case "custom":
            default:
                return ZLe({
                    provingServerUrl: new URL(t.url)
                });
        }
    }
    const H7 = 1e5, IO = 6e5, Jy = 2, jct = 16, qct = 12;
    function KT(t) {
        const e = t instanceof Uint8Array ? t : new Uint8Array(t);
        let n = "";
        for(let r = 0; r < e.length; r++)n += String.fromCharCode(e[r]);
        return btoa(n);
    }
    function Wh(t) {
        const e = atob(t), n = new Uint8Array(e.length);
        for(let r = 0; r < e.length; r++)n[r] = e.charCodeAt(r);
        return n;
    }
    async function p2(t, e, n = IO) {
        const r = typeof t == "string" ? new TextEncoder().encode(t) : new Uint8Array(t), s = await crypto.subtle.importKey("raw", r.buffer, "PBKDF2", !1, [
            "deriveKey"
        ]);
        return r.fill(0), crypto.subtle.deriveKey({
            name: "PBKDF2",
            salt: e.buffer,
            iterations: n,
            hash: "SHA-256"
        }, s, {
            name: "AES-GCM",
            length: 256
        }, !1, [
            "encrypt",
            "decrypt"
        ]);
    }
    async function Lte(t, e, n) {
        const r = new TextEncoder, s = crypto.getRandomValues(new Uint8Array(qct)), i = {
            name: "AES-GCM",
            iv: s.buffer
        };
        n && (i.additionalData = n.buffer);
        const o = r.encode(e), a = await crypto.subtle.encrypt(i, t, o);
        return o.fill(0), {
            iv: KT(s),
            ciphertext: KT(a)
        };
    }
    async function Xf(t, e, n, r) {
        const s = new TextDecoder, i = Wh(n), o = Wh(e), a = {
            name: "AES-GCM",
            iv: i.buffer
        };
        r && (a.additionalData = r.buffer);
        const c = await crypto.subtle.decrypt(a, t, o.buffer);
        return s.decode(c);
    }
    function Kct() {
        return crypto.getRandomValues(new Uint8Array(jct));
    }
    function AO(t, e) {
        const n = Wh(e), r = new Uint8Array(1 + n.length);
        return r[0] = t, r.set(n, 1), r;
    }
    async function zte(t, e) {
        const n = Kct(), r = await p2(t, n, IO), s = JSON.stringify(e), i = KT(n), o = AO(Jy, i), { iv: a, ciphertext: c } = await Lte(r, s, o);
        return {
            version: Jy,
            salt: i,
            iv: a,
            ciphertext: c
        };
    }
    async function pU(t, e) {
        const n = Wh(e.salt), r = e.version === 1 ? H7 : IO, s = await p2(t, n, r), i = e.version >= 2 ? AO(e.version, e.salt) : void 0;
        let o, a = !1;
        try {
            o = await Xf(s, e.ciphertext, e.iv, i);
        } catch (l) {
            if (e.version >= 2) {
                try {
                    o = await Xf(s, e.ciphertext, e.iv);
                } catch  {
                    try {
                        const u = await p2(t, n, H7);
                        o = await Xf(u, e.ciphertext, e.iv);
                    } catch  {
                        try {
                            const u = await p2(t, n, H7);
                            o = await Xf(u, e.ciphertext, e.iv, i);
                        } catch  {
                            throw l;
                        }
                    }
                }
                a = !0;
            } else throw l;
        }
        const c = JSON.parse(o);
        if (!c || typeof c.seed != "string" || typeof c.nightExternalKey != "string" || typeof c.zswapKeys != "string" || typeof c.dustKeys != "string") throw new Error("Invalid vault structure");
        return {
            contents: c,
            key: s,
            needsUpgrade: e.version < Jy || a
        };
    }
    async function _w(t, e, n) {
        const r = JSON.stringify(n), s = AO(Jy, e), { iv: i, ciphertext: o } = await Lte(t, r, s);
        return {
            version: Jy,
            salt: e,
            iv: i,
            ciphertext: o
        };
    }
    vn = function(...t) {
        return eae(hj(t));
    };
    const k_ = (t, e)=>({
            indexerUrl: t.indexerWsUrl,
            networkId: t.networkId,
            costParameters: {
                additionalFeeOverhead: 300000000000000n,
                feeBlocksMargin: 5
            },
            indexerClientConnection: {
                indexerHttpUrl: t.indexerHttpUrl,
                indexerWsUrl: t.indexerWsUrl
            },
            txHistoryStorage: e ?? new bh
        });
    let Ute = "0:0";
    let T_, ud, zp, gU, Wct;
    T_ = (t, e)=>{
        Ute = `${t}:${e}`;
    };
    ud = (t)=>`${t}:${Ute}`;
    zp = async (t)=>{
        await cn.setItem(ud("local:txHistoryCache"), t);
    };
    gU = async ()=>{
        const t = await cn.getItem(ud("local:txHistoryCache"));
        if (!t) return null;
        try {
            return bh.fromSerialized(t);
        } catch  {
            return null;
        }
    };
    Wct = (t)=>new Uint8Array(Buffer.from(t, "base64"));
    Hte = (t)=>{
        const e = got(t);
        return Buffer.from(e).toString("base64");
    };
    let Yy = null, Qy = null;
    const $ct = 1e3, Xct = 6e4;
    async function Gct() {
        const t = await cn.getItem("local:unlockFailCount") ?? 0, e = await cn.getItem("local:unlockLockedUntil") ?? 0;
        return {
            failCount: t,
            lockedUntil: e
        };
    }
    async function bU(t, e) {
        await cn.setItem("local:unlockFailCount", t), await cn.setItem("local:unlockLockedUntil", e);
    }
    let wp, K5, Jct, $h;
    Zct = async ()=>{
        const t = await cn.getItem("local:encryptedVault");
        return t?.version === 1 || t?.version === 2 ? (await cn.removeItem("local:wallet"), await cn.removeItem("local:nightExternalKey"), await cn.removeItem("local:zswapKeys"), await cn.removeItem("local:dustKeys"), "locked") : "none";
    };
    wp = async (t)=>{
        await cn.setItem("local:encryptedVault", t);
    };
    K5 = async ()=>await cn.getItem("local:encryptedVault");
    Cvt = async (t, e)=>{
        const n = await zte(t, e);
        await wp(n);
    };
    jte = async (t)=>{
        const { failCount: e, lockedUntil: n } = await Gct(), r = Date.now();
        if (r < n) {
            const c = Math.ceil((n - r) / 1e3);
            throw new Error(`Too many failed attempts. Try again in ${c}s`);
        }
        const s = await K5();
        if (!s) throw new Error("No encrypted vault found");
        let i, o, a;
        try {
            ({ contents: i, key: o, needsUpgrade: a } = await pU(t, s));
        } catch  {
            const c = e + 1, l = Math.min($ct * Math.pow(2, c - 1), Xct);
            throw await bU(c, Date.now() + l), new Error("Wrong password");
        }
        if (await bU(0, 0), a) {
            const c = await zte(t, i);
            await wp(c);
            const { key: l } = await pU(t, c);
            return {
                contents: i,
                key: l,
                salt: c.salt
            };
        }
        return {
            contents: i,
            key: o,
            salt: s.salt
        };
    };
    Jct = "1am-session";
    $h = "keys";
    function PO() {
        return new Promise((t, e)=>{
            const n = indexedDB.open(Jct, 1);
            n.onupgradeneeded = ()=>{
                n.result.createObjectStore($h);
            }, n.onsuccess = ()=>t(n.result), n.onerror = ()=>e(n.error);
        });
    }
    async function mU(t, e) {
        const n = await PO();
        return new Promise((r, s)=>{
            const i = n.transaction($h, "readwrite");
            i.objectStore($h).put(e, t), i.oncomplete = ()=>{
                n.close(), r();
            }, i.onerror = ()=>{
                n.close(), s(i.error);
            };
        });
    }
    async function WT(t) {
        const e = await PO();
        return new Promise((n, r)=>{
            const i = e.transaction($h, "readonly").objectStore($h).get(t);
            i.onsuccess = ()=>{
                e.close(), n(i.result);
            }, i.onerror = ()=>{
                e.close(), r(i.error);
            };
        });
    }
    async function Yct() {
        try {
            const t = await PO();
            return new Promise((e, n)=>{
                const r = t.transaction($h, "readwrite");
                r.objectStore($h).clear(), r.oncomplete = ()=>{
                    t.close(), e();
                }, r.onerror = ()=>{
                    t.close(), n(r.error);
                };
            });
        } catch  {}
    }
    let ao, OO, elt, $T;
    Qct = async (t, e)=>{
        Yy = t, Qy = e, await mU("vaultKey", t), await mU("vaultSalt", e);
    };
    ao = ()=>!Yy || !Qy ? null : {
            key: Yy,
            salt: Qy
        };
    OO = async ()=>{
        Yy = null, Qy = null, await Yct();
    };
    elt = async ()=>{
        try {
            return await WT("vaultKey") != null;
        } catch  {
            return !1;
        }
    };
    $T = async ()=>{
        let t = ao();
        if (!t) {
            const n = await WT("vaultKey"), r = await WT("vaultSalt");
            n && r && (Yy = n, Qy = r, t = {
                key: n,
                salt: r
            });
        }
        if (!t) return null;
        const e = await K5();
        if (!e) return null;
        try {
            let n;
            if (e.version >= 2) {
                const s = Wh(e.salt), i = new Uint8Array(1 + s.length);
                i[0] = e.version, i.set(s, 1), n = i;
            }
            const r = await Xf(t.key, e.ciphertext, e.iv, n);
            return JSON.parse(r);
        } catch  {
            return OO(), null;
        }
    };
    let Lc = Promise.resolve();
    let E_, tlt, yU, va, W5, $5, qte, nlt, rlt, slt, ilt, olt, alt, wU, _U, clt, X5;
    E_ = async (t)=>{
        const e = Lc;
        let n;
        Lc = new Promise((r)=>{
            n = r;
        });
        try {
            await e;
            const r = ao();
            if (!r) throw new Error("Wallet is locked");
            const s = await K5();
            if (!s) throw new Error("No vault found");
            let i;
            if (s.version >= 2) {
                const l = Wh(s.salt), u = new Uint8Array(1 + l.length);
                u[0] = s.version, u.set(l, 1), i = u;
            }
            const o = await Xf(r.key, s.ciphertext, s.iv, i), a = JSON.parse(o);
            a.walletState = t;
            const c = await _w(r.key, r.salt, a);
            await wp(c);
        } finally{
            n();
        }
    };
    tlt = async ()=>{
        await cn.removeItem("local:encryptedVault"), await cn.removeItem("local:wallet"), await cn.removeItem("local:nightExternalKey"), await cn.removeItem("local:zswapKeys"), await cn.removeItem("local:dustKeys"), await cn.removeItem("local:environmentSettings"), await cn.removeItem("local:pendingTransactions"), await cn.removeItem("local:walletMetadata"), await cn.removeItem("local:unlockFailCount"), await cn.removeItem("local:unlockLockedUntil"), await OO();
    };
    yU = {
        wallets: [
            {
                id: 0,
                name: "Wallet 1",
                accounts: [
                    {
                        index: 0,
                        name: "Account 1"
                    }
                ],
                activeAccountIndex: 0,
                nextAccountIndex: 1
            }
        ],
        activeId: 0,
        nextId: 1
    };
    va = async ()=>{
        const t = await cn.getItem("local:walletMetadata");
        return t || {
            ...yU,
            wallets: [
                ...yU.wallets
            ]
        };
    };
    hl = async (t)=>{
        await cn.setItem("local:walletMetadata", t);
    };
    W5 = async ()=>{
        const t = ao();
        if (!t) throw new Error("Wallet is locked");
        const e = await K5();
        if (!e) throw new Error("No vault found");
        let n;
        if (e.version >= 2) {
            const s = Wh(e.salt), i = new Uint8Array(1 + s.length);
            i[0] = e.version, i.set(s, 1), n = i;
        }
        const r = await Xf(t.key, e.ciphertext, e.iv, n);
        return JSON.parse(r);
    };
    $5 = (t)=>{
        t.wallets || (t.wallets = [
            {
                id: 0,
                seed: t.seed,
                mnemonic: t.mnemonic
            }
        ]);
    };
    qte = async (t, e)=>{
        const n = Lc;
        let r;
        Lc = new Promise((s)=>{
            r = s;
        });
        try {
            await n;
            const s = ao();
            if (!s) throw new Error("Wallet is locked");
            const i = await W5();
            $5(i);
            const o = i.wallets.find((l)=>l.id === t);
            if (!o) throw new Error(`Wallet ${t} not found in vault`);
            const a = Kte(o.seed, e);
            i.seed = o.seed, i.mnemonic = o.mnemonic, i.nightExternalKey = Buffer.from(a.nightExternalKey).toString("base64"), i.zswapKeys = Buffer.from(a.zswapKeys).toString("base64"), i.dustKeys = Buffer.from(a.dustKeys).toString("base64"), i.walletState = void 0;
            const c = await _w(s.key, s.salt, i);
            return await wp(c), i;
        } finally{
            r();
        }
    };
    nlt = async (t, e = 0)=>qte(t, e);
    rlt = async (t, e)=>qte(t, e);
    slt = async (t, e, n)=>{
        const r = Lc;
        let s;
        Lc = new Promise((i)=>{
            s = i;
        });
        try {
            await r;
            const i = ao();
            if (!i) throw new Error("Wallet is locked");
            const o = await W5();
            $5(o), o.wallets.push({
                id: t,
                seed: e,
                mnemonic: n
            });
            const a = Kte(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 _w(i.key, i.salt, o);
            return await wp(c), o;
        } finally{
            s();
        }
    };
    ilt = async (t)=>{
        const e = Lc;
        let n;
        Lc = new Promise((r)=>{
            n = r;
        });
        try {
            await e;
            const r = ao();
            if (!r) throw new Error("Wallet is locked");
            const s = await W5();
            $5(s), s.wallets = s.wallets.filter((o)=>o.id !== t);
            const i = await _w(r.key, r.salt, s);
            await wp(i);
        } finally{
            n();
        }
    };
    olt = async (t)=>{
        const e = Lc;
        let n;
        Lc = new Promise((r)=>{
            n = r;
        });
        try {
            await e;
            const r = ao();
            if (!r) throw new Error("Wallet is locked");
            const s = await W5();
            t(s);
            const i = await _w(r.key, r.salt, s);
            await wp(i);
        } finally{
            n();
        }
    };
    alt = 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)=>HT(a).restore(t.serializedShieldedWalletState),
            unshielded: (a)=>UT(a).restore(t.serializedUnshieldedWalletState),
            dust: (a)=>jT(a).restore(t.serializedDustWalletState)
        };
        return s && (s.mode === "proofstation" || s.mode === "wasm") && (i.provingService = ()=>qT(s)), await ld.init(i);
    };
    Kte = (t, e)=>{
        const n = Wct(t), r = EE.fromSeed(n);
        if (r.type !== "seedOk") throw new Error("Failed to initialize HDWallet");
        const s = r.hdWallet.selectAccount(e).selectRoles([
            Ap.Zswap,
            Ap.NightExternal,
            Ap.Dust
        ]).deriveKeysAt(0);
        if (s.type !== "keysDerived") throw new Error("Failed to derive keys");
        return r.hdWallet.clear(), {
            zswapKeys: s.keys[Ap.Zswap],
            dustKeys: s.keys[Ap.Dust],
            nightExternalKey: s.keys[Ap.NightExternal]
        };
    };
    wU = 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 = Ui.fromSeed(i), l = Ma.fromSeed(o), u = yd(a, e.networkId);
        if (t.walletState) {
            const p = {
                configuration: {
                    ...e,
                    relayURL: new URL(n),
                    ...s?.mode !== "wasm" && s?.mode !== "proofstation" ? {
                        provingServerUrl: new URL(r)
                    } : {}
                },
                shielded: (b)=>HT(b).restore(t.walletState.serializedShieldedWalletState),
                unshielded: (b)=>UT(b).restore(t.walletState.serializedUnshieldedWalletState),
                dust: (b)=>jT(b).restore(t.walletState.serializedDustWalletState)
            };
            return s && (s.mode === "proofstation" || s.mode === "wasm") && (p.provingService = ()=>qT(s)), {
                wallet: await ld.init(p),
                dustSecretKey: l,
                zswapSecretKeys: c,
                nightExternalKeyBytes: a
            };
        }
        const d = {
            configuration: {
                ...e,
                relayURL: new URL(n),
                ...s?.mode !== "wasm" && s?.mode !== "proofstation" ? {
                    provingServerUrl: new URL(r)
                } : {}
            },
            shielded: (p)=>HT(p).startWithSecretKeys(c),
            unshielded: async (p)=>UT(p).startWithPublicKey(Mte.fromKeyStore(u)),
            dust: (p)=>jT(p).startWithSecretKey(l, wi.initialParameters().dust)
        };
        return s && (s.mode === "proofstation" || s.mode === "wasm") && (d.provingService = ()=>qT(s)), {
            wallet: await ld.init(d),
            dustSecretKey: l,
            zswapSecretKeys: c,
            nightExternalKeyBytes: a
        };
    };
    _U = async (t)=>{
        const e = t ? `:${t}` : "";
        return await cn.getItem(ud(`local:pendingTransactions${e}`)) || [];
    };
    clt = async (t, e)=>{
        const n = e ? `:${e}` : "";
        await cn.setItem(ud(`local:pendingTransactions${n}`), t);
    };
    X5 = pj("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"
        }
    });
    yi = (t)=>{
        const [e, n] = Ze(t, [
            "variant",
            "size",
            "class",
            "label"
        ]), r = e.label;
        return M(zc, Le({
            get class () {
                return vn(X5({
                    variant: e.variant,
                    size: e.size
                }), e.class);
            }
        }, r && {
            title: r,
            "aria-label": r
        }, n));
    };
    Ks = function(t) {
        return (e)=>(t(e), ()=>t(void 0));
    };
    Wte = [
        "id",
        "name",
        "validationState",
        "required",
        "disabled",
        "readOnly"
    ];
    $te = function(t) {
        const e = `form-control-${ai()}`, n = zt({
            id: e
        }, t), [r, s] = he(), [i, o] = he(), [a, c] = he(), [l, u] = he(), d = (b, y, _)=>{
            const v = _ != null || r() != null;
            return [
                _,
                r(),
                v && y != null ? b : void 0
            ].filter(Boolean).join(" ") || void 0;
        }, f = (b)=>[
                a(),
                l(),
                b
            ].filter(Boolean).join(" ") || void 0, p = _t(()=>({
                "data-valid": ke(n.validationState) === "valid" ? "" : void 0,
                "data-invalid": ke(n.validationState) === "invalid" ? "" : void 0,
                "data-required": ke(n.required) ? "" : void 0,
                "data-disabled": ke(n.disabled) ? "" : void 0,
                "data-readonly": ke(n.readOnly) ? "" : void 0
            }));
        return {
            formControlContext: {
                name: ()=>ke(n.name) ?? ke(n.id),
                dataset: p,
                validationState: ()=>ke(n.validationState),
                isRequired: ()=>ke(n.required),
                isDisabled: ()=>ke(n.disabled),
                isReadOnly: ()=>ke(n.readOnly),
                labelId: r,
                fieldId: i,
                descriptionId: a,
                errorMessageId: l,
                getAriaLabelledBy: d,
                getAriaDescribedBy: f,
                generateId: du(()=>ke(n.id)),
                registerLabel: Ks(s),
                registerField: Ks(o),
                registerDescription: Ks(c),
                registerErrorMessage: Ks(u)
            }
        };
    };
    MO = us();
    of = function() {
        const t = ds(MO);
        if (t === void 0) throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");
        return t;
    };
    G5 = function(t) {
        const e = of(), n = zt({
            id: e.generateId("description")
        }, t);
        return ot(()=>At(e.registerDescription(n.id))), M(yn, Le({
            as: "div"
        }, ()=>e.dataset(), n));
    };
    Z5 = function(t) {
        let e;
        const n = of(), r = zt({
            id: n.generateId("label")
        }, t), [s, i] = Ze(r, [
            "ref"
        ]), o = Cv(()=>e, ()=>"label");
        return ot(()=>At(n.registerLabel(i.id))), M(yn, Le({
            as: "label",
            ref (a) {
                var c = ir((l)=>e = l, s.ref);
                typeof c == "function" && c(a);
            },
            get for () {
                return it(()=>o() === "label")() ? n.fieldId() : void 0;
            }
        }, ()=>n.dataset(), i));
    };
    Xte = function(t, e) {
        ot(Gi(t, (n)=>{
            if (n == null) return;
            const r = llt(n);
            r != null && (r.addEventListener("reset", e, {
                passive: !0
            }), At(()=>{
                r.removeEventListener("reset", e);
            }));
        }));
    };
    function llt(t) {
        return ult(t) ? t.form : t.closest("form");
    }
    function ult(t) {
        return t.matches("textarea, input, select, button");
    }
    J5 = function(t) {
        const e = of(), n = zt({
            id: e.generateId("error-message")
        }, t), [r, s] = Ze(n, [
            "forceMount"
        ]), i = ()=>e.validationState() === "invalid";
        return ot(()=>{
            i() && At(e.registerErrorMessage(s.id));
        }), M(ge, {
            get when () {
                return r.forceMount || i();
            },
            get children () {
                return M(yn, Le({
                    as: "div"
                }, ()=>e.dataset(), s));
            }
        });
    };
    _p = function(t) {
        const [e, n] = he(t.defaultValue?.()), r = _t(()=>t.value?.() !== void 0), s = _t(()=>r() ? t.value?.() : e());
        return [
            s,
            (o)=>{
                uE(()=>{
                    const a = Tie(o, s());
                    return Object.is(a, s()) || (r() || n(a), t.onChange?.(a)), a;
                });
            }
        ];
    };
    function Gte(t) {
        const [e, n] = _p(t);
        return [
            ()=>e() ?? !1,
            n
        ];
    }
    function dlt(t) {
        const [e, n] = _p(t);
        return [
            ()=>e() ?? [],
            n
        ];
    }
    let Ys, flt, hlt, Zte;
    Ys = (t)=>typeof t == "function" ? t() : t;
    flt = (t)=>{
        const e = _t(()=>{
            const o = Ys(t.element);
            if (o) return getComputedStyle(o);
        }), n = ()=>e()?.animationName ?? "none", [r, s] = he(Ys(t.show) ? "present" : "hidden");
        let i = "none";
        return ot((o)=>{
            const a = Ys(t.show);
            return uE(()=>{
                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;
        }), ot(()=>{
            const o = Ys(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), At(()=>{
                o.removeEventListener("animationstart", a), o.removeEventListener("animationcancel", c), o.removeEventListener("animationend", c);
            });
        }), {
            present: ()=>r() === "present" || r() === "hiding",
            state: r,
            setState: s
        };
    };
    hlt = flt;
    e1 = hlt;
    Zte = [
        "id",
        "aria-label",
        "aria-labelledby",
        "aria-describedby"
    ];
    function Jte(t) {
        const e = of(), n = zt({
            id: e.generateId("field")
        }, t);
        return ot(()=>At(e.registerField(ke(n.id)))), {
            fieldProps: {
                id: ()=>ke(n.id),
                ariaLabel: ()=>ke(n["aria-label"]),
                ariaLabelledBy: ()=>e.getAriaLabelledBy(ke(n.id), ke(n["aria-label"]), ke(n["aria-labelledby"])),
                ariaDescribedBy: ()=>e.getAriaDescribedBy(ke(n["aria-describedby"]))
            }
        };
    }
    var plt = {};
    fu(plt, {
        Description: ()=>G5,
        ErrorMessage: ()=>J5,
        Input: ()=>NO,
        Label: ()=>Z5,
        Root: ()=>VO,
        TextArea: ()=>BO,
        TextField: ()=>blt,
        useTextFieldContext: ()=>RO
    });
    var Yte = us();
    function RO() {
        const t = ds(Yte);
        if (t === void 0) throw new Error("[kobalte]: `useTextFieldContext` must be used within a `TextField` component");
        return t;
    }
    function NO(t) {
        return M(Qte, Le({
            type: "text"
        }, t));
    }
    function Qte(t) {
        const e = of(), n = RO(), r = zt({
            id: n.generateId("input")
        }, t), [s, i, o] = Ze(r, [
            "onInput"
        ], Zte), { fieldProps: a } = Jte(i);
        return M(yn, Le({
            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 VO(t) {
        let e;
        const n = `textfield-${ai()}`, r = zt({
            id: n
        }, t), [s, i, o] = Ze(r, [
            "ref",
            "value",
            "defaultValue",
            "onChange"
        ], Wte), a = s.value, [c, l] = _p({
            value: ()=>a === void 0 ? void 0 : s.value ?? "",
            defaultValue: ()=>s.defaultValue,
            onChange: (p)=>s.onChange?.(p)
        }), { formControlContext: u } = $te(i);
        Xte(()=>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: du(()=>ke(i.id)),
            onInput: d
        };
        return M(MO.Provider, {
            value: u,
            get children () {
                return M(Yte.Provider, {
                    value: f,
                    get children () {
                        return M(yn, Le({
                            as: "div",
                            ref (p) {
                                var h = ir((b)=>e = b, s.ref);
                                typeof h == "function" && h(p);
                            },
                            role: "group",
                            get id () {
                                return ke(i.id);
                            }
                        }, ()=>u.dataset(), o));
                    }
                });
            }
        });
    }
    function BO(t) {
        let e;
        const n = RO(), r = zt({
            id: n.generateId("textarea")
        }, t), [s, i] = Ze(r, [
            "ref",
            "autoResize",
            "submitOnEnter",
            "onKeyPress"
        ]);
        ot(Gi([
            ()=>e,
            ()=>s.autoResize,
            ()=>n.value()
        ], ([a, c])=>{
            !a || !c || glt(a);
        }));
        const o = (a)=>{
            e && s.submitOnEnter && a.key === "Enter" && !a.shiftKey && e.form && (e.form.requestSubmit(), a.preventDefault());
        };
        return M(Qte, Le({
            as: "textarea",
            get "aria-multiline" () {
                return s.submitOnEnter ? "false" : void 0;
            },
            get onKeyPress () {
                return Yt([
                    s.onKeyPress,
                    o
                ]);
            },
            ref (a) {
                var c = ir((l)=>e = l, s.ref);
                typeof c == "function" && c(a);
            }
        }, i));
    }
    function glt(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 blt = Object.assign(VO, {
        Description: G5,
        ErrorMessage: J5,
        Input: NO,
        Label: Z5,
        TextArea: BO
    });
    let mlt, ylt, XT, Mr;
    wd = (t)=>{
        const [e, n] = Ze(t, [
            "class"
        ]);
        return M(VO, Le({
            get class () {
                return vn("flex flex-col gap-1", e.class);
            }
        }, n));
    };
    mh = (t)=>{
        const e = Le({
            type: "text"
        }, t), [n, r] = Ze(e, [
            "type",
            "class",
            "unstyled"
        ]);
        return M(NO, Le({
            get type () {
                return n.type;
            },
            get class () {
                return vn(!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));
    };
    mlt = (t)=>{
        const [e, n] = Ze(t, [
            "class"
        ]);
        return M(BO, Le({
            get class () {
                return vn("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));
    };
    ylt = pj("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"
        }
    });
    XT = (t)=>{
        const [e, n] = Ze(t, [
            "class"
        ]);
        return M(Z5, Le({
            get class () {
                return vn(ylt(), e.class);
            }
        }, n));
    };
    Mr = {
        preview: {
            name: "preview",
            label: "Preview",
            description: "Test network for development",
            networkId: "preview",
            indexerHttpUrl: "https://indexer.preview.midnight.network/api/v4/graphql",
            indexerWsUrl: "wss://indexer.preview.midnight.network/api/v4/graphql/ws",
            nodeUrl: "wss://rpc.preview.midnight.network",
            proofServerUrl: "https://api-preview.1am.xyz",
            defaultApiKey: "pk_live__sItK98-enkW25L6abMrV1U520gALkWCXtKBD3DUtsY",
            explorerBaseUrl: "https://explorer.1am.xyz",
            enabled: !0
        },
        preprod: {
            name: "preprod",
            label: "Preprod",
            description: "Pre-production network",
            networkId: "preprod",
            indexerHttpUrl: "https://indexer.preprod.midnight.network/api/v4/graphql",
            indexerWsUrl: "wss://indexer.preprod.midnight.network/api/v4/graphql/ws",
            nodeUrl: "wss://rpc.preprod.midnight.network",
            proofServerUrl: "https://api-preprod.1am.xyz",
            defaultApiKey: "pk_live__sItK98-enkW25L6abMrV1U520gALkWCXtKBD3DUtsY",
            explorerBaseUrl: "https://explorer.1am.xyz",
            enabled: !0
        },
        mainnet: {
            name: "mainnet",
            label: "Mainnet",
            description: "Production network",
            networkId: "mainnet",
            indexerHttpUrl: "https://indexer.mainnet.midnight.network/api/v4/graphql",
            indexerWsUrl: "wss://indexer.mainnet.midnight.network/api/v4/graphql/ws",
            nodeUrl: "wss://rpc.mainnet.midnight.network",
            proofServerUrl: "https://api.1am.xyz",
            defaultApiKey: "pk_live__sItK98-enkW25L6abMrV1U520gALkWCXtKBD3DUtsY",
            explorerBaseUrl: "https://explorer.1am.xyz",
            enabled: !0
        }
    };
    function ene(t) {
        return Mr[t]?.proofServerUrl || Mr.mainnet.proofServerUrl;
    }
    function DO(t, e) {
        return t === "" || t === "DUST" || t === "tDUST" ? "DUST" : t;
    }
    let hv, tne, pv, t1, rne, gv;
    hv = "https://api.1am.xyz";
    tne = "proofstation";
    nne = "pk_live__sItK98-enkW25L6abMrV1U520gALkWCXtKBD3DUtsY";
    pv = (t)=>Mr[t]?.defaultApiKey || nne;
    t1 = "mainnet";
    GT = {
        local: {
            label: "Local",
            url: "http://localhost:6300",
            description: "Self-hosted proof server on your machine"
        },
        proofstation: {
            label: "1AM ProofStation",
            url: "https://api.1am.xyz",
            description: "Hosted proving + dust sponsorship by 1AM — zero gas fees"
        },
        wasm: {
            label: "In-Browser (WASM)",
            url: "wasm://local",
            description: "Experimental — contact team@1am.xyz for early access",
            disabled: !0
        },
        custom: {
            label: "Custom Server",
            url: "",
            description: "Your own proof server URL"
        }
    };
    rne = [
        1,
        2,
        5,
        10,
        30
    ];
    gv = 30;
    Sg = async ()=>{
        const t = await cn.getItem("local:environmentSettings");
        return t ? (t.proofServerMode === "proofstation" && (t.proofStationApiKey = pv(t.environment), t.proofServerUrl = ene(t.environment)), t.theme && t.theme !== "light" && t.theme !== "dark" && (t.theme = "light", await Km(t)), t.proofServerUrl && !sne(t.proofServerUrl) && (t.proofServerUrl = hv), t) : {
            environment: t1,
            proofServerUrl: hv,
            proofServerMode: tne,
            proofStationApiKey: pv(t1),
            dustSponsorship: !0,
            sidePanelEnabled: !0,
            autoLockMinutes: gv
        };
    };
    function sne(t) {
        try {
            const e = new URL(t);
            return e.hostname === "localhost" || e.hostname === "127.0.0.1" || e.hostname === "::1" || e.protocol === "https:" || e.protocol === "wss:" || t === "wasm://local";
        } catch  {
            return !1;
        }
    }
    Km = async (t)=>{
        if ((t.proofServerMode === "custom" || t.proofServerMode === "proofstation") && !sne(t.proofServerUrl)) throw new Error("Proof server URL must use HTTPS (HTTP only allowed for localhost)");
        await cn.setItem("local:environmentSettings", t);
    };
    function FO(t, e, n) {
        const r = t.replace(/\/$/, "");
        try {
            const a = new URL(r);
            if (a.protocol !== "https:" && a.protocol !== "http:") return "";
        } catch  {
            return "";
        }
        const s = (e.startsWith("0x") || e.startsWith("0X") ? e.slice(2) : e).replace(/[^a-fA-F0-9]/g, "");
        if (!s) return "";
        const o = n && new Set([
            "preview",
            "preprod",
            "mainnet"
        ]).has(n) ? `?network=${n}` : "";
        return `${r}/tx/${s}${o}`;
    }
    let wlt;
    wlt = Object.freeze(Object.defineProperty({
        __proto__: null,
        AUTO_LOCK_OPTIONS: rne,
        DEFAULT_AUTO_LOCK_MINUTES: gv,
        DEFAULT_ENVIRONMENT: t1,
        DEFAULT_PROOFSTATION_API_KEY: nne,
        DEFAULT_PROOF_SERVER_MODE: tne,
        DEFAULT_PROOF_SERVER_URL: hv,
        ENVIRONMENTS: Mr,
        PROOF_SERVER_PRESETS: GT,
        explorerTransactionUrl: FO,
        getDefaultApiKey: pv,
        getEnvironmentSettings: Sg,
        getProofServerUrl: ene,
        saveEnvironmentSettings: Km,
        tokenLabel: DO
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    Y5 = `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(`
`);
    var _lt = se('<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 the path that matches your wallet state.</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'), xlt = se('<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 Slt, klt, Tlt, Elt, xU, ei;
    vlt = (t)=>{
        const e = (n)=>{
            t.fullpage ? window.location.href = `/fullpage.html?mode=${n.mode}` : (yo.tabs.create({
                url: yo.runtime.getURL(`/fullpage.html?mode=${n.mode}`)
            }), window.close());
        };
        return M(ge, {
            get when () {
                return t.fullpage;
            },
            get fallback () {
                return M(klt, {
                    openFullPageApp: e
                });
            },
            get children () {
                return M(Slt, {
                    openFullPageApp: e
                });
            }
        });
    };
    Slt = (t)=>{
        const [e, n] = he(!1);
        return $a(async ()=>{
            const s = (await Sg()).theme === "dark";
            n(s), document.documentElement.setAttribute("data-theme", s ? "dark" : "light");
        }), (()=>{
            var r = _lt(), 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, b = h.firstChild, y = b.nextSibling;
            return X(a, M(Zm, {
                class: "h-8 w-auto",
                animated: !0
            })), X(y, M(yi, {
                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), X(y, M(yi, {
                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), r;
        })();
    };
    klt = (t)=>(()=>{
            var e = xlt(), n = e.firstChild, r = n.firstChild, s = r.firstChild, i = r.nextSibling;
            return X(r, M(Zm, {
                class: "h-10 w-auto",
                animated: !0
            }), s), X(i, M(yi, {
                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), X(i, M(yi, {
                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), e;
        })();
    Tlt = "modulepreload";
    Elt = function(t) {
        return "/" + t;
    };
    xU = {};
    ei = function(e, n, r) {
        let s = Promise.resolve();
        if (n && n.length > 0) {
            let o = function(l) {
                return Promise.all(l.map((u)=>Promise.resolve(u).then((d)=>({
                            status: "fulfilled",
                            value: d
                        }), (d)=>({
                            status: "rejected",
                            reason: d
                        }))));
            };
            document.getElementsByTagName("link");
            const a = document.querySelector("meta[property=csp-nonce]"), c = a?.nonce || a?.getAttribute("nonce");
            s = o(n.map((l)=>{
                if (l = Elt(l), l in xU) return;
                xU[l] = !0;
                const u = l.endsWith(".css"), d = u ? '[rel="stylesheet"]' : "";
                if (document.querySelector(`link[href="${l}"]${d}`)) return;
                const f = document.createElement("link");
                if (f.rel = u ? "stylesheet" : Tlt, u || (f.as = "script"), f.crossOrigin = "", f.href = l, c && f.setAttribute("nonce", c), document.head.appendChild(f), u) return new Promise((p, h)=>{
                    f.addEventListener("load", p), f.addEventListener("error", ()=>h(new Error(`Unable to preload CSS for ${l}`)));
                });
            }));
        }
        function i(o) {
            const a = new Event("vite:preloadError", {
                cancelable: !0
            });
            if (a.payload = o, window.dispatchEvent(a), !a.defaultPrevented) throw o;
        }
        return s.then((o)=>{
            for (const a of o || [])a.status === "rejected" && i(a.reason);
            return e().catch(i);
        });
    };
    async function Clt(t = 6e4) {
        try {
            const n = (await chrome.storage.session.get("walletState")).walletState;
            return !n || Date.now() - n.timestamp > t ? null : n;
        } catch  {
            try {
                const e = await cn.getItem("session:walletState");
                if (!e) return null;
                const n = JSON.parse(e);
                return Date.now() - n.timestamp > t ? null : n;
            } catch  {
                return null;
            }
        }
    }
    let Ilt;
    Ilt = "1am-wallet-state";
    Ivt = "1am-keep-alive";
    let Ea = null, g0 = [], od = !1, C_ = 0;
    const Alt = 10;
    async function ine() {
        if (od) return null;
        try {
            Ea = chrome.runtime.connect({
                name: Ilt
            }), od = !0, C_ = 0, Ea.onMessage.addListener((t)=>{
                if (t.type === "WALLET_STATE_UPDATE") for (const e of g0)try {
                    e(t.state);
                } catch  {}
            }), Ea.onDisconnect.addListener(()=>{
                if (od = !1, Ea = null, C_++, C_ <= Alt && g0.length > 0) {
                    const t = Math.min(1e3 * Math.pow(2, C_ - 1), 3e4);
                    setTimeout(()=>{
                        od || ine().catch(()=>{});
                    }, t);
                }
            });
        } catch  {
            od = !1, Ea = null;
        }
        return Clt();
    }
    function Plt(t) {
        return g0.push(t), ()=>{
            g0 = g0.filter((e)=>e !== t);
        };
    }
    function vU(t) {
        if (!(!Ea || !od)) try {
            Ea.postMessage({
                type: "CMD_WALLET_STATE_BROADCAST",
                state: {
                    ...t,
                    timestamp: Date.now()
                }
            });
        } catch  {
            od = !1, Ea = null;
        }
    }
    function Olt() {
        if (Ea) {
            try {
                Ea.disconnect();
            } catch  {}
            Ea = null;
        }
        od = !1, g0 = [];
    }
    const Mlt = "1am-wallet-ownership";
    async function Rlt(t) {
        const e = crypto.randomUUID();
        return new Promise((n)=>{
            const r = chrome.runtime.connect({
                name: Mlt
            });
            r.onMessage.addListener((s)=>{
                s.type === "OWNERSHIP_GRANT" ? n({
                    role: s.role,
                    contextId: e
                }) : s.type === "OWNERSHIP_REVOKE" && n({
                    role: "primary",
                    contextId: e
                });
            }), r.postMessage({
                type: "OWNERSHIP_REQUEST",
                contextId: e,
                contextType: t
            }), r.onDisconnect.addListener(()=>{
                n({
                    role: "primary",
                    contextId: e
                });
            }), setTimeout(()=>n({
                    role: "primary",
                    contextId: e
                }), 5e3);
        });
    }
    function Nlt(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 = ()=>{
            n && (clearTimeout(n), n = null, r && t(...r), r = null);
        }, s;
    }
    async function ZT(t) {
        const e = new Uint8Array(t).buffer, n = await crypto.subtle.digest("SHA-256", e);
        return Array.from(new Uint8Array(n)).map((r)=>r.toString(16).padStart(2, "0")).join("");
    }
    const j7 = (t, e)=>({
            mode: t.proofServerMode || "local",
            url: t.proofServerUrl,
            apiKey: t.proofStationApiKey,
            clientId: e
        }), I_ = 10, one = us();
    let Wm = !1, g2 = [];
    const q7 = async (t = 3e4)=>Wm ? t <= 0 ? !1 : new Promise((e)=>{
            const n = setTimeout(()=>{
                g2 = g2.filter((s)=>s !== r), e(!1);
            }, t), r = ()=>{
                clearTimeout(n), Wm = !0, e(!0);
            };
            g2.push(r);
        }) : (Wm = !0, !0), K7 = ()=>{
        const t = g2.shift();
        t ? t() : Wm = !1;
    }, Vlt = (t)=>{
        const [e, n] = he(!0), [r, s] = he(!1), [i, o] = he(!1), [a, c] = he({
            shielded: {
                current: 0,
                total: 0
            },
            unshielded: {
                current: 0,
                total: 0
            },
            dust: {
                current: 0,
                total: 0
            },
            percent: 0
        }), [l, u] = he(null);
        let d = 0;
        const [f, p] = he({
            indexer: "checking",
            rpc: "checking",
            overall: "checking",
            lastChecked: 0
        }), [h, b] = he({
            status: "checking",
            availableWallets: 0,
            totalWallets: 0,
            totalBalance: 0n,
            totalUtxos: 0,
            pendingTxs: 0,
            lastChecked: 0
        }), [y, _] = he({}), [v, w] = he(new Map), [E, I] = he(0n), [D, U] = he(""), [K, $] = he(""), [ne, te] = he(""), [J, C] = he(new Map), g = _t(()=>Array.from(J().values())), [x, A] = he(0), [R, N] = he(!1), [L, z] = he(null), [B, S] = he(null), [O, W] = he(""), [F, G] = he({
            environment: t1,
            proofServerUrl: hv,
            proofServerMode: "local"
        }), [ee, Q] = he([]), [Y, ae] = he(1), [de, pe] = he([]), Ae = _t(()=>de().filter((me)=>me.status === "submitting" || me.status === "pending").length), [Oe, Re] = he([
            {
                id: 0,
                name: "Wallet 1",
                accounts: [
                    {
                        index: 0,
                        name: "Account 1"
                    }
                ],
                activeAccountIndex: 0,
                nextAccountIndex: 1
            }
        ]), [Me, Je] = he(0), [Ee, le] = he(!1), [qe, Ye] = he(0), [ut, Ce] = he(""), [oe, ue] = he(null), [Ie, H] = he(!1), [T, P] = he(null), [Z, ie] = he(!1), [ce, be] = he(!1), [yt, Et] = he("");
        let dt = null, Kt = !1, tt = 0;
        const [vt, Kr] = he([]), Vn = new Map, _n = (me)=>{
            const Se = crypto.randomUUID();
            Kr((Ke)=>[
                    ...Ke,
                    {
                        ...me,
                        id: Se
                    }
                ]);
            const Ne = me.type === "error" ? 8e3 : 5e3, ve = setTimeout(()=>{
                Vn.delete(Se), Ya(Se);
            }, Ne);
            Vn.set(Se, ve);
        }, Ya = (me)=>{
            const Se = Vn.get(me);
            Se && (clearTimeout(Se), Vn.delete(me)), Kr((Ne)=>Ne.filter((ve)=>ve.id !== me));
        }, jn = _t(()=>ee().length), nt = _t(()=>Math.max(1, Math.ceil(ee().length / I_))), Wr = _t(()=>{
            const me = (Y() - 1) * I_;
            return ee().slice(me, me + I_);
        }), fn = "0000000000000000000000000000000000000000000000000000000000000000";
        let je = null, dr = null, Wt = null, Ut = null, fr = null, Bn, hn = k_(Mr[t1]), Ri = !1, $t = null, Xn = !1;
        const Ni = Nlt(async (me)=>{
            if (!Xn && !(Ri && !ao())) {
                Xn = !0;
                try {
                    const Se = {
                        serializedDustWalletState: await me.dust.serializeState(),
                        serializedShieldedWalletState: await me.shielded.serializeState(),
                        serializedUnshieldedWalletState: await me.unshielded.serializeState()
                    };
                    if ($t) try {
                        await zp($t.serialize());
                    } catch  {}
                    Ri && await E_(Se);
                } catch (Se) {
                    console.error("[Wallet] Checkpoint save failed:", Se instanceof Error ? Se.message : Se);
                } finally{
                    Xn = !1;
                }
            }
        }, 5e3), hr = (me)=>me === void 0 || me === "" || me === fn, pr = 15, ku = (me)=>me === "DUST" || me === "tDUST", gr = (me, Se = 4, Ne)=>{
            const ve = (Ke, wt, sn)=>{
                const qn = 10n ** BigInt(wt), ps = Ke / qn, Er = Ke % qn;
                if (sn <= 0) return ps.toString();
                const $r = Er.toString().padStart(wt, "0").slice(0, sn);
                return `${ps}.${$r}`;
            };
            return hr(Ne) ? ve(me, 6, Se) : ku(Ne) ? ve(me, pr, Se) : me.toString();
        }, br = ()=>je;
        let Qa = Promise.resolve();
        const Vi = ()=>{
            const me = [
                ...de()
            ], Se = F().environment;
            return Qa = Qa.then(()=>clt(me, Se)).catch((Ne)=>console.error("[Wallet] persistPending failed:", Ne)), Qa;
        }, lf = async (me)=>{
            pe((Se)=>[
                    me,
                    ...Se
                ]), await Vi();
        }, Mo = async (me, Se)=>{
            pe((Ne)=>Ne.map((ve)=>ve.id === me ? {
                        ...ve,
                        ...Se
                    } : ve)), await Vi();
        }, Jc = async (me)=>{
            const Se = de();
            let Ne = !1;
            const ve = Se.map((Ke)=>(Ke.status === "submitting" || Ke.status === "pending") && Ke.txHash && me.has(Ke.txHash) ? (Ne = !0, {
                    ...Ke,
                    status: "confirmed"
                }) : (Ke.status === "submitting" || Ke.status === "pending") && Date.now() - Ke.createdAt > 600 * 1e3 ? (Ne = !0, {
                    ...Ke,
                    status: "failed",
                    error: "Transaction timed out"
                }) : Ke);
            Ne && (pe(ve), await Vi());
        }, Tu = (me)=>{
            const Se = new Map;
            for (const ve of ee())Se.set(ve.hash, ve);
            for (const ve of me)Se.set(ve.hash, ve);
            const Ne = Array.from(Se.values());
            return Ne.sort((ve, Ke)=>Ke.timestamp.getTime() - ve.timestamp.getTime()), Ne;
        }, uf = async (me)=>{
            const Se = DO("DUST", F().environment);
            if (!je || !fr) {
                z("Wallet not initialized");
                return;
            }
            if (await q7(15e3)) {
                N(!0), z(null);
                try {
                    const Ke = (await Mn(je.state().pipe(bu((Er)=>Er.isSynced)))).unshielded.availableCoins.filter((Er)=>Er.utxo.type === fn && !Er.meta.registeredForDustGeneration);
                    if (Ke.length === 0) {
                        z(`No NIGHT UTXOs available for ${Se} generation`);
                        return;
                    }
                    const wt = yd(fr, hn.networkId), sn = await je.registerNightUtxosForDustGeneration(Ke, wt.getPublicKey(), (Er)=>wt.signData(Er), await je.dust.getAddress()), qn = await je.finalizeRecipe(sn), ps = await je.submitTransaction(qn);
                    _n({
                        type: "success",
                        title: "Dust generation submitted",
                        txHash: ps
                    });
                } catch (ve) {
                    console.error(`${Se} generation failed:`, ve), z(ve instanceof Error ? ve.message : `Failed to generate ${Se}`);
                } finally{
                    N(!1), K7();
                }
            }
        }, df = async (me, Se, Ne, ve)=>{
            if (!await q7(0)) throw new Error("A transaction is already in progress");
            try {
                return await Eu(me, Se, Ne, ve);
            } finally{
                K7();
            }
        }, Eu = async (me, Se, Ne, ve)=>{
            if (!je) throw new Error("Wallet not initialized");
            if (!Wt && !Ut && !fr) throw new Error("Secret keys not found");
            const Ke = crypto.randomUUID();
            await lf({
                id: Ke,
                type: "send",
                amount: Se.toString(),
                tokenType: Ne,
                recipientAddress: me,
                status: "submitting",
                createdAt: Date.now()
            });
            let wt = !1;
            try {
                const sn = ns.parse(me), qn = hn.networkId;
                let ps;
                try {
                    ps = ve === "shielded" ? {
                        type: "shielded",
                        outputs: [
                            {
                                type: Ne,
                                receiverAddress: sn.decode($l, qn),
                                amount: Se
                            }
                        ]
                    } : {
                        type: "unshielded",
                        outputs: [
                            {
                                type: Ne,
                                receiverAddress: sn.decode(Hi, qn),
                                amount: Se
                            }
                        ]
                    };
                } catch  {
                    throw new Error(`Invalid ${ve} address — make sure you're using a ${ve} address`);
                }
                let Er = await je.transferTransaction([
                    ps
                ], {
                    shieldedSecretKeys: Ut,
                    dustSecretKey: Wt
                }, {
                    ttl: new Date(Date.now() + 1800 * 1e3),
                    payFees: !1
                });
                const $r = F();
                if ($r.dustSponsorship) {
                    const { proveAndBalance: Nt, confirmSubmitted: pn } = await ei(async ()=>{
                        const { proveAndBalance: Gs, confirmSubmitted: It } = await import("./balance-client-mXpQOift.js");
                        return {
                            proveAndBalance: Gs,
                            confirmSubmitted: It
                        };
                    }, []);
                    W("Signing transaction...");
                    const Yn = (Gs)=>yd(fr, hn.networkId).signData(Gs), De = await je.signUnprovenTransaction(Er.transaction, Yn);
                    W("Proving & balancing (server)...");
                    const pt = await Nt($r.proofServerUrl, De.serialize(), $r.proofStationApiKey, Bn), { fromHex: en, toHex: Jt } = await ei(async ()=>{
                        const { fromHex: Gs, toHex: It } = await import("./index-BWkvlZPi.js").then(async (m)=>{
                            await m.__tla;
                            return m;
                        });
                        return {
                            fromHex: Gs,
                            toHex: It
                        };
                    }, __vite__mapDeps([0,1])), Dt = xn.deserialize("signature", "proof", "binding", en(pt.txBytes)), Bt = Dt.serialize(), Nr = Jt(Bt);
                    if (!Nr || Nr.length < 10) throw new Error("Proof server returned invalid transaction");
                    const or = await crypto.subtle.digest("SHA-256", Uint8Array.from(Bt)), On = Jt(new Uint8Array(or));
                    if (pt.txHash && On !== pt.txHash) throw new Error("Proof server txHash does not match actual transaction hash");
                    await Mo(Ke, {
                        txHash: pt.txHash,
                        status: "pending"
                    }), W("Broadcasting transaction..."), wt = !0;
                    const Xr = await je.submitTransaction(Dt);
                    return await Mo(Ke, {
                        txHash: pt.txHash,
                        status: "pending"
                    }), W(""), _n({
                        type: "success",
                        title: "Transaction submitted",
                        txHash: pt.txHash
                    }), await pn($r.proofServerUrl, pt.txHash, $r.proofStationApiKey, Bn).catch(()=>{}), Xr;
                }
                let Di = await je.balanceUnprovenTransaction(Er.transaction, {
                    shieldedSecretKeys: Ut,
                    dustSecretKey: Wt
                }, {
                    ttl: new Date(Date.now() + 1800 * 1e3)
                }), Ro = await je.signRecipe(Di, (Nt)=>yd(fr, hn.networkId).signData(Nt)), gs = await je.finalizeRecipe(Ro);
                wt = !0;
                let pa = await je.submitTransaction(gs);
                return await Mo(Ke, {
                    status: "pending"
                }), _n({
                    type: "success",
                    title: "Transaction submitted",
                    txHash: pa
                }), pa;
            } catch (sn) {
                const qn = sn instanceof Error ? sn.message : "Unknown error";
                throw wt ? (await Mo(Ke, {
                    status: "pending",
                    error: "Submission uncertain — waiting for confirmation"
                }), W(""), S("Transaction status is uncertain — please wait for confirmation before retrying"), _n({
                    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 Mo(Ke, {
                    status: "failed",
                    error: qn
                }), S(qn), _n({
                    type: "error",
                    title: "Transaction failed",
                    message: qn
                }), new Error(qn));
            }
        }, Yc = async (me)=>{
            const Se = F(), Ne = me.environment !== Se.environment;
            if (Ne) {
                try {
                    Ni.cancel();
                } catch  {}
                try {
                    dr?.unsubscribe();
                } catch  {}
                if (je) {
                    try {
                        await Promise.race([
                            je.stop(),
                            new Promise((ve)=>setTimeout(ve, 2e3))
                        ]);
                    } catch  {}
                    je = null;
                }
            }
            if (await Km(me), G(me), Ne) {
                pe([]), ae(1), await zp("");
                try {
                    await cn.removeItem(ud("session:encryptedSnapshot"));
                } catch  {}
                if (Ri) try {
                    await E_(void 0);
                } catch  {}
                window.location.reload();
            }
        }, ff = ()=>{
            _({}), w(new Map), I(0n), U(""), $(""), te(""), C(new Map), A(0), Q([]), ae(1), pe([]), N(!1), z(null), S(null), W(""), s(!1), u(null);
        }, Cu = (me)=>{
            if (!(!me || typeof me != "object")) for (const Se of Object.getOwnPropertyNames(me))try {
                const Ne = me[Se];
                Ne instanceof Uint8Array ? Ne.fill(0) : Ne instanceof ArrayBuffer && new Uint8Array(Ne).fill(0);
            } catch  {}
        }, Qc = ()=>{
            if (fr) {
                try {
                    fr.fill(0);
                } catch  {}
                fr = null;
            }
            Bn = void 0, Cu(Wt), Wt = null, Cu(Ut), Ut = null, Ri = !1;
        }, ec = async ()=>{
            try {
                await navigator.clipboard.writeText("");
            } catch  {}
            try {
                Ni.cancel();
            } catch  {}
            if ($t) try {
                await zp($t.serialize());
            } catch  {}
            if (je && Ri && ao()) try {
                const me = {
                    serializedDustWalletState: await je.dust.serializeState(),
                    serializedShieldedWalletState: await je.shielded.serializeState(),
                    serializedUnshieldedWalletState: await je.unshielded.serializeState()
                };
                await E_(me);
            } catch  {}
            try {
                dr?.unsubscribe();
            } catch  {}
            if (je) {
                try {
                    await Promise.race([
                        je.stop(),
                        new Promise((me)=>setTimeout(me, 2e3))
                    ]);
                } catch  {}
                je = null;
            }
            Qc(), await OO(), window.location.reload();
        }, el = async ()=>{
            try {
                Ni.cancel();
            } catch  {}
            try {
                dr?.unsubscribe();
            } catch  {}
            if (je) {
                try {
                    await Promise.race([
                        je.stop(),
                        new Promise((me)=>setTimeout(me, 2e3))
                    ]);
                } catch  {}
                je = null;
            }
            Qc(), await tlt(), window.location.reload();
        }, Bi = async (me)=>{
            try {
                Ni.cancel();
            } catch  {}
            if (je && Ri && ao()) try {
                const wt = {
                    serializedDustWalletState: await je.dust.serializeState(),
                    serializedShieldedWalletState: await je.shielded.serializeState(),
                    serializedUnshieldedWalletState: await je.unshielded.serializeState()
                };
                await E_(wt);
            } catch  {}
            try {
                dr?.unsubscribe();
            } catch  {}
            if (dr = null, je) {
                try {
                    await Promise.race([
                        je.stop(),
                        new Promise((wt)=>setTimeout(wt, 3e3))
                    ]);
                } catch  {}
                je = null;
            }
            Qc(), Ri = !1, ff(), await zp("");
            try {
                await cn.removeItem(ud("session:encryptedSnapshot"));
            } catch  {}
            Ri = !0;
            const Se = F(), Ne = Mr[Se.environment];
            $t = new bh, hn = k_(Ne, $t);
            const ve = await wU(me, hn, Ne.nodeUrl, Se.proofServerUrl, j7(Se, Bn));
            if (je = ve.wallet, Ut = ve.zswapSecretKeys, Wt = ve.dustSecretKey, fr = ve.nightExternalKeyBytes, Bn = fr ? await ZT(fr) : void 0, Ut && D() === "") try {
                const wt = Ut.coinPublicKey, sn = Ut.encryptionPublicKey;
                if (wt && sn && /^[0-9a-f]+$/i.test(wt) && /^[0-9a-f]+$/i.test(sn)) {
                    const qn = wt.match(/.{2}/g), ps = sn.match(/.{2}/g);
                    if (qn && ps) {
                        const Er = new Uint8Array(qn.map((gs)=>parseInt(gs, 16))), $r = new Uint8Array(ps.map((gs)=>parseInt(gs, 16))), Di = new Uint8Array(Er.length + $r.length);
                        Di.set(Er, 0), Di.set($r, Er.length);
                        const Ro = hn.networkId === "mainnet" ? "mn_shield-addr" : `mn_shield-addr_${hn.networkId}`;
                        U(zf.encode(Ro, zf.toWords(Di), !1));
                    }
                }
            } catch (wt) {
                console.error("[Wallet] Shielded address derivation failed:", wt);
            }
            const Ke = await _U(F().environment);
            Ke.length > 0 && pe(Ke), kp(), Ut && Wt && await je.start(Ut, Wt), Se.environment === "mainnet" && Se.cardanoEnabled && me.mnemonic && Sp(me.mnemonic).catch(()=>{});
        }, tl = async (me)=>{
            if (me !== Me() && !Ee()) {
                le(!0), n(!0);
                try {
                    await Vi();
                    const Se = await va(), Ne = Se.wallets.find((wt)=>wt.id === me);
                    if (!Ne) throw new Error("Wallet not found");
                    const ve = Ne.activeAccountIndex ?? 0, Ke = await nlt(me, ve);
                    Se.activeId = me, await hl(Se), Je(me), Ye(ve), T_(me, ve), await Bi(Ke);
                } catch (Se) {
                    u(Se instanceof Error ? Se.message : "Failed to switch wallet");
                } finally{
                    n(!1), le(!1);
                }
            }
        }, hf = async (me, Se, Ne)=>{
            le(!0), n(!0);
            try {
                const ve = await va(), Ke = ve.nextId, wt = Se || `Wallet ${ve.wallets.length + 1}`, sn = await slt(Ke, me, Ne);
                ve.wallets.push({
                    id: Ke,
                    name: wt,
                    accounts: [
                        {
                            index: 0,
                            name: "Account 1"
                        }
                    ],
                    activeAccountIndex: 0,
                    nextAccountIndex: 1
                }), ve.activeId = Ke, ve.nextId = Ke + 1, await hl(ve), Re([
                    ...ve.wallets
                ]), Je(Ke), Ye(0), T_(Ke, 0), await Bi(sn);
            } catch (ve) {
                u(ve instanceof Error ? ve.message : "Failed to add wallet");
            } finally{
                n(!1), le(!1);
            }
        }, pf = async (me, Se)=>{
            const Ne = await va(), ve = Ne.wallets.find((Ke)=>Ke.id === me);
            ve && (ve.name = Se.trim() || ve.name, await hl(Ne), Re([
                ...Ne.wallets
            ]));
        }, Sb = async (me)=>{
            if (me === 0 || !(await va()).wallets.some((ve)=>ve.id === me)) return;
            me === Me() && await tl(0), await ilt(me);
            const Ne = await va();
            Ne.wallets = Ne.wallets.filter((ve)=>ve.id !== me), await hl(Ne), Re([
                ...Ne.wallets
            ]);
        }, vp = async (me)=>{
            if (me !== qe() && !Ee()) {
                le(!0), n(!0);
                try {
                    await Vi();
                    const Se = await rlt(Me(), me), Ne = await va(), ve = Ne.wallets.find((Ke)=>Ke.id === Me());
                    ve && (ve.activeAccountIndex = me, await hl(Ne), Re([
                        ...Ne.wallets
                    ])), Ye(me), T_(Me(), me), await Bi(Se);
                } catch (Se) {
                    u(Se instanceof Error ? Se.message : "Failed to switch account");
                } finally{
                    n(!1), le(!1);
                }
            }
        }, y9 = async ()=>{
            const me = await va(), Se = me.wallets.find((Ke)=>Ke.id === Me());
            if (!Se) return;
            const Ne = Se.nextAccountIndex, ve = `Account ${Se.accounts.length + 1}`;
            Se.accounts.push({
                index: Ne,
                name: ve
            }), Se.nextAccountIndex = Ne + 1, await hl(me), Re([
                ...me.wallets
            ]), await vp(Ne);
        }, w9 = async (me, Se)=>{
            const Ne = await va(), ve = Ne.wallets.find((wt)=>wt.id === Me());
            if (!ve) return;
            const Ke = ve.accounts.find((wt)=>wt.index === me);
            Ke && (Ke.name = Se.trim() || Ke.name, await hl(Ne), Re([
                ...Ne.wallets
            ]));
        }, _9 = async (me)=>{
            if (me === 0) return;
            const Se = await va(), Ne = Se.wallets.find((Ke)=>Ke.id === Me());
            if (!Ne) return;
            const ve = Ne.accounts.find((Ke)=>Ke.index === me);
            if (ve) {
                if (me === qe()) {
                    const Ke = Ne.accounts.find((wt)=>wt.index !== me && !wt.hidden);
                    await vp(Ke?.index ?? 0);
                }
                ve.hidden = !0, await hl(Se), Re([
                    ...Se.wallets
                ]);
            }
        }, kb = async (me)=>{
            const Se = await va(), Ne = Se.wallets.find((Ke)=>Ke.id === Me());
            if (!Ne) return;
            const ve = Ne.accounts.find((Ke)=>Ke.index === me);
            ve && (ve.hidden = !1, await hl(Se), Re([
                ...Se.wallets
            ]));
        }, Sp = async (me)=>{
            if (!Kt) {
                Kt = !0, H(!0), P(null);
                try {
                    const { deriveCardanoAddress: Se, fetchCardanoNightBalance: Ne } = await ei(async ()=>{
                        const { deriveCardanoAddress: wt, fetchCardanoNightBalance: sn } = await Promise.resolve().then(()=>tH);
                        return {
                            deriveCardanoAddress: wt,
                            fetchCardanoNightBalance: sn
                        };
                    }, void 0), ve = await Se(me);
                    Ce(ve);
                    try {
                        const wt = await Ne(ve);
                        ue(wt), tt = 0;
                    } catch (wt) {
                        tt++, P(wt instanceof Error ? wt.message : "Failed to fetch Cardano balance");
                    }
                    Tb();
                    const Ke = ()=>{
                        if (tt >= 5) return;
                        const wt = Math.min(3e5, 6e4 * Math.pow(2, tt));
                        dt = setTimeout(async ()=>{
                            try {
                                const { fetchCardanoNightBalance: sn } = await ei(async ()=>{
                                    const { fetchCardanoNightBalance: ps } = await Promise.resolve().then(()=>tH);
                                    return {
                                        fetchCardanoNightBalance: ps
                                    };
                                }, void 0), qn = await sn(ve);
                                ue(qn), P(null), tt = 0;
                            } catch (sn) {
                                tt++, P(sn instanceof Error ? sn.message : "Failed to fetch Cardano balance");
                            }
                            Ke();
                        }, wt);
                    };
                    Ke();
                } catch (Se) {
                    console.error("[1AM] initCardano failed:", Se), P(Se instanceof Error ? Se.message : "Failed to derive Cardano address");
                } finally{
                    H(!1), Kt = !1;
                }
            }
        }, Tb = ()=>{
            dt && (clearTimeout(dt), dt = null), tt = 0;
        }, Eb = async (me)=>{
            const Se = Me();
            await olt((ve)=>{
                if (ve.mnemonic = me, ve.wallets) {
                    const Ke = ve.wallets.find((wt)=>wt.id === Se);
                    Ke && (Ke.mnemonic = me);
                }
            }), be(!0);
            const Ne = F();
            await Km({
                ...Ne,
                cardanoEnabled: !0
            }), G({
                ...Ne,
                cardanoEnabled: !0
            }), ie(!0), await Sp(me);
        }, x9 = async (me)=>{
            const Se = F();
            if (await Km({
                ...Se,
                cardanoEnabled: me
            }), G({
                ...Se,
                cardanoEnabled: me
            }), ie(me), !me) Tb(), Ce(""), ue(null), P(null);
            else try {
                const Ne = await $T();
                Ne?.mnemonic && await Sp(Ne.mnemonic);
            } catch (Ne) {
                console.error("[1AM] Cardano enable failed:", Ne), P(Ne instanceof Error ? Ne.message : "Failed to enable Cardano");
            }
        }, kp = ()=>{
            if (!je) return;
            dr?.unsubscribe();
            const me = hn.networkId, Se = (ve)=>{
                console.error("[1AM] Wallet state subscription error:", ve), s(!1), u(ve instanceof Error ? ve.message : "Wallet connection lost");
            }, Ne = async (ve)=>{
                s(ve.isSynced);
                const Ke = ve.shielded?.progress, wt = ve.unshielded?.progress, sn = ve.dust?.progress, qn = Number(Ke?.appliedIndex ?? 0), ps = Number(Ke?.highestRelevantWalletIndex ?? 0), Er = Number(wt?.appliedId ?? 0), $r = Number(wt?.highestTransactionId ?? 0), Di = Number(sn?.appliedIndex ?? 0), Ro = Number(sn?.highestRelevantWalletIndex ?? 0), gs = qn + Er + Di, pa = ps + $r + Ro, Nt = pa > 0 ? Math.min(100, Math.round(gs / pa * 100)) : 0;
                if (c({
                    shielded: {
                        current: qn,
                        total: ps
                    },
                    unshielded: {
                        current: Er,
                        total: $r
                    },
                    dust: {
                        current: Di,
                        total: Ro
                    },
                    percent: ve.isSynced ? 100 : Nt
                }), !ve.isSynced && je && Nt > 0 && Nt % 10 === 0 && Ni(je), ve.isSynced || vU({
                    shieldedBalances: {},
                    unshieldedBalances: {},
                    dustBalance: "0",
                    shieldedAddress: D(),
                    unshieldedAddress: K(),
                    dustAddress: ne(),
                    dustCoins: 0,
                    availableUtxoForDustGeneration: 0,
                    pendingTransactions: [],
                    transactions: [],
                    totalTransactions: 0,
                    isLoading: !1,
                    isSynced: !1,
                    syncProgress: Nt,
                    error: null,
                    networkHealth: "ok",
                    wallets: Oe().map((pn)=>({
                            id: pn.id,
                            name: pn.name
                        })),
                    activeWalletId: String(Me()),
                    activeAccountIndex: qe(),
                    cardanoAddress: ut(),
                    cardanoEnabled: Z(),
                    environment: F().environment,
                    timestamp: Date.now()
                }), ve.isSynced && je) {
                    const pn = {};
                    for (const { coin: It } of ve.shielded.totalCoins){
                        const Ts = It.type;
                        pn[Ts] = (pn[Ts] ?? 0n) + It.value;
                    }
                    _(pn);
                    const Yn = {};
                    for (const { utxo: It } of ve.unshielded.totalCoins){
                        const Ts = It.type;
                        Yn[Ts] = (Yn[Ts] ?? 0n) + It.value;
                    }
                    w(new Map(Object.entries(Yn)));
                    const De = new Map;
                    for (const It of ve.dust.availableCoinsWithFullInfo(new Date))It.dtime === void 0 && De.set(It.token.nonce, It);
                    C(De);
                    let pt = 0n;
                    for (const It of De.values())pt += It.generatedNow;
                    I(pt);
                    const en = ve.unshielded.availableCoins.filter((It)=>!It.meta.registeredForDustGeneration && It.utxo.type === fn).length, Jt = Object.fromEntries(Object.entries(pn).map(([It, Ts])=>[
                            It,
                            Ts.toString()
                        ])), Dt = Object.fromEntries(Object.entries(Yn).map(([It, Ts])=>[
                            It,
                            Ts.toString()
                        ])), Bt = pt.toString(), Nr = de().map((It)=>({
                            id: It.id,
                            txHash: It.txHash,
                            type: It.type,
                            status: It.status,
                            createdAt: It.createdAt,
                            recipientAddress: It.recipientAddress
                        })), or = Oe().map((It)=>({
                            id: It.id,
                            name: It.name
                        }));
                    if (A(en), vU({
                        shieldedBalances: Jt,
                        unshieldedBalances: Dt,
                        dustBalance: Bt,
                        shieldedAddress: D(),
                        unshieldedAddress: K(),
                        dustAddress: ne(),
                        dustCoins: De.size,
                        availableUtxoForDustGeneration: en,
                        pendingTransactions: Nr,
                        transactions: [],
                        totalTransactions: 0,
                        isLoading: !1,
                        isSynced: ve.isSynced,
                        syncProgress: a().percent,
                        error: null,
                        networkHealth: "ok",
                        wallets: or,
                        activeWalletId: String(Me()),
                        activeAccountIndex: qe(),
                        cardanoAddress: ut(),
                        cardanoEnabled: Z(),
                        environment: F().environment,
                        timestamp: Date.now()
                    }), ve.isSynced && je && (Ni(je), setTimeout(async ()=>{
                        try {
                            d++;
                            const It = {
                                ts: Date.now(),
                                seq: d,
                                shielded: Jt,
                                unshielded: Dt,
                                dust: Bt,
                                shieldedAddr: D(),
                                unshieldedAddr: K(),
                                dustAddr: ne(),
                                dustCoinsCount: De.size,
                                availUtxo: en,
                                walletState: {
                                    serializedDustWalletState: await je.dust.serializeState(),
                                    serializedShieldedWalletState: await je.shielded.serializeState(),
                                    serializedUnshieldedWalletState: await je.unshielded.serializeState()
                                }
                            }, Ts = ao();
                            if (Ts) {
                                const Ib = crypto.getRandomValues(new Uint8Array(12)), C9 = new TextEncoder().encode(`snapshot-v1:${F().environment}`), Pre = new TextEncoder().encode(JSON.stringify(It)), Ore = await crypto.subtle.encrypt({
                                    name: "AES-GCM",
                                    iv: Ib,
                                    additionalData: C9
                                }, Ts.key, Pre), jM = (Mre)=>{
                                    const qM = new Uint8Array(Mre);
                                    let KM = "";
                                    for(let I9 = 0; I9 < qM.length; I9++)KM += String.fromCharCode(qM[I9]);
                                    return btoa(KM);
                                };
                                cn.setItem(ud("session:encryptedSnapshot"), JSON.stringify({
                                    iv: jM(Ib),
                                    ct: jM(Ore)
                                }));
                            }
                        } catch (It) {
                            console.error("[Wallet] Snapshot save failed:", It);
                        }
                    }, 1e3)), K() === "") {
                        const It = ve.unshielded.address?.data, Ts = It ? new Hi(It) : ve.unshielded.address;
                        $(ns.encode(me, Ts).toString());
                    }
                    ne() === "" && te(ns.encode(me, ve.dust.address).toString()), D() === "" && U(ns.encode(me, ve.shielded.address).toString());
                    const On = [];
                    for await (const It of ve.unshielded.transactionHistory.getAll())On.push(It);
                    try {
                        if (ve.shielded?.transactionHistory) for await (const It of ve.shielded.transactionHistory.getAll())On.push(It);
                    } catch  {}
                    const Xr = Tu(On);
                    Q(Xr), Y() > Math.max(1, Math.ceil(Xr.length / I_)) && ae(1);
                    const Gs = new Set(Xr.map((It)=>It.hash));
                    await Jc(Gs);
                }
            };
            dr = je.state().subscribe(Ne, Se);
        }, Cb = async ()=>{
            if (!(!je || !Ut || !Wt)) {
                s(!1), c({
                    shielded: {
                        current: 0,
                        total: 0
                    },
                    unshielded: {
                        current: 0,
                        total: 0
                    },
                    dust: {
                        current: 0,
                        total: 0
                    },
                    percent: 0
                }), u(null);
                try {
                    if (Ni.flush(), dr?.unsubscribe(), dr = null, $t) try {
                        await zp($t.serialize());
                    } catch  {}
                    const me = {
                        serializedDustWalletState: await je.dust.serializeState(),
                        serializedShieldedWalletState: await je.shielded.serializeState(),
                        serializedUnshieldedWalletState: await je.unshielded.serializeState()
                    };
                    try {
                        await Promise.race([
                            je.stop(),
                            new Promise((Ke)=>setTimeout(Ke, 3e3))
                        ]);
                    } catch  {}
                    const Se = F(), Ne = Mr[Se.environment];
                    $t = await gU() ?? new bh, je = await alt(me, k_(Ne, $t), Ne.nodeUrl, Se.proofServerUrl, j7(Se, Bn)), kp(), await je.start(Ut, Wt);
                } catch (me) {
                    console.error("Failed to refresh sync:", me), u("Failed to refresh sync. Try again.");
                }
            }
        };
        $a(async ()=>{
            try {
                const me = (Nt)=>{
                    if (Nt.shieldedBalances && Object.keys(Nt.shieldedBalances).length > 0) {
                        const pn = {};
                        for (const [Yn, De] of Object.entries(Nt.shieldedBalances))pn[Yn] = BigInt(De);
                        _(pn);
                    }
                    if (Nt.unshieldedBalances && Object.keys(Nt.unshieldedBalances).length > 0) {
                        const pn = {};
                        for (const [Yn, De] of Object.entries(Nt.unshieldedBalances))pn[Yn] = BigInt(De);
                        w(new Map(Object.entries(pn)));
                    }
                    Nt.dustBalance && Nt.dustBalance !== "0" && I(BigInt(Nt.dustBalance)), Nt.shieldedAddress && U(Nt.shieldedAddress), Nt.unshieldedAddress && $(Nt.unshieldedAddress), Nt.dustAddress && te(Nt.dustAddress), Nt.availableUtxoForDustGeneration != null && A(Nt.availableUtxoForDustGeneration), Nt.pendingTransactions?.length > 0 && pe((pn)=>{
                        const Yn = new Set(pn.map((pt)=>pt.id)), De = Nt.pendingTransactions.filter((pt)=>!Yn.has(pt.id));
                        return De.length > 0 ? [
                            ...De,
                            ...pn
                        ] : pn;
                    }), Nt.cardanoAddress && Ce(Nt.cardanoAddress), Nt.isSynced && !r() && s(!0), typeof Nt.syncProgress == "number" && Nt.syncProgress > a().percent && c((pn)=>({
                            ...pn,
                            percent: Nt.syncProgress
                        }));
                }, Se = await Sg();
                G(Se);
                const Ne = Se.environment, ve = await ine();
                ve && ve.environment === Ne ? (me(ve), ve.isSynced && s(!0), n(!1)) : ve && `${ve.environment}${Ne}`, Plt((Nt)=>{
                    Nt.environment === Ne && me(Nt);
                });
                const Ke = window.__ONE_AM_SHELL__ === "sidepanel" ? "sidepanel" : window.__ONE_AM_SHELL__ === "popup" ? "popup" : "fullpage", wt = await Rlt(Ke), sn = wt.role === "secondary";
                o(sn), sn || wt.role;
                let qn;
                const ps = async ()=>{
                    try {
                        const Nt = await cn.getItem(ud("session:encryptedSnapshot"));
                        if (!Nt) return;
                        const pn = JSON.parse(Nt), Yn = ao();
                        if (!Yn) return;
                        const De = Uint8Array.from(atob(pn.iv), (Bt)=>Bt.charCodeAt(0)), pt = Uint8Array.from(atob(pn.ct), (Bt)=>Bt.charCodeAt(0)), en = new TextEncoder().encode(`snapshot-v1:${Se.environment}`), Jt = await crypto.subtle.decrypt({
                            name: "AES-GCM",
                            iv: De,
                            additionalData: en
                        }, Yn.key, pt), Dt = JSON.parse(new TextDecoder().decode(Jt));
                        if (typeof Dt.seq == "number" && Dt.seq < d) return;
                        if (typeof Dt.seq == "number" && (d = Dt.seq), Dt.shielded) {
                            const Bt = {};
                            for (const [Nr, or] of Object.entries(Dt.shielded))Bt[Nr] = BigInt(or);
                            _(Bt);
                        }
                        if (Dt.unshielded) {
                            const Bt = {};
                            for (const [Nr, or] of Object.entries(Dt.unshielded))Bt[Nr] = BigInt(or);
                            w(new Map(Object.entries(Bt)));
                        }
                        Dt.dust && I(BigInt(Dt.dust)), Dt.shieldedAddr && U(Dt.shieldedAddr), Dt.unshieldedAddr && $(Dt.unshieldedAddr), Dt.dustAddr && te(Dt.dustAddr), Dt.availUtxo != null && A(Dt.availUtxo), Dt.walletState && (qn = Dt.walletState), n(!1);
                    } catch  {}
                }, Er = Mr[Se.environment], [$r, Di, Ro, gs] = await Promise.all([
                    va(),
                    gU(),
                    _U(Se.environment),
                    $T()
                ]);
                Re($r.wallets), Je($r.activeId);
                const pa = $r.wallets.find((Nt)=>Nt.id === $r.activeId);
                if (pa && Ye(pa.activeAccountIndex ?? 0), T_($r.activeId, pa?.activeAccountIndex ?? 0), $t = Di ?? new bh, Di) {
                    const Nt = [];
                    for await (const pn of Di.getAll())Nt.push(pn);
                    Nt.sort((pn, Yn)=>Yn.timestamp.getTime() - pn.timestamp.getTime()), Q(Nt);
                }
                if (Ro.length > 0 && pe(Ro), hn = k_(Er, $t), gs) {
                    Ri = !0, $5(gs), Et(gs.seed), be(!!gs.mnemonic), ie(!!Se.cardanoEnabled), await ps(), !gs.walletState && qn && (gs.walletState = qn);
                    const Nt = async ()=>{
                        const pn = await wU(gs, hn, Er.nodeUrl, Se.proofServerUrl, j7(Se, Bn));
                        if (je = pn.wallet, Ut = pn.zswapSecretKeys, Wt = pn.dustSecretKey, fr = pn.nightExternalKeyBytes, Bn = fr ? await ZT(fr) : void 0, Ut && D() === "") try {
                            const Yn = Ut.coinPublicKey, De = Ut.encryptionPublicKey;
                            if (Yn && De && /^[0-9a-f]+$/i.test(Yn) && /^[0-9a-f]+$/i.test(De)) {
                                const pt = Yn.match(/.{2}/g), en = De.match(/.{2}/g);
                                if (pt && en) {
                                    const Jt = new Uint8Array(pt.map((or)=>parseInt(or, 16))), Dt = new Uint8Array(en.map((or)=>parseInt(or, 16))), Bt = new Uint8Array(Jt.length + Dt.length);
                                    Bt.set(Jt, 0), Bt.set(Dt, Jt.length);
                                    const Nr = hn.networkId === "mainnet" ? "mn_shield-addr" : `mn_shield-addr_${hn.networkId}`;
                                    U(zf.encode(Nr, zf.toWords(Bt), !1));
                                }
                            }
                        } catch (Yn) {
                            console.error("[Wallet] Shielded address derivation failed:", Yn);
                        }
                    };
                    sn ? (ve?.isSynced && s(!0), n(!1), Nt().then(()=>{
                        kp();
                    }).catch((pn)=>console.error("[1AM] Secondary: deferred wallet init failed:", pn))) : (await Nt(), kp(), je && Ut && Wt && await je.start(Ut, Wt)), Se.environment === "mainnet" && Se.cardanoEnabled && gs.mnemonic && Sp(gs.mnemonic).catch(()=>{}), n(!1);
                    return;
                }
                u("No wallet found. Please create one first."), n(!1);
            } catch (me) {
                u(me instanceof Error ? me.message : "Failed to initialize wallet"), n(!1);
            }
        });
        let Mw = !1;
        ot(async ()=>{
            if (!(!r() || Mw)) {
                Mw = !0;
                try {
                    const { getRecoverableTxs: me, removeInflightTx: Se } = await ei(async ()=>{
                        const { getRecoverableTxs: wt, removeInflightTx: sn } = await Promise.resolve().then(()=>L2t);
                        return {
                            getRecoverableTxs: wt,
                            removeInflightTx: sn
                        };
                    }, void 0), Ne = `${Me()}:${qe()}`, ve = F().environment, Ke = await me(Ne, ve);
                    for (const wt of Ke)pe((sn)=>sn.some((qn)=>qn.id === wt.id) ? sn : [
                            {
                                id: wt.id,
                                type: wt.txType,
                                amount: "0",
                                tokenType: "",
                                status: "submitting",
                                createdAt: wt.createdAt,
                                recipientAddress: wt.dappOrigin ? `DApp via ${wt.dappOrigin}` : void 0,
                                error: "Interrupted — checking if transaction was confirmed"
                            },
                            ...sn
                        ]), await Se(wt.id);
                    Ke.length > 0 && Vi().catch(()=>{});
                } catch (me) {
                    console.error("[1AM] Inflight check failed:", me);
                }
            }
        });
        let Rw = Date.now();
        const Tp = ()=>{
            Rw = Date.now();
        }, v9 = setInterval(async ()=>{
            if (!je || !ao() || Wm) return;
            if (!await elt()) {
                ec();
                return;
            }
            const Se = (F().autoLockMinutes ?? 30) * 60 * 1e3;
            Date.now() - Rw > Se && ec();
        }, 5e3);
        typeof document < "u" && (document.addEventListener("click", Tp), document.addEventListener("keydown", Tp));
        const S9 = setInterval(async ()=>{
            if (!r()) {
                const { checkNetworkHealth: me } = await ei(async ()=>{
                    const { checkNetworkHealth: Ne } = await Promise.resolve().then(()=>m2);
                    return {
                        checkNetworkHealth: Ne
                    };
                }, void 0), Se = await me(F().environment);
                p(Se);
            }
        }, 3e4);
        (async ()=>{
            try {
                const { checkNetworkHealth: me } = await ei(async ()=>{
                    const { checkNetworkHealth: Ne } = await Promise.resolve().then(()=>m2);
                    return {
                        checkNetworkHealth: Ne
                    };
                }, void 0), Se = await me(F().environment);
                p(Se);
            } catch (me) {
                console.error("[1AM] Initial health check failed:", me);
            }
        })();
        const Ep = async ()=>{
            const me = F();
            if (!me.dustSponsorship || me.proofServerMode !== "proofstation") {
                b((Se)=>({
                        ...Se,
                        status: "off"
                    }));
                return;
            }
            try {
                const { checkSponsorHealth: Se } = await ei(async ()=>{
                    const { checkSponsorHealth: ve } = await Promise.resolve().then(()=>m2);
                    return {
                        checkSponsorHealth: ve
                    };
                }, void 0), Ne = await Se(me.proofServerUrl);
                b(Ne);
            } catch  {}
        };
        Ep();
        const k9 = setInterval(Ep, 6e4);
        At(async ()=>{
            if (Olt(), Tb(), clearInterval(S9), clearInterval(k9), clearInterval(v9), Vn.forEach((me)=>clearTimeout(me)), Vn.clear(), typeof document < "u" && (document.removeEventListener("click", Tp), document.removeEventListener("keydown", Tp)), $t) try {
                await zp($t.serialize());
            } catch  {}
            Ni.flush(), dr?.unsubscribe(), await je?.stop();
        });
        const E9 = {
            isLoading: e,
            isSynced: r,
            syncProgress: a,
            error: l,
            networkHealth: f,
            sponsorHealth: h,
            shieldedBalances: y,
            unshieldedBalances: v,
            dustBalance: E,
            shieldedAddress: D,
            unshieldedAddress: K,
            dustAddress: ne,
            dustCoins: g,
            availableUtxoForDustGeneration: x,
            transactions: ee,
            paginatedTransactions: Wr,
            currentPage: Y,
            totalPages: nt,
            totalTransactions: jn,
            setCurrentPage: ae,
            pendingTransactions: de,
            pendingCount: Ae,
            toasts: vt,
            dismissToast: Ya,
            addToast: _n,
            isGeneratingDust: R,
            dustGenerationError: L,
            startDustGeneration: uf,
            sendTokens: df,
            refreshSync: Cb,
            trackDAppTx: (me, Se)=>{
                const Ne = crypto.randomUUID(), ve = {
                    id: Ne,
                    type: "dapp",
                    amount: "0",
                    tokenType: "",
                    status: "submitting",
                    createdAt: Date.now(),
                    recipientAddress: `${me} via ${Se}`
                };
                return pe((Ke)=>[
                        ve,
                        ...Ke
                    ]), Vi().catch((Ke)=>console.error("[Wallet] trackDAppTx persist failed:", Ke)), Ne;
            },
            resolveDAppTx: (me, Se, Ne)=>{
                const ve = Ne ? {
                    status: "failed",
                    error: Ne,
                    txHash: Se
                } : {
                    status: "confirmed",
                    txHash: Se
                };
                pe((Ke)=>Ke.map((wt)=>wt.id === me ? {
                            ...wt,
                            ...ve
                        } : wt)), Vi().catch((Ke)=>console.error("[Wallet] resolveDAppTx persist failed:", Ke));
            },
            acquireTxLock: q7,
            releaseTxLock: K7,
            isSecondaryContext: i,
            lockWallet: ec,
            deleteWallet: el,
            formatBalance: gr,
            getWallet: br,
            getDustSecretKey: async ()=>{
                if (!Wt) throw new Error("Wallet is locked");
                return Wt;
            },
            getZswapSecretKeys: async ()=>{
                if (!Ut) throw new Error("Wallet is locked");
                return Ut;
            },
            getNightExternalKey: async ()=>{
                if (!fr) throw new Error("Wallet is locked");
                return fr;
            },
            get configuration () {
                return hn;
            },
            sendTokensError: B,
            sendTokensStatus: O,
            environmentSettings: F,
            updateSettings: Yc,
            wallets: Oe,
            activeWalletId: Me,
            switchWallet: tl,
            addWallet: hf,
            renameWallet: pf,
            removeWallet: Sb,
            isSwitchingWallet: Ee,
            activeAccountIndex: qe,
            switchAccount: vp,
            addAccount: y9,
            renameAccount: w9,
            hideAccount: _9,
            unhideAccount: kb,
            cardanoAddress: ut,
            cardanoBalance: oe,
            cardanoLoading: Ie,
            cardanoError: T,
            cardanoEnabled: Z,
            cardanoHasMnemonic: ce,
            setCardanoEnabled: x9,
            enableCardanoWithMnemonic: Eb,
            vaultSeed: yt,
            exportMnemonic: async (me)=>{
                const Se = typeof me == "string" ? new TextEncoder().encode(me) : me;
                try {
                    const { extractMnemonic: Ne } = await ei(async ()=>{
                        const { extractMnemonic: Ke } = await import("./export-mnemonic-96pGaLLi.js");
                        return {
                            extractMnemonic: Ke
                        };
                    }, []), { contents: ve } = await jte(Se);
                    return Ne(ve, Me());
                } finally{
                    Se.fill(0);
                }
            }
        };
        return M(one.Provider, {
            value: E9,
            get children () {
                return t.children;
            }
        });
    }, Tr = ()=>{
        const t = ds(one);
        if (!t) throw new Error("useWallet must be used within a WalletProvider");
        return t;
    };
    var Blt = 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 ane(t) {
        let e = t.startIndex ?? 0;
        const n = t.startLevel ?? 0, r = [], s = (c)=>{
            if (c == null) return "";
            const l = t.getKey ?? "key", u = Kp(l) ? c[l] : l(c);
            return u != null ? String(u) : "";
        }, i = (c)=>{
            if (c == null) return "";
            const l = t.getTextValue ?? "textValue", u = Kp(l) ? c[l] : l(c);
            return u != null ? String(u) : "";
        }, o = (c)=>{
            if (c == null) return !1;
            const l = t.getDisabled ?? "disabled";
            return (Kp(l) ? c[l] : l(c)) ?? !1;
        }, a = (c)=>{
            if (c != null) return Kp(t.getSectionChildren) ? c[t.getSectionChildren] : t.getSectionChildren?.(c);
        };
        for (const c of t.dataSource){
            if (Kp(c) || Nie(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 = ane({
                        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 Dlt(t, e = []) {
        return _t(()=>{
            const n = ane({
                dataSource: ke(t.dataSource),
                getKey: ke(t.getKey),
                getTextValue: ke(t.getTextValue),
                getDisabled: ke(t.getDisabled),
                getSectionChildren: ke(t.getSectionChildren)
            });
            for(let r = 0; r < e.length; r++)e[r]();
            return t.factory(n);
        });
    }
    var Flt = new Set([
        "Avst",
        "Arab",
        "Armi",
        "Syrc",
        "Samr",
        "Mand",
        "Thaa",
        "Mend",
        "Nkoo",
        "Adlm",
        "Rohg",
        "Hebr"
    ]), Llt = new Set([
        "ae",
        "ar",
        "arc",
        "bcc",
        "bqi",
        "ckb",
        "dv",
        "fa",
        "glk",
        "he",
        "ku",
        "mzn",
        "nqo",
        "pnb",
        "ps",
        "sd",
        "ug",
        "ur",
        "yi"
    ]);
    function zlt(t) {
        if (Intl.Locale) {
            const n = new Intl.Locale(t).maximize().script ?? "";
            return Flt.has(n);
        }
        const e = t.split("-")[0];
        return Llt.has(e);
    }
    function Ult(t) {
        return zlt(t) ? "rtl" : "ltr";
    }
    function cne() {
        let t = typeof navigator < "u" && (navigator.language || navigator.userLanguage) || "en-US";
        try {
            Intl.DateTimeFormat.supportedLocalesOf([
                t
            ]);
        } catch  {
            t = "en-US";
        }
        return {
            locale: t,
            direction: Ult(t)
        };
    }
    var JT = cne(), Em = new Set;
    function SU() {
        JT = cne();
        for (const t of Em)t(JT);
    }
    function Hlt() {
        const [t, e] = he(JT), n = _t(()=>t());
        return $a(()=>{
            Em.size === 0 && window.addEventListener("languagechange", SU), Em.add(e), At(()=>{
                Em.delete(e), Em.size === 0 && window.removeEventListener("languagechange", SU);
            });
        }), {
            locale: ()=>n().locale,
            direction: ()=>n().direction
        };
    }
    var jlt = us();
    function Xc() {
        const t = Hlt();
        return ds(jlt) || t;
    }
    var W7 = new Map;
    function lne(t) {
        const { locale: e } = Xc(), n = _t(()=>e() + (t ? Object.entries(t).sort((r, s)=>r[0] < s[0] ? -1 : 1).join() : ""));
        return _t(()=>{
            const r = n();
            let s;
            return W7.has(r) && (s = W7.get(r)), s || (s = new Intl.Collator(e(), t), W7.set(r, s)), s;
        });
    }
    var mc = class une extends Set {
        anchorKey;
        currentKey;
        constructor(e, n, r){
            super(e), e instanceof une ? (this.anchorKey = n || e.anchorKey, this.currentKey = r || e.currentKey) : (this.anchorKey = n, this.currentKey = r);
        }
    };
    function qlt(t) {
        const [e, n] = _p(t);
        return [
            ()=>e() ?? new mc,
            n
        ];
    }
    function dne(t) {
        return Lie() ? t.altKey : t.ctrlKey;
    }
    function Gp(t) {
        return a1() ? t.metaKey : t.ctrlKey;
    }
    function kU(t) {
        return new mc(t);
    }
    function fne(t, e) {
        if (t.size !== e.size) return !1;
        for (const n of t)if (!e.has(n)) return !1;
        return !0;
    }
    function Klt(t) {
        const e = zt({
            selectionMode: "none",
            selectionBehavior: "toggle"
        }, t), [n, r] = he(!1), [s, i] = he(), o = _t(()=>{
            const b = ke(e.selectedKeys);
            return b != null ? kU(b) : b;
        }), a = _t(()=>{
            const b = ke(e.defaultSelectedKeys);
            return b != null ? kU(b) : new mc;
        }), [c, l] = qlt({
            value: o,
            defaultValue: a,
            onChange: (b)=>e.onSelectionChange?.(b)
        }), [u, d] = he(ke(e.selectionBehavior)), f = ()=>ke(e.selectionMode), p = ()=>ke(e.disallowEmptySelection) ?? !1, h = (b)=>{
            (ke(e.allowDuplicateSelectionEvents) || !fne(b, c())) && l(b);
        };
        return ot(()=>{
            const b = c();
            ke(e.selectionBehavior) === "replace" && u() === "toggle" && typeof b == "object" && b.size === 0 && d("replace");
        }), ot(()=>{
            d(ke(e.selectionBehavior) ?? "toggle");
        }), {
            selectionMode: f,
            disallowEmptySelection: p,
            selectionBehavior: u,
            setSelectionBehavior: d,
            isFocused: n,
            setFocused: r,
            focusedKey: s,
            setFocusedKey: i,
            selectedKeys: c,
            setSelectedKeys: h
        };
    }
    function hne(t) {
        const [e, n] = he(""), [r, s] = he(-1);
        return {
            typeSelectHandlers: {
                onKeyDown: (o)=>{
                    if (ke(t.isDisabled)) return;
                    const a = ke(t.keyboardDelegate), c = ke(t.selectionManager);
                    if (!a.getKeyForSearch) return;
                    const l = Wlt(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 && $lt(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 Wlt(t) {
        return t.length === 1 || !/^[A-Z]/i.test(t) ? t : "";
    }
    function $lt(t) {
        return t.split("").every((e)=>e === t[0]);
    }
    function pne(t, e, n) {
        const s = Le({
            selectOnFocus: ()=>ke(t.selectionManager).selectionBehavior() === "replace"
        }, t), i = ()=>n?.() ?? e(), { direction: o } = Xc();
        let a = {
            top: 0,
            left: 0
        };
        Aie(()=>ke(s.isVirtualized) ? void 0 : i(), "scroll", ()=>{
            const y = i();
            y && (a = {
                top: y.scrollTop,
                left: y.scrollLeft
            });
        });
        const { typeSelectHandlers: c } = hne({
            isDisabled: ()=>ke(s.disallowTypeAhead),
            keyboardDelegate: ()=>ke(s.keyboardDelegate),
            selectionManager: ()=>ke(s.selectionManager)
        }), l = ()=>ke(s.orientation) ?? "vertical", u = (y)=>{
            Fn(y, c.onKeyDown), y.altKey && y.key === "Tab" && y.preventDefault();
            const _ = e();
            if (!_?.contains(y.target)) return;
            const v = ke(s.selectionManager), w = ke(s.selectOnFocus), E = (K)=>{
                K != null && (v.setFocusedKey(K), y.shiftKey && v.selectionMode() === "multiple" ? v.extendSelection(K) : w && !dne(y) && v.replaceSelection(K));
            }, I = ke(s.keyboardDelegate), D = ke(s.shouldFocusWrap), U = v.focusedKey();
            switch(y.key){
                case (l() === "vertical" ? "ArrowDown" : "ArrowRight"):
                    {
                        if (I.getKeyBelow) {
                            y.preventDefault();
                            let K;
                            U != null ? K = I.getKeyBelow(U) : K = I.getFirstKey?.(), K == null && D && (K = I.getFirstKey?.(U)), E(K);
                        }
                        break;
                    }
                case (l() === "vertical" ? "ArrowUp" : "ArrowLeft"):
                    {
                        if (I.getKeyAbove) {
                            y.preventDefault();
                            let K;
                            U != null ? K = I.getKeyAbove(U) : K = I.getLastKey?.(), K == null && D && (K = I.getLastKey?.(U)), E(K);
                        }
                        break;
                    }
                case (l() === "vertical" ? "ArrowLeft" : "ArrowUp"):
                    {
                        if (I.getKeyLeftOf) {
                            y.preventDefault();
                            const K = o() === "rtl";
                            let $;
                            U != null ? $ = I.getKeyLeftOf(U) : $ = K ? I.getFirstKey?.() : I.getLastKey?.(), E($);
                        }
                        break;
                    }
                case (l() === "vertical" ? "ArrowRight" : "ArrowDown"):
                    {
                        if (I.getKeyRightOf) {
                            y.preventDefault();
                            const K = o() === "rtl";
                            let $;
                            U != null ? $ = I.getKeyRightOf(U) : $ = K ? I.getLastKey?.() : I.getFirstKey?.(), E($);
                        }
                        break;
                    }
                case "Home":
                    if (I.getFirstKey) {
                        y.preventDefault();
                        const K = I.getFirstKey(U, Gp(y));
                        K != null && (v.setFocusedKey(K), Gp(y) && y.shiftKey && v.selectionMode() === "multiple" ? v.extendSelection(K) : w && v.replaceSelection(K));
                    }
                    break;
                case "End":
                    if (I.getLastKey) {
                        y.preventDefault();
                        const K = I.getLastKey(U, Gp(y));
                        K != null && (v.setFocusedKey(K), Gp(y) && y.shiftKey && v.selectionMode() === "multiple" ? v.extendSelection(K) : w && v.replaceSelection(K));
                    }
                    break;
                case "PageDown":
                    if (I.getKeyPageBelow && U != null) {
                        y.preventDefault();
                        const K = I.getKeyPageBelow(U);
                        E(K);
                    }
                    break;
                case "PageUp":
                    if (I.getKeyPageAbove && U != null) {
                        y.preventDefault();
                        const K = I.getKeyPageAbove(U);
                        E(K);
                    }
                    break;
                case "a":
                    Gp(y) && v.selectionMode() === "multiple" && ke(s.disallowSelectAll) !== !0 && (y.preventDefault(), v.selectAll());
                    break;
                case "Escape":
                    y.defaultPrevented || (y.preventDefault(), ke(s.disallowEmptySelection) || v.clearSelection());
                    break;
                case "Tab":
                    if (!ke(s.allowsTabNavigation)) {
                        if (y.shiftKey) _.focus();
                        else {
                            const K = uj(_, {
                                tabbable: !0
                            });
                            let $, ne;
                            do ne = K.lastChild(), ne && ($ = ne);
                            while (ne);
                            $ && !$.contains(document.activeElement) && Lr($);
                        }
                        break;
                    }
            }
        }, d = (y)=>{
            const _ = ke(s.selectionManager), v = ke(s.keyboardDelegate), w = ke(s.selectOnFocus);
            if (_.isFocused()) {
                y.currentTarget.contains(y.target) || _.setFocused(!1);
                return;
            }
            if (y.currentTarget.contains(y.target)) {
                if (_.setFocused(!0), _.focusedKey() == null) {
                    const E = (D)=>{
                        D != null && (_.setFocusedKey(D), w && _.replaceSelection(D));
                    }, I = y.relatedTarget;
                    I && y.currentTarget.compareDocumentPosition(I) & Node.DOCUMENT_POSITION_FOLLOWING ? E(_.lastSelectedKey() ?? v.getLastKey?.()) : E(_.firstSelectedKey() ?? v.getFirstKey?.());
                } else if (!ke(s.isVirtualized)) {
                    const E = i();
                    if (E) {
                        E.scrollTop = a.top, E.scrollLeft = a.left;
                        const I = E.querySelector(`[data-key="${_.focusedKey()}"]`);
                        I && (Lr(I), I6(E, I));
                    }
                }
            }
        }, f = (y)=>{
            const _ = ke(s.selectionManager);
            y.currentTarget.contains(y.relatedTarget) || _.setFocused(!1);
        }, p = (y)=>{
            i() === y.target && y.preventDefault();
        }, h = ()=>{
            const y = ke(s.autoFocus);
            if (!y) return;
            const _ = ke(s.selectionManager), v = ke(s.keyboardDelegate);
            let w;
            y === "first" && (w = v.getFirstKey?.()), y === "last" && (w = v.getLastKey?.());
            const E = _.selectedKeys();
            E.size && (w = E.values().next().value), _.setFocused(!0), _.setFocusedKey(w);
            const I = e();
            I && w == null && !ke(s.shouldUseVirtualFocus) && Lr(I);
        };
        return $a(()=>{
            s.deferAutoFocus ? setTimeout(h, 0) : h();
        }), ot(Gi([
            i,
            ()=>ke(s.isVirtualized),
            ()=>ke(s.selectionManager).focusedKey()
        ], (y)=>{
            const [_, v, w] = y;
            if (v) w && s.scrollToKey?.(w);
            else if (w && _) {
                const E = _.querySelector(`[data-key="${w}"]`);
                E && I6(_, E);
            }
        })), {
            tabIndex: _t(()=>{
                if (!ke(s.shouldUseVirtualFocus)) return ke(s.selectionManager).focusedKey() == null ? 0 : -1;
            }),
            onKeyDown: u,
            onMouseDown: p,
            onFocusIn: d,
            onFocusOut: f
        };
    }
    function Q5(t, e) {
        const n = ()=>ke(t.selectionManager), r = ()=>ke(t.key), s = ()=>ke(t.shouldUseVirtualFocus), i = (v)=>{
            n().selectionMode() !== "none" && (n().selectionMode() === "single" ? n().isSelected(r()) && !n().disallowEmptySelection() ? n().toggleSelection(r()) : n().replaceSelection(r()) : v?.shiftKey ? n().extendSelection(r()) : n().selectionBehavior() === "toggle" || Gp(v) || "pointerType" in v && v.pointerType === "touch" ? n().toggleSelection(r()) : n().replaceSelection(r()));
        }, o = ()=>n().isSelected(r()), a = ()=>ke(t.disabled) || n().isDisabled(r()), c = ()=>!a() && n().canSelectItem(r());
        let l = null;
        const u = (v)=>{
            c() && (l = v.pointerType, v.pointerType === "mouse" && v.button === 0 && !ke(t.shouldSelectOnPressUp) && i(v));
        }, d = (v)=>{
            c() && v.pointerType === "mouse" && v.button === 0 && ke(t.shouldSelectOnPressUp) && ke(t.allowsDifferentPressOrigin) && i(v);
        }, f = (v)=>{
            c() && (ke(t.shouldSelectOnPressUp) && !ke(t.allowsDifferentPressOrigin) || l !== "mouse") && i(v);
        }, p = (v)=>{
            !c() || ![
                "Enter",
                " "
            ].includes(v.key) || (dne(v) ? n().toggleSelection(r()) : i(v));
        }, h = (v)=>{
            a() && v.preventDefault();
        }, b = (v)=>{
            const w = e();
            s() || a() || !w || v.target === w && n().setFocusedKey(r());
        }, y = _t(()=>{
            if (!(s() || a())) return r() === n().focusedKey() ? 0 : -1;
        }), _ = _t(()=>ke(t.virtualized) ? void 0 : r());
        return ot(Gi([
            e,
            r,
            s,
            ()=>n().focusedKey(),
            ()=>n().isFocused()
        ], ([v, w, E, I, D])=>{
            v && w === I && D && !E && document.activeElement !== v && (t.focus ? t.focus() : Lr(v));
        })), {
            isSelected: o,
            isDisabled: a,
            allowsSelection: c,
            tabIndex: y,
            dataKey: _,
            onPointerDown: u,
            onPointerUp: d,
            onClick: f,
            onKeyDown: p,
            onMouseDown: h,
            onFocus: b
        };
    }
    var Xlt = 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 mc(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 mc(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 mc([
                e
            ], e, e) : new mc;
            this.state.setSelectedKeys(n);
        }
        setSelectedKeys(t) {
            if (this.selectionMode() === "none") return;
            const e = new mc;
            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 mc);
        }
        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;
        }
    }, TU = 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 e9(t) {
        const e = Klt(t), r = Dlt({
            dataSource: ()=>ke(t.dataSource),
            getKey: ()=>ke(t.getKey),
            getTextValue: ()=>ke(t.getTextValue),
            getDisabled: ()=>ke(t.getDisabled),
            getSectionChildren: ()=>ke(t.getSectionChildren),
            factory: (i)=>t.filter ? new TU(t.filter(i)) : new TU(i)
        }, [
            ()=>t.filter
        ]), s = new Xlt(r, e);
        return Vre(()=>{
            const i = e.focusedKey();
            i != null && !r().getItem(i) && e.setFocusedKey(void 0);
        }), {
            collection: r,
            selectionManager: ()=>s
        };
    }
    var gne = us();
    function bne() {
        return ds(gne);
    }
    function Glt() {
        const t = bne();
        if (t === void 0) throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");
        return t;
    }
    function mne(t, e) {
        return !!(e.compareDocumentPosition(t) & Node.DOCUMENT_POSITION_PRECEDING);
    }
    function Zlt(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 && mne(s, n)) return r + 1;
        }
        return 0;
    }
    function Jlt(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 : mne(a, c) ? (r > i && (n = !0), -1) : (r < i && (n = !0), 1);
        }), n ? e.map(([r, s])=>s) : t;
    }
    function yne(t, e) {
        const n = Jlt(t);
        t !== n && e(n);
    }
    function Ylt(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 Mc(r).body;
    }
    function Qlt(t, e) {
        ot(()=>{
            const n = setTimeout(()=>{
                yne(t(), e);
            });
            At(()=>clearTimeout(n));
        });
    }
    function eut(t, e) {
        if (typeof IntersectionObserver != "function") {
            Qlt(t, e);
            return;
        }
        let n = [];
        ot(()=>{
            const r = ()=>{
                const o = !!n.length;
                n = t(), o && yne(t(), e);
            }, s = Ylt(t()), i = new IntersectionObserver(r, {
                root: s
            });
            for (const o of t()){
                const a = o.ref();
                a && i.observe(a);
            }
            At(()=>i.disconnect());
        });
    }
    function wne(t = {}) {
        const [e, n] = dlt({
            value: ()=>ke(t.items),
            onChange: (i)=>t.onItemsChange?.(i)
        });
        eut(e, n);
        const r = (i)=>(n((o)=>{
                const a = Zlt(o, i);
                return Rie(o, i, a);
            }), ()=>{
                n((o)=>{
                    const a = o.filter((c)=>c.ref() !== i.ref());
                    return o.length === a.length ? o : a;
                });
            });
        return {
            DomCollectionProvider: (i)=>M(gne.Provider, {
                    value: {
                        registerItem: r
                    },
                    get children () {
                        return i.children;
                    }
                })
        };
    }
    function _ne(t) {
        const e = Glt(), n = zt({
            shouldRegisterItem: !0
        }, t);
        ot(()=>{
            if (!n.shouldRegisterItem) return;
            const r = e.registerItem(n.getItem());
            At(r);
        });
    }
    function tut(t, e) {
        const n = new ResizeObserver(t);
        return At(n.disconnect.bind(n)), {
            observe: (r)=>n.observe(r, e),
            unobserve: n.unobserve.bind(n)
        };
    }
    function nut(t, e, n) {
        const r = new WeakMap, { observe: s, unobserve: i } = tut((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);
        ot((o)=>{
            const a = Sie(E6(ke(t)));
            return Cie(a, o, s, i), a;
        }, []);
    }
    var rut = {};
    fu(rut, {
        Content: ()=>LO,
        Indicator: ()=>zO,
        List: ()=>UO,
        Root: ()=>HO,
        Tabs: ()=>iut,
        Trigger: ()=>jO,
        useTabsContext: ()=>xw
    });
    var xne = us();
    function xw() {
        const t = ds(xne);
        if (t === void 0) throw new Error("[kobalte]: `useTabsContext` must be used within a `Tabs` component");
        return t;
    }
    function LO(t) {
        const [e, n] = he(), r = xw(), [s, i] = Ze(t, [
            "ref",
            "id",
            "value",
            "forceMount"
        ]), [o, a] = he(0), c = ()=>s.id ?? r.generateContentId(s.value), l = ()=>r.listState().selectedKey() === s.value, { present: u } = e1({
            show: ()=>s.forceMount || l(),
            element: ()=>e() ?? null
        });
        return ot(Gi([
            ()=>e(),
            ()=>u()
        ], ([d, f])=>{
            if (d == null || !f) return;
            const p = ()=>{
                const b = uj(d, {
                    tabbable: !0
                });
                a(b.nextNode() ? void 0 : 0);
            };
            p();
            const h = new MutationObserver(p);
            h.observe(d, {
                subtree: !0,
                childList: !0,
                attributes: !0,
                attributeFilter: [
                    "tabindex",
                    "disabled"
                ]
            }), At(()=>{
                h.disconnect();
            });
        })), ot(Gi([
            ()=>s.value,
            c
        ], ([d, f])=>{
            r.contentIdsMap().set(d, f);
        })), M(ge, {
            get when () {
                return u();
            },
            get children () {
                return M(yn, Le({
                    as: "div",
                    ref (d) {
                        var f = ir(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 zO(t) {
        const e = xw(), [n, r] = Ze(t, [
            "style"
        ]), [s, i] = he({
            width: void 0,
            height: void 0
        }), { direction: o } = Xc(), 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);
        };
        $a(()=>{
            queueMicrotask(()=>{
                a();
            });
        }), ot(Gi([
            e.selectedTab,
            e.orientation,
            o
        ], ()=>{
            a();
        }, {
            defer: !0
        }));
        const [c, l] = he(!1);
        let u = null, d = null;
        return nut(e.selectedTab, (f, p)=>{
            if (d !== p) {
                d = p;
                return;
            }
            l(!0), u && clearTimeout(u), u = setTimeout(()=>{
                u = null, l(!1);
            }, 1), a();
        }), M(yn, Le({
            as: "div",
            role: "presentation",
            get style () {
                return Pg(s(), n.style);
            },
            get "data-orientation" () {
                return e.orientation();
            },
            get "data-resizing" () {
                return c();
            }
        }, r));
    }
    function UO(t) {
        let e;
        const n = xw(), [r, s] = Ze(t, [
            "ref",
            "onKeyDown",
            "onMouseDown",
            "onFocusIn",
            "onFocusOut"
        ]), { direction: i } = Xc(), o = new Blt(()=>n.listState().collection(), i, n.orientation), a = pne({
            selectionManager: ()=>n.listState().selectionManager(),
            keyboardDelegate: ()=>o,
            selectOnFocus: ()=>n.activationMode() === "automatic",
            shouldFocusWrap: !1,
            disallowEmptySelection: !0
        }, ()=>e);
        return ot(()=>{
            if (e == null) return;
            const c = e.querySelector(`[data-key="${n.listState().selectedKey()}"]`);
            c != null && n.setSelectedTab(c);
        }), M(yn, Le({
            as: "div",
            ref (c) {
                var l = ir((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 sut(t) {
        const [e, n] = _p({
            value: ()=>ke(t.selectedKey),
            defaultValue: ()=>ke(t.defaultSelectedKey),
            onChange: (l)=>t.onSelectionChange?.(l)
        }), r = _t(()=>{
            const l = e();
            return l != null ? [
                l
            ] : [];
        }), [, s] = Ze(t, [
            "onSelectionChange"
        ]), i = Le(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 } = e9(i), c = _t(()=>{
            const l = e();
            return l != null ? o().getItem(l) : void 0;
        });
        return {
            collection: o,
            selectionManager: a,
            selectedKey: e,
            setSelectedKey: n,
            selectedItem: c
        };
    }
    function HO(t) {
        const e = `tabs-${ai()}`, n = zt({
            id: e,
            orientation: "horizontal",
            activationMode: "automatic"
        }, t), [r, s] = Ze(n, [
            "value",
            "defaultValue",
            "onChange",
            "orientation",
            "activationMode",
            "disabled"
        ]), [i, o] = he([]), [a, c] = he(), { DomCollectionProvider: l } = wne({
            items: i,
            onItemsChange: o
        }), u = sut({
            selectedKey: ()=>r.value,
            defaultSelectedKey: ()=>r.defaultValue,
            onSelectionChange: (b)=>r.onChange?.(String(b)),
            dataSource: i
        });
        let d = u.selectedKey();
        ot(Gi([
            ()=>u.selectionManager(),
            ()=>u.collection(),
            ()=>u.selectedKey()
        ], ([b, y, _])=>{
            let v = _;
            if (b.isEmpty() || v == null || !y.getItem(v)) {
                v = y.getFirstKey();
                let w = v != null ? y.getItem(v) : void 0;
                for(; w?.disabled && w.key !== y.getLastKey();)v = y.getKeyAfter(w.key), w = v != null ? y.getItem(v) : void 0;
                w?.disabled && v === y.getLastKey() && (v = y.getFirstKey()), v != null && b.setSelectedKeys([
                    v
                ]);
            }
            (b.focusedKey() == null || !b.isFocused() && v !== d) && b.setFocusedKey(v), d = v;
        }));
        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: (b)=>`${s.id}-trigger-${b}`,
            generateContentId: (b)=>`${s.id}-content-${b}`
        };
        return M(l, {
            get children () {
                return M(xne.Provider, {
                    value: h,
                    get children () {
                        return M(yn, Le({
                            as: "div",
                            get "data-orientation" () {
                                return h.orientation();
                            }
                        }, s));
                    }
                });
            }
        });
    }
    function jO(t) {
        let e;
        const n = xw(), r = zt({
            type: "button"
        }, t), [s, i] = Ze(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);
        _ne({
            getItem: ()=>({
                    ref: ()=>e,
                    type: "item",
                    key: s.value,
                    textValue: "",
                    disabled: c()
                })
        });
        const u = Q5({
            key: ()=>s.value,
            selectionManager: ()=>n.listState().selectionManager(),
            disabled: c
        }, ()=>e), d = (f)=>{
            oj() && Lr(f.currentTarget);
        };
        return ot(Gi([
            ()=>s.value,
            o
        ], ([f, p])=>{
            n.triggerIdsMap().set(f, p);
        })), M(yn, Le({
            as: "button",
            ref (f) {
                var p = ir((h)=>e = h, s.ref);
                typeof p == "function" && p(f);
            },
            get id () {
                return o();
            },
            role: "tab",
            get tabIndex () {
                return it(()=>!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 it(()=>!!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 iut = Object.assign(HO, {
        Content: LO,
        Indicator: zO,
        List: UO,
        Trigger: jO
    });
    const out = HO, aut = (t)=>{
        const [e, n] = Ze(t, [
            "class"
        ]);
        return M(UO, Le({
            get class () {
                return vn("relative inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground", e.class);
            }
        }, n));
    }, $7 = (t)=>{
        const [e, n] = Ze(t, [
            "class",
            "label"
        ]), r = e.label;
        return M(jO, Le({
            get class () {
                return vn("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));
    }, X7 = (t)=>{
        const [e, n] = Ze(t, [
            "class"
        ]);
        return M(LO, Le({
            get class () {
                return vn("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));
    }, cut = {
        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"
    }, lut = (t)=>{
        const [e, n] = Ze(t, [
            "class",
            "variant"
        ]), r = ()=>e.variant ?? "line";
        return M(zO, Le({
            get class () {
                return vn(cut[r()], e.class);
            }
        }, n));
    }, uut = [
        "top",
        "right",
        "bottom",
        "left"
    ], Wd = Math.min, co = Math.max, bv = Math.round, A_ = Math.floor, Oc = (t)=>({
            x: t,
            y: t
        }), dut = {
        left: "right",
        right: "left",
        bottom: "top",
        top: "bottom"
    };
    function YT(t, e, n) {
        return co(t, Wd(e, n));
    }
    function xp(t, e) {
        return typeof t == "function" ? t(e) : t;
    }
    function $d(t) {
        return t.split("-")[0];
    }
    function wb(t) {
        return t.split("-")[1];
    }
    function vne(t) {
        return t === "x" ? "y" : "x";
    }
    function qO(t) {
        return t === "y" ? "height" : "width";
    }
    function Bl(t) {
        const e = t[0];
        return e === "t" || e === "b" ? "y" : "x";
    }
    function KO(t) {
        return vne(Bl(t));
    }
    function fut(t, e, n) {
        n === void 0 && (n = !1);
        const r = wb(t), s = KO(t), i = qO(s);
        let o = s === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
        return e.reference[i] > e.floating[i] && (o = mv(o)), [
            o,
            mv(o)
        ];
    }
    function hut(t) {
        const e = mv(t);
        return [
            QT(t),
            e,
            QT(e)
        ];
    }
    function QT(t) {
        return t.includes("start") ? t.replace("start", "end") : t.replace("end", "start");
    }
    const EU = [
        "left",
        "right"
    ], CU = [
        "right",
        "left"
    ], put = [
        "top",
        "bottom"
    ], gut = [
        "bottom",
        "top"
    ];
    function but(t, e, n) {
        switch(t){
            case "top":
            case "bottom":
                return n ? e ? CU : EU : e ? EU : CU;
            case "left":
            case "right":
                return e ? put : gut;
            default:
                return [];
        }
    }
    function mut(t, e, n, r) {
        const s = wb(t);
        let i = but($d(t), n === "start", r);
        return s && (i = i.map((o)=>o + "-" + s), e && (i = i.concat(i.map(QT)))), i;
    }
    function mv(t) {
        const e = $d(t);
        return dut[e] + t.slice(e.length);
    }
    function yut(t) {
        return {
            top: 0,
            right: 0,
            bottom: 0,
            left: 0,
            ...t
        };
    }
    function Sne(t) {
        return typeof t != "number" ? yut(t) : {
            top: t,
            right: t,
            bottom: t,
            left: t
        };
    }
    function yv(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 IU(t, e, n) {
        let { reference: r, floating: s } = t;
        const i = Bl(e), o = KO(e), a = qO(o), c = $d(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(wb(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 wut(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 } = xp(e, t), h = Sne(p), y = a[f ? d === "floating" ? "reference" : "floating" : d], _ = yv(await i.getClippingRect({
            element: (n = await (i.isElement == null ? void 0 : i.isElement(y))) == null || n ? y : y.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(a.floating)),
            boundary: l,
            rootBoundary: u,
            strategy: c
        })), v = d === "floating" ? {
            x: r,
            y: s,
            width: o.floating.width,
            height: o.floating.height
        } : o.reference, w = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(a.floating)), E = await (i.isElement == null ? void 0 : i.isElement(w)) ? await (i.getScale == null ? void 0 : i.getScale(w)) || {
            x: 1,
            y: 1
        } : {
            x: 1,
            y: 1
        }, I = yv(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
            elements: a,
            rect: v,
            offsetParent: w,
            strategy: c
        }) : v);
        return {
            top: (_.top - I.top + h.top) / E.y,
            bottom: (I.bottom - _.bottom + h.bottom) / E.y,
            left: (_.left - I.left + h.left) / E.x,
            right: (I.right - _.right + h.right) / E.x
        };
    }
    const _ut = 50, xut = async (t, e, n)=>{
        const { placement: r = "bottom", strategy: s = "absolute", middleware: i = [], platform: o } = n, a = o.detectOverflow ? o : {
            ...o,
            detectOverflow: wut
        }, 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 } = IU(l, r, c), f = r, p = 0;
        const h = {};
        for(let b = 0; b < i.length; b++){
            const y = i[b];
            if (!y) continue;
            const { name: _, fn: v } = y, { x: w, y: E, data: I, reset: D } = await v({
                x: u,
                y: d,
                initialPlacement: r,
                placement: f,
                strategy: s,
                middlewareData: h,
                rects: l,
                platform: a,
                elements: {
                    reference: t,
                    floating: e
                }
            });
            u = w ?? u, d = E ?? d, h[_] = {
                ...h[_],
                ...I
            }, D && p < _ut && (p++, typeof D == "object" && (D.placement && (f = D.placement), D.rects && (l = D.rects === !0 ? await o.getElementRects({
                reference: t,
                floating: e,
                strategy: s
            }) : D.rects), { x: u, y: d } = IU(l, f, c)), b = -1);
        }
        return {
            x: u,
            y: d,
            placement: f,
            strategy: s,
            middlewareData: h
        };
    }, vut = (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 } = xp(t, e) || {};
                if (l == null) return {};
                const d = Sne(u), f = {
                    x: n,
                    y: r
                }, p = KO(s), h = qO(p), b = await o.getDimensions(l), y = p === "y", _ = y ? "top" : "left", v = y ? "bottom" : "right", w = y ? "clientHeight" : "clientWidth", E = i.reference[h] + i.reference[p] - f[p] - i.floating[h], I = f[p] - i.reference[p], D = await (o.getOffsetParent == null ? void 0 : o.getOffsetParent(l));
                let U = D ? D[w] : 0;
                (!U || !await (o.isElement == null ? void 0 : o.isElement(D))) && (U = a.floating[w] || i.floating[h]);
                const K = E / 2 - I / 2, $ = U / 2 - b[h] / 2 - 1, ne = Wd(d[_], $), te = Wd(d[v], $), J = ne, C = U - b[h] - te, g = U / 2 - b[h] / 2 + K, x = YT(J, g, C), A = !c.arrow && wb(s) != null && g !== x && i.reference[h] / 2 - (g < J ? ne : te) - b[h] / 2 < 0, R = A ? g < J ? g - J : g - C : 0;
                return {
                    [p]: f[p] + R,
                    data: {
                        [p]: x,
                        centerOffset: g - x - R,
                        ...A && {
                            alignmentOffset: R
                        }
                    },
                    reset: A
                };
            }
        }), Sut = 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: b = !0, ...y } = xp(t, e);
                if ((n = i.arrow) != null && n.alignmentOffset) return {};
                const _ = $d(s), v = Bl(a), w = $d(a) === a, E = await (c.isRTL == null ? void 0 : c.isRTL(l.floating)), I = f || (w || !b ? [
                    mv(a)
                ] : hut(a)), D = h !== "none";
                !f && D && I.push(...mut(a, b, h, E));
                const U = [
                    a,
                    ...I
                ], K = await c.detectOverflow(e, y), $ = [];
                let ne = ((r = i.flip) == null ? void 0 : r.overflows) || [];
                if (u && $.push(K[_]), d) {
                    const g = fut(s, o, E);
                    $.push(K[g[0]], K[g[1]]);
                }
                if (ne = [
                    ...ne,
                    {
                        placement: s,
                        overflows: $
                    }
                ], !$.every((g)=>g <= 0)) {
                    var te, J;
                    const g = (((te = i.flip) == null ? void 0 : te.index) || 0) + 1, x = U[g];
                    if (x && (!(d === "alignment" ? v !== Bl(x) : !1) || ne.every((N)=>Bl(N.placement) === v ? N.overflows[0] > 0 : !0))) return {
                        data: {
                            index: g,
                            overflows: ne
                        },
                        reset: {
                            placement: x
                        }
                    };
                    let A = (J = ne.filter((R)=>R.overflows[0] <= 0).sort((R, N)=>R.overflows[1] - N.overflows[1])[0]) == null ? void 0 : J.placement;
                    if (!A) switch(p){
                        case "bestFit":
                            {
                                var C;
                                const R = (C = ne.filter((N)=>{
                                    if (D) {
                                        const L = Bl(N.placement);
                                        return L === v || 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 : C[0];
                                R && (A = R);
                                break;
                            }
                        case "initialPlacement":
                            A = a;
                            break;
                    }
                    if (s !== A) return {
                        reset: {
                            placement: A
                        }
                    };
                }
                return {};
            }
        };
    };
    function AU(t, e) {
        return {
            top: t.top - e.height,
            right: t.right - e.width,
            bottom: t.bottom - e.height,
            left: t.left - e.width
        };
    }
    function PU(t) {
        return uut.some((e)=>t[e] >= 0);
    }
    const kut = function(t) {
        return t === void 0 && (t = {}), {
            name: "hide",
            options: t,
            async fn (e) {
                const { rects: n, platform: r } = e, { strategy: s = "referenceHidden", ...i } = xp(t, e);
                switch(s){
                    case "referenceHidden":
                        {
                            const o = await r.detectOverflow(e, {
                                ...i,
                                elementContext: "reference"
                            }), a = AU(o, n.reference);
                            return {
                                data: {
                                    referenceHiddenOffsets: a,
                                    referenceHidden: PU(a)
                                }
                            };
                        }
                    case "escaped":
                        {
                            const o = await r.detectOverflow(e, {
                                ...i,
                                altBoundary: !0
                            }), a = AU(o, n.floating);
                            return {
                                data: {
                                    escapedOffsets: a,
                                    escaped: PU(a)
                                }
                            };
                        }
                    default:
                        return {};
                }
            }
        };
    }, Tut = new Set([
        "left",
        "top"
    ]);
    async function Eut(t, e) {
        const { placement: n, platform: r, elements: s } = t, i = await (r.isRTL == null ? void 0 : r.isRTL(s.floating)), o = $d(n), a = wb(n), c = Bl(n) === "y", l = Tut.has(o) ? -1 : 1, u = i && c ? -1 : 1, d = xp(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 Cut = 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 Eut(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
                    }
                };
            }
        };
    }, Iut = 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: (_)=>{
                        let { x: v, y: w } = _;
                        return {
                            x: v,
                            y: w
                        };
                    }
                }, ...l } = xp(t, e), u = {
                    x: n,
                    y: r
                }, d = await i.detectOverflow(e, l), f = Bl($d(s)), p = vne(f);
                let h = u[p], b = u[f];
                if (o) {
                    const _ = p === "y" ? "top" : "left", v = p === "y" ? "bottom" : "right", w = h + d[_], E = h - d[v];
                    h = YT(w, h, E);
                }
                if (a) {
                    const _ = f === "y" ? "top" : "left", v = f === "y" ? "bottom" : "right", w = b + d[_], E = b - d[v];
                    b = YT(w, b, E);
                }
                const y = c.fn({
                    ...e,
                    [p]: h,
                    [f]: b
                });
                return {
                    ...y,
                    data: {
                        x: y.x - n,
                        y: y.y - r,
                        enabled: {
                            [p]: o,
                            [f]: a
                        }
                    }
                };
            }
        };
    }, Aut = 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 } = xp(t, e), u = await o.detectOverflow(e, l), d = $d(s), f = wb(s), p = Bl(s) === "y", { width: h, height: b } = i.floating;
                let y, _;
                d === "top" || d === "bottom" ? (y = d, _ = f === (await (o.isRTL == null ? void 0 : o.isRTL(a.floating)) ? "start" : "end") ? "left" : "right") : (_ = d, y = f === "end" ? "top" : "bottom");
                const v = b - u.top - u.bottom, w = h - u.left - u.right, E = Wd(b - u[y], v), I = Wd(h - u[_], w), D = !e.middlewareData.shift;
                let U = E, K = I;
                if ((n = e.middlewareData.shift) != null && n.enabled.x && (K = w), (r = e.middlewareData.shift) != null && r.enabled.y && (U = v), D && !f) {
                    const ne = co(u.left, 0), te = co(u.right, 0), J = co(u.top, 0), C = co(u.bottom, 0);
                    p ? K = h - 2 * (ne !== 0 || te !== 0 ? ne + te : co(u.left, u.right)) : U = b - 2 * (J !== 0 || C !== 0 ? J + C : co(u.top, u.bottom));
                }
                await c({
                    ...e,
                    availableWidth: K,
                    availableHeight: U
                });
                const $ = await o.getDimensions(a.floating);
                return h !== $.width || b !== $.height ? {
                    reset: {
                        rects: !0
                    }
                } : {};
            }
        };
    };
    function t9() {
        return typeof window < "u";
    }
    function _b(t) {
        return kne(t) ? (t.nodeName || "").toLowerCase() : "#document";
    }
    function So(t) {
        var e;
        return (t == null || (e = t.ownerDocument) == null ? void 0 : e.defaultView) || window;
    }
    function Gc(t) {
        var e;
        return (e = (kne(t) ? t.ownerDocument : t.document) || window.document) == null ? void 0 : e.documentElement;
    }
    function kne(t) {
        return t9() ? t instanceof Node || t instanceof So(t).Node : !1;
    }
    function qa(t) {
        return t9() ? t instanceof Element || t instanceof So(t).Element : !1;
    }
    function xu(t) {
        return t9() ? t instanceof HTMLElement || t instanceof So(t).HTMLElement : !1;
    }
    function OU(t) {
        return !t9() || typeof ShadowRoot > "u" ? !1 : t instanceof ShadowRoot || t instanceof So(t).ShadowRoot;
    }
    function vw(t) {
        const { overflow: e, overflowX: n, overflowY: r, display: s } = Ka(t);
        return /auto|scroll|overlay|hidden|clip/.test(e + r + n) && s !== "inline" && s !== "contents";
    }
    function Put(t) {
        return /^(table|td|th)$/.test(_b(t));
    }
    function n9(t) {
        try {
            if (t.matches(":popover-open")) return !0;
        } catch  {}
        try {
            return t.matches(":modal");
        } catch  {
            return !1;
        }
    }
    const Out = /transform|translate|scale|rotate|perspective|filter/, Mut = /paint|layout|strict|content/, Ef = (t)=>!!t && t !== "none";
    let G7;
    function WO(t) {
        const e = qa(t) ? Ka(t) : t;
        return Ef(e.transform) || Ef(e.translate) || Ef(e.scale) || Ef(e.rotate) || Ef(e.perspective) || !$O() && (Ef(e.backdropFilter) || Ef(e.filter)) || Out.test(e.willChange || "") || Mut.test(e.contain || "");
    }
    function Rut(t) {
        let e = Xd(t);
        for(; xu(e) && !kg(e);){
            if (WO(e)) return e;
            if (n9(e)) return null;
            e = Xd(e);
        }
        return null;
    }
    function $O() {
        return G7 == null && (G7 = typeof CSS < "u" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none")), G7;
    }
    function kg(t) {
        return /^(html|body|#document)$/.test(_b(t));
    }
    function Ka(t) {
        return So(t).getComputedStyle(t);
    }
    function r9(t) {
        return qa(t) ? {
            scrollLeft: t.scrollLeft,
            scrollTop: t.scrollTop
        } : {
            scrollLeft: t.scrollX,
            scrollTop: t.scrollY
        };
    }
    function Xd(t) {
        if (_b(t) === "html") return t;
        const e = t.assignedSlot || t.parentNode || OU(t) && t.host || Gc(t);
        return OU(e) ? e.host : e;
    }
    function Tne(t) {
        const e = Xd(t);
        return kg(e) ? t.ownerDocument ? t.ownerDocument.body : t.body : xu(e) && vw(e) ? e : Tne(e);
    }
    function n1(t, e, n) {
        var r;
        e === void 0 && (e = []), n === void 0 && (n = !0);
        const s = Tne(t), i = s === ((r = t.ownerDocument) == null ? void 0 : r.body), o = So(s);
        if (i) {
            const a = eE(o);
            return e.concat(o, o.visualViewport || [], vw(s) ? s : [], a && n ? n1(a) : []);
        } else return e.concat(s, n1(s, [], n));
    }
    function eE(t) {
        return t.parent && Object.getPrototypeOf(t.parent) ? t.frameElement : null;
    }
    function Ene(t) {
        const e = Ka(t);
        let n = parseFloat(e.width) || 0, r = parseFloat(e.height) || 0;
        const s = xu(t), i = s ? t.offsetWidth : n, o = s ? t.offsetHeight : r, a = bv(n) !== i || bv(r) !== o;
        return a && (n = i, r = o), {
            width: n,
            height: r,
            $: a
        };
    }
    function XO(t) {
        return qa(t) ? t : t.contextElement;
    }
    function b0(t) {
        const e = XO(t);
        if (!xu(e)) return Oc(1);
        const n = e.getBoundingClientRect(), { width: r, height: s, $: i } = Ene(e);
        let o = (i ? bv(n.width) : n.width) / r, a = (i ? bv(n.height) : n.height) / s;
        return (!o || !Number.isFinite(o)) && (o = 1), (!a || !Number.isFinite(a)) && (a = 1), {
            x: o,
            y: a
        };
    }
    const Nut = Oc(0);
    function Cne(t) {
        const e = So(t);
        return !$O() || !e.visualViewport ? Nut : {
            x: e.visualViewport.offsetLeft,
            y: e.visualViewport.offsetTop
        };
    }
    function Vut(t, e, n) {
        return e === void 0 && (e = !1), !n || e && n !== So(t) ? !1 : e;
    }
    function Xh(t, e, n, r) {
        e === void 0 && (e = !1), n === void 0 && (n = !1);
        const s = t.getBoundingClientRect(), i = XO(t);
        let o = Oc(1);
        e && (r ? qa(r) && (o = b0(r)) : o = b0(t));
        const a = Vut(i, n, r) ? Cne(i) : Oc(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 = So(i), p = r && qa(r) ? So(r) : r;
            let h = f, b = eE(h);
            for(; b && r && p !== h;){
                const y = b0(b), _ = b.getBoundingClientRect(), v = Ka(b), w = _.left + (b.clientLeft + parseFloat(v.paddingLeft)) * y.x, E = _.top + (b.clientTop + parseFloat(v.paddingTop)) * y.y;
                c *= y.x, l *= y.y, u *= y.x, d *= y.y, c += w, l += E, h = So(b), b = eE(h);
            }
        }
        return yv({
            width: u,
            height: d,
            x: c,
            y: l
        });
    }
    function s9(t, e) {
        const n = r9(t).scrollLeft;
        return e ? e.left + n : Xh(Gc(t)).left + n;
    }
    function Ine(t, e) {
        const n = t.getBoundingClientRect(), r = n.left + e.scrollLeft - s9(t, n), s = n.top + e.scrollTop;
        return {
            x: r,
            y: s
        };
    }
    function But(t) {
        let { elements: e, rect: n, offsetParent: r, strategy: s } = t;
        const i = s === "fixed", o = Gc(r), a = e ? n9(e.floating) : !1;
        if (r === o || a && i) return n;
        let c = {
            scrollLeft: 0,
            scrollTop: 0
        }, l = Oc(1);
        const u = Oc(0), d = xu(r);
        if ((d || !d && !i) && ((_b(r) !== "body" || vw(o)) && (c = r9(r)), d)) {
            const p = Xh(r);
            l = b0(r), u.x = p.x + r.clientLeft, u.y = p.y + r.clientTop;
        }
        const f = o && !d && !i ? Ine(o, c) : Oc(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 Dut(t) {
        return Array.from(t.getClientRects());
    }
    function Fut(t) {
        const e = Gc(t), n = r9(t), r = t.ownerDocument.body, s = co(e.scrollWidth, e.clientWidth, r.scrollWidth, r.clientWidth), i = co(e.scrollHeight, e.clientHeight, r.scrollHeight, r.clientHeight);
        let o = -n.scrollLeft + s9(t);
        const a = -n.scrollTop;
        return Ka(r).direction === "rtl" && (o += co(e.clientWidth, r.clientWidth) - s), {
            width: s,
            height: i,
            x: o,
            y: a
        };
    }
    const MU = 25;
    function Lut(t, e) {
        const n = So(t), r = Gc(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 = $O();
            (!u || u && e === "fixed") && (a = s.offsetLeft, c = s.offsetTop);
        }
        const l = s9(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 <= MU && (i -= h);
        } else l <= MU && (i += l);
        return {
            width: i,
            height: o,
            x: a,
            y: c
        };
    }
    function zut(t, e) {
        const n = Xh(t, !0, e === "fixed"), r = n.top + t.clientTop, s = n.left + t.clientLeft, i = xu(t) ? b0(t) : Oc(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 RU(t, e, n) {
        let r;
        if (e === "viewport") r = Lut(t, n);
        else if (e === "document") r = Fut(Gc(t));
        else if (qa(e)) r = zut(e, n);
        else {
            const s = Cne(t);
            r = {
                x: e.x - s.x,
                y: e.y - s.y,
                width: e.width,
                height: e.height
            };
        }
        return yv(r);
    }
    function Ane(t, e) {
        const n = Xd(t);
        return n === e || !qa(n) || kg(n) ? !1 : Ka(n).position === "fixed" || Ane(n, e);
    }
    function Uut(t, e) {
        const n = e.get(t);
        if (n) return n;
        let r = n1(t, [], !1).filter((a)=>qa(a) && _b(a) !== "body"), s = null;
        const i = Ka(t).position === "fixed";
        let o = i ? Xd(t) : t;
        for(; qa(o) && !kg(o);){
            const a = Ka(o), c = WO(o);
            !c && a.position === "fixed" && (s = null), (i ? !c && !s : !c && a.position === "static" && !!s && (s.position === "absolute" || s.position === "fixed") || vw(o) && !c && Ane(t, o)) ? r = r.filter((u)=>u !== o) : s = a, o = Xd(o);
        }
        return e.set(t, r), r;
    }
    function Hut(t) {
        let { element: e, boundary: n, rootBoundary: r, strategy: s } = t;
        const o = [
            ...n === "clippingAncestors" ? n9(e) ? [] : Uut(e, this._c) : [].concat(n),
            r
        ], a = RU(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 = RU(e, o[f], s);
            c = co(p.top, c), l = Wd(p.right, l), u = Wd(p.bottom, u), d = co(p.left, d);
        }
        return {
            width: l - d,
            height: u - c,
            x: d,
            y: c
        };
    }
    function jut(t) {
        const { width: e, height: n } = Ene(t);
        return {
            width: e,
            height: n
        };
    }
    function qut(t, e, n) {
        const r = xu(e), s = Gc(e), i = n === "fixed", o = Xh(t, !0, i, e);
        let a = {
            scrollLeft: 0,
            scrollTop: 0
        };
        const c = Oc(0);
        function l() {
            c.x = s9(s);
        }
        if (r || !r && !i) if ((_b(e) !== "body" || vw(s)) && (a = r9(e)), r) {
            const p = Xh(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 ? Ine(s, a) : Oc(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 Z7(t) {
        return Ka(t).position === "static";
    }
    function NU(t, e) {
        if (!xu(t) || Ka(t).position === "fixed") return null;
        if (e) return e(t);
        let n = t.offsetParent;
        return Gc(t) === n && (n = n.ownerDocument.body), n;
    }
    function Pne(t, e) {
        const n = So(t);
        if (n9(t)) return n;
        if (!xu(t)) {
            let s = Xd(t);
            for(; s && !kg(s);){
                if (qa(s) && !Z7(s)) return s;
                s = Xd(s);
            }
            return n;
        }
        let r = NU(t, e);
        for(; r && Put(r) && Z7(r);)r = NU(r, e);
        return r && kg(r) && Z7(r) && !WO(r) ? n : r || Rut(t) || n;
    }
    const Kut = async function(t) {
        const e = this.getOffsetParent || Pne, n = this.getDimensions, r = await n(t.floating);
        return {
            reference: qut(t.reference, await e(t.floating), t.strategy),
            floating: {
                x: 0,
                y: 0,
                width: r.width,
                height: r.height
            }
        };
    };
    function Wut(t) {
        return Ka(t).direction === "rtl";
    }
    const One = {
        convertOffsetParentRelativeRectToViewportRelativeRect: But,
        getDocumentElement: Gc,
        getClippingRect: Hut,
        getOffsetParent: Pne,
        getElementRects: Kut,
        getClientRects: Dut,
        getDimensions: jut,
        getScale: b0,
        isElement: qa,
        isRTL: Wut
    };
    function Mne(t, e) {
        return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
    }
    function $ut(t, e) {
        let n = null, r;
        const s = Gc(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 = A_(d), b = A_(s.clientWidth - (u + f)), y = A_(s.clientHeight - (d + p)), _ = A_(u), w = {
                rootMargin: -h + "px " + -b + "px " + -y + "px " + -_ + "px",
                threshold: co(0, Wd(1, c)) || 1
            };
            let E = !0;
            function I(D) {
                const U = D[0].intersectionRatio;
                if (U !== c) {
                    if (!E) return o();
                    U ? o(!1, U) : r = setTimeout(()=>{
                        o(!1, 1e-7);
                    }, 1e3);
                }
                U === 1 && !Mne(l, t.getBoundingClientRect()) && o(), E = !1;
            }
            try {
                n = new IntersectionObserver(I, {
                    ...w,
                    root: s.ownerDocument
                });
            } catch  {
                n = new IntersectionObserver(I, w);
            }
            n.observe(t);
        }
        return o(!0), i;
    }
    function Xut(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 = XO(t), u = s || i ? [
            ...l ? n1(l) : [],
            ...e ? n1(e) : []
        ] : [];
        u.forEach((_)=>{
            s && _.addEventListener("scroll", n, {
                passive: !0
            }), i && _.addEventListener("resize", n);
        });
        const d = l && a ? $ut(l, n) : null;
        let f = -1, p = null;
        o && (p = new ResizeObserver((_)=>{
            let [v] = _;
            v && v.target === l && p && e && (p.unobserve(e), cancelAnimationFrame(f), f = requestAnimationFrame(()=>{
                var w;
                (w = p) == null || w.observe(e);
            })), n();
        }), l && !c && p.observe(l), e && p.observe(e));
        let h, b = c ? Xh(t) : null;
        c && y();
        function y() {
            const _ = Xh(t);
            b && !Mne(b, _) && n(), b = _, h = requestAnimationFrame(y);
        }
        return n(), ()=>{
            var _;
            u.forEach((v)=>{
                s && v.removeEventListener("scroll", n), i && v.removeEventListener("resize", n);
            }), d?.(), (_ = p) == null || _.disconnect(), p = null, c && cancelAnimationFrame(h);
        };
    }
    const Gut = Cut, Zut = Iut, Jut = Sut, Yut = Aut, Qut = kut, edt = vut, tdt = (t, e, n)=>{
        const r = new Map, s = {
            platform: One,
            ...n
        }, i = {
            ...s.platform,
            _c: r
        };
        return xut(t, e, {
            ...s,
            platform: i
        });
    };
    var ndt = se('<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>'), GO = us();
    function ZO() {
        const t = ds(GO);
        if (t === void 0) throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");
        return t;
    }
    var tE = 30, VU = tE / 2, rdt = {
        top: 180,
        right: -90,
        bottom: 0,
        left: 90
    };
    function Sw(t) {
        const e = ZO(), n = zt({
            size: tE
        }, t), [r, s] = Ze(n, [
            "ref",
            "style",
            "size"
        ]), i = ()=>e.currentPlacement().split("-")[0], o = sdt(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 * (tE / r.size), d = ()=>`rotate(${rdt[i()]} ${VU} ${VU}) translate(0 2)`;
        return M(yn, Le({
            as: "div",
            ref (f) {
                var p = ir(e.setArrowRef, r.ref);
                typeof p == "function" && p(f);
            },
            "aria-hidden": "true",
            get style () {
                return Pg({
                    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 = ndt(), p = f.firstChild, h = p.firstChild;
                return h.nextSibling, mt(()=>Qt(p, "transform", d())), f;
            }
        }));
    }
    function sdt(t) {
        const [e, n] = he();
        return ot(()=>{
            const r = t();
            r && n(Vie(r).getComputedStyle(r));
        }), e;
    }
    function idt(t) {
        const e = ZO(), [n, r] = Ze(t, [
            "ref",
            "style"
        ]);
        return M(yn, Le({
            as: "div",
            ref (s) {
                var i = ir(e.setPositionerRef, n.ref);
                typeof i == "function" && i(s);
            },
            "data-popper-positioner": "",
            get style () {
                return Pg({
                    position: "absolute",
                    top: 0,
                    left: 0,
                    "min-width": "max-content"
                }, n.style);
            }
        }, r));
    }
    function BU(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 odt(t, e) {
        return {
            contextElement: t,
            getBoundingClientRect: ()=>{
                const r = e(t);
                return r ? BU(r) : t ? t.getBoundingClientRect() : BU();
            }
        };
    }
    function adt(t) {
        return /^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(t);
    }
    var cdt = {
        top: "bottom",
        right: "left",
        bottom: "top",
        left: "right"
    };
    function ldt(t, e) {
        const [n, r] = t.split("-"), s = cdt[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 udt(t) {
        const e = zt({
            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] = he(), [s, i] = he(), [o, a] = he(e.placement), c = ()=>odt(e.anchorRef?.(), e.getAnchorRect), { direction: l } = Xc();
        async function u() {
            const f = c(), p = n(), h = s();
            if (!f || !p) return;
            const b = (h?.clientHeight || 0) / 2, y = typeof e.gutter == "number" ? e.gutter + b : e.gutter ?? b;
            p.style.setProperty("--kb-popper-content-overflow-padding", `${e.overflowPadding}px`), f.getBoundingClientRect();
            const _ = [
                Gut(({ placement: D })=>{
                    const U = !!D.split("-")[1];
                    return {
                        mainAxis: y,
                        crossAxis: U ? void 0 : e.shift,
                        alignmentAxis: e.shift
                    };
                })
            ];
            if (e.flip !== !1) {
                const D = typeof e.flip == "string" ? e.flip.split(" ") : void 0;
                if (D !== void 0 && !D.every(adt)) throw new Error("`flip` expects a spaced-delimited list of placements");
                _.push(Jut({
                    padding: e.overflowPadding,
                    fallbackPlacements: D
                }));
            }
            (e.slide || e.overlap) && _.push(Zut({
                mainAxis: e.slide,
                crossAxis: e.overlap,
                padding: e.overflowPadding
            })), _.push(Yut({
                padding: e.overflowPadding,
                apply ({ availableWidth: D, availableHeight: U, rects: K }) {
                    const $ = Math.round(K.reference.width);
                    D = Math.floor(D), U = Math.floor(U), p.style.setProperty("--kb-popper-anchor-width", `${$}px`), p.style.setProperty("--kb-popper-content-available-width", `${D}px`), p.style.setProperty("--kb-popper-content-available-height", `${U}px`), e.sameWidth && (p.style.width = `${$}px`), e.fitViewport && (p.style.maxWidth = `${D}px`, p.style.maxHeight = `${U}px`);
                }
            })), e.hideWhenDetached && _.push(Qut({
                padding: e.detachedPadding
            })), h && _.push(edt({
                element: h,
                padding: e.arrowPadding
            }));
            const v = await tdt(f, p, {
                placement: e.placement,
                strategy: "absolute",
                middleware: _,
                platform: {
                    ...One,
                    isRTL: ()=>l() === "rtl"
                }
            });
            if (a(v.placement), e.onCurrentPlacementChange?.(v.placement), !p) return;
            p.style.setProperty("--kb-popper-content-transform-origin", ldt(v.placement, l()));
            const w = Math.round(v.x), E = Math.round(v.y);
            let I;
            if (e.hideWhenDetached && (I = v.middlewareData.hide?.referenceHidden ? "hidden" : "visible"), Object.assign(p.style, {
                top: "0",
                left: "0",
                transform: `translate3d(${w}px, ${E}px, 0)`,
                visibility: I
            }), h && v.middlewareData.arrow) {
                const { x: D, y: U } = v.middlewareData.arrow, K = v.placement.split("-")[0];
                Object.assign(h.style, {
                    left: D != null ? `${D}px` : "",
                    top: U != null ? `${U}px` : "",
                    [K]: "100%"
                });
            }
        }
        ot(()=>{
            const f = c(), p = n();
            if (!f || !p) return;
            const h = Xut(f, p, u, {
                elementResize: typeof ResizeObserver == "function"
            });
            At(h);
        }), ot(()=>{
            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 M(GO.Provider, {
            value: d,
            get children () {
                return e.children;
            }
        });
    }
    var i9 = Object.assign(udt, {
        Arrow: Sw,
        Context: GO,
        usePopperContext: ZO,
        Positioner: idt
    }), Rne = 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 Nne(t, e, n) {
        const r = lne({
            usage: "search",
            sensitivity: "base"
        }), s = _t(()=>{
            const i = ke(t.keyboardDelegate);
            return i || new Rne(t.collection, e, r);
        });
        return pne({
            selectionManager: ()=>ke(t.selectionManager),
            keyboardDelegate: s,
            autoFocus: ()=>ke(t.autoFocus),
            deferAutoFocus: ()=>ke(t.deferAutoFocus),
            shouldFocusWrap: ()=>ke(t.shouldFocusWrap),
            disallowEmptySelection: ()=>ke(t.disallowEmptySelection),
            selectOnFocus: ()=>ke(t.selectOnFocus),
            disallowTypeAhead: ()=>ke(t.disallowTypeAhead),
            shouldUseVirtualFocus: ()=>ke(t.shouldUseVirtualFocus),
            allowsTabNavigation: ()=>ke(t.allowsTabNavigation),
            isVirtualized: ()=>ke(t.isVirtualized),
            scrollToKey: (i)=>ke(t.scrollToKey)?.(i),
            orientation: ()=>ke(t.orientation)
        }, e, n);
    }
    var wv = "data-kb-top-layer", Vne, nE = !1, lu = [];
    function r1(t) {
        return lu.findIndex((e)=>e.node === t);
    }
    function ddt(t) {
        return lu[r1(t)];
    }
    function fdt(t) {
        return lu[lu.length - 1].node === t;
    }
    function Bne() {
        return lu.filter((t)=>t.isPointerBlocking);
    }
    function hdt() {
        return [
            ...Bne()
        ].slice(-1)[0];
    }
    function JO() {
        return Bne().length > 0;
    }
    function Dne(t) {
        const e = r1(hdt()?.node);
        return r1(t) < e;
    }
    function pdt(t) {
        lu.push(t);
    }
    function gdt(t) {
        const e = r1(t);
        e < 0 || lu.splice(e, 1);
    }
    function bdt() {
        for (const { node: t } of lu)t.style.pointerEvents = Dne(t) ? "none" : "auto";
    }
    function mdt(t) {
        if (JO() && !nE) {
            const e = Mc(t);
            Vne = document.body.style.pointerEvents, e.body.style.pointerEvents = "none", nE = !0;
        }
    }
    function ydt(t) {
        if (JO()) return;
        const e = Mc(t);
        e.body.style.pointerEvents = Vne, e.body.style.length === 0 && e.body.removeAttribute("style"), nE = !1;
    }
    var no = {
        layers: lu,
        isTopMostLayer: fdt,
        hasPointerBlockingLayer: JO,
        isBelowPointerBlockingLayer: Dne,
        addLayer: pdt,
        removeLayer: gdt,
        indexOf: r1,
        find: ddt,
        assignPointerEventToLayers: bdt,
        disableBodyPointerEvents: mdt,
        restoreBodyPointerEvents: ydt
    }, J7 = "focusScope.autoFocusOnMount", Y7 = "focusScope.autoFocusOnUnmount", DU = {
        bubbles: !1,
        cancelable: !0
    }, FU = {
        stack: [],
        active () {
            return this.stack[0];
        },
        add (t) {
            t !== this.active() && this.active()?.pause(), this.stack = C6(this.stack, t), this.stack.unshift(t);
        },
        remove (t) {
            this.stack = C6(this.stack, t), this.active()?.resume();
        }
    };
    function YO(t, e) {
        const [n, r] = he(!1), s = {
            pause () {
                r(!0);
            },
            resume () {
                r(!1);
            }
        };
        let i = null;
        const o = (h)=>t.onMountAutoFocus?.(h), a = (h)=>t.onUnmountAutoFocus?.(h), c = ()=>Mc(e()), l = ()=>{
            const h = c().createElement("span");
            return h.setAttribute("data-focus-trap", ""), h.tabIndex = 0, Object.assign(h.style, dj), h;
        }, u = ()=>{
            const h = e();
            return h ? cj(h, !0).filter((b)=>!b.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 b = om(h);
            return !b || po(h, b) ? !1 : lj(b);
        };
        ot(()=>{
            const h = e();
            if (!h) return;
            FU.add(s);
            const b = om(h);
            if (!po(h, b)) {
                const _ = new CustomEvent(J7, DU);
                h.addEventListener(J7, o), h.dispatchEvent(_), _.defaultPrevented || setTimeout(()=>{
                    Lr(d()), om(h) === b && Lr(h);
                }, 0);
            }
            At(()=>{
                h.removeEventListener(J7, o), setTimeout(()=>{
                    const _ = new CustomEvent(Y7, DU);
                    p() && _.preventDefault(), h.addEventListener(Y7, a), h.dispatchEvent(_), _.defaultPrevented || Lr(b ?? c().body), h.removeEventListener(Y7, a), FU.remove(s);
                }, 0);
            });
        }), ot(()=>{
            const h = e();
            if (!h || !ke(t.trapFocus) || n()) return;
            const b = (_)=>{
                const v = _.target;
                v?.closest(`[${wv}]`) || (po(h, v) ? i = v : Lr(i));
            }, y = (_)=>{
                const w = _.relatedTarget ?? om(h);
                w?.closest(`[${wv}]`) || po(h, w) || Lr(i);
            };
            c().addEventListener("focusin", b), c().addEventListener("focusout", y), At(()=>{
                c().removeEventListener("focusin", b), c().removeEventListener("focusout", y);
            });
        }), ot(()=>{
            const h = e();
            if (!h || !ke(t.trapFocus) || n()) return;
            const b = l();
            h.insertAdjacentElement("afterbegin", b);
            const y = l();
            h.insertAdjacentElement("beforeend", y);
            function _(w) {
                const E = d(), I = f();
                w.relatedTarget === E ? Lr(I) : Lr(E);
            }
            b.addEventListener("focusin", _), y.addEventListener("focusin", _);
            const v = new MutationObserver((w)=>{
                for (const E of w)E.previousSibling === y && (y.remove(), h.insertAdjacentElement("beforeend", y)), E.nextSibling === b && (b.remove(), h.insertAdjacentElement("afterbegin", b));
            });
            v.observe(h, {
                childList: !0,
                subtree: !1
            }), At(()=>{
                b.removeEventListener("focusin", _), y.removeEventListener("focusin", _), b.remove(), y.remove(), v.disconnect();
            });
        });
    }
    var wdt = "data-live-announcer";
    function QO(t) {
        ot(()=>{
            ke(t.isDisabled) || At(_dt(ke(t.targets), ke(t.root)));
        });
    }
    var rm = new WeakMap, Do = [];
    function _dt(t, e = document.body) {
        const n = new Set(t), r = new Set, s = (c)=>{
            for (const f of c.querySelectorAll(`[${wdt}], [${wv}]`))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 = rm.get(c) ?? 0;
            c.getAttribute("aria-hidden") === "true" && l === 0 || (l === 0 && c.setAttribute("aria-hidden", "true"), r.add(c), rm.set(c, l + 1));
        };
        Do.length && Do[Do.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 Do.push(a), ()=>{
            o.disconnect();
            for (const c of r){
                const l = rm.get(c);
                if (l == null) return;
                l === 1 ? (c.removeAttribute("aria-hidden"), rm.delete(c)) : rm.set(c, l - 1);
            }
            a === Do[Do.length - 1] ? (Do.pop(), Do.length && Do[Do.length - 1].observe()) : Do.splice(Do.indexOf(a), 1);
        };
    }
    var LU = "interactOutside.pointerDownOutside", zU = "interactOutside.focusOutside";
    function xdt(t, e) {
        let n, r = Jie;
        const s = ()=>Mc(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(`[${wv}]`) || !po(s(), f) || po(e(), f) ? !1 : !t.shouldExcludeElement?.(f);
        }, l = (d)=>{
            function f() {
                const p = e(), h = d.target;
                if (!p || !h || !c(d)) return;
                const b = Yt([
                    i,
                    a
                ]);
                h.addEventListener(LU, b, {
                    once: !0
                });
                const y = new CustomEvent(LU, {
                    bubbles: !1,
                    cancelable: !0,
                    detail: {
                        originalEvent: d,
                        isContextMenu: d.button === 2 || Uie(d) && d.button === 0
                    }
                });
                h.dispatchEvent(y);
            }
            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(zU, h, {
                once: !0
            });
            const b = new CustomEvent(zU, {
                bubbles: !1,
                cancelable: !0,
                detail: {
                    originalEvent: d,
                    isContextMenu: !1
                }
            });
            p.dispatchEvent(b);
        };
        ot(()=>{
            ke(t.isDisabled) || (n = window.setTimeout(()=>{
                s().addEventListener("pointerdown", l, !0);
            }, 0), s().addEventListener("focusin", u, !0), At(()=>{
                window.clearTimeout(n), s().removeEventListener("click", r), s().removeEventListener("pointerdown", l, !0), s().removeEventListener("focusin", u, !0);
            }));
        });
    }
    function vdt(t) {
        const e = (n)=>{
            n.key === sj.Escape && t.onEscapeKeyDown?.(n);
        };
        ot(()=>{
            if (ke(t.isDisabled)) return;
            const n = t.ownerDocument?.() ?? Mc();
            n.addEventListener("keydown", e), At(()=>{
                n.removeEventListener("keydown", e);
            });
        });
    }
    var Fne = us();
    function Sdt() {
        return ds(Fne);
    }
    function eM(t) {
        let e;
        const n = Sdt(), [r, s] = Ze(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?.();
            };
        };
        xdt({
            shouldExcludeElement: (d)=>e ? r.excludedElements?.some((f)=>po(f(), d)) || [
                    ...i
                ].some((f)=>po(f, d)) : !1,
            onPointerDownOutside: (d)=>{
                !e || no.isBelowPointerBlockingLayer(e) || !r.bypassTopMostLayerCheck && !no.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), vdt({
            ownerDocument: ()=>Mc(e),
            onEscapeKeyDown: (d)=>{
                !e || !no.isTopMostLayer(e) || (r.onEscapeKeyDown?.(d), !d.defaultPrevented && r.onDismiss && (d.preventDefault(), r.onDismiss()));
            }
        }), $a(()=>{
            if (!e) return;
            no.addLayer({
                node: e,
                isPointerBlocking: r.disableOutsidePointerEvents,
                dismiss: r.onDismiss
            });
            const d = n?.registerNestedLayer(e);
            no.assignPointerEventToLayers(), no.disableBodyPointerEvents(e), At(()=>{
                e && (no.removeLayer(e), d?.(), no.assignPointerEventToLayers(), no.restoreBodyPointerEvents(e));
            });
        }), ot(Gi([
            ()=>e,
            ()=>r.disableOutsidePointerEvents
        ], ([d, f])=>{
            if (!d) return;
            const p = no.find(d);
            p && p.isPointerBlocking !== f && (p.isPointerBlocking = f, no.assignPointerEventToLayers()), f && no.disableBodyPointerEvents(d), At(()=>{
                no.restoreBodyPointerEvents(d);
            });
        }, {
            defer: !0
        }));
        const u = {
            registerNestedLayer: o
        };
        return M(Fne.Provider, {
            value: u,
            get children () {
                return M(yn, Le({
                    as: "div",
                    ref (d) {
                        var f = ir((p)=>e = p, r.ref);
                        typeof f == "function" && f(d);
                    }
                }, s));
            }
        });
    }
    function o9(t = {}) {
        const [e, n] = Gte({
            value: ()=>ke(t.open),
            defaultValue: ()=>!!ke(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 kdt(t = {}) {
        const [e, n] = Gte({
            value: ()=>ke(t.isSelected),
            defaultValue: ()=>!!ke(t.defaultIsSelected),
            onChange: (i)=>t.onSelectedChange?.(i)
        });
        return {
            isSelected: e,
            setIsSelected: (i)=>{
                !ke(t.isReadOnly) && !ke(t.isDisabled) && n(i);
            },
            toggle: ()=>{
                !ke(t.isReadOnly) && !ke(t.isDisabled) && n(!e());
            }
        };
    }
    var rE = (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;
    }, P_ = new Map, Tdt = (t)=>{
        ot(()=>{
            const e = Ys(t.style) ?? {}, n = Ys(t.properties) ?? [], r = {};
            for(const i in e)r[i] = t.element.style[i];
            const s = P_.get(t.key);
            s ? s.activeCount++ : P_.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);
            At(()=>{
                const i = P_.get(t.key);
                if (i) {
                    if (i.activeCount !== 1) {
                        i.activeCount--;
                        return;
                    }
                    P_.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?.();
                }
            });
        });
    }, UU = Tdt, Edt = (t, e)=>{
        switch(e){
            case "x":
                return [
                    t.clientWidth,
                    t.scrollLeft,
                    t.scrollWidth
                ];
            case "y":
                return [
                    t.clientHeight,
                    t.scrollTop,
                    t.scrollHeight
                ];
        }
    }, Cdt = (t, e)=>{
        const n = getComputedStyle(t), r = e === "x" ? n.overflowX : n.overflowY;
        return r === "auto" || r === "scroll" || t.tagName === "HTML" && r === "visible";
    }, Idt = (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] = Edt(s, e), d = u - c - r * l;
            (l !== 0 || d !== 0) && Cdt(s, e) && (i += d, o += l), s === (n ?? document.documentElement) ? a = !0 : s = s._$host ?? s.parentElement;
        }while (s && !a);
        return [
            i,
            o
        ];
    }, [HU, jU] = he([]), Adt = (t)=>HU().indexOf(t) === HU().length - 1, Pdt = (t)=>{
        const e = Le({
            element: null,
            enabled: !0,
            hideScrollbar: !0,
            preventScrollbarShift: !0,
            preventScrollbarShiftMode: "padding",
            restoreScrollPosition: !0,
            allowPinchZoom: !1
        }, t), n = ai();
        let r = [
            0,
            0
        ], s = null, i = null;
        ot(()=>{
            Ys(e.enabled) && (jU((l)=>[
                    ...l,
                    n
                ]), At(()=>{
                jU((l)=>l.filter((u)=>u !== n));
            }));
        }), ot(()=>{
            if (!Ys(e.enabled) || !Ys(e.hideScrollbar)) return;
            const { body: l } = document, u = window.innerWidth - l.offsetWidth;
            if (Ys(e.preventScrollbarShift)) {
                const d = {
                    overflow: "hidden"
                }, f = [];
                u > 0 && (Ys(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;
                UU({
                    key: "prevent-scroll",
                    element: l,
                    style: d,
                    properties: f,
                    cleanup: ()=>{
                        Ys(e.restoreScrollPosition) && u > 0 && window.scrollTo(h, p);
                    }
                });
            } else UU({
                key: "prevent-scroll",
                element: l,
                style: {
                    overflow: "hidden"
                }
            });
        }), ot(()=>{
            !Adt(n) || !Ys(e.enabled) || (document.addEventListener("wheel", a, {
                passive: !1
            }), document.addEventListener("touchstart", o, {
                passive: !1
            }), document.addEventListener("touchmove", c, {
                passive: !1
            }), At(()=>{
                document.removeEventListener("wheel", a), document.removeEventListener("touchstart", o), document.removeEventListener("touchmove", c);
            }));
        });
        const o = (l)=>{
            r = qU(l), s = null, i = null;
        }, a = (l)=>{
            const u = l.target, d = Ys(e.element), f = Odt(l), p = Math.abs(f[0]) > Math.abs(f[1]) ? "x" : "y", h = p === "x" ? f[0] : f[1], b = KU(u, p, h, d);
            let y;
            d && rE(d, u) ? y = !b : y = !0, y && l.cancelable && l.preventDefault();
        }, c = (l)=>{
            const u = Ys(e.element), d = l.target;
            let f;
            if (l.touches.length === 2) f = !Ys(e.allowPinchZoom);
            else {
                if (s == null || i === null) {
                    const p = qU(l).map((b, y)=>r[y] - b), 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 = KU(d, s, i, u);
                    u && rE(u, d) ? f = !p : f = !0;
                }
            }
            f && l.cancelable && l.preventDefault();
        };
    }, Odt = (t)=>[
            t.deltaX,
            t.deltaY
        ], qU = (t)=>t.changedTouches[0] ? [
            t.changedTouches[0].clientX,
            t.changedTouches[0].clientY
        ] : [
            0,
            0
        ], KU = (t, e, n, r)=>{
        const s = r !== null && rE(r, t), [i, o] = Idt(t, e, s ? r : void 0);
        return !(n > 0 && Math.abs(i) <= 1 || n < 0 && Math.abs(o) < 1);
    }, Mdt = Pdt, tM = Mdt, Rdt = us();
    function a9() {
        return ds(Rdt);
    }
    var Ndt = us();
    function Lne() {
        return ds(Ndt);
    }
    var zne = us();
    function Une() {
        return ds(zne);
    }
    function vu() {
        const t = Une();
        if (t === void 0) throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");
        return t;
    }
    var Hne = us();
    function nM() {
        const t = ds(Hne);
        if (t === void 0) throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");
        return t;
    }
    var jne = us();
    function Zc() {
        const t = ds(jne);
        if (t === void 0) throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");
        return t;
    }
    function rM(t) {
        let e;
        const n = Zc(), r = vu(), s = zt({
            id: n.generateId(`item-${ai()}`)
        }, t), [i, o] = Ze(s, [
            "ref",
            "textValue",
            "disabled",
            "closeOnSelect",
            "checked",
            "indeterminate",
            "onSelect",
            "onPointerMove",
            "onPointerLeave",
            "onPointerDown",
            "onPointerUp",
            "onClick",
            "onKeyDown",
            "onMouseDown",
            "onFocus"
        ]), [a, c] = he(), [l, u] = he(), [d, f] = he(), p = ()=>r.listState().selectionManager(), h = ()=>o.id, b = ()=>p().focusedKey() === h(), y = ()=>{
            i.onSelect?.(), i.closeOnSelect && setTimeout(()=>{
                r.close(!0);
            });
        };
        _ne({
            getItem: ()=>({
                    ref: ()=>e,
                    type: "item",
                    key: h(),
                    textValue: i.textValue ?? d()?.textContent ?? e?.textContent ?? "",
                    disabled: i.disabled ?? !1
                })
        });
        const _ = Q5({
            key: h,
            selectionManager: p,
            shouldSelectOnPressUp: !0,
            allowsDifferentPressOrigin: !0,
            disabled: ()=>i.disabled
        }, ()=>e), v = ($)=>{
            Fn($, i.onPointerMove), $.pointerType === "mouse" && (i.disabled ? r.onItemLeave($) : (r.onItemEnter($), $.defaultPrevented || (Lr($.currentTarget), r.listState().selectionManager().setFocused(!0), r.listState().selectionManager().setFocusedKey(h()))));
        }, w = ($)=>{
            Fn($, i.onPointerLeave), $.pointerType === "mouse" && r.onItemLeave($);
        }, E = ($)=>{
            Fn($, i.onPointerUp), !i.disabled && $.button === 0 && y();
        }, I = ($)=>{
            if (Fn($, i.onKeyDown), !$.repeat && !i.disabled) switch($.key){
                case "Enter":
                case " ":
                    y();
                    break;
            }
        }, D = _t(()=>{
            if (i.indeterminate) return "mixed";
            if (i.checked != null) return i.checked;
        }), U = _t(()=>({
                "data-indeterminate": i.indeterminate ? "" : void 0,
                "data-checked": i.checked && !i.indeterminate ? "" : void 0,
                "data-disabled": i.disabled ? "" : void 0,
                "data-highlighted": b() ? "" : void 0
            })), K = {
            isChecked: ()=>i.checked,
            dataset: U,
            setLabelRef: f,
            generateId: du(()=>o.id),
            registerLabel: Ks(c),
            registerDescription: Ks(u)
        };
        return M(Hne.Provider, {
            value: K,
            get children () {
                return M(yn, Le({
                    as: "div",
                    ref ($) {
                        var ne = ir((te)=>e = te, i.ref);
                        typeof ne == "function" && ne($);
                    },
                    get tabIndex () {
                        return _.tabIndex();
                    },
                    get "aria-checked" () {
                        return D();
                    },
                    get "aria-disabled" () {
                        return i.disabled;
                    },
                    get "aria-labelledby" () {
                        return a();
                    },
                    get "aria-describedby" () {
                        return l();
                    },
                    get "data-key" () {
                        return _.dataKey();
                    },
                    get onPointerDown () {
                        return Yt([
                            i.onPointerDown,
                            _.onPointerDown
                        ]);
                    },
                    get onPointerUp () {
                        return Yt([
                            E,
                            _.onPointerUp
                        ]);
                    },
                    get onClick () {
                        return Yt([
                            i.onClick,
                            _.onClick
                        ]);
                    },
                    get onKeyDown () {
                        return Yt([
                            I,
                            _.onKeyDown
                        ]);
                    },
                    get onMouseDown () {
                        return Yt([
                            i.onMouseDown,
                            _.onMouseDown
                        ]);
                    },
                    get onFocus () {
                        return Yt([
                            i.onFocus,
                            _.onFocus
                        ]);
                    },
                    onPointerMove: v,
                    onPointerLeave: w
                }, U, o));
            }
        });
    }
    function qne(t) {
        const e = zt({
            closeOnSelect: !1
        }, t), [n, r] = Ze(e, [
            "checked",
            "defaultChecked",
            "onChange",
            "onSelect"
        ]), s = kdt({
            isSelected: ()=>n.checked,
            defaultIsSelected: ()=>n.defaultChecked,
            onSelectedChange: (o)=>n.onChange?.(o),
            isDisabled: ()=>r.disabled
        });
        return M(rM, Le({
            role: "menuitemcheckbox",
            get checked () {
                return s.isSelected();
            },
            onSelect: ()=>{
                n.onSelect?.(), s.toggle();
            }
        }, r));
    }
    var s1 = {
        next: (t, e)=>t === "ltr" ? e === "horizontal" ? "ArrowRight" : "ArrowDown" : e === "horizontal" ? "ArrowLeft" : "ArrowUp",
        previous: (t, e)=>s1.next(t === "ltr" ? "rtl" : "ltr", e)
    }, WU = {
        first: (t)=>t === "horizontal" ? "ArrowDown" : "ArrowRight",
        last: (t)=>t === "horizontal" ? "ArrowUp" : "ArrowLeft"
    };
    function sM(t) {
        const e = Zc(), n = vu(), r = a9(), { direction: s } = Xc(), i = zt({
            id: e.generateId("trigger")
        }, t), [o, a] = Ze(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 = Cv(()=>n.triggerRef(), ()=>"button"), u = _t(()=>l() === "a" && n.triggerRef()?.getAttribute("href") != null);
        ot(Gi(()=>r?.value(), (_)=>{
            u() && _ === 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 = (_)=>{
            Fn(_, o.onPointerDown), _.currentTarget.dataset.pointerType = _.pointerType, !o.disabled && _.pointerType !== "touch" && _.button === 0 && d();
        }, p = (_)=>{
            Fn(_, o.onClick), o.disabled || _.currentTarget.dataset.pointerType === "touch" && d();
        }, h = (_)=>{
            if (Fn(_, o.onKeyDown), !o.disabled) {
                if (u()) switch(_.key){
                    case "Enter":
                    case " ":
                        return;
                }
                switch(_.key){
                    case "Enter":
                    case " ":
                    case WU.first(e.orientation()):
                        _.stopPropagation(), _.preventDefault(), Qie(_.currentTarget), n.open("first"), r?.setAutoFocusMenu(!0), r?.setValue(c);
                        break;
                    case WU.last(e.orientation()):
                        _.stopPropagation(), _.preventDefault(), n.open("last");
                        break;
                    case s1.next(s(), e.orientation()):
                        if (r === void 0) break;
                        _.stopPropagation(), _.preventDefault(), r.nextMenu();
                        break;
                    case s1.previous(s(), e.orientation()):
                        if (r === void 0) break;
                        _.stopPropagation(), _.preventDefault(), r.previousMenu();
                        break;
                }
            }
        }, b = (_)=>{
            Fn(_, o.onMouseOver), n.triggerRef()?.dataset.pointerType !== "touch" && !o.disabled && r !== void 0 && r.value() !== void 0 && r.setValue(c);
        }, y = (_)=>{
            Fn(_, o.onFocus), r !== void 0 && _.currentTarget.dataset.pointerType !== "touch" && r.setValue(c);
        };
        return ot(()=>At(n.registerTriggerId(o.id))), M(zc, Le({
            ref (_) {
                var v = ir(n.setTriggerRef, o.ref);
                typeof v == "function" && 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 it(()=>!!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: b,
            onClick: p,
            onKeyDown: h,
            onFocus: y,
            role: r !== void 0 ? "menuitem" : void 0
        }, ()=>n.dataset(), a));
    }
    function Kne(t) {
        let e;
        const n = Zc(), r = vu(), s = a9(), i = Lne(), { direction: o } = Xc(), a = zt({
            id: n.generateId(`content-${ai()}`)
        }, t), [c, l] = Ze(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 = Nne({
            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);
        YO({
            trapFocus: ()=>d() && r.isOpen(),
            onMountAutoFocus: (w)=>{
                s === void 0 && c.onOpenAutoFocus?.(w);
            },
            onUnmountAutoFocus: c.onCloseAutoFocus
        }, ()=>e);
        const p = (w)=>{
            if (po(w.currentTarget, w.target) && (w.key === "Tab" && r.isOpen() && w.preventDefault(), s !== void 0 && w.currentTarget.getAttribute("aria-haspopup") !== "true")) switch(w.key){
                case s1.next(o(), n.orientation()):
                    w.stopPropagation(), w.preventDefault(), r.close(!0), s.setAutoFocusMenu(!0), s.nextMenu();
                    break;
                case s1.previous(o(), n.orientation()):
                    if (w.currentTarget.hasAttribute("data-closed")) break;
                    w.stopPropagation(), w.preventDefault(), r.close(!0), s.setAutoFocusMenu(!0), s.previousMenu();
                    break;
            }
        }, h = (w)=>{
            c.onEscapeKeyDown?.(w), s?.setAutoFocusMenu(!1), r.close(!0);
        }, b = (w)=>{
            c.onFocusOutside?.(w), n.isModal() && w.preventDefault();
        }, y = (w)=>{
            Fn(w, c.onPointerEnter), r.isOpen() && (r.parentMenuContext()?.listState().selectionManager().setFocused(!1), r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0));
        }, _ = (w)=>{
            if (Fn(w, c.onPointerMove), w.pointerType !== "mouse") return;
            const E = w.target, I = u !== w.clientX;
            po(w.currentTarget, E) && I && (r.setPointerDir(w.clientX > u ? "right" : "left"), u = w.clientX);
        };
        ot(()=>At(r.registerContentId(c.id))), At(()=>r.setContentRef(void 0));
        const v = {
            ref: ir((w)=>{
                r.setContentRef(w), e = w;
            }, 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: y,
            onPointerMove: _,
            get "data-orientation" () {
                return n.orientation();
            }
        };
        return M(ge, {
            get when () {
                return r.contentPresent();
            },
            get children () {
                return M(ge, {
                    get when () {
                        return i === void 0 || r.parentMenuContext() != null;
                    },
                    get fallback () {
                        return M(yn, Le({
                            as: "div"
                        }, ()=>r.dataset(), v, l));
                    },
                    get children () {
                        return M(i9.Positioner, {
                            get children () {
                                return M(eM, Le({
                                    get disableOutsidePointerEvents () {
                                        return it(()=>!!d())() && r.isOpen();
                                    },
                                    get excludedElements () {
                                        return [
                                            r.triggerRef
                                        ];
                                    },
                                    bypassTopMostLayerCheck: !0,
                                    get style () {
                                        return Pg({
                                            "--kb-menu-content-transform-origin": "var(--kb-popper-content-transform-origin)",
                                            position: "relative"
                                        }, c.style);
                                    },
                                    onEscapeKeyDown: h,
                                    onFocusOutside: b,
                                    get onDismiss () {
                                        return r.close;
                                    }
                                }, ()=>r.dataset(), v, l));
                            }
                        });
                    }
                });
            }
        });
    }
    function Vdt(t) {
        let e;
        const n = Zc(), r = vu(), [s, i] = Ze(t, [
            "ref"
        ]);
        return tM({
            element: ()=>e ?? null,
            enabled: ()=>r.contentPresent() && n.preventScroll()
        }), M(Kne, Le({
            ref (o) {
                var a = ir((c)=>{
                    e = c;
                }, s.ref);
                typeof a == "function" && a(o);
            }
        }, i));
    }
    var Wne = us();
    function Bdt() {
        const t = ds(Wne);
        if (t === void 0) throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");
        return t;
    }
    function iM(t) {
        const e = Zc(), n = zt({
            id: e.generateId(`group-${ai()}`)
        }, t), [r, s] = he(), i = {
            generateId: du(()=>n.id),
            registerLabelId: Ks(s)
        };
        return M(Wne.Provider, {
            value: i,
            get children () {
                return M(yn, Le({
                    as: "div",
                    role: "group",
                    get "aria-labelledby" () {
                        return r();
                    }
                }, n));
            }
        });
    }
    function $ne(t) {
        const e = Bdt(), n = zt({
            id: e.generateId("label")
        }, t), [r, s] = Ze(n, [
            "id"
        ]);
        return ot(()=>At(e.registerLabelId(r.id))), M(yn, Le({
            as: "span",
            get id () {
                return r.id;
            },
            "aria-hidden": "true"
        }, s));
    }
    function Xne(t) {
        const e = vu(), n = zt({
            children: "▼"
        }, t);
        return M(yn, Le({
            as: "span",
            "aria-hidden": "true"
        }, ()=>e.dataset(), n));
    }
    function oM(t) {
        return M(rM, Le({
            role: "menuitem",
            closeOnSelect: !0
        }, t));
    }
    function Gne(t) {
        const e = nM(), n = zt({
            id: e.generateId("description")
        }, t), [r, s] = Ze(n, [
            "id"
        ]);
        return ot(()=>At(e.registerDescription(r.id))), M(yn, Le({
            as: "div",
            get id () {
                return r.id;
            }
        }, ()=>e.dataset(), s));
    }
    function Zne(t) {
        const e = nM(), n = zt({
            id: e.generateId("indicator")
        }, t), [r, s] = Ze(n, [
            "forceMount"
        ]);
        return M(ge, {
            get when () {
                return r.forceMount || e.isChecked();
            },
            get children () {
                return M(yn, Le({
                    as: "div"
                }, ()=>e.dataset(), s));
            }
        });
    }
    function Jne(t) {
        const e = nM(), n = zt({
            id: e.generateId("label")
        }, t), [r, s] = Ze(n, [
            "ref",
            "id"
        ]);
        return ot(()=>At(e.registerLabel(r.id))), M(yn, Le({
            as: "div",
            ref (i) {
                var o = ir(e.setLabelRef, r.ref);
                typeof o == "function" && o(i);
            },
            get id () {
                return r.id;
            }
        }, ()=>e.dataset(), s));
    }
    function aM(t) {
        const e = vu();
        return M(ge, {
            get when () {
                return e.contentPresent();
            },
            get children () {
                return M(dE, t);
            }
        });
    }
    var Yne = us();
    function Ddt() {
        const t = ds(Yne);
        if (t === void 0) throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");
        return t;
    }
    function Qne(t) {
        const n = Zc().generateId(`radiogroup-${ai()}`), r = zt({
            id: n
        }, t), [s, i] = Ze(r, [
            "value",
            "defaultValue",
            "onChange",
            "disabled"
        ]), [o, a] = _p({
            value: ()=>s.value,
            defaultValue: ()=>s.defaultValue,
            onChange: (l)=>s.onChange?.(l)
        }), c = {
            isDisabled: ()=>s.disabled,
            isSelectedValue: (l)=>l === o(),
            setSelectedValue: (l)=>a(l)
        };
        return M(Yne.Provider, {
            value: c,
            get children () {
                return M(iM, i);
            }
        });
    }
    function ere(t) {
        const e = Ddt(), n = zt({
            closeOnSelect: !1
        }, t), [r, s] = Ze(n, [
            "value",
            "onSelect"
        ]);
        return M(rM, Le({
            role: "menuitemradio",
            get checked () {
                return e.isSelectedValue(r.value);
            },
            onSelect: ()=>{
                r.onSelect?.(), e.setSelectedValue(r.value);
            }
        }, s));
    }
    function Fdt(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 Ldt(t, e) {
        return e ? Yie([
            t.clientX,
            t.clientY
        ], e) : !1;
    }
    function tre(t) {
        const e = Zc(), n = bne(), r = Une(), s = a9(), i = Lne(), o = zt({
            placement: e.orientation() === "horizontal" ? "bottom-start" : "right-start"
        }, t), [a, c] = Ze(o, [
            "open",
            "defaultOpen",
            "onOpenChange"
        ]);
        let l = 0, u = null, d = "right";
        const [f, p] = he(), [h, b] = he(), [y, _] = he(), [v, w] = he(), [E, I] = he(!0), [D, U] = he(c.placement), [K, $] = he([]), [ne, te] = he([]), { DomCollectionProvider: J } = wne({
            items: ne,
            onItemsChange: te
        }), C = o9({
            open: ()=>a.open,
            defaultOpen: ()=>a.defaultOpen,
            onOpenChange: (Q)=>a.onOpenChange?.(Q)
        }), { present: g } = e1({
            show: ()=>e.forceMount() || C.isOpen(),
            element: ()=>v() ?? null
        }), x = e9({
            selectionMode: "none",
            dataSource: ne
        }), A = (Q)=>{
            I(Q), C.open();
        }, R = (Q = !1)=>{
            C.close(), Q && r && r.close(!0);
        }, N = (Q)=>{
            I(Q), C.toggle();
        }, L = ()=>{
            const Q = v();
            Q && (Lr(Q), x.selectionManager().setFocused(!0), x.selectionManager().setFocusedKey(void 0));
        }, z = ()=>{
            i != null ? setTimeout(()=>L()) : L();
        }, B = (Q)=>{
            $((ae)=>[
                    ...ae,
                    Q
                ]);
            const Y = r?.registerNestedMenu(Q);
            return ()=>{
                $((ae)=>C6(ae, Q)), Y?.();
            };
        }, S = (Q)=>d === u?.side && Ldt(Q, u?.area), O = (Q)=>{
            S(Q) && Q.preventDefault();
        }, W = (Q)=>{
            S(Q) || z();
        }, F = (Q)=>{
            S(Q) && Q.preventDefault();
        };
        QO({
            isDisabled: ()=>!(r == null && C.isOpen() && e.isModal()),
            targets: ()=>[
                    v(),
                    ...K()
                ].filter(Boolean)
        }), ot(()=>{
            const Q = v();
            if (!Q || !r) return;
            const Y = r.registerNestedMenu(Q);
            At(()=>{
                Y();
            });
        }), ot(()=>{
            r === void 0 && s?.registerMenu(e.value(), [
                v(),
                ...K()
            ]);
        }), ot(()=>{
            r !== void 0 || s === void 0 || (s.value() === e.value() ? (y()?.focus(), s.autoFocusMenu() && A(!0)) : R());
        }), ot(()=>{
            r !== void 0 || s === void 0 || C.isOpen() && s.setValue(e.value());
        }), At(()=>{
            r === void 0 && s?.unregisterMenu(e.value());
        });
        const ee = {
            dataset: _t(()=>({
                    "data-expanded": C.isOpen() ? "" : void 0,
                    "data-closed": C.isOpen() ? void 0 : ""
                })),
            isOpen: C.isOpen,
            contentPresent: g,
            nestedMenus: K,
            currentPlacement: D,
            pointerGraceTimeoutId: ()=>l,
            autoFocus: E,
            listState: ()=>x,
            parentMenuContext: ()=>r,
            triggerRef: y,
            contentRef: v,
            triggerId: f,
            contentId: h,
            setTriggerRef: _,
            setContentRef: w,
            open: A,
            close: R,
            toggle: N,
            focusContent: z,
            onItemEnter: O,
            onItemLeave: W,
            onTriggerLeave: F,
            setPointerDir: (Q)=>d = Q,
            setPointerGraceTimeoutId: (Q)=>l = Q,
            setPointerGraceIntent: (Q)=>u = Q,
            registerNestedMenu: B,
            registerItemToParentDomCollection: n?.registerItem,
            registerTriggerId: Ks(p),
            registerContentId: Ks(b)
        };
        return M(J, {
            get children () {
                return M(zne.Provider, {
                    value: ee,
                    get children () {
                        return M(ge, {
                            when: i === void 0,
                            get fallback () {
                                return c.children;
                            },
                            get children () {
                                return M(i9, Le({
                                    anchorRef: y,
                                    contentRef: v,
                                    onCurrentPlacementChange: U
                                }, c));
                            }
                        });
                    }
                });
            }
        });
    }
    function nre(t) {
        const { direction: e } = Xc();
        return M(tre, Le({
            get placement () {
                return e() === "rtl" ? "left-start" : "right-start";
            },
            flip: !0
        }, t));
    }
    var zdt = {
        close: (t, e)=>t === "ltr" ? [
                e === "horizontal" ? "ArrowLeft" : "ArrowUp"
            ] : [
                e === "horizontal" ? "ArrowRight" : "ArrowDown"
            ]
    };
    function rre(t) {
        const e = vu(), n = Zc(), [r, s] = Ze(t, [
            "onFocusOutside",
            "onKeyDown"
        ]), { direction: i } = Xc();
        return M(Kne, Le({
            onOpenAutoFocus: (u)=>{
                u.preventDefault();
            },
            onCloseAutoFocus: (u)=>{
                u.preventDefault();
            },
            onFocusOutside: (u)=>{
                r.onFocusOutside?.(u);
                const d = u.target;
                po(e.triggerRef(), d) || e.close();
            },
            onKeyDown: (u)=>{
                Fn(u, r.onKeyDown);
                const d = po(u.currentTarget, u.target), f = zdt.close(i(), n.orientation()).includes(u.key), p = e.parentMenuContext() != null;
                d && f && p && (e.close(), Lr(e.triggerRef()));
            }
        }, s));
    }
    var $U = [
        "Enter",
        " "
    ], Udt = {
        open: (t, e)=>t === "ltr" ? [
                ...$U,
                e === "horizontal" ? "ArrowRight" : "ArrowDown"
            ] : [
                ...$U,
                e === "horizontal" ? "ArrowLeft" : "ArrowUp"
            ]
    };
    function sre(t) {
        let e;
        const n = Zc(), r = vu(), s = zt({
            id: n.generateId(`sub-trigger-${ai()}`)
        }, t), [i, o] = Ze(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 } = Xc(), u = ()=>i.id, d = ()=>{
            const w = r.parentMenuContext();
            if (w == null) throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");
            return w.listState().selectionManager();
        }, f = ()=>r.listState().collection(), p = ()=>d().focusedKey() === u(), h = Q5({
            key: u,
            selectionManager: d,
            shouldSelectOnPressUp: !0,
            allowsDifferentPressOrigin: !0,
            disabled: ()=>i.disabled
        }, ()=>e), b = (w)=>{
            Fn(w, i.onClick), !r.isOpen() && !i.disabled && r.open(!0);
        }, y = (w)=>{
            if (Fn(w, i.onPointerMove), w.pointerType !== "mouse") return;
            const E = r.parentMenuContext();
            if (E?.onItemEnter(w), !w.defaultPrevented) {
                if (i.disabled) {
                    E?.onItemLeave(w);
                    return;
                }
                !r.isOpen() && !a && (r.parentMenuContext()?.setPointerGraceIntent(null), a = window.setTimeout(()=>{
                    r.open(!1), c();
                }, 100)), E?.onItemEnter(w), w.defaultPrevented || (r.listState().selectionManager().isFocused() && (r.listState().selectionManager().setFocused(!1), r.listState().selectionManager().setFocusedKey(void 0)), Lr(w.currentTarget), E?.listState().selectionManager().setFocused(!0), E?.listState().selectionManager().setFocusedKey(u()));
            }
        }, _ = (w)=>{
            if (Fn(w, i.onPointerLeave), w.pointerType !== "mouse") return;
            c();
            const E = r.parentMenuContext(), I = r.contentRef();
            if (I) {
                E?.setPointerGraceIntent({
                    area: Fdt(r.currentPlacement(), w, I),
                    side: r.currentPlacement().split("-")[0]
                }), window.clearTimeout(E?.pointerGraceTimeoutId());
                const D = window.setTimeout(()=>{
                    E?.setPointerGraceIntent(null);
                }, 300);
                E?.setPointerGraceTimeoutId(D);
            } else {
                if (E?.onTriggerLeave(w), w.defaultPrevented) return;
                E?.setPointerGraceIntent(null);
            }
            E?.onItemLeave(w);
        }, v = (w)=>{
            Fn(w, i.onKeyDown), !w.repeat && (i.disabled || Udt.open(l(), n.orientation()).includes(w.key) && (w.stopPropagation(), w.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 ot(()=>{
            if (r.registerItemToParentDomCollection == null) throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");
            const w = r.registerItemToParentDomCollection({
                ref: ()=>e,
                type: "item",
                key: u(),
                textValue: i.textValue ?? e?.textContent ?? "",
                disabled: i.disabled ?? !1
            });
            At(w);
        }), ot(Gi(()=>r.parentMenuContext()?.pointerGraceTimeoutId(), (w)=>{
            At(()=>{
                window.clearTimeout(w), r.parentMenuContext()?.setPointerGraceIntent(null);
            });
        })), ot(()=>At(r.registerTriggerId(i.id))), At(()=>{
            c();
        }), M(yn, Le({
            as: "div",
            ref (w) {
                var E = ir((I)=>{
                    r.setTriggerRef(I), e = I;
                }, i.ref);
                typeof E == "function" && E(w);
            },
            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 it(()=>!!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([
                    b,
                    h.onClick
                ]);
            },
            get onKeyDown () {
                return Yt([
                    v,
                    h.onKeyDown
                ]);
            },
            get onMouseDown () {
                return Yt([
                    i.onMouseDown,
                    h.onMouseDown
                ]);
            },
            get onFocus () {
                return Yt([
                    i.onFocus,
                    h.onFocus
                ]);
            },
            onPointerMove: y,
            onPointerLeave: _
        }, ()=>r.dataset(), o));
    }
    function Hdt(t) {
        const e = a9(), n = `menu-${ai()}`, r = zt({
            id: n,
            modal: !0
        }, t), [s, i] = Ze(r, [
            "id",
            "modal",
            "preventScroll",
            "forceMount",
            "open",
            "defaultOpen",
            "onOpenChange",
            "value",
            "orientation"
        ]), o = o9({
            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: du(()=>s.id),
            value: ()=>s.value,
            orientation: ()=>s.orientation ?? e?.orientation() ?? "horizontal"
        };
        return M(jne.Provider, {
            value: a,
            get children () {
                return M(tre, Le({
                    get open () {
                        return o.isOpen();
                    },
                    get onOpenChange () {
                        return o.setIsOpen;
                    }
                }, i));
            }
        });
    }
    var jdt = {};
    fu(jdt, {
        Root: ()=>c9,
        Separator: ()=>qdt
    });
    function c9(t) {
        let e;
        const n = zt({
            orientation: "horizontal"
        }, t), [r, s] = Ze(n, [
            "ref",
            "orientation"
        ]), i = Cv(()=>e, ()=>"hr");
        return M(yn, Le({
            as: "hr",
            ref (o) {
                var a = ir((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 qdt = c9, Kdt = {};
    fu(Kdt, {
        Arrow: ()=>Sw,
        CheckboxItem: ()=>qne,
        Content: ()=>cM,
        DropdownMenu: ()=>Wdt,
        Group: ()=>iM,
        GroupLabel: ()=>$ne,
        Icon: ()=>Xne,
        Item: ()=>oM,
        ItemDescription: ()=>Gne,
        ItemIndicator: ()=>Zne,
        ItemLabel: ()=>Jne,
        Portal: ()=>aM,
        RadioGroup: ()=>Qne,
        RadioItem: ()=>ere,
        Root: ()=>lM,
        Separator: ()=>c9,
        Sub: ()=>nre,
        SubContent: ()=>rre,
        SubTrigger: ()=>sre,
        Trigger: ()=>sM
    });
    function cM(t) {
        const e = Zc(), n = vu(), [r, s] = Ze(t, [
            "onCloseAutoFocus",
            "onInteractOutside"
        ]);
        let i = !1;
        return M(Vdt, Le({
            onCloseAutoFocus: (c)=>{
                r.onCloseAutoFocus?.(c), i || Lr(n.triggerRef()), i = !1, c.preventDefault();
            },
            onInteractOutside: (c)=>{
                r.onInteractOutside?.(c), (!e.isModal() || c.detail.isContextMenu) && (i = !0);
            }
        }, s));
    }
    function lM(t) {
        const e = `dropdownmenu-${ai()}`, n = zt({
            id: e
        }, t);
        return M(Hdt, n);
    }
    var Wdt = Object.assign(lM, {
        Arrow: Sw,
        CheckboxItem: qne,
        Content: cM,
        Group: iM,
        GroupLabel: $ne,
        Icon: Xne,
        Item: oM,
        ItemDescription: Gne,
        ItemIndicator: Zne,
        ItemLabel: Jne,
        Portal: aM,
        RadioGroup: Qne,
        RadioItem: ere,
        Separator: c9,
        Sub: nre,
        SubContent: rre,
        SubTrigger: sre,
        Trigger: sM
    });
    const $dt = sM, Xdt = (t)=>M(lM, Le({
            gutter: 0
        }, t)), Gdt = (t)=>{
        const [, e] = Ze(t, [
            "class"
        ]);
        return M(aM, {
            get children () {
                return M(cM, Le({
                    get class () {
                        return vn("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));
            }
        });
    }, Up = (t)=>{
        const [, e] = Ze(t, [
            "class"
        ]);
        return M(oM, Le({
            get class () {
                return vn("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 Zdt = se("<button type=button role=switch><span aria-hidden=true>");
    const Gf = (t)=>{
        const [e, n] = Ze(t, [
            "checked",
            "onChange",
            "size",
            "class",
            "disabled"
        ]), r = ()=>e.size ?? "md";
        return (()=>{
            var s = Zdt(), i = s.firstChild;
            return s.$$click = ()=>{
                e.disabled || e.onChange?.(!e.checked);
            }, vv(s, Le({
                get "aria-checked" () {
                    return e.checked;
                },
                get disabled () {
                    return e.disabled;
                },
                get class () {
                    return vn("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), mt(()=>Mt(i, vn("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;
        })();
    };
    ci([
        "click"
    ]);
    var Jdt = se('<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">'), Ydt = se('<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">'), Qdt = se('<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>'), eft = se('<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>'), tft = se('<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>'), nft = se('<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">'), rft = se('<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>'), sft = se('<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>'), ift = se('<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">'), oft = se('<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>'), aft = se('<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">'), cft = se('<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>'), lft = se('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 18 18"fill=none><path d="M17.1709 5.37402C17.6508 6.47248 17.916 7.68542 17.916 8.95801C17.916 13.9056 13.9056 17.916 8.95801 17.916C7.15564 17.916 5.47648 17.3839 4.07129 16.4678V17.1016H2.44238V14.7734C2.44256 14.4459 2.63949 14.1505 2.94141 14.0234C3.2437 13.8965 3.59298 13.9629 3.82715 14.1924C5.15005 15.4892 6.96009 16.2871 8.95801 16.2871C13.006 16.2871 16.2871 13.006 16.2871 8.95801C16.2871 7.91409 16.0696 6.92305 15.6777 6.02637L17.1709 5.37402Z"fill=currentColor></path><path fill-rule=evenodd clip-rule=evenodd d="M12.3242 5.32324C11.6011 6.51177 12.5297 8.00879 13.958 8.00879V9.90723C12.5297 9.90723 11.602 11.4043 12.3252 12.5928L10.5928 13.541C9.86036 12.3375 8.05681 12.3375 7.32422 13.541L5.5918 12.5928C6.31495 11.4043 5.38635 9.90723 3.95801 9.90723V8.00879C5.38637 8.00879 6.31593 6.51179 5.59277 5.32324L7.3252 4.375C8.05738 5.57769 9.85967 5.57775 10.5918 4.375L12.3242 5.32324ZM8.95801 7.5C8.15259 7.5 7.5 8.15259 7.5 8.95801C7.50002 9.76341 8.1526 10.416 8.95801 10.416C9.76341 10.416 10.416 9.76341 10.416 8.95801C10.416 8.15259 9.76342 7.5 8.95801 7.5Z"fill=currentColor></path><path d="M8.95801 0C10.7603 7.93618e-06 12.4396 0.532207 13.8447 1.44824V0.814453H15.4727V3.1416C15.4727 3.46934 15.2767 3.76546 14.9746 3.89258C14.6723 4.01954 14.323 3.95308 14.0889 3.72363C12.766 2.42678 10.9559 1.62892 8.95801 1.62891C4.91001 1.62891 1.62891 4.91001 1.62891 8.95801C1.62891 10.0019 1.8465 10.993 2.23828 11.8896L0.745117 12.542C0.265189 11.4435 5.60729e-06 10.2306 0 8.95801C0 4.01046 4.01046 0 8.95801 0Z"fill=currentColor>'), uft = se('<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">'), dft = se('<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">'), fft = se('<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">'), hft = se('<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">'), pft = se('<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">'), gft = se('<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">'), bft = se('<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">'), mft = se('<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 yft = ()=>Jdt(), wft = ()=>Ydt(), _ft = ()=>Qdt(), xft = ()=>eft(), Tg = ()=>tft(), vft = ()=>nft(), Sft = ()=>rft(), Eg = ()=>sft(), uM = ()=>ift(), kft = ()=>oft(), ire = ()=>aft(), kw = ()=>cft(), sE = ()=>lft(), Tft = ()=>uft(), Eft = ()=>dft(), Cft = ()=>fft(), Ift = ()=>hft(), Aft = ()=>pft(), Pft = ()=>gft(), Oft = ()=>bft(), Mft = ()=>mft(), l9 = "/assets/cardano-ada-logo-white-B9pPeaxq.svg", Tw = "/assets/cardano-ada-logo-black-D1FRPH9x.svg", Rft = 220, Nft = (t)=>{
        document.documentElement.setAttribute("data-theme", t);
    }, ore = (t)=>{
        const e = document.documentElement;
        e.setAttribute("data-theme-transitioning", "true"), requestAnimationFrame(()=>{
            Nft(t);
        }), window.setTimeout(()=>{
            e.removeAttribute("data-theme-transitioning");
        }, Rft);
    };
    var Vft = se('<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'), Bft = se('<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">'), Dft = se('<span class="flex items-center justify-center w-7 h-7 text-header-muted"><i class="icon-box w-3.5 h-3.5">'), Fft = se('<span class="type-text-xs text-header-muted">%'), Lft = se('<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>'), zft = se('<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)">'), Uft = se('<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">'), Hft = se('<div class="flex items-center gap-1.5 lg:hidden"><span class="text-[9px] font-medium text-header-muted">DUST</span><span class="text-[9px] text-header-foreground">'), jft = se('<button type=button title="Refresh sync"aria-label="Refresh sync"><div>'), qft = se("<span><span></span><span>"), Kft = se('<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)]">'), Wft = se('<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"><span class="text-xs text-header-muted"></span><span class="text-sm font-semibold text-header-foreground uppercase">'), $ft = se('<div class="px-2 pb-2 flex gap-1.5">'), Xft = se('<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">'), Hp = se('<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)]">'), Gft = se('<span class="text-[var(--text-tertiary)] transition-colors group-hover:text-[var(--text-tertiary-hover)] group-focus:text-[var(--text-tertiary-hover)]">SWITCH ACCOUNT'), Zft = se('<span class="text-[var(--text-tertiary)] transition-colors group-hover:text-[var(--text-tertiary-hover)] group-focus:text-[var(--text-tertiary-hover)]">ADD WALLET'), Jft = se('<span class="text-[var(--text-tertiary)] transition-colors group-hover:text-[var(--text-tertiary-hover)] group-focus:text-[var(--text-tertiary-hover)]">SETTINGS'), Yft = se('<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'), Qft = se('<span class="text-[var(--text-tertiary)] transition-colors group-hover:text-[var(--text-tertiary-hover)] group-focus:text-[var(--text-tertiary-hover)]">EXPLORER'), eht = se('<span class="text-[var(--text-tertiary)] transition-colors group-hover:text-[var(--text-tertiary-hover)] group-focus:text-[var(--text-tertiary-hover)]">SUPPORT'), tht = se('<span class="text-[var(--text-tertiary)] transition-colors group-hover:text-[var(--text-tertiary-hover)] group-focus:text-[var(--text-tertiary-hover)]">LOCK WALLET'), nht = se('<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)]">'), rht = se('<button><span></span><span class="text-xs font-semibold text-[var(--color-header-foreground)] uppercase tracking-wide">'), sht = se('<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="type-text-xs text-header-muted"></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">'), iht = se('<div class="flex items-center gap-1 cursor-default"><span></span><span>');
    const Q7 = ()=>{
        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: b, cardanoEnabled: y, setCardanoEnabled: _ } = Tr(), [v, w] = he(0), [E, I] = he(!1), D = ()=>DO("DUST", l().environment), U = ()=>s(r(), 4, "DUST"), K = _t(()=>{
            const F = i();
            if (F.length === 0) return 0;
            const G = F.reduce((Q, Y)=>Q + Y.generatedNow, 0n), ee = F.reduce((Q, Y)=>Q + Y.maxCap, 0n);
            return ee === 0n ? 0 : Math.min(100, Number(G * 100n / ee));
        }), $ = ()=>t() ? "text-emerald-400" : h().overall === "down" || h().indexer === "down" ? "text-rose-400" : "text-amber-400", ne = ()=>e() || !t(), te = _t(()=>d().find((F)=>F.id === f())?.name || "Wallet 1"), J = _t(()=>d().find((F)=>F.id === f())?.accounts.find((F)=>F.index === p())?.name || "Account 1"), C = ()=>l().environment === "mainnet" ? "text-emerald-400" : l().environment === "preprod" ? "text-amber-400" : "text-blue-400", [g, x] = he(!1), A = _t(()=>[
                "preview",
                "preprod",
                "mainnet"
            ].filter((F)=>F !== l().environment)), R = ()=>l().environment === "mainnet" ? "bg-emerald-400" : l().environment === "preprod" ? "bg-amber-400" : "bg-blue-400", N = ()=>l().environment === "mainnet" ? "var(--fg-success-secondary)" : l().environment === "preprod" ? "var(--bg-warning-solid)" : "var(--fg-brand-secondary)";
        ot(()=>{
            E() && !t() && n().percent > 0 && I(!1);
        });
        const L = async (F)=>{
            ore(F), await u({
                ...l(),
                theme: F
            });
        };
        $a(()=>{});
        const z = _t(()=>{
            const F = b().status;
            return b(), !l().dustSponsorship || l().proofServerMode !== "proofstation" ? null : F === "ready" ? {
                text: "SPONSORED",
                color: "text-emerald-400",
                dot: "bg-emerald-400",
                tooltip: "Your transactions are gas-free — powered by 1AM ProofStation"
            } : F === "low" ? {
                text: "LOW DUST",
                color: "text-amber-400",
                dot: "bg-amber-400",
                tooltip: "ProofStation dust is running low — transactions may fail soon"
            } : F === "empty" ? {
                text: "NO DUST",
                color: "text-rose-400",
                dot: "bg-rose-400",
                tooltip: "No dust available — transactions cannot be sponsored right now"
            } : F === "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..."
            };
        }), B = ()=>[
                M(ge, {
                    get when () {
                        return t();
                    },
                    get fallback () {
                        return (()=>{
                            var F = Uft(), G = F.firstChild, ee = G.firstChild, Q = G.nextSibling, Y = Q.firstChild, ae = Y.nextSibling, de = ae.nextSibling;
                            return X(ee, M(ge, {
                                get when () {
                                    return h().overall === "down" || h().indexer === "down";
                                },
                                get fallback () {
                                    return it(()=>e() ? "INITIALIZING..." : "SYNCING...");
                                },
                                children: "NETWORK DOWN"
                            })), X(G, M(ge, {
                                get when () {
                                    return it(()=>!E() && !e() && n().percent > 0 && h().overall !== "down")() && h().indexer !== "down";
                                },
                                get children () {
                                    var pe = Fft(), Ae = pe.firstChild;
                                    return X(pe, ()=>n().percent, Ae), pe;
                                }
                            }), null), X(F, M(ge, {
                                get when () {
                                    return h().overall === "down" || h().indexer === "down";
                                },
                                get children () {
                                    var pe = Lft(), Ae = pe.firstChild, Oe = Ae.nextSibling, Re = Oe.firstChild, Me = Re.nextSibling, Je = Me.nextSibling;
                                    return X(Me, ()=>Mr[l().environment].label), X(Je, (()=>{
                                        var Ee = it(()=>l().environment === "mainnet");
                                        return ()=>Ee() ? "MAIN" : l().environment === "preprod" ? "PRE" : "PREV";
                                    })()), mt((Ee)=>{
                                        var le = `inline-flex items-center gap-1 text-[9px] lg:text-xs font-semibold uppercase tracking-wider ${C()}`, qe = `w-1.5 h-1.5 rounded-full shrink-0 ${R()}`;
                                        return le !== Ee.e && Mt(Oe, Ee.e = le), qe !== Ee.t && Mt(Re, Ee.t = qe), Ee;
                                    }, {
                                        e: void 0,
                                        t: void 0
                                    }), pe;
                                }
                            }), Q), X(F, M(ge, {
                                get when () {
                                    return it(()=>h().overall !== "down")() && h().indexer !== "down";
                                },
                                get children () {
                                    var pe = zft(), Ae = pe.firstChild, Oe = Ae.nextSibling;
                                    return mt((Re)=>{
                                        var Me = E() ? "0%" : `${n().percent}%`, Je = N();
                                        return Me !== Re.e && Zf(Oe, "width", Re.e = Me), Je !== Re.t && Zf(Oe, "background-color", Re.t = Je), Re;
                                    }, {
                                        e: void 0,
                                        t: void 0
                                    }), pe;
                                }
                            }), Q), X(ae, ()=>Mr[l().environment].label), X(de, (()=>{
                                var pe = it(()=>l().environment === "mainnet");
                                return ()=>pe() ? "MAIN" : l().environment === "preprod" ? "PRE" : "PREV";
                            })()), mt((pe)=>{
                                var Ae = `type-text-xs text-header-muted ${!e() && h().overall !== "down" && h().indexer !== "down" ? "animate-pulse" : ""}`, Oe = `inline-flex items-center gap-1 cursor-default ${C()}`, Re = `w-1 h-1 rounded-full shrink-0 ${R()}`;
                                return Ae !== pe.e && Mt(ee, pe.e = Ae), Oe !== pe.t && Mt(Q, pe.t = Oe), Re !== pe.a && Mt(Y, pe.a = Re), pe;
                            }, {
                                e: void 0,
                                t: void 0,
                                a: void 0
                            }), F;
                        })();
                    },
                    get children () {
                        var F = Vft(), G = F.firstChild, ee = G.firstChild, Q = ee.nextSibling, Y = Q.nextSibling;
                        return X(Q, ()=>Mr[l().environment].label), X(Y, (()=>{
                            var ae = it(()=>l().environment === "mainnet");
                            return ()=>ae() ? "MAIN" : l().environment === "preprod" ? "PRE" : "PREV";
                        })()), mt((ae)=>{
                            var de = `inline-flex items-center gap-1 text-[9px] lg:text-xs font-semibold uppercase tracking-wider ${C()}`, pe = `w-1.5 h-1.5 rounded-full shrink-0 ${R()}`;
                            return de !== ae.e && Mt(G, ae.e = de), pe !== ae.t && Mt(ee, ae.t = pe), ae;
                        }, {
                            e: void 0,
                            t: void 0
                        }), F;
                    }
                }),
                M(ge, {
                    get when () {
                        return c() > 0;
                    },
                    get children () {
                        var F = Bft(), G = F.firstChild, ee = G.nextSibling;
                        return X(ee, c), F;
                    }
                }),
                M(ge, {
                    get when () {
                        return t();
                    },
                    get children () {
                        var F = Dft(), G = F.firstChild;
                        return X(G, M(wft, {})), F;
                    }
                })
            ], S = (F)=>(()=>{
                var G = jft(), ee = G.firstChild;
                return G.$$click = ()=>{
                    I(!0), o();
                }, X(ee, M(B, {})), X(G, M(ge, {
                    get when () {
                        return t();
                    },
                    get children () {
                        var Q = Hft(), Y = Q.firstChild, ae = Y.nextSibling;
                        return X(ae, U), X(Q, M(ge, {
                            get when () {
                                return z();
                            },
                            children: (de)=>{
                                const pe = ()=>de().color.includes("emerald") ? "bg-emerald-500/15" : de().color.includes("amber") ? "bg-amber-500/15" : de().color.includes("rose") ? "bg-rose-500/15" : "bg-white/10";
                                return (()=>{
                                    var Ae = qft(), Oe = Ae.firstChild, Re = Oe.nextSibling;
                                    return X(Re, ()=>de().text), mt((Me)=>{
                                        var Je = `inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full ${pe()}`, Ee = de().tooltip, le = `w-1 h-1 rounded-full ${de().dot}`, qe = `text-[8px] font-semibold ${de().color}`;
                                        return Je !== Me.e && Mt(Ae, Me.e = Je), Ee !== Me.t && Qt(Ae, "title", Me.t = Ee), le !== Me.a && Mt(Oe, Me.a = le), qe !== Me.o && Mt(Re, Me.o = qe), Me;
                                    }, {
                                        e: void 0,
                                        t: void 0,
                                        a: void 0,
                                        o: void 0
                                    }), Ae;
                                })();
                            }
                        }), null), Q;
                    }
                }), null), mt((Q)=>{
                    var Y = `group flex flex-col justify-center gap-0.5 text-left transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${F.class || ""}`, ae = ne(), de = `flex items-center gap-1.5 ${$()}`;
                    return Y !== Q.e && Mt(G, Q.e = Y), ae !== Q.t && (G.disabled = Q.t = ae), de !== Q.a && Mt(ee, Q.a = de), Q;
                }, {
                    e: void 0,
                    t: void 0,
                    a: void 0
                }), G;
            })(), O = (F)=>{
            const [G, ee] = he(!1), Q = ()=>te().slice(0, 2).toUpperCase(), Y = ()=>{
                ee(!1), _2(!1), w2(!0);
            }, ae = async (de)=>{
                ee(!1), await L(de);
            };
            return M(Xdt, {
                placement: "bottom-end",
                gutter: 8,
                get open () {
                    return G();
                },
                onOpenChange: ee,
                get children () {
                    return [
                        M($dt, {
                            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 ${F.class || ""}`;
                            },
                            title: "Manage wallets",
                            "aria-label": "Manage wallets",
                            get children () {
                                var de = Kft(), pe = de.firstChild;
                                return X(pe, Q), de;
                            }
                        }),
                        M(Gdt, {
                            class: "w-[315px] p-0 bg-[var(--bg-primary)] !border-solid !border !border-[var(--border)] shadow-lg overflow-hidden",
                            get children () {
                                return [
                                    (()=>{
                                        var de = Wft(), pe = de.firstChild, Ae = pe.firstChild, Oe = Ae.firstChild, Re = Ae.nextSibling, Me = Re.firstChild, Je = Me.nextSibling;
                                        return X(Oe, Q), X(Me, te), X(Je, J), de;
                                    })(),
                                    (()=>{
                                        var de = Xft(), pe = de.firstChild, Ae = pe.firstChild, Oe = Ae.firstChild, Re = Oe.nextSibling, Me = Ae.nextSibling, Je = Me.firstChild, Ee = Je.nextSibling;
                                        return X(Re, ()=>Mr[l().environment].label), Me.$$click = (le)=>{
                                            le.stopPropagation(), x(!g());
                                        }, X(de, M(ge, {
                                            get when () {
                                                return g();
                                            },
                                            get children () {
                                                var le = $ft();
                                                return X(le, M(tr, {
                                                    get each () {
                                                        return A();
                                                    },
                                                    children: (qe)=>{
                                                        const Ye = qe === "mainnet" ? "bg-[var(--fg-success-secondary)]" : qe === "preprod" ? "bg-[var(--fg-warning-secondary)]" : "bg-[var(--fg-brand-secondary)]", ut = qe === "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))]" : qe === "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 Ce = rht(), oe = Ce.firstChild, ue = oe.nextSibling;
                                                            return Ce.$$click = async (Ie)=>{
                                                                Ie.stopPropagation(), x(!1), await u({
                                                                    ...l(),
                                                                    environment: qe
                                                                });
                                                            }, Mt(Ce, `flex-1 flex items-center justify-center gap-1.5 px-2 py-2 rounded-none border transition-colors ${ut}`), Mt(oe, `w-1.5 h-1.5 rounded-full ${Ye}`), X(ue, ()=>Mr[qe].label), mt(()=>Qt(Ce, "aria-label", `Switch to ${Mr[qe].label} network`)), Ce;
                                                        })();
                                                    }
                                                })), le;
                                            }
                                        }), null), mt((le)=>{
                                            var qe = `w-1.5 h-1.5 rounded-full ${R()}`, Ye = g(), ut = `w-3.5 h-3.5 transition-transform ${g() ? "rotate-90" : ""}`;
                                            return qe !== le.e && Mt(Oe, le.e = qe), Ye !== le.t && Qt(Me, "aria-expanded", le.t = Ye), ut !== le.a && Qt(Ee, "class", le.a = ut), le;
                                        }, {
                                            e: void 0,
                                            t: void 0,
                                            a: void 0
                                        }), de;
                                    })(),
                                    (()=>{
                                        var de = nht(), pe = de.firstChild, Ae = pe.nextSibling, Oe = Ae.firstChild, Re = Oe.firstChild, Me = Re.nextSibling, Je = Oe.nextSibling, Ee = Ae.nextSibling, le = Ee.firstChild, qe = le.nextSibling, Ye = Ee.nextSibling, ut = Ye.nextSibling;
                                        return X(de, M(Up, {
                                            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: ()=>{
                                                w2(!1), _2(!0);
                                            },
                                            get children () {
                                                return [
                                                    (()=>{
                                                        var Ce = Hp();
                                                        return X(Ce, M(Tft, {})), Ce;
                                                    })(),
                                                    Gft()
                                                ];
                                            }
                                        }), pe), X(de, M(Up, {
                                            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: ()=>{
                                                w2(!1), _2(!0);
                                            },
                                            get children () {
                                                return [
                                                    (()=>{
                                                        var Ce = Hp();
                                                        return X(Ce, M(Eft, {})), Ce;
                                                    })(),
                                                    Zft()
                                                ];
                                            }
                                        }), pe), X(de, M(Up, {
                                            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: Y,
                                            get children () {
                                                return [
                                                    (()=>{
                                                        var Ce = Hp();
                                                        return X(Ce, M(Cft, {})), Ce;
                                                    })(),
                                                    Jft()
                                                ];
                                            }
                                        }), Ae), Ae.$$click = ()=>void ae(l().theme === "dark" ? "light" : "dark"), X(Re, M(ge, {
                                            get when () {
                                                return l().theme === "dark";
                                            },
                                            get fallback () {
                                                return M(Ift, {});
                                            },
                                            get children () {
                                                return M(_ft, {});
                                            }
                                        })), X(Me, ()=>l().theme === "dark" ? "LIGHT MODE" : "DARK MODE"), Je.$$click = (Ce)=>Ce.stopPropagation(), X(Je, M(Gf, {
                                            get checked () {
                                                return l().theme === "dark";
                                            },
                                            "aria-label": "Toggle dark mode",
                                            onChange: (Ce)=>void ae(Ce ? "dark" : "light")
                                        })), Ee.$$click = async (Ce)=>{
                                            Ce.stopPropagation();
                                            const oe = !l().sidePanelEnabled;
                                            await u({
                                                ...l(),
                                                sidePanelEnabled: oe
                                            }), chrome.runtime.sendMessage({
                                                type: "SIDE_PANEL_SETTING_CHANGED"
                                            }).catch(()=>{});
                                        }, qe.$$click = (Ce)=>Ce.stopPropagation(), X(qe, M(Gf, {
                                            get checked () {
                                                return l().sidePanelEnabled ?? !0;
                                            },
                                            "aria-label": "Toggle side panel",
                                            onChange: async (Ce)=>{
                                                await u({
                                                    ...l(),
                                                    sidePanelEnabled: Ce
                                                }), chrome.runtime.sendMessage({
                                                    type: "SIDE_PANEL_SETTING_CHANGED"
                                                }).catch(()=>{});
                                            }
                                        })), X(de, M(ge, {
                                            get when () {
                                                return l().environment === "mainnet";
                                            },
                                            get children () {
                                                var Ce = Yft(), oe = Ce.firstChild, ue = oe.firstChild;
                                                return Ce.$$click = (Ie)=>Ie.stopPropagation(), X(Ce, M(Gf, {
                                                    get checked () {
                                                        return y();
                                                    },
                                                    "aria-label": "Toggle Cardano L1",
                                                    onChange: async (Ie)=>{
                                                        await _(Ie);
                                                    }
                                                }), null), mt(()=>Qt(ue, "src", l().theme === "dark" ? l9 : Tw)), Ce;
                                            }
                                        }), Ye), X(de, M(Up, {
                                            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 Ce = l().environment === "preprod" ? "preprod" : l().environment;
                                                window.open(`https://explorer.1am.xyz/?network=${Ce}`, "_blank");
                                            },
                                            get children () {
                                                return [
                                                    (()=>{
                                                        var Ce = Hp();
                                                        return X(Ce, M(Aft, {})), Ce;
                                                    })(),
                                                    Qft()
                                                ];
                                            }
                                        }), ut), X(de, M(Up, {
                                            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 Ce = Hp();
                                                        return X(Ce, M(Pft, {})), Ce;
                                                    })(),
                                                    eht()
                                                ];
                                            }
                                        }), ut), X(de, M(Up, {
                                            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 Ce = Hp();
                                                        return X(Ce, M(Oft, {})), Ce;
                                                    })(),
                                                    tht()
                                                ];
                                            }
                                        }), null), de;
                                    })()
                                ];
                            }
                        })
                    ];
                }
            });
        }, W = ()=>{
            window.open("https://1am.xyz", "_blank", "noopener,noreferrer");
        };
        return (()=>{
            var F = sht(), G = F.firstChild, ee = G.firstChild, Q = ee.nextSibling, Y = Q.firstChild, ae = Y.firstChild, de = G.nextSibling, pe = de.firstChild, Ae = pe.firstChild, Oe = pe.nextSibling, Re = Oe.firstChild, Me = Re.firstChild, Je = Me.firstChild, Ee = Je.firstChild, le = Ee.nextSibling, qe = Je.nextSibling, Ye = qe.firstChild, ut = Ye.nextSibling;
            return ee.$$click = W, X(ee, M(Zm, {
                class: "max-h-[18px] min-w-[70px] w-auto object-contain",
                animated: !0
            })), X(Q, M(S, {
                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)]"
            }), Y), Y.$$click = ()=>{
                const Ce = yo.runtime.getURL("/fullpage.html");
                yo.tabs.create({
                    url: Ce
                }), window.close();
            }, X(ae, M(Mft, {})), X(Q, M(O, {
                class: "h-full shrink-0 border-l border-header-divider"
            }), null), Ae.$$click = W, X(Ae, M(Zm, {
                class: "max-h-8 w-auto object-contain",
                animated: !0
            })), X(Ee, D), X(le, U), X(Me, M(ge, {
                get when () {
                    return z();
                },
                children: (Ce)=>(()=>{
                        var oe = iht(), ue = oe.firstChild, Ie = ue.nextSibling;
                        return X(Ie, ()=>Ce().text), mt((H)=>{
                            var T = Ce().tooltip, P = `w-1 h-1 rounded-full ${Ce().dot}`, Z = `text-[9px] font-medium uppercase tracking-wider ${Ce().color}`;
                            return T !== H.e && Qt(oe, "title", H.e = T), P !== H.t && Mt(ue, H.t = P), Z !== H.a && Mt(Ie, H.a = Z), H;
                        }, {
                            e: void 0,
                            t: void 0,
                            a: void 0
                        }), oe;
                    })()
            }), null), X(Oe, M(S, {
                get class () {
                    return `h-full px-6 border-r border-header-divider hover:bg-[var(--color-header-divider)] active:bg-[var(--color-header-divider)] ${$()}`;
                }
            }), null), X(Oe, M(O, {
                class: "h-full"
            }), null), mt((Ce)=>Zf(ut, "width", `${K()}%`)), F;
        })();
    };
    ci([
        "click"
    ]);
    var oht = se('<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)]">'), aht = se("<div>");
    const cht = {
        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)"
        }
    }, lht = {
        sm: "type-text-xs",
        md: "type-text-sm",
        lg: "type-text-sm"
    }, uht = {
        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]"
            }
        }
    }, m0 = (t)=>{
        const [e, n] = Ze(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 = cht[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 = aht();
            return vv(c, Le({
                get class () {
                    return vn("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)]", lht[s()], uht[s()][i()][o()], i() === "modern" && "shadow-[0_1px_2px_0_var(--badge-shadow)]", e.class);
                },
                get style () {
                    return a();
                }
            }, n), !1, !0), X(c, M(ge, {
                get when () {
                    return o() === "dot";
                },
                get children () {
                    return oht();
                }
            }), null), X(c, M(fE, {
                get children () {
                    return [
                        M(Jf, {
                            get when () {
                                return e.children;
                            },
                            get children () {
                                return e.children;
                            }
                        }),
                        M(Jf, {
                            get when () {
                                return !e.children;
                            },
                            children: "Label"
                        })
                    ];
                }
            }), null), c;
        })();
    };
    var dht = se('<div class="p-2.5 rounded-sm bg-rose-50 border border-rose-200 text-xs text-rose-600">'), fht = se('<p class="text-xs text-rose-500">Invalid recovery phrase. Please check your words.'), hht = se('<div class="fixed inset-0 z-50 flex items-center justify-center p-2"><div class="absolute inset-0 bg-overlay/50"></div><div class="relative w-full max-w-sm max-h-[90vh] overflow-y-auto rounded-sm bg-card shadow-xl"><div class="flex items-center justify-between border-b border-border px-4 py-3"><h2 class="type-text-sm font-semibold text-foreground uppercase tracking-wider">Enable Cardano</h2><button class="rounded-sm p-1 transition-colors hover:bg-bg-primary-hover"><svg class="h-4 w-4 text-content-muted-light"viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2><path d="M18 6 6 18M6 6l12 12"></path></svg></button></div><div class="p-4 space-y-4"><div class="flex items-start gap-2 p-2.5 rounded-sm bg-amber-50 border border-amber-200"><svg class="w-3.5 h-3.5 text-amber-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><p class="text-xs font-semibold text-amber-800">Re-enter your recovery phrase</p><p class="text-xs text-amber-700 mt-0.5">Cardano uses a different key derivation than Midnight. To derive your Cardano address, we need your original 24-word recovery phrase. This is a one-time step.</p></div></div><div class="grid grid-cols-3 gap-1.5"></div><div class="flex gap-2"><button class="flex-1 h-10 rounded-sm border border-border bg-card text-sm font-medium text-fg-secondary transition-colors hover:bg-bg-primary-hover hover:text-fg-primary">Cancel</button><button class="flex-1 h-10 rounded-sm bg-bg-primary-solid text-sm font-semibold text-fg-white transition-colors hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-40">'), pht = se('<div class="flex items-center gap-1 rounded bg-muted px-1.5"><span class="w-4 shrink-0 text-right text-[10px] text-content-muted-light">.</span><input type=text class="w-full bg-transparent py-1.5 text-xs text-foreground outline-none"autocomplete=off>');
    const ght = (t)=>{
        const [e, n] = he(Array(24).fill("")), [r, s] = he(null), [i, o] = he(!1), a = _t(()=>e().every((p)=>p.trim().length > 0)), c = _t(()=>{
            if (!a()) return !1;
            const p = M2(e().map((h)=>h.trim().toLowerCase()));
            return fte(p, Y5);
        }), l = (p, h)=>{
            n((b)=>{
                const y = [
                    ...b
                ];
                return y[p] = h, y;
            });
        }, u = (p)=>{
            const h = p.clipboardData?.getData("text");
            if (!h) return;
            const b = h.trim().split(/\s+/);
            b.length === 24 && (p.preventDefault(), n(b));
        }, d = async ()=>{
            o(!0), s(null);
            try {
                const p = M2(e().map((b)=>b.trim().toLowerCase()));
                if (Hte(p) !== t.expectedSeed) {
                    s("This mnemonic does not match your wallet. Please enter the correct recovery phrase."), o(!1);
                    return;
                }
                t.onConfirm(p), f();
            } catch  {
                s("Invalid recovery phrase."), o(!1);
            }
        }, f = ()=>{
            n(Array(24).fill("")), s(null), o(!1), t.onClose();
        };
        return M(ge, {
            get when () {
                return t.open;
            },
            get children () {
                var p = hht(), h = p.firstChild, b = h.nextSibling, y = b.firstChild, _ = y.firstChild, v = _.nextSibling, w = y.nextSibling, E = w.firstChild, I = E.nextSibling, D = I.nextSibling, U = D.firstChild, K = U.nextSibling;
                return h.$$click = f, v.$$click = f, X(w, M(ge, {
                    get when () {
                        return r();
                    },
                    get children () {
                        var $ = dht();
                        return X($, r), $;
                    }
                }), I), X(I, M(tr, {
                    get each () {
                        return e();
                    },
                    children: ($, ne)=>(()=>{
                            var te = pht(), J = te.firstChild, C = J.firstChild, g = J.nextSibling;
                            return X(J, ()=>ne() + 1, C), g.addEventListener("paste", u), g.$$input = (x)=>l(ne(), x.currentTarget.value), g.value = $, Qt(g, "spellcheck", !1), te;
                        })()
                })), X(w, M(ge, {
                    get when () {
                        return it(()=>!!a())() && !c();
                    },
                    get children () {
                        return fht();
                    }
                }), D), U.$$click = f, K.$$click = d, X(K, ()=>i() ? "Verifying..." : "Enable Cardano"), mt(()=>K.disabled = i() || !c()), p;
            }
        });
    };
    ci([
        "click",
        "input"
    ]);
    const XU = "/assets/divider-hcEMBCLi.png", dM = {
        indexer: "checking",
        rpc: "checking",
        overall: "checking",
        lastChecked: 0
    }, _v = {
        ...dM,
        proofServer: "checking",
        faucet: "checking",
        services: []
    };
    function are(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 bht(t) {
        return t === "preprod" ? "https://faucet.preprod.midnight.network/api/health" : t === "preview" ? "https://faucet.preview.midnight.network/api/health" : null;
    }
    async function mht(t) {
        const e = Mr[t];
        if (!e) return {
            ...dM,
            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 cre(t, e) {
        const n = Mr[t];
        if (!n) return {
            ..._v,
            overall: "down",
            lastChecked: Date.now()
        };
        const r = 5e3, s = async (_, v)=>{
            try {
                const w = new AbortController, E = setTimeout(()=>w.abort(), r), I = await fetch(_, {
                    ...v,
                    signal: w.signal
                }).catch(()=>null);
                return clearTimeout(E), !!I && I.ok;
            } catch  {
                return !1;
            }
        }, i = n.nodeUrl.replace("wss://", "https://").replace("ws://", "http://"), o = bht(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 (_)=>{
                if (!_) return !1;
                try {
                    const v = await fetch(`${e}/health`, {
                        signal: AbortSignal.timeout(r)
                    });
                    if (!v.ok) return !0;
                    const w = await v.json().catch(()=>null);
                    return w?.services?.balance?.status === "ok" || w?.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", b = a && c ? "healthy" : !a && !c ? "down" : "degraded", y = [
            {
                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 && y.push({
            label: "Faucet",
            url: o,
            status: h
        }), {
            indexer: d,
            rpc: f,
            proofServer: p,
            faucet: h,
            overall: b,
            lastChecked: Date.now(),
            services: y
        };
    }
    const b2 = {
        status: "checking",
        availableWallets: 0,
        totalWallets: 0,
        totalBalance: 0n,
        totalUtxos: 0,
        pendingTxs: 0,
        lastChecked: 0
    }, yht = 50000000000000n;
    async function wht(t) {
        try {
            const e = await fetch(`${t}/health`, {
                signal: AbortSignal.timeout(8e3)
            });
            if (!e.ok) return {
                ...b2,
                status: "down",
                lastChecked: Date.now()
            };
            const s = (await e.json())?.cluster?.[0]?.wallet_status;
            if (!s) return {
                ...b2,
                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 < yht ? u = "low" : u = "ready", {
                status: u,
                availableWallets: i,
                totalWallets: o,
                totalBalance: c,
                totalUtxos: l,
                pendingTxs: a,
                lastChecked: Date.now()
            };
        } catch  {
            return {
                ...b2,
                status: "down",
                lastChecked: Date.now()
            };
        }
    }
    const m2 = Object.freeze(Object.defineProperty({
        __proto__: null,
        DEFAULT_SPONSOR_HEALTH: b2,
        INITIAL_DETAILED_HEALTH: _v,
        INITIAL_HEALTH: dM,
        checkDetailedHealth: cre,
        checkNetworkHealth: mht,
        checkSponsorHealth: wht,
        getExternalLinks: are
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    var _ht = se('<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">'), xht = se('<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.'), e6 = se('<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">'), vht = se('<div class="mt-6 max-w-[281px]"><label class="mb-1.5 block font-mono text-xs uppercase text-content-muted"for=proofstation-key>API KEY'), Sht = se('<div class="mt-6 max-w-[281px]"><label class="mb-1.5 block font-mono text-xs uppercase text-content-muted"for=proof-server-url>PROOF SERVER URL</label><input id=proof-server-url class="w-full min-h-[40px] border border-[var(--border-primary)] bg-[var(--bg-primary)] px-3 py-2 font-mono text-sm text-foreground placeholder:text-content-muted-light outline-none focus:border-[var(--fg-primary)] focus:ring-2 focus:ring-[var(--fg-primary)]/8 transition-all"placeholder=http://localhost:6300 autocomplete=off>'), kht = se('<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'), Tht = se('<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...'), Eht = se('<div class="mt-6 border-t border-[var(--border-secondary)] pt-5">'), Cht = se('<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">'), Iht = se('<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">'), Aht = se('<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">'), Pht = se('<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>'), Oht = se('<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></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">THE ENDPOINT USED FOR TRANSACTION PROVING. DEFAULTS TO A LOCAL PROOF SERVER.</p></div><div class="mt-6 space-y-2"></div></section><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">DUST SPONSORSHIP</h2><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=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">Require password to reopen</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></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'), GU = se('<span class="absolute inset-[31.25%] rounded-full bg-white">'), Mht = se("<span aria-hidden=true>"), Rht = se('<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">'), Nht = se('<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'), t6 = se('<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">'), Vht = se('<button><span aria-hidden=true></span><div class="flex-1 min-w-0"><div class="flex items-center gap-2"><span class="font-mono text-sm font-semibold text-foreground uppercase"></span></div><p class="mt-0.5 font-mono text-xs text-content-muted">'), Bht = se("<button>m"), Dht = se('<p class="text-xs text-[var(--text-error-primary)] font-mono">'), Fht = se('<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">'), Lht = se('<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.'), zht = se('<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'), Uht = se('<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'), Hht = se('<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>...'), jht = se('<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">'), qht = se('<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 Kht = (t)=>{
        const { environmentSettings: e, updateSettings: n, lockWallet: r, deleteWallet: s, cardanoEnabled: i, cardanoHasMnemonic: o, setCardanoEnabled: a, enableCardanoWithMnemonic: c, vaultSeed: l, exportMnemonic: u, wallets: d, activeWalletId: f } = Tr(), p = ()=>d().find((vt)=>vt.id === f())?.name || "Wallet", h = ()=>d().find((vt)=>vt.id === f())?.accounts?.filter((vt)=>!vt.hidden)?.length || 1, [b, y] = he(e().environment), [_, v] = he(e().proofServerMode || "proofstation"), [w, E] = he(e().proofServerUrl), [I, D] = he(e().proofStationApiKey || ""), [U, K] = he(e().dustSponsorship ?? !0), [$, ne] = he(e().autoLockMinutes || gv), [te, J] = he(e().sidePanelEnabled || !1), [C, g] = he(e().theme || "light"), [x, A] = he(!1), [R, N] = he(!1), [L, z] = he(""), [B, S] = he(!1), [O, W] = he(!1), [F, G] = he(_v), [ee, Q] = he(!1), [Y, ae] = he(null), [de, pe] = he(null), [Ae, Oe] = he(!1), [Re, Me] = he(""), [Je, Ee] = he(""), [le, qe] = he(""), [Ye, ut] = he(!1);
        let Ce;
        const oe = 6e4, ue = ()=>{
            Oe(!1), Ee(""), Me(""), qe(""), ut(!1), Ce && (clearTimeout(Ce), Ce = void 0);
        }, Ie = ()=>{
            Ce && clearTimeout(Ce), Ce = setTimeout(ue, oe);
        }, H = (vt)=>{
            Ee(vt), ut(!1), Ie();
        }, T = (vt)=>{
            qe("Wrong password"), ut(!1);
        };
        At(ue);
        const P = async ()=>{
            Q(!0);
            try {
                const vt = await cre(b(), w());
                G(vt);
            } catch (vt) {
                console.error("[Settings] Health check failed:", vt), G(_v);
            } finally{
                Q(!1);
            }
        };
        $a(()=>{
            P();
        });
        const Z = _t(()=>b() !== e().environment || w() !== e().proofServerUrl || _() !== (e().proofServerMode || "proofstation") || I() !== (e().proofStationApiKey || "") || U() !== (e().dustSponsorship ?? !0) || $() !== (e().autoLockMinutes || gv) || C() !== (e().theme || "light")), ie = _t(()=>b() !== e().environment), ce = (vt)=>{
            if (v(vt), vt === "proofstation") E(Mr[b()].proofServerUrl), D(pv(b())), K(!0);
            else {
                const Kr = GT[vt];
                Kr && vt !== "custom" && E(Kr.url), K(!1);
            }
        }, be = async ()=>{
            A(!0), await n({
                environment: b(),
                proofServerUrl: w(),
                proofServerMode: _(),
                proofStationApiKey: _() === "proofstation" ? I() : void 0,
                proofStationApiKeys: {
                    ...e().proofStationApiKeys,
                    [b()]: _() === "proofstation" ? I() : void 0
                },
                dustSponsorship: U(),
                autoLockMinutes: $(),
                theme: C()
            }), A(!1), N(!0), setTimeout(()=>N(!1), 2e3);
        }, yt = async ()=>{
            L() === "DELETE" && await s();
        }, Et = (vt)=>{
            pe((Kr)=>Kr === vt ? null : vt);
        }, dt = async (vt, Kr)=>{
            try {
                await navigator.clipboard.writeText(vt), ae(Kr), setTimeout(()=>ae(null), 1500);
            } catch  {}
        }, Kt = _t(()=>Mr[b()]), tt = ()=>(()=>{
                var vt = _ht(), Kr = vt.firstChild;
                return Zf(Kr, "background-image", `url(${XU})`), vt;
            })();
        return (()=>{
            var vt = Oht(), Kr = vt.firstChild, Vn = Kr.firstChild, _n = Vn.firstChild, Ya = Kr.nextSibling, jn = Ya.firstChild, nt = jn.firstChild, Wr = nt.nextSibling, fn = Wr.firstChild;
            fn.nextSibling;
            var je = Wr.nextSibling, dr = je.firstChild;
            dr.nextSibling;
            var Wt = je.nextSibling, Ut = Wt.firstChild;
            Ut.nextSibling;
            var fr = Wt.nextSibling, Bn = fr.firstChild;
            Bn.nextSibling;
            var hn = jn.nextSibling, Ri = hn.firstChild, $t = hn.nextSibling, Xn = $t.firstChild, Ni = Xn.firstChild, hr = Ni.firstChild;
            hr.nextSibling;
            var pr = Ni.nextSibling, ku = Xn.nextSibling, gr = ku.firstChild, br = gr.nextSibling, Qa = br.firstChild, Vi = Qa.firstChild, lf = Vi.nextSibling, Mo = lf.firstChild, Jc = Mo.nextSibling, Tu = Qa.nextSibling, uf = Tu.firstChild, df = uf.nextSibling, Eu = df.firstChild, Yc = Eu.nextSibling, ff = Tu.nextSibling, Cu = ff.firstChild, Qc = Cu.nextSibling, ec = Qc.firstChild, el = ec.nextSibling, Bi = ku.nextSibling, tl = Bi.firstChild, hf = tl.firstChild;
            hf.nextSibling;
            var pf = tl.nextSibling, Sb = Bi.nextSibling, vp = Sb.firstChild, y9 = vp.firstChild, w9 = y9.firstChild, _9 = w9.nextSibling, kb = Sb.nextSibling, Sp = kb.firstChild, Tb = Sp.nextSibling, Eb = Tb.firstChild, x9 = Eb.firstChild, kp = x9.firstChild;
            kp.nextSibling;
            var Cb = Eb.nextSibling, Mw = Cb.firstChild, Rw = Mw.firstChild, Tp = Rw.nextSibling, v9 = Cb.nextSibling, S9 = v9.firstChild, Ep = kb.nextSibling, k9 = Ep.firstChild, T9 = k9.nextSibling, UM = T9.firstChild, HM = UM.nextSibling, E9 = HM.nextSibling, me = T9.nextSibling, Se = me.nextSibling, Ne = Se.firstChild, ve = Ep.nextSibling, Ke = ve.firstChild, wt = Ke.firstChild, sn = wt.firstChild, qn = sn.firstChild, ps = qn.firstChild, Er = ps.nextSibling, $r = qn.nextSibling, Di = sn.nextSibling, Ro = ve.nextSibling, gs = Ro.firstChild, pa = gs.nextSibling, Nt = pa.nextSibling, pn = Nt.firstChild, Yn = pn.nextSibling;
            return Yn.nextSibling, v2(_n, "click", t.onBack, !0), Zf(Ri, "background-image", `url(${XU})`), X(pr, M(tr, {
                get each () {
                    return Object.values(Mr);
                },
                children: (De)=>(()=>{
                        var pt = Rht(), en = pt.firstChild, Jt = en.firstChild, Dt = en.nextSibling;
                        return pt.$$click = ()=>De.enabled && y(De.name), X(Jt, (()=>{
                            var Bt = it(()=>De.name === "preprod");
                            return ()=>Bt() ? "PREPROD" : De.label.toUpperCase();
                        })()), X(en, M(ge, {
                            get when () {
                                return De.enabled;
                            },
                            get fallback () {
                                return Nht();
                            },
                            get children () {
                                var Bt = Mht();
                                return X(Bt, M(ge, {
                                    get when () {
                                        return b() === De.name;
                                    },
                                    get children () {
                                        return GU();
                                    }
                                })), mt(()=>Mt(Bt, `w-4 h-4 rounded-full flex-none shrink-0 ${b() === De.name ? "bg-[var(--bg-brand-solid)] relative overflow-hidden" : "border border-[var(--border-primary)] bg-transparent"}`)), Bt;
                            }
                        }), null), X(Dt, ()=>De.description), mt((Bt)=>{
                            var Nr = `
                      min-h-[76px] flex flex-col gap-1 justify-center px-4 py-3 text-left transition-all
                      ${b() === De.name ? "border-2 border-[var(--border-primary)] bg-[var(--bg-primary-hover)]" : De.enabled ? "border border-[var(--border-secondary)] bg-[var(--bg-primary)] hover:border-[var(--border-primary)]" : "border border-[var(--border-secondary)] bg-muted cursor-default"}
                    `, or = !De.enabled, On = b() === De.name;
                            return Nr !== Bt.e && Mt(pt, Bt.e = Nr), or !== Bt.t && (pt.disabled = Bt.t = or), On !== Bt.a && Qt(pt, "aria-checked", Bt.a = On), Bt;
                        }, {
                            e: void 0,
                            t: void 0,
                            a: void 0
                        }), pt;
                    })()
            })), X(Xn, M(ge, {
                get when () {
                    return ie();
                },
                get children () {
                    return xht();
                }
            }), null), X($t, M(tt, {}), ku), X(Mo, ()=>Kt().indexerHttpUrl), Jc.$$click = ()=>dt(Kt().indexerHttpUrl, "indexer"), X(Jc, M(ge, {
                get when () {
                    return Y() === "indexer";
                },
                get fallback () {
                    return t6();
                },
                get children () {
                    return e6();
                }
            })), X(Eu, ()=>Kt().indexerWsUrl), Yc.$$click = ()=>dt(Kt().indexerWsUrl, "ws"), X(Yc, M(ge, {
                get when () {
                    return Y() === "ws";
                },
                get fallback () {
                    return t6();
                },
                get children () {
                    return e6();
                }
            })), X(ec, ()=>Kt().nodeUrl), el.$$click = ()=>dt(Kt().nodeUrl, "node"), X(el, M(ge, {
                get when () {
                    return Y() === "node";
                },
                get fallback () {
                    return t6();
                },
                get children () {
                    return e6();
                }
            })), X($t, M(tt, {}), Bi), X(pf, M(tr, {
                get each () {
                    return Object.entries(GT);
                },
                children: ([De, pt])=>(()=>{
                        var en = Vht(), Jt = en.firstChild, Dt = Jt.nextSibling, Bt = Dt.firstChild, Nr = Bt.firstChild, or = Bt.nextSibling;
                        return en.$$click = ()=>!pt.disabled && ce(De), X(Jt, M(ge, {
                            get when () {
                                return it(()=>_() === De)() && !pt.disabled;
                            },
                            get children () {
                                return GU();
                            }
                        })), X(Nr, ()=>pt.label), X(Bt, M(ge, {
                            get when () {
                                return it(()=>!pt.disabled)() && De === (e().proofServerMode || "proofstation");
                            },
                            get children () {
                                return M(m0, {
                                    tone: "success",
                                    variant: "color",
                                    size: "sm",
                                    icon: "dot",
                                    class: "font-mono uppercase",
                                    children: "Active"
                                });
                            }
                        }), null), X(Bt, M(ge, {
                            get when () {
                                return pt.disabled;
                            },
                            get children () {
                                return M(m0, {
                                    tone: "warning",
                                    variant: "color",
                                    size: "sm",
                                    class: "font-mono uppercase",
                                    children: "Experimental"
                                });
                            }
                        }), null), X(or, ()=>pt.description), mt((On)=>{
                            var Xr = `w-full flex items-center gap-3 p-3 border transition-all text-left ${pt.disabled ? "border-[var(--border-secondary)] opacity-50 cursor-not-allowed bg-muted" : _() === De ? "border-2 border-[var(--border-primary)] bg-[var(--bg-primary-hover)]" : "border-[var(--border-secondary)] hover:border-[var(--border-primary)] bg-[var(--bg-primary)]"}`, Gs = pt.disabled, It = `w-4 h-4 rounded-full flex-none shrink-0 relative ${_() === De && !pt.disabled ? "bg-[var(--bg-brand-solid)] overflow-hidden" : "border border-[var(--border-primary)] bg-transparent"}`;
                            return Xr !== On.e && Mt(en, On.e = Xr), Gs !== On.t && (en.disabled = On.t = Gs), It !== On.a && Mt(Jt, On.a = It), On;
                        }, {
                            e: void 0,
                            t: void 0,
                            a: void 0
                        }), en;
                    })()
            })), X(Bi, M(ge, {
                get when () {
                    return _() === "proofstation";
                },
                get children () {
                    var De = vht();
                    return De.firstChild, X(De, M(wd, {
                        get value () {
                            return I();
                        },
                        onChange: D,
                        get children () {
                            return M(mh, {
                                id: "proofstation-key",
                                placeholder: "pk_live_...",
                                class: "h-10 rounded-none border-[var(--border-primary)] bg-[var(--bg-primary)] font-mono text-sm text-foreground placeholder:text-content-muted-light focus:border-[var(--fg-primary)] focus:ring-2 focus:ring-[var(--fg-primary)]/8",
                                type: "password"
                            });
                        }
                    }), null), De;
                }
            }), null), X(Bi, M(ge, {
                get when () {
                    return _() === "local" || _() === "custom";
                },
                get children () {
                    var De = Sht(), pt = De.firstChild, en = pt.nextSibling;
                    return en.$$input = (Jt)=>E(Jt.currentTarget.value), Qt(en, "spellcheck", !1), mt(()=>en.value = w()), De;
                }
            }), null), X(Bi, M(ge, {
                get when () {
                    return Z() || R();
                },
                get children () {
                    var De = Eht();
                    return X(De, M(yi, {
                        onClick: be,
                        get disabled () {
                            return x() || R();
                        },
                        get class () {
                            return `h-10 px-6 font-mono text-sm font-semibold uppercase tracking-wide transition-colors ${R() ? "bg-[var(--bg-success-solid)] text-primary-foreground cursor-default" : ie() ? "bg-[var(--bg-warning-solid)] hover:opacity-90 text-primary-foreground" : "bg-[var(--fg-primary)] hover:bg-[var(--bg-primary-solid)] text-[var(--fg-white)]"}`;
                        },
                        get children () {
                            return [
                                M(ge, {
                                    get when () {
                                        return R();
                                    },
                                    get children () {
                                        return kht();
                                    }
                                }),
                                M(ge, {
                                    get when () {
                                        return it(()=>!R())() && x();
                                    },
                                    get children () {
                                        return Tht();
                                    }
                                }),
                                M(ge, {
                                    get when () {
                                        return it(()=>!R())() && !x();
                                    },
                                    get children () {
                                        return ie() ? "Apply & Resync Wallet" : "Apply Settings";
                                    }
                                })
                            ];
                        }
                    })), De;
                }
            }), null), X($t, M(tt, {}), Sb), X(_9, (()=>{
                var De = it(()=>_() !== "proofstation");
                return ()=>De() ? "Only available with 1AM ProofStation" : U() ? "Server pays fees for you" : "You pay dust fees locally";
            })()), X(vp, M(Gf, {
                get checked () {
                    return U();
                },
                get disabled () {
                    return _() !== "proofstation";
                },
                "aria-label": "Toggle dust sponsorship",
                onChange: (De)=>{
                    _() === "proofstation" && K(De);
                }
            }), null), X($t, M(ge, {
                get when () {
                    return b() === "mainnet";
                },
                get fallback () {
                    return M(tt, {});
                },
                get children () {
                    return [
                        M(tt, {}),
                        (()=>{
                            var De = Cht(), pt = De.firstChild, en = pt.firstChild, Jt = en.firstChild, Dt = Jt.firstChild, Bt = Jt.nextSibling;
                            return X(Bt, ()=>i() ? "Showing NIGHT balance from Cardano L1" : "Show NIGHT balance on Cardano L1"), X(pt, M(Gf, {
                                get checked () {
                                    return i();
                                },
                                "aria-label": "Toggle Cardano NIGHT",
                                onChange: ()=>{
                                    i() ? a(!1) : o() ? a(!0) : W(!0);
                                }
                            }), null), mt(()=>Qt(Dt, "src", e().theme === "dark" ? l9 : Tw)), De;
                        })(),
                        M(tt, {})
                    ];
                }
            }), kb), X(Eb, M(Gf, {
                get checked () {
                    return C() === "dark";
                },
                "aria-label": "Toggle dark mode",
                onChange: async (De)=>{
                    const pt = De ? "dark" : "light";
                    g(pt), ore(pt), await n({
                        ...e(),
                        theme: pt
                    });
                }
            }), null), X(Tp, ()=>te() ? "Opens as sidebar when icon clicked" : "Opens as popup when icon clicked"), X(Cb, M(Gf, {
                get checked () {
                    return te();
                },
                "aria-label": "Toggle side panel",
                onChange: async (De)=>{
                    J(De), await n({
                        ...e(),
                        sidePanelEnabled: De
                    }), chrome.runtime.sendMessage({
                        type: "SIDE_PANEL_SETTING_CHANGED"
                    });
                }
            }), null), S9.$$click = ()=>{
                const De = yo.runtime.getURL("/fullpage.html");
                yo.tabs.create({
                    url: De
                }), window.close();
            }, X($t, M(tt, {}), Ep), X(E9, M(tr, {
                get each () {
                    return [
                        ...rne
                    ];
                },
                children: (De)=>(()=>{
                        var pt = Bht(), en = pt.firstChild;
                        return pt.$$click = ()=>{
                            ne(De), n({
                                ...e(),
                                autoLockMinutes: De
                            });
                        }, X(pt, De, en), mt(()=>Mt(pt, `flex-1 h-9 font-mono text-xs font-semibold uppercase transition-colors ${$() === De ? "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"}`)), pt;
                    })()
            })), X(me, M(ge, {
                get when () {
                    return !Ae();
                },
                get fallback () {
                    return (()=>{
                        var De = Lht(), pt = De.firstChild, en = pt.nextSibling;
                        return en.nextSibling, X(De, M(ge, {
                            get when () {
                                return !Je();
                            },
                            get fallback () {
                                return (()=>{
                                    var Jt = zht(), Dt = Jt.firstChild, Bt = Dt.firstChild, Nr = Bt.nextSibling, or = Dt.nextSibling, On = or.firstChild, Xr = or.nextSibling, Gs = Xr.firstChild, It = Gs.nextSibling, Ts = It.nextSibling, Ib = Ts.nextSibling;
                                    Ib.nextSibling;
                                    var C9 = Xr.nextSibling;
                                    return X(Nr, p), X(On, Je), X(Xr, h, It), X(Xr, ()=>h() !== 1 ? "s" : "", Ib), C9.$$click = ue, Jt;
                                })();
                            },
                            get children () {
                                var Jt = Fht(), Dt = Jt.firstChild, Bt = Dt.nextSibling, Nr = Bt.firstChild, or = Nr.nextSibling;
                                return X(Jt, M(wd, {
                                    get value () {
                                        return Re();
                                    },
                                    onChange: Me,
                                    get children () {
                                        return M(mh, {
                                            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: (On)=>{
                                                On.key === "Enter" && Re().length > 0 && (ut(!0), qe(""), u(Re()).then(H).catch(T));
                                            }
                                        });
                                    }
                                }), Bt), X(Jt, M(ge, {
                                    get when () {
                                        return le();
                                    },
                                    get children () {
                                        var On = Dht();
                                        return X(On, le), On;
                                    }
                                }), Bt), Nr.$$click = ue, or.$$click = ()=>{
                                    ut(!0), qe(""), u(Re()).then(H).catch(T);
                                }, X(or, ()=>Ye() ? "Decrypting..." : "Reveal"), mt(()=>or.disabled = Re().length === 0 || Ye()), Jt;
                            }
                        }), null), De;
                    })();
                },
                get children () {
                    var De = Iht(), pt = De.firstChild, en = pt.firstChild, Jt = en.nextSibling;
                    return Jt.firstChild, De.$$click = ()=>Oe(!0), X(Jt, p, null), De;
                }
            })), Ne.$$click = ()=>r(), X(Se, M(ge, {
                get when () {
                    return !B();
                },
                get fallback () {
                    return (()=>{
                        var De = Uht(), pt = De.firstChild, en = pt.nextSibling, Jt = en.firstChild, Dt = Jt.nextSibling;
                        return X(De, M(wd, {
                            get value () {
                                return L();
                            },
                            onChange: z,
                            get children () {
                                return M(mh, {
                                    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
                                });
                            }
                        }), en), Jt.$$click = ()=>{
                            S(!1), z("");
                        }, Dt.$$click = yt, mt(()=>Dt.disabled = L() !== "DELETE"), De;
                    })();
                },
                get children () {
                    var De = Aht();
                    return De.$$click = ()=>S(!0), De;
                }
            }), null), X($t, M(tt, {}), ve), Ke.$$click = ()=>Et("health"), X($r, (()=>{
                var De = it(()=>F().overall === "checking");
                return ()=>De() ? "Checking..." : it(()=>F().overall === "healthy")() ? "All services operational" : F().overall === "degraded" ? "Some services degraded" : "Services unreachable";
            })()), X(ve, M(ge, {
                get when () {
                    return de() === "health";
                },
                get children () {
                    var De = Pht(), pt = De.firstChild, en = pt.firstChild, Jt = en.nextSibling, Dt = pt.nextSibling, Bt = Dt.nextSibling, Nr = Bt.firstChild, or = Nr.nextSibling;
                    return X(en, (()=>{
                        var On = it(()=>F().lastChecked > 0);
                        return ()=>On() ? `Last checked ${new Date(F().lastChecked).toLocaleTimeString()}` : "Not checked yet";
                    })()), Jt.$$click = P, X(Jt, ()=>ee() ? "Checking..." : "Refresh"), X(Dt, M(tr, {
                        get each () {
                            return F().services;
                        },
                        children: (On)=>(()=>{
                                var Xr = jht(), Gs = Xr.firstChild, It = Gs.firstChild, Ts = It.nextSibling;
                                return X(It, ()=>On.label), X(Ts, ()=>On.url), X(Xr, M(ge, {
                                    get when () {
                                        return On.status === "checking";
                                    },
                                    get fallback () {
                                        return M(m0, {
                                            get tone () {
                                                return On.status === "up" ? "success" : "error";
                                            },
                                            variant: "color",
                                            size: "sm",
                                            icon: "dot",
                                            class: "ml-3 shrink-0 font-mono uppercase",
                                            get children () {
                                                return On.status;
                                            }
                                        });
                                    },
                                    get children () {
                                        return Hht();
                                    }
                                }), null), Xr;
                            })()
                    })), X(or, M(tr, {
                        get each () {
                            return are(b());
                        },
                        children: (On)=>(()=>{
                                var Xr = qht(), Gs = Xr.firstChild;
                                return X(Gs, ()=>On.label), mt(()=>Qt(Xr, "href", On.url)), Xr;
                            })()
                    })), mt(()=>Jt.disabled = ee()), De;
                }
            }), null), X($t, M(tt, {}), Ro), X(Nt, ()=>chrome.runtime.getManifest().version, Yn), X(vt, M(ght, {
                get open () {
                    return O();
                },
                onClose: ()=>W(!1),
                onConfirm: async (De)=>{
                    await c(De), W(!1);
                },
                get expectedSeed () {
                    return l();
                }
            }), null), mt((De)=>{
                var pt = Y() === "indexer" ? "Copied!" : "Copy", en = Y() === "ws" ? "Copied!" : "Copy", Jt = Y() === "node" ? "Copied!" : "Copy", Dt = `w-2 h-2 rounded-full ${F().overall === "healthy" ? "bg-[var(--fg-success-secondary)]" : F().overall === "degraded" ? "bg-[var(--fg-warning-secondary)]" : F().overall === "down" ? "bg-[var(--fg-error-secondary)]" : "bg-[var(--border-secondary)] animate-pulse"}`, Bt = `mt-0.5 h-4 w-4 shrink-0 text-content-muted-light transition-transform ${de() === "health" ? "rotate-180" : ""}`;
                return pt !== De.e && Qt(Jc, "title", De.e = pt), en !== De.t && Qt(Yc, "title", De.t = en), Jt !== De.a && Qt(el, "title", De.a = Jt), Dt !== De.o && Mt(Er, De.o = Dt), Bt !== De.i && Qt(Di, "class", De.i = Bt), De;
            }, {
                e: void 0,
                t: void 0,
                a: void 0,
                o: void 0,
                i: void 0
            }), vt;
        })();
    };
    ci([
        "click",
        "input"
    ]);
    var Wht = se('<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)]">'), $ht = se('<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">'), Xht = se(`<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`), Ght = se(`<p class="text-xs text-[var(--text-error-primary)]">Words don't match. Please check your recovery phrase.`), Zht = se('<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">'), Jht = se('<p class="text-xs text-[var(--text-error-primary)]">Invalid recovery phrase. Please check your words.'), Yht = se('<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">'), Qht = se('<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>'), ept = se('<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">'), ZU = se('<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 tpt = (t)=>{
        const { addWallet: e } = Tr(), [n, r] = he("choose"), [s, i] = he(""), [o, a] = he(!1), [c, l] = he(null);
        let u;
        At(()=>clearTimeout(u));
        const [d, f] = he([]), [p, h] = he(Array(24).fill("")), [b, y] = he(Array(24).fill("")), _ = _t(()=>{
            const J = b();
            if (!J.every((g)=>g.trim().length > 0)) return !1;
            const C = M2(J.map((g)=>g.trim().toLowerCase()));
            return fte(C, Y5);
        }), v = _t(()=>{
            const J = d(), C = p();
            return J.length === 0 ? !1 : J.every((g, x)=>C[x]?.trim().toLowerCase() === g.toLowerCase());
        }), w = ()=>{
            const J = xie();
            f(J), r("create-backup");
        }, E = async (J)=>{
            a(!0), l(null);
            try {
                const C = Hte(J);
                await e(C, s().trim() || void 0, J), t.onBack();
            } catch (C) {
                l(C instanceof Error ? C.message : "Failed to add wallet"), a(!1);
            }
        }, I = ()=>E(d().join(" ")), D = ()=>E(M2(b().map((J)=>J.trim().toLowerCase()))), U = (J, C)=>{
            h((g)=>{
                const x = [
                    ...g
                ];
                return x[J] = C, x;
            });
        }, K = (J, C)=>{
            y((g)=>{
                const x = [
                    ...g
                ];
                return x[J] = C, x;
            });
        }, $ = (J)=>(C)=>{
                const g = C.clipboardData?.getData("text");
                if (!g) return;
                const x = g.trim().split(/\s+/);
                x.length === 24 && (C.preventDefault(), J(x));
            }, ne = ()=>{
            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";
            }
        }, te = ()=>{
            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 J = Qht(), C = J.firstChild, g = C.firstChild, x = g.nextSibling, A = C.nextSibling, R = A.firstChild;
            return g.$$click = te, X(x, ne), X(R, M(ge, {
                get when () {
                    return c();
                },
                get children () {
                    var N = Wht();
                    return X(N, c), N;
                }
            }), null), X(R, M(ge, {
                get when () {
                    return n() === "choose";
                },
                get children () {
                    var N = $ht(), L = N.firstChild, z = L.firstChild, B = z.nextSibling, S = L.nextSibling, O = S.nextSibling;
                    return B.$$input = (W)=>i(W.currentTarget.value), S.$$click = w, O.$$click = ()=>r("import"), mt(()=>B.value = s()), N;
                }
            }), null), X(R, M(ge, {
                get when () {
                    return n() === "create-backup";
                },
                get children () {
                    var N = Xht(), L = N.firstChild, z = L.nextSibling, B = z.firstChild, S = z.nextSibling, O = S.firstChild, W = O.nextSibling;
                    return X(B, M(tr, {
                        get each () {
                            return d();
                        },
                        children: (F, G)=>(()=>{
                                var ee = ept(), Q = ee.firstChild, Y = Q.nextSibling;
                                return X(Q, ()=>G() + 1), X(Y, F), ee;
                            })()
                    })), O.$$click = async ()=>{
                        try {
                            await navigator.clipboard.writeText(d().join(" "));
                            const F = document.getElementById("copy-mnemonic-btn");
                            F && (F.textContent = "Copied!", setTimeout(()=>F.textContent = "Copy All", 2e3)), clearTimeout(u), u = setTimeout(()=>{
                                navigator.clipboard.writeText("").catch(()=>{});
                            }, 6e4);
                        } catch  {}
                    }, W.$$click = ()=>r("create-confirm"), N;
                }
            }), null), X(R, M(ge, {
                get when () {
                    return n() === "create-confirm";
                },
                get children () {
                    var N = Zht(), L = N.firstChild, z = L.firstChild, B = z.nextSibling, S = L.nextSibling, O = S.firstChild, W = S.nextSibling;
                    return B.$$click = async ()=>{
                        const G = (await navigator.clipboard.readText()).trim().split(/\s+/);
                        G.length === 24 && h(G);
                    }, X(O, M(tr, {
                        get each () {
                            return p();
                        },
                        children: (F, G)=>(()=>{
                                var ee = ZU(), Q = ee.firstChild, Y = Q.nextSibling;
                                return X(Q, ()=>G() + 1), v2(Y, "paste", $(h)), Y.$$input = (ae)=>U(G(), ae.currentTarget.value), Y.value = F, Qt(Y, "spellcheck", !1), ee;
                            })()
                    })), X(N, M(ge, {
                        get when () {
                            return it(()=>!!p().every((F)=>F.trim()))() && !v();
                        },
                        get children () {
                            return Ght();
                        }
                    }), W), W.$$click = I, X(W, ()=>o() ? "Adding Wallet..." : "Confirm & Add Wallet"), mt(()=>W.disabled = o() || !v()), N;
                }
            }), null), X(R, M(ge, {
                get when () {
                    return n() === "import";
                },
                get children () {
                    var N = Yht(), L = N.firstChild, z = L.nextSibling, B = z.firstChild, S = z.nextSibling;
                    return X(B, M(tr, {
                        get each () {
                            return b();
                        },
                        children: (O, W)=>(()=>{
                                var F = ZU(), G = F.firstChild, ee = G.nextSibling;
                                return X(G, ()=>W() + 1), v2(ee, "paste", $(y)), ee.$$input = (Q)=>K(W(), Q.currentTarget.value), ee.value = O, Qt(ee, "spellcheck", !1), F;
                            })()
                    })), X(N, M(ge, {
                        get when () {
                            return it(()=>!!b().every((O)=>O.trim()))() && !_();
                        },
                        get children () {
                            return Jht();
                        }
                    }), S), S.$$click = D, X(S, ()=>o() ? "Adding Wallet..." : "Import Wallet"), mt(()=>S.disabled = o() || !_()), N;
                }
            }), null), mt(()=>Mt(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" : ""}`)), J;
        })();
    };
    ci([
        "click",
        "input"
    ]);
    var npt = se('<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>'), rpt = se('<div class="mx-auto flex h-full w-full max-w-[1280px] border-x border-border bg-background">'), spt = se('<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'), ipt = se('<button class="h-7 px-2.5 text-xs font-medium rounded-sm bg-white text-black hover:bg-white/80 transition-colors">Switch'), opt = se('<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">'), apt = se('<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'), cpt = se('<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">'), lpt = se('<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">'), upt = se('<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>'), dpt = se('<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'), fpt = se('<span class="text-[10px] text-text-brand-tertiary ml-1.5">Active'), hpt = se('<div class="flex-1 min-w-0"><span class="text-xs font-medium text-foreground">'), ppt = se('<button class="h-6 px-2 text-[10px] font-medium rounded bg-white text-black hover:bg-white/80 transition-colors">Use'), gpt = se('<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>'), bpt = se('<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">'), mpt = se('<input type=text class="flex-1 h-7 px-2 text-xs border border-border rounded text-foreground outline-none focus:border-foreground"autofocus>'), ypt = se('<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 wpt = (t)=>{
        const { wallets: e, activeWalletId: n, activeAccountIndex: r, switchWallet: s, addAccount: i, renameWallet: o, removeWallet: a, switchAccount: c, renameAccount: l, hideAccount: u, unhideAccount: d } = Tr(), [f, p] = he(!1), [h, b] = he(!1), [y, _] = he(null), [v, w] = he(null), [E, I] = he(""), [D, U] = he(null), K = (C, g)=>{
            _(C), I(g);
        }, $ = ()=>{
            const C = y();
            C !== null && E().trim() && o(C, E().trim()), _(null);
        }, ne = (C, g, x)=>{
            w(`${C}:${g}`), I(x);
        }, te = ()=>{
            const C = v();
            if (C && E().trim()) {
                const [, g] = C.split(":");
                l(parseInt(g), E().trim());
            }
            w(null);
        }, J = (C, g)=>{
            C.key === "Enter" && g(), C.key === "Escape" && (_(null), w(null));
        };
        return (()=>{
            var C = rpt();
            return X(C, M(ge, {
                get when () {
                    return !h();
                },
                get fallback () {
                    return M(tpt, {
                        onBack: ()=>b(!1)
                    });
                },
                get children () {
                    var g = npt(), x = g.firstChild, A = x.firstChild, R = x.nextSibling, N = R.firstChild, L = N.firstChild;
                    return v2(A, "click", t.onBack, !0), X(N, M(tr, {
                        get each () {
                            return e();
                        },
                        children: (z)=>{
                            const B = ()=>z.id === n();
                            return (()=>{
                                var S = lpt(), O = S.firstChild, W = O.firstChild, F = W.firstChild, G = W.nextSibling, ee = G.firstChild, Q = O.nextSibling;
                                return X(F, ()=>z.name[0]), X(O, M(ge, {
                                    get when () {
                                        return y() !== z.id;
                                    },
                                    get fallback () {
                                        return (()=>{
                                            var Y = upt();
                                            return Y.addEventListener("blur", $), Y.addEventListener("keypress", (ae)=>J(ae, $)), Y.$$input = (ae)=>I(ae.currentTarget.value), mt(()=>Y.value = E()), Y;
                                        })();
                                    },
                                    get children () {
                                        var Y = spt(), ae = Y.firstChild, de = ae.nextSibling, pe = de.firstChild;
                                        return X(ae, ()=>z.name), X(de, ()=>z.accounts.length, pe), X(de, ()=>z.accounts.length !== 1 ? "s" : "", null), X(de, ()=>B() ? " · Active" : "", null), Y;
                                    }
                                }), G), X(G, M(ge, {
                                    get when () {
                                        return !B();
                                    },
                                    get children () {
                                        var Y = ipt();
                                        return Y.$$click = ()=>s(z.id), Y;
                                    }
                                }), ee), ee.$$click = ()=>K(z.id, z.name), X(G, M(ge, {
                                    get when () {
                                        return z.id !== 0;
                                    },
                                    get children () {
                                        return M(ge, {
                                            get when () {
                                                return D() !== z.id;
                                            },
                                            get fallback () {
                                                return (()=>{
                                                    var Y = dpt(), ae = Y.firstChild, de = ae.nextSibling;
                                                    return ae.$$click = ()=>U(null), de.$$click = async ()=>{
                                                        await a(z.id), U(null);
                                                    }, Y;
                                                })();
                                            },
                                            get children () {
                                                var Y = opt();
                                                return Y.$$click = ()=>U(z.id), Y;
                                            }
                                        });
                                    }
                                }), null), X(Q, M(tr, {
                                    get each () {
                                        return z.accounts.filter((Y)=>!Y.hidden);
                                    },
                                    children: (Y)=>{
                                        const ae = ()=>B() && Y.index === r(), de = ()=>`${z.id}:${Y.index}`;
                                        return (()=>{
                                            var pe = bpt(), Ae = pe.firstChild, Oe = Ae.nextSibling, Re = Oe.firstChild;
                                            return X(Ae, ()=>Y.index + 1), X(pe, M(ge, {
                                                get when () {
                                                    return v() !== de();
                                                },
                                                get fallback () {
                                                    return (()=>{
                                                        var Me = mpt();
                                                        return Me.addEventListener("blur", te), Me.addEventListener("keypress", (Je)=>J(Je, te)), Me.$$input = (Je)=>I(Je.currentTarget.value), mt(()=>Me.value = E()), Me;
                                                    })();
                                                },
                                                get children () {
                                                    var Me = hpt(), Je = Me.firstChild;
                                                    return X(Je, ()=>Y.name), X(Me, M(ge, {
                                                        get when () {
                                                            return ae();
                                                        },
                                                        get children () {
                                                            return fpt();
                                                        }
                                                    }), null), Me;
                                                }
                                            }), Oe), X(Oe, M(ge, {
                                                get when () {
                                                    return it(()=>!!B())() && !ae();
                                                },
                                                get children () {
                                                    var Me = ppt();
                                                    return Me.$$click = ()=>c(Y.index), Me;
                                                }
                                            }), Re), Re.$$click = ()=>ne(z.id, Y.index, Y.name), X(Oe, M(ge, {
                                                get when () {
                                                    return Y.index !== 0;
                                                },
                                                get children () {
                                                    var Me = gpt();
                                                    return Me.$$click = ()=>u(Y.index), Me;
                                                }
                                            }), null), mt((Me)=>{
                                                var Je = `flex items-center gap-3 px-4 py-2.5 pl-10 border-b border-border last:border-b-0 ${ae() ? "bg-brand-secondary" : ""}`, Ee = `w-6 h-6 rounded-sm flex items-center justify-center shrink-0 text-[10px] font-bold ${ae() ? "bg-foreground text-background" : "bg-muted text-content-muted-light"}`;
                                                return Je !== Me.e && Mt(pe, Me.e = Je), Ee !== Me.t && Mt(Ae, Me.t = Ee), Me;
                                            }, {
                                                e: void 0,
                                                t: void 0
                                            }), pe;
                                        })();
                                    }
                                }), null), X(Q, M(ge, {
                                    get when () {
                                        return B();
                                    },
                                    get children () {
                                        var Y = apt();
                                        return Y.$$click = ()=>i(), Y;
                                    }
                                }), null), X(Q, M(ge, {
                                    get when () {
                                        return z.accounts.some((Y)=>Y.hidden);
                                    },
                                    get children () {
                                        var Y = cpt(), ae = Y.firstChild, de = ae.firstChild, pe = de.nextSibling, Ae = pe.nextSibling;
                                        return ae.$$click = ()=>p(!f()), X(pe, (()=>{
                                            var Oe = it(()=>!!f());
                                            return ()=>Oe() ? "Hide" : `${z.accounts.filter((Re)=>Re.hidden).length} hidden account${z.accounts.filter((Re)=>Re.hidden).length !== 1 ? "s" : ""}`;
                                        })()), X(Y, M(ge, {
                                            get when () {
                                                return f();
                                            },
                                            get children () {
                                                return M(tr, {
                                                    get each () {
                                                        return z.accounts.filter((Oe)=>Oe.hidden);
                                                    },
                                                    children: (Oe)=>(()=>{
                                                            var Re = ypt(), Me = Re.firstChild, Je = Me.nextSibling, Ee = Je.nextSibling;
                                                            return X(Me, ()=>Oe.index + 1), X(Je, ()=>Oe.name), Ee.$$click = ()=>d(Oe.index), Re;
                                                        })()
                                                });
                                            }
                                        }), null), mt(()=>Qt(Ae, "class", `w-3 h-3 ml-auto transition-transform ${f() ? "rotate-180" : ""}`)), Y;
                                    }
                                }), null), mt((Y)=>{
                                    var ae = `bg-card rounded-sm border overflow-hidden ${B() ? "border-foreground" : "border-border"}`, de = `w-9 h-9 rounded-sm flex items-center justify-center shrink-0 ${B() ? "bg-white text-black dark:bg-white dark:text-black" : "bg-background text-content-muted"}`;
                                    return ae !== Y.e && Mt(S, Y.e = ae), de !== Y.t && Mt(W, Y.t = de), Y;
                                }, {
                                    e: void 0,
                                    t: void 0
                                }), S;
                            })();
                        }
                    }), L), L.$$click = ()=>b(!0), g;
                }
            })), C;
        })();
    };
    ci([
        "click",
        "input"
    ]);
    const _pt = "/assets/cardano-ada-logo-Di0wVzkC.svg";
    var xpt = se('<img alt=Cardano class="w-full h-full">'), vpt = se('<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)">'), Spt = se('<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">'), kpt = se('<i class="icon-box w-[30px] h-[30px] text-icon-muted shrink-0">'), Tpt = se('<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>'), Ept = se('<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 Cpt = "0000000000000000000000000000000000000000000000000000000000000000";
    function Ipt(t) {
        return t === "" ? "DUST" : t === Cpt ? "NIGHT" : t.length > 20 ? `${t.slice(0, 8)}...${t.slice(-8)}` : t;
    }
    const Apt = ()=>{
        const { environmentSettings: t } = Tr(), e = ()=>t().theme === "dark" ? l9 : Tw;
        return (()=>{
            var n = xpt();
            return mt(()=>Qt(n, "src", e())), n;
        })();
    }, Ppt = (t)=>{
        const { formatBalance: e } = Tr(), n = ()=>t.asset.walletType === "shielded", r = ()=>t.asset.walletType === "cardano", s = ()=>r() ? M(Apt, {}) : n() ? M(Tg, {}) : M(Eg, {}), i = ()=>r() ? (Number(t.asset.balance) / 1e6).toFixed(4) : e(t.asset.balance, 4, t.asset.token);
        return (()=>{
            var o = Spt(), a = o.firstChild, c = a.firstChild, l = c.firstChild, u = a.nextSibling, d = u.firstChild, f = d.firstChild, p = f.nextSibling, h = u.nextSibling, b = h.firstChild;
            return X(c, M(ge, {
                get when () {
                    return t.asset.token === "ADA";
                },
                get fallback () {
                    return (()=>{
                        var y = kpt();
                        return X(y, M(kw, {})), y;
                    })();
                },
                get children () {
                    var y = vpt(), _ = y.firstChild;
                    return Qt(_, "src", _pt), y;
                }
            }), l), X(l, ()=>Ipt(t.asset.token)), X(f, s), X(p, ()=>t.asset.walletType), X(b, i), mt(()=>Qt(l, "title", t.asset.token)), o;
        })();
    }, Opt = ()=>{
        const { shieldedBalances: t, unshieldedBalances: e, cardanoBalance: n, cardanoEnabled: r, environmentSettings: s } = Tr(), i = _t(()=>{
            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 (s().environment === "mainnet" && 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 = Tpt(), a = o.firstChild, c = a.firstChild, l = c.firstChild, u = l.nextSibling;
            return X(u, M(ge, {
                get when () {
                    return i().length > 0;
                },
                get fallback () {
                    return (()=>{
                        var d = Ept(), f = d.firstChild, p = f.firstChild, h = p.firstChild;
                        return X(h, M(kw, {})), d;
                    })();
                },
                get children () {
                    return M(tr, {
                        get each () {
                            return i();
                        },
                        children: (d)=>M(Ppt, {
                                asset: d
                            })
                    });
                }
            })), o;
        })();
    };
    var Mpt = se('<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)">'), Rpt = se('<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">'), Npt = se("<span class=text-[var(--text-warning-primary)]>Syncing..."), Vpt = se('<img alt=Cardano class="w-full h-full">'), Bpt = se('<div class="flex items-center gap-2 mt-1 px-3 py-1.5 bg-foreground/5 border border-[var(--border-secondary)]"><span class="text-xs text-content-muted">ADA</span><span class="text-sm font-medium text-foreground"style=font-family:var(--font-family-body)>'), Dpt = se('<article class="flex flex-col p-4 md:p-5 gap-1 md:border-r border-b border-[var(--border-secondary)] last:border-r-0"><div class="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">CARDANO BALANCE</span></div></div><div class="flex flex-col gap-1"><p class="type-display-xs md:type-display-xl font-semibold text-foreground"style=font-family:var(--font-family-body)></p><p class="text-xs text-content-muted">NIGHT on Cardano L1'), Fpt = se("<section>");
    const JU = (t)=>{
        const [e, n] = he(!1);
        return (()=>{
            var r = Rpt(), 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 X(r, M(ge, {
                get when () {
                    return t.shielded;
                },
                get children () {
                    return Mpt();
                }
            }), s), X(o, ()=>t.icon), X(a, ()=>t.title), c.$$click = ()=>n((p)=>!p), X(c, M(ge, {
                get when () {
                    return e();
                },
                fallback: "HIDE",
                children: "SHOW"
            }), l), X(l, M(ge, {
                get when () {
                    return e();
                },
                get fallback () {
                    return M(vft, {});
                },
                get children () {
                    return M(Sft, {});
                }
            })), X(d, (()=>{
                var p = it(()=>!!e());
                return ()=>p() ? "••••••" : t.amount;
            })()), X(f, (()=>{
                var p = it(()=>!!t.syncing);
                return ()=>p() ? Npt() : t.subtitle;
            })()), mt((p)=>{
                var h = e() ? "Show" : "Hide", b = e() ? "Show" : "Hide", y = `type-display-xs md:type-display-xl font-semibold ${t.syncing ? "text-foreground/30" : "text-foreground"} transition-colors duration-500`;
                return h !== p.e && Qt(c, "title", p.e = h), b !== p.t && Qt(c, "aria-label", p.t = b), y !== p.a && Mt(d, p.a = y), p;
            }, {
                e: void 0,
                t: void 0,
                a: void 0
            }), r;
        })();
    }, Lpt = ()=>{
        const { environmentSettings: t } = Tr(), e = ()=>t().theme === "dark" ? l9 : Tw;
        return (()=>{
            var n = Vpt();
            return mt(()=>Qt(n, "src", e())), n;
        })();
    }, zpt = ()=>{
        const { shieldedBalances: t, unshieldedBalances: e, formatBalance: n, environmentSettings: r, cardanoBalance: s, cardanoEnabled: i, isSynced: o } = Tr(), a = ()=>{
            let I = 0n;
            const D = t();
            for (const [U, K] of Object.entries(D))I += K;
            return I;
        }, c = ()=>{
            let I = 0n;
            for (const [D, U] of e().entries())I += U;
            return I;
        }, l = ()=>n(a()), u = ()=>n(c()), d = ()=>!o() && a() === 0n, f = ()=>!o() && c() === 0n, p = ()=>"NIGHT", { cardanoLoading: h, cardanoError: b } = Tr(), y = ()=>r().environment === "mainnet", _ = ()=>y() && i(), v = ()=>{
            if (h()) return "...";
            if (b()) return "Error";
            const I = s();
            return I ? (Number(I.night) / 1e6).toFixed(2) : "0.00";
        }, w = ()=>{
            const I = s();
            return !I || h() ? null : (Number(I.lovelace) / 1e6).toFixed(2);
        }, E = ()=>_() ? "grid-cols-1 md:grid-cols-3" : "grid-cols-1 md:grid-cols-2";
        return (()=>{
            var I = Fpt();
            return X(I, M(JU, {
                title: "SHIELDED BALANCE",
                get subtitle () {
                    return `Sum of all shielded ${p()} tokens`;
                },
                get icon () {
                    return M(Tg, {});
                },
                get amount () {
                    return l();
                },
                get syncing () {
                    return d();
                },
                shielded: !0
            }), null), X(I, M(JU, {
                title: "UNSHIELDED BALANCE",
                get subtitle () {
                    return `Sum of all unshielded ${p()} tokens`;
                },
                get icon () {
                    return M(Eg, {});
                },
                get amount () {
                    return u();
                },
                get syncing () {
                    return f();
                }
            }), null), X(I, M(ge, {
                get when () {
                    return _();
                },
                get children () {
                    var D = Dpt(), U = D.firstChild, K = U.firstChild, $ = K.firstChild, ne = U.nextSibling, te = ne.firstChild;
                    return te.nextSibling, X($, M(Lpt, {})), X(te, v), X(ne, M(ge, {
                        get when () {
                            return w();
                        },
                        get children () {
                            var J = Bpt(), C = J.firstChild, g = C.nextSibling;
                            return X(g, w), J;
                        }
                    }), null), D;
                }
            }), null), mt(()=>Mt(I, `grid ${E()} bg-[var(--bg-primary)]`)), I;
        })();
    };
    ci([
        "click"
    ]);
    var u9 = se("<li>"), Upt = se("<ul>"), Hpt = {};
    fu(Hpt, {
        Ellipsis: ()=>fM,
        Item: ()=>hM,
        Items: ()=>pM,
        Next: ()=>gM,
        Pagination: ()=>jpt,
        Previous: ()=>bM,
        Root: ()=>mM,
        usePaginationContext: ()=>Ew
    });
    function fM(t) {
        return (()=>{
            var e = u9();
            return X(e, M(yn, Le({
                as: "div"
            }, t))), e;
        })();
    }
    var lre = us();
    function Ew() {
        const t = ds(lre);
        if (t === void 0) throw new Error("[kobalte]: `usePaginationContext` must be used within a `Pagination` component");
        return t;
    }
    function hM(t) {
        const e = Ew(), [n, r] = Ze(t, [
            "page",
            "onClick"
        ]), s = ()=>e.page() === n.page, i = ()=>{
            e.setPage(n.page);
        };
        return (()=>{
            var o = u9();
            return X(o, M(zc, Le({
                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 pM(t) {
        const e = Ew(), n = _t(()=>{
            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()), b = Math.min(r() - i(), s());
            if (o() !== !1) {
                const y = h, _ = b;
                h += Math.max(s() - _, 0), b += Math.max(s() - y, 0), u || b++, d || h++, o() === !0 && (f || b++, p || h++), i() - h - (a() ? 2 : 1) === 1 && (f = !1, h++), r() - i() - b - (c() ? 1 : 0) === 1 && (p = !1, b++);
            }
            return {
                showFirst: u,
                showLast: d,
                showFirstEllipsis: f,
                showLastEllipsis: p,
                previousSiblingCount: h,
                nextSiblingCount: b,
                renderItemsDirectly: l
            };
        });
        return M(ge, {
            get when () {
                return n().renderItemsDirectly;
            },
            get fallback () {
                return [
                    M(ge, {
                        get when () {
                            return n().showFirst;
                        },
                        get children () {
                            return e.renderItem(1);
                        }
                    }),
                    M(ge, {
                        get when () {
                            return n().showFirstEllipsis;
                        },
                        get children () {
                            return e.renderEllipsis();
                        }
                    }),
                    M(tr, {
                        get each () {
                            return [
                                ...Array(n().previousSiblingCount).keys()
                            ].reverse();
                        },
                        children: (r)=>it(()=>e.renderItem(e.page() - (r + 1)))
                    }),
                    it(()=>e.renderItem(e.page())),
                    M(tr, {
                        get each () {
                            return [
                                ...Array(n().nextSiblingCount).keys()
                            ];
                        },
                        children: (r)=>it(()=>e.renderItem(e.page() + (r + 1)))
                    }),
                    M(ge, {
                        get when () {
                            return n().showLastEllipsis;
                        },
                        get children () {
                            return e.renderEllipsis();
                        }
                    }),
                    M(ge, {
                        get when () {
                            return n().showLast;
                        },
                        get children () {
                            return e.renderItem(e.count());
                        }
                    })
                ];
            },
            get children () {
                return M(tr, {
                    get each () {
                        return [
                            ...Array(e.count()).keys()
                        ];
                    },
                    children: (r)=>it(()=>e.renderItem(r + 1))
                });
            }
        });
    }
    function gM(t) {
        const e = Ew(), [n, r] = Ze(t, [
            "onClick"
        ]), s = ()=>{
            e.setPage(e.page() + 1);
        }, i = ()=>e.page() === e.count();
        return (()=>{
            var o = u9();
            return X(o, M(zc, Le({
                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 bM(t) {
        const e = Ew(), [n, r] = Ze(t, [
            "onClick"
        ]), s = ()=>{
            e.setPage(e.page() - 1);
        }, i = ()=>e.page() === 1;
        return (()=>{
            var o = u9();
            return X(o, M(zc, Le({
                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 mM(t) {
        const e = `pagination-${ai()}`, n = zt({
            id: e
        }, t), [r, s] = Ze(n, [
            "page",
            "defaultPage",
            "onPageChange",
            "count",
            "siblingCount",
            "showFirst",
            "showLast",
            "fixedItems",
            "itemComponent",
            "ellipsisComponent",
            "disabled",
            "children"
        ]), i = _p({
            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 M(lre.Provider, {
            value: o,
            get children () {
                return M(yn, Le({
                    as: "nav",
                    get "data-disabled" () {
                        return r.disabled ? "" : void 0;
                    }
                }, s, {
                    get children () {
                        var a = Upt();
                        return X(a, ()=>r.children), a;
                    }
                }));
            }
        });
    }
    var jpt = Object.assign(mM, {
        Ellipsis: fM,
        Item: hM,
        Items: pM,
        Next: gM,
        Previous: bM
    }), qpt = se('<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>'), Kpt = se("<span class=sr-only>More pages"), Wpt = se('<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">'), $pt = se("<span>Previous"), Xpt = se("<span>Next"), Gpt = se('<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 Zpt = pM, Jpt = (t)=>{
        const [e, n] = Ze(t, [
            "class"
        ]);
        return M(mM, Le({
            get class () {
                return vn("[&>*]:flex [&>*]:flex-row [&>*]:items-center [&>*]:gap-1", e.class);
            }
        }, n));
    }, Ypt = (t)=>{
        const [e, n] = Ze(t, [
            "class"
        ]);
        return M(hM, Le({
            get class () {
                return vn(X5({
                    variant: "ghost"
                }), "size-10 data-[current]:border", e.class);
            }
        }, n));
    }, Qpt = (t)=>{
        const [e, n] = Ze(t, [
            "class"
        ]);
        return M(fM, Le({
            get class () {
                return vn("flex size-10 items-center justify-center", e.class);
            }
        }, n, {
            get children () {
                return [
                    qpt(),
                    Kpt()
                ];
            }
        }));
    }, e0t = (t)=>{
        const [e, n] = Ze(t, [
            "class",
            "children"
        ]);
        return M(bM, Le({
            get class () {
                return vn(X5({
                    variant: "ghost"
                }), "gap-1 pl-2.5", e.class);
            }
        }, n, {
            get children () {
                return M(ge, {
                    get when () {
                        return e.children;
                    },
                    get fallback () {
                        return [
                            Wpt(),
                            $pt()
                        ];
                    },
                    children: (r)=>r()
                });
            }
        }));
    }, t0t = (t)=>{
        const [e, n] = Ze(t, [
            "class",
            "children"
        ]);
        return M(gM, Le({
            get class () {
                return vn(X5({
                    variant: "ghost"
                }), "gap-1 pl-2.5", e.class);
            }
        }, n, {
            get children () {
                return M(ge, {
                    get when () {
                        return e.children;
                    },
                    get fallback () {
                        return [
                            Xpt(),
                            Gpt()
                        ];
                    },
                    children: (r)=>r()
                });
            }
        }));
    };
    var n0t = se('<span class="text-[10px] font-normal text-content-muted font-mono truncate">'), r0t = se('<span class="text-[10px] text-content-muted-light truncate">'), s0t = se('<span class="text-[10px] text-[var(--text-error-primary)] truncate">'), i0t = se('<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"><span class="text-xs font-normal text-foreground font-mono truncate"></span></div></td><td class="py-3 px-4 md:px-8 align-middle text-right">'), o0t = se('<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="inline-flex items-center gap-2"><i class="icon-box w-3.5 h-3.5 text-icon-muted">'), a0t = se('<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 '), c0t = se('<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-4 md:px-8 text-left text-xs font-medium text-content-muted font-mono">TRANSACTION</th><th class="py-3 px-4 md:px-8 text-left text-xs font-medium text-content-muted font-mono">METHOD</th><th class="py-3 px-4 md:px-8 w-[143px]"></th></tr></thead><tbody>'), l0t = se('<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');
    function u0t(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 d0t(t) {
        const e = t.reduce((n, r)=>n + r.net, 0n);
        return e > 0n ? "receive" : e < 0n ? "send" : "self";
    }
    const f0t = {
        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"
        }
    }, h0t = {
        SUCCESS: {
            tone: "success",
            label: "Success"
        },
        FAILURE: {
            tone: "error",
            label: "Failed"
        },
        PARTIAL_SUCCESS: {
            tone: "warning",
            label: "Partial"
        }
    };
    function p0t(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 g0t(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 iE(t) {
        return t.length <= 16 ? t : `${t.slice(0, 8)}...${t.slice(-8)}`;
    }
    const b0t = (t)=>{
        const { environmentSettings: e } = Tr(), n = ()=>{
            switch(t.transaction.status){
                case "submitting":
                    return {
                        label: "Submitting",
                        tone: "warning",
                        icon: "dot"
                    };
                case "pending":
                    return {
                        label: "Pending",
                        tone: "warning",
                        icon: "dot"
                    };
                case "failed":
                    return {
                        label: "Failed",
                        tone: "error",
                        icon: "none"
                    };
                case "confirmed":
                    return {
                        label: "Confirmed",
                        tone: "success",
                        icon: "none"
                    };
            }
        }, r = ()=>{
            if (!t.transaction.txHash) return;
            const s = Mr[e().environment], i = FO(s.explorerBaseUrl, t.transaction.txHash, e().environment);
            i && (chrome.tabs?.create?.({
                url: i
            }) ?? window.open(i, "_blank"));
        };
        return (()=>{
            var s = i0t(), i = s.firstChild, o = i.firstChild, a = o.firstChild, c = a.nextSibling, l = c.firstChild, u = i.nextSibling, d = u.firstChild, f = d.firstChild, p = u.nextSibling;
            return s.$$click = r, X(a, M(kw, {})), X(l, ()=>p0t(new Date(t.transaction.createdAt))), X(c, M(ge, {
                get when () {
                    return t.transaction.txHash;
                },
                get children () {
                    var h = n0t();
                    return X(h, ()=>iE(t.transaction.txHash)), mt(()=>Qt(h, "title", t.transaction.txHash)), h;
                }
            }), null), X(f, (()=>{
                var h = it(()=>t.transaction.type === "send");
                return ()=>h() ? "Send" : it(()=>t.transaction.type === "dapp")() ? "DApp" : t.transaction.type;
            })()), X(d, M(ge, {
                get when () {
                    return it(()=>t.transaction.type === "dapp")() && t.transaction.recipientAddress;
                },
                get children () {
                    var h = r0t();
                    return X(h, ()=>t.transaction.recipientAddress), h;
                }
            }), null), X(d, M(ge, {
                get when () {
                    return t.transaction.error;
                },
                get children () {
                    var h = s0t();
                    return X(h, ()=>(t.transaction.error || "").replace(/[<>&"']/g, "").slice(0, 120)), h;
                }
            }), null), X(p, M(m0, {
                get tone () {
                    return n().tone;
                },
                variant: "color",
                size: "sm",
                get icon () {
                    return n().icon;
                },
                class: "uppercase tracking-wide",
                get children () {
                    return n().label;
                }
            })), mt(()=>Mt(s, `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"}`)), s;
        })();
    }, m0t = (t)=>{
        const { formatBalance: e, environmentSettings: n } = Tr(), r = _t(()=>u0t(t.transaction)), s = _t(()=>d0t(r())), i = ()=>f0t[s()], o = ()=>h0t[t.transaction.status], a = ()=>{
            const l = Mr[n().environment];
            return FO(l.explorerBaseUrl, t.transaction.hash, n().environment);
        }, c = ()=>{
            const l = a();
            l && (chrome.tabs?.create?.({
                url: l
            }) ?? window.open(l, "_blank"));
        };
        return (()=>{
            var l = o0t(), u = l.firstChild, d = u.firstChild, f = d.firstChild, p = f.nextSibling, h = p.firstChild, b = h.nextSibling, y = u.nextSibling, _ = y.firstChild, v = _.firstChild, w = v.nextSibling, E = w.firstChild, I = E.nextSibling, D = y.nextSibling, U = D.firstChild, K = U.firstChild;
            return l.$$click = c, X(f, M(kw, {})), X(h, ()=>g0t(t.transaction.timestamp)), X(b, ()=>iE(t.transaction.hash)), X(v, M(ire, {})), X(E, ()=>i().label), X(I, ()=>iE(t.transaction.hash)), X(U, M(m0, {
                get tone () {
                    return o().tone;
                },
                variant: "color",
                size: "sm",
                class: "uppercase tracking-wide",
                get children () {
                    return o().label;
                }
            }), K), X(K, M(yft, {})), mt(($)=>{
                var ne = t.transaction.hash, te = t.transaction.hash;
                return ne !== $.e && Qt(b, "title", $.e = ne), te !== $.t && Qt(I, "title", $.t = te), $;
            }, {
                e: void 0,
                t: void 0
            }), l;
        })();
    }, y0t = ()=>{
        const { paginatedTransactions: t, totalTransactions: e, currentPage: n, totalPages: r, setCurrentPage: s, pendingTransactions: i } = Tr(), o = _t(()=>i().filter((l)=>l.type === "dapp")), a = _t(()=>i().filter((l)=>l.status === "submitting" || l.status === "pending" || l.status === "failed")), c = _t(()=>{
            const l = [
                ...o().map((u)=>({
                        kind: "pending",
                        data: u,
                        time: u.createdAt
                    })),
                ...a().filter((u)=>u.type !== "dapp").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 = c0t(), u = l.firstChild, d = u.firstChild, f = d.firstChild, p = f.nextSibling;
            return X(p, M(ge, {
                get when () {
                    return c().length > 0;
                },
                get fallback () {
                    return (()=>{
                        var h = l0t(), b = h.firstChild, y = b.firstChild, _ = y.firstChild;
                        return X(_, M(kw, {})), h;
                    })();
                },
                get children () {
                    return M(tr, {
                        get each () {
                            return c();
                        },
                        children: (h)=>h.kind === "pending" ? M(b0t, {
                                get transaction () {
                                    return h.data;
                                }
                            }) : M(m0t, {
                                get transaction () {
                                    return h.data;
                                }
                            })
                    });
                }
            })), X(u, M(ge, {
                get when () {
                    return r() > 1;
                },
                get children () {
                    var h = a0t(), b = h.firstChild, y = b.firstChild, _ = y.nextSibling;
                    return _.nextSibling, X(b, n, _), X(b, r, null), X(h, M(Jpt, {
                        get count () {
                            return r();
                        },
                        get page () {
                            return n();
                        },
                        onPageChange: s,
                        itemComponent: (v)=>M(Ypt, {
                                get page () {
                                    return v.page;
                                },
                                get children () {
                                    return v.page;
                                }
                            }),
                        ellipsisComponent: ()=>M(Qpt, {}),
                        siblingCount: 1,
                        fixedItems: !0,
                        class: "mx-0 w-auto",
                        get children () {
                            return [
                                M(e0t, {}),
                                M(Zpt, {}),
                                M(t0t, {})
                            ];
                        }
                    }), null), h;
                }
            }), null), l;
        })();
    };
    ci([
        "click"
    ]);
    var w0t = {};
    fu(w0t, {
        CloseButton: ()=>Cw,
        Content: ()=>yM,
        Description: ()=>wM,
        Dialog: ()=>_0t,
        Overlay: ()=>_M,
        Portal: ()=>xM,
        Root: ()=>vM,
        Title: ()=>SM,
        Trigger: ()=>kM,
        useDialogContext: ()=>af
    });
    var ure = us();
    function af() {
        const t = ds(ure);
        if (t === void 0) throw new Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");
        return t;
    }
    function Cw(t) {
        const e = af(), [n, r] = Ze(t, [
            "aria-label",
            "onClick"
        ]);
        return M(zc, Le({
            get "aria-label" () {
                return n["aria-label"] || e.translations().dismiss;
            },
            onClick: (i)=>{
                Fn(i, n.onClick), e.close();
            }
        }, r));
    }
    function yM(t) {
        let e;
        const n = af(), r = zt({
            id: n.generateId("content")
        }, t), [s, i] = Ze(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)), po(n.triggerRef(), f.target) && f.preventDefault(), f.detail.originalEvent.type === "focusin" && a && f.preventDefault());
        }, d = (f)=>{
            s.onCloseAutoFocus?.(f), n.modal() ? (f.preventDefault(), Lr(n.triggerRef())) : (f.defaultPrevented || (o || Lr(n.triggerRef()), f.preventDefault()), o = !1, a = !1);
        };
        return QO({
            isDisabled: ()=>!(n.isOpen() && n.modal()),
            targets: ()=>e ? [
                    e
                ] : []
        }), tM({
            element: ()=>e ?? null,
            enabled: ()=>n.contentPresent() && n.preventScroll()
        }), YO({
            trapFocus: ()=>n.isOpen() && n.modal(),
            onMountAutoFocus: s.onOpenAutoFocus,
            onUnmountAutoFocus: d
        }, ()=>e), ot(()=>At(n.registerContentId(i.id))), M(ge, {
            get when () {
                return n.contentPresent();
            },
            get children () {
                return M(eM, Le({
                    ref (f) {
                        var p = ir((h)=>{
                            n.setContentRef(h), e = h;
                        }, s.ref);
                        typeof p == "function" && p(f);
                    },
                    role: "dialog",
                    tabIndex: -1,
                    get disableOutsidePointerEvents () {
                        return it(()=>!!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 wM(t) {
        const e = af(), n = zt({
            id: e.generateId("description")
        }, t), [r, s] = Ze(n, [
            "id"
        ]);
        return ot(()=>At(e.registerDescriptionId(r.id))), M(yn, Le({
            as: "p",
            get id () {
                return r.id;
            }
        }, s));
    }
    function _M(t) {
        const e = af(), [n, r] = Ze(t, [
            "ref",
            "style",
            "onPointerDown"
        ]), s = (i)=>{
            Fn(i, n.onPointerDown), i.target === i.currentTarget && i.preventDefault();
        };
        return M(ge, {
            get when () {
                return e.overlayPresent();
            },
            get children () {
                return M(yn, Le({
                    as: "div",
                    ref (i) {
                        var o = ir(e.setOverlayRef, n.ref);
                        typeof o == "function" && o(i);
                    },
                    get style () {
                        return Pg({
                            "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 xM(t) {
        const e = af();
        return M(ge, {
            get when () {
                return e.contentPresent() || e.overlayPresent();
            },
            get children () {
                return M(dE, t);
            }
        });
    }
    var YU = {
        dismiss: "Dismiss"
    };
    function vM(t) {
        const e = `dialog-${ai()}`, n = zt({
            id: e,
            modal: !0,
            translations: YU
        }, t), [r, s] = he(), [i, o] = he(), [a, c] = he(), [l, u] = he(), [d, f] = he(), [p, h] = he(), b = o9({
            open: ()=>n.open,
            defaultOpen: ()=>n.defaultOpen,
            onOpenChange: (E)=>n.onOpenChange?.(E)
        }), y = ()=>n.forceMount || b.isOpen(), { present: _ } = e1({
            show: y,
            element: ()=>l() ?? null
        }), { present: v } = e1({
            show: y,
            element: ()=>d() ?? null
        }), w = {
            translations: ()=>n.translations ?? YU,
            isOpen: b.isOpen,
            modal: ()=>n.modal ?? !0,
            preventScroll: ()=>n.preventScroll ?? w.modal(),
            contentId: r,
            titleId: i,
            descriptionId: a,
            triggerRef: p,
            overlayRef: l,
            setOverlayRef: u,
            contentRef: d,
            setContentRef: f,
            overlayPresent: _,
            contentPresent: v,
            close: b.close,
            toggle: b.toggle,
            setTriggerRef: h,
            generateId: du(()=>n.id),
            registerContentId: Ks(s),
            registerTitleId: Ks(o),
            registerDescriptionId: Ks(c)
        };
        return M(ure.Provider, {
            value: w,
            get children () {
                return n.children;
            }
        });
    }
    function SM(t) {
        const e = af(), n = zt({
            id: e.generateId("title")
        }, t), [r, s] = Ze(n, [
            "id"
        ]);
        return ot(()=>At(e.registerTitleId(r.id))), M(yn, Le({
            as: "h2",
            get id () {
                return r.id;
            }
        }, s));
    }
    function kM(t) {
        const e = af(), [n, r] = Ze(t, [
            "ref",
            "onClick"
        ]);
        return M(zc, Le({
            ref (i) {
                var o = ir(e.setTriggerRef, n.ref);
                typeof o == "function" && o(i);
            },
            "aria-haspopup": "dialog",
            get "aria-expanded" () {
                return e.isOpen();
            },
            get "aria-controls" () {
                return it(()=>!!e.isOpen())() ? e.contentId() : void 0;
            },
            get "data-expanded" () {
                return e.isOpen() ? "" : void 0;
            },
            get "data-closed" () {
                return e.isOpen() ? void 0 : "";
            },
            onClick: (i)=>{
                Fn(i, n.onClick), e.toggle();
            }
        }, r));
    }
    var _0t = Object.assign(vM, {
        CloseButton: Cw,
        Content: yM,
        Description: wM,
        Overlay: _M,
        Portal: xM,
        Title: SM,
        Trigger: kM
    }), x0t = se("<option>"), v0t = se("<div aria-hidden=true><input type=text style=font-size:16px><select tabindex=-1><option>");
    function S0t(t) {
        let e;
        const [n, r] = Ze(t, [
            "ref",
            "onChange",
            "collection",
            "selectionManager",
            "isOpen",
            "isMultiple",
            "isVirtualized",
            "focusTrigger"
        ]), s = of(), [i, o] = he(!1), a = (c)=>{
            const l = n.collection.getItem(c);
            return M(ge, {
                get when () {
                    return l?.type === "item";
                },
                get children () {
                    var u = x0t();
                    return u.value = c, X(u, ()=>l?.textValue), mt(()=>u.selected = n.selectionManager.isSelected(c)), u;
                }
            });
        };
        return ot(Gi(()=>n.selectionManager.selectedKeys(), (c, l)=>{
            l && fne(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 = v0t(), l = c.firstChild, u = l.nextSibling;
            u.firstChild, l.addEventListener("focus", ()=>n.focusTrigger()), u.addEventListener("change", (f)=>{
                Fn(f, n.onChange), i() || n.selectionManager.setSelectedKeys(new Set([
                    f.target.value
                ])), o(!1);
            });
            var d = ir((f)=>e = f, n.ref);
            return typeof d == "function" && w6(d, u), vv(u, Le({
                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), X(u, M(ge, {
                get when () {
                    return n.isVirtualized;
                },
                get fallback () {
                    return M(tr, {
                        get each () {
                            return [
                                ...n.collection.getKeys()
                            ];
                        },
                        children: a
                    });
                },
                get children () {
                    return M(tr, {
                        get each () {
                            return [
                                ...n.selectionManager.selectedKeys()
                            ];
                        },
                        children: a
                    });
                }
            }), null), mt((f)=>{
                var p = dj, h = n.selectionManager.isFocused() || n.isOpen ? -1 : 0, b = s.isRequired(), y = s.isDisabled(), _ = s.isReadOnly();
                return f.e = gH(c, p, f.e), h !== f.t && Qt(l, "tabindex", f.t = h), b !== f.a && (l.required = f.a = b), y !== f.o && (l.disabled = f.o = y), _ !== f.i && (l.readOnly = f.i = _), f;
            }, {
                e: void 0,
                t: void 0,
                a: void 0,
                o: void 0,
                i: void 0
            }), c;
        })();
    }
    var QU = new WeakMap;
    function k0t(t) {
        let e = QU.get(t);
        if (e != null) return e;
        e = 0;
        for (const n of t)n.type === "item" && e++;
        return QU.set(t, e), e;
    }
    var T0t = {};
    fu(T0t, {
        Item: ()=>Iw,
        ItemDescription: ()=>d9,
        ItemIndicator: ()=>Aw,
        ItemLabel: ()=>Pw,
        Listbox: ()=>E0t,
        Root: ()=>EM,
        Section: ()=>f9,
        useListboxContext: ()=>fre
    });
    var dre = us();
    function fre() {
        const t = ds(dre);
        if (t === void 0) throw new Error("[kobalte]: `useListboxContext` must be used within a `Listbox` component");
        return t;
    }
    var hre = us();
    function TM() {
        const t = ds(hre);
        if (t === void 0) throw new Error("[kobalte]: `useListboxItemContext` must be used within a `Listbox.Item` component");
        return t;
    }
    function Iw(t) {
        let e;
        const n = fre(), r = `${n.generateId("item")}-${ai()}`, s = zt({
            id: r
        }, t), [i, o] = Ze(s, [
            "ref",
            "item",
            "aria-label",
            "aria-labelledby",
            "aria-describedby",
            "onPointerMove",
            "onPointerDown",
            "onPointerUp",
            "onClick",
            "onKeyDown",
            "onMouseDown",
            "onFocus"
        ]), [a, c] = he(), [l, u] = he(), d = ()=>n.listState().selectionManager(), f = ()=>d().focusedKey() === i.item.key, p = Q5({
            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();
        }, b = _t(()=>!(a1() && oj())), y = ()=>b() ? i["aria-label"] : void 0, _ = ()=>b() ? a() : void 0, v = ()=>b() ? l() : void 0, w = ()=>{
            if (!n.isVirtualized()) return;
            const K = n.listState().collection().getItem(i.item.key)?.index;
            return K != null ? K + 1 : void 0;
        }, E = ()=>{
            if (n.isVirtualized()) return k0t(n.listState().collection());
        }, I = (K)=>{
            Fn(K, i.onPointerMove), K.pointerType === "mouse" && !p.isDisabled() && n.shouldFocusOnHover() && (Lr(K.currentTarget), d().setFocused(!0), d().setFocusedKey(i.item.key));
        }, D = _t(()=>({
                "data-disabled": p.isDisabled() ? "" : void 0,
                "data-selected": p.isSelected() ? "" : void 0,
                "data-highlighted": f() ? "" : void 0
            })), U = {
            isSelected: p.isSelected,
            dataset: D,
            generateId: du(()=>o.id),
            registerLabelId: Ks(c),
            registerDescriptionId: Ks(u)
        };
        return M(hre.Provider, {
            value: U,
            get children () {
                return M(yn, Le({
                    as: "li",
                    ref (K) {
                        var $ = ir((ne)=>e = ne, i.ref);
                        typeof $ == "function" && $(K);
                    },
                    role: "option",
                    get tabIndex () {
                        return p.tabIndex();
                    },
                    get "aria-disabled" () {
                        return p.isDisabled();
                    },
                    get "aria-selected" () {
                        return h();
                    },
                    get "aria-label" () {
                        return y();
                    },
                    get "aria-labelledby" () {
                        return _();
                    },
                    get "aria-describedby" () {
                        return v();
                    },
                    get "aria-posinset" () {
                        return w();
                    },
                    get "aria-setsize" () {
                        return E();
                    },
                    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: I
                }, D, o));
            }
        });
    }
    function d9(t) {
        const e = TM(), n = zt({
            id: e.generateId("description")
        }, t);
        return ot(()=>At(e.registerDescriptionId(n.id))), M(yn, Le({
            as: "div"
        }, ()=>e.dataset(), n));
    }
    function Aw(t) {
        const e = TM(), n = zt({
            id: e.generateId("indicator")
        }, t), [r, s] = Ze(n, [
            "forceMount"
        ]);
        return M(ge, {
            get when () {
                return r.forceMount || e.isSelected();
            },
            get children () {
                return M(yn, Le({
                    as: "div",
                    "aria-hidden": "true"
                }, ()=>e.dataset(), s));
            }
        });
    }
    function Pw(t) {
        const e = TM(), n = zt({
            id: e.generateId("label")
        }, t);
        return ot(()=>At(e.registerLabelId(n.id))), M(yn, Le({
            as: "div"
        }, ()=>e.dataset(), n));
    }
    function EM(t) {
        let e;
        const n = `listbox-${ai()}`, r = zt({
            id: n,
            selectionMode: "single",
            virtualized: !1
        }, t), [s, i] = Ze(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 = _t(()=>s.state ? s.state : e9({
                selectedKeys: ()=>s.value,
                defaultSelectedKeys: ()=>s.defaultValue,
                onSelectionChange: s.onChange,
                allowDuplicateSelectionEvents: ()=>ke(s.allowDuplicateSelectionEvents),
                disallowEmptySelection: ()=>ke(s.disallowEmptySelection),
                selectionBehavior: ()=>ke(s.selectionBehavior),
                selectionMode: ()=>ke(s.selectionMode),
                dataSource: ()=>s.options ?? [],
                getKey: ()=>s.optionValue,
                getTextValue: ()=>s.optionTextValue,
                getDisabled: ()=>s.optionDisabled,
                getSectionChildren: ()=>s.optionGroupChildren
            })), a = Nne({
            selectionManager: ()=>o().selectionManager(),
            collection: ()=>o().collection(),
            autoFocus: ()=>ke(s.autoFocus),
            shouldFocusWrap: ()=>ke(s.shouldFocusWrap),
            keyboardDelegate: ()=>s.keyboardDelegate,
            disallowEmptySelection: ()=>ke(s.disallowEmptySelection),
            selectOnFocus: ()=>ke(s.selectOnFocus),
            disallowTypeAhead: ()=>ke(s.disallowTypeAhead),
            shouldUseVirtualFocus: ()=>ke(s.shouldUseVirtualFocus),
            allowsTabNavigation: ()=>ke(s.allowsTabNavigation),
            isVirtualized: ()=>s.virtualized,
            scrollToKey: ()=>s.scrollToItem
        }, ()=>e, ()=>s.scrollRef?.()), c = {
            listState: o,
            generateId: du(()=>i.id),
            shouldUseVirtualFocus: ()=>r.shouldUseVirtualFocus,
            shouldSelectOnPressUp: ()=>r.shouldSelectOnPressUp,
            shouldFocusOnHover: ()=>r.shouldFocusOnHover,
            isVirtualized: ()=>s.virtualized
        };
        return M(dre.Provider, {
            value: c,
            get children () {
                return M(yn, Le({
                    as: "ul",
                    ref (l) {
                        var u = ir((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 M(ge, {
                            get when () {
                                return !s.virtualized;
                            },
                            get fallback () {
                                return s.children?.(o().collection);
                            },
                            get children () {
                                return M(Oie, {
                                    get each () {
                                        return [
                                            ...o().collection()
                                        ];
                                    },
                                    by: "key",
                                    children: (l)=>M(fE, {
                                            get children () {
                                                return [
                                                    M(Jf, {
                                                        get when () {
                                                            return l().type === "section";
                                                        },
                                                        get children () {
                                                            return s.renderSection?.(l());
                                                        }
                                                    }),
                                                    M(Jf, {
                                                        get when () {
                                                            return l().type === "item";
                                                        },
                                                        get children () {
                                                            return s.renderItem?.(l());
                                                        }
                                                    })
                                                ];
                                            }
                                        })
                                });
                            }
                        });
                    }
                }));
            }
        });
    }
    function f9(t) {
        return M(yn, Le({
            as: "li",
            role: "presentation"
        }, t));
    }
    var E0t = Object.assign(EM, {
        Item: Iw,
        ItemDescription: d9,
        ItemIndicator: Aw,
        ItemLabel: Pw,
        Section: f9
    }), C0t = {};
    fu(C0t, {
        Arrow: ()=>Sw,
        Content: ()=>CM,
        Description: ()=>G5,
        ErrorMessage: ()=>J5,
        HiddenSelect: ()=>gre,
        Icon: ()=>IM,
        Item: ()=>Iw,
        ItemDescription: ()=>d9,
        ItemIndicator: ()=>Aw,
        ItemLabel: ()=>Pw,
        Label: ()=>bre,
        Listbox: ()=>AM,
        Portal: ()=>PM,
        Root: ()=>OM,
        Section: ()=>f9,
        Select: ()=>P0t,
        Trigger: ()=>MM,
        Value: ()=>RM,
        useSelectContext: ()=>Su
    });
    var pre = us();
    function Su() {
        const t = ds(pre);
        if (t === void 0) throw new Error("[kobalte]: `useSelectContext` must be used within a `Select` component");
        return t;
    }
    function CM(t) {
        let e;
        const n = Su(), [r, s] = Ze(t, [
            "ref",
            "style",
            "onCloseAutoFocus",
            "onFocusOutside"
        ]), i = (a)=>{
            n.close();
        }, o = (a)=>{
            r.onFocusOutside?.(a), n.isOpen() && n.isModal() && a.preventDefault();
        };
        return QO({
            isDisabled: ()=>!(n.isOpen() && n.isModal()),
            targets: ()=>e ? [
                    e
                ] : []
        }), tM({
            element: ()=>e ?? null,
            enabled: ()=>n.contentPresent() && n.preventScroll()
        }), YO({
            trapFocus: ()=>n.isOpen() && n.isModal(),
            onMountAutoFocus: (a)=>{
                a.preventDefault();
            },
            onUnmountAutoFocus: (a)=>{
                r.onCloseAutoFocus?.(a), a.defaultPrevented || (Lr(n.triggerRef()), a.preventDefault());
            }
        }, ()=>e), M(ge, {
            get when () {
                return n.contentPresent();
            },
            get children () {
                return M(i9.Positioner, {
                    get children () {
                        return M(eM, Le({
                            ref (a) {
                                var c = ir((l)=>{
                                    n.setContentRef(l), e = l;
                                }, r.ref);
                                typeof c == "function" && c(a);
                            },
                            get disableOutsidePointerEvents () {
                                return it(()=>!!n.isModal())() && n.isOpen();
                            },
                            get excludedElements () {
                                return [
                                    n.triggerRef
                                ];
                            },
                            get style () {
                                return Pg({
                                    "--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 gre(t) {
        const e = Su();
        return M(S0t, Le({
            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 IM(t) {
        const e = Su(), n = zt({
            children: "▼"
        }, t);
        return M(yn, Le({
            as: "span",
            "aria-hidden": "true"
        }, ()=>e.dataset(), n));
    }
    function bre(t) {
        const e = Su(), [n, r] = Ze(t, [
            "onClick"
        ]);
        return M(Z5, Le({
            as: "span",
            onClick: (i)=>{
                Fn(i, n.onClick), e.isDisabled() || e.triggerRef()?.focus();
            }
        }, r));
    }
    function AM(t) {
        const e = Su(), n = zt({
            id: e.generateId("listbox")
        }, t), [r, s] = Ze(n, [
            "ref",
            "id",
            "onKeyDown"
        ]);
        return ot(()=>At(e.registerListboxId(r.id))), M(EM, Le({
            ref (o) {
                var a = ir(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)=>{
                Fn(o, r.onKeyDown), o.key === "Escape" && o.preventDefault();
            }
        }, s));
    }
    function PM(t) {
        const e = Su();
        return M(ge, {
            get when () {
                return e.contentPresent();
            },
            get children () {
                return M(dE, t);
            }
        });
    }
    function I0t(t) {
        const e = `select-${ai()}`, n = zt({
            id: e,
            selectionMode: "single",
            disallowEmptySelection: !1,
            closeOnSelection: t.selectionMode === "single",
            allowDuplicateSelectionEvents: !0,
            gutter: 8,
            sameWidth: !0,
            modal: !1
        }, t), [r, s, i, o] = Ze(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"
        ], Wte), [a, c] = he(), [l, u] = he(), [d, f] = he(), [p, h] = he(), [b, y] = he(), [_, v] = he(), [w, E] = he(), [I, D] = he(!0), U = (ee)=>{
            const Q = r.optionValue;
            return Q == null ? String(ee) : String(IE(Q) ? Q(ee) : ee[Q]);
        }, K = _t(()=>{
            const ee = r.optionGroupChildren;
            return ee == null ? r.options : r.options.flatMap((Q)=>Q[ee] ?? Q);
        }), $ = _t(()=>K().map((ee)=>U(ee))), ne = (ee)=>[
                ...ee
            ].map((Q)=>K().find((Y)=>U(Y) === Q)).filter((Q)=>Q != null), te = o9({
            open: ()=>r.open,
            defaultOpen: ()=>r.defaultOpen,
            onOpenChange: (ee)=>r.onOpenChange?.(ee)
        }), J = e9({
            selectedKeys: ()=>r.value != null ? r.value.map(U) : r.value,
            defaultSelectedKeys: ()=>r.defaultValue != null ? r.defaultValue.map(U) : r.defaultValue,
            onSelectionChange: (ee)=>{
                r.onChange?.(ne(ee)), r.closeOnSelection && N();
            },
            allowDuplicateSelectionEvents: ()=>ke(r.allowDuplicateSelectionEvents),
            disallowEmptySelection: ()=>ke(r.disallowEmptySelection),
            selectionBehavior: ()=>ke(r.selectionBehavior),
            selectionMode: ()=>r.selectionMode,
            dataSource: ()=>r.options ?? [],
            getKey: ()=>r.optionValue,
            getTextValue: ()=>r.optionTextValue,
            getDisabled: ()=>r.optionDisabled,
            getSectionChildren: ()=>r.optionGroupChildren
        }), C = _t(()=>ne(J.selectionManager().selectedKeys())), g = (ee)=>{
            J.selectionManager().toggleSelection(U(ee));
        }, { present: x } = e1({
            show: ()=>r.forceMount || te.isOpen(),
            element: ()=>b() ?? null
        }), A = ()=>{
            const ee = _();
            ee && Lr(ee);
        }, R = (ee)=>{
            if (r.options.length <= 0) return;
            D(ee), te.open();
            let Q = J.selectionManager().firstSelectedKey();
            Q == null && (ee === "first" ? Q = J.collection().getFirstKey() : ee === "last" && (Q = J.collection().getLastKey())), A(), J.selectionManager().setFocused(!0), J.selectionManager().setFocusedKey(Q);
        }, N = ()=>{
            te.close(), J.selectionManager().setFocused(!1), J.selectionManager().setFocusedKey(void 0);
        }, L = (ee)=>{
            te.isOpen() ? N() : R(ee);
        }, { formControlContext: z } = $te(i);
        Xte(p, ()=>{
            const ee = r.defaultValue ? [
                ...r.defaultValue
            ].map(U) : new mc;
            J.selectionManager().setSelectedKeys(ee);
        });
        const B = lne({
            usage: "search",
            sensitivity: "base"
        }), S = _t(()=>{
            const ee = ke(r.keyboardDelegate);
            return ee || new Rne(J.collection, void 0, B);
        }), O = (ee)=>r.itemComponent?.({
                item: ee
            }), W = (ee)=>r.sectionComponent?.({
                section: ee
            });
        ot(Gi([
            $
        ], ([ee])=>{
            const Y = [
                ...J.selectionManager().selectedKeys()
            ].filter((ae)=>ee.includes(ae));
            J.selectionManager().setSelectedKeys(Y);
        }, {
            defer: !0
        }));
        const F = _t(()=>({
                "data-expanded": te.isOpen() ? "" : void 0,
                "data-closed": te.isOpen() ? void 0 : ""
            })), G = {
            dataset: F,
            isOpen: te.isOpen,
            isDisabled: ()=>z.isDisabled() ?? !1,
            isMultiple: ()=>ke(r.selectionMode) === "multiple",
            isVirtualized: ()=>r.virtualized ?? !1,
            isModal: ()=>r.modal ?? !1,
            preventScroll: ()=>r.preventScroll ?? G.isModal(),
            disallowTypeAhead: ()=>r.disallowTypeAhead ?? !1,
            shouldFocusWrap: ()=>r.shouldFocusWrap ?? !1,
            selectedOptions: C,
            contentPresent: x,
            autoFocus: I,
            triggerRef: p,
            listState: ()=>J,
            keyboardDelegate: S,
            triggerId: a,
            valueId: l,
            listboxId: d,
            listboxAriaLabelledBy: w,
            setListboxAriaLabelledBy: E,
            setTriggerRef: h,
            setContentRef: y,
            setListboxRef: v,
            open: R,
            close: N,
            toggle: L,
            placeholder: ()=>r.placeholder,
            renderItem: O,
            renderSection: W,
            removeOptionFromSelection: g,
            generateId: du(()=>ke(i.id)),
            registerTriggerId: Ks(c),
            registerValueId: Ks(u),
            registerListboxId: Ks(f)
        };
        return M(MO.Provider, {
            value: z,
            get children () {
                return M(pre.Provider, {
                    value: G,
                    get children () {
                        return M(i9, Le({
                            anchorRef: p,
                            contentRef: b
                        }, s, {
                            get children () {
                                return M(yn, Le({
                                    as: "div",
                                    role: "group",
                                    get id () {
                                        return ke(i.id);
                                    }
                                }, ()=>z.dataset(), F, o));
                            }
                        }));
                    }
                });
            }
        });
    }
    function OM(t) {
        const [e, n] = Ze(t, [
            "value",
            "defaultValue",
            "onChange",
            "multiple"
        ]), r = _t(()=>e.value != null ? e.multiple ? e.value : [
                e.value
            ] : e.value), s = _t(()=>e.defaultValue != null ? e.multiple ? e.defaultValue : [
                e.defaultValue
            ] : e.defaultValue);
        return M(I0t, Le({
            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 MM(t) {
        const e = of(), n = Su(), r = zt({
            id: n.generateId("trigger")
        }, t), [s, i, o] = Ze(r, [
            "ref",
            "disabled",
            "onPointerDown",
            "onClick",
            "onKeyDown",
            "onFocus",
            "onBlur"
        ], Zte), a = ()=>n.listState().selectionManager(), c = ()=>n.keyboardDelegate(), l = ()=>s.disabled || n.isDisabled(), { fieldProps: u } = Jte(i), { typeSelectHandlers: d } = hne({
            keyboardDelegate: c,
            selectionManager: a,
            onTypeSelect: (v)=>a().select(v)
        }), f = ()=>[
                n.listboxAriaLabelledBy(),
                n.valueId()
            ].filter(Boolean).join(" ") || void 0, p = (v)=>{
            Fn(v, s.onPointerDown), v.currentTarget.dataset.pointerType = v.pointerType, !l() && v.pointerType !== "touch" && v.button === 0 && (v.preventDefault(), n.toggle(!0));
        }, h = (v)=>{
            Fn(v, s.onClick), !l() && v.currentTarget.dataset.pointerType === "touch" && n.toggle(!0);
        }, b = (v)=>{
            if (Fn(v, s.onKeyDown), !l()) switch(Fn(v, d.onKeyDown), v.key){
                case "Enter":
                case " ":
                case "ArrowDown":
                    v.stopPropagation(), v.preventDefault(), n.toggle("first");
                    break;
                case "ArrowUp":
                    v.stopPropagation(), v.preventDefault(), n.toggle("last");
                    break;
                case "ArrowLeft":
                    {
                        if (v.preventDefault(), n.isMultiple()) return;
                        const w = a().firstSelectedKey(), E = w != null ? c().getKeyAbove?.(w) : c().getFirstKey?.();
                        E != null && a().select(E);
                        break;
                    }
                case "ArrowRight":
                    {
                        if (v.preventDefault(), n.isMultiple()) return;
                        const w = a().firstSelectedKey(), E = w != null ? c().getKeyBelow?.(w) : c().getFirstKey?.();
                        E != null && a().select(E);
                        break;
                    }
            }
        }, y = (v)=>{
            Fn(v, s.onFocus), !a().isFocused() && a().setFocused(!0);
        }, _ = (v)=>{
            Fn(v, s.onBlur), !n.isOpen() && a().setFocused(!1);
        };
        return ot(()=>At(n.registerTriggerId(u.id()))), ot(()=>{
            n.setListboxAriaLabelledBy([
                u.ariaLabelledBy(),
                u.ariaLabel() && !u.ariaLabelledBy() ? u.id() : null
            ].filter(Boolean).join(" ") || void 0);
        }), M(zc, Le({
            ref (v) {
                var w = ir(n.setTriggerRef, s.ref);
                typeof w == "function" && w(v);
            },
            get id () {
                return u.id();
            },
            get disabled () {
                return l();
            },
            "aria-haspopup": "listbox",
            get "aria-expanded" () {
                return n.isOpen();
            },
            get "aria-controls" () {
                return it(()=>!!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: b,
            onFocus: y,
            onBlur: _
        }, ()=>n.dataset(), ()=>e.dataset(), o));
    }
    function RM(t) {
        const e = of(), n = Su(), r = zt({
            id: n.generateId("value")
        }, t), [s, i] = Ze(r, [
            "id",
            "children"
        ]), o = ()=>n.listState().selectionManager(), a = ()=>{
            const c = o().selectedKeys();
            return c.size === 1 && c.has("") ? !0 : o().isEmpty();
        };
        return ot(()=>At(n.registerValueId(s.id))), M(yn, Le({
            as: "span",
            get id () {
                return s.id;
            },
            get "data-placeholder-shown" () {
                return a() ? "" : void 0;
            }
        }, ()=>e.dataset(), i, {
            get children () {
                return M(ge, {
                    get when () {
                        return !a();
                    },
                    get fallback () {
                        return n.placeholder();
                    },
                    get children () {
                        return M(A0t, {
                            state: {
                                selectedOption: ()=>n.selectedOptions()[0],
                                selectedOptions: ()=>n.selectedOptions(),
                                remove: (c)=>n.removeOptionFromSelection(c),
                                clear: ()=>o().clearSelection()
                            },
                            get children () {
                                return s.children;
                            }
                        });
                    }
                });
            }
        }));
    }
    function A0t(t) {
        const e = Bre(()=>{
            const n = t.children;
            return IE(n) ? n(t.state) : n;
        });
        return it(e);
    }
    var P0t = Object.assign(OM, {
        Arrow: Sw,
        Content: CM,
        Description: G5,
        ErrorMessage: J5,
        HiddenSelect: gre,
        Icon: IM,
        Item: Iw,
        ItemDescription: d9,
        ItemIndicator: Aw,
        ItemLabel: Pw,
        Label: bre,
        Listbox: AM,
        Portal: PM,
        Section: f9,
        Trigger: MM,
        Value: RM
    }), O0t = se('<svg><path d="M8 9l4 -4l4 4"></svg>', !1, !0, !1), M0t = se('<svg><path d="M16 15l-4 4l-4 -4"></svg>', !1, !0, !1), R0t = se('<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 N0t = OM, V0t = RM, B0t = (t)=>{
        const [e, n] = Ze(t, [
            "class",
            "children"
        ]);
        return M(MM, Le({
            get class () {
                return vn("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 [
                    it(()=>e.children),
                    M(IM, {
                        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 [
                                O0t(),
                                M0t()
                            ];
                        }
                    })
                ];
            }
        }));
    }, D0t = (t)=>{
        const [e, n] = Ze(t, [
            "class"
        ]);
        return M(PM, {
            get children () {
                return M(CM, Le({
                    get class () {
                        return vn("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 M(AM, {
                            class: "m-0 p-1"
                        });
                    }
                }));
            }
        });
    }, F0t = (t)=>{
        const [e, n] = Ze(t, [
            "class",
            "children"
        ]);
        return M(Iw, Le({
            get class () {
                return vn("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 [
                    M(Aw, {
                        class: "absolute right-2 flex size-3.5 items-center justify-center",
                        get children () {
                            return R0t();
                        }
                    }),
                    M(Pw, {
                        get children () {
                            return e.children;
                        }
                    })
                ];
            }
        }));
    }, NM = "0691b2fecca1ac4f53cb6dfb00b7013e561d1f34403b957cbb5af1fa", VM = "4e49474854", mre = `${NM}${VM}`, xb = "https://api.1am.xyz/rpc/cardano", yh = 2147483648;
    async function L0t(t, e, n, r) {
        const s = await crypto.subtle.importKey("raw", t, "PBKDF2", !1, [
            "deriveBits"
        ]), i = await crypto.subtle.deriveBits({
            name: "PBKDF2",
            salt: e,
            iterations: n,
            hash: "SHA-512"
        }, s, r * 8);
        return new Uint8Array(i);
    }
    async function yre(t) {
        const e = await L0t(new Uint8Array(0), t, 4096, 96), n = e.slice(0, 32), r = e.slice(32, 64), s = e.slice(64, 96);
        return n[0] &= 248, n[31] &= 31, n[31] |= 64, {
            kL: n,
            kR: r,
            cc: s
        };
    }
    function z0t(t) {
        const e = new Uint8Array(4);
        return e[0] = t & 255, e[1] = t >> 8 & 255, e[2] = t >> 16 & 255, e[3] = t >> 24 & 255, e;
    }
    function wre(t, e) {
        const n = new Uint8Array(32);
        let r = 0;
        for(let s = 0; s < 32; s++){
            const i = (t[s] || 0) + (e[s] || 0) + r;
            n[s] = i & 255, r = i >> 8;
        }
        return n;
    }
    function U0t(t, e) {
        const n = new Uint8Array(32);
        let r = 0;
        for(let s = 0; s < 28; s++){
            const i = t[s] << 3 | r;
            n[s] = i & 255, r = i >> 8;
        }
        return r && (n[28] = r), wre(n, e);
    }
    function H0t(t) {
        let e = 0n;
        for(let n = t.length - 1; n >= 0; n--)e = e << 8n | BigInt(t[n]);
        return e;
    }
    const j0t = 7237005577332262213973186563042994240857116359379907606001950938285454250989n;
    function xv(t) {
        const e = H0t(t) % j0t;
        return Bje.Point.BASE.multiply(e).toBytes();
    }
    function q0t(t, e) {
        const n = e >= yh, r = z0t(e), s = xv(t.kL);
        let i;
        n ? (i = new Uint8Array(69), i[0] = 0, i.set(t.kL, 1), i.set(t.kR, 33), i.set(r, 65)) : (i = new Uint8Array(37), i[0] = 2, i.set(s, 1), i.set(r, 33));
        const o = Hx(pD, t.cc, i), a = o.slice(0, 32), c = o.slice(32, 64), l = U0t(a.slice(0, 28), t.kL), u = wre(c, t.kR);
        let d;
        n ? (d = new Uint8Array(69), d[0] = 1, d.set(t.kL, 1), d.set(t.kR, 33), d.set(r, 65)) : (d = new Uint8Array(37), d[0] = 3, d.set(s, 1), d.set(r, 33));
        const f = Hx(pD, t.cc, d).slice(32, 64);
        return {
            kL: l,
            kR: u,
            cc: f
        };
    }
    function $m(t, e) {
        let n = t;
        for (const r of e){
            const s = n;
            n = q0t(n, r), s !== t && (s.kL.fill(0), s.kR.fill(0), s.cc.fill(0));
        }
        return n;
    }
    function eH(t) {
        return Ux(t, {
            dkLen: 28
        });
    }
    async function K0t(t) {
        const e = lO(t, Y5), n = e instanceof Uint8Array ? e : new TextEncoder().encode(e), r = await yre(n), s = $m(r, [
            1852 + yh,
            1815 + yh,
            0 + yh
        ]), i = $m(s, [
            0,
            0
        ]), o = xv(i.kL), a = $m(s, [
            2,
            0
        ]), c = xv(a.kL), l = eH(o), u = eH(c), d = 1, f = new Uint8Array(57);
        f[0] = d, f.set(l, 1), f.set(u, 29);
        const p = pR.toWords(f), h = pR.encode("addr", p, 1023);
        return n.fill(0), r.kL.fill(0), r.kR.fill(0), r.cc.fill(0), s.kL.fill(0), s.kR.fill(0), s.cc.fill(0), i.kL.fill(0), i.kR.fill(0), i.cc.fill(0), a.kL.fill(0), a.kR.fill(0), a.cc.fill(0), h;
    }
    const Ow = "pk_live__sItK98-enkW25L6abMrV1U520gALkWCXtKBD3DUtsY";
    async function W0t(t, e = Ow) {
        const n = await fetch(`${xb}/addresses/${encodeURIComponent(t)}`, {
            headers: {
                "X-API-Key": e
            },
            signal: AbortSignal.timeout(15e3)
        });
        if (n.status === 404) return {
            lovelace: 0n,
            night: 0n
        };
        if (!n.ok) throw new Error(`Cardano proxy error: ${n.status} ${n.statusText}`);
        return $0t(await n.json());
    }
    function $0t(t) {
        let e = 0n, n = 0n;
        if (Array.isArray(t.amount)) for (const r of t.amount)r.unit === "lovelace" ? e = BigInt(r.quantity) : r.unit === mre && (n = BigInt(r.quantity));
        return {
            lovelace: e,
            night: n
        };
    }
    function _re(t, e = 4) {
        if (t < 9007199254740992n) return (Number(t) / 1e6).toFixed(e);
        const n = t / 1000000n, r = t % 1000000n;
        if (e === 0) return n.toString();
        const s = r.toString().padStart(6, "0").slice(0, e);
        return `${n.toString()}.${s}`;
    }
    function X0t(t, e = 4) {
        return _re(t, e);
    }
    function xre(t, e = 4) {
        return _re(t, e);
    }
    async function G0t(t, e = Ow) {
        const n = await fetch(`${xb}/addresses/${encodeURIComponent(t)}/utxos`, {
            headers: {
                "X-API-Key": e
            },
            signal: AbortSignal.timeout(15e3)
        });
        if (n.status === 404) return [];
        if (!n.ok) throw new Error(`Cardano UTXO fetch failed: ${n.status}`);
        return await n.json();
    }
    async function Z0t(t = Ow) {
        const e = await fetch(`${xb}/epochs/latest/parameters`, {
            headers: {
                "X-API-Key": t
            },
            signal: AbortSignal.timeout(15e3)
        });
        if (!e.ok) throw new Error(`Failed to fetch protocol params: ${e.status}`);
        return await e.json();
    }
    async function J0t(t = Ow) {
        const e = await fetch(`${xb}/blocks/latest`, {
            headers: {
                "X-API-Key": t
            },
            signal: AbortSignal.timeout(15e3)
        });
        if (!e.ok) throw new Error(`Failed to fetch current slot: ${e.status}`);
        const n = await e.json();
        if (!n?.slot) throw new Error("Invalid block data: missing slot");
        return Number(n.slot);
    }
    async function Y0t(t, e = Ow) {
        const n = new Uint8Array(t).buffer, r = await fetch(`${xb}/tx/submit`, {
            method: "POST",
            headers: {
                "Content-Type": "application/cbor",
                "X-API-Key": e
            },
            signal: AbortSignal.timeout(3e4),
            body: n
        });
        if (!r.ok) {
            const i = await r.text().catch(()=>"");
            throw new Error(`Tx submit failed: ${r.status} ${i}`);
        }
        const s = await r.json();
        return typeof s == "string" ? s : s.toString();
    }
    async function vre(t) {
        const e = lO(t, Y5), n = e instanceof Uint8Array ? e : new TextEncoder().encode(e), r = await yre(n), s = $m(r, [
            1852 + yh,
            1815 + yh,
            0 + yh
        ]), i = $m(s, [
            0,
            0
        ]), o = new Uint8Array(64);
        o.set(i.kL, 0), o.set(i.kR, 32);
        const a = xv(i.kL);
        return n.fill(0), r.kL.fill(0), r.kR.fill(0), r.cc.fill(0), s.kL.fill(0), s.kR.fill(0), s.cc.fill(0), i.kL.fill(0), i.kR.fill(0), i.cc.fill(0), {
            extendedPrivateKey: o,
            publicKey: a
        };
    }
    async function Sre(t) {
        const e = await ei(()=>import("./cardano_serialization_lib-CCLeBkON.js").then(async (m)=>{
                await m.__tla;
                return m;
            }), __vite__mapDeps([2,1]));
        let { mnemonic: n, fromAddress: r, toAddress: s, nightAmount: i, adaAmount: o, adaOnly: a } = t;
        if (!s || !s.startsWith("addr1") && !s.startsWith("addr_test1")) throw new Error("Invalid Cardano address — must start with addr1 (mainnet) or addr_test1 (testnet)");
        try {
            e.Address.from_bech32(s);
        } catch  {
            throw new Error("Invalid Cardano address — failed bech32 checksum validation");
        }
        const [{ extendedPrivateKey: c }, l, u, d] = await Promise.all([
            vre(n),
            G0t(r),
            Z0t(),
            J0t()
        ]);
        if (n = "", l.length === 0) throw new Error("No UTXOs found — wallet has no funds");
        let f = null;
        const p = [], h = (b)=>(p.push(b), b);
        try {
            f = h(e.PrivateKey.from_extended_bytes(c));
            const b = h(e.TransactionBuilder.new(e.TransactionBuilderConfigBuilder.new().fee_algo(e.LinearFee.new(e.BigNum.from_str(u.min_fee_a.toString()), e.BigNum.from_str(u.min_fee_b.toString()))).pool_deposit(e.BigNum.from_str(u.pool_deposit)).key_deposit(e.BigNum.from_str(u.key_deposit)).max_value_size(parseInt(u.max_val_size || "5000")).max_tx_size(parseInt(u.max_tx_size || "16384")).coins_per_utxo_byte(e.BigNum.from_str(u.coins_per_utxo_size || u.coins_per_utxo_word || "4310")).build())), y = h(f.to_public().hash());
            for (const te of l){
                const J = e.TransactionInput.new(e.TransactionHash.from_bytes(sm(te.tx_hash)), te.tx_index), C = e.Value.new(e.BigNum.from_str("0"));
                let g = "0";
                const x = e.MultiAsset.new();
                for (const A of te.amount)if (A.unit === "lovelace") g = A.quantity;
                else {
                    const R = A.unit.slice(0, 56), N = A.unit.slice(56), L = e.ScriptHash.from_bytes(sm(R));
                    let z = x.get(L);
                    z || (z = e.Assets.new()), z.insert(e.AssetName.new(sm(N)), e.BigNum.from_str(A.quantity)), x.insert(L, z);
                }
                C.set_coin(e.BigNum.from_str(g)), x.len() > 0 && C.set_multiasset(x), b.add_key_input(y, J, C);
            }
            let _;
            if (a && o) _ = e.Value.new(e.BigNum.from_str(o.toString()));
            else {
                const te = e.MultiAsset.new(), J = e.Assets.new();
                J.insert(e.AssetName.new(sm(VM)), e.BigNum.from_str(i.toString())), te.insert(e.ScriptHash.from_bytes(sm(NM)), J), _ = e.Value.new(e.BigNum.from_str(o?.toString() || "0")), _.set_multiasset(te);
                const C = e.DataCost.new_coins_per_byte(e.BigNum.from_str(u.coins_per_utxo_size || u.coins_per_utxo_word || "4310")), g = e.min_ada_for_output(e.TransactionOutput.new(e.Address.from_bech32(s), _), C), x = o && o > BigInt(g.to_str()) ? o : BigInt(g.to_str());
                _.set_coin(e.BigNum.from_str(x.toString()));
            }
            b.add_output(e.TransactionOutput.new(e.Address.from_bech32(s), _)), b.set_ttl(d + 1800), b.add_change_if_needed(e.Address.from_bech32(r));
            const v = h(b.build()), w = v.to_bytes(), E = Ux(w, {
                dkLen: 32
            }), I = h(e.TransactionHash.from_bytes(E)), D = h(e.TransactionWitnessSet.new()), U = h(e.Vkeywitnesses.new());
            U.add(e.make_vkey_witness(I, f)), D.set_vkeys(U);
            const $ = h(e.Transaction.new(v, D)).to_bytes();
            return {
                txHash: await Y0t($)
            };
        } finally{
            c.fill(0);
            for (const b of p)try {
                b.free();
            } catch  {}
        }
    }
    function sm(t) {
        const e = new Uint8Array(t.length / 2);
        for(let n = 0; n < t.length; n += 2)e[n / 2] = parseInt(t.substring(n, n + 2), 16);
        return e;
    }
    const tH = Object.freeze(Object.defineProperty({
        __proto__: null,
        CARDANO_PROXY_URL: xb,
        NIGHT_ASSET_ID: mre,
        NIGHT_ASSET_NAME_HEX: VM,
        NIGHT_POLICY_ID: NM,
        deriveCardanoAddress: K0t,
        deriveCardanoSigningKey: vre,
        fetchCardanoNightBalance: W0t,
        formatAda: xre,
        formatCardanoNight: X0t,
        sendCardanoTransaction: Sre
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    var Q0t = se('<i class="icon-box w-6 h-6">'), egt = se('<button title="Cardano L1"aria-label="Cardano L1"><img alt class="w-4 h-4 brightness-0 invert">CARDANO'), tgt = se('<div class="flex items-center justify-between px-3 py-2 bg-muted rounded border border-border"><span class="text-xs text-content-muted">ADA available for fees</span><span class="text-sm font-mono font-medium text-foreground"> ADA'), ngt = se('<div class="bg-rose-500/10 border-l-[3px] border-rose-500 px-3 py-2"><p class="text-xs text-rose-600">You need at least ~1.5 ADA to send a Cardano token transaction.'), rgt = se('<div class="bg-rose-500/10 text-rose-500 p-3 rounded-lg text-sm">'), sgt = se('<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 Cardanoscan"aria-label="View on Cardanoscan"><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>'), igt = se('<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">'), ogt = se('<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!'), agt = se('<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.'), cgt = se('<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></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'), lgt = se('<div class="flex justify-between w-full"><span></span><span class="text-content-muted-light text-xs">'), ugt = se('<div class="animate-spin w-4 h-4 border-2 border-current border-t-transparent rounded-full">');
    const kre = "0000000000000000000000000000000000000000000000000000000000000000";
    function nH(t) {
        return t === "" || t === kre ? "NIGHT" : t;
    }
    const dgt = (t)=>{
        const [e] = Ze(t, [
            "edgeToEdge"
        ]), n = ()=>e.edgeToEdge === !0, { shieldedBalances: r, unshieldedBalances: s, sendTokens: i, formatBalance: o, isSynced: a, sendTokensError: c, sendTokensStatus: l, cardanoBalance: u, cardanoAddress: d, cardanoEnabled: f, acquireTxLock: p, releaseTxLock: h, environmentSettings: b, exportMnemonic: y } = Tr(), _ = ()=>b().environment === "mainnet", v = ()=>_() && f(), [w, E] = he(""), [I, D] = he(""), [U, K] = he("unshielded"), [$, ne] = he(null), [te, J] = he(!1), [C, g] = he(null), [x, A] = he(!1), [R, N] = he(null), [L, z] = he(null), [B, S] = he(null), [O, W] = he(null), [F, G] = he(!1);
        let ee;
        ot(()=>{
            const Ee = L();
            if (!Ee) return;
            const le = ()=>{
                document.body.style.setProperty("--send-token-select-width", `${Ee.offsetWidth}px`);
            };
            le();
            const qe = new ResizeObserver(le);
            qe.observe(Ee), At(()=>{
                qe.disconnect(), document.body.style.removeProperty("--send-token-select-width");
            });
        }), ot(()=>{
            const Ee = B();
            if (!Ee) return;
            const le = ()=>{
                W(Ee.scrollHeight), G(!0);
            };
            le();
            const qe = new ResizeObserver(le);
            qe.observe(Ee), At(()=>{
                qe.disconnect();
            });
        }), At(()=>{
            ee !== void 0 && window.cancelAnimationFrame(ee);
        });
        const Q = (Ee)=>{
            if (Ee === U()) return;
            const le = B();
            le && (G(!0), W(le.scrollHeight)), K(Ee), ne(Ee === "cardano" ? "cNIGHT" : null), ee !== void 0 && window.cancelAnimationFrame(ee), ee = window.requestAnimationFrame(()=>{
                const qe = B();
                qe && W(qe.scrollHeight), ee = void 0;
            });
        }, Y = _t(()=>{
            if (U() === "cardano") {
                const Ee = u(), le = [];
                return Ee && Ee.night > 0n && le.push({
                    rawType: "cNIGHT",
                    displayName: "NIGHT",
                    balance: Ee.night
                }), Ee && Ee.lovelace > 0n && le.push({
                    rawType: "ADA",
                    displayName: "ADA",
                    balance: Ee.lovelace
                }), le;
            }
            return U() === "shielded" ? Object.entries(r()).map(([Ee, le])=>({
                    rawType: Ee,
                    displayName: nH(Ee),
                    balance: le
                })) : [
                ...s().entries()
            ].map(([Ee, le])=>({
                    rawType: Ee,
                    displayName: nH(Ee),
                    balance: le
                }));
        }), ae = ()=>Y().find((Ee)=>Ee.displayName === $()), de = ()=>ae()?.balance ?? 0n, pe = ()=>{
            const Ee = ae();
            if (Ee) {
                if (Ee.rawType === "cNIGHT" || Ee.rawType === "ADA") {
                    let le = Ee.balance;
                    if (Ee.rawType === "ADA") {
                        const ut = 500000n;
                        le = le > ut ? le - ut : 0n;
                    }
                    const qe = le / 1000000n, Ye = (le % 1000000n).toString().padStart(6, "0").replace(/0+$/, "");
                    D(Ye ? `${qe}.${Ye}` : qe.toString());
                    return;
                }
                D(o(Ee.balance, 4, Ee.rawType));
            }
        }, [Ae, Oe] = he(""), [Re, Me] = he(!1), Je = async ()=>{
            if (g(null), !w() || !I() || !$()) {
                g("Please fill in all fields");
                return;
            }
            const Ee = ae();
            if (!Ee) {
                g("Please select an asset");
                return;
            }
            const le = parseFloat(I());
            if (isNaN(le) || le <= 0) {
                g("Amount must be greater than 0");
                return;
            }
            if (U() === "cardano") {
                if (!Re()) {
                    Me(!0);
                    return;
                }
                if (!Ae()) {
                    g("Enter your password to sign the Cardano transaction");
                    return;
                }
            }
            const qe = U() === "cardano", Ye = !qe && (Ee.rawType === "" || Ee.rawType === kre);
            let ut;
            if (Ye || qe) {
                const Ce = I().split("."), oe = BigInt(Ce[0] || "0") * 1000000n, ue = (Ce[1] || "").slice(0, 6).padEnd(6, "0");
                ut = oe + BigInt(ue);
            } else {
                const Ce = I().split(".")[0] || "0";
                ut = BigInt(Ce);
            }
            if (ut <= 0n) {
                g("Amount must be greater than 0");
                return;
            }
            if (ut > de()) {
                g("Insufficient balance");
                return;
            }
            J(!0), A(!1), N(null);
            try {
                if (qe) {
                    if (g(null), !await p(5e3)) {
                        g("Wallet busy — another transaction is in progress. Please try again."), J(!1);
                        return;
                    }
                    try {
                        const oe = await y(Ae()), ue = Ee.rawType === "ADA", Ie = await Sre({
                            mnemonic: oe,
                            fromAddress: d(),
                            toAddress: w(),
                            nightAmount: ue ? 0n : ut,
                            adaAmount: ue ? ut : void 0,
                            adaOnly: ue
                        });
                        N(Ie.txHash), Oe(""), Me(!1);
                    } finally{
                        h();
                    }
                } else {
                    const Ce = await i(w(), ut, Ee.rawType, U());
                    N(Ce);
                }
                A(!0), E(""), D("");
            } catch (Ce) {
                const oe = Ce instanceof Error ? Ce.message : "Failed to send tokens";
                g(oe.includes("Decryption") ? "Wrong password" : oe), Oe("");
            } finally{
                J(!1);
            }
        };
        return (()=>{
            var Ee = cgt(), le = Ee.firstChild, qe = le.firstChild, Ye = qe.nextSibling, ut = le.nextSibling, Ce = ut.firstChild, oe = Ce.firstChild, ue = Ce.nextSibling, Ie = ue.firstChild, H = ut.nextSibling, T = H.firstChild, P = T.firstChild, Z = P.firstChild, ie = Z.firstChild, ce = ie.firstChild, be = ce.nextSibling, yt = ie.nextSibling, Et = yt.firstChild, dt = Et.firstChild, Kt = Et.nextSibling, tt = yt.nextSibling, vt = tt.firstChild, Kr = vt.nextSibling, Vn = Kr.firstChild, _n = Z.nextSibling, Ya = _n.firstChild, jn = Ya.firstChild;
            return jn.firstChild, X(Ye, M(Cw, {
                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 nt = Q0t();
                    return X(nt, M(uM, {})), nt;
                }
            })), Ce.$$click = ()=>Q("shielded"), X(oe, M(Tg, {})), ue.$$click = ()=>Q("unshielded"), X(Ie, M(Eg, {})), X(ut, M(ge, {
                get when () {
                    return v();
                },
                get children () {
                    var nt = egt(), Wr = nt.firstChild;
                    return nt.$$click = ()=>Q("cardano"), Qt(Wr, "src", Tw), mt(()=>Mt(nt, `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)] ${U() === "cardano" ? "bg-[#0033AD] text-header-foreground rounded-[4px]" : "bg-transparent text-header-muted rounded-[2px]"}`)), nt;
                }
            }), null), w6(S, T), X(ce, M(ge, {
                get when () {
                    return U() === "shielded";
                },
                get fallback () {
                    return M(Eg, {});
                },
                get children () {
                    return M(Tg, {});
                }
            })), X(be, (()=>{
                var nt = it(()=>U() === "shielded");
                return ()=>nt() ? "SHIELDED SEND" : U() === "cardano" ? "CARDANO SEND" : "UNSHIELDED SEND";
            })()), dt.$$input = (nt)=>D(nt.currentTarget.value), Kt.$$click = pe, X(Kr, ()=>o(de(), 4, ae()?.rawType), Vn), X(Kr, ()=>$() || "—", null), w6(z, jn), X(jn, M(N0t, {
                get value () {
                    return $();
                },
                onChange: (nt)=>ne(nt || null),
                get options () {
                    return Y().map((nt)=>nt.displayName);
                },
                placeholder: "Select an asset",
                itemComponent: (nt)=>M(F0t, {
                        get item () {
                            return nt.item;
                        },
                        get children () {
                            var Wr = lgt(), fn = Wr.firstChild, je = fn.nextSibling;
                            return X(fn, ()=>nt.item.rawValue), X(je, ()=>{
                                const dr = Y().find((Wt)=>Wt.displayName === nt.item.rawValue);
                                return o(dr?.balance ?? 0n, 4, dr?.rawType);
                            }), Wr;
                        }
                    }),
                get children () {
                    return [
                        M(B0t, {
                            class: "w-full h-[40px] px-3 border border-border rounded-none bg-card text-content-muted-light uppercase",
                            get children () {
                                return M(V0t, {
                                    children: (nt)=>nt.selectedOption() || "SELECT AN ASSET"
                                });
                            }
                        }),
                        M(D0t, {
                            class: "w-[var(--send-token-select-width)] min-w-[var(--send-token-select-width)] max-w-[var(--send-token-select-width)]"
                        })
                    ];
                }
            }), null), X(Ya, M(wd, {
                get value () {
                    return w();
                },
                onChange: E,
                get children () {
                    return [
                        M(XT, {
                            class: "text-sm font-medium text-content-muted-dark",
                            children: "RECIPIENT"
                        }),
                        M(mh, {
                            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), X(_n, M(ge, {
                get when () {
                    return U() === "cardano";
                },
                get children () {
                    return [
                        (()=>{
                            var nt = tgt(), Wr = nt.firstChild, fn = Wr.nextSibling, je = fn.firstChild;
                            return X(fn, ()=>xre(u()?.lovelace ?? 0n), je), nt;
                        })(),
                        M(ge, {
                            get when () {
                                return (u()?.lovelace ?? 0n) < 1500000n;
                            },
                            get children () {
                                return ngt();
                            }
                        })
                    ];
                }
            }), null), X(_n, M(ge, {
                get when () {
                    return Re();
                },
                get children () {
                    return M(wd, {
                        get value () {
                            return Ae();
                        },
                        onChange: Oe,
                        get children () {
                            return [
                                M(XT, {
                                    class: "text-sm font-medium text-content-muted-dark",
                                    children: "PASSWORD TO SIGN"
                                }),
                                M(mh, {
                                    type: "password",
                                    placeholder: "Enter wallet password",
                                    class: "h-11 px-3.5 border border-border rounded-none bg-card",
                                    autofocus: !0,
                                    onKeyDown: (nt)=>{
                                        nt.key === "Enter" && Ae() && !te() && Je();
                                    }
                                })
                            ];
                        }
                    });
                }
            }), null), X(_n, M(ge, {
                get when () {
                    return C() || c();
                },
                get children () {
                    var nt = rgt();
                    return X(nt, ()=>C() || c()), nt;
                }
            }), null), X(_n, M(ge, {
                get when () {
                    return x();
                },
                get children () {
                    var nt = ogt();
                    return nt.firstChild, X(nt, M(ge, {
                        get when () {
                            return R();
                        },
                        get children () {
                            var Wr = igt(), fn = Wr.firstChild, je = fn.nextSibling;
                            return X(fn, R), je.$$click = async ()=>{
                                try {
                                    await navigator.clipboard.writeText(R());
                                } catch  {}
                            }, X(Wr, M(ge, {
                                get when () {
                                    return U() === "cardano";
                                },
                                get children () {
                                    var dr = sgt();
                                    return mt(()=>Qt(dr, "href", `https://cardanoscan.io/transaction/${(R() || "").replace(/[^a-fA-F0-9]/g, "")}`)), dr;
                                }
                            }), null), Wr;
                        }
                    }), null), nt;
                }
            }), null), X(_n, M(yi, {
                variant: "submit",
                size: "submit",
                onClick: Je,
                get disabled () {
                    return it(()=>U() !== "cardano")() && !a() || te() || !w() || !I() || !$() || U() === "cardano" && Re() && !Ae();
                },
                title: "Send",
                "aria-label": "Send",
                get children () {
                    return M(ge, {
                        get when () {
                            return !te();
                        },
                        get fallback () {
                            return [
                                ugt(),
                                it(()=>l() || "Processing...")
                            ];
                        },
                        get children () {
                            return U() === "cardano" && !Re() ? "CONTINUE" : "SEND";
                        }
                    });
                }
            }), null), X(_n, M(ge, {
                get when () {
                    return !a();
                },
                get children () {
                    return agt();
                }
            }), null), mt((nt)=>{
                var Wr = vn("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]"), fn = vn("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)] ${U() === "shielded" ? "bg-white text-black rounded-[4px]" : "bg-transparent text-header-muted rounded-[2px]"}`, dr = `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)] ${U() === "unshielded" ? "bg-[#F04438] text-white rounded-[4px]" : "bg-transparent text-header-muted rounded-[2px]"}`, Wt = vn("overflow-hidden transition-[height] motion-reduce:transition-none", F() && "duration-[264ms] ease-[cubic-bezier(0.16,1,0.3,1)]"), Ut = F() && O() !== null ? {
                    height: `${O()}px`
                } : void 0, fr = vn("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", I().trim().length > 0 ? "text-header-foreground" : "text-header-muted");
                return Wr !== nt.e && Mt(le, nt.e = Wr), fn !== nt.t && Mt(Ye, nt.t = fn), je !== nt.a && Mt(Ce, nt.a = je), dr !== nt.o && Mt(ue, nt.o = dr), Wt !== nt.i && Mt(H, nt.i = Wt), nt.n = gH(H, Ut, nt.n), fr !== nt.s && Mt(dt, nt.s = fr), nt;
            }, {
                e: void 0,
                t: void 0,
                a: void 0,
                o: void 0,
                i: void 0,
                n: void 0,
                s: void 0
            }), mt(()=>dt.value = I()), Ee;
        })();
    };
    ci([
        "click",
        "input"
    ]);
    const fgt = "/assets/midnight_onchain_runtime_wasm_bg-DwR8u1Y3.wasm";
    let re;
    function hgt(t) {
        re = t;
    }
    function cf(t) {
        const e = re.__externref_table_alloc();
        return re.__wbindgen_export_2.set(e, t), e;
    }
    function Oo(t, e) {
        try {
            return t.apply(this, e);
        } catch (n) {
            const r = cf(n);
            re.__wbindgen_exn_store(r);
        }
    }
    let O_ = null;
    function Xm() {
        return (O_ === null || O_.byteLength === 0) && (O_ = new Uint8Array(re.memory.buffer)), O_;
    }
    let y2 = new TextDecoder("utf-8", {
        ignoreBOM: !0,
        fatal: !0
    });
    y2.decode();
    const pgt = 2146435072;
    let n6 = 0;
    function ggt(t, e) {
        return n6 += e, n6 >= pgt && (y2 = new TextDecoder("utf-8", {
            ignoreBOM: !0,
            fatal: !0
        }), y2.decode(), n6 = e), y2.decode(Xm().subarray(t, t + e));
    }
    function In(t, e) {
        return t = t >>> 0, ggt(t, e);
    }
    let Ds = 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 oi(t, e, n) {
        if (n === void 0) {
            const a = Gm.encode(t), c = e(a.length, 1) >>> 0;
            return Xm().subarray(c, c + a.length).set(a), Ds = a.length, c;
        }
        let r = t.length, s = e(r, 1) >>> 0;
        const i = Xm();
        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 = Xm().subarray(s + o, s + r), c = Gm.encodeInto(t, a);
            o += c.written, s = n(s, r, o, 1) >>> 0;
        }
        return Ds = o, s;
    }
    let jp = null;
    function Wa() {
        return (jp === null || jp.buffer.detached === !0 || jp.buffer.detached === void 0 && jp.buffer !== re.memory.buffer) && (jp = new DataView(re.memory.buffer)), jp;
    }
    function sr(t) {
        return t == null;
    }
    function h9(t, e) {
        return t = t >>> 0, Xm().subarray(t / 1, t / 1 + e);
    }
    function oE(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 += oE(t[0]));
            for(let o = 1; o < s; o++)i += ", " + oE(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 rH = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>{
        re.__wbindgen_export_5.get(t.dtor)(t.a, t.b);
    });
    function bgt(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 ? (re.__wbindgen_export_5.get(s.dtor)(a, s.b), rH.unregister(s)) : s.a = a;
            }
        };
        return i.original = s, rH.register(i, s, s), i;
    }
    function _e(t) {
        const e = re.__wbindgen_export_2.get(t);
        return re.__externref_table_dealloc(t), e;
    }
    Avt = function() {
        let t, e;
        try {
            const s = re.dummyUserAddress();
            var n = s[0], r = s[1];
            if (s[3]) throw n = 0, r = 0, _e(s[2]);
            return t = n, e = r, In(n, r);
        } finally{
            re.__wbindgen_free(t, e, 1);
        }
    };
    Pvt = function(t) {
        const e = re.leafHash(t);
        if (e[2]) throw _e(e[1]);
        return _e(e[0]);
    };
    Ovt = function(t) {
        let e, n;
        try {
            const i = re.entryPointHash(t);
            var r = i[0], s = i[1];
            if (i[3]) throw r = 0, s = 0, _e(i[2]);
            return e = r, n = s, In(r, s);
        } finally{
            re.__wbindgen_free(e, n, 1);
        }
    };
    Mvt = function() {
        let t, e;
        try {
            const s = re.sampleContractAddress();
            var n = s[0], r = s[1];
            if (s[3]) throw n = 0, r = 0, _e(s[2]);
            return t = n, e = r, In(n, r);
        } finally{
            re.__wbindgen_free(t, e, 1);
        }
    };
    Rvt = function(t, e, n) {
        const r = oi(t, re.__wbindgen_malloc, re.__wbindgen_realloc), s = Ds, i = oi(n, re.__wbindgen_malloc, re.__wbindgen_realloc), o = Ds, a = re.verifySignature(r, s, e, i, o);
        if (a[2]) throw _e(a[1]);
        return a[0] !== 0;
    };
    mgt = function() {
        let t, e;
        try {
            const s = re.dummyContractAddress();
            var n = s[0], r = s[1];
            if (s[3]) throw n = 0, r = 0, _e(s[2]);
            return t = n, e = r, In(n, r);
        } finally{
            re.__wbindgen_free(t, e, 1);
        }
    };
    Nvt = function(t) {
        const e = re.ecMulGenerator(t);
        if (e[2]) throw _e(e[1]);
        return _e(e[0]);
    };
    Vvt = function(t, e, n) {
        const r = re.persistentCommit(t, e, n);
        if (r[2]) throw _e(r[1]);
        return _e(r[0]);
    };
    Bvt = function(t, e, n, r, s) {
        var i = sr(s) ? 0 : oi(s, re.__wbindgen_malloc, re.__wbindgen_realloc), o = Ds;
        const a = re.proofDataIntoSerializedPreimage(t, e, n, r, i, o);
        if (a[2]) throw _e(a[1]);
        return _e(a[0]);
    };
    ygt = function() {
        const t = re.maxField();
        if (t[2]) throw _e(t[1]);
        return _e(t[0]);
    };
    Dvt = function() {
        let t, e;
        try {
            const s = re.sampleSigningKey();
            var n = s[0], r = s[1];
            if (s[3]) throw n = 0, r = 0, _e(s[2]);
            return t = n, e = r, In(n, r);
        } finally{
            re.__wbindgen_free(t, e, 1);
        }
    };
    Fvt = function(t) {
        let e, n;
        try {
            const i = re.signingKeyFromBip340(t);
            var r = i[0], s = i[1];
            if (i[3]) throw r = 0, s = 0, _e(i[2]);
            return e = r, n = s, In(r, s);
        } finally{
            re.__wbindgen_free(e, n, 1);
        }
    };
    Lvt = function() {
        let t, e;
        try {
            const s = re.communicationCommitmentRandomness();
            var n = s[0], r = s[1];
            if (s[3]) throw n = 0, r = 0, _e(s[2]);
            return t = n, e = r, In(n, r);
        } finally{
            re.__wbindgen_free(t, e, 1);
        }
    };
    zvt = function(t, e) {
        let n, r;
        try {
            const o = oi(t, re.__wbindgen_malloc, re.__wbindgen_realloc), a = Ds, c = re.signData(o, a, e);
            var s = c[0], i = c[1];
            if (c[3]) throw s = 0, i = 0, _e(c[2]);
            return n = s, r = i, In(s, i);
        } finally{
            re.__wbindgen_free(n, r, 1);
        }
    };
    Uvt = function(t, e) {
        const n = re.ecMul(t, e);
        if (n[2]) throw _e(n[1]);
        return _e(n[0]);
    };
    Hvt = function(t, e, n) {
        let r, s;
        try {
            const a = oi(n, re.__wbindgen_malloc, re.__wbindgen_realloc), c = Ds, l = re.communicationCommitment(t, e, a, c);
            var i = l[0], o = l[1];
            if (l[3]) throw i = 0, o = 0, _e(l[2]);
            return r = i, s = o, In(i, o);
        } finally{
            re.__wbindgen_free(r, s, 1);
        }
    };
    jvt = function(t, e, n) {
        const r = re.transientCommit(t, e, n);
        if (r[2]) throw _e(r[1]);
        return _e(r[0]);
    };
    qvt = function(t, e) {
        let n, r;
        try {
            const o = oi(e, re.__wbindgen_malloc, re.__wbindgen_realloc), a = Ds, c = re.rawTokenType(t, o, a);
            var s = c[0], i = c[1];
            if (c[3]) throw s = 0, i = 0, _e(c[2]);
            return n = s, r = i, In(s, i);
        } finally{
            re.__wbindgen_free(n, r, 1);
        }
    };
    Kvt = function(t) {
        const e = re.upgradeFromTransient(t);
        if (e[2]) throw _e(e[1]);
        return _e(e[0]);
    };
    Wvt = function(t) {
        let e, n;
        try {
            const i = oi(t, re.__wbindgen_malloc, re.__wbindgen_realloc), o = Ds, a = re.signatureVerifyingKey(i, o);
            var r = a[0], s = a[1];
            if (a[3]) throw r = 0, s = 0, _e(a[2]);
            return e = r, n = s, In(r, s);
        } finally{
            re.__wbindgen_free(e, n, 1);
        }
    };
    $vt = function(t) {
        const e = re.bigIntToValue(t);
        if (e[2]) throw _e(e[1]);
        return _e(e[0]);
    };
    Xvt = function() {
        let t, e;
        try {
            const s = re.sampleRawTokenType();
            var n = s[0], r = s[1];
            if (s[3]) throw n = 0, r = 0, _e(s[2]);
            return t = n, e = r, In(n, r);
        } finally{
            re.__wbindgen_free(t, e, 1);
        }
    };
    Gvt = function(t) {
        const e = re.maxAlignedSize(t);
        if (e[2]) throw _e(e[1]);
        return BigInt.asUintN(64, e[0]);
    };
    Zvt = function(t, e) {
        const n = re.persistentHash(t, e);
        if (n[2]) throw _e(n[1]);
        return _e(n[0]);
    };
    Jvt = function(t) {
        const e = re.bigIntModFr(t);
        if (e[2]) throw _e(e[1]);
        return _e(e[0]);
    };
    Yvt = function(t, e) {
        const n = re.ecAdd(t, e);
        if (n[2]) throw _e(n[1]);
        return _e(n[0]);
    };
    Qvt = function(t) {
        const e = re.valueToBigInt(t);
        if (e[2]) throw _e(e[1]);
        return _e(e[0]);
    };
    e3t = function(t, e) {
        const n = re.transientHash(t, e);
        if (n[2]) throw _e(n[1]);
        return _e(n[0]);
    };
    t3t = function() {
        let t, e;
        try {
            const s = re.sampleUserAddress();
            var n = s[0], r = s[1];
            if (s[3]) throw n = 0, r = 0, _e(s[2]);
            return t = n, e = r, In(n, r);
        } finally{
            re.__wbindgen_free(t, e, 1);
        }
    };
    n3t = function(t, e) {
        const n = re.runtimeCoinCommitment(t, e);
        if (n[2]) throw _e(n[1]);
        return _e(n[0]);
    };
    r3t = function(t, e) {
        const n = re.hashToCurve(t, e);
        if (n[2]) throw _e(n[1]);
        return _e(n[0]);
    };
    s3t = function(t) {
        const e = re.degradeToTransient(t);
        if (e[2]) throw _e(e[1]);
        return _e(e[0]);
    };
    i3t = function(t) {
        const e = re.encodeShieldedCoinInfo(t);
        if (e[2]) throw _e(e[1]);
        return _e(e[0]);
    };
    o3t = function(t) {
        const e = oi(t, re.__wbindgen_malloc, re.__wbindgen_realloc), n = Ds, r = re.encodeCoinPublicKey(e, n);
        if (r[2]) throw _e(r[1]);
        return _e(r[0]);
    };
    a3t = function(t) {
        const e = oi(t, re.__wbindgen_malloc, re.__wbindgen_realloc), n = Ds, r = re.encodeContractAddress(e, n);
        if (r[2]) throw _e(r[1]);
        return _e(r[0]);
    };
    c3t = function(t) {
        const e = re.decodeQualifiedShieldedCoinInfo(t);
        if (e[2]) throw _e(e[1]);
        return _e(e[0]);
    };
    l3t = function(t) {
        const e = oi(t, re.__wbindgen_malloc, re.__wbindgen_realloc), n = Ds, r = re.encodeUserAddress(e, n);
        if (r[2]) throw _e(r[1]);
        return _e(r[0]);
    };
    u3t = function(t) {
        let e, n;
        try {
            const i = re.decodeUserAddress(t);
            var r = i[0], s = i[1];
            if (i[3]) throw r = 0, s = 0, _e(i[2]);
            return e = r, n = s, In(r, s);
        } finally{
            re.__wbindgen_free(e, n, 1);
        }
    };
    d3t = function(t) {
        const e = re.decodeShieldedCoinInfo(t);
        if (e[2]) throw _e(e[1]);
        return _e(e[0]);
    };
    f3t = function(t) {
        let e, n;
        try {
            const i = re.decodeCoinPublicKey(t);
            var r = i[0], s = i[1];
            if (i[3]) throw r = 0, s = 0, _e(i[2]);
            return e = r, n = s, In(r, s);
        } finally{
            re.__wbindgen_free(e, n, 1);
        }
    };
    h3t = function(t) {
        const e = oi(t, re.__wbindgen_malloc, re.__wbindgen_realloc), n = Ds, r = re.encodeRawTokenType(e, n);
        if (r[2]) throw _e(r[1]);
        return _e(r[0]);
    };
    p3t = function(t) {
        let e, n;
        try {
            const i = re.decodeContractAddress(t);
            var r = i[0], s = i[1];
            if (i[3]) throw r = 0, s = 0, _e(i[2]);
            return e = r, n = s, In(r, s);
        } finally{
            re.__wbindgen_free(e, n, 1);
        }
    };
    g3t = function(t) {
        let e, n;
        try {
            const i = re.decodeRawTokenType(t);
            var r = i[0], s = i[1];
            if (i[3]) throw r = 0, s = 0, _e(i[2]);
            return e = r, n = s, In(r, s);
        } finally{
            re.__wbindgen_free(e, n, 1);
        }
    };
    b3t = function(t) {
        const e = re.encodeQualifiedShieldedCoinInfo(t);
        if (e[2]) throw _e(e[1]);
        return _e(e[0]);
    };
    function _i(t, e) {
        if (!(t instanceof e)) throw new Error(`expected instance of ${e.name}`);
    }
    m3t = function(t, e, n, r) {
        _i(t, Jh), _i(n, uu);
        const s = re.runProgram(t.__wbg_ptr, e, n.__wbg_ptr, r);
        if (s[2]) throw _e(s[1]);
        return o1.__wrap(s[0]);
    };
    function BM(t, e) {
        t = t >>> 0;
        const n = Wa(), r = [];
        for(let s = t; s < t + 4 * e; s += 4)r.push(re.__wbindgen_export_2.get(n.getUint32(s, !0)));
        return re.__externref_drop_slice(t, e), r;
    }
    function wgt(t, e, n) {
        re.closure567_externref_shim(t, e, n);
    }
    function _gt(t, e, n, r) {
        re.closure607_externref_shim(t, e, n, r);
    }
    const r6 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>re.__wbg_chargedstate_free(t >>> 0, 1));
    Gd = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Gd.prototype);
            return n.__wbg_ptr = e, r6.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, r6.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            re.__wbg_chargedstate_free(e, 0);
        }
        constructor(e){
            _i(e, Qr);
            const n = re.chargedstate_new(e.__wbg_ptr);
            return this.__wbg_ptr = n >>> 0, r6.register(this, this.__wbg_ptr, this), this;
        }
        get state() {
            const e = re.chargedstate_state(this.__wbg_ptr);
            return Qr.__wrap(e);
        }
        toString(e) {
            let n, r;
            try {
                const s = re.chargedstate_toString(this.__wbg_ptr, sr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                re.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (Gd.prototype[Symbol.dispose] = Gd.prototype.free);
    const s6 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>re.__wbg_contractmaintenanceauthority_free(t >>> 0, 1));
    Gh = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Gh.prototype);
            return n.__wbg_ptr = e, s6.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, s6.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            re.__wbg_contractmaintenanceauthority_free(e, 0);
        }
        static deserialize(e) {
            const n = re.contractmaintenanceauthority_deserialize(e);
            if (n[2]) throw _e(n[1]);
            return Gh.__wrap(n[0]);
        }
        constructor(e, n, r){
            const s = re.contractmaintenanceauthority_new(e, n, sr(r) ? 0 : cf(r));
            if (s[2]) throw _e(s[1]);
            return this.__wbg_ptr = s[0] >>> 0, s6.register(this, this.__wbg_ptr, this), this;
        }
        get counter() {
            return re.contractmaintenanceauthority_counter(this.__wbg_ptr);
        }
        get committee() {
            const e = re.contractmaintenanceauthority_committee(this.__wbg_ptr);
            if (e[2]) throw _e(e[1]);
            return _e(e[0]);
        }
        serialize() {
            const e = re.contractmaintenanceauthority_serialize(this.__wbg_ptr);
            if (e[2]) throw _e(e[1]);
            return _e(e[0]);
        }
        get threshold() {
            return re.contractmaintenanceauthority_threshold(this.__wbg_ptr) >>> 0;
        }
        toString(e) {
            let n, r;
            try {
                const s = re.contractmaintenanceauthority_toString(this.__wbg_ptr, sr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                re.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (Gh.prototype[Symbol.dispose] = Gh.prototype.free);
    const i6 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>re.__wbg_contractoperation_free(t >>> 0, 1));
    Zh = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Zh.prototype);
            return n.__wbg_ptr = e, i6.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, i6.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            re.__wbg_contractoperation_free(e, 0);
        }
        static deserialize(e) {
            const n = re.contractoperation_deserialize(e);
            if (n[2]) throw _e(n[1]);
            return Zh.__wrap(n[0]);
        }
        get verifierKey() {
            const e = re.contractoperation_verifier_key(this.__wbg_ptr);
            if (e[2]) throw _e(e[1]);
            return _e(e[0]);
        }
        set verifierKey(e) {
            const n = re.contractoperation_set_verifier_key(this.__wbg_ptr, e);
            if (n[1]) throw _e(n[0]);
        }
        constructor(){
            const e = re.contractoperation_new();
            if (e[2]) throw _e(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, i6.register(this, this.__wbg_ptr, this), this;
        }
        serialize() {
            const e = re.contractoperation_serialize(this.__wbg_ptr);
            if (e[2]) throw _e(e[1]);
            return _e(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = re.contractoperation_toString(this.__wbg_ptr, sr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                re.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (Zh.prototype[Symbol.dispose] = Zh.prototype.free);
    const o6 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>re.__wbg_contractstate_free(t >>> 0, 1));
    Cg = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Cg.prototype);
            return n.__wbg_ptr = e, o6.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, o6.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            re.__wbg_contractstate_free(e, 0);
        }
        operations() {
            const e = re.contractstate_operations(this.__wbg_ptr);
            var n = BM(e[0], e[1]).slice();
            return re.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        static deserialize(e) {
            const n = re.contractstate_deserialize(e);
            if (n[2]) throw _e(n[1]);
            return Cg.__wrap(n[0]);
        }
        set balance(e) {
            const n = re.contractstate_set_balance(this.__wbg_ptr, e);
            if (n[1]) throw _e(n[0]);
        }
        setOperation(e, n) {
            _i(n, Zh);
            const r = re.contractstate_setOperation(this.__wbg_ptr, e, n.__wbg_ptr);
            if (r[1]) throw _e(r[0]);
        }
        get maintenanceAuthority() {
            const e = re.contractstate_maintenance_authority(this.__wbg_ptr);
            return Gh.__wrap(e);
        }
        set maintenanceAuthority(e) {
            _i(e, Gh), re.contractstate_set_maintenance_authority(this.__wbg_ptr, e.__wbg_ptr);
        }
        constructor(){
            const e = re.contractstate_new();
            return this.__wbg_ptr = e >>> 0, o6.register(this, this.__wbg_ptr, this), this;
        }
        get data() {
            const e = re.contractstate_data(this.__wbg_ptr);
            return Gd.__wrap(e);
        }
        query(e, n) {
            _i(n, uu);
            const r = re.contractstate_query(this.__wbg_ptr, e, n.__wbg_ptr);
            if (r[2]) throw _e(r[1]);
            return _e(r[0]);
        }
        get balance() {
            const e = re.contractstate_balance(this.__wbg_ptr);
            if (e[2]) throw _e(e[1]);
            return _e(e[0]);
        }
        set data(e) {
            _i(e, Gd), re.contractstate_set_data(this.__wbg_ptr, e.__wbg_ptr);
        }
        operation(e) {
            const n = re.contractstate_operation(this.__wbg_ptr, e);
            if (n[2]) throw _e(n[1]);
            return n[0] === 0 ? void 0 : Zh.__wrap(n[0]);
        }
        serialize() {
            const e = re.contractstate_serialize(this.__wbg_ptr);
            if (e[2]) throw _e(e[1]);
            return _e(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = re.contractstate_toString(this.__wbg_ptr, sr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                re.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (Cg.prototype[Symbol.dispose] = Cg.prototype.free);
    const a6 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>re.__wbg_costmodel_free(t >>> 0, 1));
    uu = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(uu.prototype);
            return n.__wbg_ptr = e, a6.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, a6.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            re.__wbg_costmodel_free(e, 0);
        }
        static initialCostModel() {
            const e = re.costmodel_initialCostModel();
            return uu.__wrap(e);
        }
        constructor(){
            const e = re.costmodel_new();
            if (e[2]) throw _e(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, a6.register(this, this.__wbg_ptr, this), this;
        }
        toString(e) {
            let n, r;
            try {
                const s = re.costmodel_toString(this.__wbg_ptr, sr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                re.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (uu.prototype[Symbol.dispose] = uu.prototype.free);
    typeof FinalizationRegistry > "u" || new FinalizationRegistry((t)=>re.__wbg_intounderlyingbytesource_free(t >>> 0, 1));
    typeof FinalizationRegistry > "u" || new FinalizationRegistry((t)=>re.__wbg_intounderlyingsink_free(t >>> 0, 1));
    typeof FinalizationRegistry > "u" || new FinalizationRegistry((t)=>re.__wbg_intounderlyingsource_free(t >>> 0, 1));
    const c6 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>re.__wbg_querycontext_free(t >>> 0, 1));
    wh = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(wh.prototype);
            return n.__wbg_ptr = e, c6.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, c6.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            re.__wbg_querycontext_free(e, 0);
        }
        get comIndices() {
            const e = re.querycontext_com_indices(this.__wbg_ptr);
            if (e[2]) throw _e(e[1]);
            return _e(e[0]);
        }
        set effects(e) {
            const n = re.querycontext_set_effects(this.__wbg_ptr, e);
            if (n[1]) throw _e(n[0]);
        }
        toVmStack() {
            const e = re.querycontext_toVmStack(this.__wbg_ptr);
            return Jh.__wrap(e);
        }
        runTranscript(e, n) {
            _i(n, uu);
            const r = re.querycontext_runTranscript(this.__wbg_ptr, e, n.__wbg_ptr);
            if (r[2]) throw _e(r[1]);
            return wh.__wrap(r[0]);
        }
        insertCommitment(e, n) {
            const r = oi(e, re.__wbindgen_malloc, re.__wbindgen_realloc), s = Ds, i = re.querycontext_insertCommitment(this.__wbg_ptr, r, s, n);
            if (i[2]) throw _e(i[1]);
            return wh.__wrap(i[0]);
        }
        constructor(e, n){
            _i(e, Gd);
            const r = oi(n, re.__wbindgen_malloc, re.__wbindgen_realloc), s = Ds, i = re.querycontext_new(e.__wbg_ptr, r, s);
            if (i[2]) throw _e(i[1]);
            return this.__wbg_ptr = i[0] >>> 0, c6.register(this, this.__wbg_ptr, this), this;
        }
        get block() {
            const e = re.querycontext_block(this.__wbg_ptr);
            if (e[2]) throw _e(e[1]);
            return _e(e[0]);
        }
        query(e, n, r) {
            _i(n, uu);
            const s = re.querycontext_query(this.__wbg_ptr, e, n.__wbg_ptr, r);
            if (s[2]) throw _e(s[1]);
            return i1.__wrap(s[0]);
        }
        get state() {
            const e = re.querycontext_state(this.__wbg_ptr);
            return Gd.__wrap(e);
        }
        get address() {
            let e, n;
            try {
                const i = re.querycontext_address(this.__wbg_ptr);
                var r = i[0], s = i[1];
                if (i[3]) throw r = 0, s = 0, _e(i[2]);
                return e = r, n = s, In(r, s);
            } finally{
                re.__wbindgen_free(e, n, 1);
            }
        }
        get effects() {
            const e = re.querycontext_effects(this.__wbg_ptr);
            if (e[2]) throw _e(e[1]);
            return _e(e[0]);
        }
        qualify(e) {
            const n = re.querycontext_qualify(this.__wbg_ptr, e);
            if (n[2]) throw _e(n[1]);
            return _e(n[0]);
        }
        set block(e) {
            const n = re.querycontext_set_block(this.__wbg_ptr, e);
            if (n[1]) throw _e(n[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = re.querycontext_toString(this.__wbg_ptr, sr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                re.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (wh.prototype[Symbol.dispose] = wh.prototype.free);
    const l6 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>re.__wbg_queryresults_free(t >>> 0, 1));
    i1 = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(i1.prototype);
            return n.__wbg_ptr = e, l6.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, l6.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            re.__wbg_queryresults_free(e, 0);
        }
        constructor(){
            const e = re.queryresults_new();
            if (e[2]) throw _e(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, l6.register(this, this.__wbg_ptr, this), this;
        }
        get events() {
            const e = re.queryresults_events(this.__wbg_ptr);
            if (e[2]) throw _e(e[1]);
            return _e(e[0]);
        }
        get context() {
            const e = re.queryresults_context(this.__wbg_ptr);
            return wh.__wrap(e);
        }
        get gasCost() {
            const e = re.queryresults_gas_cost(this.__wbg_ptr);
            if (e[2]) throw _e(e[1]);
            return _e(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = re.queryresults_toString(this.__wbg_ptr, sr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                re.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (i1.prototype[Symbol.dispose] = i1.prototype.free);
    const u6 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>re.__wbg_stateboundedmerkletree_free(t >>> 0, 1));
    Dl = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Dl.prototype);
            return n.__wbg_ptr = e, u6.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, u6.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            re.__wbg_stateboundedmerkletree_free(e, 0);
        }
        pathForLeaf(e, n) {
            const r = re.stateboundedmerkletree_pathForLeaf(this.__wbg_ptr, e, n);
            if (r[2]) throw _e(r[1]);
            return _e(r[0]);
        }
        findPathForLeaf(e) {
            const n = re.stateboundedmerkletree_findPathForLeaf(this.__wbg_ptr, e);
            if (n[2]) throw _e(n[1]);
            return _e(n[0]);
        }
        root() {
            const e = re.stateboundedmerkletree_root(this.__wbg_ptr);
            if (e[2]) throw _e(e[1]);
            return _e(e[0]);
        }
        constructor(e){
            const n = re.stateboundedmerkletree_blank(e);
            return this.__wbg_ptr = n >>> 0, u6.register(this, this.__wbg_ptr, this), this;
        }
        get height() {
            return re.stateboundedmerkletree_height(this.__wbg_ptr);
        }
        rehash() {
            const e = re.stateboundedmerkletree_rehash(this.__wbg_ptr);
            return Dl.__wrap(e);
        }
        update(e, n) {
            const r = re.stateboundedmerkletree_update(this.__wbg_ptr, e, n);
            if (r[2]) throw _e(r[1]);
            return Dl.__wrap(r[0]);
        }
        collapse(e, n) {
            const r = re.stateboundedmerkletree_collapse(this.__wbg_ptr, e, n);
            return Dl.__wrap(r);
        }
        toString(e) {
            let n, r;
            try {
                const s = re.stateboundedmerkletree_toString(this.__wbg_ptr, sr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                re.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (Dl.prototype[Symbol.dispose] = Dl.prototype.free);
    const d6 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>re.__wbg_statemap_free(t >>> 0, 1));
    _d = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(_d.prototype);
            return n.__wbg_ptr = e, d6.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, d6.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            re.__wbg_statemap_free(e, 0);
        }
        get(e) {
            const n = re.statemap_get(this.__wbg_ptr, e);
            if (n[2]) throw _e(n[1]);
            return n[0] === 0 ? void 0 : Qr.__wrap(n[0]);
        }
        constructor(){
            const e = re.statemap_new();
            return this.__wbg_ptr = e >>> 0, d6.register(this, this.__wbg_ptr, this), this;
        }
        keys() {
            const e = re.statemap_keys(this.__wbg_ptr);
            if (e[3]) throw _e(e[2]);
            var n = BM(e[0], e[1]).slice();
            return re.__wbindgen_free(e[0], e[1] * 4, 4), n;
        }
        insert(e, n) {
            _i(n, Qr);
            const r = re.statemap_insert(this.__wbg_ptr, e, n.__wbg_ptr);
            if (r[2]) throw _e(r[1]);
            return _d.__wrap(r[0]);
        }
        remove(e) {
            const n = re.statemap_remove(this.__wbg_ptr, e);
            if (n[2]) throw _e(n[1]);
            return _d.__wrap(n[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = re.statemap_toString(this.__wbg_ptr, sr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                re.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (_d.prototype[Symbol.dispose] = _d.prototype.free);
    const f6 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>re.__wbg_statevalue_free(t >>> 0, 1));
    Qr = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Qr.prototype);
            return n.__wbg_ptr = e, f6.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, f6.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            re.__wbg_statevalue_free(e, 0);
        }
        arrayPush(e) {
            _i(e, Qr);
            const n = re.statevalue_arrayPush(this.__wbg_ptr, e.__wbg_ptr);
            if (n[2]) throw _e(n[1]);
            return Qr.__wrap(n[0]);
        }
        asBoundedMerkleTree() {
            const e = re.statevalue_asBoundedMerkleTree(this.__wbg_ptr);
            if (e[2]) throw _e(e[1]);
            return e[0] === 0 ? void 0 : Dl.__wrap(e[0]);
        }
        static newBoundedMerkleTree(e) {
            _i(e, Dl);
            const n = re.statevalue_newBoundedMerkleTree(e.__wbg_ptr);
            return Qr.__wrap(n);
        }
        constructor(){
            const e = re.statevalue_new();
            if (e[2]) throw _e(e[1]);
            return this.__wbg_ptr = e[0] >>> 0, f6.register(this, this.__wbg_ptr, this), this;
        }
        type() {
            let e, n;
            try {
                const r = re.statevalue_type(this.__wbg_ptr);
                return e = r[0], n = r[1], In(r[0], r[1]);
            } finally{
                re.__wbindgen_free(e, n, 1);
            }
        }
        asMap() {
            const e = re.statevalue_asMap(this.__wbg_ptr);
            if (e[2]) throw _e(e[1]);
            return e[0] === 0 ? void 0 : _d.__wrap(e[0]);
        }
        static decode(e) {
            const n = re.statevalue_decode(e);
            if (n[2]) throw _e(n[1]);
            return Qr.__wrap(n[0]);
        }
        encode() {
            const e = re.statevalue_encode(this.__wbg_ptr);
            if (e[2]) throw _e(e[1]);
            return _e(e[0]);
        }
        asCell() {
            const e = re.statevalue_asCell(this.__wbg_ptr);
            if (e[2]) throw _e(e[1]);
            return _e(e[0]);
        }
        static newMap(e) {
            _i(e, _d);
            const n = re.statevalue_newMap(e.__wbg_ptr);
            return Qr.__wrap(n);
        }
        asArray() {
            const e = re.statevalue_asArray(this.__wbg_ptr);
            if (e[3]) throw _e(e[2]);
            let n;
            return e[0] !== 0 && (n = BM(e[0], e[1]).slice(), re.__wbindgen_free(e[0], e[1] * 4, 4)), n;
        }
        logSize() {
            return re.statevalue_logSize(this.__wbg_ptr) >>> 0;
        }
        static newCell(e) {
            const n = re.statevalue_newCell(e);
            if (n[2]) throw _e(n[1]);
            return Qr.__wrap(n[0]);
        }
        static newNull() {
            const e = re.statevalue_newNull();
            return Qr.__wrap(e);
        }
        static newArray() {
            const e = re.statevalue_newArray();
            return Qr.__wrap(e);
        }
        toString(e) {
            let n, r;
            try {
                const s = re.statevalue_toString(this.__wbg_ptr, sr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                re.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (Qr.prototype[Symbol.dispose] = Qr.prototype.free);
    const sH = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>re.__wbg_vmresults_free(t >>> 0, 1));
    o1 = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(o1.prototype);
            return n.__wbg_ptr = e, sH.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, sH.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            re.__wbg_vmresults_free(e, 0);
        }
        constructor(){
            const e = re.vmresults_new();
            if (e[2]) throw _e(e[1]);
            return Qr.__wrap(e[0]);
        }
        get stack() {
            const e = re.vmresults_stack(this.__wbg_ptr);
            return Jh.__wrap(e);
        }
        get events() {
            const e = re.vmresults_events(this.__wbg_ptr);
            if (e[2]) throw _e(e[1]);
            return _e(e[0]);
        }
        get gasCost() {
            const e = re.vmresults_gas_cost(this.__wbg_ptr);
            if (e[2]) throw _e(e[1]);
            return _e(e[0]);
        }
        toString(e) {
            let n, r;
            try {
                const s = re.vmresults_toString(this.__wbg_ptr, sr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                re.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (o1.prototype[Symbol.dispose] = o1.prototype.free);
    const h6 = typeof FinalizationRegistry > "u" ? {
        register: ()=>{},
        unregister: ()=>{}
    } : new FinalizationRegistry((t)=>re.__wbg_vmstack_free(t >>> 0, 1));
    Jh = class {
        static __wrap(e) {
            e = e >>> 0;
            const n = Object.create(Jh.prototype);
            return n.__wbg_ptr = e, h6.register(n, n.__wbg_ptr, n), n;
        }
        __destroy_into_raw() {
            const e = this.__wbg_ptr;
            return this.__wbg_ptr = 0, h6.unregister(this), e;
        }
        free() {
            const e = this.__destroy_into_raw();
            re.__wbg_vmstack_free(e, 0);
        }
        removeLast() {
            re.vmstack_removeLast(this.__wbg_ptr);
        }
        get(e) {
            const n = re.vmstack_get(this.__wbg_ptr, e);
            return n === 0 ? void 0 : Qr.__wrap(n);
        }
        constructor(){
            const e = re.vmstack_new();
            return this.__wbg_ptr = e >>> 0, h6.register(this, this.__wbg_ptr, this), this;
        }
        push(e, n) {
            _i(e, Qr), re.vmstack_push(this.__wbg_ptr, e.__wbg_ptr, n);
        }
        length() {
            return re.vmstack_length(this.__wbg_ptr) >>> 0;
        }
        isStrong(e) {
            const n = re.vmstack_isStrong(this.__wbg_ptr, e);
            return n === 16777215 ? void 0 : n !== 0;
        }
        toString(e) {
            let n, r;
            try {
                const s = re.vmstack_toString(this.__wbg_ptr, sr(e) ? 16777215 : e ? 1 : 0);
                return n = s[0], r = s[1], In(s[0], s[1]);
            } finally{
                re.__wbindgen_free(n, r, 1);
            }
        }
    };
    Symbol.dispose && (Jh.prototype[Symbol.dispose] = Jh.prototype.free);
    function xgt() {
        return Oo(function(t) {
            return BigInt(t);
        }, arguments);
    }
    function vgt(t) {
        return BigInt(t);
    }
    function Sgt(t, e) {
        return Error(In(t, e));
    }
    function kgt(t) {
        return Number(t);
    }
    function Tgt(t, e) {
        const n = String(e), r = oi(n, re.__wbindgen_malloc, re.__wbindgen_realloc), s = Ds;
        Wa().setInt32(t + 4, s, !0), Wa().setInt32(t + 0, r, !0);
    }
    function Egt(t) {
        return t.buffer;
    }
    function Cgt(t) {
        const e = t.byobRequest;
        return sr(e) ? 0 : cf(e);
    }
    function Igt(t) {
        return t.byteLength;
    }
    function Agt(t) {
        return t.byteOffset;
    }
    function Pgt() {
        return Oo(function(t, e) {
            return t.call(e);
        }, arguments);
    }
    function Ogt() {
        return Oo(function(t, e, n) {
            return t.call(e, n);
        }, arguments);
    }
    function Mgt() {
        return Oo(function(t) {
            t.close();
        }, arguments);
    }
    function Rgt() {
        return Oo(function(t) {
            t.close();
        }, arguments);
    }
    function Ngt(t) {
        return Cg.__wrap(t);
    }
    function Vgt(t) {
        return t.crypto;
    }
    function Bgt(t) {
        return t.done;
    }
    function Dgt() {
        return Oo(function(t, e) {
            t.enqueue(e);
        }, arguments);
    }
    function Fgt(t) {
        return Object.entries(t);
    }
    function Lgt(t) {
        return Array.from(t);
    }
    function zgt() {
        return Oo(function(t, e) {
            t.getRandomValues(e);
        }, arguments);
    }
    function Ugt(t, e) {
        return t[e >>> 0];
    }
    function Hgt() {
        return Oo(function(t, e) {
            return Reflect.get(t, e);
        }, arguments);
    }
    function jgt(t, e) {
        return t.get(e);
    }
    function qgt(t, e) {
        return t[e];
    }
    function Kgt(t) {
        let e;
        try {
            e = t instanceof ArrayBuffer;
        } catch  {
            e = !1;
        }
        return e;
    }
    function Wgt(t) {
        let e;
        try {
            e = t instanceof Map;
        } catch  {
            e = !1;
        }
        return e;
    }
    function $gt(t) {
        let e;
        try {
            e = t instanceof Uint8Array;
        } catch  {
            e = !1;
        }
        return e;
    }
    function Xgt(t) {
        return Array.isArray(t);
    }
    function Ggt(t) {
        return Number.isSafeInteger(t);
    }
    function Zgt() {
        return Symbol.iterator;
    }
    function Jgt(t) {
        return t.keys();
    }
    function Ygt(t) {
        return t.length;
    }
    function Qgt(t) {
        return t.length;
    }
    function ebt(t) {
        return t.msCrypto;
    }
    function tbt() {
        return new Object;
    }
    function nbt() {
        return new Array;
    }
    function rbt(t, e) {
        try {
            var n = {
                a: t,
                b: e
            }, r = (i, o)=>{
                const a = n.a;
                n.a = 0;
                try {
                    return _gt(a, n.b, i, o);
                } finally{
                    n.a = a;
                }
            };
            return new Promise(r);
        } finally{
            n.a = n.b = 0;
        }
    }
    function sbt() {
        return new Map;
    }
    function ibt(t) {
        return new Uint8Array(t);
    }
    function obt(t, e) {
        return new Error(In(t, e));
    }
    function abt(t, e) {
        return new Uint8Array(h9(t, e));
    }
    function cbt(t, e) {
        return new Function(In(t, e));
    }
    function lbt(t, e, n) {
        return new Uint8Array(t, e >>> 0, n >>> 0);
    }
    function ubt(t) {
        return new Uint8Array(t >>> 0);
    }
    function dbt(t) {
        return t.next;
    }
    function fbt() {
        return Oo(function(t) {
            return t.next();
        }, arguments);
    }
    function hbt(t) {
        return t.node;
    }
    function pbt(t) {
        return t.process;
    }
    function gbt(t, e, n) {
        Uint8Array.prototype.set.call(h9(t, e), n);
    }
    function bbt(t, e) {
        return t.push(e);
    }
    function mbt(t) {
        queueMicrotask(t);
    }
    function ybt(t) {
        return t.queueMicrotask;
    }
    function wbt() {
        return Oo(function(t, e) {
            t.randomFillSync(e);
        }, arguments);
    }
    function _bt() {
        return Oo(function() {
            return module.require;
        }, arguments);
    }
    function xbt(t) {
        return Promise.resolve(t);
    }
    function vbt() {
        return Oo(function(t, e) {
            t.respond(e >>> 0);
        }, arguments);
    }
    function Sbt(t, e, n) {
        t.set(h9(e, n));
    }
    function kbt(t, e, n) {
        t[e] = n;
    }
    function Tbt(t, e, n) {
        t[e >>> 0] = n;
    }
    function Ebt(t, e, n) {
        return t.set(e, n);
    }
    function Cbt(t) {
        return Qr.__wrap(t);
    }
    function Ibt() {
        const t = typeof globalThis > "u" ? null : globalThis;
        return sr(t) ? 0 : cf(t);
    }
    function Abt() {
        const t = typeof globalThis > "u" ? null : globalThis;
        return sr(t) ? 0 : cf(t);
    }
    function Pbt() {
        const t = typeof self > "u" ? null : self;
        return sr(t) ? 0 : cf(t);
    }
    function Obt() {
        const t = typeof window > "u" ? null : window;
        return sr(t) ? 0 : cf(t);
    }
    function Mbt(t, e, n) {
        return t.subarray(e >>> 0, n >>> 0);
    }
    function Rbt(t, e) {
        return t.then(e);
    }
    function Nbt() {
        return Oo(function(t, e) {
            return t.toString(e);
        }, arguments);
    }
    function Vbt(t) {
        return t.toString();
    }
    function Bbt(t) {
        return t.value;
    }
    function Dbt(t) {
        return t.versions;
    }
    function Fbt(t) {
        const e = t.view;
        return sr(e) ? 0 : cf(e);
    }
    function Lbt(t, e) {
        const n = e, r = typeof n == "bigint" ? n : void 0;
        Wa().setBigInt64(t + 8, sr(r) ? BigInt(0) : r, !0), Wa().setInt32(t + 0, !sr(r), !0);
    }
    function zbt(t) {
        const e = t, n = typeof e == "boolean" ? e : void 0;
        return sr(n) ? 16777215 : n ? 1 : 0;
    }
    function Ubt(t) {
        const e = t.original;
        return e.cnt-- == 1 ? (e.a = 0, !0) : !1;
    }
    function Hbt(t, e) {
        const n = oE(e), r = oi(n, re.__wbindgen_malloc, re.__wbindgen_realloc), s = Ds;
        Wa().setInt32(t + 4, s, !0), Wa().setInt32(t + 0, r, !0);
    }
    function jbt(t, e) {
        return t in e;
    }
    function qbt(t) {
        return typeof t == "bigint";
    }
    function Kbt(t) {
        return typeof t == "function";
    }
    function Wbt(t) {
        return t === null;
    }
    function $bt(t) {
        const e = t;
        return typeof e == "object" && e !== null;
    }
    function Xbt(t) {
        return typeof t == "string";
    }
    function Gbt(t) {
        return t === void 0;
    }
    function Zbt(t, e) {
        return t === e;
    }
    function Jbt(t, e) {
        return t == e;
    }
    function Ybt(t, e) {
        const n = e, r = typeof n == "number" ? n : void 0;
        Wa().setFloat64(t + 8, sr(r) ? 0 : r, !0), Wa().setInt32(t + 0, !sr(r), !0);
    }
    function Qbt(t, e) {
        return t >> e;
    }
    function emt(t, e) {
        const n = e, r = typeof n == "string" ? n : void 0;
        var s = sr(r) ? 0 : oi(r, re.__wbindgen_malloc, re.__wbindgen_realloc), i = Ds;
        Wa().setInt32(t + 4, i, !0), Wa().setInt32(t + 0, s, !0);
    }
    function tmt(t, e) {
        throw new Error(In(t, e));
    }
    function nmt(t, e) {
        return In(t, e);
    }
    function rmt(t) {
        return BigInt.asUintN(64, t);
    }
    function smt(t, e) {
        return bgt(t, e, 566, wgt);
    }
    function imt(t) {
        return t;
    }
    function omt(t, e) {
        return h9(t, e);
    }
    function amt(t) {
        return t;
    }
    function cmt(t, e) {
        return BigInt.asUintN(64, t) | BigInt.asUintN(64, e) << BigInt(64);
    }
    function lmt() {
        const t = re.__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 fe = await Ij({
        "./midnight_onchain_runtime_wasm_bg.js": {
            __wbg_statevalue_new: Cbt,
            __wbg_contractstate_new: Ngt,
            __wbg_getwithrefkey_1dc361bd10053bfe: qgt,
            __wbg_set_3f1d0b984ed272ed: kbt,
            __wbg_String_8f0eb39a4a4c2f66: Tgt,
            __wbg_queueMicrotask_25d0739ac89e8c88: mbt,
            __wbg_queueMicrotask_4488407636f5bf24: ybt,
            __wbg_respond_6c2c4e20ef85138e: vbt,
            __wbg_view_91cc97d57ab30530: Fbt,
            __wbg_byobRequest_2c036bceca1e6037: Cgt,
            __wbg_close_cccada6053ee3a65: Mgt,
            __wbg_enqueue_452bc2343d1c2ff9: Dgt,
            __wbg_close_d71a78219dc23e91: Rgt,
            __wbg_crypto_86f2631e91b51511: Vgt,
            __wbg_process_3975fd6c72f520aa: pbt,
            __wbg_versions_4e31226f5e8dc909: Dbt,
            __wbg_node_e1f24f89a7336c2e: hbt,
            __wbg_require_b74f47fc2d022fd6: _bt,
            __wbg_msCrypto_d562bbe83e0d4b91: ebt,
            __wbg_getRandomValues_b3f15fcbfabb0f8b: zgt,
            __wbg_randomFillSync_f8c153b79f285817: wbt,
            __wbg_byteLength_331a6b5545834024: Igt,
            __wbg_byteOffset_49a5b5608000358b: Agt,
            __wbg_newfromslice_074c56947bd43469: abt,
            __wbg_newwithlength_a167dcc7aaa3ba77: ubt,
            __wbg_newwithbyteoffsetandlength_e8f53910b4d42b45: lbt,
            __wbg_new_638ebfaedbf32a5e: ibt,
            __wbg_buffer_8d40b1d762fb3c66: Egt,
            __wbg_length_6bb7e81f9d7713e4: Qgt,
            __wbg_prototypesetcall_3d4a26c1ed734349: gbt,
            __wbg_subarray_70fd07feefe14294: Mbt,
            __wbg_set_1353b2a5e96bc48c: Sbt,
            __wbg_BigInt_40a77d45cca49470: xgt,
            __wbg_done_75ed0ee6dd243d9d: Bgt,
            __wbg_value_dd9372230531eade: Bbt,
            __wbg_instanceof_Map_ebb01a5b6b5ffd0b: Wgt,
            __wbg_instanceof_Uint8Array_9a8378d955933db7: $gt,
            __wbg_instanceof_ArrayBuffer_67f3012529f6a2dd: Kgt,
            __wbg_BigInt_6adbfd8eb0f7ec07: vgt,
            __wbg_get_5ee3191755594360: jgt,
            __wbg_new_2ff1f68f3676ea53: sbt,
            __wbg_set_b7f1cf4fae26fe2a: Ebt,
            __wbg_keys_822161a7faf55538: Jgt,
            __wbg_get_0da715ceaecea5c8: Ugt,
            __wbg_new_1f3a344cf3123716: nbt,
            __wbg_set_90f6c0f7bd8c0415: Tbt,
            __wbg_from_88bc52ce20ba6318: Lgt,
            __wbg_push_330b2eb93e4e1212: bbt,
            __wbg_length_186546c51cd61acd: Ygt,
            __wbg_isArray_030cce220591fb41: Xgt,
            __wbg_new_da9dc54c5db29dfa: obt,
            __wbg_toString_d8f537919ef401d6: Vbt,
            __wbg_toString_7268338f40012a03: Nbt,
            __wbg_isSafeInteger_1c0d1af5542e102a: Ggt,
            __wbg_new_19c25a3f2fa63a02: tbt,
            __wbg_entries_2be2f15bd5554996: Fgt,
            __wbg_iterator_f370b34483c71a1c: Zgt,
            __wbg_static_accessor_GLOBAL_THIS_f0a4409105898184: Abt,
            __wbg_static_accessor_SELF_995b214ae681ff99: Pbt,
            __wbg_static_accessor_GLOBAL_8921f820c2ce3f12: Ibt,
            __wbg_static_accessor_WINDOW_cde3890479c675ea: Obt,
            __wbg_new_2e3c58a15f39f5f9: rbt,
            __wbg_then_e22500defe16819f: Rbt,
            __wbg_resolve_4055c623acdd6a1b: xbt,
            __wbg_get_458e874b43b18b25: Hgt,
            __wbg_newnoargs_254190557c45b4ec: cbt,
            __wbg_call_13410aac570ffff7: Pgt,
            __wbg_call_a5400b25a865cfd8: Ogt,
            __wbg_next_5b3530e612fde77d: dbt,
            __wbg_next_692e82279131b03c: fbt,
            __wbg_wbindgenin_d7a1ee10933d2d55: jbt,
            __wbg_wbindgenshr_7d2aae6044c0dab1: Qbt,
            __wbg_wbindgenthrow_451ec1a8469d7eb6: tmt,
            __wbg_wbindgencbdrop_eb10308566512b88: Ubt,
            __wbg_wbindgenisnull_f3037694abe4d97a: Wbt,
            __wbg_wbindgenjsvaleq_e6f2ad59ccae1b58: Zbt,
            __wbg_Number_998bea33bd87c3e0: kgt,
            __wbg_Error_e17e777aac105295: Sgt,
            __wbg_wbindgenisbigint_ecb90cc08a5a9154: qbt,
            __wbg_wbindgenisobject_307a53c6bd97fbf8: $bt,
            __wbg_wbindgenisstring_d4fa939789f003b0: Xbt,
            __wbg_wbindgennumberget_f74b4c7525ac05cb: Ybt,
            __wbg_wbindgenstringget_0f16a6ddddef376f: emt,
            __wbg_wbindgenbooleanget_3fe6f642c7d97746: zbt,
            __wbg_wbindgenisfunction_8cee7dce3725ae74: Kbt,
            __wbg_wbindgenisundefined_c4b71d073b92f3c5: Gbt,
            __wbg_wbindgenjsvallooseeq_9bec8c9be826bed1: Jbt,
            __wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1: Lbt,
            __wbg_wbindgendebugstring_99ef257a3ddda34d: Hbt,
            __wbindgen_init_externref_table: lmt,
            __wbindgen_cast_4b5eaebe94e9fac3: smt,
            __wbindgen_cast_4625c577ab2ec9ee: rmt,
            __wbindgen_cast_9ae0607507abb057: imt,
            __wbindgen_cast_cb9088102bce6b30: omt,
            __wbindgen_cast_e7b45dd881f38ce3: cmt,
            __wbindgen_cast_2241b6af4c4b2941: nmt,
            __wbindgen_cast_d6cd19b81560fd6e: amt
        }
    }, fgt), umt = fe.memory, dmt = fe.__wbg_chargedstate_free, fmt = fe.__wbg_contractmaintenanceauthority_free, hmt = fe.__wbg_contractoperation_free, pmt = fe.__wbg_contractstate_free, gmt = fe.__wbg_costmodel_free, bmt = fe.__wbg_querycontext_free, mmt = fe.__wbg_queryresults_free, ymt = fe.__wbg_stateboundedmerkletree_free, wmt = fe.__wbg_statemap_free, _mt = fe.__wbg_statevalue_free, xmt = fe.__wbg_vmresults_free, vmt = fe.__wbg_vmstack_free, Smt = fe.bigIntModFr, kmt = fe.bigIntToValue, Tmt = fe.chargedstate_new, Emt = fe.chargedstate_state, Cmt = fe.chargedstate_toString, Imt = fe.communicationCommitment, Amt = fe.communicationCommitmentRandomness, Pmt = fe.contractmaintenanceauthority_committee, Omt = fe.contractmaintenanceauthority_counter, Mmt = fe.contractmaintenanceauthority_deserialize, Rmt = fe.contractmaintenanceauthority_new, Nmt = fe.contractmaintenanceauthority_serialize, Vmt = fe.contractmaintenanceauthority_threshold, Bmt = fe.contractmaintenanceauthority_toString, Dmt = fe.contractoperation_deserialize, Fmt = fe.contractoperation_new, Lmt = fe.contractoperation_serialize, zmt = fe.contractoperation_set_verifier_key, Umt = fe.contractoperation_toString, Hmt = fe.contractoperation_verifier_key, jmt = fe.contractstate_balance, qmt = fe.contractstate_data, Kmt = fe.contractstate_deserialize, Wmt = fe.contractstate_maintenance_authority, $mt = fe.contractstate_new, Xmt = fe.contractstate_operation, Gmt = fe.contractstate_operations, Zmt = fe.contractstate_query, Jmt = fe.contractstate_serialize, Ymt = fe.contractstate_setOperation, Qmt = fe.contractstate_set_balance, eyt = fe.contractstate_set_data, tyt = fe.contractstate_set_maintenance_authority, nyt = fe.contractstate_toString, ryt = fe.costmodel_initialCostModel, syt = fe.costmodel_new, iyt = fe.costmodel_toString, oyt = fe.decodeCoinPublicKey, ayt = fe.decodeContractAddress, cyt = fe.decodeQualifiedShieldedCoinInfo, lyt = fe.decodeRawTokenType, uyt = fe.decodeShieldedCoinInfo, dyt = fe.decodeUserAddress, fyt = fe.degradeToTransient, hyt = fe.dummyContractAddress, pyt = fe.dummyUserAddress, gyt = fe.ecAdd, byt = fe.ecMul, myt = fe.ecMulGenerator, yyt = fe.encodeCoinPublicKey, wyt = fe.encodeContractAddress, _yt = fe.encodeQualifiedShieldedCoinInfo, xyt = fe.encodeRawTokenType, vyt = fe.encodeShieldedCoinInfo, Syt = fe.encodeUserAddress, kyt = fe.entryPointHash, Tyt = fe.hashToCurve, Eyt = fe.leafHash, Cyt = fe.maxAlignedSize, Iyt = fe.maxField, Ayt = fe.persistentCommit, Pyt = fe.persistentHash, Oyt = fe.proofDataIntoSerializedPreimage, Myt = fe.querycontext_address, Ryt = fe.querycontext_block, Nyt = fe.querycontext_com_indices, Vyt = fe.querycontext_effects, Byt = fe.querycontext_insertCommitment, Dyt = fe.querycontext_new, Fyt = fe.querycontext_qualify, Lyt = fe.querycontext_query, zyt = fe.querycontext_runTranscript, Uyt = fe.querycontext_set_block, Hyt = fe.querycontext_set_effects, jyt = fe.querycontext_state, qyt = fe.querycontext_toString, Kyt = fe.querycontext_toVmStack, Wyt = fe.queryresults_context, $yt = fe.queryresults_events, Xyt = fe.queryresults_gas_cost, Gyt = fe.queryresults_new, Zyt = fe.queryresults_toString, Jyt = fe.rawTokenType, Yyt = fe.runProgram, Qyt = fe.runtimeCoinCommitment, e1t = fe.runtimeCoinNullifier, t1t = fe.sampleContractAddress, n1t = fe.sampleRawTokenType, r1t = fe.sampleSigningKey, s1t = fe.sampleUserAddress, i1t = fe.signData, o1t = fe.signatureVerifyingKey, a1t = fe.signingKeyFromBip340, c1t = fe.stateboundedmerkletree_blank, l1t = fe.stateboundedmerkletree_collapse, u1t = fe.stateboundedmerkletree_findPathForLeaf, d1t = fe.stateboundedmerkletree_height, f1t = fe.stateboundedmerkletree_pathForLeaf, h1t = fe.stateboundedmerkletree_rehash, p1t = fe.stateboundedmerkletree_root, g1t = fe.stateboundedmerkletree_toString, b1t = fe.stateboundedmerkletree_update, m1t = fe.statemap_get, y1t = fe.statemap_insert, w1t = fe.statemap_keys, _1t = fe.statemap_new, x1t = fe.statemap_remove, v1t = fe.statemap_toString, S1t = fe.statevalue_arrayPush, k1t = fe.statevalue_asArray, T1t = fe.statevalue_asBoundedMerkleTree, E1t = fe.statevalue_asCell, C1t = fe.statevalue_asMap, I1t = fe.statevalue_decode, A1t = fe.statevalue_encode, P1t = fe.statevalue_logSize, O1t = fe.statevalue_new, M1t = fe.statevalue_newArray, R1t = fe.statevalue_newBoundedMerkleTree, N1t = fe.statevalue_newCell, V1t = fe.statevalue_newMap, B1t = fe.statevalue_newNull, D1t = fe.statevalue_toString, F1t = fe.statevalue_type, L1t = fe.transientCommit, z1t = fe.transientHash, U1t = fe.upgradeFromTransient, H1t = fe.valueToBigInt, j1t = fe.verifySignature, q1t = fe.vmresults_events, K1t = fe.vmresults_gas_cost, W1t = fe.vmresults_new, $1t = fe.vmresults_stack, X1t = fe.vmresults_toString, G1t = fe.vmstack_get, Z1t = fe.vmstack_isStrong, J1t = fe.vmstack_length, Y1t = fe.vmstack_new, Q1t = fe.vmstack_push, ewt = fe.vmstack_removeLast, twt = fe.vmstack_toString, nwt = fe.__wbg_intounderlyingbytesource_free, rwt = fe.__wbg_intounderlyingsink_free, swt = fe.__wbg_intounderlyingsource_free, iwt = fe.intounderlyingbytesource_autoAllocateChunkSize, owt = fe.intounderlyingbytesource_cancel, awt = fe.intounderlyingbytesource_pull, cwt = fe.intounderlyingbytesource_start, lwt = fe.intounderlyingbytesource_type, uwt = fe.intounderlyingsink_abort, dwt = fe.intounderlyingsink_close, fwt = fe.intounderlyingsink_write, hwt = fe.intounderlyingsource_cancel, pwt = fe.intounderlyingsource_pull, gwt = fe.__wbindgen_exn_store, bwt = fe.__externref_table_alloc, mwt = fe.__wbindgen_export_2, ywt = fe.__wbindgen_malloc, wwt = fe.__wbindgen_realloc, _wt = fe.__wbindgen_export_5, xwt = fe.__externref_table_dealloc, vwt = fe.__wbindgen_free, Swt = fe.__externref_drop_slice, kwt = fe.closure567_externref_shim, Twt = fe.closure607_externref_shim, Tre = fe.__wbindgen_start, Ewt = Object.freeze(Object.defineProperty({
        __proto__: null,
        __externref_drop_slice: Swt,
        __externref_table_alloc: bwt,
        __externref_table_dealloc: xwt,
        __wbg_chargedstate_free: dmt,
        __wbg_contractmaintenanceauthority_free: fmt,
        __wbg_contractoperation_free: hmt,
        __wbg_contractstate_free: pmt,
        __wbg_costmodel_free: gmt,
        __wbg_intounderlyingbytesource_free: nwt,
        __wbg_intounderlyingsink_free: rwt,
        __wbg_intounderlyingsource_free: swt,
        __wbg_querycontext_free: bmt,
        __wbg_queryresults_free: mmt,
        __wbg_stateboundedmerkletree_free: ymt,
        __wbg_statemap_free: wmt,
        __wbg_statevalue_free: _mt,
        __wbg_vmresults_free: xmt,
        __wbg_vmstack_free: vmt,
        __wbindgen_exn_store: gwt,
        __wbindgen_export_2: mwt,
        __wbindgen_export_5: _wt,
        __wbindgen_free: vwt,
        __wbindgen_malloc: ywt,
        __wbindgen_realloc: wwt,
        __wbindgen_start: Tre,
        bigIntModFr: Smt,
        bigIntToValue: kmt,
        chargedstate_new: Tmt,
        chargedstate_state: Emt,
        chargedstate_toString: Cmt,
        closure567_externref_shim: kwt,
        closure607_externref_shim: Twt,
        communicationCommitment: Imt,
        communicationCommitmentRandomness: Amt,
        contractmaintenanceauthority_committee: Pmt,
        contractmaintenanceauthority_counter: Omt,
        contractmaintenanceauthority_deserialize: Mmt,
        contractmaintenanceauthority_new: Rmt,
        contractmaintenanceauthority_serialize: Nmt,
        contractmaintenanceauthority_threshold: Vmt,
        contractmaintenanceauthority_toString: Bmt,
        contractoperation_deserialize: Dmt,
        contractoperation_new: Fmt,
        contractoperation_serialize: Lmt,
        contractoperation_set_verifier_key: zmt,
        contractoperation_toString: Umt,
        contractoperation_verifier_key: Hmt,
        contractstate_balance: jmt,
        contractstate_data: qmt,
        contractstate_deserialize: Kmt,
        contractstate_maintenance_authority: Wmt,
        contractstate_new: $mt,
        contractstate_operation: Xmt,
        contractstate_operations: Gmt,
        contractstate_query: Zmt,
        contractstate_serialize: Jmt,
        contractstate_setOperation: Ymt,
        contractstate_set_balance: Qmt,
        contractstate_set_data: eyt,
        contractstate_set_maintenance_authority: tyt,
        contractstate_toString: nyt,
        costmodel_initialCostModel: ryt,
        costmodel_new: syt,
        costmodel_toString: iyt,
        decodeCoinPublicKey: oyt,
        decodeContractAddress: ayt,
        decodeQualifiedShieldedCoinInfo: cyt,
        decodeRawTokenType: lyt,
        decodeShieldedCoinInfo: uyt,
        decodeUserAddress: dyt,
        degradeToTransient: fyt,
        dummyContractAddress: hyt,
        dummyUserAddress: pyt,
        ecAdd: gyt,
        ecMul: byt,
        ecMulGenerator: myt,
        encodeCoinPublicKey: yyt,
        encodeContractAddress: wyt,
        encodeQualifiedShieldedCoinInfo: _yt,
        encodeRawTokenType: xyt,
        encodeShieldedCoinInfo: vyt,
        encodeUserAddress: Syt,
        entryPointHash: kyt,
        hashToCurve: Tyt,
        intounderlyingbytesource_autoAllocateChunkSize: iwt,
        intounderlyingbytesource_cancel: owt,
        intounderlyingbytesource_pull: awt,
        intounderlyingbytesource_start: cwt,
        intounderlyingbytesource_type: lwt,
        intounderlyingsink_abort: uwt,
        intounderlyingsink_close: dwt,
        intounderlyingsink_write: fwt,
        intounderlyingsource_cancel: hwt,
        intounderlyingsource_pull: pwt,
        leafHash: Eyt,
        maxAlignedSize: Cyt,
        maxField: Iyt,
        memory: umt,
        persistentCommit: Ayt,
        persistentHash: Pyt,
        proofDataIntoSerializedPreimage: Oyt,
        querycontext_address: Myt,
        querycontext_block: Ryt,
        querycontext_com_indices: Nyt,
        querycontext_effects: Vyt,
        querycontext_insertCommitment: Byt,
        querycontext_new: Dyt,
        querycontext_qualify: Fyt,
        querycontext_query: Lyt,
        querycontext_runTranscript: zyt,
        querycontext_set_block: Uyt,
        querycontext_set_effects: Hyt,
        querycontext_state: jyt,
        querycontext_toString: qyt,
        querycontext_toVmStack: Kyt,
        queryresults_context: Wyt,
        queryresults_events: $yt,
        queryresults_gas_cost: Xyt,
        queryresults_new: Gyt,
        queryresults_toString: Zyt,
        rawTokenType: Jyt,
        runProgram: Yyt,
        runtimeCoinCommitment: Qyt,
        runtimeCoinNullifier: e1t,
        sampleContractAddress: t1t,
        sampleRawTokenType: n1t,
        sampleSigningKey: r1t,
        sampleUserAddress: s1t,
        signData: i1t,
        signatureVerifyingKey: o1t,
        signingKeyFromBip340: a1t,
        stateboundedmerkletree_blank: c1t,
        stateboundedmerkletree_collapse: l1t,
        stateboundedmerkletree_findPathForLeaf: u1t,
        stateboundedmerkletree_height: d1t,
        stateboundedmerkletree_pathForLeaf: f1t,
        stateboundedmerkletree_rehash: h1t,
        stateboundedmerkletree_root: p1t,
        stateboundedmerkletree_toString: g1t,
        stateboundedmerkletree_update: b1t,
        statemap_get: m1t,
        statemap_insert: y1t,
        statemap_keys: w1t,
        statemap_new: _1t,
        statemap_remove: x1t,
        statemap_toString: v1t,
        statevalue_arrayPush: S1t,
        statevalue_asArray: k1t,
        statevalue_asBoundedMerkleTree: T1t,
        statevalue_asCell: E1t,
        statevalue_asMap: C1t,
        statevalue_decode: I1t,
        statevalue_encode: A1t,
        statevalue_logSize: P1t,
        statevalue_new: O1t,
        statevalue_newArray: M1t,
        statevalue_newBoundedMerkleTree: R1t,
        statevalue_newCell: N1t,
        statevalue_newMap: V1t,
        statevalue_newNull: B1t,
        statevalue_toString: D1t,
        statevalue_type: F1t,
        transientCommit: L1t,
        transientHash: z1t,
        upgradeFromTransient: U1t,
        valueToBigInt: H1t,
        verifySignature: j1t,
        vmresults_events: q1t,
        vmresults_gas_cost: K1t,
        vmresults_new: W1t,
        vmresults_stack: $1t,
        vmresults_toString: X1t,
        vmstack_get: G1t,
        vmstack_isStrong: Z1t,
        vmstack_length: J1t,
        vmstack_new: Y1t,
        vmstack_push: Q1t,
        vmstack_removeLast: ewt,
        vmstack_toString: twt
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    hgt(Ewt);
    Tre();
    y3t = ygt();
    w3t = mgt();
    Cwt = /^([0-9A-Fa-f]{2})*$/;
    Ere = 32;
    _3t = function(t) {
        return typeof t == "string" && t.length === Ere * 2 && Cwt.test(t);
    };
    x3t = function(t) {
        return typeof t == "object" && t !== null && t !== void 0 && "bytes" in t && t.bytes instanceof Uint8Array && t.bytes.length == Ere;
    };
    Ig = (t)=>Buffer.from(t, "hex");
    p9 = (t)=>Buffer.from(t).toString("hex");
    ci([
        "click"
    ]);
    var Iwt = se('<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">'), Awt = se('<p class="text-[10px] text-center text-content-muted-light py-1 uppercase">+<!> more coins'), Pwt = se('<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">'), Owt = se('<div class="bg-rose-500/10 border border-rose-500/20 text-rose-500 rounded-lg text-sm p-3">'), Mwt = se('<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...'), Rwt = se('<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'), Nwt = se('<div class="animate-spin w-4 h-4 border-2 border-current border-t-transparent rounded-full">');
    const Vwt = (t)=>{
        const { formatBalance: e } = Tr(), 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 = Iwt(), s = r.firstChild;
            s.firstChild;
            var i = s.nextSibling, o = i.firstChild, a = i.nextSibling;
            return X(s, ()=>t.index + 1, null), X(a, ()=>e(t.coin.generatedNow, 4, "DUST")), mt((c)=>Zf(o, "width", `${n()}%`)), r;
        })();
    }, Bwt = ()=>{
        typeof yo < "u" ? yo.tabs.create({
            url: yo.runtime.getURL("/fullpage.html")
        }) : typeof chrome < "u" && chrome.tabs.create({
            url: chrome.runtime.getURL("/fullpage.html")
        });
    }, Dwt = ()=>{
        const [t, e] = he(void 0), { dustCoins: n, dustBalance: r, unshieldedBalances: s, availableUtxoForDustGeneration: i, isGeneratingDust: o, dustGenerationError: a, startDustGeneration: c, formatBalance: l, isSynced: u } = Tr(), d = "0000000000000000000000000000000000000000000000000000000000000000", f = ()=>s().get(d) ?? 0n, p = _t(()=>{
            const h = n(), b = h.filter((w)=>w.maxCapReachedAt <= new Date), y = h.filter((w)=>w.maxCapReachedAt > new Date), _ = h.reduce((w, E)=>w + E.maxCap, 0n), v = h.reduce((w, E)=>w + E.generatedNow, 0n);
            return {
                totalCoins: h.length,
                availableCoins: b.length,
                pendingCoins: y.length,
                totalValue: _,
                availableValue: v,
                pendingValue: _ - v
            };
        });
        return (()=>{
            var h = Rwt(), b = h.firstChild, y = b.firstChild, _ = y.nextSibling, v = _.firstChild, w = v.firstChild, E = v.nextSibling, I = E.firstChild, D = E.nextSibling, U = D.firstChild, K = b.nextSibling, $ = K.firstChild, ne = $.nextSibling, te = ne.firstChild, J = te.nextSibling, C = J.firstChild, g = ne.nextSibling, x = g.firstChild, A = x.nextSibling, R = A.firstChild, N = g.nextSibling, L = N.firstChild, z = L.firstChild, B = z.nextSibling, S = B.firstChild, O = K.nextSibling, W = O.firstChild, F = W.nextSibling, G = F.nextSibling, ee = G.firstChild, Q = ee.firstChild, Y = ee.nextSibling, ae = Y.firstChild, de = O.nextSibling, pe = de.firstChild, Ae = pe.firstChild, Oe = Ae.firstChild;
            return X(w, ()=>p().totalCoins), X(I, ()=>p().availableCoins), X(U, ()=>p().pendingCoins), X(J, ()=>l(p().availableValue, 4, "DUST"), C), X(A, ()=>l(p().pendingValue, 4, "DUST"), R), X(B, ()=>l(r(), 4, "DUST"), S), X(Q, ()=>l(f())), X(ae, i), X(O, M(wd, {
                get value () {
                    return t();
                },
                onChange: (Re)=>e(Re.toString()),
                class: "w-full",
                get children () {
                    return M(mh, {
                        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), X(h, M(ge, {
                get when () {
                    return n().length > 0;
                },
                get children () {
                    var Re = Pwt(), Me = Re.firstChild, Je = Me.firstChild, Ee = Je.nextSibling, le = Ee.firstChild, qe = Me.nextSibling;
                    return X(Ee, ()=>n().length, le), X(qe, M(tr, {
                        get each () {
                            return n().slice(0, 3);
                        },
                        children: (Ye, ut)=>M(Vwt, {
                                coin: Ye,
                                get index () {
                                    return ut();
                                }
                            })
                    }), null), X(qe, M(ge, {
                        get when () {
                            return n().length > 3;
                        },
                        get children () {
                            var Ye = Awt(), ut = Ye.firstChild, Ce = ut.nextSibling;
                            return Ce.nextSibling, X(Ye, ()=>n().length - 3, Ce), Ye;
                        }
                    }), null), Re;
                }
            }), de), X(pe, M(ge, {
                get when () {
                    return a();
                },
                get children () {
                    var Re = Owt();
                    return X(Re, a), Re;
                }
            }), Ae), X(pe, M(ge, {
                get when () {
                    return !u();
                },
                get children () {
                    return Mwt();
                }
            }), Ae), X(pe, M(yi, {
                variant: "submit",
                size: "submit",
                onClick: ()=>c(t()),
                get disabled () {
                    return !u() || o() || i() === 0;
                },
                title: "Generate DUST",
                "aria-label": "Generate DUST",
                get children () {
                    return M(ge, {
                        get when () {
                            return !o();
                        },
                        get fallback () {
                            return [
                                Nwt(),
                                "Generating..."
                            ];
                        },
                        children: "GENERATE DUST"
                    });
                }
            }), Ae), Ae.$$click = Bwt, X(Oe, M(xft, {})), h;
        })();
    };
    ci([
        "click"
    ]);
    var Cre = se("<div>"), Fwt = se('<i class="icon-box w-6 h-6">'), Lwt = se('<div><h2 class="type-display-xs font-semibold text-header-foreground"></h2><div>');
    const g9 = (t)=>M(vM, Le(t, {
            onOpenChange: (n)=>{
                n && document.activeElement instanceof HTMLElement && document.activeElement.blur(), t.onOpenChange?.(n);
            }
        })), DM = kM, zwt = (t)=>{
        const [, e] = Ze(t, [
            "children",
            "fullScreen"
        ]);
        return M(xM, Le(e, {
            get children () {
                var n = Cre();
                return X(n, ()=>t.children), mt(()=>Mt(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;
            }
        }));
    }, Uwt = (t)=>{
        const [, e] = Ze(t, [
            "class"
        ]);
        return M(_M, Le({
            get class () {
                return vn("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));
    }, b9 = (t)=>{
        const [, e] = Ze(t, [
            "class",
            "children",
            "fullScreen"
        ]), n = ()=>t.fullScreen === !0;
        return M(zwt, {
            get fullScreen () {
                return n();
            },
            get children () {
                return [
                    M(Uwt, {}),
                    M(yM, Le({
                        get class () {
                            return vn("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;
                        }
                    }))
                ];
            }
        });
    }, Hwt = (t)=>{
        const [, e] = Ze(t, [
            "class"
        ]);
        return (()=>{
            var n = Cre();
            return vv(n, Le({
                get class () {
                    return vn("flex flex-col space-y-1.5 text-center sm:text-left", t.class);
                }
            }, e), !1, !1), n;
        })();
    }, jwt = (t)=>{
        const [, e] = Ze(t, [
            "class"
        ]);
        return M(SM, Le({
            get class () {
                return vn("type-text-lg font-semibold tracking-tight", t.class);
            }
        }, e));
    }, qwt = (t)=>{
        const [, e] = Ze(t, [
            "class"
        ]);
        return M(wM, Le({
            get class () {
                return vn("type-text-sm text-content-muted", t.class);
            }
        }, e));
    }, Kwt = (t)=>(()=>{
            var e = Lwt(), n = e.firstChild, r = n.nextSibling;
            return X(n, ()=>t.title), X(r, M(Cw, {
                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 = Fwt();
                    return X(s, M(uM, {})), s;
                }
            })), mt((s)=>{
                var i = vn("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 = vn("ml-auto flex w-16 h-16 shrink-0 items-center justify-center", !t.noBorder && "border-l border-header-divider");
                return i !== s.e && Mt(e, s.e = i), o !== s.t && Mt(r, s.t = o), s;
            }, {
                e: void 0,
                t: void 0
            }), e;
        })();
    var Wwt = se("<span>🤝"), $wt = se('<div class="bg-rose-500/10 border border-rose-500/20 text-rose-500 p-3 rounded-lg text-sm">'), Xwt = se('<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">'), Gwt = se('<div class="animate-spin w-4 h-4 border-2 border-current border-t-transparent rounded-full mr-2">');
    const Zwt = (t)=>{
        const { formatBalance: e, getWallet: n, getDustSecretKey: r, getZswapSecretKeys: s, acquireTxLock: i, releaseTxLock: o } = Tr(), [a, c] = he(""), [l, u] = he(!1), [d, f] = he(null), [p, h] = he(!1), b = (w)=>{
            w.preventDefault();
            const E = w.dataTransfer?.files[0];
            if (E) {
                const I = new FileReader;
                I.onload = (D)=>{
                    const U = D.target?.result;
                    c(U);
                }, I.readAsText(E);
            }
        }, y = (w)=>{
            w.preventDefault();
        }, _ = 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 E = !1;
            try {
                const I = n();
                if (!I) throw new Error("Wallet not found");
                const D = await s(), U = await r();
                if (!D || !U) throw new Error("Zswap secret key or dust secret key not found");
                const K = xn.deserialize("signature", "proof", "binding", Ig(a())), $ = await I.balanceFinalizedTransaction(K, {
                    shieldedSecretKeys: D,
                    dustSecretKey: U
                }, {
                    ttl: new Date(Date.now() + 1800 * 1e3)
                }), ne = await I.finalizeRecipe($);
                E = !0;
                const te = await I.submitTransaction(ne);
            } catch (I) {
                f(E ? "Transaction status uncertain — it may have been submitted. Do not retry." : I instanceof Error ? I.message : "Failed to sponsor transaction");
            } finally{
                u(!1), o();
            }
        }, v = ()=>{
            c(""), f(null), h(!1), t.onClose();
        };
        return M(g9, {
            get open () {
                return t.open;
            },
            onOpenChange: (w)=>!w && v(),
            get children () {
                return M(b9, {
                    class: "max-w-lg",
                    get children () {
                        return [
                            M(Hwt, {
                                get children () {
                                    return [
                                        M(jwt, {
                                            class: "flex items-center gap-2",
                                            get children () {
                                                return [
                                                    Wwt(),
                                                    "Sponsor a Transaction"
                                                ];
                                            }
                                        }),
                                        M(qwt, {
                                            children: "Pay transaction fees for another user using your DUST"
                                        })
                                    ];
                                }
                            }),
                            M(ge, {
                                get when () {
                                    return t.selectedCoin;
                                },
                                get children () {
                                    var w = Xwt(), E = w.firstChild, I = E.firstChild, D = I.nextSibling, U = D.firstChild, K = E.nextSibling, $ = K.nextSibling, ne = $.nextSibling, te = ne.firstChild, J = ne.nextSibling;
                                    return X(U, ()=>e(t.selectedCoin.generatedNow, 4, "DUST")), K.addEventListener("dragover", y), K.addEventListener("drop", b), X(K, M(wd, {
                                        get value () {
                                            return a();
                                        },
                                        onChange: c,
                                        get children () {
                                            return [
                                                M(XT, {
                                                    children: "Serialized UnbalancedTransaction"
                                                }),
                                                M(mlt, {
                                                    placeholder: "Paste the serialized transaction here, or drag & drop a file...",
                                                    class: "min-h-[150px] font-mono text-xs"
                                                })
                                            ];
                                        }
                                    })), X(w, M(ge, {
                                        get when () {
                                            return d();
                                        },
                                        get children () {
                                            var C = $wt();
                                            return X(C, d), C;
                                        }
                                    }), $), te.addEventListener("change", (C)=>h(C.currentTarget.checked)), X(J, M(yi, {
                                        variant: "outline",
                                        onClick: v,
                                        class: "flex-1",
                                        title: "Cancel",
                                        "aria-label": "Cancel",
                                        children: "Cancel"
                                    }), null), X(J, M(yi, {
                                        variant: "submit",
                                        size: "submit",
                                        onClick: _,
                                        get disabled () {
                                            return l() || !a().trim();
                                        },
                                        class: "flex-1",
                                        title: "Balance and submit",
                                        "aria-label": "Balance and submit",
                                        get children () {
                                            return M(ge, {
                                                get when () {
                                                    return !l();
                                                },
                                                get fallback () {
                                                    return [
                                                        Gwt(),
                                                        "Processing..."
                                                    ];
                                                },
                                                children: "Balance & Submit"
                                            });
                                        }
                                    }), null), mt(()=>te.checked = p()), w;
                                }
                            })
                        ];
                    }
                });
            }
        });
    };
    var Jwt = se('<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'), Ywt = se('<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'), Qwt = se('<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'), e_t = se('<div class="flex flex-col gap-2">'), t_t = se('<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.'), n_t = se('<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">'), r_t = se('<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 s_t = (t)=>{
        const { formatBalance: e } = Tr(), 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 = Ywt(), 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, b = h.firstChild, y = b.nextSibling;
            y.nextSibling;
            var _ = f.nextSibling, v = _.firstChild, w = _.nextSibling, E = w.firstChild;
            return X(c, ()=>t.index + 1, null), X(l, ()=>t.coin.token.backingNight.slice(0, 6), u), X(l, ()=>t.coin.token.backingNight.slice(-4), null), X(d, (()=>{
                var I = it(()=>!!r());
                return ()=>I() ? "READY" : n();
            })()), X(p, ()=>e(t.coin.generatedNow, 4, "DUST")), X(h, ()=>e(t.coin.maxCap, 4, "DUST"), y), X(w, ()=>s().toFixed(1), E), X(i, M(ge, {
                get when () {
                    return r();
                },
                get children () {
                    var I = Jwt();
                    return I.$$click = ()=>t.onSponsorClick(t.coin), I;
                }
            }), null), mt((I)=>{
                var D = t.coin.token.backingNight, U = `text-xs px-2 py-0.5 rounded-md font-medium ${r() ? "bg-background text-foreground" : "bg-background text-icon-muted"}`, K = `${s()}%`;
                return D !== I.e && Qt(l, "title", I.e = D), U !== I.t && Mt(d, I.t = U), K !== I.a && Zf(v, "width", I.a = K), I;
            }, {
                e: void 0,
                t: void 0,
                a: void 0
            }), i;
        })();
    }, i_t = ()=>{
        const { dustCoins: t, isSynced: e, formatBalance: n } = Tr(), [r, s] = he(null), [i, o] = he(!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 = n_t(), f = d.firstChild, p = f.firstChild, h = p.firstChild, b = h.nextSibling, y = b.firstChild, _ = f.nextSibling;
                return X(b, ()=>n(l(), 4, "DUST"), y), X(f, M(ge, {
                    get when () {
                        return t().length > 0;
                    },
                    get children () {
                        var v = Qwt(), w = v.firstChild, E = w.firstChild, I = w.nextSibling, D = I.firstChild;
                        return X(E, u), X(D, ()=>t().length - u()), v;
                    }
                }), null), X(_, M(ge, {
                    get when () {
                        return t().length > 0;
                    },
                    get fallback () {
                        return r_t();
                    },
                    get children () {
                        var v = e_t();
                        return X(v, M(tr, {
                            get each () {
                                return t();
                            },
                            children: (w, E)=>M(s_t, {
                                    coin: w,
                                    get index () {
                                        return E();
                                    },
                                    onSponsorClick: a
                                })
                        })), v;
                    }
                }), null), X(_, M(ge, {
                    get when () {
                        return !e();
                    },
                    get children () {
                        return t_t();
                    }
                }), null), d;
            })(),
            M(Zwt, {
                get open () {
                    return i();
                },
                onClose: c,
                get selectedCoin () {
                    return r();
                }
            })
        ];
    };
    ci([
        "click"
    ]);
    function FM() {
        return typeof window > "u" ? !1 : window.__ONE_AM_SHELL__ === "popup";
    }
    var o_t = se('<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)>'), a_t = se('<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">'), c_t = se('<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 l_t = ()=>{
        const t = FM();
        return M(g9, {
            get children () {
                return [
                    M(DM, {
                        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 [
                                o_t(),
                                (()=>{
                                    var e = a_t();
                                    return X(e, M(kft, {})), e;
                                })(),
                                c_t()
                            ];
                        }
                    }),
                    M(b9, {
                        class: "border-0 p-0",
                        fullScreen: t,
                        get children () {
                            return M(dgt, {
                                edgeToEdge: t
                            });
                        }
                    })
                ];
            }
        });
    };
    var u_t = se('<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)">'), d_t = se('<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)>'), f_t = se('<p class="relative break-all text-md leading-6 text-content-muted"style=font-family:var(--font-family-display)>'), h_t = se('<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">'), p_t = se('<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>'), g_t = se('<i class="icon-box h-6 w-6">'), b_t = se('<div><h2 class="type-display-xs font-semibold text-header-foreground"></h2><div>'), m_t = se('<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)>'), y_t = se('<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">'), w_t = se('<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'), __t = se('<div class="flex flex-1 flex-col min-h-0 w-full overflow-y-auto bg-card">'), x_t = se('<div class="px-1 pt-1">'), v_t = se('<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 Gu = (t)=>{
        const [e, n] = he(!1), [r, s] = he("");
        let i;
        At(()=>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 ei(async ()=>{
                        const { default: u } = await import("./browser-XUndnu9Z.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 = h_t(), l = c.firstChild, u = l.firstChild, d = u.firstChild, f = d.firstChild, p = d.nextSibling, h = u.nextSibling, b = h.firstChild, y = b.nextSibling;
            return X(c, M(ge, {
                get when () {
                    return t.shielded;
                },
                get children () {
                    return u_t();
                }
            }), l), X(f, ()=>t.icon()), X(p, ()=>t.label), b.$$click = a, y.$$click = o, X(y, M(ge, {
                get when () {
                    return e();
                },
                fallback: "COPY",
                children: "COPIED"
            })), X(c, M(ge, {
                get when () {
                    return it(()=>!!t.qrOpen)() && r();
                },
                get children () {
                    var _ = d_t(), v = _.firstChild, w = v.firstChild, E = v.nextSibling;
                    return X(E, ()=>t.address), mt((I)=>{
                        var D = r(), U = `QR code for ${t.label} address`;
                        return D !== I.e && Qt(w, "src", I.e = D), U !== I.t && Qt(w, "alt", I.t = U), I;
                    }, {
                        e: void 0,
                        t: void 0
                    }), _;
                }
            }), null), X(c, M(ge, {
                get when () {
                    return it(()=>!t.qrOpen)() && !t.collapsed;
                },
                get children () {
                    var _ = f_t();
                    return X(_, ()=>t.address || "Syncing..."), _;
                }
            }), null), mt((_)=>{
                var v = vn("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"), w = vn("flex items-center gap-1 py-1.5", t.shielded && "border-y border-black/8 bg-card"), E = !t.address, I = `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"}`, D = `Show QR code for ${t.label} address`, U = `Show QR code for ${t.label} address`, K = !t.address, $ = `Copy ${t.label} address`, ne = `Copy ${t.label} address`;
                return v !== _.e && Mt(c, _.e = v), w !== _.t && Mt(u, _.t = w), E !== _.a && (b.disabled = _.a = E), I !== _.o && Mt(b, _.o = I), D !== _.i && Qt(b, "title", _.i = D), U !== _.n && Qt(b, "aria-label", _.n = U), K !== _.s && (y.disabled = _.s = K), $ !== _.h && Qt(y, "title", _.h = $), ne !== _.r && Qt(y, "aria-label", _.r = ne), _;
            }, {
                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;
        })();
    }, iH = ()=>p_t(), oH = (t)=>(()=>{
            var e = b_t(), n = e.firstChild, r = n.nextSibling;
            return X(n, ()=>t.title), X(r, M(Cw, {
                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 = g_t();
                    return X(s, M(uM, {})), s;
                }
            })), mt((s)=>{
                var i = vn("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 = vn("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 && Mt(e, s.e = i), o !== s.t && Mt(r, s.t = o), s;
            }, {
                e: void 0,
                t: void 0
            }), e;
        })(), S_t = ()=>{
        const { shieldedAddress: t, unshieldedAddress: e, dustAddress: n, cardanoAddress: r, cardanoEnabled: s, environmentSettings: i } = Tr(), o = FM(), [a, c] = he(null), l = (d)=>c((f)=>f === d ? null : d), u = ()=>i().environment === "mainnet" && s() && r();
        return M(g9, {
            get children () {
                return [
                    M(DM, {
                        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 [
                                m_t(),
                                (()=>{
                                    var d = y_t();
                                    return X(d, M(ire, {})), d;
                                })(),
                                w_t()
                            ];
                        }
                    }),
                    M(b9, {
                        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 M(ge, {
                                when: o,
                                get fallback () {
                                    return [
                                        (()=>{
                                            var d = x_t();
                                            return X(d, M(oH, {
                                                title: "RECEIVE",
                                                popup: !1
                                            })), d;
                                        })(),
                                        (()=>{
                                            var d = v_t(), f = d.firstChild;
                                            return X(f, M(Gu, {
                                                label: "Shielded",
                                                icon: ()=>M(Tg, {}),
                                                get address () {
                                                    return t();
                                                },
                                                shielded: !0,
                                                get qrOpen () {
                                                    return a() === "Shielded";
                                                },
                                                get collapsed () {
                                                    return it(()=>a() !== null)() && a() !== "Shielded";
                                                },
                                                onToggleQr: ()=>l("Shielded")
                                            }), null), X(f, M(Gu, {
                                                label: "Unshielded",
                                                icon: ()=>M(Eg, {}),
                                                get address () {
                                                    return e();
                                                },
                                                get qrOpen () {
                                                    return a() === "Unshielded";
                                                },
                                                get collapsed () {
                                                    return it(()=>a() !== null)() && a() !== "Unshielded";
                                                },
                                                onToggleQr: ()=>l("Unshielded")
                                            }), null), X(f, M(Gu, {
                                                label: "Dust",
                                                icon: ()=>M(sE, {}),
                                                get address () {
                                                    return n();
                                                },
                                                get qrOpen () {
                                                    return a() === "Dust";
                                                },
                                                get collapsed () {
                                                    return it(()=>a() !== null)() && a() !== "Dust";
                                                },
                                                onToggleQr: ()=>l("Dust")
                                            }), null), X(f, M(ge, {
                                                get when () {
                                                    return u();
                                                },
                                                get children () {
                                                    return M(Gu, {
                                                        label: "Cardano",
                                                        icon: ()=>M(iH, {}),
                                                        get address () {
                                                            return r();
                                                        },
                                                        get qrOpen () {
                                                            return a() === "Cardano";
                                                        },
                                                        get collapsed () {
                                                            return it(()=>a() !== null)() && a() !== "Cardano";
                                                        },
                                                        onToggleQr: ()=>l("Cardano")
                                                    });
                                                }
                                            }), null), d;
                                        })()
                                    ];
                                },
                                get children () {
                                    return [
                                        M(oH, {
                                            title: "RECEIVE",
                                            popup: !0
                                        }),
                                        (()=>{
                                            var d = __t();
                                            return X(d, M(Gu, {
                                                label: "Shielded",
                                                icon: ()=>M(Tg, {}),
                                                get address () {
                                                    return t();
                                                },
                                                shielded: !0,
                                                get qrOpen () {
                                                    return a() === "Shielded";
                                                },
                                                get collapsed () {
                                                    return it(()=>a() !== null)() && a() !== "Shielded";
                                                },
                                                onToggleQr: ()=>l("Shielded")
                                            }), null), X(d, M(Gu, {
                                                label: "Unshielded",
                                                icon: ()=>M(Eg, {}),
                                                get address () {
                                                    return e();
                                                },
                                                get qrOpen () {
                                                    return a() === "Unshielded";
                                                },
                                                get collapsed () {
                                                    return it(()=>a() !== null)() && a() !== "Unshielded";
                                                },
                                                onToggleQr: ()=>l("Unshielded")
                                            }), null), X(d, M(Gu, {
                                                label: "Dust",
                                                icon: ()=>M(sE, {}),
                                                get address () {
                                                    return n();
                                                },
                                                get qrOpen () {
                                                    return a() === "Dust";
                                                },
                                                get collapsed () {
                                                    return it(()=>a() !== null)() && a() !== "Dust";
                                                },
                                                onToggleQr: ()=>l("Dust")
                                            }), null), X(d, M(ge, {
                                                get when () {
                                                    return u();
                                                },
                                                get children () {
                                                    return M(Gu, {
                                                        label: "Cardano",
                                                        icon: ()=>M(iH, {}),
                                                        get address () {
                                                            return r();
                                                        },
                                                        get qrOpen () {
                                                            return a() === "Cardano";
                                                        },
                                                        get collapsed () {
                                                            return it(()=>a() !== null)() && a() !== "Cardano";
                                                        },
                                                        onToggleQr: ()=>l("Cardano")
                                                    });
                                                }
                                            }), null), d;
                                        })()
                                    ];
                                }
                            });
                        }
                    })
                ];
            }
        });
    };
    ci([
        "click"
    ]);
    var k_t = se('<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)>'), T_t = se('<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">'), E_t = se('<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'), C_t = se('<div class="flex-1 min-h-0 overflow-y-auto"><div class="grid grid-cols-1 lg:grid-cols-2">');
    const I_t = ()=>{
        const t = FM();
        return M(g9, {
            get children () {
                return [
                    M(DM, {
                        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 [
                                k_t(),
                                (()=>{
                                    var e = T_t();
                                    return X(e, M(sE, {})), e;
                                })(),
                                E_t()
                            ];
                        }
                    }),
                    M(b9, {
                        class: t ? "flex flex-col p-0 border-0" : "max-w-5xl flex flex-col p-0 border-0",
                        fullScreen: t,
                        get children () {
                            return [
                                M(Kwt, {
                                    title: "YOUR DUST",
                                    noBorder: t,
                                    class: "bg-bg-primary-solid"
                                }),
                                (()=>{
                                    var e = C_t(), n = e.firstChild;
                                    return X(n, M(Dwt, {}), null), X(n, M(i_t, {}), null), e;
                                })()
                            ];
                        }
                    })
                ];
            }
        });
    }, A_t = "https://raw.githubusercontent.com/webisoftSoftware/1AM-app-registery/main/registry.json", p6 = "local:appRegistry", aH = "local:appRegistryTs", P_t = 3600 * 1e3, O_t = [
        {
            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 cH(t) {
        try {
            const e = new URL(t);
            return e.protocol === "https:" || e.protocol === "http:";
        } catch  {
            return !1;
        }
    }
    function g6(t) {
        return t.filter((e)=>cH(e.url) && cH(e.icon));
    }
    async function M_t() {
        try {
            const t = await cn.getItem(aH);
            if (t && Date.now() - t < P_t) {
                const e = await cn.getItem(p6);
                if (e?.apps?.length) return g6(e.apps);
            }
        } catch  {}
        try {
            const t = await fetch(A_t, {
                cache: "no-cache"
            });
            if (t.ok) {
                const e = await t.json();
                if (e?.apps?.length) return await cn.setItem(p6, e), await cn.setItem(aH, Date.now()), g6(e.apps);
            }
        } catch  {}
        try {
            const t = await cn.getItem(p6);
            if (t?.apps?.length) return g6(t.apps);
        } catch  {}
        return O_t;
    }
    function R_t(t, e) {
        return t.filter((n)=>n.networks.includes(e) || n.networks.includes("*"));
    }
    var N_t = se('<img class="w-7 h-7 object-contain">'), V_t = se("<div>"), B_t = se('<span class="text-white font-bold text-sm">'), D_t = se('<div class=space-y-2><p class="text-[10px] font-semibold text-icon-muted uppercase tracking-wider">Featured'), F_t = se('<p class="text-[10px] font-semibold text-icon-muted uppercase tracking-wider">All Apps'), L_t = se('<div class="grid grid-cols-2 gap-2">'), z_t = se('<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'), U_t = se("<button>"), H_t = se('<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">'), j_t = se('<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'), q_t = se('<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 K_t = {
        defi: "bg-emerald-500",
        gaming: "bg-amber-500",
        tools: "bg-blue-500",
        social: "bg-purple-500",
        nft: "bg-rose-500",
        other: "bg-gray-500"
    }, W_t = (t)=>{
        const [e, n] = he(!1), r = ()=>K_t[t.app.category] || "bg-gray-500";
        return (()=>{
            var s = V_t();
            return X(s, M(ge, {
                get when () {
                    return !e();
                },
                get fallback () {
                    return (()=>{
                        var i = B_t();
                        return X(i, ()=>t.app.name.slice(0, 2).toUpperCase()), i;
                    })();
                },
                get children () {
                    var i = N_t();
                    return i.addEventListener("error", ()=>n(!0)), mt((o)=>{
                        var a = t.app.icon, c = t.app.name;
                        return a !== o.e && Qt(i, "src", o.e = a), c !== o.t && Qt(i, "alt", o.t = c), o;
                    }, {
                        e: void 0,
                        t: void 0
                    }), i;
                }
            })), mt(()=>Mt(s, `${t.size || "w-10 h-10"} rounded-lg flex items-center justify-center overflow-hidden shrink-0 ${e() ? r() : "bg-background"}`)), s;
        })();
    }, $_t = [
        {
            id: "all",
            label: "All"
        },
        {
            id: "defi",
            label: "DeFi"
        },
        {
            id: "gaming",
            label: "Gaming"
        },
        {
            id: "tools",
            label: "Tools"
        },
        {
            id: "social",
            label: "Social"
        },
        {
            id: "nft",
            label: "NFT"
        }
    ], X_t = ()=>{
        const { environmentSettings: t } = Tr(), [e] = bH(M_t), [n, r] = he("all"), s = _t(()=>{
            const c = e() || [], l = t().environment, u = R_t(c, l);
            return n() === "all" ? u : u.filter((d)=>d.category === n());
        }), i = _t(()=>s().filter((c)=>c.featured)), o = _t(()=>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 = z_t(), l = c.firstChild, u = l.nextSibling;
            return X(l, M(tr, {
                each: $_t,
                children: (d)=>(()=>{
                        var f = U_t();
                        return f.$$click = ()=>r(d.id), X(f, ()=>d.label), mt(()=>Mt(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;
                    })()
            })), X(c, M(ge, {
                get when () {
                    return it(()=>n() === "all")() && i().length > 0;
                },
                get children () {
                    var d = D_t();
                    return d.firstChild, X(d, M(tr, {
                        get each () {
                            return i();
                        },
                        children: (f)=>(()=>{
                                var p = H_t(), h = p.firstChild, b = h.firstChild, y = b.firstChild, _ = b.nextSibling;
                                return p.$$click = ()=>a(f), X(p, M(W_t, {
                                    app: f,
                                    size: "w-10 h-10"
                                }), h), X(y, ()=>f.name), X(b, M(ge, {
                                    get when () {
                                        return f.new;
                                    },
                                    get children () {
                                        return M(m0, {
                                            tone: "success",
                                            variant: "color",
                                            size: "sm",
                                            class: "font-mono uppercase",
                                            children: "New"
                                        });
                                    }
                                }), null), X(_, ()=>f.description), p;
                            })()
                    }), null), d;
                }
            }), u), X(u, M(ge, {
                get when () {
                    return it(()=>n() === "all")() && i().length > 0;
                },
                get children () {
                    return F_t();
                }
            }), null), X(u, M(ge, {
                get when () {
                    return o().length > 0 || n() !== "all" && s().length > 0;
                },
                get fallback () {
                    return j_t();
                },
                get children () {
                    var d = L_t();
                    return X(d, M(tr, {
                        get each () {
                            return it(()=>n() !== "all")() ? s() : o();
                        },
                        children: (f)=>(()=>{
                                var p = q_t(), h = p.firstChild, b = h.firstChild, y = h.nextSibling, _ = y.firstChild, v = _.nextSibling;
                                return p.$$click = ()=>a(f), b.addEventListener("error", (w)=>{
                                    w.target.style.display = "none";
                                }), X(_, ()=>f.name), X(v, ()=>f.description), mt((w)=>{
                                    var E = f.icon, I = f.name;
                                    return E !== w.e && Qt(b, "src", w.e = E), I !== w.t && Qt(b, "alt", w.t = I), w;
                                }, {
                                    e: void 0,
                                    t: void 0
                                }), p;
                            })()
                    })), d;
                }
            }), null), c;
        })();
    };
    ci([
        "click"
    ]);
    var G_t = se('<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">'), Z_t = se('<div class="w-3 h-3 border-2 border-[var(--fg-warning-secondary)] border-t-transparent rounded-full animate-spin">'), J_t = se('<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">'), Y_t = se('<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">'), Q_t = se('<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">'), e2t = se('<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'), t2t = se('<div><p class="text-xs font-medium font-mono uppercase tracking-wide">'), n2t = se('<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">'), r2t = se('<div><div class=shrink-0></div><div class="flex-1 min-w-0">'), s2t = se("<div>"), i2t = se('<p class="text-[11px] opacity-70 mt-0.5 font-mono">'), o2t = se('<p class="text-[10px] font-mono opacity-50 mt-0.5 truncate">'), a2t = se('<div><p class="text-xs font-semibold font-mono uppercase tracking-wide">'), lH = se('<div class="flex flex-col h-full"><div class="flex-1 min-h-0 overflow-hidden">'), c2t = se('<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">'), l2t = se('<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...'), u2t = se("<section>"), d2t = se('<div class="flex flex-[0_0_auto] border-b border-[var(--border-secondary)] px-0 md:px-8 bg-[var(--bg-primary)]">'), f2t = se('<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 [uH, w2] = he(!1), [dH, _2] = he(!1), h2t = ()=>{
        const t = Tr(), { toasts: e, dismissToast: n, isSynced: r, transactions: s, networkHealth: i, refreshSync: o } = t, [a, c] = he(!1), [l, u] = he(null), d = ()=>s().length > 0, f = ()=>!r(), p = ()=>{
            const w = e();
            if (w.length === 0) return null;
            const E = w[w.length - 1];
            return E.id === l() ? null : E;
        }, h = ()=>f() || p() !== null;
        ot(()=>{
            h() ? requestAnimationFrame(()=>c(!0)) : c(!1);
        }), ot(()=>{
            const w = e().length > 0 ? e()[e().length - 1] : null;
            w && w.id !== l() && u(null);
        });
        const b = ()=>{
            const w = p();
            w && (u(w.id), n(w.id));
        }, y = ()=>f() ? "syncing" : p() ? "toast" : "none", _ = ()=>i().overall === "down" || i().indexer === "down", v = ()=>{
            const w = y();
            if (w === "syncing" && _()) return "bg-[var(--bg-error-primary)] border-[var(--border-error-subtle)] text-[var(--text-error-primary)]";
            if (w === "syncing") return "bg-[var(--bg-warning-primary)] border-[color:color-mix(in_srgb,var(--warning-foreground)_30%,transparent)] text-[var(--text-warning-primary)]";
            const E = p();
            if (!E) return "";
            switch(E.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 w = s2t();
            return X(w, M(ge, {
                get when () {
                    return h();
                },
                get children () {
                    var E = r2t(), I = E.firstChild, D = I.nextSibling;
                    return X(I, M(ge, {
                        get when () {
                            return it(()=>y() === "syncing")() && _();
                        },
                        get children () {
                            return G_t();
                        }
                    }), null), X(I, M(ge, {
                        get when () {
                            return it(()=>y() === "syncing")() && !_();
                        },
                        get children () {
                            return Z_t();
                        }
                    }), null), X(I, M(ge, {
                        get when () {
                            return y() === "toast";
                        },
                        get children () {
                            return [
                                M(ge, {
                                    get when () {
                                        return p()?.type === "success";
                                    },
                                    get children () {
                                        return J_t();
                                    }
                                }),
                                M(ge, {
                                    get when () {
                                        return p()?.type === "error";
                                    },
                                    get children () {
                                        return Y_t();
                                    }
                                }),
                                M(ge, {
                                    get when () {
                                        return p()?.type === "info";
                                    },
                                    get children () {
                                        return Q_t();
                                    }
                                })
                            ];
                        }
                    }), null), X(D, M(ge, {
                        get when () {
                            return y() === "syncing";
                        },
                        get children () {
                            var U = t2t(), K = U.firstChild;
                            return X(K, (()=>{
                                var $ = it(()=>!!_());
                                return ()=>$() ? "Network unavailable" : d() ? "Syncing new transactions..." : "Syncing with the network...";
                            })()), X(U, M(ge, {
                                get when () {
                                    return _();
                                },
                                get children () {
                                    var $ = e2t(), ne = $.firstChild, te = ne.nextSibling;
                                    return X(ne, (()=>{
                                        var J = it(()=>i().indexer === "down" && i().rpc === "down");
                                        return ()=>J() ? "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.";
                                    })()), te.$$click = async ()=>{
                                        const { checkNetworkHealth: J } = await ei(async ()=>{
                                            const { checkNetworkHealth: g } = await Promise.resolve().then(()=>m2);
                                            return {
                                                checkNetworkHealth: g
                                            };
                                        }, void 0);
                                        (await J(t.environmentSettings().environment)).overall === "healthy" && o();
                                    }, $;
                                }
                            }), null), U;
                        }
                    }), null), X(D, M(ge, {
                        get when () {
                            return it(()=>y() === "toast")() && p();
                        },
                        children: (U)=>{
                            const K = ()=>p();
                            return (()=>{
                                var $ = a2t(), ne = $.firstChild;
                                return X(ne, ()=>K().title), X($, M(ge, {
                                    get when () {
                                        return K().message;
                                    },
                                    get children () {
                                        var te = i2t();
                                        return X(te, ()=>K().message), te;
                                    }
                                }), null), X($, M(ge, {
                                    get when () {
                                        return K().txHash;
                                    },
                                    get children () {
                                        var te = o2t();
                                        return X(te, ()=>K().txHash), te;
                                    }
                                }), null), $;
                            })();
                        }
                    }), null), X(E, M(ge, {
                        get when () {
                            return y() === "toast";
                        },
                        get children () {
                            var U = n2t();
                            return U.$$click = b, U;
                        }
                    }), null), mt(()=>Mt(E, `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)] ${v()}`)), E;
                }
            })), mt(()=>Mt(w, `overflow-hidden transition-all duration-300 ease-in-out ${a() && h() ? "max-h-24 opacity-100" : "max-h-0 opacity-0"}`)), w;
        })();
    }, p2t = ()=>{
        const { isLoading: t, error: e, isSynced: n } = Tr();
        return ot(()=>{
            document.documentElement.toggleAttribute("data-syncing", !n());
        }), [
            M(ge, {
                get when () {
                    return uH();
                },
                get children () {
                    var r = lH(), s = r.firstChild;
                    return X(r, M(Q7, {}), s), X(s, M(Kht, {
                        onBack: ()=>w2(!1)
                    })), r;
                }
            }),
            M(ge, {
                get when () {
                    return dH();
                },
                get children () {
                    var r = lH(), s = r.firstChild;
                    return X(r, M(Q7, {}), s), X(s, M(wpt, {
                        onBack: ()=>_2(!1)
                    })), r;
                }
            }),
            M(ge, {
                get when () {
                    return it(()=>!uH())() && !dH();
                },
                get children () {
                    return [
                        M(Q7, {}),
                        (()=>{
                            var r = f2t(), s = r.firstChild, i = s.firstChild;
                            return X(i, M(ge, {
                                get when () {
                                    return e();
                                },
                                get children () {
                                    var o = c2t(), a = o.firstChild, c = a.nextSibling;
                                    return X(c, e), o;
                                }
                            }), null), X(i, M(ge, {
                                get when () {
                                    return t();
                                },
                                get children () {
                                    return l2t();
                                }
                            }), null), X(i, M(ge, {
                                get when () {
                                    return it(()=>!t())() && !e();
                                },
                                get children () {
                                    return [
                                        M(h2t, {}),
                                        M(zpt, {}),
                                        (()=>{
                                            var o = u2t();
                                            return X(o, M(l_t, {}), null), X(o, M(S_t, {}), null), X(o, M(I_t, {}), null), mt(()=>Mt(o, `flex border-b border-[var(--border-secondary)] bg-background ${n() ? "" : "[&_*]:!transition-none [&_*]:!duration-0"}`)), o;
                                        })(),
                                        M(out, {
                                            defaultValue: "transactions",
                                            class: "flex flex-col bg-[var(--bg-primary)]",
                                            get children () {
                                                return [
                                                    (()=>{
                                                        var o = d2t();
                                                        return X(o, M(aut, {
                                                            class: "h-auto p-0 gap-3 bg-transparent border-0",
                                                            get children () {
                                                                return [
                                                                    M(lut, {
                                                                        variant: "line",
                                                                        class: "bg-foreground"
                                                                    }),
                                                                    M($7, {
                                                                        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"
                                                                    }),
                                                                    M($7, {
                                                                        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"
                                                                    }),
                                                                    M($7, {
                                                                        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"
                                                                    })
                                                                ];
                                                            }
                                                        })), o;
                                                    })(),
                                                    M(X7, {
                                                        value: "assets",
                                                        class: "mt-0 bg-[var(--bg-primary)]",
                                                        get children () {
                                                            return M(Opt, {});
                                                        }
                                                    }),
                                                    M(X7, {
                                                        value: "transactions",
                                                        class: "mt-0 bg-[var(--bg-primary)]",
                                                        get children () {
                                                            return M(y0t, {});
                                                        }
                                                    }),
                                                    M(X7, {
                                                        value: "apps",
                                                        class: "mt-0 bg-[var(--bg-primary)]",
                                                        get children () {
                                                            return M(X_t, {});
                                                        }
                                                    })
                                                ];
                                            }
                                        })
                                    ];
                                }
                            }), null), r;
                        })()
                    ];
                }
            })
        ];
    }, g2t = ()=>M(p2t, {});
    ci([
        "click"
    ]);
    var b2t = se('<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)]">'), m2t = se('<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">'), y2t = se('<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.'), w2t = se('<div class="w-4 h-4 mr-2 border-2 border-white border-t-transparent rounded-full animate-spin">');
    const _2t = (t)=>{
        const [e, n] = he(""), [r, s] = he(null), [i, o] = he(!1), a = async ()=>{
            if (!e().trim()) return;
            s(null), o(!0);
            const l = new TextEncoder().encode(e());
            n("");
            try {
                await t.onUnlock(l);
            } catch (u) {
                s(u instanceof Error ? u.message : "Wrong password"), o(!1);
            } finally{
                l.fill(0);
            }
        }, c = (l)=>{
            l.key === "Enter" && a();
        };
        return (()=>{
            var l = y2t(), u = l.firstChild, d = u.firstChild, f = d.firstChild, p = u.nextSibling, h = p.firstChild, b = h.firstChild, y = b.nextSibling;
            return X(d, M(Zm, {
                class: "h-7 w-auto",
                animated: !0
            }), f), X(h, M(wd, {
                get value () {
                    return e();
                },
                onChange: n,
                get children () {
                    return M(mh, {
                        type: "password",
                        placeholder: "Enter password",
                        class: "h-11 type-text-sm border-border text-foreground placeholder:text-content-muted-light rounded-none",
                        onKeyPress: c,
                        autofocus: !0
                    });
                }
            }), y), X(h, M(ge, {
                get when () {
                    return r();
                },
                get children () {
                    var _ = b2t(), v = _.firstChild, w = v.firstChild, E = w.nextSibling;
                    return X(E, r), _;
                }
            }), y), X(h, M(yi, {
                class: "w-full mt-4 bg-bg-primary-solid text-fg-white hover:opacity-90 rounded-none",
                onClick: a,
                get disabled () {
                    return !e().trim() || i();
                },
                get children () {
                    return M(ge, {
                        get when () {
                            return !i();
                        },
                        get fallback () {
                            return [
                                w2t(),
                                "UNLOCKING..."
                            ];
                        },
                        get children () {
                            return [
                                m2t(),
                                "UNLOCK"
                            ];
                        }
                    });
                }
            }), y), l;
        })();
    };
    async function x2t(t, e, n, r, s, i, o) {
        const { messageType: a, origin: c, payload: l } = t;
        if (!e) return Pt("InternalError", "Wallet not initialized");
        try {
            switch(a){
                case "DAPP_GET_SHIELDED_BALANCES":
                    return await v2t(e);
                case "DAPP_GET_UNSHIELDED_BALANCES":
                    return await S2t(e);
                case "DAPP_GET_DUST_BALANCE":
                    return await k2t(e, o);
                case "DAPP_GET_SHIELDED_ADDRESSES":
                    return await T2t(e, r, n);
                case "DAPP_GET_UNSHIELDED_ADDRESS":
                    return await E2t(e, n);
                case "DAPP_GET_DUST_ADDRESS":
                    return await C2t(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 I2t(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) ? Pt("InvalidRequest", "Invalid sign data payload: requires data (string) and options.encoding (hex|base64|text)") : u.data.length > 64 * 1024 ? Pt("InvalidRequest", "Sign data too large (max 64 KB)") : await A2t(u, i, n);
                    }
                case "DAPP_MAKE_TRANSFER":
                    {
                        const u = l, d = u?.desiredOutputs ?? u?.outputs;
                        if (!u || !Array.isArray(d) || d.length === 0) return Pt("InvalidRequest", "Invalid transfer payload: requires desiredOutputs array");
                        if (d.length > 50) return Pt("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 Pt("InvalidRequest", "Invalid transfer output: requires recipient (string), type (string), value, and kind (shielded|unshielded)");
                            if (f.recipient.length > 256) return Pt("InvalidRequest", "Recipient address too long");
                            try {
                                const p = BigInt(f.value);
                                if (p <= 0n) return Pt("InvalidRequest", "Transfer amount must be positive");
                                if (p > 10n ** 36n) return Pt("InvalidRequest", "Transfer amount exceeds maximum");
                            } catch  {
                                return Pt("InvalidRequest", "Invalid transfer amount");
                            }
                        }
                        return await N2t(e, {
                            outputs: d
                        }, r, s, i, n);
                    }
                case "DAPP_MAKE_INTENT":
                    {
                        const u = l;
                        if (!u || !Array.isArray(u.desiredInputs) || !Array.isArray(u.desiredOutputs)) return Pt("InvalidRequest", "Invalid intent payload: requires desiredInputs and desiredOutputs arrays");
                        if (u.desiredInputs.length > 50) return Pt("InvalidRequest", "Too many desired inputs (max 50)");
                        if (u.desiredOutputs.length > 50) return Pt("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 Pt("InvalidRequest", "Invalid desired input: requires type (string) and value");
                            try {
                                const f = BigInt(d.value);
                                if (f <= 0n) return Pt("InvalidRequest", "Input amount must be positive");
                                if (f > 10n ** 36n) return Pt("InvalidRequest", "Input amount exceeds maximum");
                            } catch  {
                                return Pt("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 Pt("InvalidRequest", "Invalid desired output: requires recipient, type, value, and kind (shielded|unshielded)");
                            if (d.recipient.length > 256) return Pt("InvalidRequest", "Recipient address too long");
                            try {
                                const f = BigInt(d.value);
                                if (f <= 0n) return Pt("InvalidRequest", "Output amount must be positive");
                                if (f > 10n ** 36n) return Pt("InvalidRequest", "Output amount exceeds maximum");
                            } catch  {
                                return Pt("InvalidRequest", "Invalid output amount");
                            }
                        }
                        return await P2t(e, u, r, s, n);
                    }
                case "DAPP_BALANCE_UNSEALED_TX":
                    {
                        const u = l;
                        if (!u || typeof u.tx != "string" || !u.tx) return Pt("InvalidRequest", "Invalid payload: requires tx (hex string)");
                        if (u.tx.length > 2 * 1024 * 1024) return Pt("InvalidRequest", "Transaction too large");
                        if (o?.dustSponsorship && o?.balanceServiceUrl && !u._useLocalDust) try {
                            const { balanceOnly: d } = await ei(async ()=>{
                                const { balanceOnly: h } = await import("./balance-client-mXpQOift.js");
                                return {
                                    balanceOnly: h
                                };
                            }, []), f = Ig(u.tx), p = await d(o.balanceServiceUrl, f, o.apiKey, o.clientId);
                            return Ps({
                                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 R2t(e, u, r, s, i, n);
                    }
                case "DAPP_BALANCE_SEALED_TX":
                    {
                        const u = l;
                        if (!u || typeof u.tx != "string" || !u.tx) return Pt("InvalidRequest", "Invalid payload: requires tx (hex string)");
                        if (u.tx.length > 2 * 1024 * 1024) return Pt("InvalidRequest", "Transaction too large");
                        if (o?.dustSponsorship && o?.balanceServiceUrl && !u._useLocalDust) try {
                            const { balanceOnly: d } = await ei(async ()=>{
                                const { balanceOnly: h } = await import("./balance-client-mXpQOift.js");
                                return {
                                    balanceOnly: h
                                };
                            }, []), f = Ig(u.tx), p = await d(o.balanceServiceUrl, f, o.apiKey, o.clientId);
                            return Ps({
                                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 M2t(e, u, r, s);
                    }
                case "DAPP_SUBMIT_TRANSACTION":
                    {
                        const u = l;
                        return !u || typeof u.tx != "string" || !u.tx ? Pt("InvalidRequest", "Invalid payload: requires tx (hex string)") : u.tx.length > 2 * 1024 * 1024 ? Pt("InvalidRequest", "Transaction too large") : await O2t(e, u);
                    }
                case "DAPP_PROVING_CHECK":
                    {
                        const u = l;
                        if (!u?.serializedPreimage || !u?.keyLocation) return Pt("InvalidRequest", "Invalid proving check payload");
                        try {
                            const d = new Uint8Array(u.serializedPreimage), f = u.zkir ? new Uint8Array(u.zkir) : void 0, p = RE(d, f), h = o?.proofServerUrl || o?.balanceServiceUrl;
                            if (!h) return Pt("InternalError", "No proof server configured");
                            const b = {
                                "Content-Type": "application/octet-stream"
                            };
                            o?.apiKey && (b["X-API-Key"] = o.apiKey), o?.clientId && (b["X-Client-ID"] = o.clientId);
                            let y = await fetch(new URL("/check", h).toString(), {
                                method: "POST",
                                headers: b,
                                body: p,
                                signal: AbortSignal.timeout(6e4)
                            });
                            if (y.status === 404 && (y = await fetch(new URL("/verify", h).toString(), {
                                method: "POST",
                                headers: b,
                                body: p,
                                signal: AbortSignal.timeout(6e4)
                            })), y.status === 404) return Pt("InternalError", "Proof server does not support /check — ask your admin to add it");
                            if (!y.ok) {
                                const E = await y.text().catch(()=>"");
                                return console.error("[DApp] PROVING_CHECK server error:", y.status, E), Pt("InternalError", `Proof server check failed (${y.status}): ${E.slice(0, 200)}`);
                            }
                            const _ = new Uint8Array(await y.arrayBuffer()), w = NE(_).map((E)=>E === void 0 ? null : E.toString());
                            return Ps(w);
                        } catch (d) {
                            const f = d instanceof Error ? d.message : String(d);
                            return console.error("[DApp] PROVING_CHECK error:", f, d), Pt("InternalError", `Proving check failed: ${f}`);
                        }
                    }
                case "DAPP_PROVING_PROVE":
                    {
                        const u = l;
                        if (!u?.serializedPreimage || !u?.keyLocation) return Pt("InvalidRequest", "Invalid proving payload");
                        try {
                            const d = new Uint8Array(u.serializedPreimage), f = u.overwriteBindingInput ? BigInt(u.overwriteBindingInput) : void 0, p = 100 * 1024 * 1024, h = async (D)=>{
                                const U = atob(D), K = Uint8Array.from(U, (A, R)=>U.charCodeAt(R)), $ = new DecompressionStream("gzip"), ne = $.writable.getWriter();
                                ne.write(K), ne.close();
                                const te = [], J = $.readable.getReader();
                                let C = 0;
                                for(;;){
                                    const { done: A, value: R } = await J.read();
                                    if (A) break;
                                    if (C += R.length, C > p) throw new Error("Decompressed payload exceeds size limit");
                                    te.push(R);
                                }
                                const g = new Uint8Array(C);
                                let x = 0;
                                for (const A of te)g.set(A, x), x += A.length;
                                return g;
                            };
                            let b;
                            if (u.zkirGz && u.proverKeyGz && u.verifierKeyGz) {
                                const [D, U, K] = await Promise.all([
                                    h(u.zkirGz),
                                    h(u.proverKeyGz),
                                    h(u.verifierKeyGz)
                                ]);
                                b = {
                                    ir: D,
                                    proverKey: U,
                                    verifierKey: K
                                };
                            }
                            const y = VE(d, f, b), _ = o?.proofServerUrl || o?.balanceServiceUrl;
                            if (!_) return Pt("InternalError", "No proof server configured");
                            const v = new URL("/prove", _), w = {
                                "Content-Type": "application/octet-stream"
                            };
                            o?.apiKey && (w["X-API-Key"] = o.apiKey), o?.clientId && (w["X-Client-ID"] = o.clientId);
                            const E = await fetch(v.toString(), {
                                method: "POST",
                                headers: w,
                                body: y,
                                signal: AbortSignal.timeout(12e4)
                            });
                            if (!E.ok) {
                                const D = await E.text().catch(()=>"");
                                return console.error("[DApp] PROVING_PROVE server error:", E.status, D), Pt("InternalError", `Proof server prove failed (${E.status}): ${D.slice(0, 200)}`);
                            }
                            const I = new Uint8Array(await E.arrayBuffer());
                            return Ps(Array.from(I));
                        } catch (d) {
                            const f = d instanceof Error ? d.message : String(d);
                            return console.error("[DApp] PROVING_PROVE error:", f, d), Pt("InternalError", `Proving failed: ${f}`);
                        }
                    }
                default:
                    return Pt("InvalidRequest", "Unknown message type");
            }
        } catch (u) {
            return console.error(`[DApp Handler] Error handling ${a}:`, u), Pt("InternalError", "An internal wallet error occurred");
        }
    }
    function fi(t, e) {
        chrome.runtime.sendMessage({
            type: "WALLET_RESPONSE",
            requestId: t,
            data: e
        });
    }
    function Ps(t) {
        return {
            success: !0,
            data: t
        };
    }
    function Pt(t, e) {
        return {
            success: !1,
            error: {
                code: t,
                reason: e
            }
        };
    }
    async function v2t(t) {
        const e = await Mn(t.state().pipe(bu((r)=>r.isSynced))), n = {};
        for (const [r, s] of Object.entries(e.shielded.balances))n[r] = s.toString();
        return Ps(n);
    }
    async function S2t(t) {
        const e = await Mn(t.state().pipe(bu((r)=>r.isSynced))), n = {};
        for (const [r, s] of Object.entries(e.unshielded.balances))n[r] = s.toString();
        return Ps(n);
    }
    async function k2t(t, e) {
        const n = await Mn(t.state().pipe(bu((a)=>a.isSynced))), r = new Date;
        let s = n.dust.balance(r), o = n.unshielded.balances[Av().raw] || 0n;
        return e?.dustSponsorship && s === 0n && (s = 1000000000000000n, o = s), Ps({
            cap: o.toString(),
            balance: s.toString()
        });
    }
    async function T2t(t, e, n) {
        if (!e) return Pt("InternalError", "Shielded keys not available");
        const r = e.coinPublicKey, s = e.encryptionPublicKey, i = ra.fromHexString(r), o = Xl.fromHexString(s), a = new $l(i, o), c = ns.encode(n.networkId, a).toString(), l = ra.codec.encode(n.networkId, i).toString(), u = Xl.codec.encode(n.networkId, o).toString();
        return Ps({
            shieldedAddress: c,
            shieldedCoinPublicKey: l,
            shieldedEncryptionPublicKey: u
        });
    }
    async function E2t(t, e) {
        const n = await Mn(t.state().pipe(bu((o)=>o.isSynced))), r = n.unshielded.address?.data, s = r ? new Hi(r) : n.unshielded.address, i = ns.encode(e.networkId, s).toString();
        return Ps({
            unshieldedAddress: i
        });
    }
    async function C2t(t, e) {
        const n = await Mn(t.state().pipe(bu((r)=>r.isSynced)));
        return Ps({
            dustAddress: ns.encode(e.networkId, n.dust.address).toString()
        });
    }
    async function I2t(t, e) {
        return Ps([]);
    }
    async function A2t(t, e, n) {
        if (!e) return Pt("InternalError", "Signing keys not available");
        const { data: r, options: s } = t, i = yd(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 Pt("InvalidRequest", "Unknown encoding");
        }
        const a = i.signData(o), c = i.getPublicKey(), l = typeof c == "object" && "toBytes" in c ? c.toBytes() : c;
        return Ps({
            data: r,
            signature: Buffer.from(a).toString("hex"),
            verifyingKey: Buffer.from(l).toString("hex")
        });
    }
    async function P2t(t, e, n, r, s) {
        if (!n || !r) return Pt("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] = BigInt(c.value);
        for (const c of e.desiredOutputs)try {
            if (c.kind === "shielded") {
                const l = ns.parse(c.recipient);
                a.push({
                    type: "shielded",
                    outputs: [
                        {
                            type: c.type,
                            receiverAddress: l.decode($l, i),
                            amount: BigInt(c.value)
                        }
                    ]
                });
            } else {
                const l = ns.parse(c.recipient);
                a.push({
                    type: "unshielded",
                    outputs: [
                        {
                            type: c.type,
                            receiverAddress: l.decode(Hi, i),
                            amount: BigInt(c.value)
                        }
                    ]
                });
            }
        } catch  {
            return Pt("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 Ps({
                tx: p9(u)
            });
        } catch (c) {
            return console.error("Error in initSwap", c), Pt("InternalError", `Operation failed: ${(c instanceof Error ? c.message : String(c)).slice(0, 300)}`);
        }
    }
    async function O2t(t, e) {
        if (!t) return Pt("InternalError", "Wallet not initialized");
        try {
            const { tx: n } = e, r = xn.deserialize("signature", "proof", "binding", Ig(n)), s = await t.submitTransaction(r);
            let i = typeof s == "string" ? s : s instanceof Uint8Array ? p9(s) : String(s);
            (i.startsWith("0x") || i.startsWith("0X")) && (i = i.slice(2));
            let o = i;
            try {
                const { ENVIRONMENTS: a, getEnvironmentSettings: c } = await ei(async ()=>{
                    const { ENVIRONMENTS: d, getEnvironmentSettings: f } = await Promise.resolve().then(()=>wlt);
                    return {
                        ENVIRONMENTS: d,
                        getEnvironmentSettings: f
                    };
                }, void 0), 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 b = (await p.json())?.data?.transactions?.[0]?.hash;
                                if (b && typeof b == "string" && b.length === 64) {
                                    o = b;
                                    break;
                                }
                            }
                        } catch  {}
                    }
                }
            } catch  {}
            return Ps({
                tx_id: i,
                txHash: o
            });
        } catch (n) {
            return console.error("Error in submitTransaction", n), Pt("InternalError", `Operation failed: ${(n instanceof Error ? n.message : String(n)).slice(0, 300)}`);
        }
    }
    async function M2t(t, e, n, r) {
        if (!t || !n || !r) return Pt("InternalError", "Wallet, zswap secret key or dust secret key not initialized");
        try {
            const { tx: s } = e, i = xn.deserialize("signature", "proof", "binding", Ig(s)), o = await t.balanceFinalizedTransaction(i, {
                shieldedSecretKeys: n,
                dustSecretKey: r
            }, {
                ttl: new Date(Date.now() + 1800 * 1e3)
            }), a = await t.finalizeRecipe(o);
            return Ps({
                tx: p9(a.serialize())
            });
        } catch (s) {
            const i = s instanceof Error ? s.message : String(s);
            return console.error("Error in balanceUnsealedTransaction:", i, s), Pt("InternalError", `Balance failed: ${i.slice(0, 300)}`);
        }
    }
    async function R2t(t, e, n, r, s, i) {
        if (!t || !n || !r || !s) return Pt("InternalError", "Wallet, zswap secret key, dust secret key or night external key not initialized");
        try {
            const { tx: o } = e, a = yd(s, i.networkId), c = (h)=>a.signData(h), l = xn.deserialize("signature", "proof", "pre-binding", Ig(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 Ps({
                tx: p9(p.serialize())
            });
        } catch (o) {
            const a = o instanceof Error ? o.message : String(o);
            return console.error("Error in balanceUnsealedTransaction:", a, o), Pt("InternalError", `Balance failed: ${a.slice(0, 300)}`);
        }
    }
    async function N2t(t, e, n, r, s, i) {
        if (!t || !n || !r || !s) return Pt("InternalError", "Wallet, zswap secret key or dust secret key or night external key not initialized");
        const o = i.networkId, a = [];
        for (const l of e.outputs)try {
            const u = ns.parse(l.recipient);
            l.kind === "shielded" ? a.push({
                type: "shielded",
                outputs: [
                    {
                        type: l.type,
                        receiverAddress: u.decode($l, o),
                        amount: BigInt(l.value)
                    }
                ]
            }) : a.push({
                type: "unshielded",
                outputs: [
                    {
                        type: l.type,
                        receiverAddress: u.decode(Hi, o),
                        amount: BigInt(l.value)
                    }
                ]
            });
        } catch  {
            return Pt("InvalidRequest", "Invalid recipient address");
        }
        let c = !1;
        try {
            const l = yd(s, i.networkId), u = (y)=>l.signData(y), d = await t.transferTransaction(a, {
                shieldedSecretKeys: n,
                dustSecretKey: r
            }, {
                ttl: new Date(Date.now() + 1800 * 1e3),
                payFees: !1
            });
            let f = await t.balanceUnprovenTransaction(d.transaction, {
                shieldedSecretKeys: n,
                dustSecretKey: r
            }, {
                ttl: new Date(Date.now() + 1800 * 1e3)
            }), p = await t.signRecipe(f, u), h = await t.finalizeRecipe(p);
            c = !0;
            let b = await t.submitTransaction(h);
            return Ps({
                tx_id: b
            });
        } catch (l) {
            return console.error("Error in transferTransaction", l), c ? Ps({
                tx_id: "ambiguous",
                status: "uncertain",
                warning: "Transaction may have been submitted. Do not retry."
            }) : Pt("InternalError", `Operation failed: ${(l instanceof Error ? l.message : String(l)).slice(0, 300)}`);
        }
    }
    const aE = "_inflight_txs", V2t = 20, LM = 1800 * 1e3;
    async function vb() {
        try {
            return (await chrome.storage.local.get(aE))[aE] ?? [];
        } catch  {
            return [];
        }
    }
    async function m9(t) {
        try {
            await chrome.storage.local.set({
                [aE]: t
            });
        } catch (e) {
            console.error("[Inflight] Storage write failed:", e);
        }
    }
    async function Ire(t) {
        const e = await vb(), n = Date.now(), s = e.filter((i)=>n - i.createdAt < LM && i.status !== "confirmed" && i.status !== "failed").filter((i)=>i.id !== t.id);
        for(; s.length >= V2t;)s.shift();
        s.push(t), await m9(s);
    }
    async function cE(t, e) {
        const n = await vb(), r = n.findIndex((s)=>s.id === t);
        r < 0 || (n[r] = {
            ...n[r],
            ...e
        }, await m9(n));
    }
    async function lE(t) {
        const e = await vb();
        await m9(e.filter((n)=>n.id !== t));
    }
    async function B2t(t, e) {
        const n = await vb(), 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 < LM);
    }
    function D2t(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 F2t() {
        const t = await vb(), e = Date.now(), n = t.filter((r)=>e - r.createdAt < LM);
        n.length !== t.length && await m9(n);
    }
    const L2t = Object.freeze(Object.defineProperty({
        __proto__: null,
        cleanExpired: F2t,
        getInflightTxs: vb,
        getRecoverableTxs: B2t,
        isDuplicateTxError: D2t,
        removeInflightTx: lE,
        saveInflightTx: Ire,
        updateInflightTx: cE
    }, Symbol.toStringTag, {
        value: "Module"
    }));
    var z2t = se('<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">'), U2t = se('<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">'), H2t = se('<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">Switch Network?</h3></div></div><div class="px-5 py-4 space-y-4"><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><p class="text-sm text-[#475467]">This site wants to connect on <span class="font-semibold text-[#181D27]"></span> but your wallet is currently on <span class="font-semibold text-[#181D27]"></span>.</p><div class="flex items-center gap-3 bg-amber-50 border border-amber-200 rounded-lg px-4 py-3"><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">Switching networks will resync your wallet. This may take a moment.</p></div></div><div class="px-5 py-4 border-t border-[#E9EAEB] flex gap-3"><button class="flex-1 h-10 text-sm font-semibold border border-[#D0D5DD] text-[#344054] rounded-lg hover:bg-[#F9FAFB] transition-colors">Stay on </button><button class="flex-1 h-10 text-sm font-semibold bg-[#181D27] text-white rounded-lg hover:bg-[#0a0d12] transition-colors">Switch to '), j2t = se('<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'), q2t = se('<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">'), K2t = se('<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">'), W2t = se('<div class="text-xs text-[#94979C]">+<!> more request<!> waiting'), $2t = se('<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]">'), X2t = se('<div class="px-5 py-4 border-t border-[#E9EAEB] flex gap-3">'), G2t = se('<div class="text-xs font-mono text-[#181D27] break-all">'), Z2t = se('<hr class="border-[#E9EAEB] my-1">'), J2t = se('<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.'), Y2t = se('<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 [fH, lc] = he([]), [Q2t, hH] = he(new Set), zM = new Set, x2 = new Map, Are = 6e4;
    function M_(t, e, n) {
        const r = JSON.stringify(n)?.slice(0, 500) ?? "";
        return `${t}:${e}:${r}`;
    }
    function ext(t) {
        if (zM.has(t)) return !0;
        const e = x2.get(t);
        return !!(e && Date.now() - e < Are);
    }
    function txt(t) {
        zM.add(t);
    }
    function Zu(t) {
        zM.delete(t), x2.set(t, Date.now());
        for (const [e, n] of x2)Date.now() - n > Are && x2.delete(e);
    }
    const [pH, b6] = he(null), m6 = 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"
    ]);
    function y6(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."
                };
            default:
                return {
                    title: t.messageType,
                    detail: ""
                };
        }
    }
    const nxt = ()=>{
        const t = Tr(), [e, n] = he(new Map), [r, s] = he([]), [i, o] = he(null), [a, c] = he(null);
        $a(()=>{
            const y = window.__ONE_AM_SHELL__, _ = y === "popup" ? "wallet-ui-popup" : y === "sidepanel" ? "wallet-ui-sidepanel" : "wallet-ui-fullpage", v = chrome.runtime.connect({
                name: _
            }), w = new Set, E = (I)=>{
                if (I.type !== "DAPP_REQUEST" || w.has(I.requestId)) return;
                w.add(I.requestId);
                const D = {
                    requestId: I.requestId,
                    messageType: I.messageType,
                    origin: I.origin,
                    payload: I.payload,
                    _phishing: I._phishing
                };
                if (D._phishing) {
                    o(D);
                    return;
                }
                if (D.messageType === "DAPP_CONNECT") {
                    const K = D.payload;
                    Sg().then(async ($)=>{
                        const ne = Mr[$.environment], { resolveNetworkMismatch: te } = await ei(async ()=>{
                            const { resolveNetworkMismatch: g } = await import("./network-switch-DRJCZ7R9.js");
                            return {
                                resolveNetworkMismatch: g
                            };
                        }, []), J = te(K?.networkId, ne.networkId);
                        if (J.action === "switch") {
                            c({
                                request: D,
                                requestedNetwork: J.requestedNetwork,
                                currentNetwork: J.currentNetwork
                            });
                            return;
                        }
                        if (J.action === "reject") {
                            fi(D.requestId, {
                                success: !1,
                                error: {
                                    code: "InvalidRequest",
                                    reason: J.reason
                                }
                            });
                            return;
                        }
                        r().find((g)=>g.messageType === "DAPP_CONNECT" && g.origin === D.origin) ? fi(D.requestId, {
                            success: !1,
                            error: {
                                code: "InternalError",
                                reason: "Connection request already pending — please wait"
                            }
                        }) : s((g)=>[
                                ...g,
                                D
                            ]);
                    });
                    return;
                }
                const U = M_(D.origin, D.messageType, D.payload);
                if (m6.has(D.messageType) && ext(U)) {
                    fi(D.requestId, {
                        success: !1,
                        error: {
                            code: "InvalidRequest",
                            reason: "Duplicate request — a similar request is already pending"
                        }
                    });
                    return;
                }
                m6.has(D.messageType) ? (txt(U), s((K)=>[
                        ...K,
                        D
                    ])) : lc((K)=>[
                        ...K,
                        D
                    ]);
            };
            v.onMessage.addListener(E), chrome.runtime.sendMessage({
                type: "WALLET_TAB_READY"
            }), At(()=>{
                v.onMessage.removeListener(E), v.disconnect();
            });
        });
        const l = ()=>{
            const y = i();
            y && (fi(y.requestId, {
                success: !1,
                error: {
                    code: "Rejected",
                    reason: "User rejected — suspected phishing site"
                }
            }), Zu(M_(y.origin, y.messageType, y.payload))), o(null);
        }, u = ()=>{
            const y = i();
            if (!y) return;
            o(null);
            const _ = {
                ...y,
                _phishing: void 0
            };
            m6.has(_.messageType) ? s((v)=>[
                    ...v,
                    _
                ]) : lc((v)=>[
                    ...v,
                    _
                ]);
        }, d = (y)=>{
            const _ = r().find((w)=>w.requestId === y);
            if (!_) return;
            const v = structuredClone(_);
            if (v.messageType === "DAPP_CONNECT") {
                Sg().then((w)=>{
                    const E = Mr[w.environment], I = v.payload;
                    I?.networkId && I.networkId !== E.networkId ? fi(v.requestId, {
                        success: !1,
                        error: {
                            code: "InvalidRequest",
                            reason: `Network mismatch. Wallet is on ${E.networkId}, requested ${I.networkId}`
                        }
                    }) : fi(v.requestId, {
                        success: !0,
                        data: {
                            authorized: !0,
                            networkId: E.networkId
                        }
                    }), s((D)=>D.filter((U)=>U.requestId !== y));
                });
                return;
            }
            s((w)=>w.filter((E)=>E.requestId !== y)), lc((w)=>[
                    ...w,
                    v
                ]);
        }, f = (y)=>{
            const _ = r().find((v)=>v.requestId === y);
            _ && (fi(_.requestId, {
                success: !1,
                error: {
                    code: "Rejected",
                    reason: "User rejected the request"
                }
            }), Zu(M_(_.origin, _.messageType, _.payload)), s((v)=>v.filter((w)=>w.requestId !== y)));
        };
        ot(()=>{
            const y = fH(), _ = Q2t();
            for (const v of y)_.has(v.requestId) || (hH((w)=>new Set([
                    ...w,
                    v.requestId
                ])), n((w)=>new Map(w).set(v.requestId, {
                    status: "processing"
                })), v._approvedNetwork = t.environmentSettings().environment, h(v));
        });
        const p = new Set;
        At(()=>{
            for (const y of p)clearInterval(y);
            p.clear();
        });
        const h = async (y)=>{
            const _ = M_(y.origin, y.messageType, y.payload), v = new Set([
                "DAPP_SUBMIT_TRANSACTION",
                "DAPP_MAKE_TRANSFER"
            ]), E = new Set([
                "DAPP_SUBMIT_TRANSACTION",
                "DAPP_MAKE_TRANSFER",
                "DAPP_MAKE_INTENT",
                "DAPP_BALANCE_UNSEALED_TX",
                "DAPP_BALANCE_SEALED_TX"
            ]).has(y.messageType);
            try {
                if (await new Promise((C)=>{
                    const g = setInterval(()=>{
                        t.isSynced() && (clearInterval(g), p.delete(g), C());
                    }, 100);
                    p.add(g), setTimeout(()=>{
                        clearInterval(g), p.delete(g), C();
                    }, 3e4);
                }), E && t.isSecondaryContext()) {
                    fi(y.requestId, {
                        success: !1,
                        error: {
                            code: "InternalError",
                            reason: "Wallet is active in another window — please use that window"
                        }
                    }), Zu(_), lc((C)=>C.filter((g)=>g.requestId !== y.requestId));
                    return;
                }
                if (E && !await t.acquireTxLock(3e4)) {
                    fi(y.requestId, {
                        success: !1,
                        error: {
                            code: "InternalError",
                            reason: "Wallet busy — another transaction is in progress"
                        }
                    }), Zu(_), lc((g)=>g.filter((x)=>x.requestId !== y.requestId));
                    return;
                }
                const D = t.environmentSettings();
                if (E) {
                    const C = y._approvedNetwork;
                    if (C && C !== D.environment) {
                        fi(y.requestId, {
                            success: !1,
                            error: {
                                code: "InternalError",
                                reason: "Network changed during request — please retry"
                            }
                        }), Zu(_), t.releaseTxLock(), lc((g)=>g.filter((x)=>x.requestId !== y.requestId));
                        return;
                    }
                }
                const U = await t.getZswapSecretKeys().catch(()=>null), K = await t.getNightExternalKey().catch(()=>null), $ = await t.getDustSecretKey().catch(()=>null);
                let ne = null;
                if (v.has(y.messageType)) {
                    const g = y.payload?.tx || JSON.stringify(y.payload)?.slice(0, 2e3) || "";
                    ne = crypto.randomUUID(), await Ire({
                        id: ne,
                        txHex: g,
                        network: D.environment,
                        walletScope: `${t.activeWalletId()}:${t.activeAccountIndex?.() ?? 0}`,
                        txType: "dapp",
                        dappOrigin: y.origin,
                        status: "submitting",
                        createdAt: Date.now(),
                        attempts: 1
                    });
                }
                const te = K ? await ZT(K) : void 0, J = await x2t(y, t.getWallet(), t.configuration, U, $, K, {
                    dustSponsorship: D.dustSponsorship,
                    balanceServiceUrl: D.dustSponsorshipUrl || D.proofServerUrl,
                    proofServerUrl: D.proofServerUrl,
                    apiKey: D.proofStationApiKey,
                    clientId: te
                });
                if (ne) if (J.success) {
                    const C = J.data, g = C?.txHash || C?.tx_id;
                    await cE(ne, {
                        status: "confirmed",
                        txHash: typeof g == "string" ? g : void 0
                    }), setTimeout(()=>lE(ne), 5e3);
                } else await cE(ne, {
                    status: "failed",
                    error: J.error?.reason
                }), setTimeout(()=>lE(ne), 1e4);
                if (!J.success && J.error?.code === "SponsorshipFailed") {
                    const C = J.data;
                    b6({
                        request: y,
                        reason: J.error?.reason || "Proof server unavailable",
                        originalPayload: C?.originalPayload,
                        pendingId: null
                    }), n((g)=>new Map(g).set(y.requestId, {
                            status: "awaiting-fallback"
                        })), hH((g)=>{
                        const x = new Set(g);
                        return x.delete(y.requestId), x;
                    }), lc((g)=>g.filter((x)=>x.requestId !== y.requestId)), Zu(_), E && t.releaseTxLock();
                    return;
                }
                if (fi(y.requestId, J), n((C)=>new Map(C).set(y.requestId, {
                        status: "done"
                    })), J.success && v.has(y.messageType)) {
                    const C = J.data, g = C?.txHash || C?.tx_id;
                    if (g) {
                        const x = t.trackDAppTx(y.messageType, y.origin);
                        t.resolveDAppTx(x, g);
                    }
                    t.addToast({
                        type: "success",
                        title: "Transaction submitted",
                        txHash: g
                    });
                } else J.success || J.success || t.addToast({
                    type: "error",
                    title: `${y6(y).title} failed`,
                    message: J.error?.reason || "Failed"
                });
                Zu(_), E && t.releaseTxLock(), lc((C)=>C.filter((g)=>g.requestId !== y.requestId));
            } catch (I) {
                console.error("[Wallet UI] Request error:", I);
                const D = I instanceof Error ? I.message : "Unknown error";
                console.error("[Wallet UI] DApp request error:", D), n((K)=>new Map(K).set(y.requestId, {
                        status: "error",
                        message: D
                    })), fi(y.requestId, {
                    success: !1,
                    error: {
                        code: "InternalError",
                        reason: "Operation failed"
                    }
                });
                const U = D.includes("No dust") ? "No dust available in your wallet to pay transaction fees" : "Request could not be processed";
                t.addToast({
                    type: "error",
                    title: `${y6(y).title} failed`,
                    message: U
                }), Zu(_), E && t.releaseTxLock(), lc((K)=>K.filter(($)=>$.requestId !== y.requestId));
            }
        }, b = ()=>{
            const y = e();
            return Array.from(y.entries()).filter(([_, v])=>v.status === "processing").map(([_])=>fH().find((v)=>v.requestId === _)).filter(Boolean);
        };
        return [
            M(ge, {
                get when () {
                    return a();
                },
                children: (y)=>{
                    const _ = y(), v = (w)=>w === "mainnet" ? "Mainnet" : w === "preprod" ? "Preprod" : w === "preview" ? "Preview" : w;
                    return (()=>{
                        var w = H2t(), E = w.firstChild, I = E.firstChild, D = I.nextSibling, U = D.firstChild, K = U.firstChild, $ = K.nextSibling, ne = U.nextSibling, te = ne.firstChild, J = te.nextSibling, C = J.nextSibling, g = C.nextSibling, x = D.nextSibling, A = x.firstChild;
                        A.firstChild;
                        var R = A.nextSibling;
                        return R.firstChild, X($, ()=>_.request.origin), X(J, ()=>v(_.requestedNetwork)), X(g, ()=>v(_.currentNetwork)), A.$$click = ()=>{
                            fi(_.request.requestId, {
                                success: !1,
                                error: {
                                    code: "Rejected",
                                    reason: "User declined network switch"
                                }
                            }), c(null);
                        }, X(A, ()=>v(_.currentNetwork), null), R.$$click = async ()=>{
                            try {
                                const N = _.requestedNetwork, L = t.environmentSettings();
                                c(null), await t.updateSettings({
                                    ...L,
                                    environment: N
                                });
                            } catch  {
                                fi(_.request.requestId, {
                                    success: !1,
                                    error: {
                                        code: "InternalError",
                                        reason: "Failed to switch network"
                                    }
                                }), c(null);
                            }
                        }, X(R, ()=>v(_.requestedNetwork), null), w;
                    })();
                }
            }),
            M(ge, {
                get when () {
                    return i();
                },
                children: (y)=>{
                    const _ = y()._phishing;
                    return (()=>{
                        var v = j2t(), w = v.firstChild, E = w.nextSibling, I = E.firstChild, D = I.nextSibling, U = D.nextSibling, K = U.nextSibling, $ = K.firstChild, ne = $.firstChild, te = ne.nextSibling, J = $.nextSibling, C = J.firstChild, g = C.nextSibling, x = J.nextSibling, A = x.firstChild, R = A.nextSibling, N = E.nextSibling, L = N.firstChild;
                        return X(te, ()=>y().origin), X(g, ()=>_.lookalike), X(R, ()=>_.reason), X(N, M(yi, {
                            class: "w-full h-12 text-base font-semibold bg-white text-[#181D27] hover:bg-gray-100",
                            onClick: l,
                            children: "Go back to safety"
                        }), L), L.$$click = u, v;
                    })();
                }
            }),
            M(ge, {
                get when () {
                    return it(()=>r().length > 0)() && !i();
                },
                get children () {
                    var y = z2t(), _ = y.firstChild;
                    return X(_, ()=>{
                        const v = r()[0], w = t.environmentSettings(), { title: E, detail: I, breakdown: D } = y6(v, !!w.dustSponsorship);
                        return [
                            (()=>{
                                var U = q2t(), K = U.firstChild, $ = K.firstChild, ne = $.nextSibling;
                                return X(ne, E), U;
                            })(),
                            (()=>{
                                var U = $2t(), K = U.firstChild, $ = K.firstChild, ne = $.nextSibling, te = K.nextSibling, J = te.firstChild, C = J.nextSibling;
                                return X(ne, ()=>v.origin), X(C, I), X(U, M(ge, {
                                    get when () {
                                        return D && D.length > 0;
                                    },
                                    get children () {
                                        var g = K2t(), x = g.firstChild, A = x.nextSibling;
                                        return X(A, M(tr, {
                                            each: D,
                                            children: (R)=>M(ge, {
                                                    when: R !== "---",
                                                    get fallback () {
                                                        return Z2t();
                                                    },
                                                    get children () {
                                                        var N = G2t();
                                                        return X(N, R), N;
                                                    }
                                                })
                                        })), g;
                                    }
                                }), null), X(U, M(ge, {
                                    get when () {
                                        return r().length > 1;
                                    },
                                    get children () {
                                        var g = W2t(), x = g.firstChild, A = x.nextSibling, R = A.nextSibling, N = R.nextSibling;
                                        return N.nextSibling, X(g, ()=>r().length - 1, A), X(g, ()=>r().length > 2 ? "s" : "", N), g;
                                    }
                                }), null), U;
                            })(),
                            (()=>{
                                var U = X2t();
                                return X(U, M(yi, {
                                    variant: "outline",
                                    class: "flex-1 border-[#E9EAEB] text-[#181D27] hover:bg-[#F5F5F5]",
                                    onClick: ()=>f(v.requestId),
                                    children: "Reject"
                                }), null), X(U, M(yi, {
                                    class: "flex-1 bg-[#181D27] text-white hover:bg-[#181D27]/90",
                                    onClick: ()=>d(v.requestId),
                                    children: "Approve"
                                }), null), U;
                            })()
                        ];
                    }), y;
                }
            }),
            M(ge, {
                get when () {
                    return pH();
                },
                get children () {
                    return (()=>{
                        const y = pH();
                        return (()=>{
                            var _ = Y2t(), v = _.firstChild, w = v.firstChild, E = w.nextSibling, I = E.firstChild, D = I.firstChild, U = D.nextSibling, K = I.nextSibling, $ = K.firstChild, ne = $.nextSibling;
                            K.nextSibling;
                            var te = E.nextSibling;
                            return X(U, ()=>y.request.origin), X(ne, ()=>y.reason), X(E, M(ge, {
                                get when () {
                                    return t.dustBalance() === 0n;
                                },
                                get children () {
                                    return J2t();
                                }
                            }), null), X(te, M(yi, {
                                variant: "outline",
                                class: "flex-1 border-[#E9EAEB] text-[#181D27] hover:bg-[#F5F5F5]",
                                onClick: ()=>{
                                    fi(y.request.requestId, {
                                        success: !1,
                                        error: {
                                            code: "Rejected",
                                            reason: "User declined to pay dust fee"
                                        }
                                    }), y.pendingId && t.resolveDAppTx(y.pendingId, void 0, "Sponsorship failed — user declined"), b6(null);
                                },
                                children: "Reject"
                            }), null), X(te, M(yi, {
                                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 J = {
                                        ...y.request,
                                        payload: {
                                            ...y.originalPayload,
                                            _useLocalDust: !0
                                        }
                                    };
                                    b6(null), lc((C)=>[
                                            ...C,
                                            J
                                        ]);
                                },
                                children: "Pay with My Dust"
                            }), null), _;
                        })();
                    })();
                }
            }),
            M(ge, {
                get when () {
                    return b().length > 0;
                },
                get children () {
                    var y = U2t(), _ = y.firstChild, v = _.nextSibling;
                    return X(v, ()=>b()[0]?.messageType.replace("DAPP_", "").replace(/_/g, " ")), y;
                }
            })
        ];
    };
    ci([
        "click"
    ]);
    var rxt = se('<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 sxt = ()=>($a(()=>{
            yo.tabs.create({
                url: yo.runtime.getURL("/fullpage.html?mode=welcome")
            }), window.close();
        }), M(vlt, {}));
    async function ixt() {
        const [t, e] = await Promise.all([
            Zct(),
            $T().catch(()=>null)
        ]);
        return t === "none" ? (yo.tabs.create({
            url: yo.runtime.getURL("/fullpage.html?mode=welcome")
        }), window.close(), {
            status: t,
            contents: null
        }) : {
            status: t,
            contents: e
        };
    }
    v3t = ()=>{
        const [t] = bH(ixt), [e, n] = he(!1);
        $a(async ()=>{
            const o = await Sg();
            document.documentElement.setAttribute("data-theme", o.theme || "light");
        });
        const r = ()=>t()?.status ?? "none", s = ()=>t()?.contents != null, i = async (o)=>{
            const { key: a, salt: c } = await jte(o);
            await Qct(a, c), o.fill(0), n(!0);
        };
        return M(ge, {
            get when () {
                return !t.loading;
            },
            get fallback () {
                return rxt();
            },
            get children () {
                return M(fE, {
                    get children () {
                        return [
                            M(Jf, {
                                get when () {
                                    return it(()=>r() === "locked")() && (s() || e());
                                },
                                get children () {
                                    return M(Vlt, {
                                        get children () {
                                            return [
                                                M(g2t, {}),
                                                M(nxt, {})
                                            ];
                                        }
                                    });
                                }
                            }),
                            M(Jf, {
                                get when () {
                                    return it(()=>r() === "locked" && !s())() && !e();
                                },
                                get children () {
                                    return M(_2t, {
                                        onUnlock: i
                                    });
                                }
                            }),
                            M(Jf, {
                                get when () {
                                    return r() === "none";
                                },
                                get children () {
                                    return M(sxt, {});
                                }
                            })
                        ];
                    }
                });
            }
        });
    };
})();
export { Nvt as $, Cvt as A, yi as B, hl as C, nne as D, sj as E, Wte as F, jte as G, Qct as H, M2 as I, fte as J, Y5 as K, Sg as L, v3t as M, lxt as N, Ivt as O, yn as P, axt as Q, mH as R, y3t as S, wd as T, $vt as U, Qvt as V, vlt as W, s3t as X, Yvt as Y, Uvt as Z, fu as _, $te as a, r3t as a0, Vvt as a1, Zvt as a2, jvt as a3, e3t as a4, Kvt as a5, p3t as a6, f3t as a7, d3t as a8, c3t as a9, g3t as aA, u3t as aB, mgt as aC, Avt as aD, h3t as aE, l3t as aF, Ovt as aG, _3t as aH, Pvt as aI, Gvt as aJ, ygt as aK, Bvt as aL, qvt as aM, m3t as aN, Mvt as aO, Xvt as aP, Dvt as aQ, t3t as aR, zvt as aS, Wvt as aT, Fvt as aU, Rvt as aV, Ij as aW, o3t as aa, a3t as ab, i3t as ac, b3t as ad, p9 as ae, n3t as af, uu as ag, wh as ah, Cg as ai, Gd as aj, Qr as ak, x3t as al, Ig as am, Ere as an, Gh as ao, Zh as ap, w3t as aq, Cwt as ar, i1 as as, Dl as at, _d as au, o1 as av, Jh as aw, Jvt as ax, Hvt as ay, Lvt as az, Xte as b, _p as c, ke as d, ir as e, MO as f, Pg as g, Fn as h, Ks as i, du as j, J5 as k, G5 as l, zt as m, Z5 as n, vn as o, mh as p, xie as q, yo as r, e1 as s, Zct as t, of as u, dj as v, Hte as w, Kte as x, Km as y, GT as z, __tla };
