(function (P3) {
  typeof define == "function" && define.amd ? define(P3) : P3()
})(function () {
  "use strict";

  function P3(t, e) {
    for (var r = 0; r < e.length; r++) {
      const n = e[r];
      if (typeof n != "string" && !Array.isArray(n)) {
        for (const i in n)
          if (i !== "default" && !(i in t)) {
            const s = Object.getOwnPropertyDescriptor(n, i);
            s && Object.defineProperty(t, i, s.get ? s : {
              enumerable: !0,
              get: () => n[i]
            })
          }
      }
    }
    return Object.freeze(Object.defineProperty(t, Symbol.toStringTag, {
      value: "Module"
    }))
  }
  var ot = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};

  function Za(t) {
    return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t
  }

  function bu(t) {
    if (t.__esModule) return t;
    var e = t.default;
    if (typeof e == "function") {
      var r = function n() {
        return this instanceof n ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments)
      };
      r.prototype = e.prototype
    } else r = {};
    return Object.defineProperty(r, "__esModule", {
      value: !0
    }), Object.keys(t).forEach(function (n) {
      var i = Object.getOwnPropertyDescriptor(t, n);
      Object.defineProperty(r, n, i.get ? i : {
        enumerable: !0,
        get: function () {
          return t[n]
        }
      })
    }), r
  }
  const Dk = "2.21.44";
  let f7 = {
      getDocsUrl: ({
        docsBaseUrl: t,
        docsPath: e = "",
        docsSlug: r
      }) => e ? `${t??"https://viem.sh"}${e}${r?`#${r}`:""}` : void 0,
      version: `viem@${Dk}`
    },
    Ye = class Mk extends Error {
      constructor(e, r = {}) {
        const n = r.cause instanceof Mk ? r.cause.details : r.cause?.message ? r.cause.message : r.details,
          i = r.cause instanceof Mk && r.cause.docsPath || r.docsPath,
          s = f7.getDocsUrl?.({
            ...r,
            docsPath: i
          }),
          o = [e || "An error occurred.", "", ...r.metaMessages ? [...r.metaMessages, ""] : [], ...s ? [`Docs: ${s}`] : [], ...n ? [`Details: ${n}`] : [], ...f7.version ? [`Version: ${f7.version}`] : []].join(`
  `);
        super(o, r.cause ? {
          cause: r.cause
        } : void 0), Object.defineProperty(this, "details", {
          enumerable: !0,
          configurable: !0,
          writable: !0,
          value: void 0
        }), Object.defineProperty(this, "docsPath", {
          enumerable: !0,
          configurable: !0,
          writable: !0,
          value: void 0
        }), Object.defineProperty(this, "metaMessages", {
          enumerable: !0,
          configurable: !0,
          writable: !0,
          value: void 0
        }), Object.defineProperty(this, "shortMessage", {
          enumerable: !0,
          configurable: !0,
          writable: !0,
          value: void 0
        }), Object.defineProperty(this, "version", {
          enumerable: !0,
          configurable: !0,
          writable: !0,
          value: void 0
        }), Object.defineProperty(this, "name", {
          enumerable: !0,
          configurable: !0,
          writable: !0,
          value: "BaseError"
        }), this.details = n, this.docsPath = i, this.metaMessages = r.metaMessages, this.name = r.name ?? this.name, this.shortMessage = e, this.version = Dk
      }
      walk(e) {
        return Lk(this, e)
      }
    };

  function Lk(t, e) {
    return e?.(t) ? t : t && typeof t == "object" && "cause" in t && t.cause !== void 0 ? Lk(t.cause, e) : e ? null : t
  }
  class XZ extends Ye {
    constructor({
      max: e,
      min: r,
      signed: n,
      size: i,
      value: s
    }) {
      super(`Number "${s}" is not in safe ${i?`${i*8}-bit ${n?"signed":"unsigned"} `:""}integer range ${e?`(${r} to ${e})`:`(above ${r})`}`, {
        name: "IntegerOutOfRangeError"
      })
    }
  }
  class eY extends Ye {
    constructor(e) {
      super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`, {
        name: "InvalidBytesBooleanError"
      })
    }
  }
  class tY extends Ye {
    constructor({
      givenSize: e,
      maxSize: r
    }) {
      super(`Size cannot exceed ${r} bytes. Given size: ${e} bytes.`, {
        name: "SizeOverflowError"
      })
    }
  }
  class Bk extends Ye {
    constructor({
      offset: e,
      position: r,
      size: n
    }) {
      super(`Slice ${r==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${n}).`, {
        name: "SliceOffsetOutOfBoundsError"
      })
    }
  }
  class Uk extends Ye {
    constructor({
      size: e,
      targetSize: r,
      type: n
    }) {
      super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${e}) exceeds padding size (${r}).`, {
        name: "SizeExceedsPaddingSizeError"
      })
    }
  }
  class jk extends Ye {
    constructor({
      size: e,
      targetSize: r,
      type: n
    }) {
      super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${r} ${n} long, but is ${e} ${n} long.`, {
        name: "InvalidBytesLengthError"
      })
    }
  }

  function zp(t, {
    dir: e,
    size: r = 32
  } = {}) {
    return typeof t == "string" ? Pd(t, {
      dir: e,
      size: r
    }) : rY(t, {
      dir: e,
      size: r
    })
  }

  function Pd(t, {
    dir: e,
    size: r = 32
  } = {}) {
    if (r === null) return t;
    const n = t.replace("0x", "");
    if (n.length > r * 2) throw new Uk({
      size: Math.ceil(n.length / 2),
      targetSize: r,
      type: "hex"
    });
    return `0x${n[e==="right"?"padEnd":"padStart"](r*2,"0")}`
  }

  function rY(t, {
    dir: e,
    size: r = 32
  } = {}) {
    if (r === null) return t;
    if (t.length > r) throw new Uk({
      size: t.length,
      targetSize: r,
      type: "bytes"
    });
    const n = new Uint8Array(r);
    for (let i = 0; i < r; i++) {
      const s = e === "right";
      n[s ? i : r - i - 1] = t[s ? i : t.length - i - 1]
    }
    return n
  }

  function Kc(t, {
    strict: e = !0
  } = {}) {
    return !t || typeof t != "string" ? !1 : e ? /^0x[0-9a-fA-F]*$/.test(t) : t.startsWith("0x")
  }

  function fi(t) {
    return Kc(t, {
      strict: !1
    }) ? Math.ceil((t.length - 2) / 2) : t.length
  }

  function Hp(t, {
    dir: e = "left"
  } = {}) {
    let r = typeof t == "string" ? t.replace("0x", "") : t,
      n = 0;
    for (let i = 0; i < r.length - 1 && r[e === "left" ? i : r.length - i - 1].toString() === "0"; i++) n++;
    return r = e === "left" ? r.slice(n) : r.slice(0, r.length - n), typeof t == "string" ? (r.length === 1 && e === "right" && (r = `${r}0`), `0x${r.length%2===1?`0${r}`:r}`) : r
  }
  const nY = new TextEncoder;

  function $3(t, e = {}) {
    return typeof t == "number" || typeof t == "bigint" ? sY(t, e) : typeof t == "boolean" ? iY(t, e) : Kc(t) ? Gc(t, e) : vf(t, e)
  }

  function iY(t, e = {}) {
    const r = new Uint8Array(1);
    return r[0] = Number(t), typeof e.size == "number" ? (Ya(r, {
      size: e.size
    }), zp(r, {
      size: e.size
    })) : r
  }
  const yu = {
    zero: 48,
    nine: 57,
    A: 65,
    F: 70,
    a: 97,
    f: 102
  };

  function Fk(t) {
    if (t >= yu.zero && t <= yu.nine) return t - yu.zero;
    if (t >= yu.A && t <= yu.F) return t - (yu.A - 10);
    if (t >= yu.a && t <= yu.f) return t - (yu.a - 10)
  }

  function Gc(t, e = {}) {
    let r = t;
    e.size && (Ya(r, {
      size: e.size
    }), r = zp(r, {
      dir: "right",
      size: e.size
    }));
    let n = r.slice(2);
    n.length % 2 && (n = `0${n}`);
    const i = n.length / 2,
      s = new Uint8Array(i);
    for (let o = 0, a = 0; o < i; o++) {
      const c = Fk(n.charCodeAt(a++)),
        l = Fk(n.charCodeAt(a++));
      if (c === void 0 || l === void 0) throw new Ye(`Invalid byte sequence ("${n[a-2]}${n[a-1]}" in "${n}").`);
      s[o] = c * 16 + l
    }
    return s
  }

  function sY(t, e) {
    const r = lr(t, e);
    return Gc(r)
  }

  function vf(t, e = {}) {
    const r = nY.encode(t);
    return typeof e.size == "number" ? (Ya(r, {
      size: e.size
    }), zp(r, {
      dir: "right",
      size: e.size
    })) : r
  }

  function Ya(t, {
    size: e
  }) {
    if (fi(t) > e) throw new tY({
      givenSize: fi(t),
      maxSize: e
    })
  }

  function qp(t, e = {}) {
    const {
      signed: r
    } = e;
    e.size && Ya(t, {
      size: e.size
    });
    const n = BigInt(t);
    if (!r) return n;
    const i = (t.length - 2) / 2,
      s = (1n << BigInt(i) * 8n - 1n) - 1n;
    return n <= s ? n : n - BigInt(`0x${"f".padStart(i*2,"f")}`) - 1n
  }

  function bf(t, e = {}) {
    return Number(qp(t, e))
  }

  function Wk(t, e = {}) {
    let r = Gc(t);
    return e.size && (Ya(r, {
      size: e.size
    }), r = Hp(r, {
      dir: "right"
    })), new TextDecoder().decode(r)
  }
  const oY = Array.from({
    length: 256
  }, (t, e) => e.toString(16).padStart(2, "0"));

  function _u(t, e = {}) {
    return typeof t == "number" || typeof t == "bigint" ? lr(t, e) : typeof t == "string" ? Vp(t, e) : typeof t == "boolean" ? zk(t, e) : Pi(t, e)
  }

  function zk(t, e = {}) {
    const r = `0x${Number(t)}`;
    return typeof e.size == "number" ? (Ya(r, {
      size: e.size
    }), zp(r, {
      size: e.size
    })) : r
  }

  function Pi(t, e = {}) {
    let r = "";
    for (let i = 0; i < t.length; i++) r += oY[t[i]];
    const n = `0x${r}`;
    return typeof e.size == "number" ? (Ya(n, {
      size: e.size
    }), zp(n, {
      dir: "right",
      size: e.size
    })) : n
  }

  function lr(t, e = {}) {
    const {
      signed: r,
      size: n
    } = e, i = BigInt(t);
    let s;
    n ? r ? s = (1n << BigInt(n) * 8n - 1n) - 1n : s = 2n ** (BigInt(n) * 8n) - 1n : typeof t == "number" && (s = BigInt(Number.MAX_SAFE_INTEGER));
    const o = typeof s == "bigint" && r ? -s - 1n : 0;
    if (s && i > s || i < o) {
      const c = typeof t == "bigint" ? "n" : "";
      throw new XZ({
        max: s ? `${s}${c}` : void 0,
        min: `${o}${c}`,
        signed: r,
        size: n,
        value: `${t}${c}`
      })
    }
    const a = `0x${(r&&i<0?(1n<<BigInt(n*8))+BigInt(i):i).toString(16)}`;
    return n ? zp(a, {
      size: n
    }) : a
  }
  const aY = new TextEncoder;

  function Vp(t, e = {}) {
    const r = aY.encode(t);
    return Pi(r, e)
  }

  function Kp(t, {
    includeName: e = !1
  } = {}) {
    if (t.type !== "function" && t.type !== "event" && t.type !== "error") throw new yY(t.type);
    return `${t.name}(${p7(t.inputs,{includeName:e})})`
  }

  function p7(t, {
    includeName: e = !1
  } = {}) {
    return t ? t.map(r => cY(r, {
      includeName: e
    })).join(e ? ", " : ",") : ""
  }

  function cY(t, {
    includeName: e
  }) {
    return t.type.startsWith("tuple") ? `(${p7(t.components,{includeName:e})})${t.type.slice(5)}` : t.type + (e && t.name ? ` ${t.name}` : "")
  }
  class lY extends Ye {
    constructor({
      docsPath: e
    }) {
      super(["A constructor was not found on the ABI.", "Make sure you are using the correct ABI and that the constructor exists on it."].join(`
  `), {
        docsPath: e,
        name: "AbiConstructorNotFoundError"
      })
    }
  }
  class Hk extends Ye {
    constructor({
      docsPath: e
    }) {
      super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.", "Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
  `), {
        docsPath: e,
        name: "AbiConstructorParamsNotFoundError"
      })
    }
  }
  class uY extends Ye {
    constructor({
      data: e,
      params: r,
      size: n
    }) {
      super([`Data size of ${n} bytes is too small for given parameters.`].join(`
  `), {
        metaMessages: [`Params: (${p7(r,{includeName:!0})})`, `Data:   ${e} (${n} bytes)`],
        name: "AbiDecodingDataSizeTooSmallError"
      }), Object.defineProperty(this, "data", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "params", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "size", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), this.data = e, this.params = r, this.size = n
    }
  }
  class O3 extends Ye {
    constructor() {
      super('Cannot decode zero data ("0x") with ABI parameters.', {
        name: "AbiDecodingZeroDataError"
      })
    }
  }
  class dY extends Ye {
    constructor({
      expectedLength: e,
      givenLength: r,
      type: n
    }) {
      super([`ABI encoding array length mismatch for type ${n}.`, `Expected length: ${e}`, `Given length: ${r}`].join(`
  `), {
        name: "AbiEncodingArrayLengthMismatchError"
      })
    }
  }
  class hY extends Ye {
    constructor({
      expectedSize: e,
      value: r
    }) {
      super(`Size of bytes "${r}" (bytes${fi(r)}) does not match expected size (bytes${e}).`, {
        name: "AbiEncodingBytesSizeMismatchError"
      })
    }
  }
  class fY extends Ye {
    constructor({
      expectedLength: e,
      givenLength: r
    }) {
      super(["ABI encoding params/values length mismatch.", `Expected length (params): ${e}`, `Given length (values): ${r}`].join(`
  `), {
        name: "AbiEncodingLengthMismatchError"
      })
    }
  }
  class qk extends Ye {
    constructor(e, {
      docsPath: r
    }) {
      super([`Encoded error signature "${e}" not found on ABI.`, "Make sure you are using the correct ABI and that the error exists on it.", `You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`].join(`
  `), {
        docsPath: r,
        name: "AbiErrorSignatureNotFoundError"
      }), Object.defineProperty(this, "signature", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), this.signature = e
    }
  }
  class D3 extends Ye {
    constructor(e, {
      docsPath: r
    } = {}) {
      super([`Function ${e?`"${e}" `:""}not found on ABI.`, "Make sure you are using the correct ABI and that the function exists on it."].join(`
  `), {
        docsPath: r,
        name: "AbiFunctionNotFoundError"
      })
    }
  }
  class pY extends Ye {
    constructor(e, {
      docsPath: r
    }) {
      super([`Function "${e}" does not contain any \`outputs\` on ABI.`, "Cannot decode function result without knowing what the parameter types are.", "Make sure you are using the correct ABI and that the function exists on it."].join(`
  `), {
        docsPath: r,
        name: "AbiFunctionOutputsNotFoundError"
      })
    }
  }
  class gY extends Ye {
    constructor(e, r) {
      super("Found ambiguous types in overloaded ABI items.", {
        metaMessages: [`\`${e.type}\` in \`${Kp(e.abiItem)}\`, and`, `\`${r.type}\` in \`${Kp(r.abiItem)}\``, "", "These types encode differently and cannot be distinguished at runtime.", "Remove one of the ambiguous items in the ABI."],
        name: "AbiItemAmbiguityError"
      })
    }
  }
  class mY extends Ye {
    constructor({
      expectedSize: e,
      givenSize: r
    }) {
      super(`Expected bytes${e}, got bytes${r}.`, {
        name: "BytesSizeMismatchError"
      })
    }
  }
  class wY extends Ye {
    constructor(e, {
      docsPath: r
    }) {
      super([`Type "${e}" is not a valid encoding type.`, "Please provide a valid ABI type."].join(`
  `), {
        docsPath: r,
        name: "InvalidAbiEncodingType"
      })
    }
  }
  class vY extends Ye {
    constructor(e, {
      docsPath: r
    }) {
      super([`Type "${e}" is not a valid decoding type.`, "Please provide a valid ABI type."].join(`
  `), {
        docsPath: r,
        name: "InvalidAbiDecodingType"
      })
    }
  }
  class bY extends Ye {
    constructor(e) {
      super([`Value "${e}" is not a valid array.`].join(`
  `), {
        name: "InvalidArrayError"
      })
    }
  }
  class yY extends Ye {
    constructor(e) {
      super([`"${e}" is not a valid definition type.`, 'Valid types: "function", "event", "error"'].join(`
  `), {
        name: "InvalidDefinitionTypeError"
      })
    }
  }

  function Zc(t) {
    return typeof t[0] == "string" ? L3(t) : _Y(t)
  }

  function _Y(t) {
    let e = 0;
    for (const i of t) e += i.length;
    const r = new Uint8Array(e);
    let n = 0;
    for (const i of t) r.set(i, n), n += i.length;
    return r
  }

  function L3(t) {
    return `0x${t.reduce((e,r)=>e+r.replace("0x",""),"")}`
  }
  class $d extends Ye {
    constructor({
      address: e
    }) {
      super(`Address "${e}" is invalid.`, {
        metaMessages: ["- Address must be a hex value of 20 bytes (40 hex characters).", "- Address must match its checksum counterpart."],
        name: "InvalidAddressError"
      })
    }
  }
  class B3 extends Map {
    constructor(e) {
      super(), Object.defineProperty(this, "maxSize", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), this.maxSize = e
    }
    get(e) {
      const r = super.get(e);
      return super.has(e) && r !== void 0 && (this.delete(e), super.set(e, r)), r
    }
    set(e, r) {
      if (super.set(e, r), this.maxSize && this.size > this.maxSize) {
        const n = this.keys().next().value;
        n && this.delete(n)
      }
      return this
    }
  }

  function U3(t) {
    if (!Number.isSafeInteger(t) || t < 0) throw new Error(`positive integer expected, not ${t}`)
  }

  function xY(t) {
    return t instanceof Uint8Array || t != null && typeof t == "object" && t.constructor.name === "Uint8Array"
  }

  function Gp(t, ...e) {
    if (!xY(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 CY(t) {
    if (typeof t != "function" || typeof t.create != "function") throw new Error("Hash should be wrapped by utils.wrapConstructor");
    U3(t.outputLen), U3(t.blockLen)
  }

  function Zp(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 Vk(t, e) {
    Gp(t);
    const r = e.outputLen;
    if (t.length < r) throw new Error(`digestInto() expects output buffer of length at least ${r}`)
  }
  const j3 = BigInt(2 ** 32 - 1),
    Kk = BigInt(32);

  function EY(t, e = !1) {
    return e ? {
      h: Number(t & j3),
      l: Number(t >> Kk & j3)
    } : {
      h: Number(t >> Kk & j3) | 0,
      l: Number(t & j3) | 0
    }
  }

  function AY(t, e = !1) {
    let r = new Uint32Array(t.length),
      n = new Uint32Array(t.length);
    for (let i = 0; i < t.length; i++) {
      const {
        h: s,
        l: o
      } = EY(t[i], e);
      [r[i], n[i]] = [s, o]
    }
    return [r, n]
  }
  const SY = (t, e, r) => t << r | e >>> 32 - r,
    IY = (t, e, r) => e << r | t >>> 32 - r,
    TY = (t, e, r) => e << r - 32 | t >>> 64 - r,
    kY = (t, e, r) => t << r - 32 | e >>> 64 - r,
    Yp = typeof globalThis == "object" && "crypto" in globalThis ? globalThis.crypto : void 0; /*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
  const RY = t => new Uint32Array(t.buffer, t.byteOffset, Math.floor(t.byteLength / 4)),
    g7 = t => new DataView(t.buffer, t.byteOffset, t.byteLength),
    Yc = (t, e) => t << 32 - e | t >>> e,
    Gk = new Uint8Array(new Uint32Array([287454020]).buffer)[0] === 68,
    NY = t => t << 24 & 4278190080 | t << 8 & 16711680 | t >>> 8 & 65280 | t >>> 24 & 255;

  function Zk(t) {
    for (let e = 0; e < t.length; e++) t[e] = NY(t[e])
  }
  const MY = Array.from({
    length: 256
  }, (t, e) => e.toString(16).padStart(2, "0"));

  function PY(t) {
    Gp(t);
    let e = "";
    for (let r = 0; r < t.length; r++) e += MY[t[r]];
    return e
  }

  function $Y(t) {
    if (typeof t != "string") throw new Error(`utf8ToBytes expected string, got ${typeof t}`);
    return new Uint8Array(new TextEncoder().encode(t))
  }

  function tw(t) {
    return typeof t == "string" && (t = $Y(t)), Gp(t), t
  }

  function OY(...t) {
    let e = 0;
    for (let n = 0; n < t.length; n++) {
      const i = t[n];
      Gp(i), e += i.length
    }
    const r = new Uint8Array(e);
    for (let n = 0, i = 0; n < t.length; n++) {
      const s = t[n];
      r.set(s, i), i += s.length
    }
    return r
  }
  let m7 = class {
    clone() {
      return this._cloneInto()
    }
  };

  function Yk(t) {
    const e = n => t().update(tw(n)).digest(),
      r = t();
    return e.outputLen = r.outputLen, e.blockLen = r.blockLen, e.create = () => t(), e
  }

  function DY(t) {
    const e = (n, i) => t(i).update(tw(n)).digest(),
      r = t({});
    return e.outputLen = r.outputLen, e.blockLen = r.blockLen, e.create = n => t(n), e
  }

  function LY(t = 32) {
    if (Yp && typeof Yp.getRandomValues == "function") return Yp.getRandomValues(new Uint8Array(t));
    if (Yp && typeof Yp.randomBytes == "function") return Yp.randomBytes(t);
    throw new Error("crypto.getRandomValues must be defined")
  }
  const Qk = [],
    Jk = [],
    Xk = [],
    BY = BigInt(0),
    rw = BigInt(1),
    UY = BigInt(2),
    jY = BigInt(7),
    FY = BigInt(256),
    WY = BigInt(113);
  for (let t = 0, e = rw, r = 1, n = 0; t < 24; t++) {
    [r, n] = [n, (2 * r + 3 * n) % 5], Qk.push(2 * (5 * n + r)), Jk.push((t + 1) * (t + 2) / 2 % 64);
    let i = BY;
    for (let s = 0; s < 7; s++) e = (e << rw ^ (e >> jY) * WY) % FY, e & UY && (i ^= rw << (rw << BigInt(s)) - rw);
    Xk.push(i)
  }
  const [zY, HY] = AY(Xk, !0), eR = (t, e, r) => r > 32 ? TY(t, e, r) : SY(t, e, r), tR = (t, e, r) => r > 32 ? kY(t, e, r) : IY(t, e, r);

  function rR(t, e = 24) {
    const r = new Uint32Array(10);
    for (let n = 24 - e; n < 24; n++) {
      for (let o = 0; o < 10; o++) r[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 = r[c],
          h = r[c + 1],
          f = eR(l, h, 1) ^ r[a],
          w = tR(l, h, 1) ^ r[a + 1];
        for (let b = 0; b < 50; b += 10) t[o + b] ^= f, t[o + b + 1] ^= w
      }
      let i = t[2],
        s = t[3];
      for (let o = 0; o < 24; o++) {
        const a = Jk[o],
          c = eR(i, s, a),
          l = tR(i, s, a),
          h = Qk[o];
        i = t[h], s = t[h + 1], t[h] = c, t[h + 1] = l
      }
      for (let o = 0; o < 50; o += 10) {
        for (let a = 0; a < 10; a++) r[a] = t[o + a];
        for (let a = 0; a < 10; a++) t[o + a] ^= ~r[(a + 2) % 10] & r[(a + 4) % 10]
      }
      t[0] ^= zY[n], t[1] ^= HY[n]
    }
    r.fill(0)
  }
  let w7 = class HZ extends m7 {
    constructor(e, r, n, i = !1, s = 24) {
      if (super(), this.blockLen = e, this.suffix = r, this.outputLen = n, this.enableXOF = i, this.rounds = s, this.pos = 0, this.posOut = 0, this.finished = !1, this.destroyed = !1, U3(n), 0 >= this.blockLen || this.blockLen >= 200) throw new Error("Sha3 supports only keccak-f1600 function");
      this.state = new Uint8Array(200), this.state32 = RY(this.state)
    }
    keccak() {
      Gk || Zk(this.state32), rR(this.state32, this.rounds), Gk || Zk(this.state32), this.posOut = 0, this.pos = 0
    }
    update(e) {
      Zp(this);
      const {
        blockLen: r,
        state: n
      } = this;
      e = tw(e);
      const i = e.length;
      for (let s = 0; s < i;) {
        const o = Math.min(r - this.pos, i - s);
        for (let a = 0; a < o; a++) n[this.pos++] ^= e[s++];
        this.pos === r && this.keccak()
      }
      return this
    }
    finish() {
      if (this.finished) return;
      this.finished = !0;
      const {
        state: e,
        suffix: r,
        pos: n,
        blockLen: i
      } = this;
      e[n] ^= r, r & 128 && n === i - 1 && this.keccak(), e[i - 1] ^= 128, this.keccak()
    }
    writeInto(e) {
      Zp(this, !1), Gp(e), this.finish();
      const r = this.state,
        {
          blockLen: n
        } = this;
      for (let i = 0, s = e.length; i < s;) {
        this.posOut >= n && this.keccak();
        const o = Math.min(n - this.posOut, s - i);
        e.set(r.subarray(this.posOut, this.posOut + o), i), this.posOut += o, i += 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 U3(e), this.xofInto(new Uint8Array(e))
    }
    digestInto(e) {
      if (Vk(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, this.state.fill(0)
    }
    _cloneInto(e) {
      const {
        blockLen: r,
        suffix: n,
        outputLen: i,
        rounds: s,
        enableXOF: o
      } = this;
      return e || (e = new HZ(r, n, i, o, s)), e.state32.set(this.state32), e.pos = this.pos, e.posOut = this.posOut, e.finished = this.finished, e.rounds = s, e.suffix = n, e.outputLen = i, e.enableXOF = o, e.destroyed = this.destroyed, e
    }
  };
  const Od = (t, e, r) => Yk(() => new w7(e, t, r)),
    qY = Od(6, 144, 224 / 8),
    VY = Od(6, 136, 256 / 8),
    KY = Od(6, 104, 384 / 8),
    GY = Od(6, 72, 512 / 8),
    ZY = Od(1, 144, 224 / 8),
    nR = Od(1, 136, 256 / 8),
    YY = Od(1, 104, 384 / 8),
    QY = Od(1, 72, 512 / 8),
    iR = (t, e, r) => DY((n = {}) => new w7(e, t, n.dkLen === void 0 ? r : n.dkLen, !0)),
    JY = iR(31, 168, 128 / 8),
    XY = iR(31, 136, 256 / 8),
    eQ = Object.freeze(Object.defineProperty({
      __proto__: null,
      Keccak: w7,
      keccakP: rR,
      keccak_224: ZY,
      keccak_256: nR,
      keccak_384: YY,
      keccak_512: QY,
      sha3_224: qY,
      sha3_256: VY,
      sha3_384: KY,
      sha3_512: GY,
      shake128: JY,
      shake256: XY
    }, Symbol.toStringTag, {
      value: "Module"
    }));

  function ps(t, e) {
    const r = e || "hex",
      n = nR(Kc(t, {
        strict: !1
      }) ? $3(t) : t);
    return r === "bytes" ? n : _u(n)
  }
  const v7 = new B3(8192);

  function F3(t, e) {
    if (v7.has(`${t}.${e}`)) return v7.get(`${t}.${e}`);
    const r = e ? `${e}${t.toLowerCase()}` : t.substring(2).toLowerCase(),
      n = ps(vf(r), "bytes"),
      i = (e ? r.substring(`${e}0x`.length) : r).split("");
    for (let o = 0; o < 40; o += 2) n[o >> 1] >> 4 >= 8 && i[o] && (i[o] = i[o].toUpperCase()), (n[o >> 1] & 15) >= 8 && i[o + 1] && (i[o + 1] = i[o + 1].toUpperCase());
    const s = `0x${i.join("")}`;
    return v7.set(`${t}.${e}`, s), s
  }

  function $i(t, e) {
    if (!Qa(t, {
        strict: !1
      })) throw new $d({
      address: t
    });
    return F3(t, e)
  }
  const tQ = /^0x[a-fA-F0-9]{40}$/,
    b7 = new B3(8192);

  function Qa(t, e) {
    const {
      strict: r = !0
    } = e ?? {}, n = `${t}.${r}`;
    if (b7.has(n)) return b7.get(n);
    const i = tQ.test(t) ? t.toLowerCase() === t ? !0 : r ? F3(t) === t : !0 : !1;
    return b7.set(n, i), i
  }

  function W3(t, e, r, {
    strict: n
  } = {}) {
    return Kc(t, {
      strict: !1
    }) ? rQ(t, e, r, {
      strict: n
    }) : aR(t, e, r, {
      strict: n
    })
  }

  function sR(t, e) {
    if (typeof e == "number" && e > 0 && e > fi(t) - 1) throw new Bk({
      offset: e,
      position: "start",
      size: fi(t)
    })
  }

  function oR(t, e, r) {
    if (typeof e == "number" && typeof r == "number" && fi(t) !== r - e) throw new Bk({
      offset: r,
      position: "end",
      size: fi(t)
    })
  }

  function aR(t, e, r, {
    strict: n
  } = {}) {
    sR(t, e);
    const i = t.slice(e, r);
    return n && oR(i, e, r), i
  }

  function rQ(t, e, r, {
    strict: n
  } = {}) {
    sR(t, e);
    const i = `0x${t.replace("0x","").slice((e??0)*2,(r??t.length)*2)}`;
    return n && oR(i, e, r), i
  }

  function nw(t, e) {
    if (t.length !== e.length) throw new fY({
      expectedLength: t.length,
      givenLength: e.length
    });
    const r = nQ({
        params: t,
        values: e
      }),
      n = _7(r);
    return n.length === 0 ? "0x" : n
  }

  function nQ({
    params: t,
    values: e
  }) {
    const r = [];
    for (let n = 0; n < t.length; n++) r.push(y7({
      param: t[n],
      value: e[n]
    }));
    return r
  }

  function y7({
    param: t,
    value: e
  }) {
    const r = x7(t.type);
    if (r) {
      const [n, i] = r;
      return sQ(e, {
        length: n,
        param: {
          ...t,
          type: i
        }
      })
    }
    if (t.type === "tuple") return uQ(e, {
      param: t
    });
    if (t.type === "address") return iQ(e);
    if (t.type === "bool") return aQ(e);
    if (t.type.startsWith("uint") || t.type.startsWith("int")) {
      const n = t.type.startsWith("int");
      return cQ(e, {
        signed: n
      })
    }
    if (t.type.startsWith("bytes")) return oQ(e, {
      param: t
    });
    if (t.type === "string") return lQ(e);
    throw new wY(t.type, {
      docsPath: "/docs/contract/encodeAbiParameters"
    })
  }

  function _7(t) {
    let e = 0;
    for (let s = 0; s < t.length; s++) {
      const {
        dynamic: o,
        encoded: a
      } = t[s];
      o ? e += 32 : e += fi(a)
    }
    const r = [],
      n = [];
    let i = 0;
    for (let s = 0; s < t.length; s++) {
      const {
        dynamic: o,
        encoded: a
      } = t[s];
      o ? (r.push(lr(e + i, {
        size: 32
      })), n.push(a), i += fi(a)) : r.push(a)
    }
    return Zc([...r, ...n])
  }

  function iQ(t) {
    if (!Qa(t)) throw new $d({
      address: t
    });
    return {
      dynamic: !1,
      encoded: Pd(t.toLowerCase())
    }
  }

  function sQ(t, {
    length: e,
    param: r
  }) {
    const n = e === null;
    if (!Array.isArray(t)) throw new bY(t);
    if (!n && t.length !== e) throw new dY({
      expectedLength: e,
      givenLength: t.length,
      type: `${r.type}[${e}]`
    });
    let i = !1;
    const s = [];
    for (let o = 0; o < t.length; o++) {
      const a = y7({
        param: r,
        value: t[o]
      });
      a.dynamic && (i = !0), s.push(a)
    }
    if (n || i) {
      const o = _7(s);
      if (n) {
        const a = lr(s.length, {
          size: 32
        });
        return {
          dynamic: !0,
          encoded: s.length > 0 ? Zc([a, o]) : a
        }
      }
      if (i) return {
        dynamic: !0,
        encoded: o
      }
    }
    return {
      dynamic: !1,
      encoded: Zc(s.map(({
        encoded: o
      }) => o))
    }
  }

  function oQ(t, {
    param: e
  }) {
    const [, r] = e.type.split("bytes"), n = fi(t);
    if (!r) {
      let i = t;
      return n % 32 !== 0 && (i = Pd(i, {
        dir: "right",
        size: Math.ceil((t.length - 2) / 2 / 32) * 32
      })), {
        dynamic: !0,
        encoded: Zc([Pd(lr(n, {
          size: 32
        })), i])
      }
    }
    if (n !== Number.parseInt(r)) throw new hY({
      expectedSize: Number.parseInt(r),
      value: t
    });
    return {
      dynamic: !1,
      encoded: Pd(t, {
        dir: "right"
      })
    }
  }

  function aQ(t) {
    if (typeof t != "boolean") throw new Ye(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);
    return {
      dynamic: !1,
      encoded: Pd(zk(t))
    }
  }

  function cQ(t, {
    signed: e
  }) {
    return {
      dynamic: !1,
      encoded: lr(t, {
        size: 32,
        signed: e
      })
    }
  }

  function lQ(t) {
    const e = Vp(t),
      r = Math.ceil(fi(e) / 32),
      n = [];
    for (let i = 0; i < r; i++) n.push(Pd(W3(e, i * 32, (i + 1) * 32), {
      dir: "right"
    }));
    return {
      dynamic: !0,
      encoded: Zc([Pd(lr(fi(e), {
        size: 32
      })), ...n])
    }
  }

  function uQ(t, {
    param: e
  }) {
    let r = !1;
    const n = [];
    for (let i = 0; i < e.components.length; i++) {
      const s = e.components[i],
        o = Array.isArray(t) ? i : s.name,
        a = y7({
          param: s,
          value: t[o]
        });
      n.push(a), a.dynamic && (r = !0)
    }
    return {
      dynamic: r,
      encoded: r ? _7(n) : Zc(n.map(({
        encoded: i
      }) => i))
    }
  }

  function x7(t) {
    const e = t.match(/^(.*)\[(\d+)?\]$/);
    return e ? [e[2] ? Number(e[2]) : null, e[1]] : void 0
  }
  const C7 = "/docs/contract/encodeDeployData";

  function cR(t) {
    const {
      abi: e,
      args: r,
      bytecode: n
    } = t;
    if (!r || r.length === 0) return n;
    const i = e.find(o => "type" in o && o.type === "constructor");
    if (!i) throw new lY({
      docsPath: C7
    });
    if (!("inputs" in i)) throw new Hk({
      docsPath: C7
    });
    if (!i.inputs || i.inputs.length === 0) throw new Hk({
      docsPath: C7
    });
    const s = nw(i.inputs, r);
    return L3([n, s])
  }

  function Ja(t) {
    return typeof t == "string" ? {
      address: t,
      type: "json-rpc"
    } : t
  }
  class E7 extends Ye {
    constructor({
      docsPath: e
    } = {}) {
      super(["Could not find an Account to execute with this Action.", "Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
  `), {
        docsPath: e,
        docsSlug: "account",
        name: "AccountNotFoundError"
      })
    }
  }
  class A7 extends Ye {
    constructor({
      docsPath: e,
      metaMessages: r,
      type: n
    }) {
      super(`Account type "${n}" is not supported.`, {
        docsPath: e,
        metaMessages: r,
        name: "AccountTypeNotSupportedError"
      })
    }
  }

  function dQ(t) {
    const e = ps(`0x${t.substring(4)}`).substring(26);
    return F3(`0x${e}`)
  }
  const cFe = "modulepreload",
    lFe = function (t) {
      return "/" + t
    },
    uFe = {},
    pi = function (e, r, n) {
      let i = Promise.resolve();

      function s(o) {
        const a = new Event("vite:preloadError", {
          cancelable: !0
        });
        if (a.payload = o, window.dispatchEvent(a), !a.defaultPrevented) throw o
      }
      return i.then(o => {
        for (const a of o || []) a.status === "rejected" && s(a.reason);
        return e().catch(s)
      })
    };
  async function hQ({
    hash: t,
    signature: e
  }) {
    const r = Kc(t) ? t : _u(t),
      {
        secp256k1: n
      } = await pi(async () => {
        const {
          secp256k1: o
        } = await Promise.resolve().then(() => fte);
        return {
          secp256k1: o
        }
      }, void 0);
    return `0x${(()=>{if(typeof e=="object"&&"r"in e&&"s"in e){const{r:l,s:h,v:f,yParity:w}=e,b=Number(w??f),C=lR(b);return new n.Signature(qp(l),qp(h)).addRecoveryBit(C)}const o=Kc(e)?e:_u(e),a=bf(`
    0x $ {
      o.slice(130)
    }
    `),c=lR(a);return n.Signature.fromCompact(o.substring(2,130)).addRecoveryBit(c)})().recoverPublicKey(r.substring(2)).toHex(!1)}`
  }

  function lR(t) {
    if (t === 0 || t === 1) return t;
    if (t === 27) return 0;
    if (t === 28) return 1;
    throw new Error("Invalid yParityOrV value")
  }
  async function fQ({
    hash: t,
    signature: e
  }) {
    return dQ(await hQ({
      hash: t,
      signature: e
    }))
  }
  class uR extends Ye {
    constructor({
      offset: e
    }) {
      super(`Offset \`${e}\` cannot be negative.`, {
        name: "NegativeOffsetError"
      })
    }
  }
  class pQ extends Ye {
    constructor({
      length: e,
      position: r
    }) {
      super(`Position \`${r}\` is out of bounds (\`0 < position < ${e}\`).`, {
        name: "PositionOutOfBoundsError"
      })
    }
  }
  class gQ extends Ye {
    constructor({
      count: e,
      limit: r
    }) {
      super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${e}\`).`, {
        name: "RecursiveReadLimitExceededError"
      })
    }
  }
  const mQ = {
    bytes: new Uint8Array,
    dataView: new DataView(new ArrayBuffer(0)),
    position: 0,
    positionReadCount: new Map,
    recursiveReadCount: 0,
    recursiveReadLimit: Number.POSITIVE_INFINITY,
    assertReadLimit() {
      if (this.recursiveReadCount >= this.recursiveReadLimit) throw new gQ({
        count: this.recursiveReadCount + 1,
        limit: this.recursiveReadLimit
      })
    },
    assertPosition(t) {
      if (t < 0 || t > this.bytes.length - 1) throw new pQ({
        length: this.bytes.length,
        position: t
      })
    },
    decrementPosition(t) {
      if (t < 0) throw new uR({
        offset: t
      });
      const e = this.position - t;
      this.assertPosition(e), this.position = e
    },
    getReadCount(t) {
      return this.positionReadCount.get(t || this.position) || 0
    },
    incrementPosition(t) {
      if (t < 0) throw new uR({
        offset: t
      });
      const e = this.position + t;
      this.assertPosition(e), this.position = e
    },
    inspectByte(t) {
      const e = t ?? this.position;
      return this.assertPosition(e), this.bytes[e]
    },
    inspectBytes(t, e) {
      const r = e ?? this.position;
      return this.assertPosition(r + t - 1), this.bytes.subarray(r, r + t)
    },
    inspectUint8(t) {
      const e = t ?? this.position;
      return this.assertPosition(e), this.bytes[e]
    },
    inspectUint16(t) {
      const e = t ?? this.position;
      return this.assertPosition(e + 1), this.dataView.getUint16(e)
    },
    inspectUint24(t) {
      const e = t ?? this.position;
      return this.assertPosition(e + 2), (this.dataView.getUint16(e) << 8) + this.dataView.getUint8(e + 2)
    },
    inspectUint32(t) {
      const e = t ?? this.position;
      return this.assertPosition(e + 3), this.dataView.getUint32(e)
    },
    pushByte(t) {
      this.assertPosition(this.position), this.bytes[this.position] = t, this.position++
    },
    pushBytes(t) {
      this.assertPosition(this.position + t.length - 1), this.bytes.set(t, this.position), this.position += t.length
    },
    pushUint8(t) {
      this.assertPosition(this.position), this.bytes[this.position] = t, this.position++
    },
    pushUint16(t) {
      this.assertPosition(this.position + 1), this.dataView.setUint16(this.position, t), this.position += 2
    },
    pushUint24(t) {
      this.assertPosition(this.position + 2), this.dataView.setUint16(this.position, t >> 8), this.dataView.setUint8(this.position + 2, t & 255), this.position += 3
    },
    pushUint32(t) {
      this.assertPosition(this.position + 3), this.dataView.setUint32(this.position, t), this.position += 4
    },
    readByte() {
      this.assertReadLimit(), this._touch();
      const t = this.inspectByte();
      return this.position++, t
    },
    readBytes(t, e) {
      this.assertReadLimit(), this._touch();
      const r = this.inspectBytes(t);
      return this.position += e ?? t, r
    },
    readUint8() {
      this.assertReadLimit(), this._touch();
      const t = this.inspectUint8();
      return this.position += 1, t
    },
    readUint16() {
      this.assertReadLimit(), this._touch();
      const t = this.inspectUint16();
      return this.position += 2, t
    },
    readUint24() {
      this.assertReadLimit(), this._touch();
      const t = this.inspectUint24();
      return this.position += 3, t
    },
    readUint32() {
      this.assertReadLimit(), this._touch();
      const t = this.inspectUint32();
      return this.position += 4, t
    },
    get remaining() {
      return this.bytes.length - this.position
    },
    setPosition(t) {
      const e = this.position;
      return this.assertPosition(t), this.position = t, () => this.position = e
    },
    _touch() {
      if (this.recursiveReadLimit === Number.POSITIVE_INFINITY) return;
      const t = this.getReadCount();
      this.positionReadCount.set(this.position, t + 1), t > 0 && this.recursiveReadCount++
    }
  };

  function S7(t, {
    recursiveReadLimit: e = 8192
  } = {}) {
    const r = Object.create(mQ);
    return r.bytes = t, r.dataView = new DataView(t.buffer, t.byteOffset, t.byteLength), r.positionReadCount = new Map, r.recursiveReadLimit = e, r
  }

  function wQ(t, e = "hex") {
    const r = dR(t),
      n = S7(new Uint8Array(r.length));
    return r.encode(n), e === "hex" ? Pi(n.bytes) : n.bytes
  }

  function dR(t) {
    return Array.isArray(t) ? vQ(t.map(e => dR(e))) : bQ(t)
  }

  function vQ(t) {
    const e = t.reduce((i, s) => i + s.length, 0),
      r = hR(e);
    return {
      length: e <= 55 ? 1 + e : 1 + r + e,
      encode(i) {
        e <= 55 ? i.pushByte(192 + e) : (i.pushByte(247 + r), r === 1 ? i.pushUint8(e) : r === 2 ? i.pushUint16(e) : r === 3 ? i.pushUint24(e) : i.pushUint32(e));
        for (const {
            encode: s
          }
          of t) s(i)
      }
    }
  }

  function bQ(t) {
    const e = typeof t == "string" ? Gc(t) : t,
      r = hR(e.length);
    return {
      length: e.length === 1 && e[0] < 128 ? 1 : e.length <= 55 ? 1 + e.length : 1 + r + e.length,
      encode(i) {
        e.length === 1 && e[0] < 128 ? i.pushBytes(e) : e.length <= 55 ? (i.pushByte(128 + e.length), i.pushBytes(e)) : (i.pushByte(183 + r), r === 1 ? i.pushUint8(e.length) : r === 2 ? i.pushUint16(e.length) : r === 3 ? i.pushUint24(e.length) : i.pushUint32(e.length), i.pushBytes(e))
      }
    }
  }

  function hR(t) {
    if (t < 2 ** 8) return 1;
    if (t < 2 ** 16) return 2;
    if (t < 2 ** 24) return 3;
    if (t < 2 ** 32) return 4;
    throw new Ye("Length is too large.")
  }

  function yQ(t) {
    const {
      chainId: e,
      contractAddress: r,
      nonce: n,
      to: i
    } = t, s = ps(L3(["0x05", wQ([e ? lr(e) : "0x", r, n ? lr(n) : "0x"])]));
    return i === "bytes" ? Gc(s) : s
  }
  async function fR(t) {
    const {
      authorization: e,
      signature: r
    } = t;
    return fQ({
      hash: yQ(e),
      signature: r ?? e
    })
  }
  class I7 extends Ye {
    constructor({
      blockNumber: e,
      chain: r,
      contract: n
    }) {
      super(`Chain "${r.name}" does not support contract "${n.name}".`, {
        metaMessages: ["This could be due to any of the following:", ...e && n.blockCreated && n.blockCreated > e ? [`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${e}).`] : [`- The chain does not have the contract "${n.name}" configured.`]],
        name: "ChainDoesNotSupportContract"
      })
    }
  }
  class _Q extends Ye {
    constructor({
      chain: e,
      currentChainId: r
    }) {
      super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${e.id} – ${e.name}).`, {
        metaMessages: [`Current Chain ID:  ${r}`, `Expected Chain ID: ${e.id} – ${e.name}`],
        name: "ChainMismatchError"
      })
    }
  }
  class xQ extends Ye {
    constructor() {
      super(["No chain was provided to the request.", "Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(`
  `), {
        name: "ChainNotFoundError"
      })
    }
  }
  class pR extends Ye {
    constructor() {
      super("No chain was provided to the Client.", {
        name: "ClientChainNotConfiguredError"
      })
    }
  }

  function CQ({
    chain: t,
    currentChainId: e
  }) {
    if (!t) throw new xQ;
    if (e !== t.id) throw new _Q({
      chain: t,
      currentChainId: e
    })
  }
  const EQ = {
      gwei: 9,
      wei: 18
    },
    AQ = {
      ether: -9,
      wei: 9
    },
    SQ = {
      ether: -18,
      gwei: -9
    };

  function iw(t, e) {
    let r = t.toString();
    const n = r.startsWith("-");
    n && (r = r.slice(1)), r = r.padStart(e, "0");
    let [i, s] = [r.slice(0, r.length - e), r.slice(r.length - e)];
    return s = s.replace(/(0+)$/, ""), `${n?"-":""}${i||"0"}${s?`.${s}`:""}`
  }

  function eo(t, e = "wei") {
    return iw(t, AQ[e])
  }
  class Qp extends Ye {
    constructor({
      cause: e,
      message: r
    } = {}) {
      const n = r?.replace("execution reverted: ", "")?.replace("execution reverted", "");
      super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`, {
        cause: e,
        name: "ExecutionRevertedError"
      })
    }
  }
  Object.defineProperty(Qp, "code", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: 3
  }), Object.defineProperty(Qp, "nodeMessage", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: /execution reverted/
  });
  class z3 extends Ye {
    constructor({
      cause: e,
      maxFeePerGas: r
    } = {}) {
      super(`The fee cap (\`maxFeePerGas\`${r?` = ${eo(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`, {
        cause: e,
        name: "FeeCapTooHighError"
      })
    }
  }
  Object.defineProperty(z3, "nodeMessage", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: /max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/
  });
  class T7 extends Ye {
    constructor({
      cause: e,
      maxFeePerGas: r
    } = {}) {
      super(`The fee cap (\`maxFeePerGas\`${r?` = ${eo(r)}`:""} gwei) cannot be lower than the block base fee.`, {
        cause: e,
        name: "FeeCapTooLowError"
      })
    }
  }
  Object.defineProperty(T7, "nodeMessage", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: /max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/
  });
  class k7 extends Ye {
    constructor({
      cause: e,
      nonce: r
    } = {}) {
      super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`, {
        cause: e,
        name: "NonceTooHighError"
      })
    }
  }
  Object.defineProperty(k7, "nodeMessage", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: /nonce too high/
  });
  class R7 extends Ye {
    constructor({
      cause: e,
      nonce: r
    } = {}) {
      super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`, "Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
  `), {
        cause: e,
        name: "NonceTooLowError"
      })
    }
  }
  Object.defineProperty(R7, "nodeMessage", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: /nonce too low|transaction already imported|already known/
  });
  class N7 extends Ye {
    constructor({
      cause: e,
      nonce: r
    } = {}) {
      super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`, {
        cause: e,
        name: "NonceMaxValueError"
      })
    }
  }
  Object.defineProperty(N7, "nodeMessage", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: /nonce has max value/
  });
  class M7 extends Ye {
    constructor({
      cause: e
    } = {}) {
      super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
  `), {
        cause: e,
        metaMessages: ["This error could arise when the account does not have enough funds to:", " - pay for the total gas fee,", " - pay for the value to send.", " ", "The cost of the transaction is calculated as `gas * gas fee + value`, where:", " - `gas` is the amount of gas needed for transaction to execute,", " - `gas fee` is the gas fee,", " - `value` is the amount of ether to send to the recipient."],
        name: "InsufficientFundsError"
      })
    }
  }
  Object.defineProperty(M7, "nodeMessage", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: /insufficient funds|exceeds transaction sender account balance/
  });
  class P7 extends Ye {
    constructor({
      cause: e,
      gas: r
    } = {}) {
      super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`, {
        cause: e,
        name: "IntrinsicGasTooHighError"
      })
    }
  }
  Object.defineProperty(P7, "nodeMessage", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: /intrinsic gas too high|gas limit reached/
  });
  class $7 extends Ye {
    constructor({
      cause: e,
      gas: r
    } = {}) {
      super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`, {
        cause: e,
        name: "IntrinsicGasTooLowError"
      })
    }
  }
  Object.defineProperty($7, "nodeMessage", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: /intrinsic gas too low/
  });
  class O7 extends Ye {
    constructor({
      cause: e
    }) {
      super("The transaction type is not supported for this chain.", {
        cause: e,
        name: "TransactionTypeNotSupportedError"
      })
    }
  }
  Object.defineProperty(O7, "nodeMessage", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: /transaction type not valid/
  });
  class H3 extends Ye {
    constructor({
      cause: e,
      maxPriorityFeePerGas: r,
      maxFeePerGas: n
    } = {}) {
      super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${eo(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${eo(n)} gwei`:""}).`].join(`
  `), {
        cause: e,
        name: "TipAboveFeeCapError"
      })
    }
  }
  Object.defineProperty(H3, "nodeMessage", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/
  });
  class q3 extends Ye {
    constructor({
      cause: e
    }) {
      super(`An error occurred while executing: ${e?.shortMessage}`, {
        cause: e,
        name: "UnknownNodeError"
      })
    }
  }

  function D7(t, e = "wei") {
    return iw(t, EQ[e])
  }

  function sw(t) {
    const e = Object.entries(t).map(([n, i]) => i === void 0 || i === !1 ? null : [n, i]).filter(Boolean),
      r = e.reduce((n, [i]) => Math.max(n, i.length), 0);
    return e.map(([n, i]) => `  ${`${n}:`.padEnd(r+1)}  ${i}`).join(`
  `)
  }
  class IQ extends Ye {
    constructor() {
      super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.", "Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
  `), {
        name: "FeeConflictError"
      })
    }
  }
  class TQ extends Ye {
    constructor({
      transaction: e
    }) {
      super("Cannot infer a transaction type from provided transaction.", {
        metaMessages: ["Provided Transaction:", "{", sw(e), "}", "", "To infer the type, either provide:", "- a `type` to the Transaction, or", "- an EIP-1559 Transaction with `maxFeePerGas`, or", "- an EIP-2930 Transaction with `gasPrice` & `accessList`, or", "- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or", "- an EIP-7702 Transaction with `authorizationList`, or", "- a Legacy Transaction with `gasPrice`"],
        name: "InvalidSerializableTransactionError"
      })
    }
  }
  class kQ extends Ye {
    constructor(e, {
      account: r,
      docsPath: n,
      chain: i,
      data: s,
      gas: o,
      gasPrice: a,
      maxFeePerGas: c,
      maxPriorityFeePerGas: l,
      nonce: h,
      to: f,
      value: w
    }) {
      const b = sw({
        chain: i && `${i?.name} (id: ${i?.id})`,
        from: r?.address,
        to: f,
        value: typeof w < "u" && `${D7(w)} ${i?.nativeCurrency?.symbol||"ETH"}`,
        data: s,
        gas: o,
        gasPrice: typeof a < "u" && `${eo(a)} gwei`,
        maxFeePerGas: typeof c < "u" && `${eo(c)} gwei`,
        maxPriorityFeePerGas: typeof l < "u" && `${eo(l)} gwei`,
        nonce: h
      });
      super(e.shortMessage, {
        cause: e,
        docsPath: n,
        metaMessages: [...e.metaMessages ? [...e.metaMessages, " "] : [], "Request Arguments:", b].filter(Boolean),
        name: "TransactionExecutionError"
      }), Object.defineProperty(this, "cause", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), this.cause = e
    }
  }
  class gR extends Ye {
    constructor({
      blockHash: e,
      blockNumber: r,
      blockTag: n,
      hash: i,
      index: s
    }) {
      let o = "Transaction";
      n && s !== void 0 && (o = `Transaction at block time "${n}" at index "${s}"`), e && s !== void 0 && (o = `Transaction at block hash "${e}" at index "${s}"`), r && s !== void 0 && (o = `Transaction at block number "${r}" at index "${s}"`), i && (o = `Transaction with hash "${i}"`), super(`${o} could not be found.`, {
        name: "TransactionNotFoundError"
      })
    }
  }
  class mR extends Ye {
    constructor({
      hash: e
    }) {
      super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`, {
        name: "TransactionReceiptNotFoundError"
      })
    }
  }
  class RQ extends Ye {
    constructor({
      hash: e
    }) {
      super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`, {
        name: "WaitForTransactionReceiptTimeoutError"
      })
    }
  }
  const Ro = (t, e, r) => JSON.stringify(t, (n, i) => typeof i == "bigint" ? i.toString() : i, r),
    NQ = t => t,
    ow = t => t;
  class yf extends Ye {
    constructor({
      body: e,
      cause: r,
      details: n,
      headers: i,
      status: s,
      url: o
    }) {
      super("HTTP request failed.", {
        cause: r,
        details: n,
        metaMessages: [s && `Status: ${s}`, `URL: ${ow(o)}`, e && `Request body: ${Ro(e)}`].filter(Boolean),
        name: "HttpRequestError"
      }), Object.defineProperty(this, "body", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "headers", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "status", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "url", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), this.body = e, this.headers = i, this.status = s, this.url = o
    }
  }
  class wR extends Ye {
    constructor({
      body: e,
      error: r,
      url: n
    }) {
      super("RPC Request failed.", {
        cause: r,
        details: r.message,
        metaMessages: [`URL: ${ow(n)}`, `Request body: ${Ro(e)}`],
        name: "RpcRequestError"
      }), Object.defineProperty(this, "code", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), this.code = r.code
    }
  }
  class vR extends Ye {
    constructor({
      body: e,
      url: r
    }) {
      super("The request took too long to respond.", {
        details: "The request timed out.",
        metaMessages: [`URL: ${ow(r)}`, `Request body: ${Ro(e)}`],
        name: "TimeoutError"
      })
    }
  }
  const MQ = -1;
  class to extends Ye {
    constructor(e, {
      code: r,
      docsPath: n,
      metaMessages: i,
      name: s,
      shortMessage: o
    }) {
      super(o, {
        cause: e,
        docsPath: n,
        metaMessages: i || e?.metaMessages,
        name: s || "RpcError"
      }), Object.defineProperty(this, "code", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), this.name = s || e.name, this.code = e instanceof wR ? e.code : r ?? MQ
    }
  }
  class Jp extends to {
    constructor(e, r) {
      super(e, r), Object.defineProperty(this, "data", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), this.data = r.data
    }
  }
  class aw extends to {
    constructor(e) {
      super(e, {
        code: aw.code,
        name: "ParseRpcError",
        shortMessage: "Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."
      })
    }
  }
  Object.defineProperty(aw, "code", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: -32700
  });
  class cw extends to {
    constructor(e) {
      super(e, {
        code: cw.code,
        name: "InvalidRequestRpcError",
        shortMessage: "JSON is not a valid request object."
      })
    }
  }
  Object.defineProperty(cw, "code", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: -32600
  });
  class lw extends to {
    constructor(e, {
      method: r
    } = {}) {
      super(e, {
        code: lw.code,
        name: "MethodNotFoundRpcError",
        shortMessage: `The method${r?` "${r}"`:""} does not exist / is not available.`
      })
    }
  }
  Object.defineProperty(lw, "code", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: -32601
  });
  class uw extends to {
    constructor(e) {
      super(e, {
        code: uw.code,
        name: "InvalidParamsRpcError",
        shortMessage: ["Invalid parameters were provided to the RPC method.", "Double check you have provided the correct parameters."].join(`
  `)
      })
    }
  }
  Object.defineProperty(uw, "code", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: -32602
  });
  class _f extends to {
    constructor(e) {
      super(e, {
        code: _f.code,
        name: "InternalRpcError",
        shortMessage: "An internal error was received."
      })
    }
  }
  Object.defineProperty(_f, "code", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: -32603
  });
  class dw extends to {
    constructor(e) {
      super(e, {
        code: dw.code,
        name: "InvalidInputRpcError",
        shortMessage: ["Missing or invalid parameters.", "Double check you have provided the correct parameters."].join(`
  `)
      })
    }
  }
  Object.defineProperty(dw, "code", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: -32e3
  });
  class hw extends to {
    constructor(e) {
      super(e, {
        code: hw.code,
        name: "ResourceNotFoundRpcError",
        shortMessage: "Requested resource not found."
      }), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "ResourceNotFoundRpcError"
      })
    }
  }
  Object.defineProperty(hw, "code", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: -32001
  });
  class Dd extends to {
    constructor(e) {
      super(e, {
        code: Dd.code,
        name: "ResourceUnavailableRpcError",
        shortMessage: "Requested resource not available."
      })
    }
  }
  Object.defineProperty(Dd, "code", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: -32002
  });
  class Xp extends to {
    constructor(e) {
      super(e, {
        code: Xp.code,
        name: "TransactionRejectedRpcError",
        shortMessage: "Transaction creation failed."
      })
    }
  }
  Object.defineProperty(Xp, "code", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: -32003
  });
  class fw extends to {
    constructor(e, {
      method: r
    } = {}) {
      super(e, {
        code: fw.code,
        name: "MethodNotSupportedRpcError",
        shortMessage: `Method${r?` "${r}"`:""} is not implemented.`
      })
    }
  }
  Object.defineProperty(fw, "code", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: -32004
  });
  class e1 extends to {
    constructor(e) {
      super(e, {
        code: e1.code,
        name: "LimitExceededRpcError",
        shortMessage: "Request exceeds defined limit."
      })
    }
  }
  Object.defineProperty(e1, "code", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: -32005
  });
  class pw extends to {
    constructor(e) {
      super(e, {
        code: pw.code,
        name: "JsonRpcVersionUnsupportedError",
        shortMessage: "Version of JSON-RPC protocol is not supported."
      })
    }
  }
  Object.defineProperty(pw, "code", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: -32006
  });
  class on extends Jp {
    constructor(e) {
      super(e, {
        code: on.code,
        name: "UserRejectedRequestError",
        shortMessage: "User rejected the request."
      })
    }
  }
  Object.defineProperty(on, "code", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: 4001
  });
  class gw extends Jp {
    constructor(e) {
      super(e, {
        code: gw.code,
        name: "UnauthorizedProviderError",
        shortMessage: "The requested method and/or account has not been authorized by the user."
      })
    }
  }
  Object.defineProperty(gw, "code", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: 4100
  });
  class mw extends Jp {
    constructor(e, {
      method: r
    } = {}) {
      super(e, {
        code: mw.code,
        name: "UnsupportedProviderMethodError",
        shortMessage: `The Provider does not support the requested method${r?` " ${r}"`:""}.`
      })
    }
  }
  Object.defineProperty(mw, "code", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: 4200
  });
  class ww extends Jp {
    constructor(e) {
      super(e, {
        code: ww.code,
        name: "ProviderDisconnectedError",
        shortMessage: "The Provider is disconnected from all chains."
      })
    }
  }
  Object.defineProperty(ww, "code", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: 4900
  });
  class vw extends Jp {
    constructor(e) {
      super(e, {
        code: vw.code,
        name: "ChainDisconnectedError",
        shortMessage: "The Provider is not connected to the requested chain."
      })
    }
  }
  Object.defineProperty(vw, "code", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: 4901
  });
  class Rs extends Jp {
    constructor(e) {
      super(e, {
        code: Rs.code,
        name: "SwitchChainError",
        shortMessage: "An error occurred when attempting to switch chain."
      })
    }
  }
  Object.defineProperty(Rs, "code", {
    enumerable: !0,
    configurable: !0,
    writable: !0,
    value: 4902
  });
  class PQ extends to {
    constructor(e) {
      super(e, {
        name: "UnknownRpcError",
        shortMessage: "An unknown RPC error occurred."
      })
    }
  }

  function L7(t, e) {
    const r = (t.details || "").toLowerCase(),
      n = t instanceof Ye ? t.walk(i => i?.code === Qp.code) : t;
    return n instanceof Ye ? new Qp({
      cause: t,
      message: n.details
    }) : Qp.nodeMessage.test(r) ? new Qp({
      cause: t,
      message: t.details
    }) : z3.nodeMessage.test(r) ? new z3({
      cause: t,
      maxFeePerGas: e?.maxFeePerGas
    }) : T7.nodeMessage.test(r) ? new T7({
      cause: t,
      maxFeePerGas: e?.maxFeePerGas
    }) : k7.nodeMessage.test(r) ? new k7({
      cause: t,
      nonce: e?.nonce
    }) : R7.nodeMessage.test(r) ? new R7({
      cause: t,
      nonce: e?.nonce
    }) : N7.nodeMessage.test(r) ? new N7({
      cause: t,
      nonce: e?.nonce
    }) : M7.nodeMessage.test(r) ? new M7({
      cause: t
    }) : P7.nodeMessage.test(r) ? new P7({
      cause: t,
      gas: e?.gas
    }) : $7.nodeMessage.test(r) ? new $7({
      cause: t,
      gas: e?.gas
    }) : O7.nodeMessage.test(r) ? new O7({
      cause: t
    }) : H3.nodeMessage.test(r) ? new H3({
      cause: t,
      maxFeePerGas: e?.maxFeePerGas,
      maxPriorityFeePerGas: e?.maxPriorityFeePerGas
    }) : new q3({
      cause: t
    })
  }

  function $Q(t, {
    docsPath: e,
    ...r
  }) {
    const n = (() => {
      const i = L7(t, r);
      return i instanceof q3 ? t : i
    })();
    return new kQ(n, {
      docsPath: e,
      ...r
    })
  }

  function B7(t, {
    format: e
  }) {
    if (!e) return {};
    const r = {};

    function n(s) {
      const o = Object.keys(s);
      for (const a of o) a in t && (r[a] = t[a]), s[a] && typeof s[a] == "object" && !Array.isArray(s[a]) && n(s[a])
    }
    const i = e(t || {});
    return n(i), r
  }
  const OQ = {
    legacy: "0x0",
    eip2930: "0x1",
    eip1559: "0x2",
    eip4844: "0x3",
    eip7702: "0x4"
  };

  function U7(t) {
    const e = {};
    return typeof t.authorizationList < "u" && (e.authorizationList = DQ(t.authorizationList)), typeof t.accessList < "u" && (e.accessList = t.accessList), typeof t.blobVersionedHashes < "u" && (e.blobVersionedHashes = t.blobVersionedHashes), typeof t.blobs < "u" && (typeof t.blobs[0] != "string" ? e.blobs = t.blobs.map(r => Pi(r)) : e.blobs = t.blobs), typeof t.data < "u" && (e.data = t.data), typeof t.from < "u" && (e.from = t.from), typeof t.gas < "u" && (e.gas = lr(t.gas)), typeof t.gasPrice < "u" && (e.gasPrice = lr(t.gasPrice)), typeof t.maxFeePerBlobGas < "u" && (e.maxFeePerBlobGas = lr(t.maxFeePerBlobGas)), typeof t.maxFeePerGas < "u" && (e.maxFeePerGas = lr(t.maxFeePerGas)), typeof t.maxPriorityFeePerGas < "u" && (e.maxPriorityFeePerGas = lr(t.maxPriorityFeePerGas)), typeof t.nonce < "u" && (e.nonce = lr(t.nonce)), typeof t.to < "u" && (e.to = t.to), typeof t.type < "u" && (e.type = OQ[t.type]), typeof t.value < "u" && (e.value = lr(t.value)), e
  }

  function DQ(t) {
    return t.map(e => ({
      address: e.contractAddress,
      r: e.r,
      s: e.s,
      chainId: lr(e.chainId),
      nonce: lr(e.nonce),
      ...typeof e.yParity < "u" ? {
        yParity: lr(e.yParity)
      } : {},
      ...typeof e.v < "u" && typeof e.yParity > "u" ? {
        v: lr(e.v)
      } : {}
    }))
  }

  function wn(t, e, r) {
    const n = t[e.name];
    if (typeof n == "function") return n;
    const i = t[r];
    return typeof i == "function" ? i : s => e(t, s)
  }
  const LQ = 2n ** 256n - 1n;

  function V3(t) {
    const {
      account: e,
      gasPrice: r,
      maxFeePerGas: n,
      maxPriorityFeePerGas: i,
      to: s
    } = t, o = e ? Ja(e) : void 0;
    if (o && !Qa(o.address)) throw new $d({
      address: o.address
    });
    if (s && !Qa(s)) throw new $d({
      address: s
    });
    if (typeof r < "u" && (typeof n < "u" || typeof i < "u")) throw new IQ;
    if (n && n > LQ) throw new z3({
      maxFeePerGas: n
    });
    if (i && n && i > n) throw new H3({
      maxFeePerGas: n,
      maxPriorityFeePerGas: i
    })
  }
  async function bR(t) {
    const e = await t.request({
      method: "eth_chainId"
    }, {
      dedupe: !0
    });
    return bf(e)
  }
  class BQ extends Ye {
    constructor() {
      super("`baseFeeMultiplier` must be greater than 1.", {
        name: "BaseFeeScalarError"
      })
    }
  }
  class j7 extends Ye {
    constructor() {
      super("Chain does not support EIP-1559 fees.", {
        name: "Eip1559FeesNotSupportedError"
      })
    }
  }
  class UQ extends Ye {
    constructor({
      maxPriorityFeePerGas: e
    }) {
      super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${eo(e)} gwei).`, {
        name: "MaxFeePerGasTooLowError"
      })
    }
  }
  class yR extends Ye {
    constructor({
      blockHash: e,
      blockNumber: r
    }) {
      let n = "Block";
      e && (n = `Block at hash "${e}"`), r && (n = `Block at number "${r}"`), super(`${n} could not be found.`, {
        name: "BlockNotFoundError"
      })
    }
  }
  const _R = {
    "0x0": "legacy",
    "0x1": "eip2930",
    "0x2": "eip1559",
    "0x3": "eip4844",
    "0x4": "eip7702"
  };

  function xR(t) {
    const e = {
      ...t,
      blockHash: t.blockHash ? t.blockHash : null,
      blockNumber: t.blockNumber ? BigInt(t.blockNumber) : null,
      chainId: t.chainId ? bf(t.chainId) : void 0,
      gas: t.gas ? BigInt(t.gas) : void 0,
      gasPrice: t.gasPrice ? BigInt(t.gasPrice) : void 0,
      maxFeePerBlobGas: t.maxFeePerBlobGas ? BigInt(t.maxFeePerBlobGas) : void 0,
      maxFeePerGas: t.maxFeePerGas ? BigInt(t.maxFeePerGas) : void 0,
      maxPriorityFeePerGas: t.maxPriorityFeePerGas ? BigInt(t.maxPriorityFeePerGas) : void 0,
      nonce: t.nonce ? bf(t.nonce) : void 0,
      to: t.to ? t.to : null,
      transactionIndex: t.transactionIndex ? Number(t.transactionIndex) : null,
      type: t.type ? _R[t.type] : void 0,
      typeHex: t.type ? t.type : void 0,
      value: t.value ? BigInt(t.value) : void 0,
      v: t.v ? BigInt(t.v) : void 0
    };
    return t.authorizationList && (e.authorizationList = jQ(t.authorizationList)), e.yParity = (() => {
      if (t.yParity) return Number(t.yParity);
      if (typeof e.v == "bigint") {
        if (e.v === 0n || e.v === 27n) return 0;
        if (e.v === 1n || e.v === 28n) return 1;
        if (e.v >= 35n) return e.v % 2n === 0n ? 1 : 0
      }
    })(), e.type === "legacy" && (delete e.accessList, delete e.maxFeePerBlobGas, delete e.maxFeePerGas, delete e.maxPriorityFeePerGas, delete e.yParity), e.type === "eip2930" && (delete e.maxFeePerBlobGas, delete e.maxFeePerGas, delete e.maxPriorityFeePerGas), e.type === "eip1559" && delete e.maxFeePerBlobGas, e
  }

  function jQ(t) {
    return t.map(e => ({
      contractAddress: e.address,
      chainId: Number(e.chainId),
      nonce: Number(e.nonce),
      r: e.r,
      s: e.s,
      yParity: Number(e.yParity)
    }))
  }

  function FQ(t) {
    const e = t.transactions?.map(r => typeof r == "string" ? r : xR(r));
    return {
      ...t,
      baseFeePerGas: t.baseFeePerGas ? BigInt(t.baseFeePerGas) : null,
      blobGasUsed: t.blobGasUsed ? BigInt(t.blobGasUsed) : void 0,
      difficulty: t.difficulty ? BigInt(t.difficulty) : void 0,
      excessBlobGas: t.excessBlobGas ? BigInt(t.excessBlobGas) : void 0,
      gasLimit: t.gasLimit ? BigInt(t.gasLimit) : void 0,
      gasUsed: t.gasUsed ? BigInt(t.gasUsed) : void 0,
      hash: t.hash ? t.hash : null,
      logsBloom: t.logsBloom ? t.logsBloom : null,
      nonce: t.nonce ? t.nonce : null,
      number: t.number ? BigInt(t.number) : null,
      size: t.size ? BigInt(t.size) : void 0,
      timestamp: t.timestamp ? BigInt(t.timestamp) : void 0,
      transactions: e,
      totalDifficulty: t.totalDifficulty ? BigInt(t.totalDifficulty) : null
    }
  }
  async function bw(t, {
    blockHash: e,
    blockNumber: r,
    blockTag: n,
    includeTransactions: i
  } = {}) {
    const s = n ?? "latest",
      o = i ?? !1,
      a = r !== void 0 ? lr(r) : void 0;
    let c = null;
    if (e ? c = await t.request({
        method: "eth_getBlockByHash",
        params: [e, o]
      }, {
        dedupe: !0
      }) : c = await t.request({
        method: "eth_getBlockByNumber",
        params: [a || s, o]
      }, {
        dedupe: !!a
      }), !c) throw new yR({
      blockHash: e,
      blockNumber: r
    });
    return (t.chain?.formatters?.block?.format || FQ)(c)
  }
  async function CR(t) {
    const e = await t.request({
      method: "eth_gasPrice"
    });
    return BigInt(e)
  }
  async function WQ(t, e) {
    const {
      block: r,
      chain: n = t.chain,
      request: i
    } = e || {};
    try {
      const s = n?.fees?.maxPriorityFeePerGas ?? n?.fees?.defaultPriorityFee;
      if (typeof s == "function") {
        const a = r || await wn(t, bw, "getBlock")({}),
          c = await s({
            block: a,
            client: t,
            request: i
          });
        if (c === null) throw new Error;
        return c
      }
      if (typeof s < "u") return s;
      const o = await t.request({
        method: "eth_maxPriorityFeePerGas"
      });
      return qp(o)
    } catch {
      const [s, o] = await Promise.all([r ? Promise.resolve(r) : wn(t, bw, "getBlock")({}), wn(t, CR, "getGasPrice")({})]);
      if (typeof s.baseFeePerGas != "bigint") throw new j7;
      const a = o - s.baseFeePerGas;
      return a < 0n ? 0n : a
    }
  }
  async function ER(t, e) {
    const {
      block: r,
      chain: n = t.chain,
      request: i,
      type: s = "eip1559"
    } = e || {}, o = await (async () => typeof n?.fees?.baseFeeMultiplier == "function" ? n.fees.baseFeeMultiplier({
      block: r,
      client: t,
      request: i
    }) : n?.fees?.baseFeeMultiplier ?? 1.2)();
    if (o < 1) throw new BQ;
    const c = 10 ** (o.toString().split(".")[1]?.length ?? 0),
      l = w => w * BigInt(Math.ceil(o * c)) / BigInt(c),
      h = r || await wn(t, bw, "getBlock")({});
    if (typeof n?.fees?.estimateFeesPerGas == "function") {
      const w = await n.fees.estimateFeesPerGas({
        block: r,
        client: t,
        multiply: l,
        request: i,
        type: s
      });
      if (w !== null) return w
    }
    if (s === "eip1559") {
      if (typeof h.baseFeePerGas != "bigint") throw new j7;
      const w = typeof i?.maxPriorityFeePerGas == "bigint" ? i.maxPriorityFeePerGas : await WQ(t, {
          block: h,
          chain: n,
          request: i
        }),
        b = l(h.baseFeePerGas);
      return {
        maxFeePerGas: i?.maxFeePerGas ?? b + w,
        maxPriorityFeePerGas: w
      }
    }
    return {
      gasPrice: i?.gasPrice ?? l(await wn(t, CR, "getGasPrice")({}))
    }
  }
  class zQ extends Ye {
    constructor(e, {
      account: r,
      docsPath: n,
      chain: i,
      data: s,
      gas: o,
      gasPrice: a,
      maxFeePerGas: c,
      maxPriorityFeePerGas: l,
      nonce: h,
      to: f,
      value: w
    }) {
      const b = sw({
        from: r?.address,
        to: f,
        value: typeof w < "u" && `${D7(w)} ${i?.nativeCurrency?.symbol||"ETH"}`,
        data: s,
        gas: o,
        gasPrice: typeof a < "u" && `${eo(a)} gwei`,
        maxFeePerGas: typeof c < "u" && `${eo(c)} gwei`,
        maxPriorityFeePerGas: typeof l < "u" && `${eo(l)} gwei`,
        nonce: h
      });
      super(e.shortMessage, {
        cause: e,
        docsPath: n,
        metaMessages: [...e.metaMessages ? [...e.metaMessages, " "] : [], "Estimate Gas Arguments:", b].filter(Boolean),
        name: "EstimateGasExecutionError"
      }), Object.defineProperty(this, "cause", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), this.cause = e
    }
  }

  function HQ(t, {
    docsPath: e,
    ...r
  }) {
    const n = (() => {
      const i = L7(t, r);
      return i instanceof q3 ? t : i
    })();
    return new zQ(n, {
      docsPath: e,
      ...r
    })
  }
  class qQ extends Ye {
    constructor({
      address: e
    }) {
      super(`State for account "${e}" is set multiple times.`, {
        name: "AccountStateConflictError"
      })
    }
  }
  class VQ extends Ye {
    constructor() {
      super("state and stateDiff are set on the same account.", {
        name: "StateAssignmentConflictError"
      })
    }
  }

  function AR(t) {
    return t.reduce((e, {
      slot: r,
      value: n
    }) => `${e}        ${r}: ${n}
  `, "")
  }

  function KQ(t) {
    return t.reduce((e, {
      address: r,
      ...n
    }) => {
      let i = `${e}    ${r}:
  `;
      return n.nonce && (i += `      nonce: ${n.nonce}
  `), n.balance && (i += `      balance: ${n.balance}
  `), n.code && (i += `      code: ${n.code}
  `), n.state && (i += `      state:
  `, i += AR(n.state)), n.stateDiff && (i += `      stateDiff:
  `, i += AR(n.stateDiff)), i
    }, `  State Override:
  `).slice(0, -1)
  }

  function SR(t) {
    if (!(!t || t.length === 0)) return t.reduce((e, {
      slot: r,
      value: n
    }) => {
      if (r.length !== 66) throw new jk({
        size: r.length,
        targetSize: 66,
        type: "hex"
      });
      if (n.length !== 66) throw new jk({
        size: n.length,
        targetSize: 66,
        type: "hex"
      });
      return e[r] = n, e
    }, {})
  }

  function GQ(t) {
    const {
      balance: e,
      nonce: r,
      state: n,
      stateDiff: i,
      code: s
    } = t, o = {};
    if (s !== void 0 && (o.code = s), e !== void 0 && (o.balance = lr(e)), r !== void 0 && (o.nonce = lr(r)), n !== void 0 && (o.state = SR(n)), i !== void 0) {
      if (o.state) throw new VQ;
      o.stateDiff = SR(i)
    }
    return o
  }

  function IR(t) {
    if (!t) return;
    const e = {};
    for (const {
        address: r,
        ...n
      }
      of t) {
      if (!Qa(r, {
          strict: !1
        })) throw new $d({
        address: r
      });
      if (e[r]) throw new qQ({
        address: r
      });
      e[r] = GQ(n)
    }
    return e
  }
  async function TR(t, {
    address: e,
    blockNumber: r,
    blockTag: n = "latest"
  }) {
    const i = r ? lr(r) : void 0,
      s = await t.request({
        method: "eth_getBalance",
        params: [e, i || n]
      });
    return BigInt(s)
  }
  async function F7(t, e) {
    const {
      account: r = t.account
    } = e, n = r ? Ja(r) : void 0;
    try {
      let U = function (g) {
        const {
          block: u,
          request: p,
          rpcStateOverride: v
        } = g;
        return t.request({
          method: "eth_estimateGas",
          params: v ? [p, u ?? "latest", v] : u ? [p, u] : [p]
        })
      };
      const {
        accessList: i,
        authorizationList: s,
        blobs: o,
        blobVersionedHashes: a,
        blockNumber: c,
        blockTag: l,
        data: h,
        gas: f,
        gasPrice: w,
        maxFeePerBlobGas: b,
        maxFeePerGas: C,
        maxPriorityFeePerGas: M,
        nonce: N,
        value: $,
        stateOverride: k,
        ...B
      } = await H7(t, {
        ...e,
        parameters: n?.type === "local" ? void 0 : ["blobVersionedHashes"]
      }), D = (c ? lr(c) : void 0) || l, V = IR(k), R = await (async () => {
        if (B.to) return B.to;
        if (s && s.length > 0) return await fR({
          authorization: s[0]
        }).catch(() => {
          throw new Ye("`to` is required. Could not infer from `authorizationList`")
        })
      })();
      V3(e);
      const P = t.chain?.formatters?.transactionRequest?.format,
        Y = (P || U7)({
          ...B7(B, {
            format: P
          }),
          from: n?.address,
          accessList: i,
          authorizationList: s,
          blobs: o,
          blobVersionedHashes: a,
          data: h,
          gas: f,
          gasPrice: w,
          maxFeePerBlobGas: b,
          maxFeePerGas: C,
          maxPriorityFeePerGas: M,
          nonce: N,
          to: R,
          value: $
        });
      let I = BigInt(await U({
        block: D,
        request: Y,
        rpcStateOverride: V
      }));
      if (s) {
        const g = await TR(t, {
            address: Y.from
          }),
          u = await Promise.all(s.map(async p => {
            const {
              contractAddress: v
            } = p, x = await U({
              block: D,
              request: {
                authorizationList: void 0,
                data: h,
                from: n?.address,
                to: v,
                value: lr(g)
              },
              rpcStateOverride: V
            }).catch(() => 100000n);
            return 2n * BigInt(x)
          }));
        I += u.reduce((p, v) => p + v, 0n)
      }
      return I
    } catch (i) {
      throw HQ(i, {
        ...e,
        account: n,
        chain: t.chain
      })
    }
  }
  async function ZQ(t, {
    address: e,
    blockTag: r = "latest",
    blockNumber: n
  }) {
    const i = await t.request({
      method: "eth_getTransactionCount",
      params: [e, n ? lr(n) : r]
    }, {
      dedupe: !!n
    });
    return bf(i)
  }

  function kR(t) {
    const {
      kzg: e
    } = t, r = t.to ?? (typeof t.blobs[0] == "string" ? "hex" : "bytes"), n = typeof t.blobs[0] == "string" ? t.blobs.map(s => Gc(s)) : t.blobs, i = [];
    for (const s of n) i.push(Uint8Array.from(e.blobToKzgCommitment(s)));
    return r === "bytes" ? i : i.map(s => Pi(s))
  }

  function RR(t) {
    const {
      kzg: e
    } = t, r = t.to ?? (typeof t.blobs[0] == "string" ? "hex" : "bytes"), n = typeof t.blobs[0] == "string" ? t.blobs.map(o => Gc(o)) : t.blobs, i = typeof t.commitments[0] == "string" ? t.commitments.map(o => Gc(o)) : t.commitments, s = [];
    for (let o = 0; o < n.length; o++) {
      const a = n[o],
        c = i[o];
      s.push(Uint8Array.from(e.computeBlobKzgProof(a, c)))
    }
    return r === "bytes" ? s : s.map(o => Pi(o))
  }

  function YQ(t, e, r, n) {
    if (typeof t.setBigUint64 == "function") return t.setBigUint64(e, r, n);
    const i = BigInt(32),
      s = BigInt(4294967295),
      o = Number(r >> i & s),
      a = Number(r & s),
      c = n ? 4 : 0,
      l = n ? 0 : 4;
    t.setUint32(e + c, o, n), t.setUint32(e + l, a, n)
  }
  const QQ = (t, e, r) => t & e ^ ~t & r,
    JQ = (t, e, r) => t & e ^ t & r ^ e & r;
  class XQ extends m7 {
    constructor(e, r, n, i) {
      super(), this.blockLen = e, this.outputLen = r, this.padOffset = n, this.isLE = i, this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.buffer = new Uint8Array(e), this.view = g7(this.buffer)
    }
    update(e) {
      Zp(this);
      const {
        view: r,
        buffer: n,
        blockLen: i
      } = this;
      e = tw(e);
      const s = e.length;
      for (let o = 0; o < s;) {
        const a = Math.min(i - this.pos, s - o);
        if (a === i) {
          const c = g7(e);
          for (; i <= s - o; o += i) this.process(c, o);
          continue
        }
        n.set(e.subarray(o, o + a), this.pos), this.pos += a, o += a, this.pos === i && (this.process(r, 0), this.pos = 0)
      }
      return this.length += e.length, this.roundClean(), this
    }
    digestInto(e) {
      Zp(this), Vk(e, this), this.finished = !0;
      const {
        buffer: r,
        view: n,
        blockLen: i,
        isLE: s
      } = this;
      let {
        pos: o
      } = this;
      r[o++] = 128, this.buffer.subarray(o).fill(0), this.padOffset > i - o && (this.process(n, 0), o = 0);
      for (let f = o; f < i; f++) r[f] = 0;
      YQ(n, i - 8, BigInt(this.length * 8), s), this.process(n, 0);
      const a = g7(e),
        c = this.outputLen;
      if (c % 4) throw new Error("_sha2: outputLen should be aligned to 32bit");
      const l = c / 4,
        h = this.get();
      if (l > h.length) throw new Error("_sha2: outputLen bigger than state");
      for (let f = 0; f < l; f++) a.setUint32(4 * f, h[f], s)
    }
    digest() {
      const {
        buffer: e,
        outputLen: r
      } = this;
      this.digestInto(e);
      const n = e.slice(0, r);
      return this.destroy(), n
    }
    _cloneInto(e) {
      e || (e = new this.constructor), e.set(...this.get());
      const {
        blockLen: r,
        buffer: n,
        length: i,
        finished: s,
        destroyed: o,
        pos: a
      } = this;
      return e.length = i, e.pos = a, e.finished = s, e.destroyed = o, i % r && e.buffer.set(n), e
    }
  }
  const eJ = 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]),
    Ld = new Uint32Array([1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225]),
    Bd = new Uint32Array(64);
  let tJ = class extends XQ {
    constructor() {
      super(64, 32, 8, !1), this.A = Ld[0] | 0, this.B = Ld[1] | 0, this.C = Ld[2] | 0, this.D = Ld[3] | 0, this.E = Ld[4] | 0, this.F = Ld[5] | 0, this.G = Ld[6] | 0, this.H = Ld[7] | 0
    }
    get() {
      const {
        A: e,
        B: r,
        C: n,
        D: i,
        E: s,
        F: o,
        G: a,
        H: c
      } = this;
      return [e, r, n, i, s, o, a, c]
    }
    set(e, r, n, i, s, o, a, c) {
      this.A = e | 0, this.B = r | 0, this.C = n | 0, this.D = i | 0, this.E = s | 0, this.F = o | 0, this.G = a | 0, this.H = c | 0
    }
    process(e, r) {
      for (let f = 0; f < 16; f++, r += 4) Bd[f] = e.getUint32(r, !1);
      for (let f = 16; f < 64; f++) {
        const w = Bd[f - 15],
          b = Bd[f - 2],
          C = Yc(w, 7) ^ Yc(w, 18) ^ w >>> 3,
          M = Yc(b, 17) ^ Yc(b, 19) ^ b >>> 10;
        Bd[f] = M + Bd[f - 7] + C + Bd[f - 16] | 0
      }
      let {
        A: n,
        B: i,
        C: s,
        D: o,
        E: a,
        F: c,
        G: l,
        H: h
      } = this;
      for (let f = 0; f < 64; f++) {
        const w = Yc(a, 6) ^ Yc(a, 11) ^ Yc(a, 25),
          b = h + w + QQ(a, c, l) + eJ[f] + Bd[f] | 0,
          M = (Yc(n, 2) ^ Yc(n, 13) ^ Yc(n, 22)) + JQ(n, i, s) | 0;
        h = l, l = c, c = a, a = o + b | 0, o = s, s = i, i = n, n = b + M | 0
      }
      n = n + this.A | 0, i = i + this.B | 0, s = s + this.C | 0, o = o + this.D | 0, a = a + this.E | 0, c = c + this.F | 0, l = l + this.G | 0, h = h + this.H | 0, this.set(n, i, s, o, a, c, l, h)
    }
    roundClean() {
      Bd.fill(0)
    }
    destroy() {
      this.set(0, 0, 0, 0, 0, 0, 0, 0), this.buffer.fill(0)
    }
  };
  const W7 = Yk(() => new tJ);

  function rJ(t, e) {
    return W7(Kc(t, {
      strict: !1
    }) ? $3(t) : t)
  }

  function nJ(t) {
    const {
      commitment: e,
      version: r = 1
    } = t, n = t.to ?? (typeof e == "string" ? "hex" : "bytes"), i = rJ(e);
    return i.set([r], 0), n === "bytes" ? i : Pi(i)
  }

  function iJ(t) {
    const {
      commitments: e,
      version: r
    } = t, n = t.to ?? (typeof e[0] == "string" ? "hex" : "bytes"), i = [];
    for (const s of e) i.push(nJ({
      commitment: s,
      to: n,
      version: r
    }));
    return i
  }
  const NR = 6,
    MR = 32,
    z7 = 4096,
    PR = MR * z7,
    $R = PR * NR - 1 - 1 * z7 * NR;
  class sJ extends Ye {
    constructor({
      maxSize: e,
      size: r
    }) {
      super("Blob size is too large.", {
        metaMessages: [`Max: ${e} bytes`, `Given: ${r} bytes`],
        name: "BlobSizeTooLargeError"
      })
    }
  }
  class oJ extends Ye {
    constructor() {
      super("Blob data must not be empty.", {
        name: "EmptyBlobError"
      })
    }
  }

  function aJ(t) {
    const e = t.to ?? (typeof t.data == "string" ? "hex" : "bytes"),
      r = typeof t.data == "string" ? Gc(t.data) : t.data,
      n = fi(r);
    if (!n) throw new oJ;
    if (n > $R) throw new sJ({
      maxSize: $R,
      size: n
    });
    const i = [];
    let s = !0,
      o = 0;
    for (; s;) {
      const a = S7(new Uint8Array(PR));
      let c = 0;
      for (; c < z7;) {
        const l = r.slice(o, o + (MR - 1));
        if (a.pushByte(0), a.pushBytes(l), l.length < 31) {
          a.pushByte(128), s = !1;
          break
        }
        c++, o += 31
      }
      i.push(a)
    }
    return e === "bytes" ? i.map(a => a.bytes) : i.map(a => Pi(a.bytes))
  }

  function cJ(t) {
    const {
      data: e,
      kzg: r,
      to: n
    } = t, i = t.blobs ?? aJ({
      data: e,
      to: n
    }), s = t.commitments ?? kR({
      blobs: i,
      kzg: r,
      to: n
    }), o = t.proofs ?? RR({
      blobs: i,
      commitments: s,
      kzg: r,
      to: n
    }), a = [];
    for (let c = 0; c < i.length; c++) a.push({
      blob: i[c],
      commitment: s[c],
      proof: o[c]
    });
    return a
  }

  function lJ(t) {
    if (t.type) return t.type;
    if (typeof t.authorizationList < "u") return "eip7702";
    if (typeof t.blobs < "u" || typeof t.blobVersionedHashes < "u" || typeof t.maxFeePerBlobGas < "u" || typeof t.sidecars < "u") return "eip4844";
    if (typeof t.maxFeePerGas < "u" || typeof t.maxPriorityFeePerGas < "u") return "eip1559";
    if (typeof t.gasPrice < "u") return typeof t.accessList < "u" ? "eip2930" : "legacy";
    throw new TQ({
      transaction: t
    })
  }
  const OR = ["blobVersionedHashes", "chainId", "fees", "gas", "nonce", "type"];
  async function H7(t, e) {
    const {
      account: r = t.account,
      blobs: n,
      chain: i,
      gas: s,
      kzg: o,
      nonce: a,
      nonceManager: c,
      parameters: l = OR,
      type: h
    } = e, f = r && Ja(r), w = {
      ...e,
      ...f ? {
        from: f?.address
      } : {}
    };
    let b;
    async function C() {
      return b || (b = await wn(t, bw, "getBlock")({
        blockTag: "latest"
      }), b)
    }
    let M;
    async function N() {
      return M || (i ? i.id : typeof e.chainId < "u" ? e.chainId : (M = await wn(t, bR, "getChainId")({}), M))
    }
    if ((l.includes("blobVersionedHashes") || l.includes("sidecars")) && n && o) {
      const $ = kR({
        blobs: n,
        kzg: o
      });
      if (l.includes("blobVersionedHashes")) {
        const k = iJ({
          commitments: $,
          to: "hex"
        });
        w.blobVersionedHashes = k
      }
      if (l.includes("sidecars")) {
        const k = RR({
            blobs: n,
            commitments: $,
            kzg: o
          }),
          B = cJ({
            blobs: n,
            commitments: $,
            proofs: k,
            to: "hex"
          });
        w.sidecars = B
      }
    }
    if (l.includes("chainId") && (w.chainId = await N()), l.includes("nonce") && typeof a > "u" && f)
      if (c) {
        const $ = await N();
        w.nonce = await c.consume({
          address: f.address,
          chainId: $,
          client: t
        })
      } else w.nonce = await wn(t, ZQ, "getTransactionCount")({
        address: f.address,
        blockTag: "pending"
      });
    if ((l.includes("fees") || l.includes("type")) && typeof h > "u") try {
      w.type = lJ(w)
    } catch {
      const $ = await C();
      w.type = typeof $?.baseFeePerGas == "bigint" ? "eip1559" : "legacy"
    }
    if (l.includes("fees"))
      if (w.type !== "legacy" && w.type !== "eip2930") {
        if (typeof w.maxFeePerGas > "u" || typeof w.maxPriorityFeePerGas > "u") {
          const $ = await C(),
            {
              maxFeePerGas: k,
              maxPriorityFeePerGas: B
            } = await ER(t, {
              block: $,
              chain: i,
              request: w
            });
          if (typeof e.maxPriorityFeePerGas > "u" && e.maxFeePerGas && e.maxFeePerGas < B) throw new UQ({
            maxPriorityFeePerGas: B
          });
          w.maxPriorityFeePerGas = B, w.maxFeePerGas = k
        }
      } else {
        if (typeof e.maxFeePerGas < "u" || typeof e.maxPriorityFeePerGas < "u") throw new j7;
        const $ = await C(),
          {
            gasPrice: k
          } = await ER(t, {
            block: $,
            chain: i,
            request: w,
            type: "legacy"
          });
        w.gasPrice = k
      } return l.includes("gas") && typeof s > "u" && (w.gas = await wn(t, F7, "estimateGas")({
      ...w,
      account: f && {
        address: f.address,
        type: "json-rpc"
      }
    })), V3(w), delete w.parameters, w
  }
  async function uJ(t, {
    serializedTransaction: e
  }) {
    return t.request({
      method: "eth_sendRawTransaction",
      params: [e]
    }, {
      retryCount: 0
    })
  }
  const q7 = new B3(128);
  async function DR(t, e) {
    const {
      account: r = t.account,
      chain: n = t.chain,
      accessList: i,
      authorizationList: s,
      blobs: o,
      data: a,
      gas: c,
      gasPrice: l,
      maxFeePerBlobGas: h,
      maxFeePerGas: f,
      maxPriorityFeePerGas: w,
      nonce: b,
      value: C,
      ...M
    } = e;
    if (typeof r > "u") throw new E7({
      docsPath: "/docs/actions/wallet/sendTransaction"
    });
    const N = r ? Ja(r) : null;
    try {
      V3(e);
      const $ = await (async () => {
        if (e.to) return e.to;
        if (s && s.length > 0) return await fR({
          authorization: s[0]
        }).catch(() => {
          throw new Ye("`to` is required. Could not infer from `authorizationList`.")
        })
      })();
      if (N?.type === "json-rpc" || N === null) {
        let k;
        n !== null && (k = await wn(t, bR, "getChainId")({}), CQ({
          currentChainId: k,
          chain: n
        }));
        const B = t.chain?.formatters?.transactionRequest?.format,
          D = (B || U7)({
            ...B7(M, {
              format: B
            }),
            accessList: i,
            authorizationList: s,
            blobs: o,
            chainId: k,
            data: a,
            from: N?.address,
            gas: c,
            gasPrice: l,
            maxFeePerBlobGas: h,
            maxFeePerGas: f,
            maxPriorityFeePerGas: w,
            nonce: b,
            to: $,
            value: C
          }),
          V = q7.get(t.uid),
          R = V ? "wallet_sendTransaction" : "eth_sendTransaction";
        try {
          return await t.request({
            method: R,
            params: [D]
          }, {
            retryCount: 0
          })
        } catch (P) {
          if (V === !1) throw P;
          const j = P;
          if (j.name === "InvalidInputRpcError" || j.name === "InvalidParamsRpcError" || j.name === "MethodNotFoundRpcError" || j.name === "MethodNotSupportedRpcError") return await t.request({
            method: "wallet_sendTransaction",
            params: [D]
          }, {
            retryCount: 0
          }).then(Y => (q7.set(t.uid, !0), Y)).catch(Y => {
            const U = Y;
            throw U.name === "MethodNotFoundRpcError" || U.name === "MethodNotSupportedRpcError" ? (q7.set(t.uid, !1), j) : U
          });
          throw j
        }
      }
      if (N?.type === "local") {
        const k = await wn(t, H7, "prepareTransactionRequest")({
            account: N,
            accessList: i,
            authorizationList: s,
            blobs: o,
            chain: n,
            data: a,
            gas: c,
            gasPrice: l,
            maxFeePerBlobGas: h,
            maxFeePerGas: f,
            maxPriorityFeePerGas: w,
            nonce: b,
            nonceManager: N.nonceManager,
            parameters: [...OR, "sidecars"],
            value: C,
            ...M,
            to: $
          }),
          B = n?.serializers?.transaction,
          F = await N.signTransaction(k, {
            serializer: B
          });
        return await wn(t, uJ, "sendRawTransaction")({
          serializedTransaction: F
        })
      }
      throw N?.type === "smart" ? new A7({
        metaMessages: ["Consider using the `sendUserOperation` Action instead."],
        docsPath: "/docs/actions/bundler/sendUserOperation",
        type: "smart"
      }) : new A7({
        docsPath: "/docs/actions/wallet/sendTransaction",
        type: N?.type
      })
    } catch ($) {
      throw $ instanceof A7 ? $ : $Q($, {
        ...e,
        account: N,
        chain: e.chain || void 0
      })
    }
  }
  const V7 = [{
      inputs: [{
        components: [{
          name: "target",
          type: "address"
        }, {
          name: "allowFailure",
          type: "bool"
        }, {
          name: "callData",
          type: "bytes"
        }],
        name: "calls",
        type: "tuple[]"
      }],
      name: "aggregate3",
      outputs: [{
        components: [{
          name: "success",
          type: "bool"
        }, {
          name: "returnData",
          type: "bytes"
        }],
        name: "returnData",
        type: "tuple[]"
      }],
      stateMutability: "view",
      type: "function"
    }],
    LR = [{
      inputs: [],
      name: "ResolverNotFound",
      type: "error"
    }, {
      inputs: [],
      name: "ResolverWildcardNotSupported",
      type: "error"
    }, {
      inputs: [],
      name: "ResolverNotContract",
      type: "error"
    }, {
      inputs: [{
        name: "returnData",
        type: "bytes"
      }],
      name: "ResolverError",
      type: "error"
    }, {
      inputs: [{
        components: [{
          name: "status",
          type: "uint16"
        }, {
          name: "message",
          type: "string"
        }],
        name: "errors",
        type: "tuple[]"
      }],
      name: "HttpError",
      type: "error"
    }],
    BR = [...LR, {
      name: "resolve",
      type: "function",
      stateMutability: "view",
      inputs: [{
        name: "name",
        type: "bytes"
      }, {
        name: "data",
        type: "bytes"
      }],
      outputs: [{
        name: "",
        type: "bytes"
      }, {
        name: "address",
        type: "address"
      }]
    }, {
      name: "resolve",
      type: "function",
      stateMutability: "view",
      inputs: [{
        name: "name",
        type: "bytes"
      }, {
        name: "data",
        type: "bytes"
      }, {
        name: "gateways",
        type: "string[]"
      }],
      outputs: [{
        name: "",
        type: "bytes"
      }, {
        name: "address",
        type: "address"
      }]
    }],
    dJ = [...LR, {
      name: "reverse",
      type: "function",
      stateMutability: "view",
      inputs: [{
        type: "bytes",
        name: "reverseName"
      }],
      outputs: [{
        type: "string",
        name: "resolvedName"
      }, {
        type: "address",
        name: "resolvedAddress"
      }, {
        type: "address",
        name: "reverseResolver"
      }, {
        type: "address",
        name: "resolver"
      }]
    }, {
      name: "reverse",
      type: "function",
      stateMutability: "view",
      inputs: [{
        type: "bytes",
        name: "reverseName"
      }, {
        type: "string[]",
        name: "gateways"
      }],
      outputs: [{
        type: "string",
        name: "resolvedName"
      }, {
        type: "address",
        name: "resolvedAddress"
      }, {
        type: "address",
        name: "reverseResolver"
      }, {
        type: "address",
        name: "resolver"
      }]
    }],
    UR = [{
      name: "text",
      type: "function",
      stateMutability: "view",
      inputs: [{
        name: "name",
        type: "bytes32"
      }, {
        name: "key",
        type: "string"
      }],
      outputs: [{
        name: "",
        type: "string"
      }]
    }],
    jR = [{
      name: "addr",
      type: "function",
      stateMutability: "view",
      inputs: [{
        name: "name",
        type: "bytes32"
      }],
      outputs: [{
        name: "",
        type: "address"
      }]
    }, {
      name: "addr",
      type: "function",
      stateMutability: "view",
      inputs: [{
        name: "name",
        type: "bytes32"
      }, {
        name: "coinType",
        type: "uint256"
      }],
      outputs: [{
        name: "",
        type: "bytes"
      }]
    }];

  function hJ(t, e = {}) {
    typeof e.size < "u" && Ya(t, {
      size: e.size
    });
    const r = Pi(t, e);
    return qp(r, e)
  }

  function fJ(t, e = {}) {
    let r = t;
    if (typeof e.size < "u" && (Ya(r, {
        size: e.size
      }), r = Hp(r)), r.length > 1 || r[0] > 1) throw new eY(r);
    return !!r[0]
  }

  function xu(t, e = {}) {
    typeof e.size < "u" && Ya(t, {
      size: e.size
    });
    const r = Pi(t, e);
    return bf(r, e)
  }

  function pJ(t, e = {}) {
    let r = t;
    return typeof e.size < "u" && (Ya(r, {
      size: e.size
    }), r = Hp(r, {
      dir: "right"
    })), new TextDecoder().decode(r)
  }

  function FR(t, e) {
    const r = typeof e == "string" ? Gc(e) : e,
      n = S7(r);
    if (fi(r) === 0 && t.length > 0) throw new O3;
    if (fi(e) && fi(e) < 32) throw new uY({
      data: typeof e == "string" ? e : Pi(e),
      params: t,
      size: fi(e)
    });
    let i = 0;
    const s = [];
    for (let o = 0; o < t.length; ++o) {
      const a = t[o];
      n.setPosition(i);
      const [c, l] = t1(n, a, {
        staticPosition: 0
      });
      i += l, s.push(c)
    }
    return s
  }

  function t1(t, e, {
    staticPosition: r
  }) {
    const n = x7(e.type);
    if (n) {
      const [i, s] = n;
      return mJ(t, {
        ...e,
        type: s
      }, {
        length: i,
        staticPosition: r
      })
    }
    if (e.type === "tuple") return yJ(t, e, {
      staticPosition: r
    });
    if (e.type === "address") return gJ(t);
    if (e.type === "bool") return wJ(t);
    if (e.type.startsWith("bytes")) return vJ(t, e, {
      staticPosition: r
    });
    if (e.type.startsWith("uint") || e.type.startsWith("int")) return bJ(t, e);
    if (e.type === "string") return _J(t, {
      staticPosition: r
    });
    throw new vY(e.type, {
      docsPath: "/docs/contract/decodeAbiParameters"
    })
  }
  const WR = 32,
    K7 = 32;

  function gJ(t) {
    const e = t.readBytes(32);
    return [F3(Pi(aR(e, -20))), 32]
  }

  function mJ(t, e, {
    length: r,
    staticPosition: n
  }) {
    if (!r) {
      const o = xu(t.readBytes(K7)),
        a = n + o,
        c = a + WR;
      t.setPosition(a);
      const l = xu(t.readBytes(WR)),
        h = yw(e);
      let f = 0;
      const w = [];
      for (let b = 0; b < l; ++b) {
        t.setPosition(c + (h ? b * 32 : f));
        const [C, M] = t1(t, e, {
          staticPosition: c
        });
        f += M, w.push(C)
      }
      return t.setPosition(n + 32), [w, 32]
    }
    if (yw(e)) {
      const o = xu(t.readBytes(K7)),
        a = n + o,
        c = [];
      for (let l = 0; l < r; ++l) {
        t.setPosition(a + l * 32);
        const [h] = t1(t, e, {
          staticPosition: a
        });
        c.push(h)
      }
      return t.setPosition(n + 32), [c, 32]
    }
    let i = 0;
    const s = [];
    for (let o = 0; o < r; ++o) {
      const [a, c] = t1(t, e, {
        staticPosition: n + i
      });
      i += c, s.push(a)
    }
    return [s, i]
  }

  function wJ(t) {
    return [fJ(t.readBytes(32), {
      size: 32
    }), 32]
  }

  function vJ(t, e, {
    staticPosition: r
  }) {
    const [n, i] = e.type.split("bytes");
    if (!i) {
      const o = xu(t.readBytes(32));
      t.setPosition(r + o);
      const a = xu(t.readBytes(32));
      if (a === 0) return t.setPosition(r + 32), ["0x", 32];
      const c = t.readBytes(a);
      return t.setPosition(r + 32), [Pi(c), 32]
    }
    return [Pi(t.readBytes(Number.parseInt(i), 32)), 32]
  }

  function bJ(t, e) {
    const r = e.type.startsWith("int"),
      n = Number.parseInt(e.type.split("int")[1] || "256"),
      i = t.readBytes(32);
    return [n > 48 ? hJ(i, {
      signed: r
    }) : xu(i, {
      signed: r
    }), 32]
  }

  function yJ(t, e, {
    staticPosition: r
  }) {
    const n = e.components.length === 0 || e.components.some(({
        name: o
      }) => !o),
      i = n ? [] : {};
    let s = 0;
    if (yw(e)) {
      const o = xu(t.readBytes(K7)),
        a = r + o;
      for (let c = 0; c < e.components.length; ++c) {
        const l = e.components[c];
        t.setPosition(a + s);
        const [h, f] = t1(t, l, {
          staticPosition: a
        });
        s += f, i[n ? c : l?.name] = h
      }
      return t.setPosition(r + 32), [i, 32]
    }
    for (let o = 0; o < e.components.length; ++o) {
      const a = e.components[o],
        [c, l] = t1(t, a, {
          staticPosition: r
        });
      i[n ? o : a?.name] = c, s += l
    }
    return [i, s]
  }

  function _J(t, {
    staticPosition: e
  }) {
    const r = xu(t.readBytes(32)),
      n = e + r;
    t.setPosition(n);
    const i = xu(t.readBytes(32));
    if (i === 0) return t.setPosition(e + 32), ["", 32];
    const s = t.readBytes(i, 32),
      o = pJ(Hp(s));
    return t.setPosition(e + 32), [o, 32]
  }

  function yw(t) {
    const {
      type: e
    } = t;
    if (e === "string" || e === "bytes" || e.endsWith("[]")) return !0;
    if (e === "tuple") return t.components?.some(yw);
    const r = x7(t.type);
    return !!(r && yw({
      ...t,
      type: r[1]
    }))
  }
  const xJ = t => ps($3(t));

  function CJ(t) {
    return xJ(t)
  }
  const EJ = "1.0.6";
  let ia = class Pk extends Error {
    constructor(e, r = {}) {
      const n = r.cause instanceof Pk ? r.cause.details : r.cause?.message ? r.cause.message : r.details,
        i = r.cause instanceof Pk && r.cause.docsPath || r.docsPath,
        s = [e || "An error occurred.", "", ...r.metaMessages ? [...r.metaMessages, ""] : [], ...i ? [`Docs: https://abitype.dev${i}`] : [], ...n ? [`Details: ${n}`] : [], `Version: abitype@${EJ}`].join(`
  `);
      super(s), Object.defineProperty(this, "details", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "docsPath", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "metaMessages", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "shortMessage", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "AbiTypeError"
      }), r.cause && (this.cause = r.cause), this.details = n, this.docsPath = i, this.metaMessages = r.metaMessages, this.shortMessage = e
    }
  };

  function Ud(t, e) {
    return t.exec(e)?.groups
  }
  const zR = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,
    HR = /^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,
    qR = /^\(.+?\).*?$/,
    VR = /^tuple(?<array>(\[(\d*)\])*)$/;

  function G7(t) {
    let e = t.type;
    if (VR.test(t.type) && "components" in t) {
      e = "(";
      const r = t.components.length;
      for (let i = 0; i < r; i++) {
        const s = t.components[i];
        e += G7(s), i < r - 1 && (e += ", ")
      }
      const n = Ud(VR, t.type);
      return e += `)${n?.array??""}`, G7({
        ...t,
        type: e
      })
    }
    return "indexed" in t && t.indexed && (e = `${e} indexed`), t.name ? `${e} ${t.name}` : e
  }

  function _w(t) {
    let e = "";
    const r = t.length;
    for (let n = 0; n < r; n++) {
      const i = t[n];
      e += G7(i), n !== r - 1 && (e += ", ")
    }
    return e
  }

  function AJ(t) {
    return t.type === "function" ? `function ${t.name}(${_w(t.inputs)})${t.stateMutability&&t.stateMutability!=="nonpayable"?` ${t.stateMutability}`:""}${t.outputs.length?` returns (${_w(t.outputs)})`:""}` : t.type === "event" ? `event ${t.name}(${_w(t.inputs)})` : t.type === "error" ? `error ${t.name}(${_w(t.inputs)})` : t.type === "constructor" ? `constructor(${_w(t.inputs)})${t.stateMutability==="payable"?" payable":""}` : t.type === "fallback" ? "fallback()" : "receive() external payable"
  }
  const KR = /^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;

  function SJ(t) {
    return KR.test(t)
  }

  function IJ(t) {
    return Ud(KR, t)
  }
  const GR = /^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;

  function TJ(t) {
    return GR.test(t)
  }

  function kJ(t) {
    return Ud(GR, t)
  }
  const ZR = /^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;

  function RJ(t) {
    return ZR.test(t)
  }

  function NJ(t) {
    return Ud(ZR, t)
  }
  const YR = /^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;

  function QR(t) {
    return YR.test(t)
  }

  function MJ(t) {
    return Ud(YR, t)
  }
  const JR = /^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;

  function PJ(t) {
    return JR.test(t)
  }

  function $J(t) {
    return Ud(JR, t)
  }
  const OJ = /^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;

  function DJ(t) {
    return OJ.test(t)
  }
  const LJ = /^receive\(\) external payable$/;

  function BJ(t) {
    return LJ.test(t)
  }
  const UJ = new Set(["indexed"]),
    Z7 = new Set(["calldata", "memory", "storage"]);
  class jJ extends ia {
    constructor({
      type: e
    }) {
      super("Unknown type.", {
        metaMessages: [`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]
      }), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "UnknownTypeError"
      })
    }
  }
  class FJ extends ia {
    constructor({
      type: e
    }) {
      super("Unknown type.", {
        metaMessages: [`Type "${e}" is not a valid ABI type.`]
      }), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "UnknownSolidityTypeError"
      })
    }
  }
  class WJ extends ia {
    constructor({
      param: e
    }) {
      super("Invalid ABI parameter.", {
        details: e
      }), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "InvalidParameterError"
      })
    }
  }
  class zJ extends ia {
    constructor({
      param: e,
      name: r
    }) {
      super("Invalid ABI parameter.", {
        details: e,
        metaMessages: [`"${r}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]
      }), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "SolidityProtectedKeywordError"
      })
    }
  }
  class HJ extends ia {
    constructor({
      param: e,
      type: r,
      modifier: n
    }) {
      super("Invalid ABI parameter.", {
        details: e,
        metaMessages: [`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`]
      }), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "InvalidModifierError"
      })
    }
  }
  class qJ extends ia {
    constructor({
      param: e,
      type: r,
      modifier: n
    }) {
      super("Invalid ABI parameter.", {
        details: e,
        metaMessages: [`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`, `Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]
      }), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "InvalidFunctionModifierError"
      })
    }
  }
  class VJ extends ia {
    constructor({
      abiParameter: e
    }) {
      super("Invalid ABI parameter.", {
        details: JSON.stringify(e, null, 2),
        metaMessages: ["ABI parameter type is invalid."]
      }), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "InvalidAbiTypeParameterError"
      })
    }
  }
  class xw extends ia {
    constructor({
      signature: e,
      type: r
    }) {
      super(`Invalid ${r} signature.`, {
        details: e
      }), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "InvalidSignatureError"
      })
    }
  }
  class KJ extends ia {
    constructor({
      signature: e
    }) {
      super("Unknown signature.", {
        details: e
      }), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "UnknownSignatureError"
      })
    }
  }
  class GJ extends ia {
    constructor({
      signature: e
    }) {
      super("Invalid struct signature.", {
        details: e,
        metaMessages: ["No properties exist."]
      }), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "InvalidStructSignatureError"
      })
    }
  }
  class ZJ extends ia {
    constructor({
      type: e
    }) {
      super("Circular reference detected.", {
        metaMessages: [`Struct "${e}" is a circular reference.`]
      }), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "CircularReferenceError"
      })
    }
  }
  class YJ extends ia {
    constructor({
      current: e,
      depth: r
    }) {
      super("Unbalanced parentheses.", {
        metaMessages: [`"${e.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],
        details: `Depth "${r}"`
      }), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "InvalidParenthesisError"
      })
    }
  }

  function QJ(t, e) {
    return e ? `${e}:${t}` : t
  }
  const Y7 = new Map([
    ["address", {
      type: "address"
    }],
    ["bool", {
      type: "bool"
    }],
    ["bytes", {
      type: "bytes"
    }],
    ["bytes32", {
      type: "bytes32"
    }],
    ["int", {
      type: "int256"
    }],
    ["int256", {
      type: "int256"
    }],
    ["string", {
      type: "string"
    }],
    ["uint", {
      type: "uint256"
    }],
    ["uint8", {
      type: "uint8"
    }],
    ["uint16", {
      type: "uint16"
    }],
    ["uint24", {
      type: "uint24"
    }],
    ["uint32", {
      type: "uint32"
    }],
    ["uint64", {
      type: "uint64"
    }],
    ["uint96", {
      type: "uint96"
    }],
    ["uint112", {
      type: "uint112"
    }],
    ["uint160", {
      type: "uint160"
    }],
    ["uint192", {
      type: "uint192"
    }],
    ["uint256", {
      type: "uint256"
    }],
    ["address owner", {
      type: "address",
      name: "owner"
    }],
    ["address to", {
      type: "address",
      name: "to"
    }],
    ["bool approved", {
      type: "bool",
      name: "approved"
    }],
    ["bytes _data", {
      type: "bytes",
      name: "_data"
    }],
    ["bytes data", {
      type: "bytes",
      name: "data"
    }],
    ["bytes signature", {
      type: "bytes",
      name: "signature"
    }],
    ["bytes32 hash", {
      type: "bytes32",
      name: "hash"
    }],
    ["bytes32 r", {
      type: "bytes32",
      name: "r"
    }],
    ["bytes32 root", {
      type: "bytes32",
      name: "root"
    }],
    ["bytes32 s", {
      type: "bytes32",
      name: "s"
    }],
    ["string name", {
      type: "string",
      name: "name"
    }],
    ["string symbol", {
      type: "string",
      name: "symbol"
    }],
    ["string tokenURI", {
      type: "string",
      name: "tokenURI"
    }],
    ["uint tokenId", {
      type: "uint256",
      name: "tokenId"
    }],
    ["uint8 v", {
      type: "uint8",
      name: "v"
    }],
    ["uint256 balance", {
      type: "uint256",
      name: "balance"
    }],
    ["uint256 tokenId", {
      type: "uint256",
      name: "tokenId"
    }],
    ["uint256 value", {
      type: "uint256",
      name: "value"
    }],
    ["event:address indexed from", {
      type: "address",
      name: "from",
      indexed: !0
    }],
    ["event:address indexed to", {
      type: "address",
      name: "to",
      indexed: !0
    }],
    ["event:uint indexed tokenId", {
      type: "uint256",
      name: "tokenId",
      indexed: !0
    }],
    ["event:uint256 indexed tokenId", {
      type: "uint256",
      name: "tokenId",
      indexed: !0
    }]
  ]);

  function JJ(t, e = {}) {
    if (RJ(t)) {
      const r = NJ(t);
      if (!r) throw new xw({
        signature: t,
        type: "function"
      });
      const n = Xa(r.parameters),
        i = [],
        s = n.length;
      for (let a = 0; a < s; a++) i.push(xf(n[a], {
        modifiers: Z7,
        structs: e,
        type: "function"
      }));
      const o = [];
      if (r.returns) {
        const a = Xa(r.returns),
          c = a.length;
        for (let l = 0; l < c; l++) o.push(xf(a[l], {
          modifiers: Z7,
          structs: e,
          type: "function"
        }))
      }
      return {
        name: r.name,
        type: "function",
        stateMutability: r.stateMutability ?? "nonpayable",
        inputs: i,
        outputs: o
      }
    }
    if (TJ(t)) {
      const r = kJ(t);
      if (!r) throw new xw({
        signature: t,
        type: "event"
      });
      const n = Xa(r.parameters),
        i = [],
        s = n.length;
      for (let o = 0; o < s; o++) i.push(xf(n[o], {
        modifiers: UJ,
        structs: e,
        type: "event"
      }));
      return {
        name: r.name,
        type: "event",
        inputs: i
      }
    }
    if (SJ(t)) {
      const r = IJ(t);
      if (!r) throw new xw({
        signature: t,
        type: "error"
      });
      const n = Xa(r.parameters),
        i = [],
        s = n.length;
      for (let o = 0; o < s; o++) i.push(xf(n[o], {
        structs: e,
        type: "error"
      }));
      return {
        name: r.name,
        type: "error",
        inputs: i
      }
    }
    if (PJ(t)) {
      const r = $J(t);
      if (!r) throw new xw({
        signature: t,
        type: "constructor"
      });
      const n = Xa(r.parameters),
        i = [],
        s = n.length;
      for (let o = 0; o < s; o++) i.push(xf(n[o], {
        structs: e,
        type: "constructor"
      }));
      return {
        type: "constructor",
        stateMutability: r.stateMutability ?? "nonpayable",
        inputs: i
      }
    }
    if (DJ(t)) return {
      type: "fallback"
    };
    if (BJ(t)) return {
      type: "receive",
      stateMutability: "payable"
    };
    throw new KJ({
      signature: t
    })
  }
  const XJ = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,
    eX = /^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,
    tX = /^u?int$/;

  function xf(t, e) {
    const r = QJ(t, e?.type);
    if (Y7.has(r)) return Y7.get(r);
    const n = qR.test(t),
      i = Ud(n ? eX : XJ, t);
    if (!i) throw new WJ({
      param: t
    });
    if (i.name && nX(i.name)) throw new zJ({
      param: t,
      name: i.name
    });
    const s = i.name ? {
        name: i.name
      } : {},
      o = i.modifier === "indexed" ? {
        indexed: !0
      } : {},
      a = e?.structs ?? {};
    let c, l = {};
    if (n) {
      c = "tuple";
      const f = Xa(i.type),
        w = [],
        b = f.length;
      for (let C = 0; C < b; C++) w.push(xf(f[C], {
        structs: a
      }));
      l = {
        components: w
      }
    } else if (i.type in a) c = "tuple", l = {
      components: a[i.type]
    };
    else if (tX.test(i.type)) c = `${i.type}256`;
    else if (c = i.type, e?.type !== "struct" && !XR(c)) throw new FJ({
      type: c
    });
    if (i.modifier) {
      if (!e?.modifiers?.has?.(i.modifier)) throw new HJ({
        param: t,
        type: e?.type,
        modifier: i.modifier
      });
      if (Z7.has(i.modifier) && !iX(c, !!i.array)) throw new qJ({
        param: t,
        type: e?.type,
        modifier: i.modifier
      })
    }
    const h = {
      type: `${c}${i.array??""}`,
      ...s,
      ...o,
      ...l
    };
    return Y7.set(r, h), h
  }

  function Xa(t, e = [], r = "", n = 0) {
    const i = t.trim().length;
    for (let s = 0; s < i; s++) {
      const o = t[s],
        a = t.slice(s + 1);
      switch (o) {
        case ",":
          return n === 0 ? Xa(a, [...e, r.trim()]) : Xa(a, e, `${r}${o}`, n);
        case "(":
          return Xa(a, e, `${r}${o}`, n + 1);
        case ")":
          return Xa(a, e, `${r}${o}`, n - 1);
        default:
          return Xa(a, e, `${r}${o}`, n)
      }
    }
    if (r === "") return e;
    if (n !== 0) throw new YJ({
      current: r,
      depth: n
    });
    return e.push(r.trim()), e
  }

  function XR(t) {
    return t === "address" || t === "bool" || t === "function" || t === "string" || zR.test(t) || HR.test(t)
  }
  const rX = /^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;

  function nX(t) {
    return t === "address" || t === "bool" || t === "function" || t === "string" || t === "tuple" || zR.test(t) || HR.test(t) || rX.test(t)
  }

  function iX(t, e) {
    return e || t === "bytes" || t === "string" || t === "tuple"
  }

  function sX(t) {
    const e = {},
      r = t.length;
    for (let o = 0; o < r; o++) {
      const a = t[o];
      if (!QR(a)) continue;
      const c = MJ(a);
      if (!c) throw new xw({
        signature: a,
        type: "struct"
      });
      const l = c.properties.split(";"),
        h = [],
        f = l.length;
      for (let w = 0; w < f; w++) {
        const C = l[w].trim();
        if (!C) continue;
        const M = xf(C, {
          type: "struct"
        });
        h.push(M)
      }
      if (!h.length) throw new GJ({
        signature: a
      });
      e[c.name] = h
    }
    const n = {},
      i = Object.entries(e),
      s = i.length;
    for (let o = 0; o < s; o++) {
      const [a, c] = i[o];
      n[a] = eN(c, e)
    }
    return n
  }
  const oX = /^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;

  function eN(t, e, r = new Set) {
    const n = [],
      i = t.length;
    for (let s = 0; s < i; s++) {
      const o = t[s];
      if (qR.test(o.type)) n.push(o);
      else {
        const c = Ud(oX, o.type);
        if (!c?.type) throw new VJ({
          abiParameter: o
        });
        const {
          array: l,
          type: h
        } = c;
        if (h in e) {
          if (r.has(h)) throw new ZJ({
            type: h
          });
          n.push({
            ...o,
            type: `tuple${l??""}`,
            components: eN(e[h] ?? [], e, new Set([...r, h]))
          })
        } else if (XR(h)) n.push(o);
        else throw new jJ({
          type: h
        })
      }
    }
    return n
  }

  function tN(t) {
    const e = sX(t),
      r = [],
      n = t.length;
    for (let i = 0; i < n; i++) {
      const s = t[i];
      QR(s) || r.push(JJ(s, e))
    }
    return r
  }

  function aX(t) {
    let e = !0,
      r = "",
      n = 0,
      i = "",
      s = !1;
    for (let o = 0; o < t.length; o++) {
      const a = t[o];
      if (["(", ")", ","].includes(a) && (e = !0), a === "(" && n++, a === ")" && n--, !!e) {
        if (n === 0) {
          if (a === " " && ["event", "function", ""].includes(i)) i = "";
          else if (i += a, a === ")") {
            s = !0;
            break
          }
          continue
        }
        if (a === " ") {
          t[o - 1] !== "," && r !== "," && r !== ",(" && (r = "", e = !1);
          continue
        }
        i += a, r += a
      }
    }
    if (!s) throw new Ye("Unable to normalize signature.");
    return i
  }
  const cX = t => {
    const e = typeof t == "string" ? t : AJ(t);
    return aX(e)
  };

  function rN(t) {
    return CJ(cX(t))
  }
  const lX = rN,
    Q7 = t => W3(rN(t), 0, 4);

  function J7(t) {
    const {
      abi: e,
      args: r = [],
      name: n
    } = t, i = Kc(n, {
      strict: !1
    }), s = e.filter(a => i ? a.type === "function" ? Q7(a) === n : a.type === "event" ? lX(a) === n : !1 : "name" in a && a.name === n);
    if (s.length === 0) return;
    if (s.length === 1) return s[0];
    let o;
    for (const a of s) {
      if (!("inputs" in a)) continue;
      if (!r || r.length === 0) {
        if (!a.inputs || a.inputs.length === 0) return a;
        continue
      }
      if (!a.inputs || a.inputs.length === 0 || a.inputs.length !== r.length) continue;
      if (r.every((l, h) => {
          const f = "inputs" in a && a.inputs[h];
          return f ? X7(l, f) : !1
        })) {
        if (o && "inputs" in o && o.inputs) {
          const l = nN(a.inputs, o.inputs, r);
          if (l) throw new gY({
            abiItem: a,
            type: l[0]
          }, {
            abiItem: o,
            type: l[1]
          })
        }
        o = a
      }
    }
    return o || s[0]
  }

  function X7(t, e) {
    const r = typeof t,
      n = e.type;
    switch (n) {
      case "address":
        return Qa(t, {
          strict: !1
        });
      case "bool":
        return r === "boolean";
      case "function":
        return r === "string";
      case "string":
        return r === "string";
      default:
        return n === "tuple" && "components" in e ? Object.values(e.components).every((i, s) => X7(Object.values(t)[s], i)) : /^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(n) ? r === "number" || r === "bigint" : /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n) ? r === "string" || t instanceof Uint8Array : /[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n) ? Array.isArray(t) && t.every(i => X7(i, {
          ...e,
          type: n.replace(/(\[[0-9]{0,}\])$/, "")
        })) : !1
    }
  }

  function nN(t, e, r) {
    for (const n in t) {
      const i = t[n],
        s = e[n];
      if (i.type === "tuple" && s.type === "tuple" && "components" in i && "components" in s) return nN(i.components, s.components, r[n]);
      const o = [i.type, s.type];
      if (o.includes("address") && o.includes("bytes20") ? !0 : o.includes("address") && o.includes("string") ? Qa(r[n], {
          strict: !1
        }) : o.includes("address") && o.includes("bytes") ? Qa(r[n], {
          strict: !1
        }) : !1) return o
    }
  }
  const e9 = "/docs/contract/decodeFunctionResult";

  function r1(t) {
    const {
      abi: e,
      args: r,
      functionName: n,
      data: i
    } = t;
    let s = e[0];
    if (n) {
      const a = J7({
        abi: e,
        args: r,
        name: n
      });
      if (!a) throw new D3(n, {
        docsPath: e9
      });
      s = a
    }
    if (s.type !== "function") throw new D3(void 0, {
      docsPath: e9
    });
    if (!s.outputs) throw new pY(s.name, {
      docsPath: e9
    });
    const o = FR(s.outputs, i);
    if (o && o.length > 1) return o;
    if (o && o.length === 1) return o[0]
  }
  const iN = "/docs/contract/encodeFunctionData";

  function uX(t) {
    const {
      abi: e,
      args: r,
      functionName: n
    } = t;
    let i = e[0];
    if (n) {
      const s = J7({
        abi: e,
        args: r,
        name: n
      });
      if (!s) throw new D3(n, {
        docsPath: iN
      });
      i = s
    }
    if (i.type !== "function") throw new D3(void 0, {
      docsPath: iN
    });
    return {
      abi: [i],
      functionName: Q7(Kp(i))
    }
  }

  function Cu(t) {
    const {
      args: e
    } = t, {
      abi: r,
      functionName: n
    } = t.abi.length === 1 && t.functionName?.startsWith("0x") ? t : uX(t), i = r[0], s = n, o = "inputs" in i && i.inputs ? nw(i.inputs, e ?? []) : void 0;
    return L3([s, o ?? "0x"])
  }

  function Cw({
    blockNumber: t,
    chain: e,
    contract: r
  }) {
    const n = e?.contracts?.[r];
    if (!n) throw new I7({
      chain: e,
      contract: {
        name: r
      }
    });
    if (t && n.blockCreated && n.blockCreated > t) throw new I7({
      blockNumber: t,
      chain: e,
      contract: {
        name: r,
        blockCreated: n.blockCreated
      }
    });
    return n.address
  }
  const sN = {
      1: "An `assert` condition failed.",
      17: "Arithmetic operation resulted in underflow or overflow.",
      18: "Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",
      33: "Attempted to convert to an invalid type.",
      34: "Attempted to access a storage byte array that is incorrectly encoded.",
      49: "Performed `.pop()` on an empty array",
      50: "Array index is out of bounds.",
      65: "Allocated too much memory or created an array which is too large.",
      81: "Attempted to call a zero-initialized variable of internal function type."
    },
    dX = {
      inputs: [{
        name: "message",
        type: "string"
      }],
      name: "Error",
      type: "error"
    },
    hX = {
      inputs: [{
        name: "reason",
        type: "uint256"
      }],
      name: "Panic",
      type: "error"
    };

  function oN(t) {
    const {
      abi: e,
      data: r
    } = t, n = W3(r, 0, 4);
    if (n === "0x") throw new O3;
    const s = [...e || [], dX, hX].find(o => o.type === "error" && n === Q7(Kp(o)));
    if (!s) throw new qk(n, {
      docsPath: "/docs/contract/decodeErrorResult"
    });
    return {
      abiItem: s,
      args: "inputs" in s && s.inputs && s.inputs.length > 0 ? FR(s.inputs, W3(r, 4)) : void 0,
      errorName: s.name
    }
  }

  function aN({
    abiItem: t,
    args: e,
    includeFunctionName: r = !0,
    includeName: n = !1
  }) {
    if ("name" in t && "inputs" in t && t.inputs) return `${r?t.name:""}(${t.inputs.map((i,s)=>`${n&&i.name?`${i.name}: `:""}${typeof e[s]=="object"?Ro(e[s]):e[s]}`).join(", ")})`
  }
  class fX extends Ye {
    constructor(e, {
      account: r,
      docsPath: n,
      chain: i,
      data: s,
      gas: o,
      gasPrice: a,
      maxFeePerGas: c,
      maxPriorityFeePerGas: l,
      nonce: h,
      to: f,
      value: w,
      stateOverride: b
    }) {
      const C = r ? Ja(r) : void 0;
      let M = sw({
        from: C?.address,
        to: f,
        value: typeof w < "u" && `${D7(w)} ${i?.nativeCurrency?.symbol||"ETH"}`,
        data: s,
        gas: o,
        gasPrice: typeof a < "u" && `${eo(a)} gwei`,
        maxFeePerGas: typeof c < "u" && `${eo(c)} gwei`,
        maxPriorityFeePerGas: typeof l < "u" && `${eo(l)} gwei`,
        nonce: h
      });
      b && (M += `
  ${KQ(b)}`), super(e.shortMessage, {
        cause: e,
        docsPath: n,
        metaMessages: [...e.metaMessages ? [...e.metaMessages, " "] : [], "Raw Call Arguments:", M].filter(Boolean),
        name: "CallExecutionError"
      }), Object.defineProperty(this, "cause", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), this.cause = e
    }
  }
  class cN extends Ye {
    constructor(e, {
      abi: r,
      args: n,
      contractAddress: i,
      docsPath: s,
      functionName: o,
      sender: a
    }) {
      const c = J7({
          abi: r,
          args: n,
          name: o
        }),
        l = c ? aN({
          abiItem: c,
          args: n,
          includeFunctionName: !1,
          includeName: !1
        }) : void 0,
        h = c ? Kp(c, {
          includeName: !0
        }) : void 0,
        f = sw({
          address: i && NQ(i),
          function: h,
          args: l && l !== "()" && `${[...Array(o?.length??0).keys()].map(()=>" ").join("")}${l}`,
          sender: a
        });
      super(e.shortMessage || `An unknown error occurred while executing the contract function "${o}".`, {
        cause: e,
        docsPath: s,
        metaMessages: [...e.metaMessages ? [...e.metaMessages, " "] : [], f && "Contract Call:", f].filter(Boolean),
        name: "ContractFunctionExecutionError"
      }), Object.defineProperty(this, "abi", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "args", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "cause", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "contractAddress", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "formattedArgs", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "functionName", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "sender", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), this.abi = r, this.args = n, this.cause = e, this.contractAddress = i, this.functionName = o, this.sender = a
    }
  }
  class t9 extends Ye {
    constructor({
      abi: e,
      data: r,
      functionName: n,
      message: i
    }) {
      let s, o, a, c;
      if (r && r !== "0x") try {
        o = oN({
          abi: e,
          data: r
        });
        const {
          abiItem: h,
          errorName: f,
          args: w
        } = o;
        if (f === "Error") c = w[0];
        else if (f === "Panic") {
          const [b] = w;
          c = sN[b]
        } else {
          const b = h ? Kp(h, {
              includeName: !0
            }) : void 0,
            C = h && w ? aN({
              abiItem: h,
              args: w,
              includeFunctionName: !1,
              includeName: !1
            }) : void 0;
          a = [b ? `Error: ${b}` : "", C && C !== "()" ? `       ${[...Array(f?.length??0).keys()].map(()=>" ").join("")}${C}` : ""]
        }
      } catch (h) {
        s = h
      } else i && (c = i);
      let l;
      s instanceof qk && (l = s.signature, a = [`Unable to decode signature "${l}" as it was not found on the provided ABI.`, "Make sure you are using the correct ABI and that the error exists on it.", `You can look up the decoded signature here: https://openchain.xyz/signatures?query=${l}.`]), super(c && c !== "execution reverted" || l ? [`The contract function "${n}" reverted with the following ${l?"signature":"reason"}:`, c || l].join(`
  `) : `The contract function "${n}" reverted.`, {
        cause: s,
        metaMessages: a,
        name: "ContractFunctionRevertedError"
      }), Object.defineProperty(this, "data", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "reason", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "signature", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), this.data = o, this.reason = c, this.signature = l
    }
  }
  class pX extends Ye {
    constructor({
      functionName: e
    }) {
      super(`The contract function "${e}" returned no data ("0x").`, {
        metaMessages: ["This could be due to any of the following:", `  - The contract does not have the function "${e}",`, "  - The parameters passed to the contract function may be invalid, or", "  - The address is not a contract."],
        name: "ContractFunctionZeroDataError"
      })
    }
  }
  class gX extends Ye {
    constructor({
      factory: e
    }) {
      super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`, {
        metaMessages: ["Please ensure:", "- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).", "- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],
        name: "CounterfactualDeploymentFailedError"
      })
    }
  }
  class r9 extends Ye {
    constructor({
      data: e,
      message: r
    }) {
      super(r || "", {
        name: "RawContractError"
      }), Object.defineProperty(this, "code", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: 3
      }), Object.defineProperty(this, "data", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), this.data = e
    }
  }

  function n9(t, e) {
    if (!(t instanceof Ye)) return !1;
    const r = t.walk(n => n instanceof t9);
    return r instanceof t9 ? !!(r.data?.errorName === "ResolverNotFound" || r.data?.errorName === "ResolverWildcardNotSupported" || r.data?.errorName === "ResolverNotContract" || r.data?.errorName === "ResolverError" || r.data?.errorName === "HttpError" || r.reason?.includes("Wildcard on non-extended resolvers is not supported") || e === "reverse" && r.reason === sN[50]) : !1
  }

  function lN(t) {
    if (t.length !== 66 || t.indexOf("[") !== 0 || t.indexOf("]") !== 65) return null;
    const e = `0x${t.slice(1,65)}`;
    return Kc(e) ? e : null
  }

  function K3(t) {
    let e = new Uint8Array(32).fill(0);
    if (!t) return Pi(e);
    const r = t.split(".");
    for (let n = r.length - 1; n >= 0; n -= 1) {
      const i = lN(r[n]),
        s = i ? $3(i) : ps(vf(r[n]), "bytes");
      e = ps(Zc([e, s]), "bytes")
    }
    return Pi(e)
  }

  function mX(t) {
    return `[${t.slice(2)}]`
  }

  function wX(t) {
    const e = new Uint8Array(32).fill(0);
    return t ? lN(t) || ps(vf(t)) : Pi(e)
  }

  function i9(t) {
    const e = t.replace(/^\.|\.$/gm, "");
    if (e.length === 0) return new Uint8Array(1);
    const r = new Uint8Array(vf(e).byteLength + 2);
    let n = 0;
    const i = e.split(".");
    for (let s = 0; s < i.length; s++) {
      let o = vf(i[s]);
      o.byteLength > 255 && (o = vf(mX(wX(i[s])))), r[n] = o.length, r.set(o, n + 1), n += o.length + 1
    }
    return r.byteLength !== n + 1 ? r.slice(0, n + 1) : r
  }
  const vX = 3;

  function Ew(t, {
    abi: e,
    address: r,
    args: n,
    docsPath: i,
    functionName: s,
    sender: o
  }) {
    const {
      code: a,
      data: c,
      message: l,
      shortMessage: h
    } = t instanceof r9 ? t : t instanceof Ye ? t.walk(w => "data" in w) || t.walk() : {}, f = t instanceof O3 ? new pX({
      functionName: s
    }) : [vX, _f.code].includes(a) && (c || l || h) ? new t9({
      abi: e,
      data: typeof c == "object" ? c.data : c,
      functionName: s,
      message: h ?? l
    }) : t;
    return new cN(f, {
      abi: e,
      args: n,
      contractAddress: r,
      docsPath: i,
      functionName: s,
      sender: o
    })
  }
  const bX = "0x82ad56cb",
    yX = "0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",
    _X = "0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";

  function xX(t, {
    docsPath: e,
    ...r
  }) {
    const n = (() => {
      const i = L7(t, r);
      return i instanceof q3 ? t : i
    })();
    return new fX(n, {
      docsPath: e,
      ...r
    })
  }

  function uN() {
    let t = () => {},
      e = () => {};
    return {
      promise: new Promise((n, i) => {
        t = n, e = i
      }),
      resolve: t,
      reject: e
    }
  }
  const s9 = new Map;

  function dN({
    fn: t,
    id: e,
    shouldSplitBatch: r,
    wait: n = 0,
    sort: i
  }) {
    const s = async () => {
      const h = c();
      o();
      const f = h.map(({
        args: w
      }) => w);
      f.length !== 0 && t(f).then(w => {
        i && Array.isArray(w) && w.sort(i);
        for (let b = 0; b < h.length; b++) {
          const {
            resolve: C
          } = h[b];
          C?.([w[b], w])
        }
      }).catch(w => {
        for (let b = 0; b < h.length; b++) {
          const {
            reject: C
          } = h[b];
          C?.(w)
        }
      })
    }, o = () => s9.delete(e), a = () => c().map(({
      args: h
    }) => h), c = () => s9.get(e) || [], l = h => s9.set(e, [...c(), h]);
    return {
      flush: o,
      async schedule(h) {
        const {
          promise: f,
          resolve: w,
          reject: b
        } = uN();
        return r?.([...a(), h]) && s(), c().length > 0 ? (l({
          args: h,
          resolve: w,
          reject: b
        }), f) : (l({
          args: h,
          resolve: w,
          reject: b
        }), setTimeout(s, n), f)
      }
    }
  }
  async function G3(t, e) {
    const {
      account: r = t.account,
      batch: n = !!t.batch?.multicall,
      blockNumber: i,
      blockTag: s = "latest",
      accessList: o,
      blobs: a,
      code: c,
      data: l,
      factory: h,
      factoryData: f,
      gas: w,
      gasPrice: b,
      maxFeePerBlobGas: C,
      maxFeePerGas: M,
      maxPriorityFeePerGas: N,
      nonce: $,
      to: k,
      value: B,
      stateOverride: F,
      ...D
    } = e, V = r ? Ja(r) : void 0;
    if (c && (h || f)) throw new Ye("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
    if (c && k) throw new Ye("Cannot provide both `code` & `to` as parameters.");
    const R = c && l,
      P = h && f && k && l,
      j = R || P,
      Y = R ? AX({
        code: c,
        data: l
      }) : P ? SX({
        data: l,
        factory: h,
        factoryData: f,
        to: k
      }) : l;
    try {
      V3(e);
      const I = (i ? lr(i) : void 0) || s,
        g = IR(F),
        u = t.chain?.formatters?.transactionRequest?.format,
        v = (u || U7)({
          ...B7(D, {
            format: u
          }),
          from: V?.address,
          accessList: o,
          blobs: a,
          data: Y,
          gas: w,
          gasPrice: b,
          maxFeePerBlobGas: C,
          maxFeePerGas: M,
          maxPriorityFeePerGas: N,
          nonce: $,
          to: j ? void 0 : k,
          value: B
        });
      if (n && CX({
          request: v
        }) && !g) try {
        return await EX(t, {
          ...v,
          blockNumber: i,
          blockTag: s
        })
      } catch (E) {
        if (!(E instanceof pR) && !(E instanceof I7)) throw E
      }
      const x = await t.request({
        method: "eth_call",
        params: g ? [v, I, g] : [v, I]
      });
      return x === "0x" ? {
        data: void 0
      } : {
        data: x
      }
    } catch (U) {
      const I = IX(U),
        {
          offchainLookup: g,
          offchainLookupSignature: u
        } = await pi(async () => {
          const {
            offchainLookup: p,
            offchainLookupSignature: v
          } = await Promise.resolve().then(() => hee);
          return {
            offchainLookup: p,
            offchainLookupSignature: v
          }
        }, void 0);
      if (t.ccipRead !== !1 && I?.slice(0, 10) === u && k) return {
        data: await g(t, {
          data: I,
          to: k
        })
      };
      throw j && I?.slice(0, 10) === "0x101bb98d" ? new gX({
        factory: h
      }) : xX(U, {
        ...e,
        account: V,
        chain: t.chain
      })
    }
  }

  function CX({
    request: t
  }) {
    const {
      data: e,
      to: r,
      ...n
    } = t;
    return !(!e || e.startsWith(bX) || !r || Object.values(n).filter(i => typeof i < "u").length > 0)
  }
  async function EX(t, e) {
    const {
      batchSize: r = 1024,
      wait: n = 0
    } = typeof t.batch?.multicall == "object" ? t.batch.multicall : {}, {
      blockNumber: i,
      blockTag: s = "latest",
      data: o,
      multicallAddress: a,
      to: c
    } = e;
    let l = a;
    if (!l) {
      if (!t.chain) throw new pR;
      l = Cw({
        blockNumber: i,
        chain: t.chain,
        contract: "multicall3"
      })
    }
    const f = (i ? lr(i) : void 0) || s,
      {
        schedule: w
      } = dN({
        id: `${t.uid}.${f}`,
        wait: n,
        shouldSplitBatch(M) {
          return M.reduce(($, {
            data: k
          }) => $ + (k.length - 2), 0) > r * 2
        },
        fn: async M => {
          const N = M.map(B => ({
              allowFailure: !0,
              callData: B.data,
              target: B.to
            })),
            $ = Cu({
              abi: V7,
              args: [N],
              functionName: "aggregate3"
            }),
            k = await t.request({
              method: "eth_call",
              params: [{
                data: $,
                to: l
              }, f]
            });
          return r1({
            abi: V7,
            args: [N],
            functionName: "aggregate3",
            data: k || "0x"
          })
        }
      }),
      [{
        returnData: b,
        success: C
      }] = await w({
        data: o,
        to: c
      });
    if (!C) throw new r9({
      data: b
    });
    return b === "0x" ? {
      data: void 0
    } : {
      data: b
    }
  }

  function AX(t) {
    const {
      code: e,
      data: r
    } = t;
    return cR({
      abi: tN(["constructor(bytes, bytes)"]),
      bytecode: yX,
      args: [e, r]
    })
  }

  function SX(t) {
    const {
      data: e,
      factory: r,
      factoryData: n,
      to: i
    } = t;
    return cR({
      abi: tN(["constructor(address, bytes, address, bytes)"]),
      bytecode: _X,
      args: [i, e, r, n]
    })
  }

  function IX(t) {
    if (!(t instanceof Ye)) return;
    const e = t.walk();
    return typeof e?.data == "object" ? e.data?.data : e.data
  }
  async function Cf(t, e) {
    const {
      abi: r,
      address: n,
      args: i,
      functionName: s,
      ...o
    } = e, a = Cu({
      abi: r,
      args: i,
      functionName: s
    });
    try {
      const {
        data: c
      } = await wn(t, G3, "call")({
        ...o,
        data: a,
        to: n
      });
      return r1({
        abi: r,
        args: i,
        functionName: s,
        data: c || "0x"
      })
    } catch (c) {
      throw Ew(c, {
        abi: r,
        address: n,
        args: i,
        docsPath: "/docs/contract/readContract",
        functionName: s
      })
    }
  }
  async function TX(t, {
    blockNumber: e,
    blockTag: r,
    coinType: n,
    name: i,
    gatewayUrls: s,
    strict: o,
    universalResolverAddress: a
  }) {
    let c = a;
    if (!c) {
      if (!t.chain) throw new Error("client chain not configured. universalResolverAddress is required.");
      c = Cw({
        blockNumber: e,
        chain: t.chain,
        contract: "ensUniversalResolver"
      })
    }
    try {
      const l = Cu({
          abi: jR,
          functionName: "addr",
          ...n != null ? {
            args: [K3(i), BigInt(n)]
          } : {
            args: [K3(i)]
          }
        }),
        h = {
          address: c,
          abi: BR,
          functionName: "resolve",
          args: [_u(i9(i)), l],
          blockNumber: e,
          blockTag: r
        },
        f = wn(t, Cf, "readContract"),
        w = s ? await f({
          ...h,
          args: [...h.args, s]
        }) : await f(h);
      if (w[0] === "0x") return null;
      const b = r1({
        abi: jR,
        args: n != null ? [K3(i), BigInt(n)] : void 0,
        functionName: "addr",
        data: w[0]
      });
      return b === "0x" || Hp(b) === "0x00" ? null : b
    } catch (l) {
      if (o) throw l;
      if (n9(l, "resolve")) return null;
      throw l
    }
  }
  class kX extends Ye {
    constructor({
      data: e
    }) {
      super("Unable to extract image from metadata. The metadata may be malformed or invalid.", {
        metaMessages: ["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.", "", `Provided data: ${JSON.stringify(e)}`],
        name: "EnsAvatarInvalidMetadataError"
      })
    }
  }
  class Aw extends Ye {
    constructor({
      reason: e
    }) {
      super(`ENS NFT avatar URI is invalid. ${e}`, {
        name: "EnsAvatarInvalidNftUriError"
      })
    }
  }
  class o9 extends Ye {
    constructor({
      uri: e
    }) {
      super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`, {
        name: "EnsAvatarUriResolutionError"
      })
    }
  }
  class RX extends Ye {
    constructor({
      namespace: e
    }) {
      super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`, {
        name: "EnsAvatarUnsupportedNamespaceError"
      })
    }
  }
  const NX = /(?<protocol>https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,
    MX = /^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,
    PX = /^data:([a-zA-Z\-/+]*);base64,([^"].*)/,
    $X = /^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;
  async function OX(t) {
    try {
      const e = await fetch(t, {
        method: "HEAD"
      });
      return e.status === 200 ? e.headers.get("content-type")?.startsWith("image/") : !1
    } catch (e) {
      return typeof e == "object" && typeof e.response < "u" || !globalThis.hasOwnProperty("Image") ? !1 : new Promise(r => {
        const n = new Image;
        n.onload = () => {
          r(!0)
        }, n.onerror = () => {
          r(!1)
        }, n.src = t
      })
    }
  }

  function hN(t, e) {
    return t ? t.endsWith("/") ? t.slice(0, -1) : t : e
  }

  function fN({
    uri: t,
    gatewayUrls: e
  }) {
    const r = PX.test(t);
    if (r) return {
      uri: t,
      isOnChain: !0,
      isEncoded: r
    };
    const n = hN(e?.ipfs, "https://ipfs.io"),
      i = hN(e?.arweave, "https://arweave.net"),
      s = t.match(NX),
      {
        protocol: o,
        subpath: a,
        target: c,
        subtarget: l = ""
      } = s?.groups || {},
      h = o === "ipns:/" || a === "ipns/",
      f = o === "ipfs:/" || a === "ipfs/" || MX.test(t);
    if (t.startsWith("http") && !h && !f) {
      let b = t;
      return e?.arweave && (b = t.replace(/https:\/\/arweave.net/g, e?.arweave)), {
        uri: b,
        isOnChain: !1,
        isEncoded: !1
      }
    }
    if ((h || f) && c) return {
      uri: `${n}/${h?"ipns":"ipfs"}/${c}${l}`,
      isOnChain: !1,
      isEncoded: !1
    };
    if (o === "ar:/" && c) return {
      uri: `${i}/${c}${l||""}`,
      isOnChain: !1,
      isEncoded: !1
    };
    let w = t.replace($X, "");
    if (w.startsWith("<svg") && (w = `data:image/svg+xml;base64,${btoa(w)}`), w.startsWith("data:") || w.startsWith("{")) return {
      uri: w,
      isOnChain: !0,
      isEncoded: !1
    };
    throw new o9({
      uri: t
    })
  }

  function pN(t) {
    if (typeof t != "object" || !("image" in t) && !("image_url" in t) && !("image_data" in t)) throw new kX({
      data: t
    });
    return t.image || t.image_url || t.image_data
  }
  async function DX({
    gatewayUrls: t,
    uri: e
  }) {
    try {
      const r = await fetch(e).then(i => i.json());
      return await a9({
        gatewayUrls: t,
        uri: pN(r)
      })
    } catch {
      throw new o9({
        uri: e
      })
    }
  }
  async function a9({
    gatewayUrls: t,
    uri: e
  }) {
    const {
      uri: r,
      isOnChain: n
    } = fN({
      uri: e,
      gatewayUrls: t
    });
    if (n || await OX(r)) return r;
    throw new o9({
      uri: e
    })
  }

  function LX(t) {
    let e = t;
    e.startsWith("did:nft:") && (e = e.replace("did:nft:", "").replace(/_/g, "/"));
    const [r, n, i] = e.split("/"), [s, o] = r.split(":"), [a, c] = n.split(":");
    if (!s || s.toLowerCase() !== "eip155") throw new Aw({
      reason: "Only EIP-155 supported"
    });
    if (!o) throw new Aw({
      reason: "Chain ID not found"
    });
    if (!c) throw new Aw({
      reason: "Contract address not found"
    });
    if (!i) throw new Aw({
      reason: "Token ID not found"
    });
    if (!a) throw new Aw({
      reason: "ERC namespace not found"
    });
    return {
      chainID: Number.parseInt(o),
      namespace: a.toLowerCase(),
      contractAddress: c,
      tokenID: i
    }
  }
  async function BX(t, {
    nft: e
  }) {
    if (e.namespace === "erc721") return Cf(t, {
      address: e.contractAddress,
      abi: [{
        name: "tokenURI",
        type: "function",
        stateMutability: "view",
        inputs: [{
          name: "tokenId",
          type: "uint256"
        }],
        outputs: [{
          name: "",
          type: "string"
        }]
      }],
      functionName: "tokenURI",
      args: [BigInt(e.tokenID)]
    });
    if (e.namespace === "erc1155") return Cf(t, {
      address: e.contractAddress,
      abi: [{
        name: "uri",
        type: "function",
        stateMutability: "view",
        inputs: [{
          name: "_id",
          type: "uint256"
        }],
        outputs: [{
          name: "",
          type: "string"
        }]
      }],
      functionName: "uri",
      args: [BigInt(e.tokenID)]
    });
    throw new RX({
      namespace: e.namespace
    })
  }
  async function UX(t, {
    gatewayUrls: e,
    record: r
  }) {
    return /eip155:/i.test(r) ? jX(t, {
      gatewayUrls: e,
      record: r
    }) : a9({
      uri: r,
      gatewayUrls: e
    })
  }
  async function jX(t, {
    gatewayUrls: e,
    record: r
  }) {
    const n = LX(r),
      i = await BX(t, {
        nft: n
      }),
      {
        uri: s,
        isOnChain: o,
        isEncoded: a
      } = fN({
        uri: i,
        gatewayUrls: e
      });
    if (o && (s.includes("data:application/json;base64,") || s.startsWith("{"))) {
      const l = a ? atob(s.replace("data:application/json;base64,", "")) : s,
        h = JSON.parse(l);
      return a9({
        uri: pN(h),
        gatewayUrls: e
      })
    }
    let c = n.tokenID;
    return n.namespace === "erc1155" && (c = c.replace("0x", "").padStart(64, "0")), DX({
      gatewayUrls: e,
      uri: s.replace(/(?:0x)?{id}/, c)
    })
  }
  async function FX(t, {
    blockNumber: e,
    blockTag: r,
    name: n,
    key: i,
    gatewayUrls: s,
    strict: o,
    universalResolverAddress: a
  }) {
    let c = a;
    if (!c) {
      if (!t.chain) throw new Error("client chain not configured. universalResolverAddress is required.");
      c = Cw({
        blockNumber: e,
        chain: t.chain,
        contract: "ensUniversalResolver"
      })
    }
    try {
      const l = {
          address: c,
          abi: BR,
          functionName: "resolve",
          args: [_u(i9(n)), Cu({
            abi: UR,
            functionName: "text",
            args: [K3(n), i]
          })],
          blockNumber: e,
          blockTag: r
        },
        h = wn(t, Cf, "readContract"),
        f = s ? await h({
          ...l,
          args: [...l.args, s]
        }) : await h(l);
      if (f[0] === "0x") return null;
      const w = r1({
        abi: UR,
        functionName: "text",
        data: f[0]
      });
      return w === "" ? null : w
    } catch (l) {
      if (o) throw l;
      if (n9(l, "resolve")) return null;
      throw l
    }
  }
  async function WX(t, {
    blockNumber: e,
    blockTag: r,
    assetGatewayUrls: n,
    name: i,
    gatewayUrls: s,
    strict: o,
    universalResolverAddress: a
  }) {
    const c = await wn(t, FX, "getEnsText")({
      blockNumber: e,
      blockTag: r,
      key: "avatar",
      name: i,
      universalResolverAddress: a,
      gatewayUrls: s,
      strict: o
    });
    if (!c) return null;
    try {
      return await UX(t, {
        record: c,
        gatewayUrls: n
      })
    } catch {
      return null
    }
  }
  async function zX(t, {
    address: e,
    blockNumber: r,
    blockTag: n,
    gatewayUrls: i,
    strict: s,
    universalResolverAddress: o
  }) {
    let a = o;
    if (!a) {
      if (!t.chain) throw new Error("client chain not configured. universalResolverAddress is required.");
      a = Cw({
        blockNumber: r,
        chain: t.chain,
        contract: "ensUniversalResolver"
      })
    }
    const c = `${e.toLowerCase().substring(2)}.addr.reverse`;
    try {
      const l = {
          address: a,
          abi: dJ,
          functionName: "reverse",
          args: [_u(i9(c))],
          blockNumber: r,
          blockTag: n
        },
        h = wn(t, Cf, "readContract"),
        [f, w] = i ? await h({
          ...l,
          args: [...l.args, i]
        }) : await h(l);
      return e.toLowerCase() !== w.toLowerCase() ? null : f
    } catch (l) {
      if (s) throw l;
      if (n9(l, "reverse")) return null;
      throw l
    }
  }
  const HX = new Map,
    qX = new Map;

  function VX(t) {
    const e = (i, s) => ({
        clear: () => s.delete(i),
        get: () => s.get(i),
        set: o => s.set(i, o)
      }),
      r = e(t, HX),
      n = e(t, qX);
    return {
      clear: () => {
        r.clear(), n.clear()
      },
      promise: r,
      response: n
    }
  }
  async function KX(t, {
    cacheKey: e,
    cacheTime: r = Number.POSITIVE_INFINITY
  }) {
    const n = VX(e),
      i = n.response.get();
    if (i && r > 0 && new Date().getTime() - i.created.getTime() < r) return i.data;
    let s = n.promise.get();
    s || (s = t(), n.promise.set(s));
    try {
      const o = await s;
      return n.response.set({
        created: new Date,
        data: o
      }), o
    } finally {
      n.promise.clear()
    }
  }
  const GX = t => `blockNumber.${t}`;
  async function ZX(t, {
    cacheTime: e = t.cacheTime
  } = {}) {
    const r = await KX(() => t.request({
      method: "eth_blockNumber"
    }), {
      cacheKey: GX(t.uid),
      cacheTime: e
    });
    return BigInt(r)
  }

  function YX(t, e) {
    if (!Qa(t, {
        strict: !1
      })) throw new $d({
      address: t
    });
    if (!Qa(e, {
        strict: !1
      })) throw new $d({
      address: e
    });
    return t.toLowerCase() === e.toLowerCase()
  }

  function QX(t, {
    args: e,
    eventName: r
  } = {}) {
    return {
      ...t,
      blockHash: t.blockHash ? t.blockHash : null,
      blockNumber: t.blockNumber ? BigInt(t.blockNumber) : null,
      logIndex: t.logIndex ? Number(t.logIndex) : null,
      transactionHash: t.transactionHash ? t.transactionHash : null,
      transactionIndex: t.transactionIndex ? Number(t.transactionIndex) : null,
      ...r ? {
        args: e,
        eventName: r
      } : {}
    }
  }
  async function gN(t, {
    blockHash: e,
    blockNumber: r,
    blockTag: n,
    hash: i,
    index: s
  }) {
    const o = n || "latest",
      a = r !== void 0 ? lr(r) : void 0;
    let c = null;
    if (i ? c = await t.request({
        method: "eth_getTransactionByHash",
        params: [i]
      }, {
        dedupe: !0
      }) : e ? c = await t.request({
        method: "eth_getTransactionByBlockHashAndIndex",
        params: [e, lr(s)]
      }, {
        dedupe: !0
      }) : (a || o) && (c = await t.request({
        method: "eth_getTransactionByBlockNumberAndIndex",
        params: [a || o, lr(s)]
      }, {
        dedupe: !!a
      })), !c) throw new gR({
      blockHash: e,
      blockNumber: r,
      blockTag: o,
      hash: i,
      index: s
    });
    return (t.chain?.formatters?.transaction?.format || xR)(c)
  }
  const JX = {
    "0x0": "reverted",
    "0x1": "success"
  };

  function XX(t) {
    const e = {
      ...t,
      blockNumber: t.blockNumber ? BigInt(t.blockNumber) : null,
      contractAddress: t.contractAddress ? t.contractAddress : null,
      cumulativeGasUsed: t.cumulativeGasUsed ? BigInt(t.cumulativeGasUsed) : null,
      effectiveGasPrice: t.effectiveGasPrice ? BigInt(t.effectiveGasPrice) : null,
      gasUsed: t.gasUsed ? BigInt(t.gasUsed) : null,
      logs: t.logs ? t.logs.map(r => QX(r)) : null,
      to: t.to ? t.to : null,
      transactionIndex: t.transactionIndex ? bf(t.transactionIndex) : null,
      status: t.status ? JX[t.status] : null,
      type: t.type ? _R[t.type] || t.type : null
    };
    return t.blobGasPrice && (e.blobGasPrice = BigInt(t.blobGasPrice)), t.blobGasUsed && (e.blobGasUsed = BigInt(t.blobGasUsed)), e
  }
  async function mN(t, {
    hash: e
  }) {
    const r = await t.request({
      method: "eth_getTransactionReceipt",
      params: [e]
    }, {
      dedupe: !0
    });
    if (!r) throw new mR({
      hash: e
    });
    return (t.chain?.formatters?.transactionReceipt?.format || XX)(r)
  }
  async function eee(t, e) {
    const {
      allowFailure: r = !0,
      batchSize: n,
      blockNumber: i,
      blockTag: s,
      multicallAddress: o,
      stateOverride: a
    } = e, c = e.contracts, l = n ?? (typeof t.batch?.multicall == "object" && t.batch.multicall.batchSize || 1024);
    let h = o;
    if (!h) {
      if (!t.chain) throw new Error("client chain not configured. multicallAddress is required.");
      h = Cw({
        blockNumber: i,
        chain: t.chain,
        contract: "multicall3"
      })
    }
    const f = [
      []
    ];
    let w = 0,
      b = 0;
    for (let N = 0; N < c.length; N++) {
      const {
        abi: $,
        address: k,
        args: B,
        functionName: F
      } = c[N];
      try {
        const D = Cu({
          abi: $,
          args: B,
          functionName: F
        });
        b += (D.length - 2) / 2, l > 0 && b > l && f[w].length > 0 && (w++, b = (D.length - 2) / 2, f[w] = []), f[w] = [...f[w], {
          allowFailure: !0,
          callData: D,
          target: k
        }]
      } catch (D) {
        const V = Ew(D, {
          abi: $,
          address: k,
          args: B,
          docsPath: "/docs/contract/multicall",
          functionName: F
        });
        if (!r) throw V;
        f[w] = [...f[w], {
          allowFailure: !0,
          callData: "0x",
          target: k
        }]
      }
    }
    const C = await Promise.allSettled(f.map(N => wn(t, Cf, "readContract")({
        abi: V7,
        address: h,
        args: [N],
        blockNumber: i,
        blockTag: s,
        functionName: "aggregate3",
        stateOverride: a
      }))),
      M = [];
    for (let N = 0; N < C.length; N++) {
      const $ = C[N];
      if ($.status === "rejected") {
        if (!r) throw $.reason;
        for (let B = 0; B < f[N].length; B++) M.push({
          status: "failure",
          error: $.reason,
          result: void 0
        });
        continue
      }
      const k = $.value;
      for (let B = 0; B < k.length; B++) {
        const {
          returnData: F,
          success: D
        } = k[B], {
          callData: V
        } = f[N][B], {
          abi: R,
          address: P,
          functionName: j,
          args: Y
        } = c[M.length];
        try {
          if (V === "0x") throw new O3;
          if (!D) throw new r9({
            data: F
          });
          const U = r1({
            abi: R,
            args: Y,
            data: F,
            functionName: j
          });
          M.push(r ? {
            result: U,
            status: "success"
          } : U)
        } catch (U) {
          const I = Ew(U, {
            abi: R,
            address: P,
            args: Y,
            docsPath: "/docs/contract/multicall",
            functionName: j
          });
          if (!r) throw I;
          M.push({
            error: I,
            result: void 0,
            status: "failure"
          })
        }
      }
    }
    if (M.length !== c.length) throw new Ye("multicall results mismatch");
    return M
  }
  const c9 = new Map,
    wN = new Map;
  let tee = 0;

  function l9(t, e, r) {
    const n = ++tee,
      i = () => c9.get(t) || [],
      s = () => {
        const h = i();
        c9.set(t, h.filter(f => f.id !== n))
      },
      o = () => {
        const h = wN.get(t);
        i().length === 1 && h && h(), s()
      },
      a = i();
    if (c9.set(t, [...a, {
        id: n,
        fns: e
      }]), a && a.length > 0) return o;
    const c = {};
    for (const h in e) c[h] = (...f) => {
      const w = i();
      if (w.length !== 0)
        for (const b of w) b.fns[h]?.(...f)
    };
    const l = r(c);
    return typeof l == "function" && wN.set(t, l), o
  }
  async function Z3(t) {
    return new Promise(e => setTimeout(e, t))
  }

  function ree(t, {
    emitOnBegin: e,
    initialWaitTime: r,
    interval: n
  }) {
    let i = !0;
    const s = () => i = !1;
    return (async () => {
      let a;
      e && (a = await t({
        unpoll: s
      }));
      const c = await r?.(a) ?? n;
      await Z3(c);
      const l = async () => {
        i && (await t({
          unpoll: s
        }), await Z3(n), l())
      };
      l()
    })(), s
  }

  function nee(t, {
    emitOnBegin: e = !1,
    emitMissed: r = !1,
    onBlockNumber: n,
    onError: i,
    poll: s,
    pollingInterval: o = t.pollingInterval
  }) {
    const a = typeof s < "u" ? s : !(t.transport.type === "webSocket" || t.transport.type === "fallback" && t.transport.transports[0].config.type === "webSocket");
    let c;
    return a ? (() => {
      const f = Ro(["watchBlockNumber", t.uid, e, r, o]);
      return l9(f, {
        onBlockNumber: n,
        onError: i
      }, w => ree(async () => {
        try {
          const b = await wn(t, ZX, "getBlockNumber")({
            cacheTime: 0
          });
          if (c) {
            if (b === c) return;
            if (b - c > 1 && r)
              for (let C = c + 1n; C < b; C++) w.onBlockNumber(C, c), c = C
          }(!c || b > c) && (w.onBlockNumber(b, c), c = b)
        } catch (b) {
          w.onError?.(b)
        }
      }, {
        emitOnBegin: e,
        interval: o
      }))
    })() : (() => {
      const f = Ro(["watchBlockNumber", t.uid, e, r]);
      return l9(f, {
        onBlockNumber: n,
        onError: i
      }, w => {
        let b = !0,
          C = () => b = !1;
        return (async () => {
          try {
            const M = (() => {
                if (t.transport.type === "fallback") {
                  const $ = t.transport.transports.find(k => k.config.type === "webSocket");
                  return $ ? $.value : t.transport
                }
                return t.transport
              })(),
              {
                unsubscribe: N
              } = await M.subscribe({
                params: ["newHeads"],
                onData($) {
                  if (!b) return;
                  const k = qp($.result?.number);
                  w.onBlockNumber(k, c), c = k
                },
                onError($) {
                  w.onError?.($)
                }
              });
            C = N, b || C()
          } catch (M) {
            i?.(M)
          }
        })(), () => C()
      })
    })()
  }
  const Y3 = new B3(8192);

  function iee(t, {
    enabled: e = !0,
    id: r
  }) {
    if (!e || !r) return t();
    if (Y3.get(r)) return Y3.get(r);
    const n = t().finally(() => Y3.delete(r));
    return Y3.set(r, n), n
  }

  function Q3(t, {
    delay: e = 100,
    retryCount: r = 2,
    shouldRetry: n = () => !0
  } = {}) {
    return new Promise((i, s) => {
      const o = async ({
        count: a = 0
      } = {}) => {
        const c = async ({
          error: l
        }) => {
          const h = typeof e == "function" ? e({
            count: a,
            error: l
          }) : e;
          h && await Z3(h), o({
            count: a + 1
          })
        };
        try {
          const l = await t();
          i(l)
        } catch (l) {
          if (a < r && await n({
              count: a,
              error: l
            })) return c({
            error: l
          });
          s(l)
        }
      };
      o()
    })
  }

  function see(t, e = {}) {
    return async (r, n = {}) => {
      const {
        dedupe: i = !1,
        retryDelay: s = 150,
        retryCount: o = 3,
        uid: a
      } = {
        ...e,
        ...n
      }, c = i ? ps(Vp(`${a}.${Ro(r)}`)) : void 0;
      return iee(() => Q3(async () => {
        try {
          return await t(r)
        } catch (l) {
          const h = l;
          switch (h.code) {
            case aw.code:
              throw new aw(h);
            case cw.code:
              throw new cw(h);
            case lw.code:
              throw new lw(h, {
                method: r.method
              });
            case uw.code:
              throw new uw(h);
            case _f.code:
              throw new _f(h);
            case dw.code:
              throw new dw(h);
            case hw.code:
              throw new hw(h);
            case Dd.code:
              throw new Dd(h);
            case Xp.code:
              throw new Xp(h);
            case fw.code:
              throw new fw(h, {
                method: r.method
              });
            case e1.code:
              throw new e1(h);
            case pw.code:
              throw new pw(h);
            case on.code:
              throw new on(h);
            case gw.code:
              throw new gw(h);
            case mw.code:
              throw new mw(h);
            case ww.code:
              throw new ww(h);
            case vw.code:
              throw new vw(h);
            case Rs.code:
              throw new Rs(h);
            case 5e3:
              throw new on(h);
            default:
              throw l instanceof Ye ? l : new PQ(h)
          }
        }
      }, {
        delay: ({
          count: l,
          error: h
        }) => {
          if (h && h instanceof yf) {
            const f = h?.headers?.get("Retry-After");
            if (f?.match(/\d/)) return Number.parseInt(f) * 1e3
          }
          return ~~(1 << l) * s
        },
        retryCount: o,
        shouldRetry: ({
          error: l
        }) => oee(l)
      }), {
        enabled: i,
        id: c
      })
    }
  }

  function oee(t) {
    return "code" in t && typeof t.code == "number" ? t.code === -1 || t.code === e1.code || t.code === _f.code : t instanceof yf && t.status ? t.status === 403 || t.status === 408 || t.status === 413 || t.status === 429 || t.status === 500 || t.status === 502 || t.status === 503 || t.status === 504 : !0
  }
  class aee extends Ye {
    constructor({
      callbackSelector: e,
      cause: r,
      data: n,
      extraData: i,
      sender: s,
      urls: o
    }) {
      super(r.shortMessage || "An error occurred while fetching for an offchain result.", {
        cause: r,
        metaMessages: [...r.metaMessages || [], r.metaMessages?.length ? "" : [], "Offchain Gateway Call:", o && ["  Gateway URL(s):", ...o.map(a => `    ${ow(a)}`)], `  Sender: ${s}`, `  Data: ${n}`, `  Callback selector: ${e}`, `  Extra data: ${i}`].flat(),
        name: "OffchainLookupError"
      })
    }
  }
  class cee extends Ye {
    constructor({
      result: e,
      url: r
    }) {
      super("Offchain gateway response is malformed. Response data must be a hex value.", {
        metaMessages: [`Gateway URL: ${ow(r)}`, `Response: ${Ro(e)}`],
        name: "OffchainLookupResponseMalformedError"
      })
    }
  }
  class lee extends Ye {
    constructor({
      sender: e,
      to: r
    }) {
      super("Reverted sender address does not match target contract address (`to`).", {
        metaMessages: [`Contract address: ${r}`, `OffchainLookup sender address: ${e}`],
        name: "OffchainLookupSenderMismatchError"
      })
    }
  }
  const uee = "0x556f1830",
    vN = {
      name: "OffchainLookup",
      type: "error",
      inputs: [{
        name: "sender",
        type: "address"
      }, {
        name: "urls",
        type: "string[]"
      }, {
        name: "callData",
        type: "bytes"
      }, {
        name: "callbackFunction",
        type: "bytes4"
      }, {
        name: "extraData",
        type: "bytes"
      }]
    };
  async function dee(t, {
    blockNumber: e,
    blockTag: r,
    data: n,
    to: i
  }) {
    const {
      args: s
    } = oN({
      data: n,
      abi: [vN]
    }), [o, a, c, l, h] = s, {
      ccipRead: f
    } = t, w = f && typeof f?.request == "function" ? f.request : bN;
    try {
      if (!YX(i, o)) throw new lee({
        sender: o,
        to: i
      });
      const b = await w({
          data: c,
          sender: o,
          urls: a
        }),
        {
          data: C
        } = await G3(t, {
          blockNumber: e,
          blockTag: r,
          data: Zc([l, nw([{
            type: "bytes"
          }, {
            type: "bytes"
          }], [b, h])]),
          to: i
        });
      return C
    } catch (b) {
      throw new aee({
        callbackSelector: l,
        cause: b,
        data: n,
        extraData: h,
        sender: o,
        urls: a
      })
    }
  }
  async function bN({
    data: t,
    sender: e,
    urls: r
  }) {
    let n = new Error("An unknown error occurred.");
    for (let i = 0; i < r.length; i++) {
      const s = r[i],
        o = s.includes("{data}") ? "GET" : "POST",
        a = o === "POST" ? {
          data: t,
          sender: e
        } : void 0,
        c = o === "POST" ? {
          "Content-Type": "application/json"
        } : {};
      try {
        const l = await fetch(s.replace("{sender}", e).replace("{data}", t), {
          body: JSON.stringify(a),
          headers: c,
          method: o
        });
        let h;
        if (l.headers.get("Content-Type")?.startsWith("application/json") ? h = (await l.json()).data : h = await l.text(), !l.ok) {
          n = new yf({
            body: a,
            details: h?.error ? Ro(h.error) : l.statusText,
            headers: l.headers,
            status: l.status,
            url: s
          });
          continue
        }
        if (!Kc(h)) {
          n = new cee({
            result: h,
            url: s
          });
          continue
        }
        return h
      } catch (l) {
        n = new yf({
          body: a,
          details: l.message,
          url: s
        })
      }
    }
    throw n
  }
  const hee = Object.freeze(Object.defineProperty({
    __proto__: null,
    ccipRequest: bN,
    offchainLookup: dee,
    offchainLookupAbiItem: vN,
    offchainLookupSignature: uee
  }, Symbol.toStringTag, {
    value: "Module"
  }));

  function fee(t) {
    return {
      formatters: void 0,
      fees: void 0,
      serializers: void 0,
      ...t
    }
  }
  const pee = /^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,
    gee = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;

  function u9(t, {
    errorInstance: e = new Error("timed out"),
    timeout: r,
    signal: n
  }) {
    return new Promise((i, s) => {
      (async () => {
        let o;
        try {
          const a = new AbortController;
          r > 0 && (o = setTimeout(() => {
            n ? a.abort() : s(e)
          }, r)), i(await t({
            signal: a?.signal || null
          }))
        } catch (a) {
          a?.name === "AbortError" && s(e), s(a)
        } finally {
          clearTimeout(o)
        }
      })()
    })
  }

  function mee() {
    return {
      current: 0,
      take() {
        return this.current++
      },
      reset() {
        this.current = 0
      }
    }
  }
  const yN = mee();

  function wee(t, e = {}) {
    return {
      async request(r) {
        const {
          body: n,
          onRequest: i = e.onRequest,
          onResponse: s = e.onResponse,
          timeout: o = e.timeout ?? 1e4
        } = r, a = {
          ...e.fetchOptions ?? {},
          ...r.fetchOptions ?? {}
        }, {
          headers: c,
          method: l,
          signal: h
        } = a;
        try {
          const f = await u9(async ({
            signal: b
          }) => {
            const C = {
                ...a,
                body: Array.isArray(n) ? Ro(n.map(k => ({
                  jsonrpc: "2.0",
                  id: k.id ?? yN.take(),
                  ...k
                }))) : Ro({
                  jsonrpc: "2.0",
                  id: n.id ?? yN.take(),
                  ...n
                }),
                headers: {
                  "Content-Type": "application/json",
                  ...c
                },
                method: l || "POST",
                signal: h || (o > 0 ? b : null)
              },
              M = new Request(t, C),
              N = await i?.(M, C) ?? {
                ...C,
                url: t
              };
            return await fetch(N.url ?? t, N)
          }, {
            errorInstance: new vR({
              body: n,
              url: t
            }),
            timeout: o,
            signal: !0
          });
          s && await s(f);
          let w;
          if (f.headers.get("Content-Type")?.startsWith("application/json")) w = await f.json();
          else {
            w = await f.text();
            try {
              w = JSON.parse(w || "{}")
            } catch (b) {
              if (f.ok) throw b;
              w = {
                error: w
              }
            }
          }
          if (!f.ok) throw new yf({
            body: n,
            details: Ro(w.error) || f.statusText,
            headers: f.headers,
            status: f.status,
            url: t
          });
          return w
        } catch (f) {
          throw f instanceof yf || f instanceof vR ? f : new yf({
            body: n,
            cause: f,
            url: t
          })
        }
      }
    }
  }
  class vee extends Ye {
    constructor({
      primaryType: e,
      types: r
    }) {
      super(`Invalid primary type \`${e}\` must be one of \`${JSON.stringify(Object.keys(r))}\`.`, {
        docsPath: "/api/glossary/Errors#typeddatainvalidprimarytypeerror",
        metaMessages: ["Check that the primary type is a key in `types`."]
      })
    }
  }
  class bee extends Ye {
    constructor({
      type: e
    }) {
      super(`Struct type "${e}" is invalid.`, {
        metaMessages: ["Struct type must not be a Solidity type."],
        name: "InvalidStructTypeError"
      })
    }
  }

  function yee(t) {
    const {
      domain: e = {},
      message: r,
      primaryType: n
    } = t, i = {
      EIP712Domain: Aee({
        domain: e
      }),
      ...t.types
    };
    Eee({
      domain: e,
      message: r,
      primaryType: n,
      types: i
    });
    const s = ["0x1901"];
    return e && s.push(_ee({
      domain: e,
      types: i
    })), n !== "EIP712Domain" && s.push(_N({
      data: r,
      primaryType: n,
      types: i
    })), ps(Zc(s))
  }

  function _ee({
    domain: t,
    types: e
  }) {
    return _N({
      data: t,
      primaryType: "EIP712Domain",
      types: e
    })
  }

  function _N({
    data: t,
    primaryType: e,
    types: r
  }) {
    const n = xN({
      data: t,
      primaryType: e,
      types: r
    });
    return ps(n)
  }

  function xN({
    data: t,
    primaryType: e,
    types: r
  }) {
    const n = [{
        type: "bytes32"
      }],
      i = [xee({
        primaryType: e,
        types: r
      })];
    for (const s of r[e]) {
      const [o, a] = EN({
        types: r,
        name: s.name,
        type: s.type,
        value: t[s.name]
      });
      n.push(o), i.push(a)
    }
    return nw(n, i)
  }

  function xee({
    primaryType: t,
    types: e
  }) {
    const r = _u(Cee({
      primaryType: t,
      types: e
    }));
    return ps(r)
  }

  function Cee({
    primaryType: t,
    types: e
  }) {
    let r = "";
    const n = CN({
      primaryType: t,
      types: e
    });
    n.delete(t);
    const i = [t, ...Array.from(n).sort()];
    for (const s of i) r += `${s}(${e[s].map(({name:o,type:a})=>`
    $ {
      a
    }
    $ {
      o
    }
    `).join(",")})`;
    return r
  }

  function CN({
    primaryType: t,
    types: e
  }, r = new Set) {
    const i = t.match(/^\w*/u)?.[0];
    if (r.has(i) || e[i] === void 0) return r;
    r.add(i);
    for (const s of e[i]) CN({
      primaryType: s.type,
      types: e
    }, r);
    return r
  }

  function EN({
    types: t,
    name: e,
    type: r,
    value: n
  }) {
    if (t[r] !== void 0) return [{
      type: "bytes32"
    }, ps(xN({
      data: n,
      primaryType: r,
      types: t
    }))];
    if (r === "bytes") return n = `0x${(n.length%2?"0":"")+n.slice(2)}`, [{
      type: "bytes32"
    }, ps(n)];
    if (r === "string") return [{
      type: "bytes32"
    }, ps(_u(n))];
    if (r.lastIndexOf("]") === r.length - 1) {
      const i = r.slice(0, r.lastIndexOf("[")),
        s = n.map(o => EN({
          name: e,
          type: i,
          types: t,
          value: o
        }));
      return [{
        type: "bytes32"
      }, ps(nw(s.map(([o]) => o), s.map(([, o]) => o)))]
    }
    return [{
      type: r
    }, n]
  }

  function Eee(t) {
    const {
      domain: e,
      message: r,
      primaryType: n,
      types: i
    } = t, s = (o, a) => {
      for (const c of o) {
        const {
          name: l,
          type: h
        } = c, f = a[l], w = h.match(gee);
        if (w && (typeof f == "number" || typeof f == "bigint")) {
          const [M, N, $] = w;
          lr(f, {
            signed: N === "int",
            size: Number.parseInt($) / 8
          })
        }
        if (h === "address" && typeof f == "string" && !Qa(f)) throw new $d({
          address: f
        });
        const b = h.match(pee);
        if (b) {
          const [M, N] = b;
          if (N && fi(f) !== Number.parseInt(N)) throw new mY({
            expectedSize: Number.parseInt(N),
            givenSize: fi(f)
          })
        }
        const C = i[h];
        C && (See(h), s(C, f))
      }
    };
    if (i.EIP712Domain && e && s(i.EIP712Domain, e), n !== "EIP712Domain")
      if (i[n]) s(i[n], r);
      else throw new vee({
        primaryType: n,
        types: i
      })
  }

  function Aee({
    domain: t
  }) {
    return [typeof t?.name == "string" && {
      name: "name",
      type: "string"
    }, t?.version && {
      name: "version",
      type: "string"
    }, typeof t?.chainId == "number" && {
      name: "chainId",
      type: "uint256"
    }, t?.verifyingContract && {
      name: "verifyingContract",
      type: "address"
    }, t?.salt && {
      name: "salt",
      type: "bytes32"
    }].filter(Boolean)
  }

  function See(t) {
    if (t === "address" || t === "bool" || t === "string" || t.startsWith("bytes") || t.startsWith("uint") || t.startsWith("int")) throw new bee({
      type: t
    })
  }
  const Iee = `Ethereum Signed Message:
  `;

  function Tee(t) {
    const e = typeof t == "string" ? Vp(t) : typeof t.raw == "string" ? t.raw : Pi(t.raw),
      r = Vp(`${Iee}${fi(e)}`);
    return Zc([r, e])
  }

  function kee(t, e) {
    return ps(Tee(t), e)
  }
  class Ree extends Ye {
    constructor({
      value: e
    }) {
      super(`Number \`${e}\` is not a valid decimal number.`, {
        name: "InvalidDecimalNumberError"
      })
    }
  }

  function Nee(t, e) {
    if (!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t)) throw new Ree({
      value: t
    });
    let [r, n = "0"] = t.split(".");
    const i = r.startsWith("-");
    if (i && (r = r.slice(1)), n = n.replace(/(0+)$/, ""), e === 0) Math.round(+`.${n}`) === 1 && (r = `${BigInt(r)+1n}`), n = "";
    else if (n.length > e) {
      const [s, o, a] = [n.slice(0, e - 1), n.slice(e - 1, e), n.slice(e)], c = Math.round(+`${o}.${a}`);
      c > 9 ? n = `${BigInt(s)+BigInt(1)}0`.padStart(s.length + 1, "0") : n = `${s}${c}`, n.length > e && (n = n.slice(1), r = `${BigInt(r)+1n}`), n = n.slice(0, e)
    } else n = n.padEnd(e, "0");
    return BigInt(`${i?"-":""}${r}${n}`)
  }
  async function Mee(t, {
    confirmations: e = 1,
    hash: r,
    onReplaced: n,
    pollingInterval: i = t.pollingInterval,
    retryCount: s = 6,
    retryDelay: o = ({
      count: c
    }) => ~~(1 << c) * 200,
    timeout: a = 18e4
  }) {
    const c = Ro(["waitForTransactionReceipt", t.uid, r]);
    let l, h, f, w = !1;
    const {
      promise: b,
      resolve: C,
      reject: M
    } = uN(), N = a ? setTimeout(() => M(new RQ({
      hash: r
    })), a) : void 0, $ = l9(c, {
      onReplaced: n,
      resolve: C,
      reject: M
    }, k => {
      const B = wn(t, nee, "watchBlockNumber")({
        emitMissed: !0,
        emitOnBegin: !0,
        poll: !0,
        pollingInterval: i,
        async onBlockNumber(F) {
          const D = R => {
            clearTimeout(N), B(), R(), $()
          };
          let V = F;
          if (!w) try {
            if (f) {
              if (e > 1 && (!f.blockNumber || V - f.blockNumber + 1n < e)) return;
              D(() => k.resolve(f));
              return
            }
            if (l || (w = !0, await Q3(async () => {
                l = await wn(t, gN, "getTransaction")({
                  hash: r
                }), l.blockNumber && (V = l.blockNumber)
              }, {
                delay: o,
                retryCount: s
              }), w = !1), f = await wn(t, mN, "getTransactionReceipt")({
                hash: r
              }), e > 1 && (!f.blockNumber || V - f.blockNumber + 1n < e)) return;
            D(() => k.resolve(f))
          } catch (R) {
            if (R instanceof gR || R instanceof mR) {
              if (!l) {
                w = !1;
                return
              }
              try {
                h = l, w = !0;
                const P = await Q3(() => wn(t, bw, "getBlock")({
                  blockNumber: V,
                  includeTransactions: !0
                }), {
                  delay: o,
                  retryCount: s,
                  shouldRetry: ({
                    error: U
                  }) => U instanceof yR
                });
                w = !1;
                const j = P.transactions.find(({
                  from: U,
                  nonce: I
                }) => U === h.from && I === h.nonce);
                if (!j || (f = await wn(t, mN, "getTransactionReceipt")({
                    hash: j.hash
                  }), e > 1 && (!f.blockNumber || V - f.blockNumber + 1n < e))) return;
                let Y = "replaced";
                j.to === h.to && j.value === h.value ? Y = "repriced" : j.from === j.to && j.value === 0n && (Y = "cancelled"), D(() => {
                  k.onReplaced?.({
                    reason: Y,
                    replacedTransaction: h,
                    transaction: j,
                    transactionReceipt: f
                  }), k.resolve(f)
                })
              } catch (P) {
                D(() => k.reject(P))
              }
            } else D(() => k.reject(R))
          }
        }
      })
    });
    return b
  }
  async function Pee(t, {
    account: e = t.account,
    message: r
  }) {
    if (!e) throw new E7({
      docsPath: "/docs/actions/wallet/signMessage"
    });
    const n = Ja(e);
    if (n.signMessage) return n.signMessage({
      message: r
    });
    const i = typeof r == "string" ? Vp(r) : r.raw instanceof Uint8Array ? _u(r.raw) : r.raw;
    return t.request({
      method: "personal_sign",
      params: [i, n.address]
    }, {
      retryCount: 0
    })
  }
  async function $ee(t, e) {
    const {
      abi: r,
      address: n,
      args: i,
      dataSuffix: s,
      functionName: o,
      ...a
    } = e, c = a.account ? Ja(a.account) : t.account, l = Cu({
      abi: r,
      args: i,
      functionName: o
    });
    try {
      const {
        data: h
      } = await wn(t, G3, "call")({
        batch: !1,
        data: `${l}${s?s.replace("0x",""):""}`,
        to: n,
        ...a,
        account: c
      }), f = r1({
        abi: r,
        args: i,
        functionName: o,
        data: h || "0x"
      }), w = r.filter(b => "name" in b && b.name === e.functionName);
      return {
        result: f,
        request: {
          abi: w,
          address: n,
          args: i,
          dataSuffix: s,
          functionName: o,
          ...a,
          account: c
        }
      }
    } catch (h) {
      throw Ew(h, {
        abi: r,
        address: n,
        args: i,
        docsPath: "/docs/contract/simulateContract",
        functionName: o,
        sender: c?.address
      })
    }
  }
  let AN = class extends m7 {
    constructor(e, r) {
      super(), this.finished = !1, this.destroyed = !1, CY(e);
      const n = tw(r);
      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 i = this.blockLen,
        s = new Uint8Array(i);
      s.set(n.length > i ? e.create().update(n).digest() : n);
      for (let o = 0; o < s.length; o++) s[o] ^= 54;
      this.iHash.update(s), this.oHash = e.create();
      for (let o = 0; o < s.length; o++) s[o] ^= 106;
      this.oHash.update(s), s.fill(0)
    }
    update(e) {
      return Zp(this), this.iHash.update(e), this
    }
    digestInto(e) {
      Zp(this), Gp(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: r,
        iHash: n,
        finished: i,
        destroyed: s,
        blockLen: o,
        outputLen: a
      } = this;
      return e = e, e.finished = i, e.destroyed = s, e.blockLen = o, e.outputLen = a, e.oHash = r._cloneInto(e.oHash), e.iHash = n._cloneInto(e.iHash), e
    }
    destroy() {
      this.destroyed = !0, this.oHash.destroy(), this.iHash.destroy()
    }
  };
  const SN = (t, e, r) => new AN(t, e).update(r).digest();
  SN.create = (t, e) => new AN(t, e); /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
  const d9 = BigInt(0),
    J3 = BigInt(1),
    Oee = BigInt(2);

  function Ef(t) {
    return t instanceof Uint8Array || t != null && typeof t == "object" && t.constructor.name === "Uint8Array"
  }

  function Sw(t) {
    if (!Ef(t)) throw new Error("Uint8Array expected")
  }

  function n1(t, e) {
    if (typeof e != "boolean") throw new Error(`${t} must be valid boolean, got "${e}".`)
  }
  const Dee = Array.from({
    length: 256
  }, (t, e) => e.toString(16).padStart(2, "0"));

  function i1(t) {
    Sw(t);
    let e = "";
    for (let r = 0; r < t.length; r++) e += Dee[t[r]];
    return e
  }

  function s1(t) {
    const e = t.toString(16);
    return e.length & 1 ? `0${e}` : e
  }

  function h9(t) {
    if (typeof t != "string") throw new Error("hex string expected, got " + typeof t);
    return BigInt(t === "" ? "0" : `0x${t}`)
  }
  const Eu = {
    _0: 48,
    _9: 57,
    _A: 65,
    _F: 70,
    _a: 97,
    _f: 102
  };

  function IN(t) {
    if (t >= Eu._0 && t <= Eu._9) return t - Eu._0;
    if (t >= Eu._A && t <= Eu._F) return t - (Eu._A - 10);
    if (t >= Eu._a && t <= Eu._f) return t - (Eu._a - 10)
  }

  function o1(t) {
    if (typeof t != "string") throw new Error("hex string expected, got " + typeof t);
    const e = t.length,
      r = e / 2;
    if (e % 2) throw new Error("padded hex string expected, got unpadded hex of length " + e);
    const n = new Uint8Array(r);
    for (let i = 0, s = 0; i < r; i++, s += 2) {
      const o = IN(t.charCodeAt(s)),
        a = IN(t.charCodeAt(s + 1));
      if (o === void 0 || a === void 0) {
        const c = t[s] + t[s + 1];
        throw new Error('hex string expected, got non-hex character "' + c + '" at index ' + s)
      }
      n[i] = o * 16 + a
    }
    return n
  }

  function Af(t) {
    return h9(i1(t))
  }

  function f9(t) {
    return Sw(t), h9(i1(Uint8Array.from(t).reverse()))
  }

  function a1(t, e) {
    return o1(t.toString(16).padStart(e * 2, "0"))
  }

  function p9(t, e) {
    return a1(t, e).reverse()
  }

  function Lee(t) {
    return o1(s1(t))
  }

  function ec(t, e, r) {
    let n;
    if (typeof e == "string") try {
        n = o1(e)
      } catch (s) {
        throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${s}`)
      } else if (Ef(e)) n = Uint8Array.from(e);
      else throw new Error(`${t} must be hex string or Uint8Array`);
    const i = n.length;
    if (typeof r == "number" && i !== r) throw new Error(`${t} expected ${r} bytes, got ${i}`);
    return n
  }

  function Iw(...t) {
    let e = 0;
    for (let n = 0; n < t.length; n++) {
      const i = t[n];
      Sw(i), e += i.length
    }
    const r = new Uint8Array(e);
    for (let n = 0, i = 0; n < t.length; n++) {
      const s = t[n];
      r.set(s, i), i += s.length
    }
    return r
  }

  function Bee(t, e) {
    if (t.length !== e.length) return !1;
    let r = 0;
    for (let n = 0; n < t.length; n++) r |= t[n] ^ e[n];
    return r === 0
  }

  function Uee(t) {
    if (typeof t != "string") throw new Error(`utf8ToBytes expected string, got ${typeof t}`);
    return new Uint8Array(new TextEncoder().encode(t))
  }
  const g9 = t => typeof t == "bigint" && d9 <= t;

  function X3(t, e, r) {
    return g9(t) && g9(e) && g9(r) && e <= t && t < r
  }

  function Sf(t, e, r, n) {
    if (!X3(e, r, n)) throw new Error(`expected valid ${t}: ${r} <= n < ${n}, got ${typeof e} ${e}`)
  }

  function TN(t) {
    let e;
    for (e = 0; t > d9; t >>= J3, e += 1);
    return e
  }

  function jee(t, e) {
    return t >> BigInt(e) & J3
  }

  function Fee(t, e, r) {
    return t | (r ? J3 : d9) << BigInt(e)
  }
  const m9 = t => (Oee << BigInt(t - 1)) - J3,
    w9 = t => new Uint8Array(t),
    kN = t => Uint8Array.from(t);

  function RN(t, e, r) {
    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 r != "function") throw new Error("hmacFn must be a function");
    let n = w9(t),
      i = w9(t),
      s = 0;
    const o = () => {
        n.fill(1), i.fill(0), s = 0
      },
      a = (...f) => r(i, n, ...f),
      c = (f = w9()) => {
        i = a(kN([0]), f), n = a(), f.length !== 0 && (i = a(kN([1]), f), n = a())
      },
      l = () => {
        if (s++ >= 1e3) throw new Error("drbg: tried 1000 values");
        let f = 0;
        const w = [];
        for (; f < e;) {
          n = a();
          const b = n.slice();
          w.push(b), f += n.length
        }
        return Iw(...w)
      };
    return (f, w) => {
      o(), c(f);
      let b;
      for (; !(b = w(l()));) c();
      return o(), b
    }
  }
  const Wee = {
    bigint: t => typeof t == "bigint",
    function: t => typeof t == "function",
    boolean: t => typeof t == "boolean",
    string: t => typeof t == "string",
    stringOrUint8Array: t => typeof t == "string" || Ef(t),
    isSafeInteger: t => Number.isSafeInteger(t),
    array: t => Array.isArray(t),
    field: (t, e) => e.Fp.isValid(t),
    hash: t => typeof t == "function" && Number.isSafeInteger(t.outputLen)
  };

  function Tw(t, e, r = {}) {
    const n = (i, s, o) => {
      const a = Wee[s];
      if (typeof a != "function") throw new Error(`Invalid validator "${s}", expected function`);
      const c = t[i];
      if (!(o && c === void 0) && !a(c, t)) throw new Error(`Invalid param ${String(i)}=${c} (${typeof c}), expected ${s}`)
    };
    for (const [i, s] of Object.entries(e)) n(i, s, !1);
    for (const [i, s] of Object.entries(r)) n(i, s, !0);
    return t
  }
  const zee = () => {
    throw new Error("not implemented")
  };

  function v9(t) {
    const e = new WeakMap;
    return (r, ...n) => {
      const i = e.get(r);
      if (i !== void 0) return i;
      const s = t(r, ...n);
      return e.set(r, s), s
    }
  }
  const Hee = Object.freeze(Object.defineProperty({
    __proto__: null,
    aInRange: Sf,
    abool: n1,
    abytes: Sw,
    bitGet: jee,
    bitLen: TN,
    bitMask: m9,
    bitSet: Fee,
    bytesToHex: i1,
    bytesToNumberBE: Af,
    bytesToNumberLE: f9,
    concatBytes: Iw,
    createHmacDrbg: RN,
    ensureBytes: ec,
    equalBytes: Bee,
    hexToBytes: o1,
    hexToNumber: h9,
    inRange: X3,
    isBytes: Ef,
    memoized: v9,
    notImplemented: zee,
    numberToBytesBE: a1,
    numberToBytesLE: p9,
    numberToHexUnpadded: s1,
    numberToVarBytesBE: Lee,
    utf8ToBytes: Uee,
    validateObject: Tw
  }, Symbol.toStringTag, {
    value: "Module"
  })); /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
  const Oi = BigInt(0),
    ti = BigInt(1),
    If = BigInt(2),
    qee = BigInt(3),
    b9 = BigInt(4),
    NN = BigInt(5),
    MN = BigInt(8);
  BigInt(9), BigInt(16);

  function ro(t, e) {
    const r = t % e;
    return r >= Oi ? r : e + r
  }

  function Vee(t, e, r) {
    if (r <= Oi || e < Oi) throw new Error("Expected power/modulo > 0");
    if (r === ti) return Oi;
    let n = ti;
    for (; e > Oi;) e & ti && (n = n * t % r), t = t * t % r, e >>= ti;
    return n
  }

  function sa(t, e, r) {
    let n = t;
    for (; e-- > Oi;) n *= n, n %= r;
    return n
  }

  function y9(t, e) {
    if (t === Oi || e <= Oi) throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);
    let r = ro(t, e),
      n = e,
      i = Oi,
      s = ti;
    for (; r !== Oi;) {
      const a = n / r,
        c = n % r,
        l = i - s * a;
      n = r, r = c, i = s, s = l
    }
    if (n !== ti) throw new Error("invert: does not exist");
    return ro(i, e)
  }

  function Kee(t) {
    const e = (t - ti) / If;
    let r, n, i;
    for (r = t - ti, n = 0; r % If === Oi; r /= If, n++);
    for (i = If; i < t && Vee(i, e, t) !== t - ti; i++);
    if (n === 1) {
      const o = (t + ti) / b9;
      return function (c, l) {
        const h = c.pow(l, o);
        if (!c.eql(c.sqr(h), l)) throw new Error("Cannot find square root");
        return h
      }
    }
    const s = (r + ti) / If;
    return function (a, c) {
      if (a.pow(c, e) === a.neg(a.ONE)) throw new Error("Cannot find square root");
      let l = n,
        h = a.pow(a.mul(a.ONE, i), r),
        f = a.pow(c, s),
        w = a.pow(c, r);
      for (; !a.eql(w, a.ONE);) {
        if (a.eql(w, a.ZERO)) return a.ZERO;
        let b = 1;
        for (let M = a.sqr(w); b < l && !a.eql(M, a.ONE); b++) M = a.sqr(M);
        const C = a.pow(h, ti << BigInt(l - b - 1));
        h = a.sqr(C), f = a.mul(f, C), w = a.mul(w, h), l = b
      }
      return f
    }
  }

  function Gee(t) {
    if (t % b9 === qee) {
      const e = (t + ti) / b9;
      return function (n, i) {
        const s = n.pow(i, e);
        if (!n.eql(n.sqr(s), i)) throw new Error("Cannot find square root");
        return s
      }
    }
    if (t % MN === NN) {
      const e = (t - NN) / MN;
      return function (n, i) {
        const s = n.mul(i, If),
          o = n.pow(s, e),
          a = n.mul(i, o),
          c = n.mul(n.mul(a, If), o),
          l = n.mul(a, n.sub(c, n.ONE));
        if (!n.eql(n.sqr(l), i)) throw new Error("Cannot find square root");
        return l
      }
    }
    return Kee(t)
  }
  const Zee = ["create", "isValid", "is0", "neg", "inv", "sqrt", "sqr", "eql", "add", "sub", "mul", "pow", "div", "addN", "subN", "mulN", "sqrN"];

  function Yee(t) {
    const e = {
        ORDER: "bigint",
        MASK: "bigint",
        BYTES: "isSafeInteger",
        BITS: "isSafeInteger"
      },
      r = Zee.reduce((n, i) => (n[i] = "function", n), e);
    return Tw(t, r)
  }

  function Qee(t, e, r) {
    if (r < Oi) throw new Error("Expected power > 0");
    if (r === Oi) return t.ONE;
    if (r === ti) return e;
    let n = t.ONE,
      i = e;
    for (; r > Oi;) r & ti && (n = t.mul(n, i)), i = t.sqr(i), r >>= ti;
    return n
  }

  function Jee(t, e) {
    const r = new Array(e.length),
      n = e.reduce((s, o, a) => t.is0(o) ? s : (r[a] = s, t.mul(s, o)), t.ONE),
      i = t.inv(n);
    return e.reduceRight((s, o, a) => t.is0(o) ? s : (r[a] = t.mul(s, r[a]), t.mul(s, o)), i), r
  }

  function PN(t, e) {
    const r = e !== void 0 ? e : t.toString(2).length,
      n = Math.ceil(r / 8);
    return {
      nBitLength: r,
      nByteLength: n
    }
  }

  function $N(t, e, r = !1, n = {}) {
    if (t <= Oi) throw new Error(`Expected Field ORDER > 0, got ${t}`);
    const {
      nBitLength: i,
      nByteLength: s
    } = PN(t, e);
    if (s > 2048) throw new Error("Field lengths over 2048 bytes are not supported");
    const o = Gee(t),
      a = Object.freeze({
        ORDER: t,
        BITS: i,
        BYTES: s,
        MASK: m9(i),
        ZERO: Oi,
        ONE: ti,
        create: c => ro(c, t),
        isValid: c => {
          if (typeof c != "bigint") throw new Error(`Invalid field element: expected bigint, got ${typeof c}`);
          return Oi <= c && c < t
        },
        is0: c => c === Oi,
        isOdd: c => (c & ti) === ti,
        neg: c => ro(-c, t),
        eql: (c, l) => c === l,
        sqr: c => ro(c * c, t),
        add: (c, l) => ro(c + l, t),
        sub: (c, l) => ro(c - l, t),
        mul: (c, l) => ro(c * l, t),
        pow: (c, l) => Qee(a, c, l),
        div: (c, l) => ro(c * y9(l, t), t),
        sqrN: c => c * c,
        addN: (c, l) => c + l,
        subN: (c, l) => c - l,
        mulN: (c, l) => c * l,
        inv: c => y9(c, t),
        sqrt: n.sqrt || (c => o(a, c)),
        invertBatch: c => Jee(a, c),
        cmov: (c, l, h) => h ? l : c,
        toBytes: c => r ? p9(c, s) : a1(c, s),
        fromBytes: c => {
          if (c.length !== s) throw new Error(`Fp.fromBytes: expected ${s}, got ${c.length}`);
          return r ? f9(c) : Af(c)
        }
      });
    return Object.freeze(a)
  }

  function ON(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 DN(t) {
    const e = ON(t);
    return e + Math.ceil(e / 2)
  }

  function Xee(t, e, r = !1) {
    const n = t.length,
      i = ON(e),
      s = DN(e);
    if (n < 16 || n < s || n > 1024) throw new Error(`expected ${s}-1024 bytes of input, got ${n}`);
    const o = r ? Af(t) : f9(t),
      a = ro(o, e - ti) + ti;
    return r ? p9(a, i) : a1(a, i)
  } /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
  const ete = BigInt(0),
    _9 = BigInt(1),
    x9 = new WeakMap,
    LN = new WeakMap;

  function tte(t, e) {
    const r = (s, o) => {
        const a = o.negate();
        return s ? a : o
      },
      n = s => {
        if (!Number.isSafeInteger(s) || s <= 0 || s > e) throw new Error(`Wrong window size=${s}, should be [1..${e}]`)
      },
      i = s => {
        n(s);
        const o = Math.ceil(e / s) + 1,
          a = 2 ** (s - 1);
        return {
          windows: o,
          windowSize: a
        }
      };
    return {
      constTimeNegate: r,
      unsafeLadder(s, o) {
        let a = t.ZERO,
          c = s;
        for (; o > ete;) o & _9 && (a = a.add(c)), c = c.double(), o >>= _9;
        return a
      },
      precomputeWindow(s, o) {
        const {
          windows: a,
          windowSize: c
        } = i(o), l = [];
        let h = s,
          f = h;
        for (let w = 0; w < a; w++) {
          f = h, l.push(f);
          for (let b = 1; b < c; b++) f = f.add(h), l.push(f);
          h = f.double()
        }
        return l
      },
      wNAF(s, o, a) {
        const {
          windows: c,
          windowSize: l
        } = i(s);
        let h = t.ZERO,
          f = t.BASE;
        const w = BigInt(2 ** s - 1),
          b = 2 ** s,
          C = BigInt(s);
        for (let M = 0; M < c; M++) {
          const N = M * l;
          let $ = Number(a & w);
          a >>= C, $ > l && ($ -= b, a += _9);
          const k = N,
            B = N + Math.abs($) - 1,
            F = M % 2 !== 0,
            D = $ < 0;
          $ === 0 ? f = f.add(r(F, o[k])) : h = h.add(r(D, o[B]))
        }
        return {
          p: h,
          f
        }
      },
      wNAFCached(s, o, a) {
        const c = LN.get(s) || 1;
        let l = x9.get(s);
        return l || (l = this.precomputeWindow(s, c), c !== 1 && x9.set(s, a(l))), this.wNAF(c, l, o)
      },
      setWindowSize(s, o) {
        n(o), LN.set(s, o), x9.delete(s)
      }
    }
  }

  function rte(t, e, r, n) {
    if (!Array.isArray(r) || !Array.isArray(n) || n.length !== r.length) throw new Error("arrays of points and scalars must have equal length");
    n.forEach((h, f) => {
      if (!e.isValid(h)) throw new Error(`wrong scalar at index ${f}`)
    }), r.forEach((h, f) => {
      if (!(h instanceof t)) throw new Error(`wrong point at index ${f}`)
    });
    const i = TN(BigInt(r.length)),
      s = i > 12 ? i - 3 : i > 4 ? i - 2 : i ? 2 : 1,
      o = (1 << s) - 1,
      a = new Array(o + 1).fill(t.ZERO),
      c = Math.floor((e.BITS - 1) / s) * s;
    let l = t.ZERO;
    for (let h = c; h >= 0; h -= s) {
      a.fill(t.ZERO);
      for (let w = 0; w < n.length; w++) {
        const b = n[w],
          C = Number(b >> BigInt(h) & BigInt(o));
        a[C] = a[C].add(r[w])
      }
      let f = t.ZERO;
      for (let w = a.length - 1, b = t.ZERO; w > 0; w--) b = b.add(a[w]), f = f.add(b);
      if (l = l.add(f), h !== 0)
        for (let w = 0; w < s; w++) l = l.double()
    }
    return l
  }

  function BN(t) {
    return Yee(t.Fp), Tw(t, {
      n: "bigint",
      h: "bigint",
      Gx: "field",
      Gy: "field"
    }, {
      nBitLength: "isSafeInteger",
      nByteLength: "isSafeInteger"
    }), Object.freeze({
      ...PN(t.n, t.nBitLength),
      ...t,
      p: t.Fp.ORDER
    })
  } /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
  function UN(t) {
    t.lowS !== void 0 && n1("lowS", t.lowS), t.prehash !== void 0 && n1("prehash", t.prehash)
  }

  function nte(t) {
    const e = BN(t);
    Tw(e, {
      a: "field",
      b: "field"
    }, {
      allowedPrivateKeyLengths: "array",
      wrapPrivateKey: "boolean",
      isTorsionFree: "function",
      clearCofactor: "function",
      allowInfinityPoint: "boolean",
      fromBytes: "function",
      toBytes: "function"
    });
    const {
      endo: r,
      Fp: n,
      a: i
    } = e;
    if (r) {
      if (!n.eql(i, n.ZERO)) throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");
      if (typeof r != "object" || typeof r.beta != "bigint" || typeof r.splitScalar != "function") throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")
    }
    return Object.freeze({
      ...e
    })
  }
  const {
    bytesToNumberBE: ite,
    hexToBytes: ste
  } = Hee, Au = {
    Err: class extends Error {
      constructor(e = "") {
        super(e)
      }
    },
    _tlv: {
      encode: (t, e) => {
        const {
          Err: r
        } = Au;
        if (t < 0 || t > 256) throw new r("tlv.encode: wrong tag");
        if (e.length & 1) throw new r("tlv.encode: unpadded data");
        const n = e.length / 2,
          i = s1(n);
        if (i.length / 2 & 128) throw new r("tlv.encode: long form length too big");
        const s = n > 127 ? s1(i.length / 2 | 128) : "";
        return `${s1(t)}${s}${i}${e}`
      },
      decode(t, e) {
        const {
          Err: r
        } = Au;
        let n = 0;
        if (t < 0 || t > 256) throw new r("tlv.encode: wrong tag");
        if (e.length < 2 || e[n++] !== t) throw new r("tlv.decode: wrong tlv");
        const i = e[n++],
          s = !!(i & 128);
        let o = 0;
        if (!s) o = i;
        else {
          const c = i & 127;
          if (!c) throw new r("tlv.decode(long): indefinite length not supported");
          if (c > 4) throw new r("tlv.decode(long): byte length is too big");
          const l = e.subarray(n, n + c);
          if (l.length !== c) throw new r("tlv.decode: length bytes not complete");
          if (l[0] === 0) throw new r("tlv.decode(long): zero leftmost byte");
          for (const h of l) o = o << 8 | h;
          if (n += c, o < 128) throw new r("tlv.decode(long): not minimal encoding")
        }
        const a = e.subarray(n, n + o);
        if (a.length !== o) throw new r("tlv.decode: wrong value length");
        return {
          v: a,
          l: e.subarray(n + o)
        }
      }
    },
    _int: {
      encode(t) {
        const {
          Err: e
        } = Au;
        if (t < Su) throw new e("integer: negative integers are not allowed");
        let r = s1(t);
        if (Number.parseInt(r[0], 16) & 8 && (r = "00" + r), r.length & 1) throw new e("unexpected assertion");
        return r
      },
      decode(t) {
        const {
          Err: e
        } = Au;
        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 ite(t)
      }
    },
    toSig(t) {
      const {
        Err: e,
        _int: r,
        _tlv: n
      } = Au, i = typeof t == "string" ? ste(t) : t;
      Sw(i);
      const {
        v: s,
        l: o
      } = n.decode(48, i);
      if (o.length) throw new e("Invalid signature: left bytes after parsing");
      const {
        v: a,
        l: c
      } = n.decode(2, s), {
        v: l,
        l: h
      } = n.decode(2, c);
      if (h.length) throw new e("Invalid signature: left bytes after parsing");
      return {
        r: r.decode(a),
        s: r.decode(l)
      }
    },
    hexFromSig(t) {
      const {
        _tlv: e,
        _int: r
      } = Au, n = `${e.encode(2,r.encode(t.r))}${e.encode(2,r.encode(t.s))}`;
      return e.encode(48, n)
    }
  }, Su = BigInt(0), Di = BigInt(1);
  BigInt(2);
  const jN = BigInt(3);
  BigInt(4);

  function ote(t) {
    const e = nte(t),
      {
        Fp: r
      } = e,
      n = $N(e.n, e.nBitLength),
      i = e.toBytes || ((M, N, $) => {
        const k = N.toAffine();
        return Iw(Uint8Array.from([4]), r.toBytes(k.x), r.toBytes(k.y))
      }),
      s = e.fromBytes || (M => {
        const N = M.subarray(1),
          $ = r.fromBytes(N.subarray(0, r.BYTES)),
          k = r.fromBytes(N.subarray(r.BYTES, 2 * r.BYTES));
        return {
          x: $,
          y: k
        }
      });

    function o(M) {
      const {
        a: N,
        b: $
      } = e, k = r.sqr(M), B = r.mul(k, M);
      return r.add(r.add(B, r.mul(M, N)), $)
    }
    if (!r.eql(r.sqr(e.Gy), o(e.Gx))) throw new Error("bad generator point: equation left != right");

    function a(M) {
      return X3(M, Di, e.n)
    }

    function c(M) {
      const {
        allowedPrivateKeyLengths: N,
        nByteLength: $,
        wrapPrivateKey: k,
        n: B
      } = e;
      if (N && typeof M != "bigint") {
        if (Ef(M) && (M = i1(M)), typeof M != "string" || !N.includes(M.length)) throw new Error("Invalid key");
        M = M.padStart($ * 2, "0")
      }
      let F;
      try {
        F = typeof M == "bigint" ? M : Af(ec("private key", M, $))
      } catch {
        throw new Error(`private key must be ${$} bytes, hex or bigint, not ${typeof M}`)
      }
      return k && (F = ro(F, B)), Sf("private key", F, Di, B), F
    }

    function l(M) {
      if (!(M instanceof w)) throw new Error("ProjectivePoint expected")
    }
    const h = v9((M, N) => {
        const {
          px: $,
          py: k,
          pz: B
        } = M;
        if (r.eql(B, r.ONE)) return {
          x: $,
          y: k
        };
        const F = M.is0();
        N == null && (N = F ? r.ONE : r.inv(B));
        const D = r.mul($, N),
          V = r.mul(k, N),
          R = r.mul(B, N);
        if (F) return {
          x: r.ZERO,
          y: r.ZERO
        };
        if (!r.eql(R, r.ONE)) throw new Error("invZ was invalid");
        return {
          x: D,
          y: V
        }
      }),
      f = v9(M => {
        if (M.is0()) {
          if (e.allowInfinityPoint && !r.is0(M.py)) return;
          throw new Error("bad point: ZERO")
        }
        const {
          x: N,
          y: $
        } = M.toAffine();
        if (!r.isValid(N) || !r.isValid($)) throw new Error("bad point: x or y not FE");
        const k = r.sqr($),
          B = o(N);
        if (!r.eql(k, B)) throw new Error("bad point: equation left != right");
        if (!M.isTorsionFree()) throw new Error("bad point: not in prime-order subgroup");
        return !0
      });
    class w {
      constructor(N, $, k) {
        if (this.px = N, this.py = $, this.pz = k, N == null || !r.isValid(N)) throw new Error("x required");
        if ($ == null || !r.isValid($)) throw new Error("y required");
        if (k == null || !r.isValid(k)) throw new Error("z required");
        Object.freeze(this)
      }
      static fromAffine(N) {
        const {
          x: $,
          y: k
        } = N || {};
        if (!N || !r.isValid($) || !r.isValid(k)) throw new Error("invalid affine point");
        if (N instanceof w) throw new Error("projective point not allowed");
        const B = F => r.eql(F, r.ZERO);
        return B($) && B(k) ? w.ZERO : new w($, k, r.ONE)
      }
      get x() {
        return this.toAffine().x
      }
      get y() {
        return this.toAffine().y
      }
      static normalizeZ(N) {
        const $ = r.invertBatch(N.map(k => k.pz));
        return N.map((k, B) => k.toAffine($[B])).map(w.fromAffine)
      }
      static fromHex(N) {
        const $ = w.fromAffine(s(ec("pointHex", N)));
        return $.assertValidity(), $
      }
      static fromPrivateKey(N) {
        return w.BASE.multiply(c(N))
      }
      static msm(N, $) {
        return rte(w, n, N, $)
      }
      _setWindowSize(N) {
        C.setWindowSize(this, N)
      }
      assertValidity() {
        f(this)
      }
      hasEvenY() {
        const {
          y: N
        } = this.toAffine();
        if (r.isOdd) return !r.isOdd(N);
        throw new Error("Field doesn't support isOdd")
      }
      equals(N) {
        l(N);
        const {
          px: $,
          py: k,
          pz: B
        } = this, {
          px: F,
          py: D,
          pz: V
        } = N, R = r.eql(r.mul($, V), r.mul(F, B)), P = r.eql(r.mul(k, V), r.mul(D, B));
        return R && P
      }
      negate() {
        return new w(this.px, r.neg(this.py), this.pz)
      }
      double() {
        const {
          a: N,
          b: $
        } = e, k = r.mul($, jN), {
          px: B,
          py: F,
          pz: D
        } = this;
        let V = r.ZERO,
          R = r.ZERO,
          P = r.ZERO,
          j = r.mul(B, B),
          Y = r.mul(F, F),
          U = r.mul(D, D),
          I = r.mul(B, F);
        return I = r.add(I, I), P = r.mul(B, D), P = r.add(P, P), V = r.mul(N, P), R = r.mul(k, U), R = r.add(V, R), V = r.sub(Y, R), R = r.add(Y, R), R = r.mul(V, R), V = r.mul(I, V), P = r.mul(k, P), U = r.mul(N, U), I = r.sub(j, U), I = r.mul(N, I), I = r.add(I, P), P = r.add(j, j), j = r.add(P, j), j = r.add(j, U), j = r.mul(j, I), R = r.add(R, j), U = r.mul(F, D), U = r.add(U, U), j = r.mul(U, I), V = r.sub(V, j), P = r.mul(U, Y), P = r.add(P, P), P = r.add(P, P), new w(V, R, P)
      }
      add(N) {
        l(N);
        const {
          px: $,
          py: k,
          pz: B
        } = this, {
          px: F,
          py: D,
          pz: V
        } = N;
        let R = r.ZERO,
          P = r.ZERO,
          j = r.ZERO;
        const Y = e.a,
          U = r.mul(e.b, jN);
        let I = r.mul($, F),
          g = r.mul(k, D),
          u = r.mul(B, V),
          p = r.add($, k),
          v = r.add(F, D);
        p = r.mul(p, v), v = r.add(I, g), p = r.sub(p, v), v = r.add($, B);
        let x = r.add(F, V);
        return v = r.mul(v, x), x = r.add(I, u), v = r.sub(v, x), x = r.add(k, B), R = r.add(D, V), x = r.mul(x, R), R = r.add(g, u), x = r.sub(x, R), j = r.mul(Y, v), R = r.mul(U, u), j = r.add(R, j), R = r.sub(g, j), j = r.add(g, j), P = r.mul(R, j), g = r.add(I, I), g = r.add(g, I), u = r.mul(Y, u), v = r.mul(U, v), g = r.add(g, u), u = r.sub(I, u), u = r.mul(Y, u), v = r.add(v, u), I = r.mul(g, v), P = r.add(P, I), I = r.mul(x, v), R = r.mul(p, R), R = r.sub(R, I), I = r.mul(p, g), j = r.mul(x, j), j = r.add(j, I), new w(R, P, j)
      }
      subtract(N) {
        return this.add(N.negate())
      }
      is0() {
        return this.equals(w.ZERO)
      }
      wNAF(N) {
        return C.wNAFCached(this, N, w.normalizeZ)
      }
      multiplyUnsafe(N) {
        Sf("scalar", N, Su, e.n);
        const $ = w.ZERO;
        if (N === Su) return $;
        if (N === Di) return this;
        const {
          endo: k
        } = e;
        if (!k) return C.unsafeLadder(this, N);
        let {
          k1neg: B,
          k1: F,
          k2neg: D,
          k2: V
        } = k.splitScalar(N), R = $, P = $, j = this;
        for (; F > Su || V > Su;) F & Di && (R = R.add(j)), V & Di && (P = P.add(j)), j = j.double(), F >>= Di, V >>= Di;
        return B && (R = R.negate()), D && (P = P.negate()), P = new w(r.mul(P.px, k.beta), P.py, P.pz), R.add(P)
      }
      multiply(N) {
        const {
          endo: $,
          n: k
        } = e;
        Sf("scalar", N, Di, k);
        let B, F;
        if ($) {
          const {
            k1neg: D,
            k1: V,
            k2neg: R,
            k2: P
          } = $.splitScalar(N);
          let {
            p: j,
            f: Y
          } = this.wNAF(V), {
            p: U,
            f: I
          } = this.wNAF(P);
          j = C.constTimeNegate(D, j), U = C.constTimeNegate(R, U), U = new w(r.mul(U.px, $.beta), U.py, U.pz), B = j.add(U), F = Y.add(I)
        } else {
          const {
            p: D,
            f: V
          } = this.wNAF(N);
          B = D, F = V
        }
        return w.normalizeZ([B, F])[0]
      }
      multiplyAndAddUnsafe(N, $, k) {
        const B = w.BASE,
          F = (V, R) => R === Su || R === Di || !V.equals(B) ? V.multiplyUnsafe(R) : V.multiply(R),
          D = F(this, $).add(F(N, k));
        return D.is0() ? void 0 : D
      }
      toAffine(N) {
        return h(this, N)
      }
      isTorsionFree() {
        const {
          h: N,
          isTorsionFree: $
        } = e;
        if (N === Di) return !0;
        if ($) return $(w, this);
        throw new Error("isTorsionFree() has not been declared for the elliptic curve")
      }
      clearCofactor() {
        const {
          h: N,
          clearCofactor: $
        } = e;
        return N === Di ? this : $ ? $(w, this) : this.multiplyUnsafe(e.h)
      }
      toRawBytes(N = !0) {
        return n1("isCompressed", N), this.assertValidity(), i(w, this, N)
      }
      toHex(N = !0) {
        return n1("isCompressed", N), i1(this.toRawBytes(N))
      }
    }
    w.BASE = new w(e.Gx, e.Gy, r.ONE), w.ZERO = new w(r.ZERO, r.ONE, r.ZERO);
    const b = e.nBitLength,
      C = tte(w, e.endo ? Math.ceil(b / 2) : b);
    return {
      CURVE: e,
      ProjectivePoint: w,
      normPrivateKeyToScalar: c,
      weierstrassEquation: o,
      isWithinCurveOrder: a
    }
  }

  function ate(t) {
    const e = BN(t);
    return Tw(e, {
      hash: "hash",
      hmac: "function",
      randomBytes: "function"
    }, {
      bits2int: "function",
      bits2int_modN: "function",
      lowS: "boolean"
    }), Object.freeze({
      lowS: !0,
      ...e
    })
  }

  function cte(t) {
    const e = ate(t),
      {
        Fp: r,
        n
      } = e,
      i = r.BYTES + 1,
      s = 2 * r.BYTES + 1;

    function o(u) {
      return ro(u, n)
    }

    function a(u) {
      return y9(u, n)
    }
    const {
      ProjectivePoint: c,
      normPrivateKeyToScalar: l,
      weierstrassEquation: h,
      isWithinCurveOrder: f
    } = ote({
      ...e,
      toBytes(u, p, v) {
        const x = p.toAffine(),
          E = r.toBytes(x.x),
          S = Iw;
        return n1("isCompressed", v), v ? S(Uint8Array.from([p.hasEvenY() ? 2 : 3]), E) : S(Uint8Array.from([4]), E, r.toBytes(x.y))
      },
      fromBytes(u) {
        const p = u.length,
          v = u[0],
          x = u.subarray(1);
        if (p === i && (v === 2 || v === 3)) {
          const E = Af(x);
          if (!X3(E, Di, r.ORDER)) throw new Error("Point is not on curve");
          const S = h(E);
          let _;
          try {
            _ = r.sqrt(S)
          } catch (G) {
            const ce = G instanceof Error ? ": " + G.message : "";
            throw new Error("Point is not on curve" + ce)
          }
          const y = (_ & Di) === Di;
          return (v & 1) === 1 !== y && (_ = r.neg(_)), {
            x: E,
            y: _
          }
        } else if (p === s && v === 4) {
          const E = r.fromBytes(x.subarray(0, r.BYTES)),
            S = r.fromBytes(x.subarray(r.BYTES, 2 * r.BYTES));
          return {
            x: E,
            y: S
          }
        } else throw new Error(`Point of length ${p} was invalid. Expected ${i} compressed bytes or ${s} uncompressed bytes`)
      }
    }), w = u => i1(a1(u, e.nByteLength));

    function b(u) {
      const p = n >> Di;
      return u > p
    }

    function C(u) {
      return b(u) ? o(-u) : u
    }
    const M = (u, p, v) => Af(u.slice(p, v));
    class N {
      constructor(p, v, x) {
        this.r = p, this.s = v, this.recovery = x, this.assertValidity()
      }
      static fromCompact(p) {
        const v = e.nByteLength;
        return p = ec("compactSignature", p, v * 2), new N(M(p, 0, v), M(p, v, 2 * v))
      }
      static fromDER(p) {
        const {
          r: v,
          s: x
        } = Au.toSig(ec("DER", p));
        return new N(v, x)
      }
      assertValidity() {
        Sf("r", this.r, Di, n), Sf("s", this.s, Di, n)
      }
      addRecoveryBit(p) {
        return new N(this.r, this.s, p)
      }
      recoverPublicKey(p) {
        const {
          r: v,
          s: x,
          recovery: E
        } = this, S = V(ec("msgHash", p));
        if (E == null || ![0, 1, 2, 3].includes(E)) throw new Error("recovery id invalid");
        const _ = E === 2 || E === 3 ? v + e.n : v;
        if (_ >= r.ORDER) throw new Error("recovery id 2 or 3 invalid");
        const y = E & 1 ? "03" : "02",
          A = c.fromHex(y + w(_)),
          G = a(_),
          ce = o(-S * G),
          W = o(x * G),
          X = c.BASE.multiplyAndAddUnsafe(A, ce, W);
        if (!X) throw new Error("point at infinify");
        return X.assertValidity(), X
      }
      hasHighS() {
        return b(this.s)
      }
      normalizeS() {
        return this.hasHighS() ? new N(this.r, o(-this.s), this.recovery) : this
      }
      toDERRawBytes() {
        return o1(this.toDERHex())
      }
      toDERHex() {
        return Au.hexFromSig({
          r: this.r,
          s: this.s
        })
      }
      toCompactRawBytes() {
        return o1(this.toCompactHex())
      }
      toCompactHex() {
        return w(this.r) + w(this.s)
      }
    }
    const $ = {
      isValidPrivateKey(u) {
        try {
          return l(u), !0
        } catch {
          return !1
        }
      },
      normPrivateKeyToScalar: l,
      randomPrivateKey: () => {
        const u = DN(e.n);
        return Xee(e.randomBytes(u), e.n)
      },
      precompute(u = 8, p = c.BASE) {
        return p._setWindowSize(u), p.multiply(BigInt(3)), p
      }
    };

    function k(u, p = !0) {
      return c.fromPrivateKey(u).toRawBytes(p)
    }

    function B(u) {
      const p = Ef(u),
        v = typeof u == "string",
        x = (p || v) && u.length;
      return p ? x === i || x === s : v ? x === 2 * i || x === 2 * s : u instanceof c
    }

    function F(u, p, v = !0) {
      if (B(u)) throw new Error("first arg must be private key");
      if (!B(p)) throw new Error("second arg must be public key");
      return c.fromHex(p).multiply(l(u)).toRawBytes(v)
    }
    const D = e.bits2int || function (u) {
        const p = Af(u),
          v = u.length * 8 - e.nBitLength;
        return v > 0 ? p >> BigInt(v) : p
      },
      V = e.bits2int_modN || function (u) {
        return o(D(u))
      },
      R = m9(e.nBitLength);

    function P(u) {
      return Sf(`num < 2^${e.nBitLength}`, u, Su, R), a1(u, e.nByteLength)
    }

    function j(u, p, v = Y) {
      if (["recovered", "canonical"].some(ee => ee in v)) throw new Error("sign() legacy options not supported");
      const {
        hash: x,
        randomBytes: E
      } = e;
      let {
        lowS: S,
        prehash: _,
        extraEntropy: y
      } = v;
      S == null && (S = !0), u = ec("msgHash", u), UN(v), _ && (u = ec("prehashed msgHash", x(u)));
      const A = V(u),
        G = l(p),
        ce = [P(G), P(A)];
      if (y != null && y !== !1) {
        const ee = y === !0 ? E(r.BYTES) : y;
        ce.push(ec("extraEntropy", ee))
      }
      const W = Iw(...ce),
        X = A;

      function Z(ee) {
        const ne = D(ee);
        if (!f(ne)) return;
        const O = a(ne),
          H = c.BASE.multiply(ne).toAffine(),
          Q = o(H.x);
        if (Q === Su) return;
        const de = o(O * o(X + Q * G));
        if (de === Su) return;
        let ge = (H.x === Q ? 0 : 2) | Number(H.y & Di),
          Te = de;
        return S && b(de) && (Te = C(de), ge ^= 1), new N(Q, Te, ge)
      }
      return {
        seed: W,
        k2sig: Z
      }
    }
    const Y = {
        lowS: e.lowS,
        prehash: !1
      },
      U = {
        lowS: e.lowS,
        prehash: !1
      };

    function I(u, p, v = Y) {
      const {
        seed: x,
        k2sig: E
      } = j(u, p, v), S = e;
      return RN(S.hash.outputLen, S.nByteLength, S.hmac)(x, E)
    }
    c.BASE._setWindowSize(8);

    function g(u, p, v, x = U) {
      const E = u;
      if (p = ec("msgHash", p), v = ec("publicKey", v), "strict" in x) throw new Error("options.strict was renamed to lowS");
      UN(x);
      const {
        lowS: S,
        prehash: _
      } = x;
      let y, A;
      try {
        if (typeof E == "string" || Ef(E)) try {
          y = N.fromDER(E)
        } catch (H) {
          if (!(H instanceof Au.Err)) throw H;
          y = N.fromCompact(E)
        } else if (typeof E == "object" && typeof E.r == "bigint" && typeof E.s == "bigint") {
          const {
            r: H,
            s: Q
          } = E;
          y = new N(H, Q)
        } else throw new Error("PARSE");
        A = c.fromHex(v)
      } catch (H) {
        if (H.message === "PARSE") throw new Error("signature must be Signature instance, Uint8Array or hex string");
        return !1
      }
      if (S && y.hasHighS()) return !1;
      _ && (p = e.hash(p));
      const {
        r: G,
        s: ce
      } = y, W = V(p), X = a(ce), Z = o(W * X), ee = o(G * X), ne = c.BASE.multiplyAndAddUnsafe(A, Z, ee)?.toAffine();
      return ne ? o(ne.x) === G : !1
    }
    return {
      CURVE: e,
      getPublicKey: k,
      getSharedSecret: F,
      sign: I,
      verify: g,
      ProjectivePoint: c,
      Signature: N,
      utils: $
    }
  } /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
  function lte(t) {
    return {
      hash: t,
      hmac: (e, ...r) => SN(t, e, OY(...r)),
      randomBytes: LY
    }
  }

  function ute(t, e) {
    const r = n => cte({
      ...t,
      ...lte(n)
    });
    return Object.freeze({
      ...r(e),
      create: r
    })
  } /*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
  const FN = BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),
    WN = BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),
    dte = BigInt(1),
    C9 = BigInt(2),
    zN = (t, e) => (t + e / C9) / e;

  function hte(t) {
    const e = FN,
      r = BigInt(3),
      n = BigInt(6),
      i = BigInt(11),
      s = BigInt(22),
      o = BigInt(23),
      a = BigInt(44),
      c = BigInt(88),
      l = t * t * t % e,
      h = l * l * t % e,
      f = sa(h, r, e) * h % e,
      w = sa(f, r, e) * h % e,
      b = sa(w, C9, e) * l % e,
      C = sa(b, i, e) * b % e,
      M = sa(C, s, e) * C % e,
      N = sa(M, a, e) * M % e,
      $ = sa(N, c, e) * N % e,
      k = sa($, a, e) * M % e,
      B = sa(k, r, e) * h % e,
      F = sa(B, o, e) * C % e,
      D = sa(F, n, e) * l % e,
      V = sa(D, C9, e);
    if (!E9.eql(E9.sqr(V), t)) throw new Error("Cannot find square root");
    return V
  }
  const E9 = $N(FN, void 0, void 0, {
      sqrt: hte
    }),
    HN = ute({
      a: BigInt(0),
      b: BigInt(7),
      Fp: E9,
      n: WN,
      Gx: BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),
      Gy: BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),
      h: BigInt(1),
      lowS: !0,
      endo: {
        beta: BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),
        splitScalar: t => {
          const e = WN,
            r = BigInt("0x3086d221a7d46bcde86c90e49284eb15"),
            n = -dte * BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),
            i = BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),
            s = r,
            o = BigInt("0x100000000000000000000000000000000"),
            a = zN(s * t, e),
            c = zN(-n * t, e);
          let l = ro(t - a * r - c * i, e),
            h = ro(-a * n - c * s, e);
          const f = l > o,
            w = h > o;
          if (f && (l = e - l), w && (h = e - h), l > o || h > o) throw new Error("splitScalar: Endomorphism failed, k=" + t);
          return {
            k1neg: f,
            k1: l,
            k2neg: w,
            k2: h
          }
        }
      }
    }, W7);
  BigInt(0), HN.ProjectivePoint;
  const fte = Object.freeze(Object.defineProperty({
    __proto__: null,
    secp256k1: HN
  }, Symbol.toStringTag, {
    value: "Module"
  }));
  async function pte(t, e) {
    const {
      abi: r,
      account: n = t.account,
      address: i,
      args: s,
      dataSuffix: o,
      functionName: a,
      ...c
    } = e;
    if (typeof n > "u") throw new E7({
      docsPath: "/docs/contract/writeContract"
    });
    const l = n ? Ja(n) : null,
      h = Cu({
        abi: r,
        args: s,
        functionName: a
      });
    try {
      return await wn(t, DR, "sendTransaction")({
        data: `${h}${o?o.replace("0x",""):""}`,
        to: i,
        account: l,
        ...c
      })
    } catch (f) {
      throw Ew(f, {
        abi: r,
        address: i,
        args: s,
        docsPath: "/docs/contract/writeContract",
        functionName: a,
        sender: l?.address
      })
    }
  }

  function gs(t, e, r) {
    const n = t[e.name];
    if (typeof n == "function") return n;
    const i = t[r];
    return typeof i == "function" ? i : s => e(t, s)
  }
  const ey = "2.14.4",
    gte = () => `@wagmi/core@${ey}`;
  var qN = function (t, e, r, n) {
      if (r === "a" && !n) throw new TypeError("Private accessor was defined without a getter");
      if (typeof e == "function" ? t !== e || !n : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
      return r === "m" ? n : r === "a" ? n.call(t) : n ? n.value : e.get(t)
    },
    ty, VN;
  class tc extends Error {
    get docsBaseUrl() {
      return "https://wagmi.sh/core"
    }
    get version() {
      return gte()
    }
    constructor(e, r = {}) {
      super(), ty.add(this), Object.defineProperty(this, "details", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "docsPath", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "metaMessages", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "shortMessage", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: void 0
      }), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "WagmiCoreError"
      });
      const n = r.cause instanceof tc ? r.cause.details : r.cause?.message ? r.cause.message : r.details,
        i = r.cause instanceof tc && r.cause.docsPath || r.docsPath;
      this.message = [e || "An error occurred.", "", ...r.metaMessages ? [...r.metaMessages, ""] : [], ...i ? [`Docs: ${this.docsBaseUrl}${i}.html${r.docsSlug?`#${r.docsSlug}`:""}`] : [], ...n ? [`Details: ${n}`] : [], `Version: ${this.version}`].join(`
  `), r.cause && (this.cause = r.cause), this.details = n, this.docsPath = i, this.metaMessages = r.metaMessages, this.shortMessage = e
    }
    walk(e) {
      return qN(this, ty, "m", VN).call(this, this, e)
    }
  }
  ty = new WeakSet, VN = function t(e, r) {
    return r?.(e) ? e : e.cause ? qN(this, ty, "m", t).call(this, e.cause, r) : e
  };
  class jd extends tc {
    constructor() {
      super("Chain not configured."), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "ChainNotConfiguredError"
      })
    }
  }
  class mte extends tc {
    constructor() {
      super("Connector already connected."), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "ConnectorAlreadyConnectedError"
      })
    }
  }
  class KN extends tc {
    constructor() {
      super("Connector not connected."), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "ConnectorNotConnectedError"
      })
    }
  }
  class wte extends tc {
    constructor({
      address: e,
      connector: r
    }) {
      super(`Account "${e}" not found for connector "${r.name}".`), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "ConnectorAccountNotFoundError"
      })
    }
  }
  class vte extends tc {
    constructor({
      connectionChainId: e,
      connectorChainId: r
    }) {
      super(`The current chain of the connector (id: ${r}) does not match the connection's chain (id: ${e}).`, {
        metaMessages: [`Current Chain ID:  ${r}`, `Expected Chain ID: ${e}`]
      }), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "ConnectorChainMismatchError"
      })
    }
  }
  class bte extends tc {
    constructor({
      connector: e
    }) {
      super(`Connector "${e.name}" unavailable while reconnecting.`, {
        details: ["During the reconnection step, the only connector methods guaranteed to be available are: `id`, `name`, `type`, `uuid`.", "All other methods are not guaranteed to be available until reconnection completes and connectors are fully restored.", "This error commonly occurs for connectors that asynchronously inject after reconnection has already started."].join(" ")
      }), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "ConnectorUnavailableReconnectingError"
      })
    }
  }
  async function GN(t, e) {
    let r;
    if (typeof e.connector == "function" ? r = t._internal.connectors.setup(e.connector) : r = e.connector, r.uid === t.state.current) throw new mte;
    try {
      t.setState(s => ({
        ...s,
        status: "connecting"
      })), r.emitter.emit("message", {
        type: "connecting"
      });
      const n = await r.connect({
          chainId: e.chainId
        }),
        i = n.accounts;
      return r.emitter.off("connect", t._internal.events.connect), r.emitter.on("change", t._internal.events.change), r.emitter.on("disconnect", t._internal.events.disconnect), await t.storage?.setItem("recentConnectorId", r.id), t.setState(s => ({
        ...s,
        connections: new Map(s.connections).set(r.uid, {
          accounts: i,
          chainId: n.chainId,
          connector: r
        }),
        current: r.uid,
        status: "connected"
      })), {
        accounts: i,
        chainId: n.chainId
      }
    } catch (n) {
      throw t.setState(i => ({
        ...i,
        status: i.current ? "connected" : "disconnected"
      })), n
    }
  }
  const A9 = 256;
  let ry = A9,
    ny;

  function ZN(t = 11) {
    if (!ny || ry + t > A9 * 2) {
      ny = "", ry = 0;
      for (let e = 0; e < A9; e++) ny += (256 + Math.random() * 256 | 0).toString(16).substring(1)
    }
    return ny.substring(ry, ry++ + t)
  }

  function YN(t) {
    const {
      batch: e,
      cacheTime: r = t.pollingInterval ?? 4e3,
      ccipRead: n,
      key: i = "base",
      name: s = "Base Client",
      pollingInterval: o = 4e3,
      type: a = "base"
    } = t, c = t.chain, l = t.account ? Ja(t.account) : void 0, {
      config: h,
      request: f,
      value: w
    } = t.transport({
      chain: c,
      pollingInterval: o
    }), b = {
      ...h,
      ...w
    }, C = {
      account: l,
      batch: e,
      cacheTime: r,
      ccipRead: n,
      chain: c,
      key: i,
      name: s,
      pollingInterval: o,
      request: f,
      transport: b,
      type: a,
      uid: ZN()
    };

    function M(N) {
      return $ => {
        const k = $(N);
        for (const F in C) delete k[F];
        const B = {
          ...N,
          ...k
        };
        return Object.assign(B, {
          extend: M(B)
        })
      }
    }
    return Object.assign(C, {
      extend: M(C)
    })
  }

  function S9({
    key: t,
    name: e,
    request: r,
    retryCount: n = 3,
    retryDelay: i = 150,
    timeout: s,
    type: o
  }, a) {
    const c = ZN();
    return {
      config: {
        key: t,
        name: e,
        request: r,
        retryCount: n,
        retryDelay: i,
        timeout: s,
        type: o
      },
      request: see(r, {
        retryCount: n,
        retryDelay: i,
        uid: c
      }),
      value: a
    }
  }

  function yte(t, e = {}) {
    const {
      key: r = "custom",
      name: n = "Custom Provider",
      retryDelay: i
    } = e;
    return ({
      retryCount: s
    }) => S9({
      key: r,
      name: n,
      request: t.request.bind(t),
      retryCount: e.retryCount ?? s,
      retryDelay: i,
      type: "custom"
    })
  }

  function _te(t, e = {}) {
    const {
      key: r = "fallback",
      name: n = "Fallback",
      rank: i = !1,
      retryCount: s,
      retryDelay: o
    } = e;
    return ({
      chain: a,
      pollingInterval: c = 4e3,
      timeout: l,
      ...h
    }) => {
      let f = t,
        w = () => {};
      const b = S9({
        key: r,
        name: n,
        async request({
          method: C,
          params: M
        }) {
          const N = async ($ = 0) => {
            const k = f[$]({
              ...h,
              chain: a,
              retryCount: 0,
              timeout: l
            });
            try {
              const B = await k.request({
                method: C,
                params: M
              });
              return w({
                method: C,
                params: M,
                response: B,
                transport: k,
                status: "success"
              }), B
            } catch (B) {
              if (w({
                  error: B,
                  method: C,
                  params: M,
                  transport: k,
                  status: "error"
                }), xte(B) || $ === f.length - 1) throw B;
              return N($ + 1)
            }
          };
          return N()
        },
        retryCount: s,
        retryDelay: o,
        type: "fallback"
      }, {
        onResponse: C => w = C,
        transports: f.map(C => C({
          chain: a,
          retryCount: 0
        }))
      });
      if (i) {
        const C = typeof i == "object" ? i : {};
        Cte({
          chain: a,
          interval: C.interval ?? c,
          onTransports: M => f = M,
          sampleCount: C.sampleCount,
          timeout: C.timeout,
          transports: f,
          weights: C.weights
        })
      }
      return b
    }
  }

  function xte(t) {
    return "code" in t && typeof t.code == "number" && (t.code === Xp.code || t.code === on.code || t.code === 5e3)
  }

  function Cte({
    chain: t,
    interval: e = 4e3,
    onTransports: r,
    sampleCount: n = 10,
    timeout: i = 1e3,
    transports: s,
    weights: o = {}
  }) {
    const {
      stability: a = .7,
      latency: c = .3
    } = o, l = [], h = async () => {
      const f = await Promise.all(s.map(async C => {
        const M = C({
            chain: t,
            retryCount: 0,
            timeout: i
          }),
          N = Date.now();
        let $, k;
        try {
          await M.request({
            method: "net_listening"
          }), k = 1
        } catch {
          k = 0
        } finally {
          $ = Date.now()
        }
        return {
          latency: $ - N,
          success: k
        }
      }));
      l.push(f), l.length > n && l.shift();
      const w = Math.max(...l.map(C => Math.max(...C.map(({
          latency: M
        }) => M)))),
        b = s.map((C, M) => {
          const N = l.map(D => D[M].latency),
            k = 1 - N.reduce((D, V) => D + V, 0) / N.length / w,
            B = l.map(D => D[M].success),
            F = B.reduce((D, V) => D + V, 0) / B.length;
          return F === 0 ? [0, M] : [c * k + a * F, M]
        }).sort((C, M) => M[0] - C[0]);
      r(b.map(([, C]) => s[C])), await Z3(e), h()
    };
    h()
  }
  class Ete extends Ye {
    constructor() {
      super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.", {
        docsPath: "/docs/clients/intro",
        name: "UrlRequiredError"
      })
    }
  }

  function iy(t, e = {}) {
    const {
      batch: r,
      fetchOptions: n,
      key: i = "http",
      name: s = "HTTP JSON-RPC",
      onFetchRequest: o,
      onFetchResponse: a,
      retryDelay: c
    } = e;
    return ({
      chain: l,
      retryCount: h,
      timeout: f
    }) => {
      const {
        batchSize: w = 1e3,
        wait: b = 0
      } = typeof r == "object" ? r : {}, C = e.retryCount ?? h, M = f ?? e.timeout ?? 1e4, N = t || l?.rpcUrls.default.http[0];
      if (!N) throw new Ete;
      const $ = wee(N, {
        fetchOptions: n,
        onRequest: o,
        onResponse: a,
        timeout: M
      });
      return S9({
        key: i,
        name: s,
        async request({
          method: k,
          params: B
        }) {
          const F = {
              method: k,
              params: B
            },
            {
              schedule: D
            } = dN({
              id: N,
              wait: b,
              shouldSplitBatch(j) {
                return j.length > w
              },
              fn: j => $.request({
                body: j
              }),
              sort: (j, Y) => j.id - Y.id
            }),
            V = async j => r ? D(j) : [await $.request({
              body: j
            })], [{
              error: R,
              result: P
            }] = await V(F);
          if (R) throw new wR({
            body: F,
            error: R,
            url: N
          });
          return P
        },
        retryCount: C,
        retryDelay: c,
        timeout: M,
        type: "http"
      }, {
        fetchOptions: n,
        url: N
      })
    }
  }
  async function kw(t, e = {}) {
    let r;
    if (e.connector) {
      const {
        connector: l
      } = e;
      if (t.state.status === "reconnecting" && !l.getAccounts && !l.getChainId) throw new bte({
        connector: l
      });
      const [h, f] = await Promise.all([l.getAccounts(), l.getChainId()]);
      r = {
        accounts: h,
        chainId: f,
        connector: l
      }
    } else r = t.state.connections.get(t.state.current);
    if (!r) throw new KN;
    const n = e.chainId ?? r.chainId,
      i = await r.connector.getChainId();
    if (i !== r.chainId) throw new vte({
      connectionChainId: r.chainId,
      connectorChainId: i
    });
    const s = r.connector;
    if (s.getClient) return s.getClient({
      chainId: n
    });
    const o = Ja(e.account ?? r.accounts[0]);
    if (o.address = $i(o.address), e.account && !r.accounts.some(l => l.toLowerCase() === o.address.toLowerCase())) throw new wte({
      address: o.address,
      connector: s
    });
    const a = t.chains.find(l => l.id === n),
      c = await r.connector.getProvider({
        chainId: n
      });
    return YN({
      account: o,
      chain: a,
      name: "Connector Client",
      transport: l => yte(c)({
        ...l,
        retryCount: 0
      })
    })
  }
  async function QN(t, e = {}) {
    let r;
    if (e.connector) r = e.connector;
    else {
      const {
        connections: i,
        current: s
      } = t.state;
      r = i.get(s)?.connector
    }
    const n = t.state.connections;
    r && (await r.disconnect(), r.emitter.off("change", t._internal.events.change), r.emitter.off("disconnect", t._internal.events.disconnect), r.emitter.on("connect", t._internal.events.connect), n.delete(r.uid)), t.setState(i => {
      if (n.size === 0) return {
        ...i,
        connections: new Map,
        current: null,
        status: "disconnected"
      };
      const s = n.values().next().value;
      return {
        ...i,
        connections: new Map(n),
        current: s.connector.uid
      }
    }); {
      const i = t.state.current;
      if (!i) return;
      const s = t.state.connections.get(i)?.connector;
      if (!s) return;
      await t.storage?.setItem("recentConnectorId", s.id)
    }
  }
  async function Ate(t, e) {
    const {
      chainId: r,
      connector: n,
      ...i
    } = e;
    let s;
    e.account ? s = e.account : s = (await kw(t, {
      account: e.account,
      chainId: r,
      connector: n
    })).account;
    const o = t.getClient({
      chainId: r
    });
    return gs(o, F7, "estimateGas")({
      ...i,
      account: s
    })
  }

  function JN(t) {
    return typeof t == "number" ? t : t === "wei" ? 0 : Math.abs(SQ[t])
  }

  function c1(t) {
    const e = t.state.current,
      r = t.state.connections.get(e),
      n = r?.accounts,
      i = n?.[0],
      s = t.chains.find(a => a.id === r?.chainId),
      o = t.state.status;
    switch (o) {
      case "connected":
        return {
          address: i, addresses: n, chain: s, chainId: r?.chainId, connector: r?.connector, isConnected: !0, isConnecting: !1, isDisconnected: !1, isReconnecting: !1, status: o
        };
      case "reconnecting":
        return {
          address: i, addresses: n, chain: s, chainId: r?.chainId, connector: r?.connector, isConnected: !!i, isConnecting: !1, isDisconnected: !1, isReconnecting: !0, status: o
        };
      case "connecting":
        return {
          address: i, addresses: n, chain: s, chainId: r?.chainId, connector: r?.connector, isConnected: !1, isConnecting: !0, isDisconnected: !1, isReconnecting: !1, status: o
        };
      case "disconnected":
        return {
          address: void 0, addresses: void 0, chain: void 0, chainId: void 0, connector: void 0, isConnected: !1, isConnecting: !1, isDisconnected: !0, isReconnecting: !1, status: o
        }
    }
  }
  async function Ste(t, e) {
    const {
      allowFailure: r = !0,
      chainId: n,
      contracts: i,
      ...s
    } = e, o = t.getClient({
      chainId: n
    });
    return gs(o, eee, "multicall")({
      allowFailure: r,
      contracts: i,
      ...s
    })
  }

  function Ite(t, e) {
    const {
      chainId: r,
      ...n
    } = e, i = t.getClient({
      chainId: r
    });
    return gs(i, Cf, "readContract")(n)
  }
  async function Tte(t, e) {
    const {
      allowFailure: r = !0,
      blockNumber: n,
      blockTag: i,
      ...s
    } = e, o = e.contracts;
    try {
      const a = {};
      for (const [f, w] of o.entries()) {
        const b = w.chainId ?? t.state.chainId;
        a[b] || (a[b] = []), a[b]?.push({
          contract: w,
          index: f
        })
      }
      const c = () => Object.entries(a).map(([f, w]) => Ste(t, {
          ...s,
          allowFailure: r,
          blockNumber: n,
          blockTag: i,
          chainId: Number.parseInt(f),
          contracts: w.map(({
            contract: b
          }) => b)
        })),
        l = (await Promise.all(c())).flat(),
        h = Object.values(a).flatMap(f => f.map(({
          index: w
        }) => w));
      return l.reduce((f, w, b) => (f && (f[h[b]] = w), f), [])
    } catch (a) {
      if (a instanceof cN) throw a;
      const c = () => o.map(l => Ite(t, {
        ...l,
        blockNumber: n,
        blockTag: i
      }));
      return r ? (await Promise.allSettled(c())).map(l => l.status === "fulfilled" ? {
        result: l.value,
        status: "success"
      } : {
        error: l.reason,
        result: void 0,
        status: "failure"
      }) : await Promise.all(c())
    }
  }
  async function kte(t, e) {
    const {
      address: r,
      blockNumber: n,
      blockTag: i,
      chainId: s,
      token: o,
      unit: a = "ether"
    } = e;
    if (o) try {
      return await XN(t, {
        balanceAddress: r,
        chainId: s,
        symbolType: "string",
        tokenAddress: o
      })
    } catch (w) {
      if (w.name === "ContractFunctionExecutionError") {
        const b = await XN(t, {
            balanceAddress: r,
            chainId: s,
            symbolType: "bytes32",
            tokenAddress: o
          }),
          C = Wk(Hp(b.symbol, {
            dir: "right"
          }));
        return {
          ...b,
          symbol: C
        }
      }
      throw w
    }
    const c = t.getClient({
        chainId: s
      }),
      h = await gs(c, TR, "getBalance")(n ? {
        address: r,
        blockNumber: n
      } : {
        address: r,
        blockTag: i
      }),
      f = t.chains.find(w => w.id === s) ?? c.chain;
    return {
      decimals: f.nativeCurrency.decimals,
      formatted: iw(h, JN(a)),
      symbol: f.nativeCurrency.symbol,
      value: h
    }
  }
  async function XN(t, e) {
    const {
      balanceAddress: r,
      chainId: n,
      symbolType: i,
      tokenAddress: s,
      unit: o
    } = e, a = {
      abi: [{
        type: "function",
        name: "balanceOf",
        stateMutability: "view",
        inputs: [{
          type: "address"
        }],
        outputs: [{
          type: "uint256"
        }]
      }, {
        type: "function",
        name: "decimals",
        stateMutability: "view",
        inputs: [],
        outputs: [{
          type: "uint8"
        }]
      }, {
        type: "function",
        name: "symbol",
        stateMutability: "view",
        inputs: [],
        outputs: [{
          type: i
        }]
      }],
      address: s
    }, [c, l, h] = await Tte(t, {
      allowFailure: !1,
      contracts: [{
        ...a,
        functionName: "balanceOf",
        args: [r],
        chainId: n
      }, {
        ...a,
        functionName: "decimals",
        chainId: n
      }, {
        ...a,
        functionName: "symbol",
        chainId: n
      }]
    }), f = iw(c ?? "0", JN(o ?? l));
    return {
      decimals: l,
      formatted: f,
      symbol: h,
      value: c
    }
  }

  function sy(t, e) {
    if (t === e) return !0;
    if (t && e && typeof t == "object" && typeof e == "object") {
      if (t.constructor !== e.constructor) return !1;
      let r, n;
      if (Array.isArray(t) && Array.isArray(e)) {
        if (r = t.length, r !== e.length) return !1;
        for (n = r; n-- !== 0;)
          if (!sy(t[n], e[n])) return !1;
        return !0
      }
      if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === e.valueOf();
      if (t.toString !== Object.prototype.toString) return t.toString() === e.toString();
      const i = Object.keys(t);
      if (r = i.length, r !== Object.keys(e).length) return !1;
      for (n = r; n-- !== 0;)
        if (!Object.prototype.hasOwnProperty.call(e, i[n])) return !1;
      for (n = r; n-- !== 0;) {
        const s = i[n];
        if (s && !sy(t[s], e[s])) return !1
      }
      return !0
    }
    return t !== t && e !== e
  }
  let oy = [];

  function ay(t) {
    const e = [...t.state.connections.values()];
    return t.state.status === "reconnecting" || sy(oy, e) ? oy : (oy = e, e)
  }

  function Rte(t, e) {
    const {
      chainId: r,
      ...n
    } = e, i = t.getClient({
      chainId: r
    });
    return gs(i, TX, "getEnsAddress")(n)
  }

  function eM(t, e) {
    const {
      chainId: r,
      ...n
    } = e, i = t.getClient({
      chainId: r
    });
    return gs(i, WX, "getEnsAvatar")(n)
  }

  function Nte(t, e) {
    const {
      chainId: r,
      ...n
    } = e, i = t.getClient({
      chainId: r
    });
    return gs(i, zX, "getEnsName")(n)
  }
  async function Mte(t, e) {
    const {
      account: r,
      chainId: n,
      ...i
    } = e, s = r ?? c1(t).address, o = t.getClient({
      chainId: n
    });
    return gs(o, H7, "prepareTransactionRequest")({
      ...i,
      ...s ? {
        account: s
      } : {}
    })
  }
  let I9 = !1;
  async function Pte(t, e = {}) {
    if (I9) return [];
    I9 = !0, t.setState(l => ({
      ...l,
      status: l.current ? "reconnecting" : "connecting"
    }));
    const r = [];
    if (e.connectors?.length)
      for (const l of e.connectors) {
        let h;
        typeof l == "function" ? h = t._internal.connectors.setup(l) : h = l, r.push(h)
      } else r.push(...t.connectors);
    let n;
    try {
      n = await t.storage?.getItem("recentConnectorId")
    } catch {}
    const i = {};
    for (const [, l] of t.state.connections) i[l.connector.id] = 1;
    n && (i[n] = 0);
    const s = Object.keys(i).length > 0 ? [...r].sort((l, h) => (i[l.id] ?? 10) - (i[h.id] ?? 10)) : r;
    let o = !1;
    const a = [],
      c = [];
    for (const l of s) {
      const h = await l.getProvider().catch(() => {});
      if (!h || c.some(b => b === h) || !await l.isAuthorized()) continue;
      const w = await l.connect({
        isReconnecting: !0
      }).catch(() => null);
      w && (l.emitter.off("connect", t._internal.events.connect), l.emitter.on("change", t._internal.events.change), l.emitter.on("disconnect", t._internal.events.disconnect), t.setState(b => {
        const C = new Map(o ? b.connections : new Map).set(l.uid, {
          accounts: w.accounts,
          chainId: w.chainId,
          connector: l
        });
        return {
          ...b,
          current: o ? b.current : l.uid,
          connections: C
        }
      }), a.push({
        accounts: w.accounts,
        chainId: w.chainId,
        connector: l
      }), c.push(h), o = !0)
    }
    return (t.state.status === "reconnecting" || t.state.status === "connecting") && (o ? t.setState(l => ({
      ...l,
      status: "connected"
    })) : t.setState(l => ({
      ...l,
      connections: new Map,
      current: null,
      status: "disconnected"
    }))), I9 = !1, a
  }
  async function $te(t, e) {
    const {
      account: r,
      chainId: n,
      connector: i,
      gas: s,
      ...o
    } = e;
    let a;
    typeof r == "object" && r?.type === "local" ? a = t.getClient({
      chainId: n
    }) : a = await kw(t, {
      account: r ?? void 0,
      chainId: n,
      connector: i
    });
    const {
      connector: c
    } = c1(t), l = await (async () => {
      if (!(!("data" in e) || !e.data) && !(i ?? c)?.supportsSimulation && s !== null) return s === void 0 ? gs(a, F7, "estimateGas")({
        ...o,
        account: r,
        chain: n ? {
          id: n
        } : null
      }) : s
    })();
    return await gs(a, DR, "sendTransaction")({
      ...o,
      ...r ? {
        account: r
      } : {},
      gas: l,
      chain: n ? {
        id: n
      } : null
    })
  }
  async function Ote(t, e) {
    const {
      account: r,
      connector: n,
      ...i
    } = e;
    let s;
    return typeof r == "object" && r.type === "local" ? s = t.getClient() : s = await kw(t, {
      account: r,
      connector: n
    }), gs(s, Pee, "signMessage")({
      ...i,
      ...r ? {
        account: r
      } : {}
    })
  }
  async function Dte(t, e) {
    const {
      abi: r,
      chainId: n,
      connector: i,
      ...s
    } = e;
    let o;
    e.account ? o = e.account : o = (await kw(t, {
      chainId: n,
      connector: i
    })).account;
    const a = t.getClient({
        chainId: n
      }),
      c = gs(a, $ee, "simulateContract"),
      {
        result: l,
        request: h
      } = await c({
        ...s,
        abi: r,
        account: o
      });
    return {
      chainId: a.chain.id,
      result: l,
      request: {
        __mode: "prepared",
        ...h,
        chainId: n
      }
    }
  }
  async function Lte(t, e) {
    const {
      connector: r
    } = e, n = t.state.connections.get(r.uid);
    if (!n) throw new KN;
    return await t.storage?.setItem("recentConnectorId", r.id), t.setState(i => ({
      ...i,
      current: r.uid
    })), {
      accounts: n.accounts,
      chainId: n.chainId
    }
  }
  class no extends tc {
    constructor() {
      super("Provider not found."), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "ProviderNotFoundError"
      })
    }
  }
  class Bte extends tc {
    constructor({
      connector: e
    }) {
      super(`"${e.name}" does not support programmatic chain switching.`), Object.defineProperty(this, "name", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: "SwitchChainNotSupportedError"
      })
    }
  }
  async function Ute(t, e) {
    const {
      addEthereumChainParameter: r,
      chainId: n
    } = e, i = t.state.connections.get(e.connector?.uid ?? t.state.current);
    if (i) {
      const o = i.connector;
      if (!o.switchChain) throw new Bte({
        connector: o
      });
      return await o.switchChain({
        addEthereumChainParameter: r,
        chainId: n
      })
    }
    const s = t.chains.find(o => o.id === n);
    if (!s) throw new jd;
    return t.setState(o => ({
      ...o,
      chainId: n
    })), s
  }

  function jte(t, e) {
    const {
      onChange: r
    } = e;
    return t.subscribe(() => c1(t), r, {
      equalityFn(n, i) {
        const {
          connector: s,
          ...o
        } = n, {
          connector: a,
          ...c
        } = i;
        return sy(o, c) && s?.id === a?.id && s?.uid === a?.uid
      }
    })
  }

  function Fte(t, e) {
    const {
      onChange: r
    } = e;
    return t._internal.connectors.subscribe((n, i) => {
      r(Object.values(n), i)
    })
  }
  async function Wte(t, e) {
    const {
      chainId: r,
      timeout: n = 0,
      ...i
    } = e, s = t.getClient({
      chainId: r
    }), a = await gs(s, Mee, "waitForTransactionReceipt")({
      ...i,
      timeout: n
    });
    if (a.status === "reverted") {
      const l = await gs(s, gN, "getTransaction")({
          hash: a.transactionHash
        }),
        f = await gs(s, G3, "call")({
          ...l,
          data: l.input,
          gasPrice: l.type !== "eip1559" ? l.gasPrice : void 0,
          maxFeePerGas: l.type === "eip1559" ? l.maxFeePerGas : void 0,
          maxPriorityFeePerGas: l.type === "eip1559" ? l.maxPriorityFeePerGas : void 0
        }),
        w = f?.data ? Wk(`0x${f.data.substring(138)}`) : "unknown reason";
      throw new Error(w)
    }
    return {
      ...a,
      chainId: s.chain.id
    }
  }
  async function zte(t, e) {
    const {
      account: r,
      chainId: n,
      connector: i,
      __mode: s,
      ...o
    } = e;
    let a;
    typeof r == "object" && r?.type === "local" ? a = t.getClient({
      chainId: n
    }) : a = await kw(t, {
      account: r ?? void 0,
      chainId: n,
      connector: i
    });
    const {
      connector: c
    } = c1(t);
    let l;
    if (s === "prepared" || c?.supportsSimulation) l = o;
    else {
      const {
        request: w
      } = await Dte(t, {
        ...o,
        account: r,
        chainId: n
      });
      l = w
    }
    return await gs(a, pte, "writeContract")({
      ...l,
      ...r ? {
        account: r
      } : {},
      chain: n ? {
        id: n
      } : null
    })
  }

  function Hte(t) {
    return t
  }
  const qte = /(rabby|trustwallet)/;
  Rw.type = "injected";

  function Rw(t = {}) {
    const {
      shimDisconnect: e = !0,
      unstable_shimAsyncInject: r
    } = t;

    function n() {
      const c = t.target;
      if (typeof c == "function") {
        const l = c();
        if (l) return l
      }
      return typeof c == "object" ? c : typeof c == "string" ? {
        ...Vte[c] ?? {
          id: c,
          name: `${c[0].toUpperCase()}${c.slice(1)}`,
          provider: `is${c[0].toUpperCase()}${c.slice(1)}`
        }
      } : {
        id: "injected",
        name: "Injected",
        provider(l) {
          return l?.ethereum
        }
      }
    }
    let i, s, o, a;
    return c => ({
      get icon() {
        return n().icon
      },
      get id() {
        return n().id
      },
      get name() {
        return n().name
      },
      get supportsSimulation() {
        return qte.test(this.id.toLowerCase())
      },
      type: Rw.type,
      async setup() {
        const l = await this.getProvider();
        l?.on && t.target && (o || (o = this.onConnect.bind(this), l.on("connect", o)), i || (i = this.onAccountsChanged.bind(this), l.on("accountsChanged", i)))
      },
      async connect({
        chainId: l,
        isReconnecting: h
      } = {}) {
        const f = await this.getProvider();
        if (!f) throw new no;
        let w = [];
        if (h) w = await this.getAccounts().catch(() => []);
        else if (e) try {
          w = (await f.request({
            method: "wallet_requestPermissions",
            params: [{
              eth_accounts: {}
            }]
          }))[0]?.caveats?.[0]?.value?.map(C => $i(C)), w.length > 0 && (w = await this.getAccounts())
        } catch (b) {
          const C = b;
          if (C.code === on.code) throw new on(C);
          if (C.code === Dd.code) throw C
        }
        try {
          !w?.length && !h && (w = (await f.request({
            method: "eth_requestAccounts"
          })).map(M => $i(M))), o && (f.removeListener("connect", o), o = void 0), i || (i = this.onAccountsChanged.bind(this), f.on("accountsChanged", i)), s || (s = this.onChainChanged.bind(this), f.on("chainChanged", s)), a || (a = this.onDisconnect.bind(this), f.on("disconnect", a));
          let b = await this.getChainId();
          return l && b !== l && (b = (await this.switchChain({
            chainId: l
          }).catch(M => {
            if (M.code === on.code) throw M;
            return {
              id: b
            }
          }))?.id ?? b), e && await c.storage?.removeItem(`${this.id}.disconnected`), t.target || await c.storage?.setItem("injected.connected", !0), {
            accounts: w,
            chainId: b
          }
        } catch (b) {
          const C = b;
          throw C.code === on.code ? new on(C) : C.code === Dd.code ? new Dd(C) : C
        }
      },
      async disconnect() {
        const l = await this.getProvider();
        if (!l) throw new no;
        s && (l.removeListener("chainChanged", s), s = void 0), a && (l.removeListener("disconnect", a), a = void 0), o || (o = this.onConnect.bind(this), l.on("connect", o));
        try {
          await u9(() => l.request({
            method: "wallet_revokePermissions",
            params: [{
              eth_accounts: {}
            }]
          }), {
            timeout: 100
          })
        } catch {}
        e && await c.storage?.setItem(`${this.id}.disconnected`, !0), t.target || await c.storage?.removeItem("injected.connected")
      },
      async getAccounts() {
        const l = await this.getProvider();
        if (!l) throw new no;
        return (await l.request({
          method: "eth_accounts"
        })).map(f => $i(f))
      },
      async getChainId() {
        const l = await this.getProvider();
        if (!l) throw new no;
        const h = await l.request({
          method: "eth_chainId"
        });
        return Number(h)
      },
      async getProvider() {
        if (typeof window > "u") return;
        let l;
        const h = n();
        return typeof h.provider == "function" ? l = h.provider(window) : typeof h.provider == "string" ? l = cy(window, h.provider) : l = h.provider, l && !l.removeListener && ("off" in l && typeof l.off == "function" ? l.removeListener = l.off : l.removeListener = () => {}), l
      },
      async isAuthorized() {
        try {
          if (e && await c.storage?.getItem(`${this.id}.disconnected`) || !t.target && !await c.storage?.getItem("injected.connected")) return !1;
          if (!await this.getProvider()) {
            if (r !== void 0 && r !== !1) {
              const w = async () => (typeof window < "u" && window.removeEventListener("ethereum#initialized", w), !!await this.getProvider()), b = typeof r == "number" ? r : 1e3;
              if (await Promise.race([...typeof window < "u" ? [new Promise(M => window.addEventListener("ethereum#initialized", () => M(w()), {
                  once: !0
                }))] : [], new Promise(M => setTimeout(() => M(w()), b))])) return !0
            }
            throw new no
          }
          return !!(await Q3(() => this.getAccounts())).length
        } catch {
          return !1
        }
      },
      async switchChain({
        addEthereumChainParameter: l,
        chainId: h
      }) {
        const f = await this.getProvider();
        if (!f) throw new no;
        const w = c.chains.find(C => C.id === h);
        if (!w) throw new Rs(new jd);
        const b = new Promise(C => {
          const M = N => {
            "chainId" in N && N.chainId === h && (c.emitter.off("change", M), C())
          };
          c.emitter.on("change", M)
        });
        try {
          return await Promise.all([f.request({
            method: "wallet_switchEthereumChain",
            params: [{
              chainId: lr(h)
            }]
          }).then(async () => {
            await this.getChainId() === h && c.emitter.emit("change", {
              chainId: h
            })
          }), b]), w
        } catch (C) {
          const M = C;
          if (M.code === 4902 || M?.data?.originalError?.code === 4902) try {
            const {
              default: N,
              ...$
            } = w.blockExplorers ?? {};
            let k;
            l?.blockExplorerUrls ? k = l.blockExplorerUrls : N && (k = [N.url, ...Object.values($).map(D => D.url)]);
            let B;
            l?.rpcUrls?.length ? B = l.rpcUrls : B = [w.rpcUrls.default?.http[0] ?? ""];
            const F = {
              blockExplorerUrls: k,
              chainId: lr(h),
              chainName: l?.chainName ?? w.name,
              iconUrls: l?.iconUrls,
              nativeCurrency: l?.nativeCurrency ?? w.nativeCurrency,
              rpcUrls: B
            };
            return await Promise.all([f.request({
              method: "wallet_addEthereumChain",
              params: [F]
            }).then(async () => {
              if (await this.getChainId() === h) c.emitter.emit("change", {
                chainId: h
              });
              else throw new on(new Error("User rejected switch after adding network."))
            }), b]), w
          } catch (N) {
            throw new on(N)
          }
          throw M.code === on.code ? new on(M) : new Rs(M)
        }
      },
      async onAccountsChanged(l) {
        if (l.length === 0) this.onDisconnect();
        else if (c.emitter.listenerCount("connect")) {
          const h = (await this.getChainId()).toString();
          this.onConnect({
            chainId: h
          }), e && await c.storage?.removeItem(`${this.id}.disconnected`)
        } else c.emitter.emit("change", {
          accounts: l.map(h => $i(h))
        })
      },
      onChainChanged(l) {
        const h = Number(l);
        c.emitter.emit("change", {
          chainId: h
        })
      },
      async onConnect(l) {
        const h = await this.getAccounts();
        if (h.length === 0) return;
        const f = Number(l.chainId);
        c.emitter.emit("connect", {
          accounts: h,
          chainId: f
        });
        const w = await this.getProvider();
        w && (o && (w.removeListener("connect", o), o = void 0), i || (i = this.onAccountsChanged.bind(this), w.on("accountsChanged", i)), s || (s = this.onChainChanged.bind(this), w.on("chainChanged", s)), a || (a = this.onDisconnect.bind(this), w.on("disconnect", a)))
      },
      async onDisconnect(l) {
        const h = await this.getProvider();
        l && l.code === 1013 && h && (await this.getAccounts()).length || (c.emitter.emit("disconnect"), h && (s && (h.removeListener("chainChanged", s), s = void 0), a && (h.removeListener("disconnect", a), a = void 0), o || (o = this.onConnect.bind(this), h.on("connect", o))))
      }
    })
  }
  const Vte = {
    coinbaseWallet: {
      id: "coinbaseWallet",
      name: "Coinbase Wallet",
      provider(t) {
        return t?.coinbaseWalletExtension ? t.coinbaseWalletExtension : cy(t, "isCoinbaseWallet")
      }
    },
    metaMask: {
      id: "metaMask",
      name: "MetaMask",
      provider(t) {
        return cy(t, e => {
          if (!e.isMetaMask || e.isBraveWallet && !e._events && !e._state) return !1;
          const r = ["isApexWallet", "isAvalanche", "isBitKeep", "isBlockWallet", "isKuCoinWallet", "isMathWallet", "isOkxWallet", "isOKExWallet", "isOneInchIOSWallet", "isOneInchAndroidWallet", "isOpera", "isPortal", "isRabby", "isTokenPocket", "isTokenary", "isUniswapWallet", "isZerion"];
          for (const n of r)
            if (e[n]) return !1;
          return !0
        })
      }
    },
    phantom: {
      id: "phantom",
      name: "Phantom",
      provider(t) {
        return t?.phantom?.ethereum ? t.phantom?.ethereum : cy(t, "isPhantom")
      }
    }
  };

  function cy(t, e) {
    function r(i) {
      return typeof e == "function" ? e(i) : typeof e == "string" ? i[e] : !0
    }
    const n = t.ethereum;
    if (n?.providers) return n.providers.find(i => r(i));
    if (n && r(n)) return n
  }

  function Kte(t) {
    if (typeof window > "u") return;
    const e = r => t(r.detail);
    return window.addEventListener("eip6963:announceProvider", e), window.dispatchEvent(new CustomEvent("eip6963:requestProvider")), () => window.removeEventListener("eip6963:announceProvider", e)
  }

  function Gte() {
    const t = new Set;
    let e = [];
    const r = () => Kte(i => {
      e.some(({
        info: s
      }) => s.uuid === i.info.uuid) || (e = [...e, i], t.forEach(s => s(e, {
        added: [i]
      })))
    });
    let n = r();
    return {
      _listeners() {
        return t
      },
      clear() {
        t.forEach(i => i([], {
          removed: [...e]
        })), e = []
      },
      destroy() {
        this.clear(), t.clear(), n?.()
      },
      findProvider({
        rdns: i
      }) {
        return e.find(s => s.info.rdns === i)
      },
      getProviders() {
        return e
      },
      reset() {
        this.clear(), n?.(), n = r()
      },
      subscribe(i, {
        emitImmediately: s
      } = {}) {
        return t.add(i), s && i(e, {
          added: e
        }), () => t.delete(i)
      }
    }
  }
  const Zte = t => (e, r, n) => {
    const i = n.subscribe;
    return n.subscribe = (o, a, c) => {
      let l = o;
      if (a) {
        const h = c?.equalityFn || Object.is;
        let f = o(n.getState());
        l = w => {
          const b = o(w);
          if (!h(f, b)) {
            const C = f;
            a(f = b, C)
          }
        }, c?.fireImmediately && a(f, f)
      }
      return i(l)
    }, t(e, r, n)
  };

  function Yte(t, e) {
    let r;
    try {
      r = t()
    } catch {
      return
    }
    return {
      getItem: i => {
        var s;
        const o = c => c === null ? null : JSON.parse(c, void 0),
          a = (s = r.getItem(i)) != null ? s : null;
        return a instanceof Promise ? a.then(o) : o(a)
      },
      setItem: (i, s) => r.setItem(i, JSON.stringify(s, void 0)),
      removeItem: i => r.removeItem(i)
    }
  }
  const T9 = t => e => {
      try {
        const r = t(e);
        return r instanceof Promise ? r : {
          then(n) {
            return T9(n)(r)
          },
          catch (n) {
            return this
          }
        }
      } catch (r) {
        return {
          then(n) {
            return this
          },
          catch (n) {
            return T9(n)(r)
          }
        }
      }
    },
    Qte = (t, e) => (r, n, i) => {
      let s = {
          storage: Yte(() => localStorage),
          partialize: M => M,
          version: 0,
          merge: (M, N) => ({
            ...N,
            ...M
          }),
          ...e
        },
        o = !1;
      const a = new Set,
        c = new Set;
      let l = s.storage;
      if (!l) return t((...M) => {
        console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`), r(...M)
      }, n, i);
      const h = () => {
          const M = s.partialize({
            ...n()
          });
          return l.setItem(s.name, {
            state: M,
            version: s.version
          })
        },
        f = i.setState;
      i.setState = (M, N) => {
        f(M, N), h()
      };
      const w = t((...M) => {
        r(...M), h()
      }, n, i);
      i.getInitialState = () => w;
      let b;
      const C = () => {
        var M, N;
        if (!l) return;
        o = !1, a.forEach(k => {
          var B;
          return k((B = n()) != null ? B : w)
        });
        const $ = ((N = s.onRehydrateStorage) == null ? void 0 : N.call(s, (M = n()) != null ? M : w)) || void 0;
        return T9(l.getItem.bind(l))(s.name).then(k => {
          if (k)
            if (typeof k.version == "number" && k.version !== s.version) {
              if (s.migrate) return [!0, s.migrate(k.state, k.version)];
              console.error("State loaded from storage couldn't be migrated since no migrate function was provided")
            } else return [!1, k.state];
          return [!1, void 0]
        }).then(k => {
          var B;
          const [F, D] = k;
          if (b = s.merge(D, (B = n()) != null ? B : w), r(b, !0), F) return h()
        }).then(() => {
          $?.(b, void 0), b = n(), o = !0, c.forEach(k => k(b))
        }).catch(k => {
          $?.(void 0, k)
        })
      };
      return i.persist = {
        setOptions: M => {
          s = {
            ...s,
            ...M
          }, M.storage && (l = M.storage)
        },
        clearStorage: () => {
          l?.removeItem(s.name)
        },
        getOptions: () => s,
        rehydrate: () => C(),
        hasHydrated: () => o,
        onHydrate: M => (a.add(M), () => {
          a.delete(M)
        }),
        onFinishHydration: M => (c.add(M), () => {
          c.delete(M)
        })
      }, s.skipHydration || C(), b || w
    },
    tM = t => {
      let e;
      const r = new Set,
        n = (l, h) => {
          const f = typeof l == "function" ? l(e) : l;
          if (!Object.is(f, e)) {
            const w = e;
            e = h ?? (typeof f != "object" || f === null) ? f : Object.assign({}, e, f), r.forEach(b => b(e, w))
          }
        },
        i = () => e,
        a = {
          setState: n,
          getState: i,
          getInitialState: () => c,
          subscribe: l => (r.add(l), () => r.delete(l))
        },
        c = e = t(n, i, a);
      return a
    },
    k9 = t => t ? tM(t) : tM;
  var rM = {
    exports: {}
  };
  (function (t) {
    var e = Object.prototype.hasOwnProperty,
      r = "~";

    function n() {}
    Object.create && (n.prototype = Object.create(null), new n().__proto__ || (r = !1));

    function i(c, l, h) {
      this.fn = c, this.context = l, this.once = h || !1
    }

    function s(c, l, h, f, w) {
      if (typeof h != "function") throw new TypeError("The listener must be a function");
      var b = new i(h, f || c, w),
        C = r ? r + l : l;
      return c._events[C] ? c._events[C].fn ? c._events[C] = [c._events[C], b] : c._events[C].push(b) : (c._events[C] = b, c._eventsCount++), c
    }

    function o(c, l) {
      --c._eventsCount === 0 ? c._events = new n : delete c._events[l]
    }

    function a() {
      this._events = new n, this._eventsCount = 0
    }
    a.prototype.eventNames = function () {
      var l = [],
        h, f;
      if (this._eventsCount === 0) return l;
      for (f in h = this._events) e.call(h, f) && l.push(r ? f.slice(1) : f);
      return Object.getOwnPropertySymbols ? l.concat(Object.getOwnPropertySymbols(h)) : l
    }, a.prototype.listeners = function (l) {
      var h = r ? r + l : l,
        f = this._events[h];
      if (!f) return [];
      if (f.fn) return [f.fn];
      for (var w = 0, b = f.length, C = new Array(b); w < b; w++) C[w] = f[w].fn;
      return C
    }, a.prototype.listenerCount = function (l) {
      var h = r ? r + l : l,
        f = this._events[h];
      return f ? f.fn ? 1 : f.length : 0
    }, a.prototype.emit = function (l, h, f, w, b, C) {
      var M = r ? r + l : l;
      if (!this._events[M]) return !1;
      var N = this._events[M],
        $ = arguments.length,
        k, B;
      if (N.fn) {
        switch (N.once && this.removeListener(l, N.fn, void 0, !0), $) {
          case 1:
            return N.fn.call(N.context), !0;
          case 2:
            return N.fn.call(N.context, h), !0;
          case 3:
            return N.fn.call(N.context, h, f), !0;
          case 4:
            return N.fn.call(N.context, h, f, w), !0;
          case 5:
            return N.fn.call(N.context, h, f, w, b), !0;
          case 6:
            return N.fn.call(N.context, h, f, w, b, C), !0
        }
        for (B = 1, k = new Array($ - 1); B < $; B++) k[B - 1] = arguments[B];
        N.fn.apply(N.context, k)
      } else {
        var F = N.length,
          D;
        for (B = 0; B < F; B++) switch (N[B].once && this.removeListener(l, N[B].fn, void 0, !0), $) {
          case 1:
            N[B].fn.call(N[B].context);
            break;
          case 2:
            N[B].fn.call(N[B].context, h);
            break;
          case 3:
            N[B].fn.call(N[B].context, h, f);
            break;
          case 4:
            N[B].fn.call(N[B].context, h, f, w);
            break;
          default:
            if (!k)
              for (D = 1, k = new Array($ - 1); D < $; D++) k[D - 1] = arguments[D];
            N[B].fn.apply(N[B].context, k)
        }
      }
      return !0
    }, a.prototype.on = function (l, h, f) {
      return s(this, l, h, f, !1)
    }, a.prototype.once = function (l, h, f) {
      return s(this, l, h, f, !0)
    }, a.prototype.removeListener = function (l, h, f, w) {
      var b = r ? r + l : l;
      if (!this._events[b]) return this;
      if (!h) return o(this, b), this;
      var C = this._events[b];
      if (C.fn) C.fn === h && (!w || C.once) && (!f || C.context === f) && o(this, b);
      else {
        for (var M = 0, N = [], $ = C.length; M < $; M++)(C[M].fn !== h || w && !C[M].once || f && C[M].context !== f) && N.push(C[M]);
        N.length ? this._events[b] = N.length === 1 ? N[0] : N : o(this, b)
      }
      return this
    }, a.prototype.removeAllListeners = function (l) {
      var h;
      return l ? (h = r ? r + l : l, this._events[h] && o(this, h)) : (this._events = new n, this._eventsCount = 0), this
    }, a.prototype.off = a.prototype.removeListener, a.prototype.addListener = a.prototype.on, a.prefixed = r, a.EventEmitter = a, t.exports = a
  })(rM);
  var Jte = rM.exports;
  const ly = Za(Jte),
    Xte = Object.freeze(Object.defineProperty({
      __proto__: null,
      EventEmitter: ly,
      default: ly
    }, Symbol.toStringTag, {
      value: "Module"
    }));
  class ere {
    constructor(e) {
      Object.defineProperty(this, "uid", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: e
      }), Object.defineProperty(this, "_emitter", {
        enumerable: !0,
        configurable: !0,
        writable: !0,
        value: new ly
      })
    }
    on(e, r) {
      this._emitter.on(e, r)
    }
    once(e, r) {
      this._emitter.once(e, r)
    }
    off(e, r) {
      this._emitter.off(e, r)
    }
    emit(e, ...r) {
      const n = r[0];
      this._emitter.emit(e, {
        uid: this.uid,
        ...n
      })
    }
    listenerCount(e) {
      return this._emitter.listenerCount(e)
    }
  }

  function tre(t) {
    return new ere(t)
  }

  function rre(t, e) {
    return JSON.parse(t, (r, n) => {
      let i = n;
      return i?.__type === "bigint" && (i = BigInt(i.value)), i?.__type === "Map" && (i = new Map(i.value)), e?.(r, i) ?? i
    })
  }

  function nM(t, e) {
    return t.slice(0, e).join(".") || "."
  }

  function iM(t, e) {
    const {
      length: r
    } = t;
    for (let n = 0; n < r; ++n)
      if (t[n] === e) return n + 1;
    return 0
  }

  function nre(t, e) {
    const r = typeof t == "function",
      n = typeof e == "function",
      i = [],
      s = [];
    return function (a, c) {
      if (typeof c == "object")
        if (i.length) {
          const l = iM(i, this);
          l === 0 ? i[i.length] = this : (i.splice(l), s.splice(l)), s[s.length] = a;
          const h = iM(i, c);
          if (h !== 0) return n ? e.call(this, a, c, nM(s, h)) : `[ref=${nM(s,h)}]`
        } else i[0] = c, s[0] = a;
      return r ? t.call(this, a, c) : c
    }
  }

  function ire(t, e, r, n) {
    return JSON.stringify(t, nre((i, s) => {
      let o = s;
      return typeof o == "bigint" && (o = {
        __type: "bigint",
        value: s.toString()
      }), o instanceof Map && (o = {
        __type: "Map",
        value: Array.from(s.entries())
      }), e?.(i, o) ?? o
    }, n), r ?? void 0)
  }

  function sre(t) {
    const {
      deserialize: e = rre,
      key: r = "wagmi",
      serialize: n = ire,
      storage: i = sM
    } = t;

    function s(o) {
      return o instanceof Promise ? o.then(a => a).catch(() => null) : o
    }
    return {
      ...i,
      key: r,
      async getItem(o, a) {
        const c = i.getItem(`${r}.${o}`),
          l = await s(c);
        return l ? e(l) ?? null : a ?? null
      },
      async setItem(o, a) {
        const c = `${r}.${o}`;
        a === null ? await s(i.removeItem(c)) : await s(i.setItem(c, n(a)))
      },
      async removeItem(o) {
        await s(i.removeItem(`${r}.${o}`))
      }
    }
  }
  const sM = {
      getItem: () => null,
      setItem: () => {},
      removeItem: () => {}
    },
    R9 = 256;
  let uy = R9,
    dy;

  function ore(t = 11) {
    if (!dy || uy + t > R9 * 2) {
      dy = "", uy = 0;
      for (let e = 0; e < R9; e++) dy += (256 + Math.random() * 256 | 0).toString(16).substring(1)
    }
    return dy.substring(uy, uy++ + t)
  }

  function oM(t) {
    const {
      multiInjectedProviderDiscovery: e = !0,
      storage: r = sre({
        storage: typeof window < "u" && window.localStorage ? window.localStorage : sM
      }),
      syncConnectedChain: n = !0,
      ssr: i = !1,
      ...s
    } = t, o = typeof window < "u" && e ? Gte() : void 0, a = k9(() => s.chains), c = k9(() => {
      const D = [],
        V = new Set;
      for (const R of s.connectors ?? []) {
        const P = l(R);
        D.push(P), !i && P.rdns && V.add(P.rdns)
      }
      if (!i && o) {
        const R = o.getProviders();
        for (const P of R) V.has(P.info.rdns) || D.push(l(h(P)))
      }
      return D
    });

    function l(D) {
      const V = tre(ore()),
        R = {
          ...D({
            emitter: V,
            chains: a.getState(),
            storage: r,
            transports: s.transports
          }),
          emitter: V,
          uid: V.uid
        };
      return V.on("connect", B), R.setup?.(), R
    }

    function h(D) {
      const {
        info: V
      } = D, R = D.provider;
      return Rw({
        target: {
          ...V,
          id: V.rdns,
          provider: R
        }
      })
    }
    const f = new Map;

    function w(D = {}) {
      const V = D.chainId ?? N.getState().chainId,
        R = a.getState().find(j => j.id === V);
      if (D.chainId && !R) throw new jd; {
        const j = f.get(N.getState().chainId);
        if (j && !R) return j;
        if (!R) throw new jd
      } {
        const j = f.get(V);
        if (j) return j
      }
      let P;
      if (s.client) P = s.client({
        chain: R
      });
      else {
        const j = R.id,
          Y = a.getState().map(g => g.id),
          U = {},
          I = Object.entries(s);
        for (const [g, u] of I)
          if (!(g === "chains" || g === "client" || g === "connectors" || g === "transports"))
            if (typeof u == "object")
              if (j in u) U[g] = u[j];
              else {
                if (Y.some(v => v in u)) continue;
                U[g] = u
              }
        else U[g] = u;
        P = YN({
          ...U,
          chain: R,
          batch: U.batch ?? {
            multicall: !0
          },
          transport: g => s.transports[j]({
            ...g,
            connectors: c
          })
        })
      }
      return f.set(V, P), P
    }

    function b() {
      return {
        chainId: a.getState()[0].id,
        connections: new Map,
        current: null,
        status: "disconnected"
      }
    }
    let C;
    const M = "0.0.0-canary-";
    ey.startsWith(M) ? C = Number.parseInt(ey.replace(M, "")) : C = Number.parseInt(ey.split(".")[0] ?? "0");
    const N = k9(Zte(r ? Qte(b, {
      migrate(D, V) {
        if (V === C) return D;
        const R = b(),
          P = $(D, R.chainId);
        return {
          ...R,
          chainId: P
        }
      },
      name: "store",
      partialize(D) {
        return {
          connections: {
            __type: "Map",
            value: Array.from(D.connections.entries()).map(([V, R]) => {
              const {
                id: P,
                name: j,
                type: Y,
                uid: U
              } = R.connector;
              return [V, {
                ...R,
                connector: {
                  id: P,
                  name: j,
                  type: Y,
                  uid: U
                }
              }]
            })
          },
          chainId: D.chainId,
          current: D.current
        }
      },
      merge(D, V) {
        typeof D == "object" && D && "status" in D && delete D.status;
        const R = $(D, V.chainId);
        return {
          ...V,
          ...D,
          chainId: R
        }
      },
      skipHydration: i,
      storage: r,
      version: C
    }) : b));
    N.setState(b());

    function $(D, V) {
      return D && typeof D == "object" && "chainId" in D && typeof D.chainId == "number" && a.getState().some(R => R.id === D.chainId) ? D.chainId : V
    }
    n && N.subscribe(({
      connections: D,
      current: V
    }) => V ? D.get(V)?.chainId : void 0, D => {
      if (a.getState().some(R => R.id === D)) return N.setState(R => ({
        ...R,
        chainId: D ?? R.chainId
      }))
    }), o?.subscribe(D => {
      const V = new Set,
        R = new Set;
      for (const j of c.getState()) V.add(j.id), j.rdns && R.add(j.rdns);
      const P = [];
      for (const j of D) {
        if (R.has(j.info.rdns)) continue;
        const Y = l(h(j));
        V.has(Y.id) || P.push(Y)
      }
      r && !N.persist.hasHydrated() || c.setState(j => [...j, ...P], !0)
    });

    function k(D) {
      N.setState(V => {
        const R = V.connections.get(D.uid);
        return R ? {
          ...V,
          connections: new Map(V.connections).set(D.uid, {
            accounts: D.accounts ?? R.accounts,
            chainId: D.chainId ?? R.chainId,
            connector: R.connector
          })
        } : V
      })
    }

    function B(D) {
      N.getState().status === "connecting" || N.getState().status === "reconnecting" || N.setState(V => {
        const R = c.getState().find(P => P.uid === D.uid);
        return R ? (R.emitter.listenerCount("connect") && R.emitter.off("connect", k), R.emitter.listenerCount("change") || R.emitter.on("change", k), R.emitter.listenerCount("disconnect") || R.emitter.on("disconnect", F), {
          ...V,
          connections: new Map(V.connections).set(D.uid, {
            accounts: D.accounts,
            chainId: D.chainId,
            connector: R
          }),
          current: D.uid,
          status: "connected"
        }) : V
      })
    }

    function F(D) {
      N.setState(V => {
        const R = V.connections.get(D.uid);
        if (R) {
          const j = R.connector;
          j.emitter.listenerCount("change") && R.connector.emitter.off("change", k), j.emitter.listenerCount("disconnect") && R.connector.emitter.off("disconnect", F), j.emitter.listenerCount("connect") || R.connector.emitter.on("connect", B)
        }
        if (V.connections.delete(D.uid), V.connections.size === 0) return {
          ...V,
          connections: new Map,
          current: null,
          status: "disconnected"
        };
        const P = V.connections.values().next().value;
        return {
          ...V,
          connections: new Map(V.connections),
          current: P.connector.uid
        }
      })
    }
    return {
      get chains() {
        return a.getState()
      },
      get connectors() {
        return c.getState()
      },
      storage: r,
      getClient: w,
      get state() {
        return N.getState()
      },
      setState(D) {
        let V;
        typeof D == "function" ? V = D(N.getState()) : V = D;
        const R = b();
        typeof V != "object" && (V = R), Object.keys(R).some(j => !(j in V)) && (V = R), N.setState(V, !0)
      },
      subscribe(D, V, R) {
        return N.subscribe(D, V, R ? {
          ...R,
          fireImmediately: R.emitImmediately
        } : void 0)
      },
      _internal: {
        mipd: o,
        store: N,
        ssr: !!i,
        syncConnectedChain: n,
        transports: s.transports,
        chains: {
          setState(D) {
            const V = typeof D == "function" ? D(a.getState()) : D;
            if (V.length !== 0) return a.setState(V, !0)
          },
          subscribe(D) {
            return a.subscribe(D)
          }
        },
        connectors: {
          providerDetailToConnector: h,
          setup: l,
          setState(D) {
            return c.setState(typeof D == "function" ? D(c.getState()) : D, !0)
          },
          subscribe(D) {
            return c.subscribe(D)
          }
        },
        events: {
          change: k,
          connect: B,
          disconnect: F
        }
      }
    }
  }

  function are(t) {
    const {
      chain: e
    } = t, r = e.rpcUrls.default.http[0];
    if (!t.transports) return [r];
    const n = t.transports?.[e.id]?.({
      chain: e
    });
    return (n?.value?.transports || [n]).map(({
      value: s
    }) => s?.url || r)
  }
  const cre = Symbol(),
    aM = Object.getPrototypeOf,
    N9 = new WeakMap,
    lre = t => t && (N9.has(t) ? N9.get(t) : aM(t) === Object.prototype || aM(t) === Array.prototype),
    ure = t => lre(t) && t[cre] || null,
    cM = (t, e = !0) => {
      N9.set(t, e)
    },
    hy = {
      BASE_URL: "/",
      DEV: !1,
      MODE: "production",
      PROD: !0,
      SSR: !1
    },
    M9 = t => typeof t == "object" && t !== null,
    Fd = new WeakMap,
    Nw = new WeakSet,
    dre = (t = Object.is, e = (l, h) => new Proxy(l, h), r = l => M9(l) && !Nw.has(l) && (Array.isArray(l) || !(Symbol.iterator in l)) && !(l instanceof WeakMap) && !(l instanceof WeakSet) && !(l instanceof Error) && !(l instanceof Number) && !(l instanceof Date) && !(l instanceof String) && !(l instanceof RegExp) && !(l instanceof ArrayBuffer), n = l => {
      switch (l.status) {
        case "fulfilled":
          return l.value;
        case "rejected":
          throw l.reason;
        default:
          throw l
      }
    }, i = new WeakMap, s = (l, h, f = n) => {
      const w = i.get(l);
      if (w?.[0] === h) return w[1];
      const b = Array.isArray(l) ? [] : Object.create(Object.getPrototypeOf(l));
      return cM(b, !0), i.set(l, [h, b]), Reflect.ownKeys(l).forEach(C => {
        if (Object.getOwnPropertyDescriptor(b, C)) return;
        const M = Reflect.get(l, C),
          N = {
            value: M,
            enumerable: !0,
            configurable: !0
          };
        if (Nw.has(M)) cM(M, !1);
        else if (M instanceof Promise) delete N.value, N.get = () => f(M);
        else if (Fd.has(M)) {
          const [$, k] = Fd.get(M);
          N.value = s($, k(), f)
        }
        Object.defineProperty(b, C, N)
      }), Object.preventExtensions(b)
    }, o = new WeakMap, a = [1, 1], c = l => {
      if (!M9(l)) throw new Error("object required");
      const h = o.get(l);
      if (h) return h;
      let f = a[0];
      const w = new Set,
        b = (j, Y = ++a[0]) => {
          f !== Y && (f = Y, w.forEach(U => U(j, Y)))
        };
      let C = a[1];
      const M = (j = ++a[1]) => (C !== j && !w.size && (C = j, $.forEach(([Y]) => {
          const U = Y[1](j);
          U > f && (f = U)
        })), f),
        N = j => (Y, U) => {
          const I = [...Y];
          I[1] = [j, ...I[1]], b(I, U)
        },
        $ = new Map,
        k = (j, Y) => {
          if ((hy ? "production" : void 0) !== "production" && $.has(j)) throw new Error("prop listener already exists");
          if (w.size) {
            const U = Y[3](N(j));
            $.set(j, [Y, U])
          } else $.set(j, [Y])
        },
        B = j => {
          var Y;
          const U = $.get(j);
          U && ($.delete(j), (Y = U[1]) == null || Y.call(U))
        },
        F = j => (w.add(j), w.size === 1 && $.forEach(([U, I], g) => {
          if ((hy ? "production" : void 0) !== "production" && I) throw new Error("remove already exists");
          const u = U[3](N(g));
          $.set(g, [U, u])
        }), () => {
          w.delete(j), w.size === 0 && $.forEach(([U, I], g) => {
            I && (I(), $.set(g, [U]))
          })
        }),
        D = Array.isArray(l) ? [] : Object.create(Object.getPrototypeOf(l)),
        R = e(D, {
          deleteProperty(j, Y) {
            const U = Reflect.get(j, Y);
            B(Y);
            const I = Reflect.deleteProperty(j, Y);
            return I && b(["delete", [Y], U]), I
          },
          set(j, Y, U, I) {
            const g = Reflect.has(j, Y),
              u = Reflect.get(j, Y, I);
            if (g && (t(u, U) || o.has(U) && t(u, o.get(U)))) return !0;
            B(Y), M9(U) && (U = ure(U) || U);
            let p = U;
            if (U instanceof Promise) U.then(v => {
              U.status = "fulfilled", U.value = v, b(["resolve", [Y], v])
            }).catch(v => {
              U.status = "rejected", U.reason = v, b(["reject", [Y], v])
            });
            else {
              !Fd.has(U) && r(U) && (p = c(U));
              const v = !Nw.has(p) && Fd.get(p);
              v && k(Y, v)
            }
            return Reflect.set(j, Y, p, I), b(["set", [Y], U, u]), !0
          }
        });
      o.set(l, R);
      const P = [D, M, s, F];
      return Fd.set(R, P), Reflect.ownKeys(l).forEach(j => {
        const Y = Object.getOwnPropertyDescriptor(l, j);
        "value" in Y && (R[j] = l[j], delete Y.value, delete Y.writable), Object.defineProperty(D, j, Y)
      }), R
    }) => [c, Fd, Nw, t, e, r, n, i, s, o, a],
    [hre] = dre();

  function jr(t = {}) {
    return hre(t)
  }

  function Rn(t, e, r) {
    const n = Fd.get(t);
    (hy ? "production" : void 0) !== "production" && !n && console.warn("Please use proxy object");
    let i;
    const s = [],
      o = n[3];
    let a = !1;
    const l = o(h => {
      s.push(h), i || (i = Promise.resolve().then(() => {
        i = void 0, a && e(s.splice(0))
      }))
    });
    return a = !0, () => {
      a = !1, l()
    }
  }

  function fy(t, e) {
    const r = Fd.get(t);
    (hy ? "production" : void 0) !== "production" && !r && console.warn("Please use proxy object");
    const [n, i, s] = r;
    return s(n, i(), e)
  }

  function rc(t) {
    return Nw.add(t), t
  }

  function ts(t, e, r, n) {
    let i = t[e];
    return Rn(t, () => {
      const s = t[e];
      Object.is(i, s) || r(i = s)
    })
  }

  function fre(t) {
    const e = jr({
      data: Array.from([]),
      has(r) {
        return this.data.some(n => n[0] === r)
      },
      set(r, n) {
        const i = this.data.find(s => s[0] === r);
        return i ? i[1] = n : this.data.push([r, n]), this
      },
      get(r) {
        var n;
        return (n = this.data.find(i => i[0] === r)) == null ? void 0 : n[1]
      },
      delete(r) {
        const n = this.data.findIndex(i => i[0] === r);
        return n === -1 ? !1 : (this.data.splice(n, 1), !0)
      },
      clear() {
        this.data.splice(0)
      },
      get size() {
        return this.data.length
      },
      toJSON() {
        return new Map(this.data)
      },
      forEach(r) {
        this.data.forEach(n => {
          r(n[1], n[0], this)
        })
      },
      keys() {
        return this.data.map(r => r[0]).values()
      },
      values() {
        return this.data.map(r => r[1]).values()
      },
      entries() {
        return new Map(this.data).entries()
      },
      get [Symbol.toStringTag]() {
        return "Map"
      },
      [Symbol.iterator]() {
        return this.entries()
      }
    });
    return Object.defineProperties(e, {
      data: {
        enumerable: !1
      },
      size: {
        enumerable: !1
      },
      toJSON: {
        enumerable: !1
      }
    }), Object.seal(e), e
  }
  var lM = {
    exports: {}
  };
  (function (t, e) {
    (function (r, n) {
      t.exports = n()
    })(ot, function () {
      var r = 1e3,
        n = 6e4,
        i = 36e5,
        s = "millisecond",
        o = "second",
        a = "minute",
        c = "hour",
        l = "day",
        h = "week",
        f = "month",
        w = "quarter",
        b = "year",
        C = "date",
        M = "Invalid Date",
        N = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,
        $ = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,
        k = {
          name: "en",
          weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
          months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
          ordinal: function (u) {
            var p = ["th", "st", "nd", "rd"],
              v = u % 100;
            return "[" + u + (p[(v - 20) % 10] || p[v] || p[0]) + "]"
          }
        },
        B = function (u, p, v) {
          var x = String(u);
          return !x || x.length >= p ? u : "" + Array(p + 1 - x.length).join(v) + u
        },
        F = {
          s: B,
          z: function (u) {
            var p = -u.utcOffset(),
              v = Math.abs(p),
              x = Math.floor(v / 60),
              E = v % 60;
            return (p <= 0 ? "+" : "-") + B(x, 2, "0") + ":" + B(E, 2, "0")
          },
          m: function u(p, v) {
            if (p.date() < v.date()) return -u(v, p);
            var x = 12 * (v.year() - p.year()) + (v.month() - p.month()),
              E = p.clone().add(x, f),
              S = v - E < 0,
              _ = p.clone().add(x + (S ? -1 : 1), f);
            return +(-(x + (v - E) / (S ? E - _ : _ - E)) || 0)
          },
          a: function (u) {
            return u < 0 ? Math.ceil(u) || 0 : Math.floor(u)
          },
          p: function (u) {
            return {
              M: f,
              y: b,
              w: h,
              d: l,
              D: C,
              h: c,
              m: a,
              s: o,
              ms: s,
              Q: w
            } [u] || String(u || "").toLowerCase().replace(/s$/, "")
          },
          u: function (u) {
            return u === void 0
          }
        },
        D = "en",
        V = {};
      V[D] = k;
      var R = "$isDayjsObject",
        P = function (u) {
          return u instanceof I || !(!u || !u[R])
        },
        j = function u(p, v, x) {
          var E;
          if (!p) return D;
          if (typeof p == "string") {
            var S = p.toLowerCase();
            V[S] && (E = S), v && (V[S] = v, E = S);
            var _ = p.split("-");
            if (!E && _.length > 1) return u(_[0])
          } else {
            var y = p.name;
            V[y] = p, E = y
          }
          return !x && E && (D = E), E || !x && D
        },
        Y = function (u, p) {
          if (P(u)) return u.clone();
          var v = typeof p == "object" ? p : {};
          return v.date = u, v.args = arguments, new I(v)
        },
        U = F;
      U.l = j, U.i = P, U.w = function (u, p) {
        return Y(u, {
          locale: p.$L,
          utc: p.$u,
          x: p.$x,
          $offset: p.$offset
        })
      };
      var I = function () {
          function u(v) {
            this.$L = j(v.locale, null, !0), this.parse(v), this.$x = this.$x || v.x || {}, this[R] = !0
          }
          var p = u.prototype;
          return p.parse = function (v) {
            this.$d = function (x) {
              var E = x.date,
                S = x.utc;
              if (E === null) return new Date(NaN);
              if (U.u(E)) return new Date;
              if (E instanceof Date) return new Date(E);
              if (typeof E == "string" && !/Z$/i.test(E)) {
                var _ = E.match(N);
                if (_) {
                  var y = _[2] - 1 || 0,
                    A = (_[7] || "0").substring(0, 3);
                  return S ? new Date(Date.UTC(_[1], y, _[3] || 1, _[4] || 0, _[5] || 0, _[6] || 0, A)) : new Date(_[1], y, _[3] || 1, _[4] || 0, _[5] || 0, _[6] || 0, A)
                }
              }
              return new Date(E)
            }(v), this.init()
          }, p.init = function () {
            var v = this.$d;
            this.$y = v.getFullYear(), this.$M = v.getMonth(), this.$D = v.getDate(), this.$W = v.getDay(), this.$H = v.getHours(), this.$m = v.getMinutes(), this.$s = v.getSeconds(), this.$ms = v.getMilliseconds()
          }, p.$utils = function () {
            return U
          }, p.isValid = function () {
            return this.$d.toString() !== M
          }, p.isSame = function (v, x) {
            var E = Y(v);
            return this.startOf(x) <= E && E <= this.endOf(x)
          }, p.isAfter = function (v, x) {
            return Y(v) < this.startOf(x)
          }, p.isBefore = function (v, x) {
            return this.endOf(x) < Y(v)
          }, p.$g = function (v, x, E) {
            return U.u(v) ? this[x] : this.set(E, v)
          }, p.unix = function () {
            return Math.floor(this.valueOf() / 1e3)
          }, p.valueOf = function () {
            return this.$d.getTime()
          }, p.startOf = function (v, x) {
            var E = this,
              S = !!U.u(x) || x,
              _ = U.p(v),
              y = function (ne, O) {
                var H = U.w(E.$u ? Date.UTC(E.$y, O, ne) : new Date(E.$y, O, ne), E);
                return S ? H : H.endOf(l)
              },
              A = function (ne, O) {
                return U.w(E.toDate()[ne].apply(E.toDate("s"), (S ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(O)), E)
              },
              G = this.$W,
              ce = this.$M,
              W = this.$D,
              X = "set" + (this.$u ? "UTC" : "");
            switch (_) {
              case b:
                return S ? y(1, 0) : y(31, 11);
              case f:
                return S ? y(1, ce) : y(0, ce + 1);
              case h:
                var Z = this.$locale().weekStart || 0,
                  ee = (G < Z ? G + 7 : G) - Z;
                return y(S ? W - ee : W + (6 - ee), ce);
              case l:
              case C:
                return A(X + "Hours", 0);
              case c:
                return A(X + "Minutes", 1);
              case a:
                return A(X + "Seconds", 2);
              case o:
                return A(X + "Milliseconds", 3);
              default:
                return this.clone()
            }
          }, p.endOf = function (v) {
            return this.startOf(v, !1)
          }, p.$set = function (v, x) {
            var E, S = U.p(v),
              _ = "set" + (this.$u ? "UTC" : ""),
              y = (E = {}, E[l] = _ + "Date", E[C] = _ + "Date", E[f] = _ + "Month", E[b] = _ + "FullYear", E[c] = _ + "Hours", E[a] = _ + "Minutes", E[o] = _ + "Seconds", E[s] = _ + "Milliseconds", E)[S],
              A = S === l ? this.$D + (x - this.$W) : x;
            if (S === f || S === b) {
              var G = this.clone().set(C, 1);
              G.$d[y](A), G.init(), this.$d = G.set(C, Math.min(this.$D, G.daysInMonth())).$d
            } else y && this.$d[y](A);
            return this.init(), this
          }, p.set = function (v, x) {
            return this.clone().$set(v, x)
          }, p.get = function (v) {
            return this[U.p(v)]()
          }, p.add = function (v, x) {
            var E, S = this;
            v = Number(v);
            var _ = U.p(x),
              y = function (ce) {
                var W = Y(S);
                return U.w(W.date(W.date() + Math.round(ce * v)), S)
              };
            if (_ === f) return this.set(f, this.$M + v);
            if (_ === b) return this.set(b, this.$y + v);
            if (_ === l) return y(1);
            if (_ === h) return y(7);
            var A = (E = {}, E[a] = n, E[c] = i, E[o] = r, E)[_] || 1,
              G = this.$d.getTime() + v * A;
            return U.w(G, this)
          }, p.subtract = function (v, x) {
            return this.add(-1 * v, x)
          }, p.format = function (v) {
            var x = this,
              E = this.$locale();
            if (!this.isValid()) return E.invalidDate || M;
            var S = v || "YYYY-MM-DDTHH:mm:ssZ",
              _ = U.z(this),
              y = this.$H,
              A = this.$m,
              G = this.$M,
              ce = E.weekdays,
              W = E.months,
              X = E.meridiem,
              Z = function (O, H, Q, de) {
                return O && (O[H] || O(x, S)) || Q[H].slice(0, de)
              },
              ee = function (O) {
                return U.s(y % 12 || 12, O, "0")
              },
              ne = X || function (O, H, Q) {
                var de = O < 12 ? "AM" : "PM";
                return Q ? de.toLowerCase() : de
              };
            return S.replace($, function (O, H) {
              return H || function (Q) {
                switch (Q) {
                  case "YY":
                    return String(x.$y).slice(-2);
                  case "YYYY":
                    return U.s(x.$y, 4, "0");
                  case "M":
                    return G + 1;
                  case "MM":
                    return U.s(G + 1, 2, "0");
                  case "MMM":
                    return Z(E.monthsShort, G, W, 3);
                  case "MMMM":
                    return Z(W, G);
                  case "D":
                    return x.$D;
                  case "DD":
                    return U.s(x.$D, 2, "0");
                  case "d":
                    return String(x.$W);
                  case "dd":
                    return Z(E.weekdaysMin, x.$W, ce, 2);
                  case "ddd":
                    return Z(E.weekdaysShort, x.$W, ce, 3);
                  case "dddd":
                    return ce[x.$W];
                  case "H":
                    return String(y);
                  case "HH":
                    return U.s(y, 2, "0");
                  case "h":
                    return ee(1);
                  case "hh":
                    return ee(2);
                  case "a":
                    return ne(y, A, !0);
                  case "A":
                    return ne(y, A, !1);
                  case "m":
                    return String(A);
                  case "mm":
                    return U.s(A, 2, "0");
                  case "s":
                    return String(x.$s);
                  case "ss":
                    return U.s(x.$s, 2, "0");
                  case "SSS":
                    return U.s(x.$ms, 3, "0");
                  case "Z":
                    return _
                }
                return null
              }(O) || _.replace(":", "")
            })
          }, p.utcOffset = function () {
            return 15 * -Math.round(this.$d.getTimezoneOffset() / 15)
          }, p.diff = function (v, x, E) {
            var S, _ = this,
              y = U.p(x),
              A = Y(v),
              G = (A.utcOffset() - this.utcOffset()) * n,
              ce = this - A,
              W = function () {
                return U.m(_, A)
              };
            switch (y) {
              case b:
                S = W() / 12;
                break;
              case f:
                S = W();
                break;
              case w:
                S = W() / 3;
                break;
              case h:
                S = (ce - G) / 6048e5;
                break;
              case l:
                S = (ce - G) / 864e5;
                break;
              case c:
                S = ce / i;
                break;
              case a:
                S = ce / n;
                break;
              case o:
                S = ce / r;
                break;
              default:
                S = ce
            }
            return E ? S : U.a(S)
          }, p.daysInMonth = function () {
            return this.endOf(f).$D
          }, p.$locale = function () {
            return V[this.$L]
          }, p.locale = function (v, x) {
            if (!v) return this.$L;
            var E = this.clone(),
              S = j(v, x, !0);
            return S && (E.$L = S), E
          }, p.clone = function () {
            return U.w(this.$d, this)
          }, p.toDate = function () {
            return new Date(this.valueOf())
          }, p.toJSON = function () {
            return this.isValid() ? this.toISOString() : null
          }, p.toISOString = function () {
            return this.$d.toISOString()
          }, p.toString = function () {
            return this.$d.toUTCString()
          }, u
        }(),
        g = I.prototype;
      return Y.prototype = g, [
        ["$ms", s],
        ["$s", o],
        ["$m", a],
        ["$H", c],
        ["$W", l],
        ["$M", f],
        ["$y", b],
        ["$D", C]
      ].forEach(function (u) {
        g[u[1]] = function (p) {
          return this.$g(p, u[0], u[1])
        }
      }), Y.extend = function (u, p) {
        return u.$i || (u(p, I, Y), u.$i = !0), Y
      }, Y.locale = j, Y.isDayjs = P, Y.unix = function (u) {
        return Y(1e3 * u)
      }, Y.en = V[D], Y.Ls = V, Y.p = {}, Y
    })
  })(lM);
  var pre = lM.exports;
  const l1 = Za(pre);
  var uM = {
    exports: {}
  };
  (function (t, e) {
    (function (r, n) {
      t.exports = n()
    })(ot, function () {
      return {
        name: "en",
        weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
        months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"),
        ordinal: function (r) {
          var n = ["th", "st", "nd", "rd"],
            i = r % 100;
          return "[" + r + (n[(i - 20) % 10] || n[i] || n[0]) + "]"
        }
      }
    })
  })(uM);
  var gre = uM.exports;
  const mre = Za(gre);
  var dM = {
    exports: {}
  };
  (function (t, e) {
    (function (r, n) {
      t.exports = n()
    })(ot, function () {
      return function (r, n, i) {
        r = r || {};
        var s = n.prototype,
          o = {
            future: "in %s",
            past: "%s ago",
            s: "a few seconds",
            m: "a minute",
            mm: "%d minutes",
            h: "an hour",
            hh: "%d hours",
            d: "a day",
            dd: "%d days",
            M: "a month",
            MM: "%d months",
            y: "a year",
            yy: "%d years"
          };

        function a(l, h, f, w) {
          return s.fromToBase(l, h, f, w)
        }
        i.en.relativeTime = o, s.fromToBase = function (l, h, f, w, b) {
          for (var C, M, N, $ = f.$locale().relativeTime || o, k = r.thresholds || [{
              l: "s",
              r: 44,
              d: "second"
            }, {
              l: "m",
              r: 89
            }, {
              l: "mm",
              r: 44,
              d: "minute"
            }, {
              l: "h",
              r: 89
            }, {
              l: "hh",
              r: 21,
              d: "hour"
            }, {
              l: "d",
              r: 35
            }, {
              l: "dd",
              r: 25,
              d: "day"
            }, {
              l: "M",
              r: 45
            }, {
              l: "MM",
              r: 10,
              d: "month"
            }, {
              l: "y",
              r: 17
            }, {
              l: "yy",
              d: "year"
            }], B = k.length, F = 0; F < B; F += 1) {
            var D = k[F];
            D.d && (C = w ? i(l).diff(f, D.d, !0) : f.diff(l, D.d, !0));
            var V = (r.rounding || Math.round)(Math.abs(C));
            if (N = C > 0, V <= D.r || !D.r) {
              V <= 1 && F > 0 && (D = k[F - 1]);
              var R = $[D.l];
              b && (V = b("" + V)), M = typeof R == "string" ? R.replace("%d", V) : R(V, h, D.l, N);
              break
            }
          }
          if (h) return M;
          var P = N ? $.future : $.past;
          return typeof P == "function" ? P(M) : P.replace("%s", M)
        }, s.to = function (l, h) {
          return a(l, h, this, !0)
        }, s.from = function (l, h) {
          return a(l, h, this)
        };
        var c = function (l) {
          return l.$u ? i.utc() : i()
        };
        s.toNow = function (l) {
          return this.to(c(this), l)
        }, s.fromNow = function (l) {
          return this.from(c(this), l)
        }
      }
    })
  })(dM);
  var wre = dM.exports;
  const vre = Za(wre);
  var hM = {
    exports: {}
  };
  (function (t, e) {
    (function (r, n) {
      t.exports = n()
    })(ot, function () {
      return function (r, n, i) {
        i.updateLocale = function (s, o) {
          var a = i.Ls[s];
          if (a) return (o ? Object.keys(o) : []).forEach(function (c) {
            a[c] = o[c]
          }), a
        }
      }
    })
  })(hM);
  var bre = hM.exports;
  const yre = Za(bre);
  l1.extend(vre), l1.extend(yre);
  const _re = {
    ...mre,
    name: "en-web3-modal",
    relativeTime: {
      future: "in %s",
      past: "%s ago",
      s: "%d sec",
      m: "1 min",
      mm: "%d min",
      h: "1 hr",
      hh: "%d hrs",
      d: "1 d",
      dd: "%d d",
      M: "1 mo",
      MM: "%d mo",
      y: "1 yr",
      yy: "%d yr"
    }
  };
  l1.locale("en-web3-modal", _re);
  const P9 = {
      getYear(t = new Date().toISOString()) {
        return l1(t).year()
      },
      getRelativeDateFromNow(t) {
        return l1(t).locale("en-web3-modal").fromNow(!0)
      },
      formatDate(t, e = "DD MMM") {
        return l1(t).format(e)
      }
    },
    $9 = {
      caipNetworkIdToNumber(t) {
        return t ? Number(t.split(":")[1]) : void 0
      },
      parseEvmChainId(t) {
        return typeof t == "string" ? this.caipNetworkIdToNumber(t) : t
      }
    };
  var xre = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,
    O9 = Math.ceil,
    oa = Math.floor,
    io = "[BigNumber Error] ",
    fM = io + "Number primitive has more than 15 significant digits: ",
    nc = 1e14,
    ur = 14,
    D9 = 9007199254740991,
    L9 = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13],
    Wd = 1e7,
    Li = 1e9;

  function pM(t) {
    var e, r, n, i = k.prototype = {
        constructor: k,
        toString: null,
        valueOf: null
      },
      s = new k(1),
      o = 20,
      a = 4,
      c = -7,
      l = 21,
      h = -1e7,
      f = 1e7,
      w = !1,
      b = 1,
      C = 0,
      M = {
        prefix: "",
        groupSize: 3,
        secondaryGroupSize: 0,
        groupSeparator: ",",
        decimalSeparator: ".",
        fractionGroupSize: 0,
        fractionGroupSeparator: " ",
        suffix: ""
      },
      N = "0123456789abcdefghijklmnopqrstuvwxyz",
      $ = !0;

    function k(P, j) {
      var Y, U, I, g, u, p, v, x, E = this;
      if (!(E instanceof k)) return new k(P, j);
      if (j == null) {
        if (P && P._isBigNumber === !0) {
          E.s = P.s, !P.c || P.e > f ? E.c = E.e = null : P.e < h ? E.c = [E.e = 0] : (E.e = P.e, E.c = P.c.slice());
          return
        }
        if ((p = typeof P == "number") && P * 0 == 0) {
          if (E.s = 1 / P < 0 ? (P = -P, -1) : 1, P === ~~P) {
            for (g = 0, u = P; u >= 10; u /= 10, g++);
            g > f ? E.c = E.e = null : (E.e = g, E.c = [P]);
            return
          }
          x = String(P)
        } else {
          if (!xre.test(x = String(P))) return n(E, x, p);
          E.s = x.charCodeAt(0) == 45 ? (x = x.slice(1), -1) : 1
        }(g = x.indexOf(".")) > -1 && (x = x.replace(".", "")), (u = x.search(/e/i)) > 0 ? (g < 0 && (g = u), g += +x.slice(u + 1), x = x.substring(0, u)) : g < 0 && (g = x.length)
      } else {
        if (Dn(j, 2, N.length, "Base"), j == 10 && $) return E = new k(P), V(E, o + E.e + 1, a);
        if (x = String(P), p = typeof P == "number") {
          if (P * 0 != 0) return n(E, x, p, j);
          if (E.s = 1 / P < 0 ? (x = x.slice(1), -1) : 1, k.DEBUG && x.replace(/^0\.0*|\./, "").length > 15) throw Error(fM + P)
        } else E.s = x.charCodeAt(0) === 45 ? (x = x.slice(1), -1) : 1;
        for (Y = N.slice(0, j), g = u = 0, v = x.length; u < v; u++)
          if (Y.indexOf(U = x.charAt(u)) < 0) {
            if (U == ".") {
              if (u > g) {
                g = v;
                continue
              }
            } else if (!I && (x == x.toUpperCase() && (x = x.toLowerCase()) || x == x.toLowerCase() && (x = x.toUpperCase()))) {
              I = !0, u = -1, g = 0;
              continue
            }
            return n(E, String(P), p, j)
          } p = !1, x = r(x, j, 10, E.s), (g = x.indexOf(".")) > -1 ? x = x.replace(".", "") : g = x.length
      }
      for (u = 0; x.charCodeAt(u) === 48; u++);
      for (v = x.length; x.charCodeAt(--v) === 48;);
      if (x = x.slice(u, ++v)) {
        if (v -= u, p && k.DEBUG && v > 15 && (P > D9 || P !== oa(P))) throw Error(fM + E.s * P);
        if ((g = g - u - 1) > f) E.c = E.e = null;
        else if (g < h) E.c = [E.e = 0];
        else {
          if (E.e = g, E.c = [], u = (g + 1) % ur, g < 0 && (u += ur), u < v) {
            for (u && E.c.push(+x.slice(0, u)), v -= ur; u < v;) E.c.push(+x.slice(u, u += ur));
            u = ur - (x = x.slice(u)).length
          } else u -= v;
          for (; u--; x += "0");
          E.c.push(+x)
        }
      } else E.c = [E.e = 0]
    }
    k.clone = pM, k.ROUND_UP = 0, k.ROUND_DOWN = 1, k.ROUND_CEIL = 2, k.ROUND_FLOOR = 3, k.ROUND_HALF_UP = 4, k.ROUND_HALF_DOWN = 5, k.ROUND_HALF_EVEN = 6, k.ROUND_HALF_CEIL = 7, k.ROUND_HALF_FLOOR = 8, k.EUCLID = 9, k.config = k.set = function (P) {
      var j, Y;
      if (P != null)
        if (typeof P == "object") {
          if (P.hasOwnProperty(j = "DECIMAL_PLACES") && (Y = P[j], Dn(Y, 0, Li, j), o = Y), P.hasOwnProperty(j = "ROUNDING_MODE") && (Y = P[j], Dn(Y, 0, 8, j), a = Y), P.hasOwnProperty(j = "EXPONENTIAL_AT") && (Y = P[j], Y && Y.pop ? (Dn(Y[0], -Li, 0, j), Dn(Y[1], 0, Li, j), c = Y[0], l = Y[1]) : (Dn(Y, -Li, Li, j), c = -(l = Y < 0 ? -Y : Y))), P.hasOwnProperty(j = "RANGE"))
            if (Y = P[j], Y && Y.pop) Dn(Y[0], -Li, -1, j), Dn(Y[1], 1, Li, j), h = Y[0], f = Y[1];
            else if (Dn(Y, -Li, Li, j), Y) h = -(f = Y < 0 ? -Y : Y);
          else throw Error(io + j + " cannot be zero: " + Y);
          if (P.hasOwnProperty(j = "CRYPTO"))
            if (Y = P[j], Y === !!Y)
              if (Y)
                if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes)) w = Y;
                else throw w = !Y, Error(io + "crypto unavailable");
          else w = Y;
          else throw Error(io + j + " not true or false: " + Y);
          if (P.hasOwnProperty(j = "MODULO_MODE") && (Y = P[j], Dn(Y, 0, 9, j), b = Y), P.hasOwnProperty(j = "POW_PRECISION") && (Y = P[j], Dn(Y, 0, Li, j), C = Y), P.hasOwnProperty(j = "FORMAT"))
            if (Y = P[j], typeof Y == "object") M = Y;
            else throw Error(io + j + " not an object: " + Y);
          if (P.hasOwnProperty(j = "ALPHABET"))
            if (Y = P[j], typeof Y == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(Y)) $ = Y.slice(0, 10) == "0123456789", N = Y;
            else throw Error(io + j + " invalid: " + Y)
        } else throw Error(io + "Object expected: " + P);
      return {
        DECIMAL_PLACES: o,
        ROUNDING_MODE: a,
        EXPONENTIAL_AT: [c, l],
        RANGE: [h, f],
        CRYPTO: w,
        MODULO_MODE: b,
        POW_PRECISION: C,
        FORMAT: M,
        ALPHABET: N
      }
    }, k.isBigNumber = function (P) {
      if (!P || P._isBigNumber !== !0) return !1;
      if (!k.DEBUG) return !0;
      var j, Y, U = P.c,
        I = P.e,
        g = P.s;
      e: if ({}.toString.call(U) == "[object Array]") {
        if ((g === 1 || g === -1) && I >= -Li && I <= Li && I === oa(I)) {
          if (U[0] === 0) {
            if (I === 0 && U.length === 1) return !0;
            break e
          }
          if (j = (I + 1) % ur, j < 1 && (j += ur), String(U[0]).length == j) {
            for (j = 0; j < U.length; j++)
              if (Y = U[j], Y < 0 || Y >= nc || Y !== oa(Y)) break e;
            if (Y !== 0) return !0
          }
        }
      } else if (U === null && I === null && (g === null || g === 1 || g === -1)) return !0;
      throw Error(io + "Invalid BigNumber: " + P)
    }, k.maximum = k.max = function () {
      return F(arguments, -1)
    }, k.minimum = k.min = function () {
      return F(arguments, 1)
    }, k.random = function () {
      var P = 9007199254740992,
        j = Math.random() * P & 2097151 ? function () {
          return oa(Math.random() * P)
        } : function () {
          return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0)
        };
      return function (Y) {
        var U, I, g, u, p, v = 0,
          x = [],
          E = new k(s);
        if (Y == null ? Y = o : Dn(Y, 0, Li), u = O9(Y / ur), w)
          if (crypto.getRandomValues) {
            for (U = crypto.getRandomValues(new Uint32Array(u *= 2)); v < u;) p = U[v] * 131072 + (U[v + 1] >>> 11), p >= 9e15 ? (I = crypto.getRandomValues(new Uint32Array(2)), U[v] = I[0], U[v + 1] = I[1]) : (x.push(p % 1e14), v += 2);
            v = u / 2
          } else if (crypto.randomBytes) {
          for (U = crypto.randomBytes(u *= 7); v < u;) p = (U[v] & 31) * 281474976710656 + U[v + 1] * 1099511627776 + U[v + 2] * 4294967296 + U[v + 3] * 16777216 + (U[v + 4] << 16) + (U[v + 5] << 8) + U[v + 6], p >= 9e15 ? crypto.randomBytes(7).copy(U, v) : (x.push(p % 1e14), v += 7);
          v = u / 7
        } else throw w = !1, Error(io + "crypto unavailable");
        if (!w)
          for (; v < u;) p = j(), p < 9e15 && (x[v++] = p % 1e14);
        for (u = x[--v], Y %= ur, u && Y && (p = L9[ur - Y], x[v] = oa(u / p) * p); x[v] === 0; x.pop(), v--);
        if (v < 0) x = [g = 0];
        else {
          for (g = -1; x[0] === 0; x.splice(0, 1), g -= ur);
          for (v = 1, p = x[0]; p >= 10; p /= 10, v++);
          v < ur && (g -= ur - v)
        }
        return E.e = g, E.c = x, E
      }
    }(), k.sum = function () {
      for (var P = 1, j = arguments, Y = new k(j[0]); P < j.length;) Y = Y.plus(j[P++]);
      return Y
    }, r = function () {
      var P = "0123456789";

      function j(Y, U, I, g) {
        for (var u, p = [0], v, x = 0, E = Y.length; x < E;) {
          for (v = p.length; v--; p[v] *= U);
          for (p[0] += g.indexOf(Y.charAt(x++)), u = 0; u < p.length; u++) p[u] > I - 1 && (p[u + 1] == null && (p[u + 1] = 0), p[u + 1] += p[u] / I | 0, p[u] %= I)
        }
        return p.reverse()
      }
      return function (Y, U, I, g, u) {
        var p, v, x, E, S, _, y, A, G = Y.indexOf("."),
          ce = o,
          W = a;
        for (G >= 0 && (E = C, C = 0, Y = Y.replace(".", ""), A = new k(U), _ = A.pow(Y.length - G), C = E, A.c = j(Iu(ca(_.c), _.e, "0"), 10, I, P), A.e = A.c.length), y = j(Y, U, I, u ? (p = N, P) : (p = P, N)), x = E = y.length; y[--E] == 0; y.pop());
        if (!y[0]) return p.charAt(0);
        if (G < 0 ? --x : (_.c = y, _.e = x, _.s = g, _ = e(_, A, ce, W, I), y = _.c, S = _.r, x = _.e), v = x + ce + 1, G = y[v], E = I / 2, S = S || v < 0 || y[v + 1] != null, S = W < 4 ? (G != null || S) && (W == 0 || W == (_.s < 0 ? 3 : 2)) : G > E || G == E && (W == 4 || S || W == 6 && y[v - 1] & 1 || W == (_.s < 0 ? 8 : 7)), v < 1 || !y[0]) Y = S ? Iu(p.charAt(1), -ce, p.charAt(0)) : p.charAt(0);
        else {
          if (y.length = v, S)
            for (--I; ++y[--v] > I;) y[v] = 0, v || (++x, y = [1].concat(y));
          for (E = y.length; !y[--E];);
          for (G = 0, Y = ""; G <= E; Y += p.charAt(y[G++]));
          Y = Iu(Y, x, p.charAt(0))
        }
        return Y
      }
    }(), e = function () {
      function P(U, I, g) {
        var u, p, v, x, E = 0,
          S = U.length,
          _ = I % Wd,
          y = I / Wd | 0;
        for (U = U.slice(); S--;) v = U[S] % Wd, x = U[S] / Wd | 0, u = y * v + x * _, p = _ * v + u % Wd * Wd + E, E = (p / g | 0) + (u / Wd | 0) + y * x, U[S] = p % g;
        return E && (U = [E].concat(U)), U
      }

      function j(U, I, g, u) {
        var p, v;
        if (g != u) v = g > u ? 1 : -1;
        else
          for (p = v = 0; p < g; p++)
            if (U[p] != I[p]) {
              v = U[p] > I[p] ? 1 : -1;
              break
            } return v
      }

      function Y(U, I, g, u) {
        for (var p = 0; g--;) U[g] -= p, p = U[g] < I[g] ? 1 : 0, U[g] = p * u + U[g] - I[g];
        for (; !U[0] && U.length > 1; U.splice(0, 1));
      }
      return function (U, I, g, u, p) {
        var v, x, E, S, _, y, A, G, ce, W, X, Z, ee, ne, O, H, Q, de = U.s == I.s ? 1 : -1,
          ge = U.c,
          Te = I.c;
        if (!ge || !ge[0] || !Te || !Te[0]) return new k(!U.s || !I.s || (ge ? Te && ge[0] == Te[0] : !Te) ? NaN : ge && ge[0] == 0 || !Te ? de * 0 : de / 0);
        for (G = new k(de), ce = G.c = [], x = U.e - I.e, de = g + x + 1, p || (p = nc, x = aa(U.e / ur) - aa(I.e / ur), de = de / ur | 0), E = 0; Te[E] == (ge[E] || 0); E++);
        if (Te[E] > (ge[E] || 0) && x--, de < 0) ce.push(1), S = !0;
        else {
          for (ne = ge.length, H = Te.length, E = 0, de += 2, _ = oa(p / (Te[0] + 1)), _ > 1 && (Te = P(Te, _, p), ge = P(ge, _, p), H = Te.length, ne = ge.length), ee = H, W = ge.slice(0, H), X = W.length; X < H; W[X++] = 0);
          Q = Te.slice(), Q = [0].concat(Q), O = Te[0], Te[1] >= p / 2 && O++;
          do {
            if (_ = 0, v = j(Te, W, H, X), v < 0) {
              if (Z = W[0], H != X && (Z = Z * p + (W[1] || 0)), _ = oa(Z / O), _ > 1)
                for (_ >= p && (_ = p - 1), y = P(Te, _, p), A = y.length, X = W.length; j(y, W, A, X) == 1;) _--, Y(y, H < A ? Q : Te, A, p), A = y.length, v = 1;
              else _ == 0 && (v = _ = 1), y = Te.slice(), A = y.length;
              if (A < X && (y = [0].concat(y)), Y(W, y, X, p), X = W.length, v == -1)
                for (; j(Te, W, H, X) < 1;) _++, Y(W, H < X ? Q : Te, X, p), X = W.length
            } else v === 0 && (_++, W = [0]);
            ce[E++] = _, W[0] ? W[X++] = ge[ee] || 0 : (W = [ge[ee]], X = 1)
          } while ((ee++ < ne || W[0] != null) && de--);
          S = W[0] != null, ce[0] || ce.splice(0, 1)
        }
        if (p == nc) {
          for (E = 1, de = ce[0]; de >= 10; de /= 10, E++);
          V(G, g + (G.e = E + x * ur - 1) + 1, u, S)
        } else G.e = x, G.r = +S;
        return G
      }
    }();

    function B(P, j, Y, U) {
      var I, g, u, p, v;
      if (Y == null ? Y = a : Dn(Y, 0, 8), !P.c) return P.toString();
      if (I = P.c[0], u = P.e, j == null) v = ca(P.c), v = U == 1 || U == 2 && (u <= c || u >= l) ? gy(v, u) : Iu(v, u, "0");
      else if (P = V(new k(P), j, Y), g = P.e, v = ca(P.c), p = v.length, U == 1 || U == 2 && (j <= g || g <= c)) {
        for (; p < j; v += "0", p++);
        v = gy(v, g)
      } else if (j -= u, v = Iu(v, g, "0"), g + 1 > p) {
        if (--j > 0)
          for (v += "."; j--; v += "0");
      } else if (j += g - p, j > 0)
        for (g + 1 == p && (v += "."); j--; v += "0");
      return P.s < 0 && I ? "-" + v : v
    }

    function F(P, j) {
      for (var Y, U, I = 1, g = new k(P[0]); I < P.length; I++) U = new k(P[I]), (!U.s || (Y = Tf(g, U)) === j || Y === 0 && g.s === j) && (g = U);
      return g
    }

    function D(P, j, Y) {
      for (var U = 1, I = j.length; !j[--I]; j.pop());
      for (I = j[0]; I >= 10; I /= 10, U++);
      return (Y = U + Y * ur - 1) > f ? P.c = P.e = null : Y < h ? P.c = [P.e = 0] : (P.e = Y, P.c = j), P
    }
    n = function () {
      var P = /^(-?)0([xbo])(?=\w[\w.]*$)/i,
        j = /^([^.]+)\.$/,
        Y = /^\.([^.]+)$/,
        U = /^-?(Infinity|NaN)$/,
        I = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
      return function (g, u, p, v) {
        var x, E = p ? u : u.replace(I, "");
        if (U.test(E)) g.s = isNaN(E) ? null : E < 0 ? -1 : 1;
        else {
          if (!p && (E = E.replace(P, function (S, _, y) {
              return x = (y = y.toLowerCase()) == "x" ? 16 : y == "b" ? 2 : 8, !v || v == x ? _ : S
            }), v && (x = v, E = E.replace(j, "$1").replace(Y, "0.$1")), u != E)) return new k(E, x);
          if (k.DEBUG) throw Error(io + "Not a" + (v ? " base " + v : "") + " number: " + u);
          g.s = null
        }
        g.c = g.e = null
      }
    }();

    function V(P, j, Y, U) {
      var I, g, u, p, v, x, E, S = P.c,
        _ = L9;
      if (S) {
        e: {
          for (I = 1, p = S[0]; p >= 10; p /= 10, I++);
          if (g = j - I, g < 0) g += ur,
          u = j,
          v = S[x = 0],
          E = oa(v / _[I - u - 1] % 10);
          else if (x = O9((g + 1) / ur), x >= S.length)
            if (U) {
              for (; S.length <= x; S.push(0));
              v = E = 0, I = 1, g %= ur, u = g - ur + 1
            } else break e;
          else {
            for (v = p = S[x], I = 1; p >= 10; p /= 10, I++);
            g %= ur, u = g - ur + I, E = u < 0 ? 0 : oa(v / _[I - u - 1] % 10)
          }
          if (U = U || j < 0 || S[x + 1] != null || (u < 0 ? v : v % _[I - u - 1]), U = Y < 4 ? (E || U) && (Y == 0 || Y == (P.s < 0 ? 3 : 2)) : E > 5 || E == 5 && (Y == 4 || U || Y == 6 && (g > 0 ? u > 0 ? v / _[I - u] : 0 : S[x - 1]) % 10 & 1 || Y == (P.s < 0 ? 8 : 7)), j < 1 || !S[0]) return S.length = 0,
          U ? (j -= P.e + 1, S[0] = _[(ur - j % ur) % ur], P.e = -j || 0) : S[0] = P.e = 0,
          P;
          if (g == 0 ? (S.length = x, p = 1, x--) : (S.length = x + 1, p = _[ur - g], S[x] = u > 0 ? oa(v / _[I - u] % _[u]) * p : 0), U)
            for (;;)
              if (x == 0) {
                for (g = 1, u = S[0]; u >= 10; u /= 10, g++);
                for (u = S[0] += p, p = 1; u >= 10; u /= 10, p++);
                g != p && (P.e++, S[0] == nc && (S[0] = 1));
                break
              } else {
                if (S[x] += p, S[x] != nc) break;
                S[x--] = 0, p = 1
              } for (g = S.length; S[--g] === 0; S.pop());
        }
        P.e > f ? P.c = P.e = null : P.e < h && (P.c = [P.e = 0])
      }
      return P
    }

    function R(P) {
      var j, Y = P.e;
      return Y === null ? P.toString() : (j = ca(P.c), j = Y <= c || Y >= l ? gy(j, Y) : Iu(j, Y, "0"), P.s < 0 ? "-" + j : j)
    }
    return i.absoluteValue = i.abs = function () {
      var P = new k(this);
      return P.s < 0 && (P.s = 1), P
    }, i.comparedTo = function (P, j) {
      return Tf(this, new k(P, j))
    }, i.decimalPlaces = i.dp = function (P, j) {
      var Y, U, I, g = this;
      if (P != null) return Dn(P, 0, Li), j == null ? j = a : Dn(j, 0, 8), V(new k(g), P + g.e + 1, j);
      if (!(Y = g.c)) return null;
      if (U = ((I = Y.length - 1) - aa(this.e / ur)) * ur, I = Y[I])
        for (; I % 10 == 0; I /= 10, U--);
      return U < 0 && (U = 0), U
    }, i.dividedBy = i.div = function (P, j) {
      return e(this, new k(P, j), o, a)
    }, i.dividedToIntegerBy = i.idiv = function (P, j) {
      return e(this, new k(P, j), 0, 1)
    }, i.exponentiatedBy = i.pow = function (P, j) {
      var Y, U, I, g, u, p, v, x, E, S = this;
      if (P = new k(P), P.c && !P.isInteger()) throw Error(io + "Exponent not an integer: " + R(P));
      if (j != null && (j = new k(j)), p = P.e > 14, !S.c || !S.c[0] || S.c[0] == 1 && !S.e && S.c.length == 1 || !P.c || !P.c[0]) return E = new k(Math.pow(+R(S), p ? P.s * (2 - py(P)) : +R(P))), j ? E.mod(j) : E;
      if (v = P.s < 0, j) {
        if (j.c ? !j.c[0] : !j.s) return new k(NaN);
        U = !v && S.isInteger() && j.isInteger(), U && (S = S.mod(j))
      } else {
        if (P.e > 9 && (S.e > 0 || S.e < -1 || (S.e == 0 ? S.c[0] > 1 || p && S.c[1] >= 24e7 : S.c[0] < 8e13 || p && S.c[0] <= 9999975e7))) return g = S.s < 0 && py(P) ? -0 : 0, S.e > -1 && (g = 1 / g), new k(v ? 1 / g : g);
        C && (g = O9(C / ur + 2))
      }
      for (p ? (Y = new k(.5), v && (P.s = 1), x = py(P)) : (I = Math.abs(+R(P)), x = I % 2), E = new k(s);;) {
        if (x) {
          if (E = E.times(S), !E.c) break;
          g ? E.c.length > g && (E.c.length = g) : U && (E = E.mod(j))
        }
        if (I) {
          if (I = oa(I / 2), I === 0) break;
          x = I % 2
        } else if (P = P.times(Y), V(P, P.e + 1, 1), P.e > 14) x = py(P);
        else {
          if (I = +R(P), I === 0) break;
          x = I % 2
        }
        S = S.times(S), g ? S.c && S.c.length > g && (S.c.length = g) : U && (S = S.mod(j))
      }
      return U ? E : (v && (E = s.div(E)), j ? E.mod(j) : g ? V(E, C, a, u) : E)
    }, i.integerValue = function (P) {
      var j = new k(this);
      return P == null ? P = a : Dn(P, 0, 8), V(j, j.e + 1, P)
    }, i.isEqualTo = i.eq = function (P, j) {
      return Tf(this, new k(P, j)) === 0
    }, i.isFinite = function () {
      return !!this.c
    }, i.isGreaterThan = i.gt = function (P, j) {
      return Tf(this, new k(P, j)) > 0
    }, i.isGreaterThanOrEqualTo = i.gte = function (P, j) {
      return (j = Tf(this, new k(P, j))) === 1 || j === 0
    }, i.isInteger = function () {
      return !!this.c && aa(this.e / ur) > this.c.length - 2
    }, i.isLessThan = i.lt = function (P, j) {
      return Tf(this, new k(P, j)) < 0
    }, i.isLessThanOrEqualTo = i.lte = function (P, j) {
      return (j = Tf(this, new k(P, j))) === -1 || j === 0
    }, i.isNaN = function () {
      return !this.s
    }, i.isNegative = function () {
      return this.s < 0
    }, i.isPositive = function () {
      return this.s > 0
    }, i.isZero = function () {
      return !!this.c && this.c[0] == 0
    }, i.minus = function (P, j) {
      var Y, U, I, g, u = this,
        p = u.s;
      if (P = new k(P, j), j = P.s, !p || !j) return new k(NaN);
      if (p != j) return P.s = -j, u.plus(P);
      var v = u.e / ur,
        x = P.e / ur,
        E = u.c,
        S = P.c;
      if (!v || !x) {
        if (!E || !S) return E ? (P.s = -j, P) : new k(S ? u : NaN);
        if (!E[0] || !S[0]) return S[0] ? (P.s = -j, P) : new k(E[0] ? u : a == 3 ? -0 : 0)
      }
      if (v = aa(v), x = aa(x), E = E.slice(), p = v - x) {
        for ((g = p < 0) ? (p = -p, I = E) : (x = v, I = S), I.reverse(), j = p; j--; I.push(0));
        I.reverse()
      } else
        for (U = (g = (p = E.length) < (j = S.length)) ? p : j, p = j = 0; j < U; j++)
          if (E[j] != S[j]) {
            g = E[j] < S[j];
            break
          } if (g && (I = E, E = S, S = I, P.s = -P.s), j = (U = S.length) - (Y = E.length), j > 0)
        for (; j--; E[Y++] = 0);
      for (j = nc - 1; U > p;) {
        if (E[--U] < S[U]) {
          for (Y = U; Y && !E[--Y]; E[Y] = j);
          --E[Y], E[U] += nc
        }
        E[U] -= S[U]
      }
      for (; E[0] == 0; E.splice(0, 1), --x);
      return E[0] ? D(P, E, x) : (P.s = a == 3 ? -1 : 1, P.c = [P.e = 0], P)
    }, i.modulo = i.mod = function (P, j) {
      var Y, U, I = this;
      return P = new k(P, j), !I.c || !P.s || P.c && !P.c[0] ? new k(NaN) : !P.c || I.c && !I.c[0] ? new k(I) : (b == 9 ? (U = P.s, P.s = 1, Y = e(I, P, 0, 3), P.s = U, Y.s *= U) : Y = e(I, P, 0, b), P = I.minus(Y.times(P)), !P.c[0] && b == 1 && (P.s = I.s), P)
    }, i.multipliedBy = i.times = function (P, j) {
      var Y, U, I, g, u, p, v, x, E, S, _, y, A, G, ce, W = this,
        X = W.c,
        Z = (P = new k(P, j)).c;
      if (!X || !Z || !X[0] || !Z[0]) return !W.s || !P.s || X && !X[0] && !Z || Z && !Z[0] && !X ? P.c = P.e = P.s = null : (P.s *= W.s, !X || !Z ? P.c = P.e = null : (P.c = [0], P.e = 0)), P;
      for (U = aa(W.e / ur) + aa(P.e / ur), P.s *= W.s, v = X.length, S = Z.length, v < S && (A = X, X = Z, Z = A, I = v, v = S, S = I), I = v + S, A = []; I--; A.push(0));
      for (G = nc, ce = Wd, I = S; --I >= 0;) {
        for (Y = 0, _ = Z[I] % ce, y = Z[I] / ce | 0, u = v, g = I + u; g > I;) x = X[--u] % ce, E = X[u] / ce | 0, p = y * x + E * _, x = _ * x + p % ce * ce + A[g] + Y, Y = (x / G | 0) + (p / ce | 0) + y * E, A[g--] = x % G;
        A[g] = Y
      }
      return Y ? ++U : A.splice(0, 1), D(P, A, U)
    }, i.negated = function () {
      var P = new k(this);
      return P.s = -P.s || null, P
    }, i.plus = function (P, j) {
      var Y, U = this,
        I = U.s;
      if (P = new k(P, j), j = P.s, !I || !j) return new k(NaN);
      if (I != j) return P.s = -j, U.minus(P);
      var g = U.e / ur,
        u = P.e / ur,
        p = U.c,
        v = P.c;
      if (!g || !u) {
        if (!p || !v) return new k(I / 0);
        if (!p[0] || !v[0]) return v[0] ? P : new k(p[0] ? U : I * 0)
      }
      if (g = aa(g), u = aa(u), p = p.slice(), I = g - u) {
        for (I > 0 ? (u = g, Y = v) : (I = -I, Y = p), Y.reverse(); I--; Y.push(0));
        Y.reverse()
      }
      for (I = p.length, j = v.length, I - j < 0 && (Y = v, v = p, p = Y, j = I), I = 0; j;) I = (p[--j] = p[j] + v[j] + I) / nc | 0, p[j] = nc === p[j] ? 0 : p[j] % nc;
      return I && (p = [I].concat(p), ++u), D(P, p, u)
    }, i.precision = i.sd = function (P, j) {
      var Y, U, I, g = this;
      if (P != null && P !== !!P) return Dn(P, 1, Li), j == null ? j = a : Dn(j, 0, 8), V(new k(g), P, j);
      if (!(Y = g.c)) return null;
      if (I = Y.length - 1, U = I * ur + 1, I = Y[I]) {
        for (; I % 10 == 0; I /= 10, U--);
        for (I = Y[0]; I >= 10; I /= 10, U++);
      }
      return P && g.e + 1 > U && (U = g.e + 1), U
    }, i.shiftedBy = function (P) {
      return Dn(P, -D9, D9), this.times("1e" + P)
    }, i.squareRoot = i.sqrt = function () {
      var P, j, Y, U, I, g = this,
        u = g.c,
        p = g.s,
        v = g.e,
        x = o + 4,
        E = new k("0.5");
      if (p !== 1 || !u || !u[0]) return new k(!p || p < 0 && (!u || u[0]) ? NaN : u ? g : 1 / 0);
      if (p = Math.sqrt(+R(g)), p == 0 || p == 1 / 0 ? (j = ca(u), (j.length + v) % 2 == 0 && (j += "0"), p = Math.sqrt(+j), v = aa((v + 1) / 2) - (v < 0 || v % 2), p == 1 / 0 ? j = "5e" + v : (j = p.toExponential(), j = j.slice(0, j.indexOf("e") + 1) + v), Y = new k(j)) : Y = new k(p + ""), Y.c[0]) {
        for (v = Y.e, p = v + x, p < 3 && (p = 0);;)
          if (I = Y, Y = E.times(I.plus(e(g, I, x, 1))), ca(I.c).slice(0, p) === (j = ca(Y.c)).slice(0, p))
            if (Y.e < v && --p, j = j.slice(p - 3, p + 1), j == "9999" || !U && j == "4999") {
              if (!U && (V(I, I.e + o + 2, 0), I.times(I).eq(g))) {
                Y = I;
                break
              }
              x += 4, p += 4, U = 1
            } else {
              (!+j || !+j.slice(1) && j.charAt(0) == "5") && (V(Y, Y.e + o + 2, 1), P = !Y.times(Y).eq(g));
              break
            }
      }
      return V(Y, Y.e + o + 1, a, P)
    }, i.toExponential = function (P, j) {
      return P != null && (Dn(P, 0, Li), P++), B(this, P, j, 1)
    }, i.toFixed = function (P, j) {
      return P != null && (Dn(P, 0, Li), P = P + this.e + 1), B(this, P, j)
    }, i.toFormat = function (P, j, Y) {
      var U, I = this;
      if (Y == null) P != null && j && typeof j == "object" ? (Y = j, j = null) : P && typeof P == "object" ? (Y = P, P = j = null) : Y = M;
      else if (typeof Y != "object") throw Error(io + "Argument not an object: " + Y);
      if (U = I.toFixed(P, j), I.c) {
        var g, u = U.split("."),
          p = +Y.groupSize,
          v = +Y.secondaryGroupSize,
          x = Y.groupSeparator || "",
          E = u[0],
          S = u[1],
          _ = I.s < 0,
          y = _ ? E.slice(1) : E,
          A = y.length;
        if (v && (g = p, p = v, v = g, A -= g), p > 0 && A > 0) {
          for (g = A % p || p, E = y.substr(0, g); g < A; g += p) E += x + y.substr(g, p);
          v > 0 && (E += x + y.slice(g)), _ && (E = "-" + E)
        }
        U = S ? E + (Y.decimalSeparator || "") + ((v = +Y.fractionGroupSize) ? S.replace(new RegExp("\\d{" + v + "}\\B", "g"), "$&" + (Y.fractionGroupSeparator || "")) : S) : E
      }
      return (Y.prefix || "") + U + (Y.suffix || "")
    }, i.toFraction = function (P) {
      var j, Y, U, I, g, u, p, v, x, E, S, _, y = this,
        A = y.c;
      if (P != null && (p = new k(P), !p.isInteger() && (p.c || p.s !== 1) || p.lt(s))) throw Error(io + "Argument " + (p.isInteger() ? "out of range: " : "not an integer: ") + R(p));
      if (!A) return new k(y);
      for (j = new k(s), x = Y = new k(s), U = v = new k(s), _ = ca(A), g = j.e = _.length - y.e - 1, j.c[0] = L9[(u = g % ur) < 0 ? ur + u : u], P = !P || p.comparedTo(j) > 0 ? g > 0 ? j : x : p, u = f, f = 1 / 0, p = new k(_), v.c[0] = 0; E = e(p, j, 0, 1), I = Y.plus(E.times(U)), I.comparedTo(P) != 1;) Y = U, U = I, x = v.plus(E.times(I = x)), v = I, j = p.minus(E.times(I = j)), p = I;
      return I = e(P.minus(Y), U, 0, 1), v = v.plus(I.times(x)), Y = Y.plus(I.times(U)), v.s = x.s = y.s, g = g * 2, S = e(x, U, g, a).minus(y).abs().comparedTo(e(v, Y, g, a).minus(y).abs()) < 1 ? [x, U] : [v, Y], f = u, S
    }, i.toNumber = function () {
      return +R(this)
    }, i.toPrecision = function (P, j) {
      return P != null && Dn(P, 1, Li), B(this, P, j, 2)
    }, i.toString = function (P) {
      var j, Y = this,
        U = Y.s,
        I = Y.e;
      return I === null ? U ? (j = "Infinity", U < 0 && (j = "-" + j)) : j = "NaN" : (P == null ? j = I <= c || I >= l ? gy(ca(Y.c), I) : Iu(ca(Y.c), I, "0") : P === 10 && $ ? (Y = V(new k(Y), o + I + 1, a), j = Iu(ca(Y.c), Y.e, "0")) : (Dn(P, 2, N.length, "Base"), j = r(Iu(ca(Y.c), I, "0"), 10, P, U, !0)), U < 0 && Y.c[0] && (j = "-" + j)), j
    }, i.valueOf = i.toJSON = function () {
      return R(this)
    }, i._isBigNumber = !0, i[Symbol.toStringTag] = "BigNumber", i[Symbol.for("nodejs.util.inspect.custom")] = i.valueOf, t != null && k.set(t), k
  }

  function aa(t) {
    var e = t | 0;
    return t > 0 || t === e ? e : e - 1
  }

  function ca(t) {
    for (var e, r, n = 1, i = t.length, s = t[0] + ""; n < i;) {
      for (e = t[n++] + "", r = ur - e.length; r--; e = "0" + e);
      s += e
    }
    for (i = s.length; s.charCodeAt(--i) === 48;);
    return s.slice(0, i + 1 || 1)
  }

  function Tf(t, e) {
    var r, n, i = t.c,
      s = e.c,
      o = t.s,
      a = e.s,
      c = t.e,
      l = e.e;
    if (!o || !a) return null;
    if (r = i && !i[0], n = s && !s[0], r || n) return r ? n ? 0 : -a : o;
    if (o != a) return o;
    if (r = o < 0, n = c == l, !i || !s) return n ? 0 : !i ^ r ? 1 : -1;
    if (!n) return c > l ^ r ? 1 : -1;
    for (a = (c = i.length) < (l = s.length) ? c : l, o = 0; o < a; o++)
      if (i[o] != s[o]) return i[o] > s[o] ^ r ? 1 : -1;
    return c == l ? 0 : c > l ^ r ? 1 : -1
  }

  function Dn(t, e, r, n) {
    if (t < e || t > r || t !== oa(t)) throw Error(io + (n || "Argument") + (typeof t == "number" ? t < e || t > r ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(t))
  }

  function py(t) {
    var e = t.c.length - 1;
    return aa(t.e / ur) == e && t.c[e] % 2 != 0
  }

  function gy(t, e) {
    return (t.length > 1 ? t.charAt(0) + "." + t.slice(1) : t) + (e < 0 ? "e" : "e+") + e
  }

  function Iu(t, e, r) {
    var n, i;
    if (e < 0) {
      for (i = r + "."; ++e; i += r);
      t = i + t
    } else if (n = t.length, ++e > n) {
      for (i = r, e -= n; --e; i += r);
      t += i
    } else e < n && (t = t.slice(0, e) + "." + t.slice(e));
    return t
  }
  var my = pM();
  const Or = {
      bigNumber(t) {
        return new my(t)
      },
      multiply(t, e) {
        if (t === void 0 || e === void 0) return my(0);
        const r = new my(t),
          n = new my(e);
        return r.multipliedBy(n)
      },
      formatNumberToLocalString(t, e = 2) {
        return t === void 0 ? "0.00" : typeof t == "number" ? t.toLocaleString("en-US", {
          maximumFractionDigits: e,
          minimumFractionDigits: e
        }) : parseFloat(t).toLocaleString("en-US", {
          maximumFractionDigits: e,
          minimumFractionDigits: e
        })
      }
    },
    Cre = {
      numericInputKeyDown(t, e, r) {
        const n = ["Backspace", "Meta", "Ctrl", "a", "A", "c", "C", "x", "X", "v", "V", "ArrowLeft", "ArrowRight", "Tab"],
          i = t.metaKey || t.ctrlKey,
          s = t.key,
          o = s.toLocaleLowerCase(),
          a = o === "a",
          c = o === "c",
          l = o === "v",
          h = o === "x",
          f = s === ",",
          w = s === ".",
          b = s >= "0" && s <= "9";
        !i && (a || c || l || h) && t.preventDefault(), e === "0" && !f && !w && s === "0" && t.preventDefault(), e === "0" && b && (r(s), t.preventDefault()), (f || w) && (e || (r("0."), t.preventDefault()), (e?.includes(".") || e?.includes(",")) && t.preventDefault()), !b && !n.includes(s) && !w && !f && t.preventDefault()
      }
    },
    Ere = [{
      type: "function",
      name: "transfer",
      stateMutability: "nonpayable",
      inputs: [{
        name: "_to",
        type: "address"
      }, {
        name: "_value",
        type: "uint256"
      }],
      outputs: [{
        name: "",
        type: "bool"
      }]
    }, {
      type: "function",
      name: "transferFrom",
      stateMutability: "nonpayable",
      inputs: [{
        name: "_from",
        type: "address"
      }, {
        name: "_to",
        type: "address"
      }, {
        name: "_value",
        type: "uint256"
      }],
      outputs: [{
        name: "",
        type: "bool"
      }]
    }],
    Are = [{
      type: "function",
      name: "transfer",
      stateMutability: "nonpayable",
      inputs: [{
        name: "recipient",
        type: "address"
      }, {
        name: "amount",
        type: "uint256"
      }],
      outputs: []
    }, {
      type: "function",
      name: "transferFrom",
      stateMutability: "nonpayable",
      inputs: [{
        name: "sender",
        type: "address"
      }, {
        name: "recipient",
        type: "address"
      }, {
        name: "amount",
        type: "uint256"
      }],
      outputs: [{
        name: "",
        type: "bool"
      }]
    }],
    pr = {
      WC_NAME_SUFFIX: ".reown.id",
      WC_NAME_SUFFIX_LEGACY: ".wcn.id",
      BLOCKCHAIN_API_RPC_URL: "https://rpc.walletconnect.org",
      PULSE_API_URL: "https://pulse.walletconnect.org",
      W3M_API_URL: "https://api.web3modal.org",
      CHAIN: {
        EVM: "eip155",
        SOLANA: "solana",
        POLKADOT: "polkadot"
      },
      CHAIN_NAME_MAP: {
        eip155: "Ethereum",
        solana: "Solana",
        polkadot: "Polkadot"
      },
      USDT_CONTRACT_ADDRESSES: ["0xdac17f958d2ee523a2206206994597c13d831ec7", "0xc2132d05d31c914a87c6611c10748aeb04b58e8f", "0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7", "0x919C1c267BC06a7039e03fcc2eF738525769109c", "0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e", "0x55d398326f99059fF775485246999027B3197955", "0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9"]
    },
    Sre = {
      getERC20Abi: t => pr.USDT_CONTRACT_ADDRESSES.includes(t) ? Are : Ere
    },
    B9 = {
      URLS: {
        FAQ: "https://walletconnect.com/faq"
      }
    },
    vn = {
      WALLET_ID: "@appkit/wallet_id",
      WALLET_NAME: "@appkit/wallet_name",
      SOLANA_WALLET: "@appkit/solana_wallet",
      SOLANA_CAIP_CHAIN: "@appkit/solana_caip_chain",
      ACTIVE_CAIP_NETWORK_ID: "@appkit/active_caip_network_id",
      CONNECTED_CONNECTOR: "@appkit/connected_connector",
      CONNECTED_SOCIAL: "@appkit/connected_social",
      CONNECTED_SOCIAL_USERNAME: "@appkit/connected_social_username",
      RECENT_WALLETS: "@appkit/recent_wallets",
      DEEPLINK_CHOICE: "WALLETCONNECT_DEEPLINK_CHOICE"
    },
    bn = {
      setItem(t, e) {
        wy() && localStorage.setItem(t, e)
      },
      getItem(t) {
        if (wy()) return localStorage.getItem(t) || void 0
      },
      removeItem(t) {
        wy() && localStorage.removeItem(t)
      },
      clear() {
        wy() && localStorage.clear()
      }
    };

  function wy() {
    return typeof window < "u" && typeof localStorage < "u"
  }

  function Tu(t, e) {
    return e === "light" ? {
      "--w4m-accent": t?.["--w4m-accent"] || "hsla(231, 100%, 70%, 1)",
      "--w4m-background": "#fff"
    } : {
      "--w4m-accent": t?.["--w4m-accent"] || "hsla(230, 100%, 67%, 1)",
      "--w4m-background": "#121313"
    }
  }

  function Ire(t) {
    return t?.endsWith(pr.WC_NAME_SUFFIX_LEGACY) || t?.endsWith(pr.WC_NAME_SUFFIX)
  }
  const U9 = "https://secure.walletconnect.org",
    gM = [{
      label: "Coinbase",
      name: "coinbase",
      feeRange: "1-2%",
      url: "",
      supportedChains: ["eip155"]
    }, {
      label: "Meld.io",
      name: "meld",
      feeRange: "1-2%",
      url: "https://meldcrypto.com",
      supportedChains: ["eip155", "solana"]
    }],
    Tre = "WXETMuFUQmqqybHuRkSgxv:25B8LJHSfpG6LVjR2ytU5Cwh7Z4Sch2ocoU",
    Qr = {
      FOUR_MINUTES_MS: 24e4,
      TEN_SEC_MS: 1e4,
      FIVE_SEC_MS: 5e3,
      THREE_SEC_MS: 3e3,
      ONE_SEC_MS: 1e3,
      SECURE_SITE: U9,
      SECURE_SITE_DASHBOARD: `${U9}/dashboard`,
      SECURE_SITE_FAVICON: `${U9}/images/favicon.png`,
      RESTRICTED_TIMEZONES: ["ASIA/SHANGHAI", "ASIA/URUMQI", "ASIA/CHONGQING", "ASIA/HARBIN", "ASIA/KASHGAR", "ASIA/MACAU", "ASIA/HONG_KONG", "ASIA/MACAO", "ASIA/BEIJING", "ASIA/HARBIN"],
      WC_COINBASE_PAY_SDK_CHAINS: ["ethereum", "arbitrum", "polygon", "avalanche-c-chain", "optimism", "celo", "base"],
      WC_COINBASE_PAY_SDK_FALLBACK_CHAIN: "ethereum",
      WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP: {
        Ethereum: "ethereum",
        "Arbitrum One": "arbitrum",
        Polygon: "polygon",
        Avalanche: "avalanche-c-chain",
        "OP Mainnet": "optimism",
        Celo: "celo",
        Base: "base"
      },
      WC_COINBASE_ONRAMP_APP_ID: "bf18c88d-495a-463b-b249-0b9d3656cf5e",
      SWAP_SUGGESTED_TOKENS: ["ETH", "UNI", "1INCH", "AAVE", "SOL", "ADA", "AVAX", "DOT", "LINK", "NITRO", "GAIA", "MILK", "TRX", "NEAR", "GNO", "WBTC", "DAI", "WETH", "USDC", "USDT", "ARB", "BAL", "BICO", "CRV", "ENS", "MATIC", "OP"],
      SWAP_POPULAR_TOKENS: ["ETH", "UNI", "1INCH", "AAVE", "SOL", "ADA", "AVAX", "DOT", "LINK", "NITRO", "GAIA", "MILK", "TRX", "NEAR", "GNO", "WBTC", "DAI", "WETH", "USDC", "USDT", "ARB", "BAL", "BICO", "CRV", "ENS", "MATIC", "OP", "METAL", "DAI", "CHAMP", "WOLF", "SALE", "BAL", "BUSD", "MUST", "BTCpx", "ROUTE", "HEX", "WELT", "amDAI", "VSQ", "VISION", "AURUM", "pSP", "SNX", "VC", "LINK", "CHP", "amUSDT", "SPHERE", "FOX", "GIDDY", "GFC", "OMEN", "OX_OLD", "DE", "WNT"],
      SWAP_SUPPORTED_NETWORKS: ["eip155:1", "eip155:42161", "eip155:10", "eip155:324", "eip155:8453", "eip155:56", "eip155:137", "eip155:100", "eip155:43114", "eip155:250", "eip155:8217", "eip155:1313161554"],
      NAMES_SUPPORTED_CHAIN_NAMESPACES: ["eip155"],
      NATIVE_TOKEN_ADDRESS: {
        eip155: "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
        solana: "So11111111111111111111111111111111111111111",
        polkadot: "0x"
      },
      CONVERT_SLIPPAGE_TOLERANCE: 1,
      CONNECT_LABELS: {
        MOBILE: "Open and continue in a new browser tab"
      },
      DEFAULT_FEATURES: {
        swaps: !0,
        onramp: !0,
        email: !0,
        emailShowWallets: !0,
        socials: ["google", "x", "discord", "farcaster", "github", "apple", "facebook"],
        history: !0,
        analytics: !0,
        allWallets: !0,
        legalCheckbox: !1,
        smartSessions: !1
      }
    },
    je = {
      isMobile() {
        return typeof window < "u" ? !!(window.matchMedia("(pointer:coarse)").matches || /Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)) : !1
      },
      checkCaipNetwork(t, e = "") {
        return t?.caipNetworkId.toLocaleLowerCase().includes(e.toLowerCase())
      },
      isAndroid() {
        const t = window.navigator.userAgent.toLowerCase();
        return je.isMobile() && t.includes("android")
      },
      isIos() {
        const t = window.navigator.userAgent.toLowerCase();
        return je.isMobile() && (t.includes("iphone") || t.includes("ipad"))
      },
      isClient() {
        return typeof window < "u"
      },
      isPairingExpired(t) {
        return t ? t - Date.now() <= Qr.TEN_SEC_MS : !0
      },
      isAllowedRetry(t, e = Qr.ONE_SEC_MS) {
        return Date.now() - t >= e
      },
      copyToClopboard(t) {
        navigator.clipboard.writeText(t)
      },
      getPairingExpiry() {
        return Date.now() + Qr.FOUR_MINUTES_MS
      },
      getNetworkId(t) {
        return t?.split(":")[1]
      },
      getPlainAddress(t) {
        return t?.split(":")[2]
      },
      async wait(t) {
        return new Promise(e => {
          setTimeout(e, t)
        })
      },
      debounce(t, e = 500) {
        let r;
        return (...n) => {
          function i() {
            t(...n)
          }
          r && clearTimeout(r), r = setTimeout(i, e)
        }
      },
      isHttpUrl(t) {
        return t.startsWith("http://") || t.startsWith("https://")
      },
      formatNativeUrl(t, e) {
        if (je.isHttpUrl(t)) return this.formatUniversalUrl(t, e);
        let r = t;
        r.includes("://") || (r = t.replaceAll("/", "").replaceAll(":", ""), r = `${r}://`), r.endsWith("/") || (r = `${r}/`), this.isTelegram() && this.isAndroid() && (e = encodeURIComponent(e));
        const n = encodeURIComponent(e);
        return {
          redirect: `${r}wc?uri=${n}`,
          href: r
        }
      },
      formatUniversalUrl(t, e) {
        if (!je.isHttpUrl(t)) return this.formatNativeUrl(t, e);
        let r = t;
        r.endsWith("/") || (r = `${r}/`);
        const n = encodeURIComponent(e);
        return {
          redirect: `${r}wc?uri=${n}`,
          href: r
        }
      },
      getOpenTargetForPlatform(t) {
        return this.isTelegram() ? "_blank" : t
      },
      openHref(t, e, r) {
        window.open(t, this.getOpenTargetForPlatform(e), r || "noreferrer noopener")
      },
      returnOpenHref(t, e, r) {
        return window.open(t, this.getOpenTargetForPlatform(e), r || "noreferrer noopener")
      },
      isTelegram() {
        return typeof window < "u" && (!!window.TelegramWebviewProxy || !!window.Telegram || !!window.TelegramWebviewProxyProto)
      },
      async preloadImage(t) {
        const e = new Promise((r, n) => {
          const i = new Image;
          i.onload = r, i.onerror = n, i.crossOrigin = "anonymous", i.src = t
        });
        return Promise.race([e, je.wait(2e3)])
      },
      formatBalance(t, e) {
        let r = "0.000";
        if (typeof t == "string") {
          const n = Number(t);
          if (n) {
            const i = Math.floor(n * 1e3) / 1e3;
            i && (r = i.toString())
          }
        }
        return `${r}${e?` ${e}`:""}`
      },
      formatBalance2(t, e) {
        let r;
        if (t === "0") r = "0";
        else if (typeof t == "string") {
          const n = Number(t);
          n && (r = n.toString().match(/^-?\d+(?:\.\d{0,3})?/u)?.[0])
        }
        return {
          value: r ?? "0",
          rest: r === "0" ? "000" : "",
          symbol: e
        }
      },
      getApiUrl() {
        return pr.W3M_API_URL
      },
      getBlockchainApiUrl() {
        return pr.BLOCKCHAIN_API_RPC_URL
      },
      getAnalyticsUrl() {
        return pr.PULSE_API_URL
      },
      getUUID() {
        return crypto?.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu, t => {
          const e = Math.random() * 16 | 0;
          return (t === "x" ? e : e & 3 | 8).toString(16)
        })
      },
      parseError(t) {
        return typeof t == "string" ? t : typeof t?.issues?.[0]?.message == "string" ? t.issues[0].message : t instanceof Error ? t.message : "Unknown error"
      },
      sortRequestedNetworks(t, e = []) {
        const r = {};
        return e && t && (t.forEach((n, i) => {
          r[n] = i
        }), e.sort((n, i) => {
          const s = r[n.id],
            o = r[i.id];
          return s !== void 0 && o !== void 0 ? s - o : s !== void 0 ? -1 : o !== void 0 ? 1 : 0
        })), e
      },
      calculateBalance(t) {
        let e = 0;
        for (const r of t) e += r.value ?? 0;
        return e
      },
      formatTokenBalance(t) {
        const e = t.toFixed(2),
          [r, n] = e.split(".");
        return {
          dollars: r,
          pennies: n
        }
      },
      isAddress(t, e = "eip155") {
        switch (e) {
          case "eip155":
            if (/^(?:0x)?[0-9a-f]{40}$/iu.test(t)) {
              if (/^(?:0x)?[0-9a-f]{40}$/iu.test(t) || /^(?:0x)?[0-9A-F]{40}$/iu.test(t)) return !0
            } else return !1;
            return !1;
          case "solana":
            return /[1-9A-HJ-NP-Za-km-z]{32,44}$/iu.test(t);
          default:
            return !1
        }
      },
      uniqueBy(t, e) {
        const r = new Set;
        return t.filter(n => {
          const i = n[e];
          return r.has(i) ? !1 : (r.add(i), !0)
        })
      },
      generateSdkVersion(t, e, r) {
        const i = t.length === 0 ? "universal" : t.map(s => s.adapterType).join(",");
        return `${e}-${i}-${r}`
      }
    };
  async function Mw(...t) {
    const e = await fetch(...t);
    if (!e.ok) throw new Error(`HTTP status code: ${e.status}`, {
      cause: e
    });
    return e
  }
  class vy {
    constructor({
      baseUrl: e,
      clientId: r
    }) {
      this.baseUrl = e, this.clientId = r
    }
    async get({
      headers: e,
      signal: r,
      cache: n,
      ...i
    }) {
      const s = this.createUrl(i);
      return (await Mw(s, {
        method: "GET",
        headers: e,
        signal: r,
        cache: n
      })).json()
    }
    async getBlob({
      headers: e,
      signal: r,
      ...n
    }) {
      const i = this.createUrl(n);
      return (await Mw(i, {
        method: "GET",
        headers: e,
        signal: r
      })).blob()
    }
    async post({
      body: e,
      headers: r,
      signal: n,
      ...i
    }) {
      const s = this.createUrl(i);
      return (await Mw(s, {
        method: "POST",
        headers: r,
        body: e ? JSON.stringify(e) : void 0,
        signal: n
      })).json()
    }
    async put({
      body: e,
      headers: r,
      signal: n,
      ...i
    }) {
      const s = this.createUrl(i);
      return (await Mw(s, {
        method: "PUT",
        headers: r,
        body: e ? JSON.stringify(e) : void 0,
        signal: n
      })).json()
    }
    async delete({
      body: e,
      headers: r,
      signal: n,
      ...i
    }) {
      const s = this.createUrl(i);
      return (await Mw(s, {
        method: "DELETE",
        headers: r,
        body: e ? JSON.stringify(e) : void 0,
        signal: n
      })).json()
    }
    createUrl({
      path: e,
      params: r
    }) {
      const n = new URL(e, this.baseUrl);
      return r && Object.entries(r).forEach(([i, s]) => {
        s && n.searchParams.append(i, s)
      }), this.clientId && n.searchParams.append("clientId", this.clientId), n
    }
  }
  const ln = jr({
      features: Qr.DEFAULT_FEATURES,
      projectId: "",
      sdkType: "appkit",
      sdkVersion: "html-wagmi-undefined"
    }),
    Ue = {
      state: ln,
      subscribeKey(t, e) {
        return ts(ln, t, e)
      },
      setOptions(t) {
        Object.assign(ln, t)
      },
      setFeatures(t) {
        t && Object.entries(t).forEach(([e, r]) => {
          ln.features || (ln.features = Qr.DEFAULT_FEATURES), e in ln.features && (ln.features[e] = r)
        })
      },
      setProjectId(t) {
        ln.projectId = t
      },
      setAllWallets(t) {
        ln.allWallets = t
      },
      setIncludeWalletIds(t) {
        ln.includeWalletIds = t
      },
      setExcludeWalletIds(t) {
        ln.excludeWalletIds = t
      },
      setFeaturedWalletIds(t) {
        ln.featuredWalletIds = t
      },
      setTokens(t) {
        ln.tokens = t
      },
      setTermsConditionsUrl(t) {
        ln.termsConditionsUrl = t
      },
      setPrivacyPolicyUrl(t) {
        ln.privacyPolicyUrl = t
      },
      setCustomWallets(t) {
        ln.customWallets = t
      },
      setIsSiweEnabled(t) {
        ln.isSiweEnabled = t
      },
      setIsUniversalProvider(t) {
        ln.isUniversalProvider = t
      },
      setSdkVersion(t) {
        ln.sdkVersion = t
      },
      setMetadata(t) {
        ln.metadata = t
      },
      setDisableAppend(t) {
        ln.disableAppend = t
      },
      setEIP6963Enabled(t) {
        ln.enableEIP6963 = t
      },
      setDebug(t) {
        ln.debug = t
      },
      setEnableWalletConnect(t) {
        ln.enableWalletConnect = t
      },
      setEnableWallets(t) {
        ln.enableWallets = t
      },
      setHasMultipleAddresses(t) {
        ln.hasMultipleAddresses = t
      },
      setSIWX(t) {
        ln.siwx = t
      }
    },
    kre = {
      purchaseCurrencies: [{
        id: "2b92315d-eab7-5bef-84fa-089a131333f5",
        name: "USD Coin",
        symbol: "USDC",
        networks: [{
          name: "ethereum-mainnet",
          display_name: "Ethereum",
          chain_id: "1",
          contract_address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
        }, {
          name: "polygon-mainnet",
          display_name: "Polygon",
          chain_id: "137",
          contract_address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"
        }]
      }, {
        id: "2b92315d-eab7-5bef-84fa-089a131333f5",
        name: "Ether",
        symbol: "ETH",
        networks: [{
          name: "ethereum-mainnet",
          display_name: "Ethereum",
          chain_id: "1",
          contract_address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
        }, {
          name: "polygon-mainnet",
          display_name: "Polygon",
          chain_id: "137",
          contract_address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"
        }]
      }],
      paymentCurrencies: [{
        id: "USD",
        payment_method_limits: [{
          id: "card",
          min: "10.00",
          max: "7500.00"
        }, {
          id: "ach_bank_account",
          min: "10.00",
          max: "25000.00"
        }]
      }, {
        id: "EUR",
        payment_method_limits: [{
          id: "card",
          min: "10.00",
          max: "7500.00"
        }, {
          id: "ach_bank_account",
          min: "10.00",
          max: "25000.00"
        }]
      }]
    },
    mM = je.getBlockchainApiUrl(),
    qn = jr({
      clientId: null,
      api: new vy({
        baseUrl: mM,
        clientId: null
      })
    }),
    An = {
      state: qn,
      fetchIdentity({
        address: t
      }) {
        return qn.api.get({
          path: `/v1/identity/${t}`,
          params: {
            projectId: Ue.state.projectId,
            sender: fe.state.activeCaipAddress ? je.getPlainAddress(fe.state.activeCaipAddress) : void 0
          }
        })
      },
      fetchTransactions({
        account: t,
        projectId: e,
        cursor: r,
        onramp: n,
        signal: i,
        cache: s,
        chainId: o
      }) {
        return qn.api.get({
          path: `/v1/account/${t}/history`,
          params: {
            projectId: e,
            cursor: r,
            onramp: n,
            chainId: o
          },
          signal: i,
          cache: s
        })
      },
      fetchSwapQuote({
        projectId: t,
        amount: e,
        userAddress: r,
        from: n,
        to: i,
        gasPrice: s
      }) {
        return qn.api.get({
          path: "/v1/convert/quotes",
          headers: {
            "Content-Type": "application/json"
          },
          params: {
            projectId: t,
            amount: e,
            userAddress: r,
            from: n,
            to: i,
            gasPrice: s
          }
        })
      },
      fetchSwapTokens({
        projectId: t,
        chainId: e
      }) {
        return qn.api.get({
          path: "/v1/convert/tokens",
          params: {
            projectId: t,
            chainId: e
          }
        })
      },
      fetchTokenPrice({
        projectId: t,
        addresses: e
      }) {
        return qn.api.post({
          path: "/v1/fungible/price",
          body: {
            projectId: t,
            currency: "usd",
            addresses: e
          },
          headers: {
            "Content-Type": "application/json"
          }
        })
      },
      fetchSwapAllowance({
        projectId: t,
        tokenAddress: e,
        userAddress: r
      }) {
        const {
          sdkType: n,
          sdkVersion: i
        } = Ue.state;
        return qn.api.get({
          path: "/v1/convert/allowance",
          params: {
            projectId: t,
            tokenAddress: e,
            userAddress: r
          },
          headers: {
            "Content-Type": "application/json",
            "x-sdk-type": n,
            "x-sdk-version": i || "html-wagmi-4.2.2"
          }
        })
      },
      fetchGasPrice({
        projectId: t,
        chainId: e
      }) {
        const {
          sdkType: r,
          sdkVersion: n
        } = Ue.state;
        return qn.api.get({
          path: "/v1/convert/gas-price",
          headers: {
            "Content-Type": "application/json",
            "x-sdk-type": r,
            "x-sdk-version": n || "html-wagmi-4.2.2"
          },
          params: {
            projectId: t,
            chainId: e
          }
        })
      },
      generateSwapCalldata({
        amount: t,
        from: e,
        projectId: r,
        to: n,
        userAddress: i
      }) {
        return qn.api.post({
          path: "/v1/convert/build-transaction",
          headers: {
            "Content-Type": "application/json"
          },
          body: {
            amount: t,
            eip155: {
              slippage: Qr.CONVERT_SLIPPAGE_TOLERANCE
            },
            from: e,
            projectId: r,
            to: n,
            userAddress: i
          }
        })
      },
      generateApproveCalldata({
        from: t,
        projectId: e,
        to: r,
        userAddress: n
      }) {
        const {
          sdkType: i,
          sdkVersion: s
        } = Ue.state;
        return qn.api.get({
          path: "/v1/convert/build-approve",
          headers: {
            "Content-Type": "application/json",
            "x-sdk-type": i,
            "x-sdk-version": s || "html-wagmi-4.2.2"
          },
          params: {
            projectId: e,
            userAddress: n,
            from: t,
            to: r
          }
        })
      },
      async getBalance(t, e, r) {
        const {
          sdkType: n,
          sdkVersion: i
        } = Ue.state;
        return qn.api.get({
          path: `/v1/account/${t}/balance`,
          headers: {
            "x-sdk-type": n,
            "x-sdk-version": i || "html-wagmi-4.2.2"
          },
          params: {
            currency: "usd",
            projectId: Ue.state.projectId,
            chainId: e,
            forceUpdate: r
          }
        })
      },
      async lookupEnsName(t) {
        return qn.api.get({
          path: `/v1/profile/account/${t}`,
          params: {
            projectId: Ue.state.projectId,
            apiVersion: "2"
          }
        })
      },
      async reverseLookupEnsName({
        address: t
      }) {
        return qn.api.get({
          path: `/v1/profile/reverse/${t}`,
          params: {
            sender: ke.state.address,
            projectId: Ue.state.projectId,
            apiVersion: "2"
          }
        })
      },
      async getEnsNameSuggestions(t) {
        return qn.api.get({
          path: `/v1/profile/suggestions/${t}`,
          params: {
            projectId: Ue.state.projectId,
            zone: "reown.id"
          }
        })
      },
      async registerEnsName({
        coinType: t,
        address: e,
        message: r,
        signature: n
      }) {
        return qn.api.post({
          path: "/v1/profile/account",
          body: {
            coin_type: t,
            address: e,
            message: r,
            signature: n
          },
          headers: {
            "Content-Type": "application/json"
          }
        })
      },
      async generateOnRampURL({
        destinationWallets: t,
        partnerUserId: e,
        defaultNetwork: r,
        purchaseAmount: n,
        paymentAmount: i
      }) {
        return (await qn.api.post({
          path: "/v1/generators/onrampurl",
          params: {
            projectId: Ue.state.projectId
          },
          body: {
            destinationWallets: t,
            defaultNetwork: r,
            partnerUserId: e,
            defaultExperience: "buy",
            presetCryptoAmount: n,
            presetFiatAmount: i
          }
        })).url
      },
      async getOnrampOptions() {
        try {
          return await qn.api.get({
            path: "/v1/onramp/options",
            params: {
              projectId: Ue.state.projectId
            }
          })
        } catch {
          return kre
        }
      },
      async getOnrampQuote({
        purchaseCurrency: t,
        paymentCurrency: e,
        amount: r,
        network: n
      }) {
        try {
          return await qn.api.post({
            path: "/v1/onramp/quote",
            params: {
              projectId: Ue.state.projectId
            },
            body: {
              purchaseCurrency: t,
              paymentCurrency: e,
              amount: r,
              network: n
            }
          })
        } catch {
          return {
            coinbaseFee: {
              amount: r,
              currency: e.id
            },
            networkFee: {
              amount: r,
              currency: e.id
            },
            paymentSubtotal: {
              amount: r,
              currency: e.id
            },
            paymentTotal: {
              amount: r,
              currency: e.id
            },
            purchaseAmount: {
              amount: r,
              currency: e.id
            },
            quoteId: "mocked-quote-id"
          }
        }
      },
      getSmartSessions(t) {
        return qn.api.get({
          path: `/v1/sessions/${t}`,
          params: {
            projectId: Ue.state.projectId
          }
        })
      },
      revokeSmartSession(t, e, r) {
        return qn.api.post({
          path: `/v1/sessions/${t}/revoke`,
          params: {
            projectId: Ue.state.projectId
          },
          body: {
            pci: e,
            signature: r
          }
        })
      },
      setClientId(t) {
        qn.clientId = t, qn.api = new vy({
          baseUrl: mM,
          clientId: t
        })
      }
    },
    No = jr({
      message: "",
      variant: "success",
      svg: void 0,
      open: !1
    }),
    Rt = {
      state: No,
      subscribeKey(t, e) {
        return ts(No, t, e)
      },
      showLoading(t) {
        this._showMessage({
          message: t,
          variant: "loading"
        })
      },
      showSuccess(t) {
        this._showMessage({
          message: t,
          variant: "success"
        })
      },
      showSvg(t, e) {
        this._showMessage({
          message: t,
          svg: e
        })
      },
      showError(t) {
        const e = je.parseError(t);
        this._showMessage({
          message: e,
          variant: "error"
        })
      },
      hide() {
        No.open = !1
      },
      _showMessage({
        message: t,
        svg: e,
        variant: r = "success"
      }) {
        No.open ? (No.open = !1, setTimeout(() => {
          No.message = t, No.variant = r, No.svg = e, No.open = !0
        }, 150)) : (No.message = t, No.variant = r, No.svg = e, No.open = !0)
      }
    },
    Rre = je.getAnalyticsUrl(),
    Nre = new vy({
      baseUrl: Rre,
      clientId: null
    }),
    Mre = ["MODAL_CREATED"],
    u1 = jr({
      timestamp: Date.now(),
      data: {
        type: "track",
        event: "MODAL_CREATED"
      }
    }),
    nt = {
      state: u1,
      subscribe(t) {
        return Rn(u1, () => t(u1))
      },
      _getApiHeaders() {
        const {
          projectId: t,
          sdkType: e,
          sdkVersion: r
        } = Ue.state;
        return {
          "x-project-id": t,
          "x-sdk-type": e,
          "x-sdk-version": r || "html-wagmi-4.2.2"
        }
      },
      async _sendAnalyticsEvent(t) {
        try {
          if (Mre.includes(t.data.event) || typeof window > "u") return;
          await Nre.post({
            path: "/e",
            headers: nt._getApiHeaders(),
            body: {
              eventId: je.getUUID(),
              url: window.location.href,
              domain: window.location.hostname,
              timestamp: t.timestamp,
              props: t.data
            }
          })
        } catch {}
      },
      sendEvent(t) {
        u1.timestamp = Date.now(), u1.data = t, Ue.state.features?.analytics && nt._sendAnalyticsEvent(u1)
      }
    };
  var d1 = {},
    by = {};
  by.byteLength = Ore, by.toByteArray = Lre, by.fromByteArray = jre;
  for (var Qc = [], la = [], Pre = typeof Uint8Array < "u" ? Uint8Array : Array, j9 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", h1 = 0, $re = j9.length; h1 < $re; ++h1) Qc[h1] = j9[h1], la[j9.charCodeAt(h1)] = h1;
  la[45] = 62, la[95] = 63;

  function wM(t) {
    var e = t.length;
    if (e % 4 > 0) throw new Error("Invalid string. Length must be a multiple of 4");
    var r = t.indexOf("=");
    r === -1 && (r = e);
    var n = r === e ? 0 : 4 - r % 4;
    return [r, n]
  }

  function Ore(t) {
    var e = wM(t),
      r = e[0],
      n = e[1];
    return (r + n) * 3 / 4 - n
  }

  function Dre(t, e, r) {
    return (e + r) * 3 / 4 - r
  }

  function Lre(t) {
    var e, r = wM(t),
      n = r[0],
      i = r[1],
      s = new Pre(Dre(t, n, i)),
      o = 0,
      a = i > 0 ? n - 4 : n,
      c;
    for (c = 0; c < a; c += 4) e = la[t.charCodeAt(c)] << 18 | la[t.charCodeAt(c + 1)] << 12 | la[t.charCodeAt(c + 2)] << 6 | la[t.charCodeAt(c + 3)], s[o++] = e >> 16 & 255, s[o++] = e >> 8 & 255, s[o++] = e & 255;
    return i === 2 && (e = la[t.charCodeAt(c)] << 2 | la[t.charCodeAt(c + 1)] >> 4, s[o++] = e & 255), i === 1 && (e = la[t.charCodeAt(c)] << 10 | la[t.charCodeAt(c + 1)] << 4 | la[t.charCodeAt(c + 2)] >> 2, s[o++] = e >> 8 & 255, s[o++] = e & 255), s
  }

  function Bre(t) {
    return Qc[t >> 18 & 63] + Qc[t >> 12 & 63] + Qc[t >> 6 & 63] + Qc[t & 63]
  }

  function Ure(t, e, r) {
    for (var n, i = [], s = e; s < r; s += 3) n = (t[s] << 16 & 16711680) + (t[s + 1] << 8 & 65280) + (t[s + 2] & 255), i.push(Bre(n));
    return i.join("")
  }

  function jre(t) {
    for (var e, r = t.length, n = r % 3, i = [], s = 16383, o = 0, a = r - n; o < a; o += s) i.push(Ure(t, o, o + s > a ? a : o + s));
    return n === 1 ? (e = t[r - 1], i.push(Qc[e >> 2] + Qc[e << 4 & 63] + "==")) : n === 2 && (e = (t[r - 2] << 8) + t[r - 1], i.push(Qc[e >> 10] + Qc[e >> 4 & 63] + Qc[e << 2 & 63] + "=")), i.join("")
  }
  var F9 = {}; /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
  F9.read = function (t, e, r, n, i) {
    var s, o, a = i * 8 - n - 1,
      c = (1 << a) - 1,
      l = c >> 1,
      h = -7,
      f = r ? i - 1 : 0,
      w = r ? -1 : 1,
      b = t[e + f];
    for (f += w, s = b & (1 << -h) - 1, b >>= -h, h += a; h > 0; s = s * 256 + t[e + f], f += w, h -= 8);
    for (o = s & (1 << -h) - 1, s >>= -h, h += n; h > 0; o = o * 256 + t[e + f], f += w, h -= 8);
    if (s === 0) s = 1 - l;
    else {
      if (s === c) return o ? NaN : (b ? -1 : 1) * (1 / 0);
      o = o + Math.pow(2, n), s = s - l
    }
    return (b ? -1 : 1) * o * Math.pow(2, s - n)
  }, F9.write = function (t, e, r, n, i, s) {
    var o, a, c, l = s * 8 - i - 1,
      h = (1 << l) - 1,
      f = h >> 1,
      w = i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
      b = n ? 0 : s - 1,
      C = n ? 1 : -1,
      M = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
    for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (a = isNaN(e) ? 1 : 0, o = h) : (o = Math.floor(Math.log(e) / Math.LN2), e * (c = Math.pow(2, -o)) < 1 && (o--, c *= 2), o + f >= 1 ? e += w / c : e += w * Math.pow(2, 1 - f), e * c >= 2 && (o++, c /= 2), o + f >= h ? (a = 0, o = h) : o + f >= 1 ? (a = (e * c - 1) * Math.pow(2, i), o = o + f) : (a = e * Math.pow(2, f - 1) * Math.pow(2, i), o = 0)); i >= 8; t[r + b] = a & 255, b += C, a /= 256, i -= 8);
    for (o = o << i | a, l += i; l > 0; t[r + b] = o & 255, b += C, o /= 256, l -= 8);
    t[r + b - C] |= M * 128
  };
  /*!
   * The buffer module from node.js, for the browser.
   *
   * @author   Feross Aboukhadijeh <https://feross.org>
   * @license  MIT
   */
  (function (t) {
    const e = by,
      r = F9,
      n = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
    t.Buffer = a, t.SlowBuffer = k, t.INSPECT_MAX_BYTES = 50;
    const i = 2147483647;
    t.kMaxLength = i, a.TYPED_ARRAY_SUPPORT = s(), !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 s() {
      try {
        const J = new Uint8Array(1),
          L = {
            foo: function () {
              return 42
            }
          };
        return Object.setPrototypeOf(L, Uint8Array.prototype), Object.setPrototypeOf(J, L), J.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(J) {
      if (J > i) throw new RangeError('The value "' + J + '" is invalid for option "size"');
      const L = new Uint8Array(J);
      return Object.setPrototypeOf(L, a.prototype), L
    }

    function a(J, L, z) {
      if (typeof J == "number") {
        if (typeof L == "string") throw new TypeError('The "string" argument must be of type string. Received type number');
        return f(J)
      }
      return c(J, L, z)
    }
    a.poolSize = 8192;

    function c(J, L, z) {
      if (typeof J == "string") return w(J, L);
      if (ArrayBuffer.isView(J)) return C(J);
      if (J == null) throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof J);
      if (He(J, ArrayBuffer) || J && He(J.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (He(J, SharedArrayBuffer) || J && He(J.buffer, SharedArrayBuffer))) return M(J, L, z);
      if (typeof J == "number") throw new TypeError('The "value" argument must not be of type number. Received type number');
      const ie = J.valueOf && J.valueOf();
      if (ie != null && ie !== J) return a.from(ie, L, z);
      const ue = N(J);
      if (ue) return ue;
      if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof J[Symbol.toPrimitive] == "function") return a.from(J[Symbol.toPrimitive]("string"), L, z);
      throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof J)
    }
    a.from = function (J, L, z) {
      return c(J, L, z)
    }, Object.setPrototypeOf(a.prototype, Uint8Array.prototype), Object.setPrototypeOf(a, Uint8Array);

    function l(J) {
      if (typeof J != "number") throw new TypeError('"size" argument must be of type number');
      if (J < 0) throw new RangeError('The value "' + J + '" is invalid for option "size"')
    }

    function h(J, L, z) {
      return l(J), J <= 0 ? o(J) : L !== void 0 ? typeof z == "string" ? o(J).fill(L, z) : o(J).fill(L) : o(J)
    }
    a.alloc = function (J, L, z) {
      return h(J, L, z)
    };

    function f(J) {
      return l(J), o(J < 0 ? 0 : $(J) | 0)
    }
    a.allocUnsafe = function (J) {
      return f(J)
    }, a.allocUnsafeSlow = function (J) {
      return f(J)
    };

    function w(J, L) {
      if ((typeof L != "string" || L === "") && (L = "utf8"), !a.isEncoding(L)) throw new TypeError("Unknown encoding: " + L);
      const z = B(J, L) | 0;
      let ie = o(z);
      const ue = ie.write(J, L);
      return ue !== z && (ie = ie.slice(0, ue)), ie
    }

    function b(J) {
      const L = J.length < 0 ? 0 : $(J.length) | 0,
        z = o(L);
      for (let ie = 0; ie < L; ie += 1) z[ie] = J[ie] & 255;
      return z
    }

    function C(J) {
      if (He(J, Uint8Array)) {
        const L = new Uint8Array(J);
        return M(L.buffer, L.byteOffset, L.byteLength)
      }
      return b(J)
    }

    function M(J, L, z) {
      if (L < 0 || J.byteLength < L) throw new RangeError('"offset" is outside of buffer bounds');
      if (J.byteLength < L + (z || 0)) throw new RangeError('"length" is outside of buffer bounds');
      let ie;
      return L === void 0 && z === void 0 ? ie = new Uint8Array(J) : z === void 0 ? ie = new Uint8Array(J, L) : ie = new Uint8Array(J, L, z), Object.setPrototypeOf(ie, a.prototype), ie
    }

    function N(J) {
      if (a.isBuffer(J)) {
        const L = $(J.length) | 0,
          z = o(L);
        return z.length === 0 || J.copy(z, 0, 0, L), z
      }
      if (J.length !== void 0) return typeof J.length != "number" || we(J.length) ? o(0) : b(J);
      if (J.type === "Buffer" && Array.isArray(J.data)) return b(J.data)
    }

    function $(J) {
      if (J >= i) throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + i.toString(16) + " bytes");
      return J | 0
    }

    function k(J) {
      return +J != J && (J = 0), a.alloc(+J)
    }
    a.isBuffer = function (L) {
      return L != null && L._isBuffer === !0 && L !== a.prototype
    }, a.compare = function (L, z) {
      if (He(L, Uint8Array) && (L = a.from(L, L.offset, L.byteLength)), He(z, Uint8Array) && (z = a.from(z, z.offset, z.byteLength)), !a.isBuffer(L) || !a.isBuffer(z)) throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');
      if (L === z) return 0;
      let ie = L.length,
        ue = z.length;
      for (let me = 0, be = Math.min(ie, ue); me < be; ++me)
        if (L[me] !== z[me]) {
          ie = L[me], ue = z[me];
          break
        } return ie < ue ? -1 : ue < ie ? 1 : 0
    }, a.isEncoding = function (L) {
      switch (String(L).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 (L, z) {
      if (!Array.isArray(L)) throw new TypeError('"list" argument must be an Array of Buffers');
      if (L.length === 0) return a.alloc(0);
      let ie;
      if (z === void 0)
        for (z = 0, ie = 0; ie < L.length; ++ie) z += L[ie].length;
      const ue = a.allocUnsafe(z);
      let me = 0;
      for (ie = 0; ie < L.length; ++ie) {
        let be = L[ie];
        if (He(be, Uint8Array)) me + be.length > ue.length ? (a.isBuffer(be) || (be = a.from(be)), be.copy(ue, me)) : Uint8Array.prototype.set.call(ue, be, me);
        else if (a.isBuffer(be)) be.copy(ue, me);
        else throw new TypeError('"list" argument must be an Array of Buffers');
        me += be.length
      }
      return ue
    };

    function B(J, L) {
      if (a.isBuffer(J)) return J.length;
      if (ArrayBuffer.isView(J) || He(J, ArrayBuffer)) return J.byteLength;
      if (typeof J != "string") throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof J);
      const z = J.length,
        ie = arguments.length > 2 && arguments[2] === !0;
      if (!ie && z === 0) return 0;
      let ue = !1;
      for (;;) switch (L) {
        case "ascii":
        case "latin1":
        case "binary":
          return z;
        case "utf8":
        case "utf-8":
          return De(J).length;
        case "ucs2":
        case "ucs-2":
        case "utf16le":
        case "utf-16le":
          return z * 2;
        case "hex":
          return z >>> 1;
        case "base64":
          return Ze(J).length;
        default:
          if (ue) return ie ? -1 : De(J).length;
          L = ("" + L).toLowerCase(), ue = !0
      }
    }
    a.byteLength = B;

    function F(J, L, z) {
      let ie = !1;
      if ((L === void 0 || L < 0) && (L = 0), L > this.length || ((z === void 0 || z > this.length) && (z = this.length), z <= 0) || (z >>>= 0, L >>>= 0, z <= L)) return "";
      for (J || (J = "utf8");;) switch (J) {
        case "hex":
          return S(this, L, z);
        case "utf8":
        case "utf-8":
          return u(this, L, z);
        case "ascii":
          return x(this, L, z);
        case "latin1":
        case "binary":
          return E(this, L, z);
        case "base64":
          return g(this, L, z);
        case "ucs2":
        case "ucs-2":
        case "utf16le":
        case "utf-16le":
          return _(this, L, z);
        default:
          if (ie) throw new TypeError("Unknown encoding: " + J);
          J = (J + "").toLowerCase(), ie = !0
      }
    }
    a.prototype._isBuffer = !0;

    function D(J, L, z) {
      const ie = J[L];
      J[L] = J[z], J[z] = ie
    }
    a.prototype.swap16 = function () {
      const L = this.length;
      if (L % 2 !== 0) throw new RangeError("Buffer size must be a multiple of 16-bits");
      for (let z = 0; z < L; z += 2) D(this, z, z + 1);
      return this
    }, a.prototype.swap32 = function () {
      const L = this.length;
      if (L % 4 !== 0) throw new RangeError("Buffer size must be a multiple of 32-bits");
      for (let z = 0; z < L; z += 4) D(this, z, z + 3), D(this, z + 1, z + 2);
      return this
    }, a.prototype.swap64 = function () {
      const L = this.length;
      if (L % 8 !== 0) throw new RangeError("Buffer size must be a multiple of 64-bits");
      for (let z = 0; z < L; z += 8) D(this, z, z + 7), D(this, z + 1, z + 6), D(this, z + 2, z + 5), D(this, z + 3, z + 4);
      return this
    }, a.prototype.toString = function () {
      const L = this.length;
      return L === 0 ? "" : arguments.length === 0 ? u(this, 0, L) : F.apply(this, arguments)
    }, a.prototype.toLocaleString = a.prototype.toString, a.prototype.equals = function (L) {
      if (!a.isBuffer(L)) throw new TypeError("Argument must be a Buffer");
      return this === L ? !0 : a.compare(this, L) === 0
    }, a.prototype.inspect = function () {
      let L = "";
      const z = t.INSPECT_MAX_BYTES;
      return L = this.toString("hex", 0, z).replace(/(.{2})/g, "$1 ").trim(), this.length > z && (L += " ... "), "<Buffer " + L + ">"
    }, n && (a.prototype[n] = a.prototype.inspect), a.prototype.compare = function (L, z, ie, ue, me) {
      if (He(L, Uint8Array) && (L = a.from(L, L.offset, L.byteLength)), !a.isBuffer(L)) throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof L);
      if (z === void 0 && (z = 0), ie === void 0 && (ie = L ? L.length : 0), ue === void 0 && (ue = 0), me === void 0 && (me = this.length), z < 0 || ie > L.length || ue < 0 || me > this.length) throw new RangeError("out of range index");
      if (ue >= me && z >= ie) return 0;
      if (ue >= me) return -1;
      if (z >= ie) return 1;
      if (z >>>= 0, ie >>>= 0, ue >>>= 0, me >>>= 0, this === L) return 0;
      let be = me - ue,
        Le = ie - z;
      const ze = Math.min(be, Le),
        Qe = this.slice(ue, me),
        Xe = L.slice(z, ie);
      for (let Je = 0; Je < ze; ++Je)
        if (Qe[Je] !== Xe[Je]) {
          be = Qe[Je], Le = Xe[Je];
          break
        } return be < Le ? -1 : Le < be ? 1 : 0
    };

    function V(J, L, z, ie, ue) {
      if (J.length === 0) return -1;
      if (typeof z == "string" ? (ie = z, z = 0) : z > 2147483647 ? z = 2147483647 : z < -2147483648 && (z = -2147483648), z = +z, we(z) && (z = ue ? 0 : J.length - 1), z < 0 && (z = J.length + z), z >= J.length) {
        if (ue) return -1;
        z = J.length - 1
      } else if (z < 0)
        if (ue) z = 0;
        else return -1;
      if (typeof L == "string" && (L = a.from(L, ie)), a.isBuffer(L)) return L.length === 0 ? -1 : R(J, L, z, ie, ue);
      if (typeof L == "number") return L = L & 255, typeof Uint8Array.prototype.indexOf == "function" ? ue ? Uint8Array.prototype.indexOf.call(J, L, z) : Uint8Array.prototype.lastIndexOf.call(J, L, z) : R(J, [L], z, ie, ue);
      throw new TypeError("val must be string, number or Buffer")
    }

    function R(J, L, z, ie, ue) {
      let me = 1,
        be = J.length,
        Le = L.length;
      if (ie !== void 0 && (ie = String(ie).toLowerCase(), ie === "ucs2" || ie === "ucs-2" || ie === "utf16le" || ie === "utf-16le")) {
        if (J.length < 2 || L.length < 2) return -1;
        me = 2, be /= 2, Le /= 2, z /= 2
      }

      function ze(Xe, Je) {
        return me === 1 ? Xe[Je] : Xe.readUInt16BE(Je * me)
      }
      let Qe;
      if (ue) {
        let Xe = -1;
        for (Qe = z; Qe < be; Qe++)
          if (ze(J, Qe) === ze(L, Xe === -1 ? 0 : Qe - Xe)) {
            if (Xe === -1 && (Xe = Qe), Qe - Xe + 1 === Le) return Xe * me
          } else Xe !== -1 && (Qe -= Qe - Xe), Xe = -1
      } else
        for (z + Le > be && (z = be - Le), Qe = z; Qe >= 0; Qe--) {
          let Xe = !0;
          for (let Je = 0; Je < Le; Je++)
            if (ze(J, Qe + Je) !== ze(L, Je)) {
              Xe = !1;
              break
            } if (Xe) return Qe
        }
      return -1
    }
    a.prototype.includes = function (L, z, ie) {
      return this.indexOf(L, z, ie) !== -1
    }, a.prototype.indexOf = function (L, z, ie) {
      return V(this, L, z, ie, !0)
    }, a.prototype.lastIndexOf = function (L, z, ie) {
      return V(this, L, z, ie, !1)
    };

    function P(J, L, z, ie) {
      z = Number(z) || 0;
      const ue = J.length - z;
      ie ? (ie = Number(ie), ie > ue && (ie = ue)) : ie = ue;
      const me = L.length;
      ie > me / 2 && (ie = me / 2);
      let be;
      for (be = 0; be < ie; ++be) {
        const Le = parseInt(L.substr(be * 2, 2), 16);
        if (we(Le)) return be;
        J[z + be] = Le
      }
      return be
    }

    function j(J, L, z, ie) {
      return qe(De(L, J.length - z), J, z, ie)
    }

    function Y(J, L, z, ie) {
      return qe(et(L), J, z, ie)
    }

    function U(J, L, z, ie) {
      return qe(Ze(L), J, z, ie)
    }

    function I(J, L, z, ie) {
      return qe(rt(L, J.length - z), J, z, ie)
    }
    a.prototype.write = function (L, z, ie, ue) {
      if (z === void 0) ue = "utf8", ie = this.length, z = 0;
      else if (ie === void 0 && typeof z == "string") ue = z, ie = this.length, z = 0;
      else if (isFinite(z)) z = z >>> 0, isFinite(ie) ? (ie = ie >>> 0, ue === void 0 && (ue = "utf8")) : (ue = ie, ie = void 0);
      else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
      const me = this.length - z;
      if ((ie === void 0 || ie > me) && (ie = me), L.length > 0 && (ie < 0 || z < 0) || z > this.length) throw new RangeError("Attempt to write outside buffer bounds");
      ue || (ue = "utf8");
      let be = !1;
      for (;;) switch (ue) {
        case "hex":
          return P(this, L, z, ie);
        case "utf8":
        case "utf-8":
          return j(this, L, z, ie);
        case "ascii":
        case "latin1":
        case "binary":
          return Y(this, L, z, ie);
        case "base64":
          return U(this, L, z, ie);
        case "ucs2":
        case "ucs-2":
        case "utf16le":
        case "utf-16le":
          return I(this, L, z, ie);
        default:
          if (be) throw new TypeError("Unknown encoding: " + ue);
          ue = ("" + ue).toLowerCase(), be = !0
      }
    }, a.prototype.toJSON = function () {
      return {
        type: "Buffer",
        data: Array.prototype.slice.call(this._arr || this, 0)
      }
    };

    function g(J, L, z) {
      return L === 0 && z === J.length ? e.fromByteArray(J) : e.fromByteArray(J.slice(L, z))
    }

    function u(J, L, z) {
      z = Math.min(J.length, z);
      const ie = [];
      let ue = L;
      for (; ue < z;) {
        const me = J[ue];
        let be = null,
          Le = me > 239 ? 4 : me > 223 ? 3 : me > 191 ? 2 : 1;
        if (ue + Le <= z) {
          let ze, Qe, Xe, Je;
          switch (Le) {
            case 1:
              me < 128 && (be = me);
              break;
            case 2:
              ze = J[ue + 1], (ze & 192) === 128 && (Je = (me & 31) << 6 | ze & 63, Je > 127 && (be = Je));
              break;
            case 3:
              ze = J[ue + 1], Qe = J[ue + 2], (ze & 192) === 128 && (Qe & 192) === 128 && (Je = (me & 15) << 12 | (ze & 63) << 6 | Qe & 63, Je > 2047 && (Je < 55296 || Je > 57343) && (be = Je));
              break;
            case 4:
              ze = J[ue + 1], Qe = J[ue + 2], Xe = J[ue + 3], (ze & 192) === 128 && (Qe & 192) === 128 && (Xe & 192) === 128 && (Je = (me & 15) << 18 | (ze & 63) << 12 | (Qe & 63) << 6 | Xe & 63, Je > 65535 && Je < 1114112 && (be = Je))
          }
        }
        be === null ? (be = 65533, Le = 1) : be > 65535 && (be -= 65536, ie.push(be >>> 10 & 1023 | 55296), be = 56320 | be & 1023), ie.push(be), ue += Le
      }
      return v(ie)
    }
    const p = 4096;

    function v(J) {
      const L = J.length;
      if (L <= p) return String.fromCharCode.apply(String, J);
      let z = "",
        ie = 0;
      for (; ie < L;) z += String.fromCharCode.apply(String, J.slice(ie, ie += p));
      return z
    }

    function x(J, L, z) {
      let ie = "";
      z = Math.min(J.length, z);
      for (let ue = L; ue < z; ++ue) ie += String.fromCharCode(J[ue] & 127);
      return ie
    }

    function E(J, L, z) {
      let ie = "";
      z = Math.min(J.length, z);
      for (let ue = L; ue < z; ++ue) ie += String.fromCharCode(J[ue]);
      return ie
    }

    function S(J, L, z) {
      const ie = J.length;
      (!L || L < 0) && (L = 0), (!z || z < 0 || z > ie) && (z = ie);
      let ue = "";
      for (let me = L; me < z; ++me) ue += xe[J[me]];
      return ue
    }

    function _(J, L, z) {
      const ie = J.slice(L, z);
      let ue = "";
      for (let me = 0; me < ie.length - 1; me += 2) ue += String.fromCharCode(ie[me] + ie[me + 1] * 256);
      return ue
    }
    a.prototype.slice = function (L, z) {
      const ie = this.length;
      L = ~~L, z = z === void 0 ? ie : ~~z, L < 0 ? (L += ie, L < 0 && (L = 0)) : L > ie && (L = ie), z < 0 ? (z += ie, z < 0 && (z = 0)) : z > ie && (z = ie), z < L && (z = L);
      const ue = this.subarray(L, z);
      return Object.setPrototypeOf(ue, a.prototype), ue
    };

    function y(J, L, z) {
      if (J % 1 !== 0 || J < 0) throw new RangeError("offset is not uint");
      if (J + L > z) throw new RangeError("Trying to access beyond buffer length")
    }
    a.prototype.readUintLE = a.prototype.readUIntLE = function (L, z, ie) {
      L = L >>> 0, z = z >>> 0, ie || y(L, z, this.length);
      let ue = this[L],
        me = 1,
        be = 0;
      for (; ++be < z && (me *= 256);) ue += this[L + be] * me;
      return ue
    }, a.prototype.readUintBE = a.prototype.readUIntBE = function (L, z, ie) {
      L = L >>> 0, z = z >>> 0, ie || y(L, z, this.length);
      let ue = this[L + --z],
        me = 1;
      for (; z > 0 && (me *= 256);) ue += this[L + --z] * me;
      return ue
    }, a.prototype.readUint8 = a.prototype.readUInt8 = function (L, z) {
      return L = L >>> 0, z || y(L, 1, this.length), this[L]
    }, a.prototype.readUint16LE = a.prototype.readUInt16LE = function (L, z) {
      return L = L >>> 0, z || y(L, 2, this.length), this[L] | this[L + 1] << 8
    }, a.prototype.readUint16BE = a.prototype.readUInt16BE = function (L, z) {
      return L = L >>> 0, z || y(L, 2, this.length), this[L] << 8 | this[L + 1]
    }, a.prototype.readUint32LE = a.prototype.readUInt32LE = function (L, z) {
      return L = L >>> 0, z || y(L, 4, this.length), (this[L] | this[L + 1] << 8 | this[L + 2] << 16) + this[L + 3] * 16777216
    }, a.prototype.readUint32BE = a.prototype.readUInt32BE = function (L, z) {
      return L = L >>> 0, z || y(L, 4, this.length), this[L] * 16777216 + (this[L + 1] << 16 | this[L + 2] << 8 | this[L + 3])
    }, a.prototype.readBigUInt64LE = Ie(function (L) {
      L = L >>> 0, de(L, "offset");
      const z = this[L],
        ie = this[L + 7];
      (z === void 0 || ie === void 0) && ge(L, this.length - 8);
      const ue = z + this[++L] * 2 ** 8 + this[++L] * 2 ** 16 + this[++L] * 2 ** 24,
        me = this[++L] + this[++L] * 2 ** 8 + this[++L] * 2 ** 16 + ie * 2 ** 24;
      return BigInt(ue) + (BigInt(me) << BigInt(32))
    }), a.prototype.readBigUInt64BE = Ie(function (L) {
      L = L >>> 0, de(L, "offset");
      const z = this[L],
        ie = this[L + 7];
      (z === void 0 || ie === void 0) && ge(L, this.length - 8);
      const ue = z * 2 ** 24 + this[++L] * 2 ** 16 + this[++L] * 2 ** 8 + this[++L],
        me = this[++L] * 2 ** 24 + this[++L] * 2 ** 16 + this[++L] * 2 ** 8 + ie;
      return (BigInt(ue) << BigInt(32)) + BigInt(me)
    }), a.prototype.readIntLE = function (L, z, ie) {
      L = L >>> 0, z = z >>> 0, ie || y(L, z, this.length);
      let ue = this[L],
        me = 1,
        be = 0;
      for (; ++be < z && (me *= 256);) ue += this[L + be] * me;
      return me *= 128, ue >= me && (ue -= Math.pow(2, 8 * z)), ue
    }, a.prototype.readIntBE = function (L, z, ie) {
      L = L >>> 0, z = z >>> 0, ie || y(L, z, this.length);
      let ue = z,
        me = 1,
        be = this[L + --ue];
      for (; ue > 0 && (me *= 256);) be += this[L + --ue] * me;
      return me *= 128, be >= me && (be -= Math.pow(2, 8 * z)), be
    }, a.prototype.readInt8 = function (L, z) {
      return L = L >>> 0, z || y(L, 1, this.length), this[L] & 128 ? (255 - this[L] + 1) * -1 : this[L]
    }, a.prototype.readInt16LE = function (L, z) {
      L = L >>> 0, z || y(L, 2, this.length);
      const ie = this[L] | this[L + 1] << 8;
      return ie & 32768 ? ie | 4294901760 : ie
    }, a.prototype.readInt16BE = function (L, z) {
      L = L >>> 0, z || y(L, 2, this.length);
      const ie = this[L + 1] | this[L] << 8;
      return ie & 32768 ? ie | 4294901760 : ie
    }, a.prototype.readInt32LE = function (L, z) {
      return L = L >>> 0, z || y(L, 4, this.length), this[L] | this[L + 1] << 8 | this[L + 2] << 16 | this[L + 3] << 24
    }, a.prototype.readInt32BE = function (L, z) {
      return L = L >>> 0, z || y(L, 4, this.length), this[L] << 24 | this[L + 1] << 16 | this[L + 2] << 8 | this[L + 3]
    }, a.prototype.readBigInt64LE = Ie(function (L) {
      L = L >>> 0, de(L, "offset");
      const z = this[L],
        ie = this[L + 7];
      (z === void 0 || ie === void 0) && ge(L, this.length - 8);
      const ue = this[L + 4] + this[L + 5] * 2 ** 8 + this[L + 6] * 2 ** 16 + (ie << 24);
      return (BigInt(ue) << BigInt(32)) + BigInt(z + this[++L] * 2 ** 8 + this[++L] * 2 ** 16 + this[++L] * 2 ** 24)
    }), a.prototype.readBigInt64BE = Ie(function (L) {
      L = L >>> 0, de(L, "offset");
      const z = this[L],
        ie = this[L + 7];
      (z === void 0 || ie === void 0) && ge(L, this.length - 8);
      const ue = (z << 24) + this[++L] * 2 ** 16 + this[++L] * 2 ** 8 + this[++L];
      return (BigInt(ue) << BigInt(32)) + BigInt(this[++L] * 2 ** 24 + this[++L] * 2 ** 16 + this[++L] * 2 ** 8 + ie)
    }), a.prototype.readFloatLE = function (L, z) {
      return L = L >>> 0, z || y(L, 4, this.length), r.read(this, L, !0, 23, 4)
    }, a.prototype.readFloatBE = function (L, z) {
      return L = L >>> 0, z || y(L, 4, this.length), r.read(this, L, !1, 23, 4)
    }, a.prototype.readDoubleLE = function (L, z) {
      return L = L >>> 0, z || y(L, 8, this.length), r.read(this, L, !0, 52, 8)
    }, a.prototype.readDoubleBE = function (L, z) {
      return L = L >>> 0, z || y(L, 8, this.length), r.read(this, L, !1, 52, 8)
    };

    function A(J, L, z, ie, ue, me) {
      if (!a.isBuffer(J)) throw new TypeError('"buffer" argument must be a Buffer instance');
      if (L > ue || L < me) throw new RangeError('"value" argument is out of bounds');
      if (z + ie > J.length) throw new RangeError("Index out of range")
    }
    a.prototype.writeUintLE = a.prototype.writeUIntLE = function (L, z, ie, ue) {
      if (L = +L, z = z >>> 0, ie = ie >>> 0, !ue) {
        const Le = Math.pow(2, 8 * ie) - 1;
        A(this, L, z, ie, Le, 0)
      }
      let me = 1,
        be = 0;
      for (this[z] = L & 255; ++be < ie && (me *= 256);) this[z + be] = L / me & 255;
      return z + ie
    }, a.prototype.writeUintBE = a.prototype.writeUIntBE = function (L, z, ie, ue) {
      if (L = +L, z = z >>> 0, ie = ie >>> 0, !ue) {
        const Le = Math.pow(2, 8 * ie) - 1;
        A(this, L, z, ie, Le, 0)
      }
      let me = ie - 1,
        be = 1;
      for (this[z + me] = L & 255; --me >= 0 && (be *= 256);) this[z + me] = L / be & 255;
      return z + ie
    }, a.prototype.writeUint8 = a.prototype.writeUInt8 = function (L, z, ie) {
      return L = +L, z = z >>> 0, ie || A(this, L, z, 1, 255, 0), this[z] = L & 255, z + 1
    }, a.prototype.writeUint16LE = a.prototype.writeUInt16LE = function (L, z, ie) {
      return L = +L, z = z >>> 0, ie || A(this, L, z, 2, 65535, 0), this[z] = L & 255, this[z + 1] = L >>> 8, z + 2
    }, a.prototype.writeUint16BE = a.prototype.writeUInt16BE = function (L, z, ie) {
      return L = +L, z = z >>> 0, ie || A(this, L, z, 2, 65535, 0), this[z] = L >>> 8, this[z + 1] = L & 255, z + 2
    }, a.prototype.writeUint32LE = a.prototype.writeUInt32LE = function (L, z, ie) {
      return L = +L, z = z >>> 0, ie || A(this, L, z, 4, 4294967295, 0), this[z + 3] = L >>> 24, this[z + 2] = L >>> 16, this[z + 1] = L >>> 8, this[z] = L & 255, z + 4
    }, a.prototype.writeUint32BE = a.prototype.writeUInt32BE = function (L, z, ie) {
      return L = +L, z = z >>> 0, ie || A(this, L, z, 4, 4294967295, 0), this[z] = L >>> 24, this[z + 1] = L >>> 16, this[z + 2] = L >>> 8, this[z + 3] = L & 255, z + 4
    };

    function G(J, L, z, ie, ue) {
      Q(L, ie, ue, J, z, 7);
      let me = Number(L & BigInt(4294967295));
      J[z++] = me, me = me >> 8, J[z++] = me, me = me >> 8, J[z++] = me, me = me >> 8, J[z++] = me;
      let be = Number(L >> BigInt(32) & BigInt(4294967295));
      return J[z++] = be, be = be >> 8, J[z++] = be, be = be >> 8, J[z++] = be, be = be >> 8, J[z++] = be, z
    }

    function ce(J, L, z, ie, ue) {
      Q(L, ie, ue, J, z, 7);
      let me = Number(L & BigInt(4294967295));
      J[z + 7] = me, me = me >> 8, J[z + 6] = me, me = me >> 8, J[z + 5] = me, me = me >> 8, J[z + 4] = me;
      let be = Number(L >> BigInt(32) & BigInt(4294967295));
      return J[z + 3] = be, be = be >> 8, J[z + 2] = be, be = be >> 8, J[z + 1] = be, be = be >> 8, J[z] = be, z + 8
    }
    a.prototype.writeBigUInt64LE = Ie(function (L, z = 0) {
      return G(this, L, z, BigInt(0), BigInt("0xffffffffffffffff"))
    }), a.prototype.writeBigUInt64BE = Ie(function (L, z = 0) {
      return ce(this, L, z, BigInt(0), BigInt("0xffffffffffffffff"))
    }), a.prototype.writeIntLE = function (L, z, ie, ue) {
      if (L = +L, z = z >>> 0, !ue) {
        const ze = Math.pow(2, 8 * ie - 1);
        A(this, L, z, ie, ze - 1, -ze)
      }
      let me = 0,
        be = 1,
        Le = 0;
      for (this[z] = L & 255; ++me < ie && (be *= 256);) L < 0 && Le === 0 && this[z + me - 1] !== 0 && (Le = 1), this[z + me] = (L / be >> 0) - Le & 255;
      return z + ie
    }, a.prototype.writeIntBE = function (L, z, ie, ue) {
      if (L = +L, z = z >>> 0, !ue) {
        const ze = Math.pow(2, 8 * ie - 1);
        A(this, L, z, ie, ze - 1, -ze)
      }
      let me = ie - 1,
        be = 1,
        Le = 0;
      for (this[z + me] = L & 255; --me >= 0 && (be *= 256);) L < 0 && Le === 0 && this[z + me + 1] !== 0 && (Le = 1), this[z + me] = (L / be >> 0) - Le & 255;
      return z + ie
    }, a.prototype.writeInt8 = function (L, z, ie) {
      return L = +L, z = z >>> 0, ie || A(this, L, z, 1, 127, -128), L < 0 && (L = 255 + L + 1), this[z] = L & 255, z + 1
    }, a.prototype.writeInt16LE = function (L, z, ie) {
      return L = +L, z = z >>> 0, ie || A(this, L, z, 2, 32767, -32768), this[z] = L & 255, this[z + 1] = L >>> 8, z + 2
    }, a.prototype.writeInt16BE = function (L, z, ie) {
      return L = +L, z = z >>> 0, ie || A(this, L, z, 2, 32767, -32768), this[z] = L >>> 8, this[z + 1] = L & 255, z + 2
    }, a.prototype.writeInt32LE = function (L, z, ie) {
      return L = +L, z = z >>> 0, ie || A(this, L, z, 4, 2147483647, -2147483648), this[z] = L & 255, this[z + 1] = L >>> 8, this[z + 2] = L >>> 16, this[z + 3] = L >>> 24, z + 4
    }, a.prototype.writeInt32BE = function (L, z, ie) {
      return L = +L, z = z >>> 0, ie || A(this, L, z, 4, 2147483647, -2147483648), L < 0 && (L = 4294967295 + L + 1), this[z] = L >>> 24, this[z + 1] = L >>> 16, this[z + 2] = L >>> 8, this[z + 3] = L & 255, z + 4
    }, a.prototype.writeBigInt64LE = Ie(function (L, z = 0) {
      return G(this, L, z, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"))
    }), a.prototype.writeBigInt64BE = Ie(function (L, z = 0) {
      return ce(this, L, z, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"))
    });

    function W(J, L, z, ie, ue, me) {
      if (z + ie > J.length) throw new RangeError("Index out of range");
      if (z < 0) throw new RangeError("Index out of range")
    }

    function X(J, L, z, ie, ue) {
      return L = +L, z = z >>> 0, ue || W(J, L, z, 4), r.write(J, L, z, ie, 23, 4), z + 4
    }
    a.prototype.writeFloatLE = function (L, z, ie) {
      return X(this, L, z, !0, ie)
    }, a.prototype.writeFloatBE = function (L, z, ie) {
      return X(this, L, z, !1, ie)
    };

    function Z(J, L, z, ie, ue) {
      return L = +L, z = z >>> 0, ue || W(J, L, z, 8), r.write(J, L, z, ie, 52, 8), z + 8
    }
    a.prototype.writeDoubleLE = function (L, z, ie) {
      return Z(this, L, z, !0, ie)
    }, a.prototype.writeDoubleBE = function (L, z, ie) {
      return Z(this, L, z, !1, ie)
    }, a.prototype.copy = function (L, z, ie, ue) {
      if (!a.isBuffer(L)) throw new TypeError("argument should be a Buffer");
      if (ie || (ie = 0), !ue && ue !== 0 && (ue = this.length), z >= L.length && (z = L.length), z || (z = 0), ue > 0 && ue < ie && (ue = ie), ue === ie || L.length === 0 || this.length === 0) return 0;
      if (z < 0) throw new RangeError("targetStart out of bounds");
      if (ie < 0 || ie >= this.length) throw new RangeError("Index out of range");
      if (ue < 0) throw new RangeError("sourceEnd out of bounds");
      ue > this.length && (ue = this.length), L.length - z < ue - ie && (ue = L.length - z + ie);
      const me = ue - ie;
      return this === L && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(z, ie, ue) : Uint8Array.prototype.set.call(L, this.subarray(ie, ue), z), me
    }, a.prototype.fill = function (L, z, ie, ue) {
      if (typeof L == "string") {
        if (typeof z == "string" ? (ue = z, z = 0, ie = this.length) : typeof ie == "string" && (ue = ie, ie = this.length), ue !== void 0 && typeof ue != "string") throw new TypeError("encoding must be a string");
        if (typeof ue == "string" && !a.isEncoding(ue)) throw new TypeError("Unknown encoding: " + ue);
        if (L.length === 1) {
          const be = L.charCodeAt(0);
          (ue === "utf8" && be < 128 || ue === "latin1") && (L = be)
        }
      } else typeof L == "number" ? L = L & 255 : typeof L == "boolean" && (L = Number(L));
      if (z < 0 || this.length < z || this.length < ie) throw new RangeError("Out of range index");
      if (ie <= z) return this;
      z = z >>> 0, ie = ie === void 0 ? this.length : ie >>> 0, L || (L = 0);
      let me;
      if (typeof L == "number")
        for (me = z; me < ie; ++me) this[me] = L;
      else {
        const be = a.isBuffer(L) ? L : a.from(L, ue),
          Le = be.length;
        if (Le === 0) throw new TypeError('The value "' + L + '" is invalid for argument "value"');
        for (me = 0; me < ie - z; ++me) this[me + z] = be[me % Le]
      }
      return this
    };
    const ee = {};

    function ne(J, L, z) {
      ee[J] = class extends z {
        constructor() {
          super(), Object.defineProperty(this, "message", {
            value: L.apply(this, arguments),
            writable: !0,
            configurable: !0
          }), this.name = `${this.name} [${J}]`, this.stack, delete this.name
        }
        get code() {
          return J
        }
        set code(ue) {
          Object.defineProperty(this, "code", {
            configurable: !0,
            enumerable: !0,
            value: ue,
            writable: !0
          })
        }
        toString() {
          return `${this.name} [${J}]: ${this.message}`
        }
      }
    }
    ne("ERR_BUFFER_OUT_OF_BOUNDS", function (J) {
      return J ? `${J} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds"
    }, RangeError), ne("ERR_INVALID_ARG_TYPE", function (J, L) {
      return `The "${J}" argument must be of type number. Received type ${typeof L}`
    }, TypeError), ne("ERR_OUT_OF_RANGE", function (J, L, z) {
      let ie = `The value of "${J}" is out of range.`,
        ue = z;
      return Number.isInteger(z) && Math.abs(z) > 2 ** 32 ? ue = O(String(z)) : typeof z == "bigint" && (ue = String(z), (z > BigInt(2) ** BigInt(32) || z < -(BigInt(2) ** BigInt(32))) && (ue = O(ue)), ue += "n"), ie += ` It must be ${L}. Received ${ue}`, ie
    }, RangeError);

    function O(J) {
      let L = "",
        z = J.length;
      const ie = J[0] === "-" ? 1 : 0;
      for (; z >= ie + 4; z -= 3) L = `_${J.slice(z-3,z)}${L}`;
      return `${J.slice(0,z)}${L}`
    }

    function H(J, L, z) {
      de(L, "offset"), (J[L] === void 0 || J[L + z] === void 0) && ge(L, J.length - (z + 1))
    }

    function Q(J, L, z, ie, ue, me) {
      if (J > z || J < L) {
        const be = typeof L == "bigint" ? "n" : "";
        let Le;
        throw L === 0 || L === BigInt(0) ? Le = `>= 0${be} and < 2${be} ** ${(me+1)*8}${be}` : Le = `>= -(2${be} ** ${(me+1)*8-1}${be}) and < 2 ** ${(me+1)*8-1}${be}`, new ee.ERR_OUT_OF_RANGE("value", Le, J)
      }
      H(ie, ue, me)
    }

    function de(J, L) {
      if (typeof J != "number") throw new ee.ERR_INVALID_ARG_TYPE(L, "number", J)
    }

    function ge(J, L, z) {
      throw Math.floor(J) !== J ? (de(J, z), new ee.ERR_OUT_OF_RANGE("offset", "an integer", J)) : L < 0 ? new ee.ERR_BUFFER_OUT_OF_BOUNDS : new ee.ERR_OUT_OF_RANGE("offset", `>= 0 and <= ${L}`, J)
    }
    const Te = /[^+/0-9A-Za-z-_]/g;

    function Oe(J) {
      if (J = J.split("=")[0], J = J.trim().replace(Te, ""), J.length < 2) return "";
      for (; J.length % 4 !== 0;) J = J + "=";
      return J
    }

    function De(J, L) {
      L = L || 1 / 0;
      let z;
      const ie = J.length;
      let ue = null;
      const me = [];
      for (let be = 0; be < ie; ++be) {
        if (z = J.charCodeAt(be), z > 55295 && z < 57344) {
          if (!ue) {
            if (z > 56319) {
              (L -= 3) > -1 && me.push(239, 191, 189);
              continue
            } else if (be + 1 === ie) {
              (L -= 3) > -1 && me.push(239, 191, 189);
              continue
            }
            ue = z;
            continue
          }
          if (z < 56320) {
            (L -= 3) > -1 && me.push(239, 191, 189), ue = z;
            continue
          }
          z = (ue - 55296 << 10 | z - 56320) + 65536
        } else ue && (L -= 3) > -1 && me.push(239, 191, 189);
        if (ue = null, z < 128) {
          if ((L -= 1) < 0) break;
          me.push(z)
        } else if (z < 2048) {
          if ((L -= 2) < 0) break;
          me.push(z >> 6 | 192, z & 63 | 128)
        } else if (z < 65536) {
          if ((L -= 3) < 0) break;
          me.push(z >> 12 | 224, z >> 6 & 63 | 128, z & 63 | 128)
        } else if (z < 1114112) {
          if ((L -= 4) < 0) break;
          me.push(z >> 18 | 240, z >> 12 & 63 | 128, z >> 6 & 63 | 128, z & 63 | 128)
        } else throw new Error("Invalid code point")
      }
      return me
    }

    function et(J) {
      const L = [];
      for (let z = 0; z < J.length; ++z) L.push(J.charCodeAt(z) & 255);
      return L
    }

    function rt(J, L) {
      let z, ie, ue;
      const me = [];
      for (let be = 0; be < J.length && !((L -= 2) < 0); ++be) z = J.charCodeAt(be), ie = z >> 8, ue = z % 256, me.push(ue), me.push(ie);
      return me
    }

    function Ze(J) {
      return e.toByteArray(Oe(J))
    }

    function qe(J, L, z, ie) {
      let ue;
      for (ue = 0; ue < ie && !(ue + z >= L.length || ue >= J.length); ++ue) L[ue + z] = J[ue];
      return ue
    }

    function He(J, L) {
      return J instanceof L || J != null && J.constructor != null && J.constructor.name != null && J.constructor.name === L.name
    }

    function we(J) {
      return J !== J
    }
    const xe = function () {
      const J = "0123456789abcdef",
        L = new Array(256);
      for (let z = 0; z < 16; ++z) {
        const ie = z * 16;
        for (let ue = 0; ue < 16; ++ue) L[ie + ue] = J[z] + J[ue]
      }
      return L
    }();

    function Ie(J) {
      return typeof BigInt > "u" ? Pe : J
    }

    function Pe() {
      throw new Error("BigInt not supported")
    }
  })(d1), typeof window < "u" && (window.Buffer || (window.Buffer = d1.Buffer), window.global || (window.global = window), window.process || (window.process = {}), window.process?.env || (window.process = {
    env: {}
  }));
  var vM = {};
  const Fre = vM.NEXT_PUBLIC_SECURE_SITE_SDK_URL || "https://secure.walletconnect.org/sdk",
    Wre = vM.NEXT_PUBLIC_DEFAULT_LOG_LEVEL || "error",
    zt = {
      APP_EVENT_KEY: "@w4m-app/",
      FRAME_EVENT_KEY: "@w4m-frame/",
      RPC_METHOD_KEY: "RPC_",
      STORAGE_KEY: "@appkit-wallet/",
      SESSION_TOKEN_KEY: "SESSION_TOKEN_KEY",
      EMAIL_LOGIN_USED_KEY: "EMAIL_LOGIN_USED_KEY",
      LAST_USED_CHAIN_KEY: "LAST_USED_CHAIN_KEY",
      LAST_EMAIL_LOGIN_TIME: "LAST_EMAIL_LOGIN_TIME",
      EMAIL: "EMAIL",
      PREFERRED_ACCOUNT_TYPE: "PREFERRED_ACCOUNT_TYPE",
      SMART_ACCOUNT_ENABLED: "SMART_ACCOUNT_ENABLED",
      SMART_ACCOUNT_ENABLED_NETWORKS: "SMART_ACCOUNT_ENABLED_NETWORKS",
      SOCIAL_USERNAME: "SOCIAL_USERNAME",
      APP_SWITCH_NETWORK: "@w4m-app/SWITCH_NETWORK",
      APP_CONNECT_EMAIL: "@w4m-app/CONNECT_EMAIL",
      APP_CONNECT_DEVICE: "@w4m-app/CONNECT_DEVICE",
      APP_CONNECT_OTP: "@w4m-app/CONNECT_OTP",
      APP_CONNECT_SOCIAL: "@w4m-app/CONNECT_SOCIAL",
      APP_GET_SOCIAL_REDIRECT_URI: "@w4m-app/GET_SOCIAL_REDIRECT_URI",
      APP_GET_USER: "@w4m-app/GET_USER",
      APP_SIGN_OUT: "@w4m-app/SIGN_OUT",
      APP_IS_CONNECTED: "@w4m-app/IS_CONNECTED",
      APP_GET_CHAIN_ID: "@w4m-app/GET_CHAIN_ID",
      APP_RPC_REQUEST: "@w4m-app/RPC_REQUEST",
      APP_UPDATE_EMAIL: "@w4m-app/UPDATE_EMAIL",
      APP_UPDATE_EMAIL_PRIMARY_OTP: "@w4m-app/UPDATE_EMAIL_PRIMARY_OTP",
      APP_UPDATE_EMAIL_SECONDARY_OTP: "@w4m-app/UPDATE_EMAIL_SECONDARY_OTP",
      APP_AWAIT_UPDATE_EMAIL: "@w4m-app/AWAIT_UPDATE_EMAIL",
      APP_SYNC_THEME: "@w4m-app/SYNC_THEME",
      APP_SYNC_DAPP_DATA: "@w4m-app/SYNC_DAPP_DATA",
      APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS: "@w4m-app/GET_SMART_ACCOUNT_ENABLED_NETWORKS",
      APP_INIT_SMART_ACCOUNT: "@w4m-app/INIT_SMART_ACCOUNT",
      APP_SET_PREFERRED_ACCOUNT: "@w4m-app/SET_PREFERRED_ACCOUNT",
      APP_CONNECT_FARCASTER: "@w4m-app/CONNECT_FARCASTER",
      APP_GET_FARCASTER_URI: "@w4m-app/GET_FARCASTER_URI",
      FRAME_SWITCH_NETWORK_ERROR: "@w4m-frame/SWITCH_NETWORK_ERROR",
      FRAME_SWITCH_NETWORK_SUCCESS: "@w4m-frame/SWITCH_NETWORK_SUCCESS",
      FRAME_CONNECT_EMAIL_ERROR: "@w4m-frame/CONNECT_EMAIL_ERROR",
      FRAME_CONNECT_EMAIL_SUCCESS: "@w4m-frame/CONNECT_EMAIL_SUCCESS",
      FRAME_CONNECT_DEVICE_ERROR: "@w4m-frame/CONNECT_DEVICE_ERROR",
      FRAME_CONNECT_DEVICE_SUCCESS: "@w4m-frame/CONNECT_DEVICE_SUCCESS",
      FRAME_CONNECT_OTP_SUCCESS: "@w4m-frame/CONNECT_OTP_SUCCESS",
      FRAME_CONNECT_OTP_ERROR: "@w4m-frame/CONNECT_OTP_ERROR",
      FRAME_CONNECT_SOCIAL_SUCCESS: "@w4m-frame/CONNECT_SOCIAL_SUCCESS",
      FRAME_CONNECT_SOCIAL_ERROR: "@w4m-frame/CONNECT_SOCIAL_ERROR",
      FRAME_CONNECT_FARCASTER_SUCCESS: "@w4m-frame/CONNECT_FARCASTER_SUCCESS",
      FRAME_CONNECT_FARCASTER_ERROR: "@w4m-frame/CONNECT_FARCASTER_ERROR",
      FRAME_GET_FARCASTER_URI_SUCCESS: "@w4m-frame/GET_FARCASTER_URI_SUCCESS",
      FRAME_GET_FARCASTER_URI_ERROR: "@w4m-frame/GET_FARCASTER_URI_ERROR",
      FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS: "@w4m-frame/GET_SOCIAL_REDIRECT_URI_SUCCESS",
      FRAME_GET_SOCIAL_REDIRECT_URI_ERROR: "@w4m-frame/GET_SOCIAL_REDIRECT_URI_ERROR",
      FRAME_GET_USER_SUCCESS: "@w4m-frame/GET_USER_SUCCESS",
      FRAME_GET_USER_ERROR: "@w4m-frame/GET_USER_ERROR",
      FRAME_SIGN_OUT_SUCCESS: "@w4m-frame/SIGN_OUT_SUCCESS",
      FRAME_SIGN_OUT_ERROR: "@w4m-frame/SIGN_OUT_ERROR",
      FRAME_IS_CONNECTED_SUCCESS: "@w4m-frame/IS_CONNECTED_SUCCESS",
      FRAME_IS_CONNECTED_ERROR: "@w4m-frame/IS_CONNECTED_ERROR",
      FRAME_GET_CHAIN_ID_SUCCESS: "@w4m-frame/GET_CHAIN_ID_SUCCESS",
      FRAME_GET_CHAIN_ID_ERROR: "@w4m-frame/GET_CHAIN_ID_ERROR",
      FRAME_RPC_REQUEST_SUCCESS: "@w4m-frame/RPC_REQUEST_SUCCESS",
      FRAME_RPC_REQUEST_ERROR: "@w4m-frame/RPC_REQUEST_ERROR",
      FRAME_SESSION_UPDATE: "@w4m-frame/SESSION_UPDATE",
      FRAME_UPDATE_EMAIL_SUCCESS: "@w4m-frame/UPDATE_EMAIL_SUCCESS",
      FRAME_UPDATE_EMAIL_ERROR: "@w4m-frame/UPDATE_EMAIL_ERROR",
      FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS: "@w4m-frame/UPDATE_EMAIL_PRIMARY_OTP_SUCCESS",
      FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR: "@w4m-frame/UPDATE_EMAIL_PRIMARY_OTP_ERROR",
      FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS: "@w4m-frame/UPDATE_EMAIL_SECONDARY_OTP_SUCCESS",
      FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR: "@w4m-frame/UPDATE_EMAIL_SECONDARY_OTP_ERROR",
      FRAME_SYNC_THEME_SUCCESS: "@w4m-frame/SYNC_THEME_SUCCESS",
      FRAME_SYNC_THEME_ERROR: "@w4m-frame/SYNC_THEME_ERROR",
      FRAME_SYNC_DAPP_DATA_SUCCESS: "@w4m-frame/SYNC_DAPP_DATA_SUCCESS",
      FRAME_SYNC_DAPP_DATA_ERROR: "@w4m-frame/SYNC_DAPP_DATA_ERROR",
      FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS: "@w4m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS",
      FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR: "@w4m-frame/GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR",
      FRAME_INIT_SMART_ACCOUNT_SUCCESS: "@w4m-frame/INIT_SMART_ACCOUNT_SUCCESS",
      FRAME_INIT_SMART_ACCOUNT_ERROR: "@w4m-frame/INIT_SMART_ACCOUNT_ERROR",
      FRAME_SET_PREFERRED_ACCOUNT_SUCCESS: "@w4m-frame/SET_PREFERRED_ACCOUNT_SUCCESS",
      FRAME_SET_PREFERRED_ACCOUNT_ERROR: "@w4m-frame/SET_PREFERRED_ACCOUNT_ERROR",
      FRAME_READY: "@w4m-frame/READY",
      RPC_RESPONSE_TYPE_ERROR: "RPC_RESPONSE_ERROR",
      RPC_RESPONSE_TYPE_TX: "RPC_RESPONSE_TRANSACTION_HASH",
      RPC_RESPONSE_TYPE_OBJECT: "RPC_RESPONSE_OBJECT"
    },
    nr = {
      SAFE_RPC_METHODS: ["eth_accounts", "eth_blockNumber", "eth_call", "eth_chainId", "eth_estimateGas", "eth_feeHistory", "eth_gasPrice", "eth_getAccount", "eth_getBalance", "eth_getBlockByHash", "eth_getBlockByNumber", "eth_getBlockReceipts", "eth_getBlockTransactionCountByHash", "eth_getBlockTransactionCountByNumber", "eth_getCode", "eth_getFilterChanges", "eth_getFilterLogs", "eth_getLogs", "eth_getProof", "eth_getStorageAt", "eth_getTransactionByBlockHashAndIndex", "eth_getTransactionByBlockNumberAndIndex", "eth_getTransactionByHash", "eth_getTransactionCount", "eth_getTransactionReceipt", "eth_getUncleCountByBlockHash", "eth_getUncleCountByBlockNumber", "eth_maxPriorityFeePerGas", "eth_newBlockFilter", "eth_newFilter", "eth_newPendingTransactionFilter", "eth_sendRawTransaction", "eth_syncing", "eth_uninstallFilter", "wallet_getCapabilities", "wallet_getCallsStatus", "eth_getUserOperationReceipt", "eth_estimateUserOperationGas", "eth_getUserOperationByHash", "eth_supportedEntryPoints"],
      NOT_SAFE_RPC_METHODS: ["personal_sign", "eth_signTypedData_v4", "eth_sendTransaction", "solana_signMessage", "solana_signTransaction", "solana_signAllTransactions", "solana_signAndSendTransaction", "wallet_sendCalls", "wallet_grantPermissions", "wallet_revokePermissions", "eth_sendUserOperation"],
      GET_CHAIN_ID: "eth_chainId",
      RPC_METHOD_NOT_ALLOWED_MESSAGE: "Requested RPC call is not allowed",
      RPC_METHOD_NOT_ALLOWED_UI_MESSAGE: "Action not allowed",
      ACCOUNT_TYPES: {
        EOA: "eoa",
        SMART_ACCOUNT: "smartAccount"
      }
    };
  var qr;
  (function (t) {
    t.assertEqual = i => i;

    function e(i) {}
    t.assertIs = e;

    function r(i) {
      throw new Error
    }
    t.assertNever = r, t.arrayToEnum = i => {
      const s = {};
      for (const o of i) s[o] = o;
      return s
    }, t.getValidEnumValues = i => {
      const s = t.objectKeys(i).filter(a => typeof i[i[a]] != "number"),
        o = {};
      for (const a of s) o[a] = i[a];
      return t.objectValues(o)
    }, t.objectValues = i => t.objectKeys(i).map(function (s) {
      return i[s]
    }), t.objectKeys = typeof Object.keys == "function" ? i => Object.keys(i) : i => {
      const s = [];
      for (const o in i) Object.prototype.hasOwnProperty.call(i, o) && s.push(o);
      return s
    }, t.find = (i, s) => {
      for (const o of i)
        if (s(o)) return o
    }, t.isInteger = typeof Number.isInteger == "function" ? i => Number.isInteger(i) : i => typeof i == "number" && isFinite(i) && Math.floor(i) === i;

    function n(i, s = " | ") {
      return i.map(o => typeof o == "string" ? `'${o}'` : o).join(s)
    }
    t.joinValues = n, t.jsonStringifyReplacer = (i, s) => typeof s == "bigint" ? s.toString() : s
  })(qr || (qr = {}));
  var W9;
  (function (t) {
    t.mergeShapes = (e, r) => ({
      ...e,
      ...r
    })
  })(W9 || (W9 = {}));
  const It = qr.arrayToEnum(["string", "nan", "number", "integer", "float", "boolean", "date", "bigint", "symbol", "function", "undefined", "null", "array", "object", "unknown", "promise", "void", "never", "map", "set"]),
    zd = t => {
      switch (typeof t) {
        case "undefined":
          return It.undefined;
        case "string":
          return It.string;
        case "number":
          return isNaN(t) ? It.nan : It.number;
        case "boolean":
          return It.boolean;
        case "function":
          return It.function;
        case "bigint":
          return It.bigint;
        case "symbol":
          return It.symbol;
        case "object":
          return Array.isArray(t) ? It.array : t === null ? It.null : t.then && typeof t.then == "function" && t.catch && typeof t.catch == "function" ? It.promise : typeof Map < "u" && t instanceof Map ? It.map : typeof Set < "u" && t instanceof Set ? It.set : typeof Date < "u" && t instanceof Date ? It.date : It.object;
        default:
          return It.unknown
      }
    },
    tt = qr.arrayToEnum(["invalid_type", "invalid_literal", "custom", "invalid_union", "invalid_union_discriminator", "invalid_enum_value", "unrecognized_keys", "invalid_arguments", "invalid_return_type", "invalid_date", "invalid_string", "too_small", "too_big", "invalid_intersection_types", "not_multiple_of", "not_finite"]),
    zre = t => JSON.stringify(t, null, 2).replace(/"([^"]+)":/g, "$1:");
  class ic extends Error {
    constructor(e) {
      super(), this.issues = [], this.addIssue = n => {
        this.issues = [...this.issues, n]
      }, this.addIssues = (n = []) => {
        this.issues = [...this.issues, ...n]
      };
      const r = new.target.prototype;
      Object.setPrototypeOf ? Object.setPrototypeOf(this, r) : this.__proto__ = r, this.name = "ZodError", this.issues = e
    }
    get errors() {
      return this.issues
    }
    format(e) {
      const r = e || function (s) {
          return s.message
        },
        n = {
          _errors: []
        },
        i = s => {
          for (const o of s.issues)
            if (o.code === "invalid_union") o.unionErrors.map(i);
            else if (o.code === "invalid_return_type") i(o.returnTypeError);
          else if (o.code === "invalid_arguments") i(o.argumentsError);
          else if (o.path.length === 0) n._errors.push(r(o));
          else {
            let a = n,
              c = 0;
            for (; c < o.path.length;) {
              const l = o.path[c];
              c === o.path.length - 1 ? (a[l] = a[l] || {
                _errors: []
              }, a[l]._errors.push(r(o))) : a[l] = a[l] || {
                _errors: []
              }, a = a[l], c++
            }
          }
        };
      return i(this), n
    }
    toString() {
      return this.message
    }
    get message() {
      return JSON.stringify(this.issues, qr.jsonStringifyReplacer, 2)
    }
    get isEmpty() {
      return this.issues.length === 0
    }
    flatten(e = r => r.message) {
      const r = {},
        n = [];
      for (const i of this.issues) i.path.length > 0 ? (r[i.path[0]] = r[i.path[0]] || [], r[i.path[0]].push(e(i))) : n.push(e(i));
      return {
        formErrors: n,
        fieldErrors: r
      }
    }
    get formErrors() {
      return this.flatten()
    }
  }
  ic.create = t => new ic(t);
  const Pw = (t, e) => {
    let r;
    switch (t.code) {
      case tt.invalid_type:
        t.received === It.undefined ? r = "Required" : r = `Expected ${t.expected}, received ${t.received}`;
        break;
      case tt.invalid_literal:
        r = `Invalid literal value, expected ${JSON.stringify(t.expected,qr.jsonStringifyReplacer)}`;
        break;
      case tt.unrecognized_keys:
        r = `Unrecognized key(s) in object: ${qr.joinValues(t.keys,", ")}`;
        break;
      case tt.invalid_union:
        r = "Invalid input";
        break;
      case tt.invalid_union_discriminator:
        r = `Invalid discriminator value. Expected ${qr.joinValues(t.options)}`;
        break;
      case tt.invalid_enum_value:
        r = `Invalid enum value. Expected ${qr.joinValues(t.options)}, received '${t.received}'`;
        break;
      case tt.invalid_arguments:
        r = "Invalid function arguments";
        break;
      case tt.invalid_return_type:
        r = "Invalid function return type";
        break;
      case tt.invalid_date:
        r = "Invalid date";
        break;
      case tt.invalid_string:
        typeof t.validation == "object" ? "includes" in t.validation ? (r = `Invalid input: must include "${t.validation.includes}"`, typeof t.validation.position == "number" && (r = `${r} at one or more positions greater than or equal to ${t.validation.position}`)) : "startsWith" in t.validation ? r = `Invalid input: must start with "${t.validation.startsWith}"` : "endsWith" in t.validation ? r = `Invalid input: must end with "${t.validation.endsWith}"` : qr.assertNever(t.validation) : t.validation !== "regex" ? r = `Invalid ${t.validation}` : r = "Invalid";
        break;
      case tt.too_small:
        t.type === "array" ? r = `Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)` : t.type === "string" ? r = `String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)` : t.type === "number" ? r = `Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}` : t.type === "date" ? r = `Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}` : r = "Invalid input";
        break;
      case tt.too_big:
        t.type === "array" ? r = `Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)` : t.type === "string" ? r = `String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)` : t.type === "number" ? r = `Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}` : t.type === "bigint" ? r = `BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}` : t.type === "date" ? r = `Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}` : r = "Invalid input";
        break;
      case tt.custom:
        r = "Invalid input";
        break;
      case tt.invalid_intersection_types:
        r = "Intersection results could not be merged";
        break;
      case tt.not_multiple_of:
        r = `Number must be a multiple of ${t.multipleOf}`;
        break;
      case tt.not_finite:
        r = "Number must be finite";
        break;
      default:
        r = e.defaultError, qr.assertNever(t)
    }
    return {
      message: r
    }
  };
  let bM = Pw;

  function Hre(t) {
    bM = t
  }

  function yy() {
    return bM
  }
  const _y = t => {
      const {
        data: e,
        path: r,
        errorMaps: n,
        issueData: i
      } = t, s = [...r, ...i.path || []], o = {
        ...i,
        path: s
      };
      let a = "";
      const c = n.filter(l => !!l).slice().reverse();
      for (const l of c) a = l(o, {
        data: e,
        defaultError: a
      }).message;
      return {
        ...i,
        path: s,
        message: i.message || a
      }
    },
    qre = [];

  function Mt(t, e) {
    const r = _y({
      issueData: e,
      data: t.data,
      path: t.path,
      errorMaps: [t.common.contextualErrorMap, t.schemaErrorMap, yy(), Pw].filter(n => !!n)
    });
    t.common.issues.push(r)
  }
  class ms {
    constructor() {
      this.value = "valid"
    }
    dirty() {
      this.value === "valid" && (this.value = "dirty")
    }
    abort() {
      this.value !== "aborted" && (this.value = "aborted")
    }
    static mergeArray(e, r) {
      const n = [];
      for (const i of r) {
        if (i.status === "aborted") return or;
        i.status === "dirty" && e.dirty(), n.push(i.value)
      }
      return {
        status: e.value,
        value: n
      }
    }
    static async mergeObjectAsync(e, r) {
      const n = [];
      for (const i of r) n.push({
        key: await i.key,
        value: await i.value
      });
      return ms.mergeObjectSync(e, n)
    }
    static mergeObjectSync(e, r) {
      const n = {};
      for (const i of r) {
        const {
          key: s,
          value: o
        } = i;
        if (s.status === "aborted" || o.status === "aborted") return or;
        s.status === "dirty" && e.dirty(), o.status === "dirty" && e.dirty(), s.value !== "__proto__" && (typeof o.value < "u" || i.alwaysSet) && (n[s.value] = o.value)
      }
      return {
        status: e.value,
        value: n
      }
    }
  }
  const or = Object.freeze({
      status: "aborted"
    }),
    yM = t => ({
      status: "dirty",
      value: t
    }),
    Ns = t => ({
      status: "valid",
      value: t
    }),
    z9 = t => t.status === "aborted",
    H9 = t => t.status === "dirty",
    $w = t => t.status === "valid",
    xy = t => typeof Promise < "u" && t instanceof Promise;
  var Jt;
  (function (t) {
    t.errToObj = e => typeof e == "string" ? {
      message: e
    } : e || {}, t.toString = e => typeof e == "string" ? e : e?.message
  })(Jt || (Jt = {}));
  class Jc {
    constructor(e, r, n, i) {
      this._cachedPath = [], this.parent = e, this.data = r, this._path = n, this._key = i
    }
    get path() {
      return this._cachedPath.length || (this._key instanceof Array ? this._cachedPath.push(...this._path, ...this._key) : this._cachedPath.push(...this._path, this._key)), this._cachedPath
    }
  }
  const _M = (t, e) => {
    if ($w(e)) return {
      success: !0,
      data: e.value
    };
    if (!t.common.issues.length) throw new Error("Validation failed but no issues detected.");
    return {
      success: !1,
      get error() {
        if (this._error) return this._error;
        const r = new ic(t.common.issues);
        return this._error = r, this._error
      }
    }
  };

  function gr(t) {
    if (!t) return {};
    const {
      errorMap: e,
      invalid_type_error: r,
      required_error: n,
      description: i
    } = t;
    if (e && (r || n)) throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
    return e ? {
      errorMap: e,
      description: i
    } : {
      errorMap: (o, a) => o.code !== "invalid_type" ? {
        message: a.defaultError
      } : typeof a.data > "u" ? {
        message: n ?? a.defaultError
      } : {
        message: r ?? a.defaultError
      },
      description: i
    }
  }
  class _r {
    constructor(e) {
      this.spa = this.safeParseAsync, this._def = e, this.parse = this.parse.bind(this), this.safeParse = this.safeParse.bind(this), this.parseAsync = this.parseAsync.bind(this), this.safeParseAsync = this.safeParseAsync.bind(this), this.spa = this.spa.bind(this), this.refine = this.refine.bind(this), this.refinement = this.refinement.bind(this), this.superRefine = this.superRefine.bind(this), this.optional = this.optional.bind(this), this.nullable = this.nullable.bind(this), this.nullish = this.nullish.bind(this), this.array = this.array.bind(this), this.promise = this.promise.bind(this), this.or = this.or.bind(this), this.and = this.and.bind(this), this.transform = this.transform.bind(this), this.brand = this.brand.bind(this), this.default = this.default.bind(this), this.catch = this.catch.bind(this), this.describe = this.describe.bind(this), this.pipe = this.pipe.bind(this), this.readonly = this.readonly.bind(this), this.isNullable = this.isNullable.bind(this), this.isOptional = this.isOptional.bind(this)
    }
    get description() {
      return this._def.description
    }
    _getType(e) {
      return zd(e.data)
    }
    _getOrReturnCtx(e, r) {
      return r || {
        common: e.parent.common,
        data: e.data,
        parsedType: zd(e.data),
        schemaErrorMap: this._def.errorMap,
        path: e.path,
        parent: e.parent
      }
    }
    _processInputParams(e) {
      return {
        status: new ms,
        ctx: {
          common: e.parent.common,
          data: e.data,
          parsedType: zd(e.data),
          schemaErrorMap: this._def.errorMap,
          path: e.path,
          parent: e.parent
        }
      }
    }
    _parseSync(e) {
      const r = this._parse(e);
      if (xy(r)) throw new Error("Synchronous parse encountered promise.");
      return r
    }
    _parseAsync(e) {
      const r = this._parse(e);
      return Promise.resolve(r)
    }
    parse(e, r) {
      const n = this.safeParse(e, r);
      if (n.success) return n.data;
      throw n.error
    }
    safeParse(e, r) {
      var n;
      const i = {
          common: {
            issues: [],
            async: (n = r?.async) !== null && n !== void 0 ? n : !1,
            contextualErrorMap: r?.errorMap
          },
          path: r?.path || [],
          schemaErrorMap: this._def.errorMap,
          parent: null,
          data: e,
          parsedType: zd(e)
        },
        s = this._parseSync({
          data: e,
          path: i.path,
          parent: i
        });
      return _M(i, s)
    }
    async parseAsync(e, r) {
      const n = await this.safeParseAsync(e, r);
      if (n.success) return n.data;
      throw n.error
    }
    async safeParseAsync(e, r) {
      const n = {
          common: {
            issues: [],
            contextualErrorMap: r?.errorMap,
            async: !0
          },
          path: r?.path || [],
          schemaErrorMap: this._def.errorMap,
          parent: null,
          data: e,
          parsedType: zd(e)
        },
        i = this._parse({
          data: e,
          path: n.path,
          parent: n
        }),
        s = await (xy(i) ? i : Promise.resolve(i));
      return _M(n, s)
    }
    refine(e, r) {
      const n = i => typeof r == "string" || typeof r > "u" ? {
        message: r
      } : typeof r == "function" ? r(i) : r;
      return this._refinement((i, s) => {
        const o = e(i),
          a = () => s.addIssue({
            code: tt.custom,
            ...n(i)
          });
        return typeof Promise < "u" && o instanceof Promise ? o.then(c => c ? !0 : (a(), !1)) : o ? !0 : (a(), !1)
      })
    }
    refinement(e, r) {
      return this._refinement((n, i) => e(n) ? !0 : (i.addIssue(typeof r == "function" ? r(n, i) : r), !1))
    }
    _refinement(e) {
      return new ac({
        schema: this,
        typeName: rr.ZodEffects,
        effect: {
          type: "refinement",
          refinement: e
        }
      })
    }
    superRefine(e) {
      return this._refinement(e)
    }
    optional() {
      return Ru.create(this, this._def)
    }
    nullable() {
      return Mf.create(this, this._def)
    }
    nullish() {
      return this.nullable().optional()
    }
    array() {
      return oc.create(this, this._def)
    }
    promise() {
      return m1.create(this, this._def)
    }
    or(e) {
      return Bw.create([this, e], this._def)
    }
    and(e) {
      return Uw.create(this, e, this._def)
    }
    transform(e) {
      return new ac({
        ...gr(this._def),
        schema: this,
        typeName: rr.ZodEffects,
        effect: {
          type: "transform",
          transform: e
        }
      })
    }
    default (e) {
      const r = typeof e == "function" ? e : () => e;
      return new Hw({
        ...gr(this._def),
        innerType: this,
        defaultValue: r,
        typeName: rr.ZodDefault
      })
    }
    brand() {
      return new CM({
        typeName: rr.ZodBranded,
        type: this,
        ...gr(this._def)
      })
    } catch (e) {
      const r = typeof e == "function" ? e : () => e;
      return new Ty({
        ...gr(this._def),
        innerType: this,
        catchValue: r,
        typeName: rr.ZodCatch
      })
    }
    describe(e) {
      const r = this.constructor;
      return new r({
        ...this._def,
        description: e
      })
    }
    pipe(e) {
      return qw.create(this, e)
    }
    readonly() {
      return Ry.create(this)
    }
    isOptional() {
      return this.safeParse(void 0).success
    }
    isNullable() {
      return this.safeParse(null).success
    }
  }
  const Vre = /^c[^\s-]{8,}$/i,
    Kre = /^[a-z][a-z0-9]*$/,
    Gre = /^[0-9A-HJKMNP-TV-Z]{26}$/,
    Zre = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,
    Yre = /^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,
    Qre = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
  let q9;
  const Jre = /^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,
    Xre = /^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,
    ene = t => t.precision ? t.offset ? new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`) : new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`) : t.precision === 0 ? t.offset ? new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$") : new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$") : t.offset ? new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$") : new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");

  function tne(t, e) {
    return !!((e === "v4" || !e) && Jre.test(t) || (e === "v6" || !e) && Xre.test(t))
  }
  class sc extends _r {
    _parse(e) {
      if (this._def.coerce && (e.data = String(e.data)), this._getType(e) !== It.string) {
        const s = this._getOrReturnCtx(e);
        return Mt(s, {
          code: tt.invalid_type,
          expected: It.string,
          received: s.parsedType
        }), or
      }
      const n = new ms;
      let i;
      for (const s of this._def.checks)
        if (s.kind === "min") e.data.length < s.value && (i = this._getOrReturnCtx(e, i), Mt(i, {
          code: tt.too_small,
          minimum: s.value,
          type: "string",
          inclusive: !0,
          exact: !1,
          message: s.message
        }), n.dirty());
        else if (s.kind === "max") e.data.length > s.value && (i = this._getOrReturnCtx(e, i), Mt(i, {
        code: tt.too_big,
        maximum: s.value,
        type: "string",
        inclusive: !0,
        exact: !1,
        message: s.message
      }), n.dirty());
      else if (s.kind === "length") {
        const o = e.data.length > s.value,
          a = e.data.length < s.value;
        (o || a) && (i = this._getOrReturnCtx(e, i), o ? Mt(i, {
          code: tt.too_big,
          maximum: s.value,
          type: "string",
          inclusive: !0,
          exact: !0,
          message: s.message
        }) : a && Mt(i, {
          code: tt.too_small,
          minimum: s.value,
          type: "string",
          inclusive: !0,
          exact: !0,
          message: s.message
        }), n.dirty())
      } else if (s.kind === "email") Yre.test(e.data) || (i = this._getOrReturnCtx(e, i), Mt(i, {
        validation: "email",
        code: tt.invalid_string,
        message: s.message
      }), n.dirty());
      else if (s.kind === "emoji") q9 || (q9 = new RegExp(Qre, "u")), q9.test(e.data) || (i = this._getOrReturnCtx(e, i), Mt(i, {
        validation: "emoji",
        code: tt.invalid_string,
        message: s.message
      }), n.dirty());
      else if (s.kind === "uuid") Zre.test(e.data) || (i = this._getOrReturnCtx(e, i), Mt(i, {
        validation: "uuid",
        code: tt.invalid_string,
        message: s.message
      }), n.dirty());
      else if (s.kind === "cuid") Vre.test(e.data) || (i = this._getOrReturnCtx(e, i), Mt(i, {
        validation: "cuid",
        code: tt.invalid_string,
        message: s.message
      }), n.dirty());
      else if (s.kind === "cuid2") Kre.test(e.data) || (i = this._getOrReturnCtx(e, i), Mt(i, {
        validation: "cuid2",
        code: tt.invalid_string,
        message: s.message
      }), n.dirty());
      else if (s.kind === "ulid") Gre.test(e.data) || (i = this._getOrReturnCtx(e, i), Mt(i, {
        validation: "ulid",
        code: tt.invalid_string,
        message: s.message
      }), n.dirty());
      else if (s.kind === "url") try {
        new URL(e.data)
      } catch {
        i = this._getOrReturnCtx(e, i), Mt(i, {
          validation: "url",
          code: tt.invalid_string,
          message: s.message
        }), n.dirty()
      } else s.kind === "regex" ? (s.regex.lastIndex = 0, s.regex.test(e.data) || (i = this._getOrReturnCtx(e, i), Mt(i, {
        validation: "regex",
        code: tt.invalid_string,
        message: s.message
      }), n.dirty())) : s.kind === "trim" ? e.data = e.data.trim() : s.kind === "includes" ? e.data.includes(s.value, s.position) || (i = this._getOrReturnCtx(e, i), Mt(i, {
        code: tt.invalid_string,
        validation: {
          includes: s.value,
          position: s.position
        },
        message: s.message
      }), n.dirty()) : s.kind === "toLowerCase" ? e.data = e.data.toLowerCase() : s.kind === "toUpperCase" ? e.data = e.data.toUpperCase() : s.kind === "startsWith" ? e.data.startsWith(s.value) || (i = this._getOrReturnCtx(e, i), Mt(i, {
        code: tt.invalid_string,
        validation: {
          startsWith: s.value
        },
        message: s.message
      }), n.dirty()) : s.kind === "endsWith" ? e.data.endsWith(s.value) || (i = this._getOrReturnCtx(e, i), Mt(i, {
        code: tt.invalid_string,
        validation: {
          endsWith: s.value
        },
        message: s.message
      }), n.dirty()) : s.kind === "datetime" ? ene(s).test(e.data) || (i = this._getOrReturnCtx(e, i), Mt(i, {
        code: tt.invalid_string,
        validation: "datetime",
        message: s.message
      }), n.dirty()) : s.kind === "ip" ? tne(e.data, s.version) || (i = this._getOrReturnCtx(e, i), Mt(i, {
        validation: "ip",
        code: tt.invalid_string,
        message: s.message
      }), n.dirty()) : qr.assertNever(s);
      return {
        status: n.value,
        value: e.data
      }
    }
    _regex(e, r, n) {
      return this.refinement(i => e.test(i), {
        validation: r,
        code: tt.invalid_string,
        ...Jt.errToObj(n)
      })
    }
    _addCheck(e) {
      return new sc({
        ...this._def,
        checks: [...this._def.checks, e]
      })
    }
    email(e) {
      return this._addCheck({
        kind: "email",
        ...Jt.errToObj(e)
      })
    }
    url(e) {
      return this._addCheck({
        kind: "url",
        ...Jt.errToObj(e)
      })
    }
    emoji(e) {
      return this._addCheck({
        kind: "emoji",
        ...Jt.errToObj(e)
      })
    }
    uuid(e) {
      return this._addCheck({
        kind: "uuid",
        ...Jt.errToObj(e)
      })
    }
    cuid(e) {
      return this._addCheck({
        kind: "cuid",
        ...Jt.errToObj(e)
      })
    }
    cuid2(e) {
      return this._addCheck({
        kind: "cuid2",
        ...Jt.errToObj(e)
      })
    }
    ulid(e) {
      return this._addCheck({
        kind: "ulid",
        ...Jt.errToObj(e)
      })
    }
    ip(e) {
      return this._addCheck({
        kind: "ip",
        ...Jt.errToObj(e)
      })
    }
    datetime(e) {
      var r;
      return typeof e == "string" ? this._addCheck({
        kind: "datetime",
        precision: null,
        offset: !1,
        message: e
      }) : this._addCheck({
        kind: "datetime",
        precision: typeof e?.precision > "u" ? null : e?.precision,
        offset: (r = e?.offset) !== null && r !== void 0 ? r : !1,
        ...Jt.errToObj(e?.message)
      })
    }
    regex(e, r) {
      return this._addCheck({
        kind: "regex",
        regex: e,
        ...Jt.errToObj(r)
      })
    }
    includes(e, r) {
      return this._addCheck({
        kind: "includes",
        value: e,
        position: r?.position,
        ...Jt.errToObj(r?.message)
      })
    }
    startsWith(e, r) {
      return this._addCheck({
        kind: "startsWith",
        value: e,
        ...Jt.errToObj(r)
      })
    }
    endsWith(e, r) {
      return this._addCheck({
        kind: "endsWith",
        value: e,
        ...Jt.errToObj(r)
      })
    }
    min(e, r) {
      return this._addCheck({
        kind: "min",
        value: e,
        ...Jt.errToObj(r)
      })
    }
    max(e, r) {
      return this._addCheck({
        kind: "max",
        value: e,
        ...Jt.errToObj(r)
      })
    }
    length(e, r) {
      return this._addCheck({
        kind: "length",
        value: e,
        ...Jt.errToObj(r)
      })
    }
    nonempty(e) {
      return this.min(1, Jt.errToObj(e))
    }
    trim() {
      return new sc({
        ...this._def,
        checks: [...this._def.checks, {
          kind: "trim"
        }]
      })
    }
    toLowerCase() {
      return new sc({
        ...this._def,
        checks: [...this._def.checks, {
          kind: "toLowerCase"
        }]
      })
    }
    toUpperCase() {
      return new sc({
        ...this._def,
        checks: [...this._def.checks, {
          kind: "toUpperCase"
        }]
      })
    }
    get isDatetime() {
      return !!this._def.checks.find(e => e.kind === "datetime")
    }
    get isEmail() {
      return !!this._def.checks.find(e => e.kind === "email")
    }
    get isURL() {
      return !!this._def.checks.find(e => e.kind === "url")
    }
    get isEmoji() {
      return !!this._def.checks.find(e => e.kind === "emoji")
    }
    get isUUID() {
      return !!this._def.checks.find(e => e.kind === "uuid")
    }
    get isCUID() {
      return !!this._def.checks.find(e => e.kind === "cuid")
    }
    get isCUID2() {
      return !!this._def.checks.find(e => e.kind === "cuid2")
    }
    get isULID() {
      return !!this._def.checks.find(e => e.kind === "ulid")
    }
    get isIP() {
      return !!this._def.checks.find(e => e.kind === "ip")
    }
    get minLength() {
      let e = null;
      for (const r of this._def.checks) r.kind === "min" && (e === null || r.value > e) && (e = r.value);
      return e
    }
    get maxLength() {
      let e = null;
      for (const r of this._def.checks) r.kind === "max" && (e === null || r.value < e) && (e = r.value);
      return e
    }
  }
  sc.create = t => {
    var e;
    return new sc({
      checks: [],
      typeName: rr.ZodString,
      coerce: (e = t?.coerce) !== null && e !== void 0 ? e : !1,
      ...gr(t)
    })
  };

  function rne(t, e) {
    const r = (t.toString().split(".")[1] || "").length,
      n = (e.toString().split(".")[1] || "").length,
      i = r > n ? r : n,
      s = parseInt(t.toFixed(i).replace(".", "")),
      o = parseInt(e.toFixed(i).replace(".", ""));
    return s % o / Math.pow(10, i)
  }
  class Hd extends _r {
    constructor() {
      super(...arguments), this.min = this.gte, this.max = this.lte, this.step = this.multipleOf
    }
    _parse(e) {
      if (this._def.coerce && (e.data = Number(e.data)), this._getType(e) !== It.number) {
        const s = this._getOrReturnCtx(e);
        return Mt(s, {
          code: tt.invalid_type,
          expected: It.number,
          received: s.parsedType
        }), or
      }
      let n;
      const i = new ms;
      for (const s of this._def.checks) s.kind === "int" ? qr.isInteger(e.data) || (n = this._getOrReturnCtx(e, n), Mt(n, {
        code: tt.invalid_type,
        expected: "integer",
        received: "float",
        message: s.message
      }), i.dirty()) : s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), Mt(n, {
        code: tt.too_small,
        minimum: s.value,
        type: "number",
        inclusive: s.inclusive,
        exact: !1,
        message: s.message
      }), i.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (n = this._getOrReturnCtx(e, n), Mt(n, {
        code: tt.too_big,
        maximum: s.value,
        type: "number",
        inclusive: s.inclusive,
        exact: !1,
        message: s.message
      }), i.dirty()) : s.kind === "multipleOf" ? rne(e.data, s.value) !== 0 && (n = this._getOrReturnCtx(e, n), Mt(n, {
        code: tt.not_multiple_of,
        multipleOf: s.value,
        message: s.message
      }), i.dirty()) : s.kind === "finite" ? Number.isFinite(e.data) || (n = this._getOrReturnCtx(e, n), Mt(n, {
        code: tt.not_finite,
        message: s.message
      }), i.dirty()) : qr.assertNever(s);
      return {
        status: i.value,
        value: e.data
      }
    }
    gte(e, r) {
      return this.setLimit("min", e, !0, Jt.toString(r))
    }
    gt(e, r) {
      return this.setLimit("min", e, !1, Jt.toString(r))
    }
    lte(e, r) {
      return this.setLimit("max", e, !0, Jt.toString(r))
    }
    lt(e, r) {
      return this.setLimit("max", e, !1, Jt.toString(r))
    }
    setLimit(e, r, n, i) {
      return new Hd({
        ...this._def,
        checks: [...this._def.checks, {
          kind: e,
          value: r,
          inclusive: n,
          message: Jt.toString(i)
        }]
      })
    }
    _addCheck(e) {
      return new Hd({
        ...this._def,
        checks: [...this._def.checks, e]
      })
    }
    int(e) {
      return this._addCheck({
        kind: "int",
        message: Jt.toString(e)
      })
    }
    positive(e) {
      return this._addCheck({
        kind: "min",
        value: 0,
        inclusive: !1,
        message: Jt.toString(e)
      })
    }
    negative(e) {
      return this._addCheck({
        kind: "max",
        value: 0,
        inclusive: !1,
        message: Jt.toString(e)
      })
    }
    nonpositive(e) {
      return this._addCheck({
        kind: "max",
        value: 0,
        inclusive: !0,
        message: Jt.toString(e)
      })
    }
    nonnegative(e) {
      return this._addCheck({
        kind: "min",
        value: 0,
        inclusive: !0,
        message: Jt.toString(e)
      })
    }
    multipleOf(e, r) {
      return this._addCheck({
        kind: "multipleOf",
        value: e,
        message: Jt.toString(r)
      })
    }
    finite(e) {
      return this._addCheck({
        kind: "finite",
        message: Jt.toString(e)
      })
    }
    safe(e) {
      return this._addCheck({
        kind: "min",
        inclusive: !0,
        value: Number.MIN_SAFE_INTEGER,
        message: Jt.toString(e)
      })._addCheck({
        kind: "max",
        inclusive: !0,
        value: Number.MAX_SAFE_INTEGER,
        message: Jt.toString(e)
      })
    }
    get minValue() {
      let e = null;
      for (const r of this._def.checks) r.kind === "min" && (e === null || r.value > e) && (e = r.value);
      return e
    }
    get maxValue() {
      let e = null;
      for (const r of this._def.checks) r.kind === "max" && (e === null || r.value < e) && (e = r.value);
      return e
    }
    get isInt() {
      return !!this._def.checks.find(e => e.kind === "int" || e.kind === "multipleOf" && qr.isInteger(e.value))
    }
    get isFinite() {
      let e = null,
        r = null;
      for (const n of this._def.checks) {
        if (n.kind === "finite" || n.kind === "int" || n.kind === "multipleOf") return !0;
        n.kind === "min" ? (r === null || n.value > r) && (r = n.value) : n.kind === "max" && (e === null || n.value < e) && (e = n.value)
      }
      return Number.isFinite(r) && Number.isFinite(e)
    }
  }
  Hd.create = t => new Hd({
    checks: [],
    typeName: rr.ZodNumber,
    coerce: t?.coerce || !1,
    ...gr(t)
  });
  class qd extends _r {
    constructor() {
      super(...arguments), this.min = this.gte, this.max = this.lte
    }
    _parse(e) {
      if (this._def.coerce && (e.data = BigInt(e.data)), this._getType(e) !== It.bigint) {
        const s = this._getOrReturnCtx(e);
        return Mt(s, {
          code: tt.invalid_type,
          expected: It.bigint,
          received: s.parsedType
        }), or
      }
      let n;
      const i = new ms;
      for (const s of this._def.checks) s.kind === "min" ? (s.inclusive ? e.data < s.value : e.data <= s.value) && (n = this._getOrReturnCtx(e, n), Mt(n, {
        code: tt.too_small,
        type: "bigint",
        minimum: s.value,
        inclusive: s.inclusive,
        message: s.message
      }), i.dirty()) : s.kind === "max" ? (s.inclusive ? e.data > s.value : e.data >= s.value) && (n = this._getOrReturnCtx(e, n), Mt(n, {
        code: tt.too_big,
        type: "bigint",
        maximum: s.value,
        inclusive: s.inclusive,
        message: s.message
      }), i.dirty()) : s.kind === "multipleOf" ? e.data % s.value !== BigInt(0) && (n = this._getOrReturnCtx(e, n), Mt(n, {
        code: tt.not_multiple_of,
        multipleOf: s.value,
        message: s.message
      }), i.dirty()) : qr.assertNever(s);
      return {
        status: i.value,
        value: e.data
      }
    }
    gte(e, r) {
      return this.setLimit("min", e, !0, Jt.toString(r))
    }
    gt(e, r) {
      return this.setLimit("min", e, !1, Jt.toString(r))
    }
    lte(e, r) {
      return this.setLimit("max", e, !0, Jt.toString(r))
    }
    lt(e, r) {
      return this.setLimit("max", e, !1, Jt.toString(r))
    }
    setLimit(e, r, n, i) {
      return new qd({
        ...this._def,
        checks: [...this._def.checks, {
          kind: e,
          value: r,
          inclusive: n,
          message: Jt.toString(i)
        }]
      })
    }
    _addCheck(e) {
      return new qd({
        ...this._def,
        checks: [...this._def.checks, e]
      })
    }
    positive(e) {
      return this._addCheck({
        kind: "min",
        value: BigInt(0),
        inclusive: !1,
        message: Jt.toString(e)
      })
    }
    negative(e) {
      return this._addCheck({
        kind: "max",
        value: BigInt(0),
        inclusive: !1,
        message: Jt.toString(e)
      })
    }
    nonpositive(e) {
      return this._addCheck({
        kind: "max",
        value: BigInt(0),
        inclusive: !0,
        message: Jt.toString(e)
      })
    }
    nonnegative(e) {
      return this._addCheck({
        kind: "min",
        value: BigInt(0),
        inclusive: !0,
        message: Jt.toString(e)
      })
    }
    multipleOf(e, r) {
      return this._addCheck({
        kind: "multipleOf",
        value: e,
        message: Jt.toString(r)
      })
    }
    get minValue() {
      let e = null;
      for (const r of this._def.checks) r.kind === "min" && (e === null || r.value > e) && (e = r.value);
      return e
    }
    get maxValue() {
      let e = null;
      for (const r of this._def.checks) r.kind === "max" && (e === null || r.value < e) && (e = r.value);
      return e
    }
  }
  qd.create = t => {
    var e;
    return new qd({
      checks: [],
      typeName: rr.ZodBigInt,
      coerce: (e = t?.coerce) !== null && e !== void 0 ? e : !1,
      ...gr(t)
    })
  };
  class Ow extends _r {
    _parse(e) {
      if (this._def.coerce && (e.data = !!e.data), this._getType(e) !== It.boolean) {
        const n = this._getOrReturnCtx(e);
        return Mt(n, {
          code: tt.invalid_type,
          expected: It.boolean,
          received: n.parsedType
        }), or
      }
      return Ns(e.data)
    }
  }
  Ow.create = t => new Ow({
    typeName: rr.ZodBoolean,
    coerce: t?.coerce || !1,
    ...gr(t)
  });
  class kf extends _r {
    _parse(e) {
      if (this._def.coerce && (e.data = new Date(e.data)), this._getType(e) !== It.date) {
        const s = this._getOrReturnCtx(e);
        return Mt(s, {
          code: tt.invalid_type,
          expected: It.date,
          received: s.parsedType
        }), or
      }
      if (isNaN(e.data.getTime())) {
        const s = this._getOrReturnCtx(e);
        return Mt(s, {
          code: tt.invalid_date
        }), or
      }
      const n = new ms;
      let i;
      for (const s of this._def.checks) s.kind === "min" ? e.data.getTime() < s.value && (i = this._getOrReturnCtx(e, i), Mt(i, {
        code: tt.too_small,
        message: s.message,
        inclusive: !0,
        exact: !1,
        minimum: s.value,
        type: "date"
      }), n.dirty()) : s.kind === "max" ? e.data.getTime() > s.value && (i = this._getOrReturnCtx(e, i), Mt(i, {
        code: tt.too_big,
        message: s.message,
        inclusive: !0,
        exact: !1,
        maximum: s.value,
        type: "date"
      }), n.dirty()) : qr.assertNever(s);
      return {
        status: n.value,
        value: new Date(e.data.getTime())
      }
    }
    _addCheck(e) {
      return new kf({
        ...this._def,
        checks: [...this._def.checks, e]
      })
    }
    min(e, r) {
      return this._addCheck({
        kind: "min",
        value: e.getTime(),
        message: Jt.toString(r)
      })
    }
    max(e, r) {
      return this._addCheck({
        kind: "max",
        value: e.getTime(),
        message: Jt.toString(r)
      })
    }
    get minDate() {
      let e = null;
      for (const r of this._def.checks) r.kind === "min" && (e === null || r.value > e) && (e = r.value);
      return e != null ? new Date(e) : null
    }
    get maxDate() {
      let e = null;
      for (const r of this._def.checks) r.kind === "max" && (e === null || r.value < e) && (e = r.value);
      return e != null ? new Date(e) : null
    }
  }
  kf.create = t => new kf({
    checks: [],
    coerce: t?.coerce || !1,
    typeName: rr.ZodDate,
    ...gr(t)
  });
  class Cy extends _r {
    _parse(e) {
      if (this._getType(e) !== It.symbol) {
        const n = this._getOrReturnCtx(e);
        return Mt(n, {
          code: tt.invalid_type,
          expected: It.symbol,
          received: n.parsedType
        }), or
      }
      return Ns(e.data)
    }
  }
  Cy.create = t => new Cy({
    typeName: rr.ZodSymbol,
    ...gr(t)
  });
  class Dw extends _r {
    _parse(e) {
      if (this._getType(e) !== It.undefined) {
        const n = this._getOrReturnCtx(e);
        return Mt(n, {
          code: tt.invalid_type,
          expected: It.undefined,
          received: n.parsedType
        }), or
      }
      return Ns(e.data)
    }
  }
  Dw.create = t => new Dw({
    typeName: rr.ZodUndefined,
    ...gr(t)
  });
  class Lw extends _r {
    _parse(e) {
      if (this._getType(e) !== It.null) {
        const n = this._getOrReturnCtx(e);
        return Mt(n, {
          code: tt.invalid_type,
          expected: It.null,
          received: n.parsedType
        }), or
      }
      return Ns(e.data)
    }
  }
  Lw.create = t => new Lw({
    typeName: rr.ZodNull,
    ...gr(t)
  });
  class f1 extends _r {
    constructor() {
      super(...arguments), this._any = !0
    }
    _parse(e) {
      return Ns(e.data)
    }
  }
  f1.create = t => new f1({
    typeName: rr.ZodAny,
    ...gr(t)
  });
  class Rf extends _r {
    constructor() {
      super(...arguments), this._unknown = !0
    }
    _parse(e) {
      return Ns(e.data)
    }
  }
  Rf.create = t => new Rf({
    typeName: rr.ZodUnknown,
    ...gr(t)
  });
  class ku extends _r {
    _parse(e) {
      const r = this._getOrReturnCtx(e);
      return Mt(r, {
        code: tt.invalid_type,
        expected: It.never,
        received: r.parsedType
      }), or
    }
  }
  ku.create = t => new ku({
    typeName: rr.ZodNever,
    ...gr(t)
  });
  class Ey extends _r {
    _parse(e) {
      if (this._getType(e) !== It.undefined) {
        const n = this._getOrReturnCtx(e);
        return Mt(n, {
          code: tt.invalid_type,
          expected: It.void,
          received: n.parsedType
        }), or
      }
      return Ns(e.data)
    }
  }
  Ey.create = t => new Ey({
    typeName: rr.ZodVoid,
    ...gr(t)
  });
  class oc extends _r {
    _parse(e) {
      const {
        ctx: r,
        status: n
      } = this._processInputParams(e), i = this._def;
      if (r.parsedType !== It.array) return Mt(r, {
        code: tt.invalid_type,
        expected: It.array,
        received: r.parsedType
      }), or;
      if (i.exactLength !== null) {
        const o = r.data.length > i.exactLength.value,
          a = r.data.length < i.exactLength.value;
        (o || a) && (Mt(r, {
          code: o ? tt.too_big : tt.too_small,
          minimum: a ? i.exactLength.value : void 0,
          maximum: o ? i.exactLength.value : void 0,
          type: "array",
          inclusive: !0,
          exact: !0,
          message: i.exactLength.message
        }), n.dirty())
      }
      if (i.minLength !== null && r.data.length < i.minLength.value && (Mt(r, {
          code: tt.too_small,
          minimum: i.minLength.value,
          type: "array",
          inclusive: !0,
          exact: !1,
          message: i.minLength.message
        }), n.dirty()), i.maxLength !== null && r.data.length > i.maxLength.value && (Mt(r, {
          code: tt.too_big,
          maximum: i.maxLength.value,
          type: "array",
          inclusive: !0,
          exact: !1,
          message: i.maxLength.message
        }), n.dirty()), r.common.async) return Promise.all([...r.data].map((o, a) => i.type._parseAsync(new Jc(r, o, r.path, a)))).then(o => ms.mergeArray(n, o));
      const s = [...r.data].map((o, a) => i.type._parseSync(new Jc(r, o, r.path, a)));
      return ms.mergeArray(n, s)
    }
    get element() {
      return this._def.type
    }
    min(e, r) {
      return new oc({
        ...this._def,
        minLength: {
          value: e,
          message: Jt.toString(r)
        }
      })
    }
    max(e, r) {
      return new oc({
        ...this._def,
        maxLength: {
          value: e,
          message: Jt.toString(r)
        }
      })
    }
    length(e, r) {
      return new oc({
        ...this._def,
        exactLength: {
          value: e,
          message: Jt.toString(r)
        }
      })
    }
    nonempty(e) {
      return this.min(1, e)
    }
  }
  oc.create = (t, e) => new oc({
    type: t,
    minLength: null,
    maxLength: null,
    exactLength: null,
    typeName: rr.ZodArray,
    ...gr(e)
  });

  function p1(t) {
    if (t instanceof Ln) {
      const e = {};
      for (const r in t.shape) {
        const n = t.shape[r];
        e[r] = Ru.create(p1(n))
      }
      return new Ln({
        ...t._def,
        shape: () => e
      })
    } else return t instanceof oc ? new oc({
      ...t._def,
      type: p1(t.element)
    }) : t instanceof Ru ? Ru.create(p1(t.unwrap())) : t instanceof Mf ? Mf.create(p1(t.unwrap())) : t instanceof Xc ? Xc.create(t.items.map(e => p1(e))) : t
  }
  class Ln extends _r {
    constructor() {
      super(...arguments), this._cached = null, this.nonstrict = this.passthrough, this.augment = this.extend
    }
    _getCached() {
      if (this._cached !== null) return this._cached;
      const e = this._def.shape(),
        r = qr.objectKeys(e);
      return this._cached = {
        shape: e,
        keys: r
      }
    }
    _parse(e) {
      if (this._getType(e) !== It.object) {
        const l = this._getOrReturnCtx(e);
        return Mt(l, {
          code: tt.invalid_type,
          expected: It.object,
          received: l.parsedType
        }), or
      }
      const {
        status: n,
        ctx: i
      } = this._processInputParams(e), {
        shape: s,
        keys: o
      } = this._getCached(), a = [];
      if (!(this._def.catchall instanceof ku && this._def.unknownKeys === "strip"))
        for (const l in i.data) o.includes(l) || a.push(l);
      const c = [];
      for (const l of o) {
        const h = s[l],
          f = i.data[l];
        c.push({
          key: {
            status: "valid",
            value: l
          },
          value: h._parse(new Jc(i, f, i.path, l)),
          alwaysSet: l in i.data
        })
      }
      if (this._def.catchall instanceof ku) {
        const l = this._def.unknownKeys;
        if (l === "passthrough")
          for (const h of a) c.push({
            key: {
              status: "valid",
              value: h
            },
            value: {
              status: "valid",
              value: i.data[h]
            }
          });
        else if (l === "strict") a.length > 0 && (Mt(i, {
          code: tt.unrecognized_keys,
          keys: a
        }), n.dirty());
        else if (l !== "strip") throw new Error("Internal ZodObject error: invalid unknownKeys value.")
      } else {
        const l = this._def.catchall;
        for (const h of a) {
          const f = i.data[h];
          c.push({
            key: {
              status: "valid",
              value: h
            },
            value: l._parse(new Jc(i, f, i.path, h)),
            alwaysSet: h in i.data
          })
        }
      }
      return i.common.async ? Promise.resolve().then(async () => {
        const l = [];
        for (const h of c) {
          const f = await h.key;
          l.push({
            key: f,
            value: await h.value,
            alwaysSet: h.alwaysSet
          })
        }
        return l
      }).then(l => ms.mergeObjectSync(n, l)) : ms.mergeObjectSync(n, c)
    }
    get shape() {
      return this._def.shape()
    }
    strict(e) {
      return Jt.errToObj, new Ln({
        ...this._def,
        unknownKeys: "strict",
        ...e !== void 0 ? {
          errorMap: (r, n) => {
            var i, s, o, a;
            const c = (o = (s = (i = this._def).errorMap) === null || s === void 0 ? void 0 : s.call(i, r, n).message) !== null && o !== void 0 ? o : n.defaultError;
            return r.code === "unrecognized_keys" ? {
              message: (a = Jt.errToObj(e).message) !== null && a !== void 0 ? a : c
            } : {
              message: c
            }
          }
        } : {}
      })
    }
    strip() {
      return new Ln({
        ...this._def,
        unknownKeys: "strip"
      })
    }
    passthrough() {
      return new Ln({
        ...this._def,
        unknownKeys: "passthrough"
      })
    }
    extend(e) {
      return new Ln({
        ...this._def,
        shape: () => ({
          ...this._def.shape(),
          ...e
        })
      })
    }
    merge(e) {
      return new Ln({
        unknownKeys: e._def.unknownKeys,
        catchall: e._def.catchall,
        shape: () => ({
          ...this._def.shape(),
          ...e._def.shape()
        }),
        typeName: rr.ZodObject
      })
    }
    setKey(e, r) {
      return this.augment({
        [e]: r
      })
    }
    catchall(e) {
      return new Ln({
        ...this._def,
        catchall: e
      })
    }
    pick(e) {
      const r = {};
      return qr.objectKeys(e).forEach(n => {
        e[n] && this.shape[n] && (r[n] = this.shape[n])
      }), new Ln({
        ...this._def,
        shape: () => r
      })
    }
    omit(e) {
      const r = {};
      return qr.objectKeys(this.shape).forEach(n => {
        e[n] || (r[n] = this.shape[n])
      }), new Ln({
        ...this._def,
        shape: () => r
      })
    }
    deepPartial() {
      return p1(this)
    }
    partial(e) {
      const r = {};
      return qr.objectKeys(this.shape).forEach(n => {
        const i = this.shape[n];
        e && !e[n] ? r[n] = i : r[n] = i.optional()
      }), new Ln({
        ...this._def,
        shape: () => r
      })
    }
    required(e) {
      const r = {};
      return qr.objectKeys(this.shape).forEach(n => {
        if (e && !e[n]) r[n] = this.shape[n];
        else {
          let s = this.shape[n];
          for (; s instanceof Ru;) s = s._def.innerType;
          r[n] = s
        }
      }), new Ln({
        ...this._def,
        shape: () => r
      })
    }
    keyof() {
      return xM(qr.objectKeys(this.shape))
    }
  }
  Ln.create = (t, e) => new Ln({
    shape: () => t,
    unknownKeys: "strip",
    catchall: ku.create(),
    typeName: rr.ZodObject,
    ...gr(e)
  }), Ln.strictCreate = (t, e) => new Ln({
    shape: () => t,
    unknownKeys: "strict",
    catchall: ku.create(),
    typeName: rr.ZodObject,
    ...gr(e)
  }), Ln.lazycreate = (t, e) => new Ln({
    shape: t,
    unknownKeys: "strip",
    catchall: ku.create(),
    typeName: rr.ZodObject,
    ...gr(e)
  });
  class Bw extends _r {
    _parse(e) {
      const {
        ctx: r
      } = this._processInputParams(e), n = this._def.options;

      function i(s) {
        for (const a of s)
          if (a.result.status === "valid") return a.result;
        for (const a of s)
          if (a.result.status === "dirty") return r.common.issues.push(...a.ctx.common.issues), a.result;
        const o = s.map(a => new ic(a.ctx.common.issues));
        return Mt(r, {
          code: tt.invalid_union,
          unionErrors: o
        }), or
      }
      if (r.common.async) return Promise.all(n.map(async s => {
        const o = {
          ...r,
          common: {
            ...r.common,
            issues: []
          },
          parent: null
        };
        return {
          result: await s._parseAsync({
            data: r.data,
            path: r.path,
            parent: o
          }),
          ctx: o
        }
      })).then(i); {
        let s;
        const o = [];
        for (const c of n) {
          const l = {
              ...r,
              common: {
                ...r.common,
                issues: []
              },
              parent: null
            },
            h = c._parseSync({
              data: r.data,
              path: r.path,
              parent: l
            });
          if (h.status === "valid") return h;
          h.status === "dirty" && !s && (s = {
            result: h,
            ctx: l
          }), l.common.issues.length && o.push(l.common.issues)
        }
        if (s) return r.common.issues.push(...s.ctx.common.issues), s.result;
        const a = o.map(c => new ic(c));
        return Mt(r, {
          code: tt.invalid_union,
          unionErrors: a
        }), or
      }
    }
    get options() {
      return this._def.options
    }
  }
  Bw.create = (t, e) => new Bw({
    options: t,
    typeName: rr.ZodUnion,
    ...gr(e)
  });
  const Ay = t => t instanceof Fw ? Ay(t.schema) : t instanceof ac ? Ay(t.innerType()) : t instanceof Ww ? [t.value] : t instanceof Vd ? t.options : t instanceof zw ? Object.keys(t.enum) : t instanceof Hw ? Ay(t._def.innerType) : t instanceof Dw ? [void 0] : t instanceof Lw ? [null] : null;
  class Sy extends _r {
    _parse(e) {
      const {
        ctx: r
      } = this._processInputParams(e);
      if (r.parsedType !== It.object) return Mt(r, {
        code: tt.invalid_type,
        expected: It.object,
        received: r.parsedType
      }), or;
      const n = this.discriminator,
        i = r.data[n],
        s = this.optionsMap.get(i);
      return s ? r.common.async ? s._parseAsync({
        data: r.data,
        path: r.path,
        parent: r
      }) : s._parseSync({
        data: r.data,
        path: r.path,
        parent: r
      }) : (Mt(r, {
        code: tt.invalid_union_discriminator,
        options: Array.from(this.optionsMap.keys()),
        path: [n]
      }), or)
    }
    get discriminator() {
      return this._def.discriminator
    }
    get options() {
      return this._def.options
    }
    get optionsMap() {
      return this._def.optionsMap
    }
    static create(e, r, n) {
      const i = new Map;
      for (const s of r) {
        const o = Ay(s.shape[e]);
        if (!o) throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);
        for (const a of o) {
          if (i.has(a)) throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);
          i.set(a, s)
        }
      }
      return new Sy({
        typeName: rr.ZodDiscriminatedUnion,
        discriminator: e,
        options: r,
        optionsMap: i,
        ...gr(n)
      })
    }
  }

  function V9(t, e) {
    const r = zd(t),
      n = zd(e);
    if (t === e) return {
      valid: !0,
      data: t
    };
    if (r === It.object && n === It.object) {
      const i = qr.objectKeys(e),
        s = qr.objectKeys(t).filter(a => i.indexOf(a) !== -1),
        o = {
          ...t,
          ...e
        };
      for (const a of s) {
        const c = V9(t[a], e[a]);
        if (!c.valid) return {
          valid: !1
        };
        o[a] = c.data
      }
      return {
        valid: !0,
        data: o
      }
    } else if (r === It.array && n === It.array) {
      if (t.length !== e.length) return {
        valid: !1
      };
      const i = [];
      for (let s = 0; s < t.length; s++) {
        const o = t[s],
          a = e[s],
          c = V9(o, a);
        if (!c.valid) return {
          valid: !1
        };
        i.push(c.data)
      }
      return {
        valid: !0,
        data: i
      }
    } else return r === It.date && n === It.date && +t == +e ? {
      valid: !0,
      data: t
    } : {
      valid: !1
    }
  }
  class Uw extends _r {
    _parse(e) {
      const {
        status: r,
        ctx: n
      } = this._processInputParams(e), i = (s, o) => {
        if (z9(s) || z9(o)) return or;
        const a = V9(s.value, o.value);
        return a.valid ? ((H9(s) || H9(o)) && r.dirty(), {
          status: r.value,
          value: a.data
        }) : (Mt(n, {
          code: tt.invalid_intersection_types
        }), or)
      };
      return n.common.async ? Promise.all([this._def.left._parseAsync({
        data: n.data,
        path: n.path,
        parent: n
      }), this._def.right._parseAsync({
        data: n.data,
        path: n.path,
        parent: n
      })]).then(([s, o]) => i(s, o)) : i(this._def.left._parseSync({
        data: n.data,
        path: n.path,
        parent: n
      }), this._def.right._parseSync({
        data: n.data,
        path: n.path,
        parent: n
      }))
    }
  }
  Uw.create = (t, e, r) => new Uw({
    left: t,
    right: e,
    typeName: rr.ZodIntersection,
    ...gr(r)
  });
  class Xc extends _r {
    _parse(e) {
      const {
        status: r,
        ctx: n
      } = this._processInputParams(e);
      if (n.parsedType !== It.array) return Mt(n, {
        code: tt.invalid_type,
        expected: It.array,
        received: n.parsedType
      }), or;
      if (n.data.length < this._def.items.length) return Mt(n, {
        code: tt.too_small,
        minimum: this._def.items.length,
        inclusive: !0,
        exact: !1,
        type: "array"
      }), or;
      !this._def.rest && n.data.length > this._def.items.length && (Mt(n, {
        code: tt.too_big,
        maximum: this._def.items.length,
        inclusive: !0,
        exact: !1,
        type: "array"
      }), r.dirty());
      const s = [...n.data].map((o, a) => {
        const c = this._def.items[a] || this._def.rest;
        return c ? c._parse(new Jc(n, o, n.path, a)) : null
      }).filter(o => !!o);
      return n.common.async ? Promise.all(s).then(o => ms.mergeArray(r, o)) : ms.mergeArray(r, s)
    }
    get items() {
      return this._def.items
    }
    rest(e) {
      return new Xc({
        ...this._def,
        rest: e
      })
    }
  }
  Xc.create = (t, e) => {
    if (!Array.isArray(t)) throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
    return new Xc({
      items: t,
      typeName: rr.ZodTuple,
      rest: null,
      ...gr(e)
    })
  };
  class jw extends _r {
    get keySchema() {
      return this._def.keyType
    }
    get valueSchema() {
      return this._def.valueType
    }
    _parse(e) {
      const {
        status: r,
        ctx: n
      } = this._processInputParams(e);
      if (n.parsedType !== It.object) return Mt(n, {
        code: tt.invalid_type,
        expected: It.object,
        received: n.parsedType
      }), or;
      const i = [],
        s = this._def.keyType,
        o = this._def.valueType;
      for (const a in n.data) i.push({
        key: s._parse(new Jc(n, a, n.path, a)),
        value: o._parse(new Jc(n, n.data[a], n.path, a))
      });
      return n.common.async ? ms.mergeObjectAsync(r, i) : ms.mergeObjectSync(r, i)
    }
    get element() {
      return this._def.valueType
    }
    static create(e, r, n) {
      return r instanceof _r ? new jw({
        keyType: e,
        valueType: r,
        typeName: rr.ZodRecord,
        ...gr(n)
      }) : new jw({
        keyType: sc.create(),
        valueType: e,
        typeName: rr.ZodRecord,
        ...gr(r)
      })
    }
  }
  class Iy extends _r {
    get keySchema() {
      return this._def.keyType
    }
    get valueSchema() {
      return this._def.valueType
    }
    _parse(e) {
      const {
        status: r,
        ctx: n
      } = this._processInputParams(e);
      if (n.parsedType !== It.map) return Mt(n, {
        code: tt.invalid_type,
        expected: It.map,
        received: n.parsedType
      }), or;
      const i = this._def.keyType,
        s = this._def.valueType,
        o = [...n.data.entries()].map(([a, c], l) => ({
          key: i._parse(new Jc(n, a, n.path, [l, "key"])),
          value: s._parse(new Jc(n, c, n.path, [l, "value"]))
        }));
      if (n.common.async) {
        const a = new Map;
        return Promise.resolve().then(async () => {
          for (const c of o) {
            const l = await c.key,
              h = await c.value;
            if (l.status === "aborted" || h.status === "aborted") return or;
            (l.status === "dirty" || h.status === "dirty") && r.dirty(), a.set(l.value, h.value)
          }
          return {
            status: r.value,
            value: a
          }
        })
      } else {
        const a = new Map;
        for (const c of o) {
          const l = c.key,
            h = c.value;
          if (l.status === "aborted" || h.status === "aborted") return or;
          (l.status === "dirty" || h.status === "dirty") && r.dirty(), a.set(l.value, h.value)
        }
        return {
          status: r.value,
          value: a
        }
      }
    }
  }
  Iy.create = (t, e, r) => new Iy({
    valueType: e,
    keyType: t,
    typeName: rr.ZodMap,
    ...gr(r)
  });
  class Nf extends _r {
    _parse(e) {
      const {
        status: r,
        ctx: n
      } = this._processInputParams(e);
      if (n.parsedType !== It.set) return Mt(n, {
        code: tt.invalid_type,
        expected: It.set,
        received: n.parsedType
      }), or;
      const i = this._def;
      i.minSize !== null && n.data.size < i.minSize.value && (Mt(n, {
        code: tt.too_small,
        minimum: i.minSize.value,
        type: "set",
        inclusive: !0,
        exact: !1,
        message: i.minSize.message
      }), r.dirty()), i.maxSize !== null && n.data.size > i.maxSize.value && (Mt(n, {
        code: tt.too_big,
        maximum: i.maxSize.value,
        type: "set",
        inclusive: !0,
        exact: !1,
        message: i.maxSize.message
      }), r.dirty());
      const s = this._def.valueType;

      function o(c) {
        const l = new Set;
        for (const h of c) {
          if (h.status === "aborted") return or;
          h.status === "dirty" && r.dirty(), l.add(h.value)
        }
        return {
          status: r.value,
          value: l
        }
      }
      const a = [...n.data.values()].map((c, l) => s._parse(new Jc(n, c, n.path, l)));
      return n.common.async ? Promise.all(a).then(c => o(c)) : o(a)
    }
    min(e, r) {
      return new Nf({
        ...this._def,
        minSize: {
          value: e,
          message: Jt.toString(r)
        }
      })
    }
    max(e, r) {
      return new Nf({
        ...this._def,
        maxSize: {
          value: e,
          message: Jt.toString(r)
        }
      })
    }
    size(e, r) {
      return this.min(e, r).max(e, r)
    }
    nonempty(e) {
      return this.min(1, e)
    }
  }
  Nf.create = (t, e) => new Nf({
    valueType: t,
    minSize: null,
    maxSize: null,
    typeName: rr.ZodSet,
    ...gr(e)
  });
  class g1 extends _r {
    constructor() {
      super(...arguments), this.validate = this.implement
    }
    _parse(e) {
      const {
        ctx: r
      } = this._processInputParams(e);
      if (r.parsedType !== It.function) return Mt(r, {
        code: tt.invalid_type,
        expected: It.function,
        received: r.parsedType
      }), or;

      function n(a, c) {
        return _y({
          data: a,
          path: r.path,
          errorMaps: [r.common.contextualErrorMap, r.schemaErrorMap, yy(), Pw].filter(l => !!l),
          issueData: {
            code: tt.invalid_arguments,
            argumentsError: c
          }
        })
      }

      function i(a, c) {
        return _y({
          data: a,
          path: r.path,
          errorMaps: [r.common.contextualErrorMap, r.schemaErrorMap, yy(), Pw].filter(l => !!l),
          issueData: {
            code: tt.invalid_return_type,
            returnTypeError: c
          }
        })
      }
      const s = {
          errorMap: r.common.contextualErrorMap
        },
        o = r.data;
      if (this._def.returns instanceof m1) {
        const a = this;
        return Ns(async function (...c) {
          const l = new ic([]),
            h = await a._def.args.parseAsync(c, s).catch(b => {
              throw l.addIssue(n(c, b)), l
            }),
            f = await Reflect.apply(o, this, h);
          return await a._def.returns._def.type.parseAsync(f, s).catch(b => {
            throw l.addIssue(i(f, b)), l
          })
        })
      } else {
        const a = this;
        return Ns(function (...c) {
          const l = a._def.args.safeParse(c, s);
          if (!l.success) throw new ic([n(c, l.error)]);
          const h = Reflect.apply(o, this, l.data),
            f = a._def.returns.safeParse(h, s);
          if (!f.success) throw new ic([i(h, f.error)]);
          return f.data
        })
      }
    }
    parameters() {
      return this._def.args
    }
    returnType() {
      return this._def.returns
    }
    args(...e) {
      return new g1({
        ...this._def,
        args: Xc.create(e).rest(Rf.create())
      })
    }
    returns(e) {
      return new g1({
        ...this._def,
        returns: e
      })
    }
    implement(e) {
      return this.parse(e)
    }
    strictImplement(e) {
      return this.parse(e)
    }
    static create(e, r, n) {
      return new g1({
        args: e || Xc.create([]).rest(Rf.create()),
        returns: r || Rf.create(),
        typeName: rr.ZodFunction,
        ...gr(n)
      })
    }
  }
  class Fw extends _r {
    get schema() {
      return this._def.getter()
    }
    _parse(e) {
      const {
        ctx: r
      } = this._processInputParams(e);
      return this._def.getter()._parse({
        data: r.data,
        path: r.path,
        parent: r
      })
    }
  }
  Fw.create = (t, e) => new Fw({
    getter: t,
    typeName: rr.ZodLazy,
    ...gr(e)
  });
  class Ww extends _r {
    _parse(e) {
      if (e.data !== this._def.value) {
        const r = this._getOrReturnCtx(e);
        return Mt(r, {
          received: r.data,
          code: tt.invalid_literal,
          expected: this._def.value
        }), or
      }
      return {
        status: "valid",
        value: e.data
      }
    }
    get value() {
      return this._def.value
    }
  }
  Ww.create = (t, e) => new Ww({
    value: t,
    typeName: rr.ZodLiteral,
    ...gr(e)
  });

  function xM(t, e) {
    return new Vd({
      values: t,
      typeName: rr.ZodEnum,
      ...gr(e)
    })
  }
  class Vd extends _r {
    _parse(e) {
      if (typeof e.data != "string") {
        const r = this._getOrReturnCtx(e),
          n = this._def.values;
        return Mt(r, {
          expected: qr.joinValues(n),
          received: r.parsedType,
          code: tt.invalid_type
        }), or
      }
      if (this._def.values.indexOf(e.data) === -1) {
        const r = this._getOrReturnCtx(e),
          n = this._def.values;
        return Mt(r, {
          received: r.data,
          code: tt.invalid_enum_value,
          options: n
        }), or
      }
      return Ns(e.data)
    }
    get options() {
      return this._def.values
    }
    get enum() {
      const e = {};
      for (const r of this._def.values) e[r] = r;
      return e
    }
    get Values() {
      const e = {};
      for (const r of this._def.values) e[r] = r;
      return e
    }
    get Enum() {
      const e = {};
      for (const r of this._def.values) e[r] = r;
      return e
    }
    extract(e) {
      return Vd.create(e)
    }
    exclude(e) {
      return Vd.create(this.options.filter(r => !e.includes(r)))
    }
  }
  Vd.create = xM;
  class zw extends _r {
    _parse(e) {
      const r = qr.getValidEnumValues(this._def.values),
        n = this._getOrReturnCtx(e);
      if (n.parsedType !== It.string && n.parsedType !== It.number) {
        const i = qr.objectValues(r);
        return Mt(n, {
          expected: qr.joinValues(i),
          received: n.parsedType,
          code: tt.invalid_type
        }), or
      }
      if (r.indexOf(e.data) === -1) {
        const i = qr.objectValues(r);
        return Mt(n, {
          received: n.data,
          code: tt.invalid_enum_value,
          options: i
        }), or
      }
      return Ns(e.data)
    }
    get enum() {
      return this._def.values
    }
  }
  zw.create = (t, e) => new zw({
    values: t,
    typeName: rr.ZodNativeEnum,
    ...gr(e)
  });
  class m1 extends _r {
    unwrap() {
      return this._def.type
    }
    _parse(e) {
      const {
        ctx: r
      } = this._processInputParams(e);
      if (r.parsedType !== It.promise && r.common.async === !1) return Mt(r, {
        code: tt.invalid_type,
        expected: It.promise,
        received: r.parsedType
      }), or;
      const n = r.parsedType === It.promise ? r.data : Promise.resolve(r.data);
      return Ns(n.then(i => this._def.type.parseAsync(i, {
        path: r.path,
        errorMap: r.common.contextualErrorMap
      })))
    }
  }
  m1.create = (t, e) => new m1({
    type: t,
    typeName: rr.ZodPromise,
    ...gr(e)
  });
  class ac extends _r {
    innerType() {
      return this._def.schema
    }
    sourceType() {
      return this._def.schema._def.typeName === rr.ZodEffects ? this._def.schema.sourceType() : this._def.schema
    }
    _parse(e) {
      const {
        status: r,
        ctx: n
      } = this._processInputParams(e), i = this._def.effect || null, s = {
        addIssue: o => {
          Mt(n, o), o.fatal ? r.abort() : r.dirty()
        },
        get path() {
          return n.path
        }
      };
      if (s.addIssue = s.addIssue.bind(s), i.type === "preprocess") {
        const o = i.transform(n.data, s);
        return n.common.issues.length ? {
          status: "dirty",
          value: n.data
        } : n.common.async ? Promise.resolve(o).then(a => this._def.schema._parseAsync({
          data: a,
          path: n.path,
          parent: n
        })) : this._def.schema._parseSync({
          data: o,
          path: n.path,
          parent: n
        })
      }
      if (i.type === "refinement") {
        const o = a => {
          const c = i.refinement(a, s);
          if (n.common.async) return Promise.resolve(c);
          if (c instanceof Promise) throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
          return a
        };
        if (n.common.async === !1) {
          const a = this._def.schema._parseSync({
            data: n.data,
            path: n.path,
            parent: n
          });
          return a.status === "aborted" ? or : (a.status === "dirty" && r.dirty(), o(a.value), {
            status: r.value,
            value: a.value
          })
        } else return this._def.schema._parseAsync({
          data: n.data,
          path: n.path,
          parent: n
        }).then(a => a.status === "aborted" ? or : (a.status === "dirty" && r.dirty(), o(a.value).then(() => ({
          status: r.value,
          value: a.value
        }))))
      }
      if (i.type === "transform")
        if (n.common.async === !1) {
          const o = this._def.schema._parseSync({
            data: n.data,
            path: n.path,
            parent: n
          });
          if (!$w(o)) return o;
          const a = i.transform(o.value, s);
          if (a instanceof Promise) throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");
          return {
            status: r.value,
            value: a
          }
        } else return this._def.schema._parseAsync({
          data: n.data,
          path: n.path,
          parent: n
        }).then(o => $w(o) ? Promise.resolve(i.transform(o.value, s)).then(a => ({
          status: r.value,
          value: a
        })) : o);
      qr.assertNever(i)
    }
  }
  ac.create = (t, e, r) => new ac({
    schema: t,
    typeName: rr.ZodEffects,
    effect: e,
    ...gr(r)
  }), ac.createWithPreprocess = (t, e, r) => new ac({
    schema: e,
    effect: {
      type: "preprocess",
      transform: t
    },
    typeName: rr.ZodEffects,
    ...gr(r)
  });
  class Ru extends _r {
    _parse(e) {
      return this._getType(e) === It.undefined ? Ns(void 0) : this._def.innerType._parse(e)
    }
    unwrap() {
      return this._def.innerType
    }
  }
  Ru.create = (t, e) => new Ru({
    innerType: t,
    typeName: rr.ZodOptional,
    ...gr(e)
  });
  class Mf extends _r {
    _parse(e) {
      return this._getType(e) === It.null ? Ns(null) : this._def.innerType._parse(e)
    }
    unwrap() {
      return this._def.innerType
    }
  }
  Mf.create = (t, e) => new Mf({
    innerType: t,
    typeName: rr.ZodNullable,
    ...gr(e)
  });
  class Hw extends _r {
    _parse(e) {
      const {
        ctx: r
      } = this._processInputParams(e);
      let n = r.data;
      return r.parsedType === It.undefined && (n = this._def.defaultValue()), this._def.innerType._parse({
        data: n,
        path: r.path,
        parent: r
      })
    }
    removeDefault() {
      return this._def.innerType
    }
  }
  Hw.create = (t, e) => new Hw({
    innerType: t,
    typeName: rr.ZodDefault,
    defaultValue: typeof e.default == "function" ? e.default : () => e.default,
    ...gr(e)
  });
  class Ty extends _r {
    _parse(e) {
      const {
        ctx: r
      } = this._processInputParams(e), n = {
        ...r,
        common: {
          ...r.common,
          issues: []
        }
      }, i = this._def.innerType._parse({
        data: n.data,
        path: n.path,
        parent: {
          ...n
        }
      });
      return xy(i) ? i.then(s => ({
        status: "valid",
        value: s.status === "valid" ? s.value : this._def.catchValue({
          get error() {
            return new ic(n.common.issues)
          },
          input: n.data
        })
      })) : {
        status: "valid",
        value: i.status === "valid" ? i.value : this._def.catchValue({
          get error() {
            return new ic(n.common.issues)
          },
          input: n.data
        })
      }
    }
    removeCatch() {
      return this._def.innerType
    }
  }
  Ty.create = (t, e) => new Ty({
    innerType: t,
    typeName: rr.ZodCatch,
    catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
    ...gr(e)
  });
  class ky extends _r {
    _parse(e) {
      if (this._getType(e) !== It.nan) {
        const n = this._getOrReturnCtx(e);
        return Mt(n, {
          code: tt.invalid_type,
          expected: It.nan,
          received: n.parsedType
        }), or
      }
      return {
        status: "valid",
        value: e.data
      }
    }
  }
  ky.create = t => new ky({
    typeName: rr.ZodNaN,
    ...gr(t)
  });
  const nne = Symbol("zod_brand");
  class CM extends _r {
    _parse(e) {
      const {
        ctx: r
      } = this._processInputParams(e), n = r.data;
      return this._def.type._parse({
        data: n,
        path: r.path,
        parent: r
      })
    }
    unwrap() {
      return this._def.type
    }
  }
  class qw extends _r {
    _parse(e) {
      const {
        status: r,
        ctx: n
      } = this._processInputParams(e);
      if (n.common.async) return (async () => {
        const s = await this._def.in._parseAsync({
          data: n.data,
          path: n.path,
          parent: n
        });
        return s.status === "aborted" ? or : s.status === "dirty" ? (r.dirty(), yM(s.value)) : this._def.out._parseAsync({
          data: s.value,
          path: n.path,
          parent: n
        })
      })(); {
        const i = this._def.in._parseSync({
          data: n.data,
          path: n.path,
          parent: n
        });
        return i.status === "aborted" ? or : i.status === "dirty" ? (r.dirty(), {
          status: "dirty",
          value: i.value
        }) : this._def.out._parseSync({
          data: i.value,
          path: n.path,
          parent: n
        })
      }
    }
    static create(e, r) {
      return new qw({
        in: e,
        out: r,
        typeName: rr.ZodPipeline
      })
    }
  }
  class Ry extends _r {
    _parse(e) {
      const r = this._def.innerType._parse(e);
      return $w(r) && (r.value = Object.freeze(r.value)), r
    }
  }
  Ry.create = (t, e) => new Ry({
    innerType: t,
    typeName: rr.ZodReadonly,
    ...gr(e)
  });
  const EM = (t, e = {}, r) => t ? f1.create().superRefine((n, i) => {
      var s, o;
      if (!t(n)) {
        const a = typeof e == "function" ? e(n) : typeof e == "string" ? {
            message: e
          } : e,
          c = (o = (s = a.fatal) !== null && s !== void 0 ? s : r) !== null && o !== void 0 ? o : !0,
          l = typeof a == "string" ? {
            message: a
          } : a;
        i.addIssue({
          code: "custom",
          ...l,
          fatal: c
        })
      }
    }) : f1.create(),
    ine = {
      object: Ln.lazycreate
    };
  var rr;
  (function (t) {
    t.ZodString = "ZodString", t.ZodNumber = "ZodNumber", t.ZodNaN = "ZodNaN", t.ZodBigInt = "ZodBigInt", t.ZodBoolean = "ZodBoolean", t.ZodDate = "ZodDate", t.ZodSymbol = "ZodSymbol", t.ZodUndefined = "ZodUndefined", t.ZodNull = "ZodNull", t.ZodAny = "ZodAny", t.ZodUnknown = "ZodUnknown", t.ZodNever = "ZodNever", t.ZodVoid = "ZodVoid", t.ZodArray = "ZodArray", t.ZodObject = "ZodObject", t.ZodUnion = "ZodUnion", t.ZodDiscriminatedUnion = "ZodDiscriminatedUnion", t.ZodIntersection = "ZodIntersection", t.ZodTuple = "ZodTuple", t.ZodRecord = "ZodRecord", t.ZodMap = "ZodMap", t.ZodSet = "ZodSet", t.ZodFunction = "ZodFunction", t.ZodLazy = "ZodLazy", t.ZodLiteral = "ZodLiteral", t.ZodEnum = "ZodEnum", t.ZodEffects = "ZodEffects", t.ZodNativeEnum = "ZodNativeEnum", t.ZodOptional = "ZodOptional", t.ZodNullable = "ZodNullable", t.ZodDefault = "ZodDefault", t.ZodCatch = "ZodCatch", t.ZodPromise = "ZodPromise", t.ZodBranded = "ZodBranded", t.ZodPipeline = "ZodPipeline", t.ZodReadonly = "ZodReadonly"
  })(rr || (rr = {}));
  const sne = (t, e = {
      message: `Input not instance of ${t.name}`
    }) => EM(r => r instanceof t, e),
    AM = sc.create,
    SM = Hd.create,
    one = ky.create,
    ane = qd.create,
    IM = Ow.create,
    cne = kf.create,
    lne = Cy.create,
    une = Dw.create,
    dne = Lw.create,
    hne = f1.create,
    fne = Rf.create,
    pne = ku.create,
    gne = Ey.create,
    mne = oc.create,
    wne = Ln.create,
    vne = Ln.strictCreate,
    bne = Bw.create,
    yne = Sy.create,
    _ne = Uw.create,
    xne = Xc.create,
    Cne = jw.create,
    Ene = Iy.create,
    Ane = Nf.create,
    Sne = g1.create,
    Ine = Fw.create,
    Tne = Ww.create,
    kne = Vd.create,
    Rne = zw.create,
    Nne = m1.create,
    TM = ac.create,
    Mne = Ru.create,
    Pne = Mf.create,
    $ne = ac.createWithPreprocess,
    One = qw.create;
  var ae = Object.freeze({
    __proto__: null,
    defaultErrorMap: Pw,
    setErrorMap: Hre,
    getErrorMap: yy,
    makeIssue: _y,
    EMPTY_PATH: qre,
    addIssueToContext: Mt,
    ParseStatus: ms,
    INVALID: or,
    DIRTY: yM,
    OK: Ns,
    isAborted: z9,
    isDirty: H9,
    isValid: $w,
    isAsync: xy,
    get util() {
      return qr
    },
    get objectUtil() {
      return W9
    },
    ZodParsedType: It,
    getParsedType: zd,
    ZodType: _r,
    ZodString: sc,
    ZodNumber: Hd,
    ZodBigInt: qd,
    ZodBoolean: Ow,
    ZodDate: kf,
    ZodSymbol: Cy,
    ZodUndefined: Dw,
    ZodNull: Lw,
    ZodAny: f1,
    ZodUnknown: Rf,
    ZodNever: ku,
    ZodVoid: Ey,
    ZodArray: oc,
    ZodObject: Ln,
    ZodUnion: Bw,
    ZodDiscriminatedUnion: Sy,
    ZodIntersection: Uw,
    ZodTuple: Xc,
    ZodRecord: jw,
    ZodMap: Iy,
    ZodSet: Nf,
    ZodFunction: g1,
    ZodLazy: Fw,
    ZodLiteral: Ww,
    ZodEnum: Vd,
    ZodNativeEnum: zw,
    ZodPromise: m1,
    ZodEffects: ac,
    ZodTransformer: ac,
    ZodOptional: Ru,
    ZodNullable: Mf,
    ZodDefault: Hw,
    ZodCatch: Ty,
    ZodNaN: ky,
    BRAND: nne,
    ZodBranded: CM,
    ZodPipeline: qw,
    ZodReadonly: Ry,
    custom: EM,
    Schema: _r,
    ZodSchema: _r,
    late: ine,
    get ZodFirstPartyTypeKind() {
      return rr
    },
    coerce: {
      string: t => sc.create({
        ...t,
        coerce: !0
      }),
      number: t => Hd.create({
        ...t,
        coerce: !0
      }),
      boolean: t => Ow.create({
        ...t,
        coerce: !0
      }),
      bigint: t => qd.create({
        ...t,
        coerce: !0
      }),
      date: t => kf.create({
        ...t,
        coerce: !0
      })
    },
    any: hne,
    array: mne,
    bigint: ane,
    boolean: IM,
    date: cne,
    discriminatedUnion: yne,
    effect: TM,
    enum: kne,
    function: Sne,
    instanceof: sne,
    intersection: _ne,
    lazy: Ine,
    literal: Tne,
    map: Ene,
    nan: one,
    nativeEnum: Rne,
    never: pne,
    null: dne,
    nullable: Pne,
    number: SM,
    object: wne,
    oboolean: () => IM().optional(),
    onumber: () => SM().optional(),
    optional: Mne,
    ostring: () => AM().optional(),
    pipeline: One,
    preprocess: $ne,
    promise: Nne,
    record: Cne,
    set: Ane,
    strictObject: vne,
    string: AM,
    symbol: lne,
    transformer: TM,
    tuple: xne,
    undefined: une,
    union: bne,
    unknown: fne,
    void: gne,
    NEVER: or,
    ZodIssueCode: tt,
    quotelessJson: zre,
    ZodError: ic
  });
  const ri = ae.object({
    message: ae.string()
  });

  function Lt(t) {
    return ae.literal(zt[t])
  }
  ae.object({
    accessList: ae.array(ae.string()),
    blockHash: ae.string().nullable(),
    blockNumber: ae.string().nullable(),
    chainId: ae.string().or(ae.number()),
    from: ae.string(),
    gas: ae.string(),
    hash: ae.string(),
    input: ae.string().nullable(),
    maxFeePerGas: ae.string(),
    maxPriorityFeePerGas: ae.string(),
    nonce: ae.string(),
    r: ae.string(),
    s: ae.string(),
    to: ae.string(),
    transactionIndex: ae.string().nullable(),
    type: ae.string(),
    v: ae.string(),
    value: ae.string()
  });
  const Dne = ae.object({
      chainId: ae.string().or(ae.number())
    }),
    Lne = ae.object({
      email: ae.string().email()
    }),
    Bne = ae.object({
      otp: ae.string()
    }),
    Une = ae.object({
      uri: ae.string()
    }),
    jne = ae.object({
      chainId: ae.optional(ae.string().or(ae.number())),
      preferredAccountType: ae.optional(ae.string())
    }),
    Fne = ae.object({
      provider: ae.enum(["google", "github", "apple", "facebook", "x", "discord"])
    }),
    Wne = ae.object({
      email: ae.string().email()
    }),
    zne = ae.object({
      otp: ae.string()
    }),
    Hne = ae.object({
      otp: ae.string()
    }),
    qne = ae.object({
      themeMode: ae.optional(ae.enum(["light", "dark"])),
      themeVariables: ae.optional(ae.record(ae.string(), ae.string().or(ae.number()))),
      w3mThemeVariables: ae.optional(ae.record(ae.string(), ae.string()))
    }),
    Vne = ae.object({
      metadata: ae.object({
        name: ae.string(),
        description: ae.string(),
        url: ae.string(),
        icons: ae.array(ae.string())
      }).optional(),
      sdkVersion: ae.string().optional(),
      sdkType: ae.string().optional(),
      projectId: ae.string()
    }),
    Kne = ae.object({
      type: ae.string()
    }),
    Gne = ae.object({
      action: ae.enum(["VERIFY_DEVICE", "VERIFY_OTP"])
    }),
    Zne = ae.object({
      url: ae.string()
    }),
    Yne = ae.object({
      userName: ae.string()
    }),
    Qne = ae.object({
      email: ae.string(),
      address: ae.string(),
      chainId: ae.string().or(ae.number()),
      accounts: ae.array(ae.object({
        address: ae.string(),
        type: ae.enum([nr.ACCOUNT_TYPES.EOA, nr.ACCOUNT_TYPES.SMART_ACCOUNT])
      })).optional(),
      userName: ae.string().optional()
    }),
    Jne = ae.object({
      action: ae.enum(["VERIFY_PRIMARY_OTP", "VERIFY_SECONDARY_OTP"])
    }),
    Xne = ae.object({
      email: ae.string().email().optional().nullable(),
      address: ae.string(),
      chainId: ae.string().or(ae.number()),
      smartAccountDeployed: ae.optional(ae.boolean()),
      accounts: ae.array(ae.object({
        address: ae.string(),
        type: ae.enum([nr.ACCOUNT_TYPES.EOA, nr.ACCOUNT_TYPES.SMART_ACCOUNT])
      })).optional(),
      preferredAccountType: ae.optional(ae.string())
    }),
    eie = ae.object({
      uri: ae.string()
    }),
    tie = ae.object({
      isConnected: ae.boolean()
    }),
    rie = ae.object({
      chainId: ae.string().or(ae.number())
    }),
    nie = ae.object({
      chainId: ae.string().or(ae.number())
    }),
    iie = ae.object({
      newEmail: ae.string().email()
    }),
    sie = ae.object({
      smartAccountEnabledNetworks: ae.array(ae.number())
    });
  ae.object({
    address: ae.string(),
    isDeployed: ae.boolean()
  });
  const oie = ae.object({
      version: ae.string().optional()
    }),
    aie = ae.object({
      type: ae.string(),
      address: ae.string()
    }),
    cie = ae.any(),
    lie = ae.object({
      method: ae.literal("eth_accounts")
    }),
    uie = ae.object({
      method: ae.literal("eth_blockNumber")
    }),
    die = ae.object({
      method: ae.literal("eth_call"),
      params: ae.array(ae.any())
    }),
    hie = ae.object({
      method: ae.literal("eth_chainId")
    }),
    fie = ae.object({
      method: ae.literal("eth_estimateGas"),
      params: ae.array(ae.any())
    }),
    pie = ae.object({
      method: ae.literal("eth_feeHistory"),
      params: ae.array(ae.any())
    }),
    gie = ae.object({
      method: ae.literal("eth_gasPrice")
    }),
    mie = ae.object({
      method: ae.literal("eth_getAccount"),
      params: ae.array(ae.any())
    }),
    wie = ae.object({
      method: ae.literal("eth_getBalance"),
      params: ae.array(ae.any())
    }),
    vie = ae.object({
      method: ae.literal("eth_getBlockByHash"),
      params: ae.array(ae.any())
    }),
    bie = ae.object({
      method: ae.literal("eth_getBlockByNumber"),
      params: ae.array(ae.any())
    }),
    yie = ae.object({
      method: ae.literal("eth_getBlockReceipts"),
      params: ae.array(ae.any())
    }),
    _ie = ae.object({
      method: ae.literal("eth_getBlockTransactionCountByHash"),
      params: ae.array(ae.any())
    }),
    xie = ae.object({
      method: ae.literal("eth_getBlockTransactionCountByNumber"),
      params: ae.array(ae.any())
    }),
    Cie = ae.object({
      method: ae.literal("eth_getCode"),
      params: ae.array(ae.any())
    }),
    Eie = ae.object({
      method: ae.literal("eth_getFilterChanges"),
      params: ae.array(ae.any())
    }),
    Aie = ae.object({
      method: ae.literal("eth_getFilterLogs"),
      params: ae.array(ae.any())
    }),
    Sie = ae.object({
      method: ae.literal("eth_getLogs"),
      params: ae.array(ae.any())
    }),
    Iie = ae.object({
      method: ae.literal("eth_getProof"),
      params: ae.array(ae.any())
    }),
    Tie = ae.object({
      method: ae.literal("eth_getStorageAt"),
      params: ae.array(ae.any())
    }),
    kie = ae.object({
      method: ae.literal("eth_getTransactionByBlockHashAndIndex"),
      params: ae.array(ae.any())
    }),
    Rie = ae.object({
      method: ae.literal("eth_getTransactionByBlockNumberAndIndex"),
      params: ae.array(ae.any())
    }),
    Nie = ae.object({
      method: ae.literal("eth_getTransactionByHash"),
      params: ae.array(ae.any())
    }),
    Mie = ae.object({
      method: ae.literal("eth_getTransactionCount"),
      params: ae.array(ae.any())
    }),
    Pie = ae.object({
      method: ae.literal("eth_getTransactionReceipt"),
      params: ae.array(ae.any())
    }),
    $ie = ae.object({
      method: ae.literal("eth_getUncleCountByBlockHash"),
      params: ae.array(ae.any())
    }),
    Oie = ae.object({
      method: ae.literal("eth_getUncleCountByBlockNumber"),
      params: ae.array(ae.any())
    }),
    Die = ae.object({
      method: ae.literal("eth_maxPriorityFeePerGas")
    }),
    Lie = ae.object({
      method: ae.literal("eth_newBlockFilter")
    }),
    Bie = ae.object({
      method: ae.literal("eth_newFilter"),
      params: ae.array(ae.any())
    }),
    Uie = ae.object({
      method: ae.literal("eth_newPendingTransactionFilter")
    }),
    jie = ae.object({
      method: ae.literal("eth_sendRawTransaction"),
      params: ae.array(ae.any())
    }),
    Fie = ae.object({
      method: ae.literal("eth_syncing"),
      params: ae.array(ae.any())
    }),
    Wie = ae.object({
      method: ae.literal("eth_uninstallFilter"),
      params: ae.array(ae.any())
    }),
    kM = ae.object({
      method: ae.literal("personal_sign"),
      params: ae.array(ae.any())
    }),
    zie = ae.object({
      method: ae.literal("eth_signTypedData_v4"),
      params: ae.array(ae.any())
    }),
    RM = ae.object({
      method: ae.literal("eth_sendTransaction"),
      params: ae.array(ae.any())
    }),
    Hie = ae.object({
      method: ae.literal("solana_signMessage"),
      params: ae.object({
        message: ae.string(),
        pubkey: ae.string()
      })
    }),
    qie = ae.object({
      method: ae.literal("solana_signTransaction"),
      params: ae.object({
        transaction: ae.string()
      })
    }),
    Vie = ae.object({
      method: ae.literal("solana_signAllTransactions"),
      params: ae.object({
        transactions: ae.array(ae.string())
      })
    }),
    Kie = ae.object({
      method: ae.literal("solana_signAndSendTransaction"),
      params: ae.object({
        transaction: ae.string(),
        options: ae.object({
          skipPreflight: ae.boolean().optional(),
          preflightCommitment: ae.enum(["processed", "confirmed", "finalized", "recent", "single", "singleGossip", "root", "max"]).optional(),
          maxRetries: ae.number().optional(),
          minContextSlot: ae.number().optional()
        }).optional()
      })
    }),
    Gie = ae.object({
      method: ae.literal("wallet_sendCalls"),
      params: ae.array(ae.object({
        chainId: ae.string().or(ae.number()).optional(),
        from: ae.string().optional(),
        version: ae.string().optional(),
        capabilities: ae.any().optional(),
        calls: ae.array(ae.object({
          to: ae.string().startsWith("0x"),
          data: ae.string().startsWith("0x").optional(),
          value: ae.string().optional()
        }))
      }))
    }),
    Zie = ae.object({
      method: ae.literal("wallet_getCallsStatus"),
      params: ae.array(ae.string())
    }),
    Yie = ae.object({
      method: ae.literal("wallet_getCapabilities")
    }),
    Qie = ae.object({
      method: ae.literal("wallet_grantPermissions"),
      params: ae.array(ae.any())
    }),
    Jie = ae.object({
      method: ae.literal("wallet_revokePermissions"),
      params: ae.any()
    }),
    NM = ae.object({
      token: ae.string()
    }),
    Bt = ae.object({
      id: ae.string().optional()
    }),
    Vw = {
      appEvent: Bt.extend({
        type: Lt("APP_SWITCH_NETWORK"),
        payload: Dne
      }).or(Bt.extend({
        type: Lt("APP_CONNECT_EMAIL"),
        payload: Lne
      })).or(Bt.extend({
        type: Lt("APP_CONNECT_DEVICE")
      })).or(Bt.extend({
        type: Lt("APP_CONNECT_OTP"),
        payload: Bne
      })).or(Bt.extend({
        type: Lt("APP_CONNECT_SOCIAL"),
        payload: Une
      })).or(Bt.extend({
        type: Lt("APP_GET_FARCASTER_URI")
      })).or(Bt.extend({
        type: Lt("APP_CONNECT_FARCASTER")
      })).or(Bt.extend({
        type: Lt("APP_GET_USER"),
        payload: ae.optional(jne)
      })).or(Bt.extend({
        type: Lt("APP_GET_SOCIAL_REDIRECT_URI"),
        payload: Fne
      })).or(Bt.extend({
        type: Lt("APP_SIGN_OUT")
      })).or(Bt.extend({
        type: Lt("APP_IS_CONNECTED"),
        payload: ae.optional(NM)
      })).or(Bt.extend({
        type: Lt("APP_GET_CHAIN_ID")
      })).or(Bt.extend({
        type: Lt("APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS")
      })).or(Bt.extend({
        type: Lt("APP_INIT_SMART_ACCOUNT")
      })).or(Bt.extend({
        type: Lt("APP_SET_PREFERRED_ACCOUNT"),
        payload: Kne
      })).or(Bt.extend({
        type: Lt("APP_RPC_REQUEST"),
        payload: kM.or(RM).or(lie).or(uie).or(die).or(hie).or(fie).or(pie).or(gie).or(mie).or(wie).or(vie).or(bie).or(yie).or(_ie).or(xie).or(Cie).or(Eie).or(Aie).or(Sie).or(Iie).or(Tie).or(kie).or(Rie).or(Nie).or(Mie).or(Pie).or($ie).or(Oie).or(Die).or(Lie).or(Bie).or(Uie).or(jie).or(Fie).or(Wie).or(kM).or(zie).or(RM).or(Hie).or(qie).or(Vie).or(Kie).or(Zie).or(Gie).or(Yie).or(Qie).or(Jie)
      })).or(Bt.extend({
        type: Lt("APP_UPDATE_EMAIL"),
        payload: Wne
      })).or(Bt.extend({
        type: Lt("APP_UPDATE_EMAIL_PRIMARY_OTP"),
        payload: zne
      })).or(Bt.extend({
        type: Lt("APP_UPDATE_EMAIL_SECONDARY_OTP"),
        payload: Hne
      })).or(Bt.extend({
        type: Lt("APP_SYNC_THEME"),
        payload: qne
      })).or(Bt.extend({
        type: Lt("APP_SYNC_DAPP_DATA"),
        payload: Vne
      })),
      frameEvent: Bt.extend({
        type: Lt("FRAME_SWITCH_NETWORK_ERROR"),
        payload: ri
      }).or(Bt.extend({
        type: Lt("FRAME_SWITCH_NETWORK_SUCCESS"),
        payload: nie
      })).or(Bt.extend({
        type: Lt("FRAME_CONNECT_EMAIL_SUCCESS"),
        payload: Gne
      })).or(Bt.extend({
        type: Lt("FRAME_CONNECT_EMAIL_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_GET_FARCASTER_URI_SUCCESS"),
        payload: Zne
      })).or(Bt.extend({
        type: Lt("FRAME_GET_FARCASTER_URI_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_CONNECT_FARCASTER_SUCCESS"),
        payload: Yne
      })).or(Bt.extend({
        type: Lt("FRAME_CONNECT_FARCASTER_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_CONNECT_OTP_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_CONNECT_OTP_SUCCESS")
      })).or(Bt.extend({
        type: Lt("FRAME_CONNECT_DEVICE_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_CONNECT_DEVICE_SUCCESS")
      })).or(Bt.extend({
        type: Lt("FRAME_CONNECT_SOCIAL_SUCCESS"),
        payload: Qne
      })).or(Bt.extend({
        type: Lt("FRAME_CONNECT_SOCIAL_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_GET_USER_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_GET_USER_SUCCESS"),
        payload: Xne
      })).or(Bt.extend({
        type: Lt("FRAME_GET_SOCIAL_REDIRECT_URI_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_GET_SOCIAL_REDIRECT_URI_SUCCESS"),
        payload: eie
      })).or(Bt.extend({
        type: Lt("FRAME_SIGN_OUT_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_SIGN_OUT_SUCCESS")
      })).or(Bt.extend({
        type: Lt("FRAME_IS_CONNECTED_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_IS_CONNECTED_SUCCESS"),
        payload: tie
      })).or(Bt.extend({
        type: Lt("FRAME_GET_CHAIN_ID_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_GET_CHAIN_ID_SUCCESS"),
        payload: rie
      })).or(Bt.extend({
        type: Lt("FRAME_RPC_REQUEST_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_RPC_REQUEST_SUCCESS"),
        payload: cie
      })).or(Bt.extend({
        type: Lt("FRAME_SESSION_UPDATE"),
        payload: NM
      })).or(Bt.extend({
        type: Lt("FRAME_UPDATE_EMAIL_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_UPDATE_EMAIL_SUCCESS"),
        payload: Jne
      })).or(Bt.extend({
        type: Lt("FRAME_UPDATE_EMAIL_PRIMARY_OTP_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_UPDATE_EMAIL_PRIMARY_OTP_SUCCESS")
      })).or(Bt.extend({
        type: Lt("FRAME_UPDATE_EMAIL_SECONDARY_OTP_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_UPDATE_EMAIL_SECONDARY_OTP_SUCCESS"),
        payload: iie
      })).or(Bt.extend({
        type: Lt("FRAME_SYNC_THEME_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_SYNC_THEME_SUCCESS")
      })).or(Bt.extend({
        type: Lt("FRAME_SYNC_DAPP_DATA_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_SYNC_DAPP_DATA_SUCCESS")
      })).or(Bt.extend({
        type: Lt("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS"),
        payload: sie
      })).or(Bt.extend({
        type: Lt("FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_INIT_SMART_ACCOUNT_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_SET_PREFERRED_ACCOUNT_SUCCESS"),
        payload: aie
      })).or(Bt.extend({
        type: Lt("FRAME_SET_PREFERRED_ACCOUNT_ERROR"),
        payload: ri
      })).or(Bt.extend({
        type: Lt("FRAME_READY"),
        payload: oie
      }))
    },
    ws = {
      set(t, e) {
        vs.isClient && localStorage.setItem(`${zt.STORAGE_KEY}${t}`, e)
      },
      get(t) {
        return vs.isClient ? localStorage.getItem(`${zt.STORAGE_KEY}${t}`) : null
      },
      delete(t, e) {
        vs.isClient && (e ? localStorage.removeItem(t) : localStorage.removeItem(`${zt.STORAGE_KEY}${t}`))
      }
    },
    MM = {
      address: /^0x(?:[A-Fa-f0-9]{40})$/u,
      transactionHash: /^0x(?:[A-Fa-f0-9]{64})$/u,
      signedMessage: /^0x(?:[a-fA-F0-9]{62,})$/u
    },
    Ny = 30 * 1e3,
    vs = {
      checkIfAllowedToTriggerEmail() {
        const t = ws.get(zt.LAST_EMAIL_LOGIN_TIME);
        if (t) {
          const e = Date.now() - Number(t);
          if (e < Ny) {
            const r = Math.ceil((Ny - e) / 1e3);
            throw new Error(`Please try again after ${r} seconds`)
          }
        }
      },
      getTimeToNextEmailLogin() {
        const t = ws.get(zt.LAST_EMAIL_LOGIN_TIME);
        if (t) {
          const e = Date.now() - Number(t);
          if (e < Ny) return Math.ceil((Ny - e) / 1e3)
        }
        return 0
      },
      checkIfRequestExists(t) {
        return nr.NOT_SAFE_RPC_METHODS.includes(t.method) || nr.SAFE_RPC_METHODS.includes(t.method)
      },
      getResponseType(t) {
        return typeof t == "string" && (t?.match(MM.transactionHash) || t?.match(MM.signedMessage)) ? zt.RPC_RESPONSE_TYPE_TX : zt.RPC_RESPONSE_TYPE_OBJECT
      },
      checkIfRequestIsSafe(t) {
        return nr.SAFE_RPC_METHODS.includes(t.method)
      },
      isClient: typeof window < "u"
    };
  class Xie {
    constructor(e, r = !1, n = "eip155:1") {
      if (this.iframe = null, this.rpcUrl = pr.BLOCKCHAIN_API_RPC_URL, this.events = {
          registerFrameEventHandler: (i, s, o) => {
            function a({
              data: c
            }) {
              if (typeof c.type != "string" || !c.type.includes(zt.FRAME_EVENT_KEY)) return;
              const l = Vw.frameEvent.parse(c);
              l.id === i && (s(l), window.removeEventListener("message", a))
            }
            vs.isClient && (window.addEventListener("message", a), o.addEventListener("abort", () => {
              window.removeEventListener("message", a)
            }))
          },
          onFrameEvent: i => {
            vs.isClient && window.addEventListener("message", ({
              data: s
            }) => {
              if (typeof s.type != "string" || !s.type.includes(zt.FRAME_EVENT_KEY)) return;
              const o = Vw.frameEvent.parse(s);
              i(o)
            })
          },
          onAppEvent: i => {
            vs.isClient && window.addEventListener("message", ({
              data: s
            }) => {
              if (typeof s.type != "string" || !s.type.includes(zt.APP_EVENT_KEY)) return;
              const o = Vw.appEvent.parse(s);
              i(o)
            })
          },
          postAppEvent: i => {
            if (vs.isClient) {
              if (!this.iframe?.contentWindow) throw new Error("W3mFrame: iframe is not set");
              Vw.appEvent.parse(i), this.iframe.contentWindow.postMessage(i, "*")
            }
          },
          postFrameEvent: i => {
            if (vs.isClient) {
              if (!parent) throw new Error("W3mFrame: parent is not set");
              Vw.frameEvent.parse(i), parent.postMessage(i, "*")
            }
          }
        }, this.projectId = e, this.frameLoadPromise = new Promise((i, s) => {
          this.frameLoadPromiseResolver = {
            resolve: i,
            reject: s
          }
        }), r && (this.frameLoadPromise = new Promise((i, s) => {
          this.frameLoadPromiseResolver = {
            resolve: i,
            reject: s
          }
        }), vs.isClient)) {
        const i = document.createElement("iframe");
        i.id = "w4m-iframe", i.src = `${Fre}?projectId=${e}&chainId=${n}`, i.name = "w4m-secure-iframe", i.style.position = "fixed", i.style.zIndex = "999999", i.style.display = "none", i.style.animationDelay = "0s, 50ms", i.style.borderBottomLeftRadius = "clamp(0px, var(--wiu-border-radius-l), 44px)", i.style.borderBottomRightRadius = "clamp(0px, var(--wiu-border-radius-l), 44px)", document.body.appendChild(i), this.iframe = i, this.iframe.onload = () => {
          this.frameLoadPromiseResolver?.resolve(void 0)
        }, this.iframe.onerror = () => {
          this.frameLoadPromiseResolver?.reject("Unable to load email login dependency")
        }
      }
    }
    get networks() {
      const e = ["eip155:1", "eip155:5", "eip155:11155111", "eip155:10", "eip155:420", "eip155:42161", "eip155:421613", "eip155:137", "eip155:80001", "eip155:42220", "eip155:1313161554", "eip155:1313161555", "eip155:56", "eip155:97", "eip155:43114", "eip155:43113", "eip155:324", "eip155:280", "eip155:100", "eip155:8453", "eip155:84531", "eip155:84532", "eip155:7777777", "eip155:999", "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", "solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z", "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1"].map(r => ({
        [r]: {
          rpcUrl: `${this.rpcUrl}/v1/?chainId=${r}&projectId=${this.projectId}`,
          chainId: r
        }
      }));
      return Object.assign({}, ...e)
    }
  }

  function ese(t) {
    try {
      return JSON.stringify(t)
    } catch {
      return '"[Circular]"'
    }
  }
  var tse = rse;

  function rse(t, e, r) {
    var n = r && r.stringify || ese,
      i = 1;
    if (typeof t == "object" && t !== null) {
      var s = e.length + i;
      if (s === 1) return t;
      var o = new Array(s);
      o[0] = n(t);
      for (var a = 1; a < s; a++) o[a] = n(e[a]);
      return o.join(" ")
    }
    if (typeof t != "string") return t;
    var c = e.length;
    if (c === 0) return t;
    for (var l = "", h = 1 - i, f = -1, w = t && t.length || 0, b = 0; b < w;) {
      if (t.charCodeAt(b) === 37 && b + 1 < w) {
        switch (f = f > -1 ? f : 0, t.charCodeAt(b + 1)) {
          case 100:
          case 102:
            if (h >= c || e[h] == null) break;
            f < b && (l += t.slice(f, b)), l += Number(e[h]), f = b + 2, b++;
            break;
          case 105:
            if (h >= c || e[h] == null) break;
            f < b && (l += t.slice(f, b)), l += Math.floor(Number(e[h])), f = b + 2, b++;
            break;
          case 79:
          case 111:
          case 106:
            if (h >= c || e[h] === void 0) break;
            f < b && (l += t.slice(f, b));
            var C = typeof e[h];
            if (C === "string") {
              l += "'" + e[h] + "'", f = b + 2, b++;
              break
            }
            if (C === "function") {
              l += e[h].name || "<anonymous>", f = b + 2, b++;
              break
            }
            l += n(e[h]), f = b + 2, b++;
            break;
          case 115:
            if (h >= c) break;
            f < b && (l += t.slice(f, b)), l += String(e[h]), f = b + 2, b++;
            break;
          case 37:
            f < b && (l += t.slice(f, b)), l += "%", f = b + 2, b++, h--;
            break
        }++h
      }++b
    }
    return f === -1 ? t : (f < w && (l += t.slice(f)), l)
  }
  const PM = tse;
  var w1 = el;
  const Kw = hse().console || {},
    nse = {
      mapHttpRequest: Py,
      mapHttpResponse: Py,
      wrapRequestSerializer: G9,
      wrapResponseSerializer: G9,
      wrapErrorSerializer: G9,
      req: Py,
      res: Py,
      err: cse
    };

  function ise(t, e) {
    return Array.isArray(t) ? t.filter(function (n) {
      return n !== "!stdSerializers.err"
    }) : t === !0 ? Object.keys(e) : !1
  }

  function el(t) {
    t = t || {}, t.browser = t.browser || {};
    const e = t.browser.transmit;
    if (e && typeof e.send != "function") throw Error("pino: transmit option must have a send function");
    const r = t.browser.write || Kw;
    t.browser.write && (t.browser.asObject = !0);
    const n = t.serializers || {},
      i = ise(t.browser.serialize, n);
    let s = t.browser.serialize;
    Array.isArray(t.browser.serialize) && t.browser.serialize.indexOf("!stdSerializers.err") > -1 && (s = !1);
    const o = ["error", "fatal", "warn", "info", "debug", "trace"];
    typeof r == "function" && (r.error = r.fatal = r.warn = r.info = r.debug = r.trace = r), t.enabled === !1 && (t.level = "silent");
    const a = t.level || "info",
      c = Object.create(r);
    c.log || (c.log = Gw), Object.defineProperty(c, "levelVal", {
      get: h
    }), Object.defineProperty(c, "level", {
      get: f,
      set: w
    });
    const l = {
      transmit: e,
      serialize: i,
      asObject: t.browser.asObject,
      levels: o,
      timestamp: lse(t)
    };
    c.levels = el.levels, c.level = a, c.setMaxListeners = c.getMaxListeners = c.emit = c.addListener = c.on = c.prependListener = c.once = c.prependOnceListener = c.removeListener = c.removeAllListeners = c.listeners = c.listenerCount = c.eventNames = c.write = c.flush = Gw, c.serializers = n, c._serialize = i, c._stdErrSerialize = s, c.child = b, e && (c._logEvent = K9());

    function h() {
      return this.level === "silent" ? 1 / 0 : this.levels.values[this.level]
    }

    function f() {
      return this._level
    }

    function w(C) {
      if (C !== "silent" && !this.levels.values[C]) throw Error("unknown level " + C);
      this._level = C, v1(l, c, "error", "log"), v1(l, c, "fatal", "error"), v1(l, c, "warn", "error"), v1(l, c, "info", "log"), v1(l, c, "debug", "log"), v1(l, c, "trace", "log")
    }

    function b(C, M) {
      if (!C) throw new Error("missing bindings for child Pino");
      M = M || {}, i && C.serializers && (M.serializers = C.serializers);
      const N = M.serializers;
      if (i && N) {
        var $ = Object.assign({}, n, N),
          k = t.browser.serialize === !0 ? Object.keys($) : i;
        delete C.serializers, My([C], k, $, this._stdErrSerialize)
      }

      function B(F) {
        this._childLevel = (F._childLevel | 0) + 1, this.error = b1(F, C, "error"), this.fatal = b1(F, C, "fatal"), this.warn = b1(F, C, "warn"), this.info = b1(F, C, "info"), this.debug = b1(F, C, "debug"), this.trace = b1(F, C, "trace"), $ && (this.serializers = $, this._serialize = k), e && (this._logEvent = K9([].concat(F._logEvent.bindings, C)))
      }
      return B.prototype = this, new B(this)
    }
    return c
  }
  el.levels = {
    values: {
      fatal: 60,
      error: 50,
      warn: 40,
      info: 30,
      debug: 20,
      trace: 10
    },
    labels: {
      10: "trace",
      20: "debug",
      30: "info",
      40: "warn",
      50: "error",
      60: "fatal"
    }
  }, el.stdSerializers = nse, el.stdTimeFunctions = Object.assign({}, {
    nullTime: $M,
    epochTime: OM,
    unixTime: use,
    isoTime: dse
  });

  function v1(t, e, r, n) {
    const i = Object.getPrototypeOf(e);
    e[r] = e.levelVal > e.levels.values[r] ? Gw : i[r] ? i[r] : Kw[r] || Kw[n] || Gw, sse(t, e, r)
  }

  function sse(t, e, r) {
    !t.transmit && e[r] === Gw || (e[r] = function (n) {
      return function () {
        const s = t.timestamp(),
          o = new Array(arguments.length),
          a = Object.getPrototypeOf && Object.getPrototypeOf(this) === Kw ? Kw : this;
        for (var c = 0; c < o.length; c++) o[c] = arguments[c];
        if (t.serialize && !t.asObject && My(o, this._serialize, this.serializers, this._stdErrSerialize), t.asObject ? n.call(a, ose(this, r, o, s)) : n.apply(a, o), t.transmit) {
          const l = t.transmit.level || e.level,
            h = el.levels.values[l],
            f = el.levels.values[r];
          if (f < h) return;
          ase(this, {
            ts: s,
            methodLevel: r,
            methodValue: f,
            transmitLevel: l,
            transmitValue: el.levels.values[t.transmit.level || e.level],
            send: t.transmit.send,
            val: e.levelVal
          }, o)
        }
      }
    }(e[r]))
  }

  function ose(t, e, r, n) {
    t._serialize && My(r, t._serialize, t.serializers, t._stdErrSerialize);
    const i = r.slice();
    let s = i[0];
    const o = {};
    n && (o.time = n), o.level = el.levels.values[e];
    let a = (t._childLevel | 0) + 1;
    if (a < 1 && (a = 1), s !== null && typeof s == "object") {
      for (; a-- && typeof i[0] == "object";) Object.assign(o, i.shift());
      s = i.length ? PM(i.shift(), i) : void 0
    } else typeof s == "string" && (s = PM(i.shift(), i));
    return s !== void 0 && (o.msg = s), o
  }

  function My(t, e, r, n) {
    for (const i in t)
      if (n && t[i] instanceof Error) t[i] = el.stdSerializers.err(t[i]);
      else if (typeof t[i] == "object" && !Array.isArray(t[i]))
      for (const s in t[i]) e && e.indexOf(s) > -1 && s in r && (t[i][s] = r[s](t[i][s]))
  }

  function b1(t, e, r) {
    return function () {
      const n = new Array(1 + arguments.length);
      n[0] = e;
      for (var i = 1; i < n.length; i++) n[i] = arguments[i - 1];
      return t[r].apply(this, n)
    }
  }

  function ase(t, e, r) {
    const n = e.send,
      i = e.ts,
      s = e.methodLevel,
      o = e.methodValue,
      a = e.val,
      c = t._logEvent.bindings;
    My(r, t._serialize || Object.keys(t.serializers), t.serializers, t._stdErrSerialize === void 0 ? !0 : t._stdErrSerialize), t._logEvent.ts = i, t._logEvent.messages = r.filter(function (l) {
      return c.indexOf(l) === -1
    }), t._logEvent.level.label = s, t._logEvent.level.value = o, n(s, t._logEvent, a), t._logEvent = K9(c)
  }

  function K9(t) {
    return {
      ts: 0,
      messages: [],
      bindings: t || [],
      level: {
        label: "",
        value: 0
      }
    }
  }

  function cse(t) {
    const e = {
      type: t.constructor.name,
      msg: t.message,
      stack: t.stack
    };
    for (const r in t) e[r] === void 0 && (e[r] = t[r]);
    return e
  }

  function lse(t) {
    return typeof t.timestamp == "function" ? t.timestamp : t.timestamp === !1 ? $M : OM
  }

  function Py() {
    return {}
  }

  function G9(t) {
    return t
  }

  function Gw() {}

  function $M() {
    return !1
  }

  function OM() {
    return Date.now()
  }

  function use() {
    return Math.round(Date.now() / 1e3)
  }

  function dse() {
    return new Date(Date.now()).toISOString()
  }

  function hse() {
    function t(e) {
      return typeof e < "u" && e
    }
    try {
      return typeof globalThis < "u" || Object.defineProperty(Object.prototype, "globalThis", {
        get: function () {
          return delete Object.prototype.globalThis, this.globalThis = this
        },
        configurable: !0
      }), globalThis
    } catch {
      return t(self) || t(window) || t(this) || {}
    }
  }
  const Zw = Za(w1),
    fse = t => JSON.stringify(t, (e, r) => typeof r == "bigint" ? r.toString() + "n" : r),
    pse = t => {
      const e = /([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,
        r = t.replace(e, '$1"$2n"$3');
      return JSON.parse(r, (n, i) => typeof i == "string" && i.match(/^\d+n$/) ? BigInt(i.substring(0, i.length - 1)) : i)
    };

  function Pf(t) {
    if (typeof t != "string") throw new Error(`Cannot safe json parse value of type ${typeof t}`);
    try {
      return pse(t)
    } catch {
      return t
    }
  }

  function Nu(t) {
    return typeof t == "string" ? t : fse(t) || ""
  }
  const gse = {
      level: "info"
    },
    Yw = "custom_context",
    Z9 = 1e3 * 1024;
  let mse = class {
      constructor(e) {
        this.nodeValue = e, this.sizeInBytes = new TextEncoder().encode(this.nodeValue).length, this.next = null
      }
      get value() {
        return this.nodeValue
      }
      get size() {
        return this.sizeInBytes
      }
    },
    DM = class {
      constructor(e) {
        this.head = null, this.tail = null, this.lengthInNodes = 0, this.maxSizeInBytes = e, this.sizeInBytes = 0
      }
      append(e) {
        const r = new mse(e);
        if (r.size > this.maxSizeInBytes) throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${r.size}`);
        for (; this.size + r.size > this.maxSizeInBytes;) this.shift();
        this.head ? (this.tail && (this.tail.next = r), this.tail = r) : (this.head = r, this.tail = r), this.lengthInNodes++, this.sizeInBytes += r.size
      }
      shift() {
        if (!this.head) return;
        const e = this.head;
        this.head = this.head.next, this.head || (this.tail = null), this.lengthInNodes--, this.sizeInBytes -= e.size
      }
      toArray() {
        const e = [];
        let r = this.head;
        for (; r !== null;) e.push(r.value), r = r.next;
        return e
      }
      get length() {
        return this.lengthInNodes
      }
      get size() {
        return this.sizeInBytes
      }
      toOrderedArray() {
        return Array.from(this)
      } [Symbol.iterator]() {
        let e = this.head;
        return {
          next: () => {
            if (!e) return {
              done: !0,
              value: null
            };
            const r = e.value;
            return e = e.next, {
              done: !1,
              value: r
            }
          }
        }
      }
    },
    LM = class {
      constructor(e, r = Z9) {
        this.level = e ?? "error", this.levelValue = w1.levels.values[this.level], this.MAX_LOG_SIZE_IN_BYTES = r, this.logs = new DM(this.MAX_LOG_SIZE_IN_BYTES)
      }
      forwardToConsole(e, r) {
        r === w1.levels.values.error ? console.error(e) : r === w1.levels.values.warn ? console.warn(e) : r === w1.levels.values.debug ? console.debug(e) : r === w1.levels.values.trace ? console.trace(e) : console.log(e)
      }
      appendToLogs(e) {
        this.logs.append(Nu({
          timestamp: new Date().toISOString(),
          log: e
        }));
        const r = typeof e == "string" ? JSON.parse(e).level : e.level;
        r >= this.levelValue && this.forwardToConsole(e, r)
      }
      getLogs() {
        return this.logs
      }
      clearLogs() {
        this.logs = new DM(this.MAX_LOG_SIZE_IN_BYTES)
      }
      getLogArray() {
        return Array.from(this.logs)
      }
      logsToBlob(e) {
        const r = this.getLogArray();
        return r.push(Nu({
          extraMetadata: e
        })), new Blob(r, {
          type: "application/json"
        })
      }
    },
    wse = class {
      constructor(e, r = Z9) {
        this.baseChunkLogger = new LM(e, r)
      }
      write(e) {
        this.baseChunkLogger.appendToLogs(e)
      }
      getLogs() {
        return this.baseChunkLogger.getLogs()
      }
      clearLogs() {
        this.baseChunkLogger.clearLogs()
      }
      getLogArray() {
        return this.baseChunkLogger.getLogArray()
      }
      logsToBlob(e) {
        return this.baseChunkLogger.logsToBlob(e)
      }
      downloadLogsBlobInBrowser(e) {
        const r = URL.createObjectURL(this.logsToBlob(e)),
          n = document.createElement("a");
        n.href = r, n.download = `walletconnect-logs-${new Date().toISOString()}.txt`, document.body.appendChild(n), n.click(), document.body.removeChild(n), URL.revokeObjectURL(r)
      }
    },
    vse = class {
      constructor(e, r = Z9) {
        this.baseChunkLogger = new LM(e, r)
      }
      write(e) {
        this.baseChunkLogger.appendToLogs(e)
      }
      getLogs() {
        return this.baseChunkLogger.getLogs()
      }
      clearLogs() {
        this.baseChunkLogger.clearLogs()
      }
      getLogArray() {
        return this.baseChunkLogger.getLogArray()
      }
      logsToBlob(e) {
        return this.baseChunkLogger.logsToBlob(e)
      }
    };
  var bse = Object.defineProperty,
    yse = Object.defineProperties,
    _se = Object.getOwnPropertyDescriptors,
    BM = Object.getOwnPropertySymbols,
    xse = Object.prototype.hasOwnProperty,
    Cse = Object.prototype.propertyIsEnumerable,
    UM = (t, e, r) => e in t ? bse(t, e, {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: r
    }) : t[e] = r,
    $y = (t, e) => {
      for (var r in e || (e = {})) xse.call(e, r) && UM(t, r, e[r]);
      if (BM)
        for (var r of BM(e)) Cse.call(e, r) && UM(t, r, e[r]);
      return t
    },
    Oy = (t, e) => yse(t, _se(e));

  function y1(t) {
    return Oy($y({}, t), {
      level: t?.level || gse.level
    })
  }

  function Ese(t, e = Yw) {
    return t[e] || ""
  }

  function Ase(t, e, r = Yw) {
    return t[r] = e, t
  }

  function so(t, e = Yw) {
    let r = "";
    return typeof t.bindings > "u" ? r = Ese(t, e) : r = t.bindings().context || "", r
  }

  function Sse(t, e, r = Yw) {
    const n = so(t, r);
    return n.trim() ? `${n}/${e}` : e
  }

  function bs(t, e, r = Yw) {
    const n = Sse(t, e, r),
      i = t.child({
        context: n
      });
    return Ase(i, n, r)
  }

  function Ise(t) {
    var e, r;
    const n = new wse((e = t.opts) == null ? void 0 : e.level, t.maxSizeInBytes);
    return {
      logger: Zw(Oy($y({}, t.opts), {
        level: "trace",
        browser: Oy($y({}, (r = t.opts) == null ? void 0 : r.browser), {
          write: i => n.write(i)
        })
      })),
      chunkLoggerController: n
    }
  }

  function Tse(t) {
    var e;
    const r = new vse((e = t.opts) == null ? void 0 : e.level, t.maxSizeInBytes);
    return {
      logger: Zw(Oy($y({}, t.opts), {
        level: "trace"
      }), r),
      chunkLoggerController: r
    }
  }

  function Y9(t) {
    return typeof t.loggerOverride < "u" && typeof t.loggerOverride != "string" ? {
      logger: t.loggerOverride,
      chunkLoggerController: null
    } : typeof window < "u" ? Ise(t) : Tse(t)
  }
  class kse {
    constructor(e) {
      const r = y1({
          level: Wre
        }),
        {
          logger: n,
          chunkLoggerController: i
        } = Y9({
          opts: r
        });
      this.logger = bs(n, this.constructor.name), this.chunkLoggerController = i, typeof window < "u" && this.chunkLoggerController?.downloadLogsBlobInBrowser && (window.downloadAppKitLogsBlob || (window.downloadAppKitLogsBlob = {}), window.downloadAppKitLogsBlob.sdk = () => {
        this.chunkLoggerController?.downloadLogsBlobInBrowser && this.chunkLoggerController.downloadLogsBlobInBrowser({
          projectId: e
        })
      })
    }
  }
  class Rse {
    constructor({
      projectId: e,
      chainId: r,
      onTimeout: n
    }) {
      this.openRpcRequests = [], this.w3mLogger = new kse(e), this.w3mFrame = new Xie(e, !0, r), this.onTimeout = n
    }
    getLoginEmailUsed() {
      return !!ws.get(zt.EMAIL_LOGIN_USED_KEY)
    }
    getEmail() {
      return ws.get(zt.EMAIL)
    }
    async connectEmail(e) {
      try {
        vs.checkIfAllowedToTriggerEmail();
        const r = await this.appEvent({
          type: zt.APP_CONNECT_EMAIL,
          payload: e
        });
        return this.setNewLastEmailLoginTime(), r
      } catch (r) {
        throw this.w3mLogger.logger.error({
          error: r
        }, "Error connecting email"), r
      }
    }
    async connectDevice() {
      try {
        return this.appEvent({
          type: zt.APP_CONNECT_DEVICE
        })
      } catch (e) {
        throw this.w3mLogger.logger.error({
          error: e
        }, "Error connecting device"), e
      }
    }
    async connectOtp(e) {
      try {
        return this.appEvent({
          type: zt.APP_CONNECT_OTP,
          payload: e
        })
      } catch (r) {
        throw this.w3mLogger.logger.error({
          error: r
        }, "Error connecting otp"), r
      }
    }
    async isConnected() {
      try {
        const e = await this.appEvent({
          type: zt.APP_IS_CONNECTED
        });
        return e.isConnected || this.deleteAuthLoginCache(), e
      } catch (e) {
        throw this.deleteAuthLoginCache(), this.w3mLogger.logger.error({
          error: e
        }, "Error checking connection"), e
      }
    }
    async getChainId() {
      try {
        const e = await this.appEvent({
          type: zt.APP_GET_CHAIN_ID
        });
        return this.setLastUsedChainId(e.chainId), e
      } catch (e) {
        throw this.w3mLogger.logger.error({
          error: e
        }, "Error getting chain id"), e
      }
    }
    async getSocialRedirectUri(e) {
      try {
        return this.appEvent({
          type: zt.APP_GET_SOCIAL_REDIRECT_URI,
          payload: e
        })
      } catch (r) {
        throw this.w3mLogger.logger.error({
          error: r
        }, "Error getting social redirect uri"), r
      }
    }
    async updateEmail(e) {
      try {
        const r = await this.appEvent({
          type: zt.APP_UPDATE_EMAIL,
          payload: e
        });
        return this.setNewLastEmailLoginTime(), r
      } catch (r) {
        throw this.w3mLogger.logger.error({
          error: r
        }, "Error updating email"), r
      }
    }
    async updateEmailPrimaryOtp(e) {
      try {
        return this.appEvent({
          type: zt.APP_UPDATE_EMAIL_PRIMARY_OTP,
          payload: e
        })
      } catch (r) {
        throw this.w3mLogger.logger.error({
          error: r
        }, "Error updating email primary otp"), r
      }
    }
    async updateEmailSecondaryOtp(e) {
      try {
        const r = await this.appEvent({
          type: zt.APP_UPDATE_EMAIL_SECONDARY_OTP,
          payload: e
        });
        return this.setLoginSuccess(r.newEmail), r
      } catch (r) {
        throw this.w3mLogger.logger.error({
          error: r
        }, "Error updating email secondary otp"), r
      }
    }
    async syncTheme(e) {
      try {
        return this.appEvent({
          type: zt.APP_SYNC_THEME,
          payload: e
        })
      } catch (r) {
        throw this.w3mLogger.logger.error({
          error: r
        }, "Error syncing theme"), r
      }
    }
    async syncDappData(e) {
      try {
        return this.appEvent({
          type: zt.APP_SYNC_DAPP_DATA,
          payload: e
        })
      } catch (r) {
        throw this.w3mLogger.logger.error({
          error: r
        }, "Error syncing dapp data"), r
      }
    }
    async getSmartAccountEnabledNetworks() {
      try {
        const e = await this.appEvent({
          type: zt.APP_GET_SMART_ACCOUNT_ENABLED_NETWORKS
        });
        return this.persistSmartAccountEnabledNetworks(e.smartAccountEnabledNetworks), e
      } catch (e) {
        throw this.persistSmartAccountEnabledNetworks([]), this.w3mLogger.logger.error({
          error: e
        }, "Error getting smart account enabled networks"), e
      }
    }
    async setPreferredAccount(e) {
      try {
        return this.appEvent({
          type: zt.APP_SET_PREFERRED_ACCOUNT,
          payload: {
            type: e
          }
        })
      } catch (r) {
        throw this.w3mLogger.logger.error({
          error: r
        }, "Error setting preferred account"), r
      }
    }
    async connect(e) {
      try {
        const r = e?.chainId || this.getLastUsedChainId() || 1,
          n = await this.appEvent({
            type: zt.APP_GET_USER,
            payload: {
              ...e,
              chainId: r
            }
          });
        return this.setLoginSuccess(n.email), this.setLastUsedChainId(n.chainId), n
      } catch (r) {
        throw this.w3mLogger.logger.error({
          error: r
        }, "Error connecting"), r
      }
    }
    async getUser(e) {
      try {
        const r = e?.chainId || this.getLastUsedChainId() || 1;
        return await this.appEvent({
          type: zt.APP_GET_USER,
          payload: {
            ...e,
            chainId: r
          }
        })
      } catch (r) {
        throw this.w3mLogger.logger.error({
          error: r
        }, "Error connecting"), r
      }
    }
    async connectSocial(e) {
      try {
        const r = await this.appEvent({
          type: zt.APP_CONNECT_SOCIAL,
          payload: {
            uri: e
          }
        });
        return r.userName && this.setSocialLoginSuccess(r.userName), r
      } catch (r) {
        throw this.w3mLogger.logger.error({
          error: r
        }, "Error connecting social"), r
      }
    }
    async getFarcasterUri() {
      try {
        return await this.appEvent({
          type: zt.APP_GET_FARCASTER_URI
        })
      } catch (e) {
        throw this.w3mLogger.logger.error({
          error: e
        }, "Error getting farcaster uri"), e
      }
    }
    async connectFarcaster() {
      try {
        const e = await this.appEvent({
          type: zt.APP_CONNECT_FARCASTER
        });
        return e.userName && this.setSocialLoginSuccess(e.userName), e
      } catch (e) {
        throw this.w3mLogger.logger.error({
          error: e
        }, "Error connecting farcaster"), e
      }
    }
    async switchNetwork(e) {
      try {
        const r = await this.appEvent({
          type: zt.APP_SWITCH_NETWORK,
          payload: {
            chainId: e
          }
        });
        return this.setLastUsedChainId(r.chainId), r
      } catch (r) {
        throw this.w3mLogger.logger.error({
          error: r
        }, "Error switching network"), r
      }
    }
    async disconnect() {
      try {
        const e = await this.appEvent({
          type: zt.APP_SIGN_OUT
        });
        return this.deleteAuthLoginCache(), e
      } catch (e) {
        throw this.w3mLogger.logger.error({
          error: e
        }, "Error disconnecting"), e
      }
    }
    async request(e) {
      try {
        if (nr.GET_CHAIN_ID === e.method) return this.getLastUsedChainId();
        this.rpcRequestHandler?.(e);
        const r = await this.appEvent({
          type: zt.APP_RPC_REQUEST,
          payload: e
        });
        return this.rpcSuccessHandler?.(r, e), r
      } catch (r) {
        throw this.rpcErrorHandler?.(r, e), this.w3mLogger.logger.error({
          error: r
        }, "Error requesting"), r
      }
    }
    onRpcRequest(e) {
      this.rpcRequestHandler = e
    }
    onRpcSuccess(e) {
      this.rpcSuccessHandler = e
    }
    onRpcError(e) {
      this.rpcErrorHandler = e
    }
    onIsConnected(e) {
      this.w3mFrame.events.onFrameEvent(r => {
        r.type === zt.FRAME_IS_CONNECTED_SUCCESS && r.payload.isConnected && e()
      })
    }
    onNotConnected(e) {
      this.w3mFrame.events.onFrameEvent(r => {
        r.type === zt.FRAME_IS_CONNECTED_ERROR && e(), r.type === zt.FRAME_IS_CONNECTED_SUCCESS && !r.payload.isConnected && e()
      })
    }
    onConnect(e) {
      this.w3mFrame.events.onFrameEvent(r => {
        r.type === zt.FRAME_GET_USER_SUCCESS && e(r.payload)
      })
    }
    async getCapabilities() {
      try {
        return await this.request({
          method: "wallet_getCapabilities"
        }) || {}
      } catch {
        return {}
      }
    }
    onSetPreferredAccount(e) {
      this.w3mFrame.events.onFrameEvent(r => {
        r.type === zt.FRAME_SET_PREFERRED_ACCOUNT_SUCCESS ? e(r.payload) : r.type === zt.FRAME_SET_PREFERRED_ACCOUNT_ERROR && e({
          type: nr.ACCOUNT_TYPES.EOA
        })
      })
    }
    onGetSmartAccountEnabledNetworks(e) {
      this.w3mFrame.events.onFrameEvent(r => {
        r.type === zt.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_SUCCESS ? e(r.payload.smartAccountEnabledNetworks) : r.type === zt.FRAME_GET_SMART_ACCOUNT_ENABLED_NETWORKS_ERROR && e([])
      })
    }
    getAvailableChainIds() {
      return Object.keys(this.w3mFrame.networks)
    }
    rejectRpcRequests() {
      try {
        this.openRpcRequests.forEach(({
          abortController: e,
          method: r
        }) => {
          nr.SAFE_RPC_METHODS.includes(r) || e.abort()
        }), this.openRpcRequests = []
      } catch (e) {
        this.w3mLogger.logger.error({
          error: e
        }, "Error aborting RPC request")
      }
    }
    async appEvent(e) {
      await this.w3mFrame.frameLoadPromise;
      let r;

      function n(a) {
        return a.replace("@w4m-app/", "")
      }
      const i = new AbortController,
        s = n(e.type);
      return [zt.APP_CONNECT_EMAIL, zt.APP_CONNECT_DEVICE, zt.APP_CONNECT_OTP, zt.APP_CONNECT_SOCIAL, zt.APP_GET_SOCIAL_REDIRECT_URI, zt.APP_GET_FARCASTER_URI].map(n).includes(s) && (r = setTimeout(() => {
        this.onTimeout?.(), i.abort()
      }, 3e4)), new Promise((a, c) => {
        const l = Math.random().toString(36).substring(7);
        if (this.w3mLogger.logger.info?.({
            event: e,
            id: l
          }, "Sending app event"), this.w3mFrame.events.postAppEvent({
            ...e,
            id: l
          }), s === "RPC_REQUEST") {
          const f = e;
          this.openRpcRequests = [...this.openRpcRequests, {
            ...f.payload,
            abortController: i
          }]
        }
        i.signal.addEventListener("abort", () => {
          c(s === "RPC_REQUEST" ? new Error("Request was aborted") : new Error("Something went wrong"))
        });

        function h(f, w) {
          f.id === l && (w.logger.info?.({
            framEvent: f,
            id: l
          }, "Received frame response"), f.type === `@w4m-frame/${s}_SUCCESS` ? (r && clearTimeout(r), "payload" in f && a(f.payload), a(void 0)) : f.type === `@w4m-frame/${s}_ERROR` && (r && clearTimeout(r), "payload" in f && c(new Error(f.payload?.message || "An error occurred")), c(new Error("An error occurred"))))
        }
        this.w3mFrame.events.registerFrameEventHandler(l, f => h(f, this.w3mLogger), i.signal)
      })
    }
    setNewLastEmailLoginTime() {
      ws.set(zt.LAST_EMAIL_LOGIN_TIME, Date.now().toString())
    }
    setSocialLoginSuccess(e) {
      ws.set(zt.SOCIAL_USERNAME, e)
    }
    setLoginSuccess(e) {
      e && ws.set(zt.EMAIL, e), ws.set(zt.EMAIL_LOGIN_USED_KEY, "true"), ws.delete(zt.LAST_EMAIL_LOGIN_TIME)
    }
    deleteAuthLoginCache() {
      ws.delete(zt.EMAIL_LOGIN_USED_KEY), ws.delete(zt.EMAIL), ws.delete(zt.LAST_USED_CHAIN_KEY), ws.delete(zt.SOCIAL_USERNAME)
    }
    setLastUsedChainId(e) {
      e && ws.set(zt.LAST_USED_CHAIN_KEY, String(e))
    }
    getLastUsedChainId() {
      return Number(ws.get(zt.LAST_USED_CHAIN_KEY))
    }
    persistSmartAccountEnabledNetworks(e) {
      ws.set(zt.SMART_ACCOUNT_ENABLED_NETWORKS, e.join(","))
    }
  }
  const yn = jr({
      transactions: [],
      coinbaseTransactions: {},
      transactionsByYear: {},
      lastNetworkInView: void 0,
      loading: !1,
      empty: !1,
      next: void 0
    }),
    yi = {
      state: yn,
      subscribe(t) {
        return Rn(yn, () => t(yn))
      },
      setLastNetworkInView(t) {
        yn.lastNetworkInView = t
      },
      async fetchTransactions(t, e) {
        const {
          projectId: r
        } = Ue.state;
        if (!r || !t) throw new Error("Transactions can't be fetched without a projectId and an accountAddress");
        yn.loading = !0;
        try {
          const n = await An.fetchTransactions({
              account: t,
              projectId: r,
              cursor: yn.next,
              onramp: e,
              cache: e === "coinbase" ? "no-cache" : void 0,
              chainId: fe.state.activeCaipNetwork?.caipNetworkId
            }),
            i = this.filterSpamTransactions(n.data),
            s = this.filterByConnectedChain(i),
            o = [...yn.transactions, ...s];
          yn.loading = !1, e === "coinbase" ? yn.coinbaseTransactions = this.groupTransactionsByYearAndMonth(yn.coinbaseTransactions, n.data) : (yn.transactions = o, yn.transactionsByYear = this.groupTransactionsByYearAndMonth(yn.transactionsByYear, s)), yn.empty = o.length === 0, yn.next = n.next ? n.next : void 0
        } catch {
          nt.sendEvent({
            type: "track",
            event: "ERROR_FETCH_TRANSACTIONS",
            properties: {
              address: t,
              projectId: r,
              cursor: yn.next,
              isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT
            }
          }), Rt.showError("Failed to fetch transactions"), yn.loading = !1, yn.empty = !0, yn.next = void 0
        }
      },
      groupTransactionsByYearAndMonth(t = {}, e = []) {
        const r = t;
        return e.forEach(n => {
          const i = new Date(n.metadata.minedAt).getFullYear(),
            s = new Date(n.metadata.minedAt).getMonth(),
            o = r[i] ?? {},
            c = (o[s] ?? []).filter(l => l.id !== n.id);
          r[i] = {
            ...o,
            [s]: [...c, n].sort((l, h) => new Date(h.metadata.minedAt).getTime() - new Date(l.metadata.minedAt).getTime())
          }
        }), r
      },
      filterSpamTransactions(t) {
        return t.filter(e => !e.transfers.every(n => n.nft_info?.flags.is_spam === !0))
      },
      filterByConnectedChain(t) {
        const e = fe.state.activeCaipNetwork?.caipNetworkId;
        return t.filter(n => n.metadata.chain === e)
      },
      clearCursor() {
        yn.next = void 0
      },
      resetTransactions() {
        yn.transactions = [], yn.transactionsByYear = {}, yn.lastNetworkInView = void 0, yn.loading = !1, yn.empty = !1, yn.next = void 0
      }
    },
    Mu = jr({
      themeMode: "dark",
      themeVariables: {},
      w3mThemeVariables: void 0
    }),
    Sn = {
      state: Mu,
      subscribe(t) {
        return Rn(Mu, () => t(Mu))
      },
      setThemeMode(t) {
        Mu.themeMode = t;
        try {
          const e = Tt.getAuthConnector();
          if (e) {
            const r = Sn.getSnapshot().themeVariables;
            e.provider.syncTheme({
              themeMode: t,
              themeVariables: r,
              w3mThemeVariables: Tu(r, t)
            })
          }
        } catch {
          console.info("Unable to sync theme to auth connector")
        }
      },
      setThemeVariables(t) {
        Mu.themeVariables = {
          ...Mu.themeVariables,
          ...t
        };
        try {
          const e = Tt.getAuthConnector();
          if (e) {
            const r = Sn.getSnapshot().themeVariables;
            e.provider.syncTheme({
              themeVariables: r,
              w3mThemeVariables: Tu(Mu.themeVariables, Mu.themeMode)
            })
          }
        } catch {
          console.info("Unable to sync theme to auth connector")
        }
      },
      getSnapshot() {
        return fy(Mu)
      }
    },
    cc = jr({
      allConnectors: [],
      connectors: []
    }),
    Tt = {
      state: cc,
      subscribeKey(t, e) {
        return ts(cc, t, e)
      },
      setConnectors(t) {
        const e = t.filter(r => {
          try {
            jr(r)
          } catch (n) {
            return console.error("ConnectorController.setConnectors: Not possible to add connector", {
              newConnector: r,
              error: n
            }), !1
          }
          return !cc.allConnectors.some(n => n.id === r.id && this.getConnectorName(n.name) === this.getConnectorName(r.name) && n.chain === r.chain)
        });
        cc.allConnectors = [...cc.allConnectors, ...e], cc.connectors = this.mergeMultiChainConnectors(cc.allConnectors)
      },
      mergeMultiChainConnectors(t) {
        const e = this.generateConnectorMapByName(t),
          r = [];
        return e.forEach(n => {
          const i = n[0],
            s = i?.id === "w3mAuth";
          n.length > 1 ? r.push({
            name: i?.name,
            imageUrl: i?.imageUrl,
            imageId: i?.imageId,
            connectors: [...n],
            type: s ? "AUTH" : "MULTI_CHAIN",
            chain: "eip155",
            id: i?.id || ""
          }) : i && r.push(i)
        }), r
      },
      generateConnectorMapByName(t) {
        const e = new Map;
        return t.forEach(r => {
          const {
            name: n
          } = r, i = this.getConnectorName(n);
          if (!i) return;
          const s = e.get(i) || [];
          s.find(a => a.chain === r.chain) || s.push(r), e.set(i, s)
        }), e
      },
      getConnectorName(t) {
        return t && ({
          "Trust Wallet": "Trust"
        } [t] || t)
      },
      getUniqueConnectorsByName(t) {
        const e = [];
        return t.forEach(r => {
          e.find(n => n.chain === r.chain) || e.push(r)
        }), e
      },
      addConnector(t) {
        if (t.id === "w3mAuth") {
          const e = t,
            r = fy(Ue.state),
            n = Sn.getSnapshot().themeMode,
            i = Sn.getSnapshot().themeVariables;
          e?.provider?.syncDappData?.({
            metadata: r.metadata,
            sdkVersion: r.sdkVersion,
            projectId: r.projectId,
            sdkType: r.sdkType
          }), e.provider.syncTheme({
            themeMode: n,
            themeVariables: i,
            w3mThemeVariables: Tu(i, n)
          }), this.setConnectors([t])
        } else this.setConnectors([t])
      },
      getAuthConnector() {
        const t = fe.state.activeChain,
          e = cc.connectors.find(r => r.id === "w3mAuth");
        if (e) return e?.connectors?.length ? e.connectors.find(n => n.chain === t) : e
      },
      getAnnouncedConnectorRdns() {
        return cc.connectors.filter(t => t.type === "ANNOUNCED").map(t => t.info?.rdns)
      },
      getConnectors() {
        return cc.connectors
      },
      getConnector(t, e) {
        return cc.connectors.find(r => r.explorerId === t || r.info?.rdns === e)
      },
      syncIfAuthConnector(t) {
        if (t.id !== "w3mAuth") return;
        const e = t,
          r = fy(Ue.state),
          n = Sn.getSnapshot().themeMode,
          i = Sn.getSnapshot().themeVariables;
        e?.provider?.syncDappData?.({
          metadata: r.metadata,
          sdkVersion: r.sdkVersion,
          sdkType: r.sdkType,
          projectId: r.projectId
        }), e.provider.syncTheme({
          themeMode: n,
          themeVariables: i,
          w3mThemeVariables: Tu(i, n)
        })
      }
    },
    Vn = jr({
      wcError: !1,
      buffering: !1,
      status: "disconnected"
    });
  let _1;
  const Kt = {
      state: Vn,
      subscribeKey(t, e) {
        return ts(Vn, t, e)
      },
      _getClient(t) {
        return fe.getConnectionControllerClient(t)
      },
      setClient(t) {
        Vn._client = rc(t)
      },
      async connectWalletConnect() {
        if (Ar.setConnectedConnector("WALLET_CONNECT"), je.isTelegram()) {
          if (_1) {
            try {
              await _1
            } catch {}
            _1 = void 0;
            return
          }
          if (!je.isPairingExpired(Vn?.wcPairingExpiry)) {
            const t = Vn.wcUri;
            Vn.wcUri = t;
            return
          }
          _1 = new Promise(async (t, e) => {
            await fe.state?.universalAdapter?.connectionControllerClient?.connectWalletConnect?.(r => {
              Vn.wcUri = r, Vn.wcPairingExpiry = je.getPairingExpiry()
            }).catch(e), t()
          }), this.state.status = "connecting", await _1, _1 = void 0, Vn.wcPairingExpiry = void 0, this.state.status = "connected"
        } else await fe.state?.universalAdapter?.connectionControllerClient?.connectWalletConnect?.(t => {
          Vn.wcUri = t, Vn.wcPairingExpiry = je.getPairingExpiry()
        })
      },
      async connectExternal(t, e, r = !0) {
        await this._getClient(e).connectExternal?.(t), r && (fe.setActiveNamespace(e), Ar.setConnectedConnector(t.type))
      },
      async reconnectExternal(t) {
        await this._getClient().reconnectExternal?.(t), Ar.setConnectedConnector(t.type)
      },
      async setPreferredAccountType(t) {
        Ot.setLoading(!0);
        const e = Tt.getAuthConnector();
        e && (await e?.provider.setPreferredAccount(t), await this.reconnectExternal(e), Ot.setLoading(!1), nt.sendEvent({
          type: "track",
          event: "SET_PREFERRED_ACCOUNT_TYPE",
          properties: {
            accountType: t,
            network: fe.state.activeCaipNetwork?.caipNetworkId || ""
          }
        }))
      },
      async signMessage(t) {
        return this._getClient().signMessage(t)
      },
      parseUnits(t, e) {
        return this._getClient().parseUnits(t, e)
      },
      formatUnits(t, e) {
        return this._getClient().formatUnits(t, e)
      },
      async sendTransaction(t) {
        return this._getClient().sendTransaction(t)
      },
      async getCapabilities(t) {
        return this._getClient().getCapabilities(t)
      },
      async grantPermissions(t) {
        return this._getClient().grantPermissions(t)
      },
      async estimateGas(t) {
        return this._getClient().estimateGas(t)
      },
      async writeContract(t) {
        return this._getClient().writeContract(t)
      },
      async getEnsAddress(t) {
        return this._getClient().getEnsAddress(t)
      },
      async getEnsAvatar(t) {
        return this._getClient().getEnsAvatar(t)
      },
      checkInstalled(t, e) {
        return this._getClient(e).checkInstalled?.(t) || !1
      },
      resetWcConnection() {
        Vn.wcUri = void 0, Vn.wcPairingExpiry = void 0, Vn.wcLinking = void 0, Vn.recentWallet = void 0, Vn.status = "disconnected", yi.resetTransactions(), Ar.deleteWalletConnectDeepLink()
      },
      setWcLinking(t) {
        Vn.wcLinking = t
      },
      setWcError(t) {
        Vn.wcError = t, Vn.buffering = !1
      },
      setRecentWallet(t) {
        Vn.recentWallet = t
      },
      setBuffering(t) {
        Vn.buffering = t
      },
      setStatus(t) {
        Vn.status = t
      },
      async disconnect() {
        try {
          const t = this._getClient(),
            e = Ue.state.siwx;
          if (e) {
            const r = fe.getActiveCaipNetwork(),
              n = je.getPlainAddress(fe.getActiveCaipAddress());
            r && n && await e.revokeSession(r.caipNetworkId, n)
          }
          await t?.disconnect(), this.resetWcConnection()
        } catch {
          throw new Error("Failed to disconnect")
        }
      },
      async initializeSWIXIfAvailable() {
        const t = Ue.state.siwx,
          e = je.getPlainAddress(fe.getActiveCaipAddress()),
          r = fe.getActiveCaipNetwork();
        if (!(t && e && r)) return;
        if (Ue.state.isSiweEnabled) {
          console.warn("SIWE is enabled skipping experimental SIWX initialization");
          return
        }
        const n = this._getClient(r?.chainNamespace);
        try {
          if ((await t.getSessions(r.caipNetworkId, e)).length) return;
          await Ot.open({
            view: Ar.getConnectedConnector() === "AUTH" ? "ApproveTransaction" : "SIWXSignMessage"
          });
          const s = await t.createMessage({
              chainId: r.caipNetworkId,
              accountAddress: e
            }),
            o = s.toString(),
            a = await n.signMessage(o);
          await t.addSession({
            data: s,
            message: o,
            signature: a
          }), Ot.close()
        } catch (i) {
          console.error("Failed to initialize SIWX", i), Ot.setLoading(!0), await n.disconnect().finally(() => {
            Ot.setLoading(!1)
          })
        }
      }
    },
    Qw = {
      async getTokenList() {
        const t = fe.state.activeCaipNetwork;
        return (await An.fetchSwapTokens({
          chainId: t?.caipNetworkId,
          projectId: Ue.state.projectId
        }))?.tokens?.map(n => ({
          ...n,
          eip2612: !1,
          quantity: {
            decimals: "0",
            numeric: "0"
          },
          price: 0,
          value: 0
        })) || []
      },
      async fetchGasPrice() {
        const t = Ue.state.projectId,
          e = fe.state.activeCaipNetwork;
        if (!e) return null;
        try {
          switch (e.chainNamespace) {
            case "solana":
              const r = (await Kt.estimateGas({
                chainNamespace: "solana"
              })).toString();
              return {
                standard: r, fast: r, instant: r
              };
            case "eip155":
            default:
              return await An.fetchGasPrice({
                projectId: t,
                chainId: e.caipNetworkId
              })
          }
        } catch {
          return null
        }
      },
      async fetchSwapAllowance({
        tokenAddress: t,
        userAddress: e,
        sourceTokenAmount: r,
        sourceTokenDecimals: n
      }) {
        const i = Ue.state.projectId,
          s = await An.fetchSwapAllowance({
            projectId: i,
            tokenAddress: t,
            userAddress: e
          });
        if (s?.allowance && r && n) {
          const o = Kt.parseUnits(r, n) || 0;
          return BigInt(s.allowance) >= o
        }
        return !1
      },
      async getMyTokensWithBalance(t) {
        const e = ke.state.address,
          r = fe.state.activeCaipNetwork;
        if (!e || !r) return [];
        const i = (await An.getBalance(e, r.caipNetworkId, t)).balances.filter(s => s.quantity.decimals !== "0");
        return ke.setTokenBalance(i, fe.state.activeChain), this.mapBalancesToSwapTokens(i)
      },
      mapBalancesToSwapTokens(t) {
        return t?.map(e => ({
          ...e,
          address: e?.address ? e.address : fe.getActiveNetworkTokenAddress(),
          decimals: parseInt(e.quantity.decimals, 10),
          logoUri: e.iconUrl,
          eip2612: !1
        })) || []
      }
    },
    _n = jr({
      view: "Connect",
      history: ["Connect"],
      transactionStack: []
    }),
    Ae = {
      state: _n,
      subscribeKey(t, e) {
        return ts(_n, t, e)
      },
      pushTransactionStack(t) {
        _n.transactionStack.push(t)
      },
      popTransactionStack(t) {
        const e = _n.transactionStack.pop();
        if (e)
          if (t) this.goBack(), e?.onCancel?.();
          else {
            if (e.goBack) this.goBack();
            else if (e.replace) {
              const n = _n.history.indexOf("ConnectingSiwe");
              n > 0 ? this.goBackToIndex(n - 1) : (Ot.close(), _n.history = [])
            } else e.view && this.reset(e.view);
            e?.onSuccess?.()
          }
      },
      push(t, e) {
        t !== _n.view && (_n.view = t, _n.history.push(t), _n.data = e)
      },
      reset(t) {
        _n.view = t, _n.history = [t]
      },
      replace(t, e) {
        _n.history.at(-1) === t || (_n.view = t, _n.history[_n.history.length - 1] = t, _n.data = e)
      },
      goBack() {
        if (_n.history.length > 1) {
          _n.history.pop();
          const [t] = _n.history.slice(-1);
          t && (_n.view = t)
        } else Ot.close()
      },
      goBackToIndex(t) {
        if (_n.history.length > 1) {
          _n.history = _n.history.slice(0, t + 1);
          const [e] = _n.history.slice(-1);
          e && (_n.view = e)
        }
      }
    },
    Pu = {
      getGasPriceInEther(t, e) {
        const r = e * t;
        return Number(r) / 1e18
      },
      getGasPriceInUSD(t, e, r) {
        const n = Pu.getGasPriceInEther(e, r);
        return Or.bigNumber(t).multipliedBy(n).toNumber()
      },
      getPriceImpact({
        sourceTokenAmount: t,
        sourceTokenPriceInUSD: e,
        toTokenPriceInUSD: r,
        toTokenAmount: n
      }) {
        const i = Or.bigNumber(t).multipliedBy(e),
          s = Or.bigNumber(n).multipliedBy(r);
        return i.minus(s).dividedBy(i).multipliedBy(100).toNumber()
      },
      getMaxSlippage(t, e) {
        const r = Or.bigNumber(t).dividedBy(100);
        return Or.multiply(e, r).toNumber()
      },
      getProviderFee(t, e = .0085) {
        return Or.bigNumber(t).multipliedBy(e).toString()
      },
      isInsufficientNetworkTokenForGas(t, e) {
        const r = e || "0";
        return Or.bigNumber(t).isZero() ? !0 : Or.bigNumber(Or.bigNumber(r)).isGreaterThan(t)
      },
      isInsufficientSourceTokenForSwap(t, e, r) {
        const n = r?.find(s => s.address === e)?.quantity?.numeric;
        return Or.bigNumber(n || "0").isLessThan(t)
      },
      getToTokenAmount({
        sourceToken: t,
        toToken: e,
        sourceTokenPrice: r,
        toTokenPrice: n,
        sourceTokenAmount: i
      }) {
        if (i === "0" || !t || !e) return "0";
        const s = t.decimals,
          o = r,
          a = e.decimals,
          c = n;
        if (c <= 0) return "0";
        const l = Or.bigNumber(i).multipliedBy(.0085),
          f = Or.bigNumber(i).minus(l).multipliedBy(Or.bigNumber(10).pow(s)),
          w = Or.bigNumber(o).dividedBy(c),
          b = s - a;
        return f.multipliedBy(w).dividedBy(Or.bigNumber(10).pow(b)).dividedBy(Or.bigNumber(10).pow(a)).toFixed(a).toString()
      }
    },
    jM = 15e4,
    Nse = 6,
    oo = {
      initializing: !1,
      initialized: !1,
      loadingPrices: !1,
      loadingQuote: !1,
      loadingApprovalTransaction: !1,
      loadingBuildTransaction: !1,
      loadingTransaction: !1,
      fetchError: !1,
      approvalTransaction: void 0,
      swapTransaction: void 0,
      transactionError: void 0,
      sourceToken: void 0,
      sourceTokenAmount: "",
      sourceTokenPriceInUSD: 0,
      toToken: void 0,
      toTokenAmount: "",
      toTokenPriceInUSD: 0,
      networkPrice: "0",
      networkBalanceInUSD: "0",
      networkTokenSymbol: "",
      inputError: void 0,
      slippage: Qr.CONVERT_SLIPPAGE_TOLERANCE,
      tokens: void 0,
      popularTokens: void 0,
      suggestedTokens: void 0,
      foundTokens: void 0,
      myTokensWithBalance: void 0,
      tokensPriceMap: {},
      gasFee: "0",
      gasPriceInUSD: 0,
      priceImpact: void 0,
      maxSlippage: void 0,
      providerFee: void 0
    },
    Ne = jr(oo),
    ut = {
      state: Ne,
      subscribe(t) {
        return Rn(Ne, () => t(Ne))
      },
      subscribeKey(t, e) {
        return ts(Ne, t, e)
      },
      getParams() {
        const t = fe.state.activeCaipAddress,
          e = je.getPlainAddress(t),
          r = fe.getActiveNetworkTokenAddress(),
          n = Ar.getConnectedConnector();
        if (!e) throw new Error("No address found to swap the tokens from.");
        const i = !Ne.toToken?.address || !Ne.toToken?.decimals,
          s = !Ne.sourceToken?.address || !Ne.sourceToken?.decimals || !Or.bigNumber(Ne.sourceTokenAmount).isGreaterThan(0),
          o = !Ne.sourceTokenAmount;
        return {
          networkAddress: r,
          fromAddress: e,
          fromCaipAddress: t,
          sourceTokenAddress: Ne.sourceToken?.address,
          toTokenAddress: Ne.toToken?.address,
          toTokenAmount: Ne.toTokenAmount,
          toTokenDecimals: Ne.toToken?.decimals,
          sourceTokenAmount: Ne.sourceTokenAmount,
          sourceTokenDecimals: Ne.sourceToken?.decimals,
          invalidToToken: i,
          invalidSourceToken: s,
          invalidSourceTokenAmount: o,
          availableToSwap: t && !i && !s && !o,
          isAuthConnector: n === "AUTH"
        }
      },
      setSourceToken(t) {
        if (!t) {
          Ne.sourceToken = t, Ne.sourceTokenAmount = "", Ne.sourceTokenPriceInUSD = 0;
          return
        }
        Ne.sourceToken = t, this.setTokenPrice(t.address, "sourceToken")
      },
      setSourceTokenAmount(t) {
        Ne.sourceTokenAmount = t
      },
      setToToken(t) {
        if (!t) {
          Ne.toToken = t, Ne.toTokenAmount = "", Ne.toTokenPriceInUSD = 0;
          return
        }
        Ne.toToken = t, this.setTokenPrice(t.address, "toToken")
      },
      setToTokenAmount(t) {
        Ne.toTokenAmount = t ? Or.formatNumberToLocalString(t, Nse) : ""
      },
      async setTokenPrice(t, e) {
        const {
          availableToSwap: r
        } = this.getParams();
        let n = Ne.tokensPriceMap[t] || 0;
        n || (Ne.loadingPrices = !0, n = await this.getAddressPrice(t)), e === "sourceToken" ? Ne.sourceTokenPriceInUSD = n : e === "toToken" && (Ne.toTokenPriceInUSD = n), Ne.loadingPrices && (Ne.loadingPrices = !1, r && this.swapTokens())
      },
      switchTokens() {
        if (Ne.initializing || !Ne.initialized) return;
        const t = Ne.toToken ? {
            ...Ne.toToken
          } : void 0,
          e = Ne.sourceToken ? {
            ...Ne.sourceToken
          } : void 0,
          r = t && Ne.toTokenAmount === "" ? "1" : Ne.toTokenAmount;
        this.setSourceToken(t), this.setToToken(e), this.setSourceTokenAmount(r), this.setToTokenAmount(""), this.swapTokens()
      },
      resetState() {
        Ne.myTokensWithBalance = oo.myTokensWithBalance, Ne.tokensPriceMap = oo.tokensPriceMap, Ne.initialized = oo.initialized, Ne.sourceToken = oo.sourceToken, Ne.sourceTokenAmount = oo.sourceTokenAmount, Ne.sourceTokenPriceInUSD = oo.sourceTokenPriceInUSD, Ne.toToken = oo.toToken, Ne.toTokenAmount = oo.toTokenAmount, Ne.toTokenPriceInUSD = oo.toTokenPriceInUSD, Ne.networkPrice = oo.networkPrice, Ne.networkTokenSymbol = oo.networkTokenSymbol, Ne.networkBalanceInUSD = oo.networkBalanceInUSD, Ne.inputError = oo.inputError
      },
      resetValues() {
        const {
          networkAddress: t
        } = this.getParams(), e = Ne.tokens?.find(r => r.address === t);
        this.setSourceToken(e), this.setToToken(void 0)
      },
      getApprovalLoadingState() {
        return Ne.loadingApprovalTransaction
      },
      clearError() {
        Ne.transactionError = void 0
      },
      async initializeState() {
        if (!Ne.initializing) {
          if (Ne.initializing = !0, !Ne.initialized) try {
            await this.fetchTokens(), Ne.initialized = !0
          } catch {
            Ne.initialized = !1, Rt.showError("Failed to initialize swap"), Ae.goBack()
          }
          Ne.initializing = !1
        }
      },
      async fetchTokens() {
        const {
          networkAddress: t
        } = this.getParams();
        await this.getTokenList(), await this.getNetworkTokenPrice(), await this.getMyTokensWithBalance();
        const e = Ne.tokens?.find(r => r.address === t);
        e && (Ne.networkTokenSymbol = e.symbol, this.setSourceToken(e), this.setSourceTokenAmount("1"))
      },
      async getTokenList() {
        const t = await Qw.getTokenList();
        Ne.tokens = t, Ne.popularTokens = t.sort((e, r) => e.symbol < r.symbol ? -1 : e.symbol > r.symbol ? 1 : 0), Ne.suggestedTokens = t.filter(e => !!Qr.SWAP_SUGGESTED_TOKENS.includes(e.symbol), {})
      },
      async getAddressPrice(t) {
        const e = Ne.tokensPriceMap[t];
        if (e) return e;
        const n = (await An.fetchTokenPrice({
            projectId: Ue.state.projectId,
            addresses: [t]
          })).fungibles || [],
          s = [...Ne.tokens || [], ...Ne.myTokensWithBalance || []]?.find(c => c.address === t)?.symbol,
          o = n.find(c => c.symbol.toLowerCase() === s?.toLowerCase())?.price || 0,
          a = parseFloat(o.toString());
        return Ne.tokensPriceMap[t] = a, a
      },
      async getNetworkTokenPrice() {
        const {
          networkAddress: t
        } = this.getParams(), r = (await An.fetchTokenPrice({
          projectId: Ue.state.projectId,
          addresses: [t]
        }).catch(() => (Rt.showError("Failed to fetch network token price"), {
          fungibles: []
        }))).fungibles?.[0], n = r?.price.toString() || "0";
        Ne.tokensPriceMap[t] = parseFloat(n), Ne.networkTokenSymbol = r?.symbol || "", Ne.networkPrice = n
      },
      async getMyTokensWithBalance(t) {
        const e = await Qw.getMyTokensWithBalance(t);
        e && (await this.getInitialGasPrice(), this.setBalances(e))
      },
      setBalances(t) {
        const {
          networkAddress: e
        } = this.getParams(), r = fe.state.activeCaipNetwork;
        if (!r) return;
        const n = t.find(i => i.address === e);
        t.forEach(i => {
          Ne.tokensPriceMap[i.address] = i.price || 0
        }), Ne.myTokensWithBalance = t.filter(i => i.address.startsWith(r.caipNetworkId)), Ne.networkBalanceInUSD = n ? Or.multiply(n.quantity.numeric, n.price).toString() : "0"
      },
      async getInitialGasPrice() {
        const t = await Qw.fetchGasPrice();
        if (!t) return {
          gasPrice: null,
          gasPriceInUSD: null
        };
        switch (fe.state?.activeCaipNetwork?.chainNamespace) {
          case "solana":
            return Ne.gasFee = t.standard, Ne.gasPriceInUSD = Or.multiply(t.standard, Ne.networkPrice).dividedBy(1e9).toNumber(), {
              gasPrice: BigInt(Ne.gasFee),
              gasPriceInUSD: Number(Ne.gasPriceInUSD)
            };
          case "eip155":
          default:
            const e = t.standard,
              r = BigInt(e),
              n = BigInt(jM),
              i = Pu.getGasPriceInUSD(Ne.networkPrice, n, r);
            return Ne.gasFee = e, Ne.gasPriceInUSD = i, {
              gasPrice: r,
              gasPriceInUSD: i
            }
        }
      },
      async swapTokens() {
        const t = ke.state.address,
          e = Ne.sourceToken,
          r = Ne.toToken,
          n = Or.bigNumber(Ne.sourceTokenAmount).isGreaterThan(0);
        if (!r || !e || Ne.loadingPrices || !n) return;
        Ne.loadingQuote = !0;
        const i = Or.bigNumber(Ne.sourceTokenAmount).multipliedBy(10 ** e.decimals).integerValue(),
          s = await An.fetchSwapQuote({
            userAddress: t,
            projectId: Ue.state.projectId,
            from: e.address,
            to: r.address,
            gasPrice: Ne.gasFee,
            amount: i.toString()
          });
        Ne.loadingQuote = !1;
        const o = s?.quotes?.[0]?.toAmount;
        if (!o) return;
        const a = Or.bigNumber(o).dividedBy(10 ** r.decimals).toString();
        this.setToTokenAmount(a), this.hasInsufficientToken(Ne.sourceTokenAmount, e.address) ? Ne.inputError = "Insufficient balance" : (Ne.inputError = void 0, this.setTransactionDetails())
      },
      async getTransaction() {
        const {
          fromCaipAddress: t,
          availableToSwap: e
        } = this.getParams(), r = Ne.sourceToken, n = Ne.toToken;
        if (!(!t || !e || !r || !n || Ne.loadingQuote)) try {
          Ne.loadingBuildTransaction = !0;
          const i = await Qw.fetchSwapAllowance({
            userAddress: t,
            tokenAddress: r.address,
            sourceTokenAmount: Ne.sourceTokenAmount,
            sourceTokenDecimals: r.decimals
          });
          let s;
          return i ? s = await this.createSwapTransaction() : s = await this.createAllowanceTransaction(), Ne.loadingBuildTransaction = !1, Ne.fetchError = !1, s
        } catch {
          Ae.goBack(), Rt.showError("Failed to check allowance"), Ne.loadingBuildTransaction = !1, Ne.approvalTransaction = void 0, Ne.swapTransaction = void 0, Ne.fetchError = !0;
          return
        }
      },
      async createAllowanceTransaction() {
        const {
          fromCaipAddress: t,
          fromAddress: e,
          sourceTokenAddress: r,
          toTokenAddress: n
        } = this.getParams();
        if (!(!t || !n)) {
          if (!r) throw new Error("createAllowanceTransaction - No source token address found.");
          try {
            const i = await An.generateApproveCalldata({
                projectId: Ue.state.projectId,
                from: r,
                to: n,
                userAddress: t
              }),
              s = await Kt.estimateGas({
                address: e,
                to: je.getPlainAddress(i.tx.to),
                data: i.tx.data
              }),
              o = {
                data: i.tx.data,
                to: je.getPlainAddress(i.tx.from),
                gas: s,
                gasPrice: BigInt(i.tx.eip155.gasPrice),
                value: BigInt(i.tx.value),
                toAmount: Ne.toTokenAmount
              };
            return Ne.swapTransaction = void 0, Ne.approvalTransaction = o, o
          } catch {
            Ae.goBack(), Rt.showError("Failed to create approval transaction"), Ne.approvalTransaction = void 0, Ne.swapTransaction = void 0, Ne.fetchError = !0;
            return
          }
        }
      },
      async createSwapTransaction() {
        const {
          networkAddress: t,
          fromCaipAddress: e,
          sourceTokenAmount: r
        } = this.getParams(), n = Ne.sourceToken, i = Ne.toToken;
        if (!e || !r || !n || !i) return;
        const s = Kt.parseUnits(r, n.decimals).toString();
        try {
          const o = await An.generateSwapCalldata({
              projectId: Ue.state.projectId,
              userAddress: e,
              from: n.address,
              to: i.address,
              amount: s
            }),
            a = n.address === t,
            c = BigInt(o.tx.eip155.gas),
            l = BigInt(o.tx.eip155.gasPrice),
            h = {
              data: o.tx.data,
              to: je.getPlainAddress(o.tx.to),
              gas: c,
              gasPrice: l,
              value: BigInt(a ? s : "0"),
              toAmount: Ne.toTokenAmount
            };
          return Ne.gasPriceInUSD = Pu.getGasPriceInUSD(Ne.networkPrice, c, l), Ne.approvalTransaction = void 0, Ne.swapTransaction = h, h
        } catch {
          Ae.goBack(), Rt.showError("Failed to create transaction"), Ne.approvalTransaction = void 0, Ne.swapTransaction = void 0, Ne.fetchError = !0;
          return
        }
      },
      async sendTransactionForApproval(t) {
        const {
          fromAddress: e,
          isAuthConnector: r
        } = this.getParams();
        Ne.loadingApprovalTransaction = !0;
        const n = "Approve limit increase in your wallet";
        r ? Ae.pushTransactionStack({
          view: null,
          goBack: !0,
          onSuccess() {
            Rt.showLoading(n)
          }
        }) : Rt.showLoading(n);
        try {
          await Kt.sendTransaction({
            address: e,
            to: t.to,
            data: t.data,
            value: BigInt(t.value),
            gasPrice: BigInt(t.gasPrice)
          }), await this.swapTokens(), await this.getTransaction(), Ne.approvalTransaction = void 0, Ne.loadingApprovalTransaction = !1
        } catch (i) {
          const s = i;
          Ne.transactionError = s?.shortMessage, Ne.loadingApprovalTransaction = !1, Rt.showError(s?.shortMessage || "Transaction error")
        }
      },
      async sendTransactionForSwap(t) {
        if (!t) return;
        const {
          fromAddress: e,
          toTokenAmount: r,
          isAuthConnector: n
        } = this.getParams();
        Ne.loadingTransaction = !0;
        const i = `Swapping ${Ne.sourceToken?.symbol} to ${Or.formatNumberToLocalString(r,3)} ${Ne.toToken?.symbol}`,
          s = `Swapped ${Ne.sourceToken?.symbol} to ${Or.formatNumberToLocalString(r,3)} ${Ne.toToken?.symbol}`;
        n ? Ae.pushTransactionStack({
          view: "Account",
          goBack: !1,
          onSuccess() {
            Rt.showLoading(i), ut.resetState()
          }
        }) : Rt.showLoading("Confirm transaction in your wallet");
        try {
          const o = [Ne.sourceToken?.address, Ne.toToken?.address].join(","),
            a = await Kt.sendTransaction({
              address: e,
              to: t.to,
              data: t.data,
              gas: t.gas,
              gasPrice: BigInt(t.gasPrice),
              value: t.value
            });
          return Ne.loadingTransaction = !1, Rt.showSuccess(s), nt.sendEvent({
            type: "track",
            event: "SWAP_SUCCESS",
            properties: {
              network: fe.state.activeCaipNetwork?.caipNetworkId || "",
              swapFromToken: this.state.sourceToken?.symbol || "",
              swapToToken: this.state.toToken?.symbol || "",
              swapFromAmount: this.state.sourceTokenAmount || "",
              swapToAmount: this.state.toTokenAmount || "",
              isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT
            }
          }), ut.resetState(), n || Ae.replace("Account"), ut.getMyTokensWithBalance(o), a
        } catch (o) {
          const a = o;
          Ne.transactionError = a?.shortMessage, Ne.loadingTransaction = !1, Rt.showError(a?.shortMessage || "Transaction error"), nt.sendEvent({
            type: "track",
            event: "SWAP_ERROR",
            properties: {
              message: a?.shortMessage || a?.message || "Unknown",
              network: fe.state.activeCaipNetwork?.caipNetworkId || "",
              swapFromToken: this.state.sourceToken?.symbol || "",
              swapToToken: this.state.toToken?.symbol || "",
              swapFromAmount: this.state.sourceTokenAmount || "",
              swapToAmount: this.state.toTokenAmount || "",
              isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT
            }
          });
          return
        }
      },
      hasInsufficientToken(t, e) {
        const r = Pu.isInsufficientSourceTokenForSwap(t, e, Ne.myTokensWithBalance);
        let n = !0;
        return ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT ? n = !1 : n = Pu.isInsufficientNetworkTokenForGas(Ne.networkBalanceInUSD, Ne.gasPriceInUSD), n || r
      },
      setTransactionDetails() {
        const {
          toTokenAddress: t,
          toTokenDecimals: e
        } = this.getParams();
        !t || !e || (Ne.gasPriceInUSD = Pu.getGasPriceInUSD(Ne.networkPrice, BigInt(Ne.gasFee), BigInt(jM)), Ne.priceImpact = Pu.getPriceImpact({
          sourceTokenAmount: Ne.sourceTokenAmount,
          sourceTokenPriceInUSD: Ne.sourceTokenPriceInUSD,
          toTokenPriceInUSD: Ne.toTokenPriceInUSD,
          toTokenAmount: Ne.toTokenAmount
        }), Ne.maxSlippage = Pu.getMaxSlippage(Ne.slippage, Ne.toTokenAmount), Ne.providerFee = Pu.getProviderFee(Ne.sourceTokenAmount))
      }
    },
    x1 = jr({
      currentTab: 0,
      tokenBalance: [],
      smartAccountDeployed: !1,
      addressLabels: new Map,
      allAccounts: []
    }),
    ke = {
      state: x1,
      replaceState(t) {
        t && Object.assign(x1, rc(t))
      },
      subscribe(t) {
        return fe.subscribeChainProp("accountState", e => {
          if (e) return t(e)
        })
      },
      subscribeKey(t, e, r) {
        let n;
        return fe.subscribeChainProp("accountState", i => {
          if (i) {
            const s = i[t];
            n !== s && (n = s, e(s))
          }
        }, r)
      },
      setStatus(t, e) {
        fe.setAccountProp("status", t, e)
      },
      getCaipAddress(t) {
        return fe.getAccountProp("caipAddress", t)
      },
      setProvider(t, e) {
        t && fe.setAccountProp("provider", t, e)
      },
      setCaipAddress(t, e) {
        const r = t ? je.getPlainAddress(t) : void 0;
        fe.state.activeCaipAddress = t, fe.setAccountProp("caipAddress", t, e), fe.setAccountProp("address", r, e)
      },
      setBalance(t, e, r) {
        fe.setAccountProp("balance", t, r), fe.setAccountProp("balanceSymbol", e, r)
      },
      setProfileName(t, e) {
        fe.setAccountProp("profileName", t, e)
      },
      setProfileImage(t, e) {
        fe.setAccountProp("profileImage", t, e)
      },
      setAddressExplorerUrl(t, e) {
        fe.setAccountProp("addressExplorerUrl", t, e)
      },
      setSmartAccountDeployed(t, e) {
        fe.setAccountProp("smartAccountDeployed", t, e)
      },
      setCurrentTab(t) {
        fe.setAccountProp("currentTab", t, fe.state.activeChain)
      },
      setTokenBalance(t, e) {
        t && fe.setAccountProp("tokenBalance", t, e)
      },
      setShouldUpdateToAddress(t, e) {
        fe.setAccountProp("shouldUpdateToAddress", t, e)
      },
      setAllAccounts(t, e) {
        fe.setAccountProp("allAccounts", t, e)
      },
      addAddressLabel(t, e, r) {
        const n = fe.getAccountProp("addressLabels", r) || new Map;
        n.set(t, e), fe.setAccountProp("addressLabels", n, r)
      },
      removeAddressLabel(t, e) {
        const r = fe.getAccountProp("addressLabels", e) || new Map;
        r.delete(t), fe.setAccountProp("addressLabels", r, e)
      },
      setConnectedWalletInfo(t, e) {
        fe.setAccountProp("connectedWalletInfo", t, e, !1)
      },
      setPreferredAccountType(t, e) {
        fe.setAccountProp("preferredAccountType", t, e)
      },
      setSocialProvider(t, e) {
        t && fe.setAccountProp("socialProvider", t, e)
      },
      setSocialWindow(t, e) {
        t && fe.setAccountProp("socialWindow", rc(t), e)
      },
      setFarcasterUrl(t, e) {
        t && fe.setAccountProp("farcasterUrl", t, e)
      },
      async fetchTokenBalance() {
        const t = fe.state.activeCaipNetwork?.caipNetworkId,
          e = fe.state.activeCaipNetwork?.chainNamespace,
          r = fe.state.activeCaipAddress,
          n = r ? je.getPlainAddress(r) : void 0;
        if (!(x1.lastRetry && !je.isAllowedRetry(x1.lastRetry, 30 * Qr.ONE_SEC_MS))) try {
          if (n && t && e) {
            const i = await An.getBalance(n, t),
              s = i.balances.filter(o => o.quantity.decimals !== "0");
            this.setTokenBalance(s, e), ut.setBalances(Qw.mapBalancesToSwapTokens(i.balances)), x1.lastRetry = void 0
          }
        } catch {
          x1.lastRetry = Date.now(), Rt.showError("Token Balance Unavailable")
        }
      },
      resetAccount(t) {
        fe.resetAccount(t)
      },
      setSiweStatus(t) {
        fe.setAccountProp("siweStatus", t, fe.state.activeChain)
      }
    },
    Jw = jr({
      loading: !1,
      open: !1,
      selectedNetworkId: void 0,
      activeChain: void 0
    }),
    Kd = {
      state: Jw,
      subscribe(t) {
        return Rn(Jw, () => t(Jw))
      },
      set(t) {
        Object.assign(Jw, {
          ...Jw,
          ...t
        })
      }
    },
    FM = {
      currentTab: 0,
      tokenBalance: [],
      smartAccountDeployed: !1,
      addressLabels: new Map,
      allAccounts: []
    },
    WM = {
      supportsAllNetworks: !0,
      smartAccountEnabledNetworks: []
    },
    Qt = jr({
      chains: fre(),
      activeCaipAddress: void 0,
      activeChain: void 0,
      activeCaipNetwork: void 0,
      noAdapters: !1,
      universalAdapter: {
        networkControllerClient: void 0,
        connectionControllerClient: void 0
      }
    }),
    fe = {
      state: Qt,
      subscribe(t) {
        return Rn(Qt, () => {
          t(Qt)
        })
      },
      subscribeKey(t, e) {
        return ts(Qt, t, e)
      },
      subscribeChainProp(t, e, r) {
        let n;
        return Rn(Qt.chains, () => {
          const i = r || Qt.activeChain;
          if (i) {
            const s = Qt.chains.get(i)?.[t];
            n !== s && (n = s, e(s))
          }
        })
      },
      initialize(t) {
        const e = t?.[0];
        t?.length === 0 && (Qt.noAdapters = !0), Qt.noAdapters || (Qt.activeChain = e?.chainNamespace, Kd.set({
          activeChain: e?.chainNamespace
        }), t.forEach(r => {
          Qt.chains.set(r.chainNamespace, {
            chainNamespace: r.chainNamespace,
            connectionControllerClient: r.connectionControllerClient,
            networkControllerClient: r.networkControllerClient,
            adapterType: r.adapterType,
            accountState: FM,
            networkState: WM,
            caipNetworks: r.caipNetworks
          })
        }))
      },
      initializeUniversalAdapter(t, e) {
        if (Qt.universalAdapter = t, e.length === 0) {
          const n = Ar.getStoredActiveCaipNetwork();
          try {
            n ? Qt.activeChain = n.chainNamespace : Qt.activeChain = t?.defaultNetwork?.chainNamespace ?? t.caipNetworks[0]?.chainNamespace
          } catch (i) {
            console.warn(">>> Error setting active caip network", i)
          }
        } [...new Set(t.caipNetworks.map(n => n.chainNamespace))].forEach(n => {
          Qt.chains.set(n, {
            chainNamespace: n,
            connectionControllerClient: void 0,
            networkControllerClient: void 0,
            adapterType: t.adapterType,
            accountState: FM,
            networkState: WM,
            caipNetworks: t.caipNetworks
          })
        })
      },
      setAdapterNetworkState(t, e) {
        const r = Qt.chains.get(t);
        r && (r.networkState = rc({
          ...r.networkState,
          ...e
        }), Qt.chains.set(t, rc(r)))
      },
      setChainAccountData(t, e, r = !0) {
        if (!t) throw new Error("Chain is required to update chain account data");
        const n = Qt.chains.get(t);
        n && (n.accountState = rc({
          ...n.accountState,
          ...e
        }), Qt.chains.set(t, n), (r || Qt.chains.size === 1 || Qt.activeChain === t) && (e.caipAddress && (Qt.activeCaipAddress = e.caipAddress), ke.replaceState(n.accountState)))
      },
      setAccountProp(t, e, r, n = !0) {
        this.setChainAccountData(r, {
          [t]: e
        }, n)
      },
      setActiveNamespace(t) {
        Qt.activeChain = t;
        const e = t ? Qt.chains.get(t) : void 0,
          r = e?.networkState?.caipNetwork;
        r?.id && (Qt.activeCaipAddress = e?.accountState?.caipAddress, Qt.activeCaipNetwork = r, bn.setItem(vn.ACTIVE_CAIP_NETWORK_ID, r?.caipNetworkId), Kd.set({
          activeChain: t,
          selectedNetworkId: r?.caipNetworkId
        }))
      },
      setActiveCaipNetwork(t) {
        if (!t) return;
        const e = Qt.chains.get(t.chainNamespace);
        Qt.activeChain = t.chainNamespace, Qt.activeCaipNetwork = t, Qt.activeCaipAddress = e?.accountState?.caipAddress, e && ke.replaceState(e.accountState), Kd.set({
          activeChain: Qt.activeChain,
          selectedNetworkId: Qt.activeCaipNetwork?.caipNetworkId
        }), bn.setItem(vn.ACTIVE_CAIP_NETWORK_ID, t.caipNetworkId), this.checkIfSupportedNetwork(t.chainNamespace) || this.showUnsupportedChainUI()
      },
      addCaipNetwork(t) {
        t && Qt.chains.get(t.chainNamespace)?.caipNetworks.push(t)
      },
      async switchActiveNetwork(t) {
        const e = this.getNetworkControllerClient(t.chainNamespace);
        e && await e.switchCaipNetwork(t), this.setActiveCaipNetwork(t), t && nt.sendEvent({
          type: "track",
          event: "SWITCH_NETWORK",
          properties: {
            network: t.caipNetworkId
          }
        })
      },
      setActiveConnector(t) {
        t && (Qt.activeConnector = rc(t))
      },
      getNetworkControllerClient(t) {
        const e = bn.getItem(vn.WALLET_ID),
          r = t || Qt.activeChain,
          n = e === "walletConnect",
          i = Qt.universalAdapter.networkControllerClient;
        if (n || Qt.noAdapters) {
          if (!i) throw new Error("Universal Adapter's networkControllerClient is not set");
          return i
        }
        if (!r) throw new Error("Chain is required to get network controller client");
        const o = Qt.chains.get(r);
        if (!o) throw new Error("Chain adapter not found");
        if (!o.networkControllerClient) throw new Error("NetworkController client not set");
        return o.networkControllerClient
      },
      getConnectionControllerClient(t) {
        const e = t || Qt.activeChain,
          r = bn.getItem(vn.CONNECTED_CONNECTOR) === "WALLET_CONNECT",
          n = Qt.universalAdapter.connectionControllerClient,
          i = Qt.chains.get("eip155")?.adapterType === "wagmi";
        if (r && !i || Qt.noAdapters) {
          if (!n) throw new Error("Universal Adapter's ConnectionControllerClient is not set");
          return n
        }
        if (!e) throw new Error("Chain is required to get connection controller client");
        const o = Qt.chains.get(e);
        if (!o) throw new Error("Chain adapter not found");
        if (!o.connectionControllerClient) throw new Error("ConnectionController client not set");
        return o.connectionControllerClient
      },
      getAccountProp(t, e) {
        let r = Qt.activeChain;
        if (e && (r = e), !r) return;
        const n = Qt.chains.get(r)?.accountState;
        if (n) return n[t]
      },
      getNetworkProp(t, e) {
        const r = Qt.chains.get(e)?.networkState;
        if (r) return r[t]
      },
      getRequestedCaipNetworks(t) {
        const e = Qt.chains.get(t),
          {
            approvedCaipNetworkIds: r = [],
            requestedCaipNetworks: n = []
          } = e?.networkState || {};
        return je.sortRequestedNetworks(r, n)
      },
      getAllRequestedCaipNetworks() {
        const t = [];
        return Qt.chains.forEach(e => {
          const r = this.getRequestedCaipNetworks(e.chainNamespace);
          t.push(...r)
        }), t
      },
      setRequestedCaipNetworks(t, e) {
        this.setAdapterNetworkState(e, {
          requestedCaipNetworks: t
        })
      },
      getAllApprovedCaipNetworkIds() {
        const t = [];
        return Qt.chains.forEach(e => {
          const r = this.getApprovedCaipNetworkIds(e.chainNamespace);
          t.push(...r)
        }), t
      },
      getActiveCaipNetwork() {
        return Qt.activeCaipNetwork
      },
      getActiveCaipAddress() {
        return Qt.activeCaipAddress
      },
      getApprovedCaipNetworkIds(t) {
        return Qt.chains.get(t)?.networkState?.approvedCaipNetworkIds || []
      },
      async setApprovedCaipNetworksData(t) {
        const r = await this.getNetworkControllerClient()?.getApprovedCaipNetworksData();
        this.setAdapterNetworkState(t, {
          approvedCaipNetworkIds: r?.approvedCaipNetworkIds,
          supportsAllNetworks: r?.supportsAllNetworks
        })
      },
      checkIfSupportedNetwork(t) {
        const e = this.state.activeCaipNetwork,
          r = this.getRequestedCaipNetworks(t);
        return r.length ? r?.some(n => n.id === e?.id) : !0
      },
      setSmartAccountEnabledNetworks(t, e) {
        this.setAdapterNetworkState(e, {
          smartAccountEnabledNetworks: t
        })
      },
      checkIfSmartAccountEnabled() {
        const t = $9.caipNetworkIdToNumber(Qt.activeCaipNetwork?.caipNetworkId),
          e = this.state.activeChain;
        return !e || !t ? !1 : !!this.getNetworkProp("smartAccountEnabledNetworks", e)?.includes(Number(t))
      },
      getActiveNetworkTokenAddress() {
        const t = this.state.activeCaipNetwork?.chainNamespace || "eip155",
          e = this.state.activeCaipNetwork?.id || 1,
          r = Qr.NATIVE_TOKEN_ADDRESS[t];
        return `${t}:${e}:${r}`
      },
      showUnsupportedChainUI() {
        setTimeout(() => {
          Ot.open({
            view: "UnsupportedChain"
          })
        }, 300)
      },
      checkIfNamesSupported() {
        const t = Qt.activeCaipNetwork;
        return !!(t?.chainNamespace && Qr.NAMES_SUPPORTED_CHAIN_NAMESPACES.includes(t.chainNamespace))
      },
      resetNetwork(t) {
        this.setAdapterNetworkState(t, {
          approvedCaipNetworkIds: void 0,
          supportsAllNetworks: !0,
          smartAccountEnabledNetworks: []
        })
      },
      resetAccount(t) {
        const e = t;
        if (!e) throw new Error("Chain is required to set account prop");
        this.state.activeCaipAddress = void 0, this.setChainAccountData(e, rc({
          smartAccountDeployed: !1,
          currentTab: 0,
          caipAddress: void 0,
          address: void 0,
          balance: void 0,
          balanceSymbol: void 0,
          profileName: void 0,
          profileImage: void 0,
          addressExplorerUrl: void 0,
          tokenBalance: [],
          connectedWalletInfo: void 0,
          preferredAccountType: void 0,
          socialProvider: void 0,
          socialWindow: void 0,
          farcasterUrl: void 0,
          provider: void 0
        }))
      }
    },
    Ar = {
      setWalletConnectDeepLink({
        name: t,
        href: e
      }) {
        try {
          bn.setItem(vn.DEEPLINK_CHOICE, JSON.stringify({
            href: e,
            name: t
          }))
        } catch {
          console.info("Unable to set WalletConnect deep link")
        }
      },
      getWalletConnectDeepLink() {
        try {
          const t = bn.getItem(vn.DEEPLINK_CHOICE);
          if (t) return JSON.parse(t)
        } catch {
          console.info("Unable to get WalletConnect deep link")
        }
      },
      deleteWalletConnectDeepLink() {
        try {
          bn.removeItem(vn.DEEPLINK_CHOICE)
        } catch {
          console.info("Unable to delete WalletConnect deep link")
        }
      },
      setAppKitRecent(t) {
        try {
          const e = Ar.getRecentWallets();
          e.find(n => n.id === t.id) || (e.unshift(t), e.length > 2 && e.pop(), bn.setItem(vn.RECENT_WALLETS, JSON.stringify(e)))
        } catch {
          console.info("Unable to set AppKit recent")
        }
      },
      getRecentWallets() {
        try {
          const t = bn.getItem(vn.RECENT_WALLETS);
          return t ? JSON.parse(t) : []
        } catch {
          console.info("Unable to get AppKit recent")
        }
        return []
      },
      setConnectedConnector(t) {
        try {
          bn.setItem(vn.CONNECTED_CONNECTOR, t)
        } catch {
          console.info("Unable to set Connected Connector")
        }
      },
      getConnectedConnector() {
        try {
          return bn.getItem(vn.CONNECTED_CONNECTOR)
        } catch {
          console.info("Unable to get Connected Connector")
        }
      },
      setConnectedSocialProvider(t) {
        try {
          bn.setItem(vn.CONNECTED_SOCIAL, t)
        } catch {
          console.info("Unable to set Connected Social Provider")
        }
      },
      getConnectedSocialProvider() {
        try {
          return bn.getItem(vn.CONNECTED_SOCIAL)
        } catch {
          console.info("Unable to get Connected Social Provider")
        }
      },
      getConnectedSocialUsername() {
        try {
          return bn.getItem(vn.CONNECTED_SOCIAL_USERNAME)
        } catch {
          console.info("Unable to get Connected Social Username")
        }
      },
      getStoredActiveCaipNetwork() {
        const t = bn.getItem(vn.ACTIVE_CAIP_NETWORK_ID);
        return fe.getAllRequestedCaipNetworks()?.find(n => n.caipNetworkId === t)
      }
    },
    ua = jr({
      walletImages: {},
      networkImages: {},
      chainImages: {},
      connectorImages: {},
      tokenImages: {},
      currencyImages: {}
    }),
    Bn = {
      state: ua,
      subscribeNetworkImages(t) {
        return Rn(ua.networkImages, () => t(ua.networkImages))
      },
      subscribeKey(t, e) {
        return ts(ua, t, e)
      },
      subscribe(t) {
        return Rn(ua, () => t(ua))
      },
      setWalletImage(t, e) {
        ua.walletImages[t] = e
      },
      setNetworkImage(t, e) {
        ua.networkImages[t] = e
      },
      setChainImage(t, e) {
        ua.chainImages[t] = e
      },
      setConnectorImage(t, e) {
        ua.connectorImages[t] = e
      },
      setTokenImage(t, e) {
        ua.tokenImages[t] = e
      },
      setCurrencyImage(t, e) {
        ua.currencyImages[t] = e
      }
    },
    Mse = je.getApiUrl(),
    ys = new vy({
      baseUrl: Mse,
      clientId: null
    }),
    Pse = "40",
    zM = "4",
    $se = 20,
    Bi = jr({
      page: 1,
      count: 0,
      featured: [],
      recommended: [],
      wallets: [],
      search: [],
      isAnalyticsEnabled: !1,
      excludedRDNS: []
    }),
    qt = {
      state: Bi,
      subscribeKey(t, e) {
        return ts(Bi, t, e)
      },
      _getSdkProperties() {
        const {
          projectId: t,
          sdkType: e,
          sdkVersion: r
        } = Ue.state;
        return {
          projectId: t,
          st: e || "appkit",
          sv: r || "html-wagmi-4.2.2"
        }
      },
      _filterOutExtensions(t) {
        return Ue.state.isUniversalProvider ? t.filter(e => !!(e.mobile_link || e.desktop_link || e.webapp_link)) : t
      },
      async _fetchWalletImage(t) {
        const e = `${ys.baseUrl}/getWalletImage/${t}`,
          r = await ys.getBlob({
            path: e,
            params: qt._getSdkProperties()
          });
        Bn.setWalletImage(t, URL.createObjectURL(r))
      },
      async _fetchNetworkImage(t) {
        const e = `${ys.baseUrl}/public/getAssetImage/${t}`,
          r = await ys.getBlob({
            path: e,
            params: qt._getSdkProperties()
          });
        Bn.setNetworkImage(t, URL.createObjectURL(r))
      },
      async _fetchConnectorImage(t) {
        const e = `${ys.baseUrl}/public/getAssetImage/${t}`,
          r = await ys.getBlob({
            path: e,
            params: qt._getSdkProperties()
          });
        Bn.setConnectorImage(t, URL.createObjectURL(r))
      },
      async _fetchCurrencyImage(t) {
        const e = `${ys.baseUrl}/public/getCurrencyImage/${t}`,
          r = await ys.getBlob({
            path: e,
            params: qt._getSdkProperties()
          });
        Bn.setCurrencyImage(t, URL.createObjectURL(r))
      },
      async _fetchTokenImage(t) {
        const e = `${ys.baseUrl}/public/getTokenImage/${t}`,
          r = await ys.getBlob({
            path: e,
            params: qt._getSdkProperties()
          });
        Bn.setTokenImage(t, URL.createObjectURL(r))
      },
      async fetchNetworkImages() {
        const e = fe.getAllRequestedCaipNetworks()?.map(({
          assets: r
        }) => r?.imageId).filter(Boolean);
        e && await Promise.allSettled(e.map(r => qt._fetchNetworkImage(r)))
      },
      async fetchConnectorImages() {
        const {
          connectors: t
        } = Tt.state, e = t.map(({
          imageId: r
        }) => r).filter(Boolean);
        await Promise.allSettled(e.map(r => qt._fetchConnectorImage(r)))
      },
      async fetchCurrencyImages(t = []) {
        await Promise.allSettled(t.map(e => qt._fetchCurrencyImage(e)))
      },
      async fetchTokenImages(t = []) {
        await Promise.allSettled(t.map(e => qt._fetchTokenImage(e)))
      },
      async fetchFeaturedWallets() {
        const {
          featuredWalletIds: t
        } = Ue.state;
        if (t?.length) {
          const {
            data: e
          } = await ys.get({
            path: "/getWallets",
            params: {
              ...qt._getSdkProperties(),
              page: "1",
              entries: t?.length ? String(t.length) : zM,
              include: t?.join(",")
            }
          });
          e.sort((n, i) => t.indexOf(n.id) - t.indexOf(i.id));
          const r = e.map(n => n.image_id).filter(Boolean);
          await Promise.allSettled(r.map(n => qt._fetchWalletImage(n))), Bi.featured = e
        }
      },
      async fetchRecommendedWallets() {
        try {
          const {
            includeWalletIds: t,
            excludeWalletIds: e,
            featuredWalletIds: r
          } = Ue.state, n = [...e ?? [], ...r ?? []].filter(Boolean), {
            data: i,
            count: s
          } = await ys.get({
            path: "/getWallets",
            params: {
              ...qt._getSdkProperties(),
              page: "1",
              chains: fe.state.activeCaipNetwork?.caipNetworkId,
              entries: zM,
              include: t?.join(","),
              exclude: n?.join(",")
            }
          }), o = Ar.getRecentWallets(), a = i.map(l => l.image_id).filter(Boolean), c = o.map(l => l.image_id).filter(Boolean);
          await Promise.allSettled([...a, ...c].map(l => qt._fetchWalletImage(l))), Bi.recommended = i, Bi.count = s ?? 0
        } catch {}
      },
      async fetchWallets({
        page: t
      }) {
        const {
          includeWalletIds: e,
          excludeWalletIds: r,
          featuredWalletIds: n
        } = Ue.state, i = [...Bi.recommended.map(({
          id: c
        }) => c), ...r ?? [], ...n ?? []].filter(Boolean), {
          data: s,
          count: o
        } = await ys.get({
          path: "/getWallets",
          params: {
            ...qt._getSdkProperties(),
            page: String(t),
            entries: Pse,
            chains: fe.state.activeCaipNetwork?.caipNetworkId,
            include: e?.join(","),
            exclude: i.join(",")
          }
        }), a = s.slice(0, $se).map(c => c.image_id).filter(Boolean);
        await Promise.allSettled(a.map(c => qt._fetchWalletImage(c))), Bi.wallets = je.uniqueBy([...Bi.wallets, ...qt._filterOutExtensions(s)], "id"), Bi.count = o > Bi.count ? o : Bi.count, Bi.page = t
      },
      async searchWalletByIds({
        ids: t
      }) {
        const {
          data: e
        } = await ys.get({
          path: "/getWallets",
          params: {
            ...qt._getSdkProperties(),
            page: "1",
            entries: String(t.length),
            chains: fe.state.activeCaipNetwork?.caipNetworkId,
            include: t?.join(",")
          }
        });
        e && e.forEach(r => {
          r?.rdns && Bi.excludedRDNS.push(r.rdns)
        })
      },
      async searchWallet({
        search: t,
        badge: e
      }) {
        const {
          includeWalletIds: r,
          excludeWalletIds: n
        } = Ue.state;
        Bi.search = [];
        const {
          data: i
        } = await ys.get({
          path: "/getWallets",
          params: {
            ...qt._getSdkProperties(),
            page: "1",
            entries: "100",
            search: t?.trim(),
            badge_type: e,
            chains: fe.state.activeCaipNetwork?.caipNetworkId,
            include: r?.join(","),
            exclude: n?.join(",")
          }
        });
        nt.sendEvent({
          type: "track",
          event: "SEARCH_WALLET",
          properties: {
            badge: e ?? "",
            search: t ?? ""
          }
        });
        const s = i.map(o => o.image_id).filter(Boolean);
        await Promise.allSettled([...s.map(o => qt._fetchWalletImage(o)), je.wait(300)]), Bi.search = qt._filterOutExtensions(i)
      },
      async reFetchWallets() {
        Bi.page = 1, Bi.wallets = [], await qt.fetchFeaturedWallets(), await qt.fetchRecommendedWallets()
      },
      prefetch() {
        const t = [qt.fetchFeaturedWallets(), qt.fetchRecommendedWallets(), qt.fetchNetworkImages(), qt.fetchConnectorImages()];
        Ue.state.features?.analytics && t.push(qt.fetchAnalyticsConfig()), Bi.prefetchPromise = Promise.race([Promise.allSettled(t)])
      },
      async fetchAnalyticsConfig() {
        const {
          isAnalyticsEnabled: t
        } = await ys.get({
          path: "/getAnalyticsConfig",
          params: qt._getSdkProperties()
        });
        Ue.setFeatures({
          analytics: t
        })
      }
    },
    tl = jr({
      loading: !1,
      open: !1,
      shake: !1
    }),
    Ot = {
      state: tl,
      subscribe(t) {
        return Rn(tl, () => t(tl))
      },
      subscribeKey(t, e) {
        return ts(tl, t, e)
      },
      async open(t) {
        console.log("0 open", t)
        await qt.state.prefetchPromise;
        const e = fe.state.activeCaipAddress,
          r = fe.state.noAdapters;
        t?.view ? Ae.reset(t.view) : e ? Ae.reset("Account") : r && !je.isMobile() ? Ae.reset("ConnectingWalletConnect") : Ae.reset("Connect"), tl.open = !0, Kd.set({
          open: !0
        }), nt.sendEvent({
          type: "track",
          event: "MODAL_OPEN",
          properties: {
            connected: !!e
          }
        })
      },
      close() {
        const t = !!fe.state.activeCaipAddress;
        tl.open = !1, Kd.set({
          open: !1
        }), nt.sendEvent({
          type: "track",
          event: "MODAL_CLOSE",
          properties: {
            connected: t
          }
        })
      },
      setLoading(t) {
        tl.loading = t, Kd.set({
          loading: t
        })
      },
      shake() {
        tl.shake || (tl.shake = !0, setTimeout(() => {
          tl.shake = !1
        }, 500))
      }
    },
    Xw = {
      id: "2b92315d-eab7-5bef-84fa-089a131333f5",
      name: "USD Coin",
      symbol: "USDC",
      networks: [{
        name: "ethereum-mainnet",
        display_name: "Ethereum",
        chain_id: "1",
        contract_address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
      }, {
        name: "polygon-mainnet",
        display_name: "Polygon",
        chain_id: "137",
        contract_address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174"
      }]
    },
    Q9 = {
      id: "USD",
      payment_method_limits: [{
        id: "card",
        min: "10.00",
        max: "7500.00"
      }, {
        id: "ach_bank_account",
        min: "10.00",
        max: "25000.00"
      }]
    },
    Kr = jr({
      providers: gM,
      selectedProvider: null,
      error: null,
      purchaseCurrency: Xw,
      paymentCurrency: Q9,
      purchaseCurrencies: [Xw],
      paymentCurrencies: [],
      quotesLoading: !1
    }),
    Gr = {
      state: Kr,
      subscribe(t) {
        return Rn(Kr, () => t(Kr))
      },
      subscribeKey(t, e) {
        return ts(Kr, t, e)
      },
      setSelectedProvider(t) {
        if (t && t.name === "meld") {
          const e = Tre,
            r = fe.state.activeChain === pr.CHAIN.SOLANA ? "SOL" : "USDC",
            n = ke.state.address ?? "",
            i = new URL(t.url);
          i.searchParams.append("publicKey", e), i.searchParams.append("destinationCurrencyCode", r), i.searchParams.append("walletAddress", n), t.url = i.toString()
        }
        Kr.selectedProvider = t
      },
      setPurchaseCurrency(t) {
        Kr.purchaseCurrency = t
      },
      setPaymentCurrency(t) {
        Kr.paymentCurrency = t
      },
      setPurchaseAmount(t) {
        this.state.purchaseAmount = t
      },
      setPaymentAmount(t) {
        this.state.paymentAmount = t
      },
      async getAvailableCurrencies() {
        const t = await An.getOnrampOptions();
        Kr.purchaseCurrencies = t.purchaseCurrencies, Kr.paymentCurrencies = t.paymentCurrencies, Kr.paymentCurrency = t.paymentCurrencies[0] || Q9, Kr.purchaseCurrency = t.purchaseCurrencies[0] || Xw, await qt.fetchCurrencyImages(t.paymentCurrencies.map(e => e.id)), await qt.fetchTokenImages(t.purchaseCurrencies.map(e => e.symbol))
      },
      async getQuote() {
        Kr.quotesLoading = !0;
        try {
          const t = await An.getOnrampQuote({
            purchaseCurrency: Kr.purchaseCurrency,
            paymentCurrency: Kr.paymentCurrency,
            amount: Kr.paymentAmount?.toString() || "0",
            network: Kr.purchaseCurrency?.symbol
          });
          return Kr.quotesLoading = !1, Kr.purchaseAmount = Number(t.purchaseAmount.amount), t
        } catch (t) {
          return Kr.error = t.message, Kr.quotesLoading = !1, null
        } finally {
          Kr.quotesLoading = !1
        }
      },
      resetState() {
        Kr.providers = gM, Kr.selectedProvider = null, Kr.error = null, Kr.purchaseCurrency = Xw, Kr.paymentCurrency = Q9, Kr.purchaseCurrencies = [Xw], Kr.paymentCurrencies = [], Kr.paymentAmount = void 0, Kr.purchaseAmount = void 0, Kr.quotesLoading = !1
      }
    },
    Ui = jr({
      loading: !1
    }),
    Vr = {
      state: Ui,
      subscribe(t) {
        return Rn(Ui, () => t(Ui))
      },
      subscribeKey(t, e) {
        return ts(Ui, t, e)
      },
      setToken(t) {
        t && (Ui.token = rc(t))
      },
      setTokenAmount(t) {
        Ui.sendTokenAmount = t
      },
      setReceiverAddress(t) {
        Ui.receiverAddress = t
      },
      setReceiverProfileImageUrl(t) {
        Ui.receiverProfileImageUrl = t
      },
      setReceiverProfileName(t) {
        Ui.receiverProfileName = t
      },
      setGasPrice(t) {
        Ui.gasPrice = t
      },
      setGasPriceInUsd(t) {
        Ui.gasPriceInUSD = t
      },
      setLoading(t) {
        Ui.loading = t
      },
      sendToken() {
        switch (fe.state.activeCaipNetwork?.chainNamespace) {
          case "eip155":
            this.sendEvmToken();
            return;
          case "solana":
            this.sendSolanaToken();
            return;
          default:
            throw new Error("Unsupported chain")
        }
      },
      sendEvmToken() {
        this.state.token?.address && this.state.sendTokenAmount && this.state.receiverAddress ? (nt.sendEvent({
          type: "track",
          event: "SEND_INITIATED",
          properties: {
            isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT,
            token: this.state.token.address,
            amount: this.state.sendTokenAmount,
            network: fe.state.activeCaipNetwork?.caipNetworkId || ""
          }
        }), this.sendERC20Token({
          receiverAddress: this.state.receiverAddress,
          tokenAddress: this.state.token.address,
          sendTokenAmount: this.state.sendTokenAmount,
          decimals: this.state.token.quantity.decimals
        })) : this.state.receiverAddress && this.state.sendTokenAmount && this.state.gasPrice && this.state.token?.quantity.decimals && (nt.sendEvent({
          type: "track",
          event: "SEND_INITIATED",
          properties: {
            isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT,
            token: this.state.token?.symbol,
            amount: this.state.sendTokenAmount,
            network: fe.state.activeCaipNetwork?.caipNetworkId || ""
          }
        }), this.sendNativeToken({
          receiverAddress: this.state.receiverAddress,
          sendTokenAmount: this.state.sendTokenAmount,
          gasPrice: this.state.gasPrice,
          decimals: this.state.token.quantity.decimals
        }))
      },
      async sendNativeToken(t) {
        Ae.pushTransactionStack({
          view: "Account",
          goBack: !1
        });
        const e = t.receiverAddress,
          r = ke.state.address,
          n = Kt.parseUnits(t.sendTokenAmount.toString(), Number(t.decimals)),
          i = "0x";
        try {
          await Kt.sendTransaction({
            to: e,
            address: r,
            data: i,
            value: n,
            gasPrice: t.gasPrice
          }), Rt.showSuccess("Transaction started"), nt.sendEvent({
            type: "track",
            event: "SEND_SUCCESS",
            properties: {
              isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT,
              token: this.state.token?.symbol || "",
              amount: t.sendTokenAmount,
              network: fe.state.activeCaipNetwork?.caipNetworkId || ""
            }
          }), this.resetSend()
        } catch {
          nt.sendEvent({
            type: "track",
            event: "SEND_ERROR",
            properties: {
              isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT,
              token: this.state.token?.symbol || "",
              amount: t.sendTokenAmount,
              network: fe.state.activeCaipNetwork?.caipNetworkId || ""
            }
          }), Rt.showError("Something went wrong")
        }
      },
      async sendERC20Token(t) {
        Ae.pushTransactionStack({
          view: "Account",
          goBack: !1
        });
        const e = Kt.parseUnits(t.sendTokenAmount.toString(), Number(t.decimals));
        try {
          if (ke.state.address && t.sendTokenAmount && t.receiverAddress && t.tokenAddress) {
            const r = je.getPlainAddress(t.tokenAddress);
            await Kt.writeContract({
              fromAddress: ke.state.address,
              tokenAddress: r,
              receiverAddress: t.receiverAddress,
              tokenAmount: e,
              method: "transfer",
              abi: Sre.getERC20Abi(r)
            }), Rt.showSuccess("Transaction started"), this.resetSend()
          }
        } catch {
          Rt.showError("Something went wrong")
        }
      },
      sendSolanaToken() {
        if (!this.state.sendTokenAmount || !this.state.receiverAddress) {
          Rt.showError("Please enter a valid amount and receiver address");
          return
        }
        Ae.pushTransactionStack({
          view: "Account",
          goBack: !1
        }), Kt.sendTransaction({
          chainNamespace: "solana",
          to: this.state.receiverAddress,
          value: this.state.sendTokenAmount
        }).then(() => {
          this.resetSend(), ke.fetchTokenBalance()
        }).catch(t => {
          Rt.showError("Failed to send transaction. Please try again."), console.error("SendController:sendToken - failed to send solana transaction", t)
        })
      },
      resetSend() {
        Ui.token = void 0, Ui.sendTokenAmount = void 0, Ui.receiverAddress = void 0, Ui.receiverProfileImageUrl = void 0, Ui.receiverProfileName = void 0, Ui.loading = !1
      }
    },
    lc = jr({
      message: "",
      open: !1,
      triggerRect: {
        width: 0,
        height: 0,
        top: 0,
        left: 0
      },
      variant: "shade"
    }),
    Mo = {
      state: lc,
      subscribe(t) {
        return Rn(lc, () => t(lc))
      },
      subscribeKey(t, e) {
        return ts(lc, t, e)
      },
      showTooltip({
        message: t,
        triggerRect: e,
        variant: r
      }) {
        lc.open = !0, lc.message = t, lc.triggerRect = e, lc.variant = r
      },
      hide() {
        lc.open = !1, lc.message = "", lc.triggerRect = {
          width: 0,
          height: 0,
          top: 0,
          left: 0
        }
      }
    },
    HM = 2147483648,
    Ose = {
      convertEVMChainIdToCoinType(t) {
        if (t >= HM) throw new Error("Invalid chainId");
        return (HM | t) >>> 0
      }
    },
    da = jr({
      suggestions: [],
      loading: !1
    }),
    rl = {
      state: da,
      subscribe(t) {
        return Rn(da, () => t(da))
      },
      subscribeKey(t, e) {
        return ts(da, t, e)
      },
      async resolveName(t) {
        try {
          return await An.lookupEnsName(t)
        } catch (e) {
          const r = e;
          throw new Error(r?.reasons?.[0]?.description || "Error resolving name")
        }
      },
      async isNameRegistered(t) {
        try {
          return await An.lookupEnsName(t), !0
        } catch {
          return !1
        }
      },
      async getSuggestions(t) {
        try {
          da.loading = !0, da.suggestions = [];
          const e = await An.getEnsNameSuggestions(t);
          return da.suggestions = e.suggestions.map(r => ({
            ...r,
            name: r.name
          })) || [], da.suggestions
        } catch (e) {
          const r = this.parseEnsApiError(e, "Error fetching name suggestions");
          throw new Error(r)
        } finally {
          da.loading = !1
        }
      },
      async getNamesForAddress(t) {
        try {
          return fe.state.activeCaipNetwork ? await An.reverseLookupEnsName({
            address: t
          }) : []
        } catch (e) {
          const r = this.parseEnsApiError(e, "Error fetching names for address");
          throw new Error(r)
        }
      },
      async registerName(t) {
        const e = fe.state.activeCaipNetwork;
        if (!e) throw new Error("Network not found");
        const r = ke.state.address,
          n = Tt.getAuthConnector();
        if (!r || !n) throw new Error("Address or auth connector not found");
        da.loading = !0;
        try {
          const i = JSON.stringify({
            name: t,
            attributes: {},
            timestamp: Math.floor(Date.now() / 1e3)
          });
          Ae.pushTransactionStack({
            view: "RegisterAccountNameSuccess",
            goBack: !1,
            replace: !0,
            onCancel() {
              da.loading = !1
            }
          });
          const s = await Kt.signMessage(i),
            o = e.id;
          if (!o) throw new Error("Network not found");
          const a = Ose.convertEVMChainIdToCoinType(Number(o));
          await An.registerEnsName({
            coinType: a,
            address: r,
            signature: s,
            message: i
          }), ke.setProfileName(t, e.chainNamespace), Ae.replace("RegisterAccountNameSuccess")
        } catch (i) {
          const s = this.parseEnsApiError(i, `Error registering name ${t}`);
          throw Ae.replace("RegisterAccountName"), new Error(s)
        } finally {
          da.loading = !1
        }
      },
      validateName(t) {
        return /^[a-zA-Z0-9-]{4,}$/u.test(t)
      },
      parseEnsApiError(t, e) {
        return t?.reasons?.[0]?.description || e
      }
    },
    Gd = jr({
      message: "",
      variant: "info",
      open: !1
    }),
    Zd = {
      state: Gd,
      subscribeKey(t, e) {
        return ts(Gd, t, e)
      },
      open(t, e) {
        console.log("1 open", t, e)
        const {
          debug: r
        } = Ue.state, {
          shortMessage: n,
          longMessage: i
        } = t;
        r && (Gd.message = n, Gd.variant = e, Gd.open = !0), i && console.error(typeof i == "function" ? i() : i)
      },
      close() {
        Gd.open = !1, Gd.message = "", Gd.variant = "info"
      }
    },
    Dse = {
      eip155: "ba0ba0cd-17c6-4806-ad93-f9d174f17900",
      solana: "a1b58899-f671-4276-6a5e-56ca5bd59700",
      polkadot: ""
    },
    Rr = {
      async fetchWalletImage(t) {
        if (t) return await qt._fetchWalletImage(t), this.getWalletImageById(t)
      },
      getWalletImageById(t) {
        if (t) return Bn.state.walletImages[t]
      },
      getWalletImage(t) {
        if (t?.image_url) return t?.image_url;
        if (t?.image_id) return Bn.state.walletImages[t.image_id]
      },
      getNetworkImage(t) {
        if (t?.assets?.imageUrl) return t?.assets?.imageUrl;
        if (t?.assets?.imageId) return Bn.state.networkImages[t.assets.imageId]
      },
      getNetworkImageById(t) {
        if (t) return Bn.state.networkImages[t]
      },
      getConnectorImage(t) {
        if (t?.imageUrl) return t.imageUrl;
        if (t?.imageId) return Bn.state.connectorImages[t.imageId]
      },
      getChainImage(t) {
        return Bn.state.networkImages[Dse[t]]
      }
    };
  /**
   * @license
   * Copyright 2019 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  const Dy = globalThis,
    J9 = Dy.ShadowRoot && (Dy.ShadyCSS === void 0 || Dy.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
    qM = Symbol(),
    VM = new WeakMap;
  let Lse = class {
    constructor(e, r, n) {
      if (this._$cssResult$ = !0, n !== qM) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
      this.cssText = e, this.t = r
    }
    get styleSheet() {
      let e = this.o;
      const r = this.t;
      if (J9 && e === void 0) {
        const n = r !== void 0 && r.length === 1;
        n && (e = VM.get(r)), e === void 0 && ((this.o = e = new CSSStyleSheet).replaceSync(this.cssText), n && VM.set(r, e))
      }
      return e
    }
    toString() {
      return this.cssText
    }
  };
  const Bse = t => new Lse(typeof t == "string" ? t : t + "", void 0, qM),
    Use = (t, e) => {
      if (J9) t.adoptedStyleSheets = e.map(r => r instanceof CSSStyleSheet ? r : r.styleSheet);
      else
        for (const r of e) {
          const n = document.createElement("style"),
            i = Dy.litNonce;
          i !== void 0 && n.setAttribute("nonce", i), n.textContent = r.cssText, t.appendChild(n)
        }
    },
    KM = J9 ? t => t : t => t instanceof CSSStyleSheet ? (e => {
      let r = "";
      for (const n of e.cssRules) r += n.cssText;
      return Bse(r)
    })(t) : t;
  /**
   * @license
   * Copyright 2017 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  const {
    is: jse,
    defineProperty: Fse,
    getOwnPropertyDescriptor: Wse,
    getOwnPropertyNames: zse,
    getOwnPropertySymbols: Hse,
    getPrototypeOf: qse
  } = Object, Yd = globalThis, GM = Yd.trustedTypes, Vse = GM ? GM.emptyScript : "", Kse = Yd.reactiveElementPolyfillSupport, e2 = (t, e) => t, Ly = {
    toAttribute(t, e) {
      switch (e) {
        case Boolean:
          t = t ? Vse : null;
          break;
        case Object:
        case Array:
          t = t == null ? t : JSON.stringify(t)
      }
      return t
    },
    fromAttribute(t, e) {
      let r = t;
      switch (e) {
        case Boolean:
          r = t !== null;
          break;
        case Number:
          r = t === null ? null : Number(t);
          break;
        case Object:
        case Array:
          try {
            r = JSON.parse(t)
          } catch {
            r = null
          }
      }
      return r
    }
  }, X9 = (t, e) => !jse(t, e), ZM = {
    attribute: !0,
    type: String,
    converter: Ly,
    reflect: !1,
    hasChanged: X9
  };
  Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), Yd.litPropertyMetadata ?? (Yd.litPropertyMetadata = new WeakMap);
  let t2 = class extends HTMLElement {
    static addInitializer(e) {
      this._$Ei(), (this.l ?? (this.l = [])).push(e)
    }
    static get observedAttributes() {
      return this.finalize(), this._$Eh && [...this._$Eh.keys()]
    }
    static createProperty(e, r = ZM) {
      if (r.state && (r.attribute = !1), this._$Ei(), this.elementProperties.set(e, r), !r.noAccessor) {
        const n = Symbol(),
          i = this.getPropertyDescriptor(e, n, r);
        i !== void 0 && Fse(this.prototype, e, i)
      }
    }
    static getPropertyDescriptor(e, r, n) {
      const {
        get: i,
        set: s
      } = Wse(this.prototype, e) ?? {
        get() {
          return this[r]
        },
        set(o) {
          this[r] = o
        }
      };
      return {
        get() {
          return i?.call(this)
        },
        set(o) {
          const a = i?.call(this);
          s.call(this, o), this.requestUpdate(e, a, n)
        },
        configurable: !0,
        enumerable: !0
      }
    }
    static getPropertyOptions(e) {
      return this.elementProperties.get(e) ?? ZM
    }
    static _$Ei() {
      if (this.hasOwnProperty(e2("elementProperties"))) return;
      const e = qse(this);
      e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties)
    }
    static finalize() {
      if (this.hasOwnProperty(e2("finalized"))) return;
      if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(e2("properties"))) {
        const r = this.properties,
          n = [...zse(r), ...Hse(r)];
        for (const i of n) this.createProperty(i, r[i])
      }
      const e = this[Symbol.metadata];
      if (e !== null) {
        const r = litPropertyMetadata.get(e);
        if (r !== void 0)
          for (const [n, i] of r) this.elementProperties.set(n, i)
      }
      this._$Eh = new Map;
      for (const [r, n] of this.elementProperties) {
        const i = this._$Eu(r, n);
        i !== void 0 && this._$Eh.set(i, r)
      }
      this.elementStyles = this.finalizeStyles(this.styles)
    }
    static finalizeStyles(e) {
      const r = [];
      if (Array.isArray(e)) {
        const n = new Set(e.flat(1 / 0).reverse());
        for (const i of n) r.unshift(KM(i))
      } else e !== void 0 && r.push(KM(e));
      return r
    }
    static _$Eu(e, r) {
      const n = r.attribute;
      return n === !1 ? void 0 : typeof n == "string" ? n : typeof e == "string" ? e.toLowerCase() : void 0
    }
    constructor() {
      super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev()
    }
    _$Ev() {
      this._$ES = new Promise(e => this.enableUpdating = e), this._$AL = new Map, this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(e => e(this))
    }
    addController(e) {
      (this._$EO ?? (this._$EO = new Set)).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.()
    }
    removeController(e) {
      this._$EO?.delete(e)
    }
    _$E_() {
      const e = new Map,
        r = this.constructor.elementProperties;
      for (const n of r.keys()) this.hasOwnProperty(n) && (e.set(n, this[n]), delete this[n]);
      e.size > 0 && (this._$Ep = e)
    }
    createRenderRoot() {
      const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
      return Use(e, this.constructor.elementStyles), e
    }
    connectedCallback() {
      this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), this._$EO?.forEach(e => e.hostConnected?.())
    }
    enableUpdating(e) {}
    disconnectedCallback() {
      this._$EO?.forEach(e => e.hostDisconnected?.())
    }
    attributeChangedCallback(e, r, n) {
      this._$AK(e, n)
    }
    _$EC(e, r) {
      const n = this.constructor.elementProperties.get(e),
        i = this.constructor._$Eu(e, n);
      if (i !== void 0 && n.reflect === !0) {
        const s = (n.converter?.toAttribute !== void 0 ? n.converter : Ly).toAttribute(r, n.type);
        this._$Em = e, s == null ? this.removeAttribute(i) : this.setAttribute(i, s), this._$Em = null
      }
    }
    _$AK(e, r) {
      const n = this.constructor,
        i = n._$Eh.get(e);
      if (i !== void 0 && this._$Em !== i) {
        const s = n.getPropertyOptions(i),
          o = typeof s.converter == "function" ? {
            fromAttribute: s.converter
          } : s.converter?.fromAttribute !== void 0 ? s.converter : Ly;
        this._$Em = i, this[i] = o.fromAttribute(r, s.type), this._$Em = null
      }
    }
    requestUpdate(e, r, n) {
      if (e !== void 0) {
        if (n ?? (n = this.constructor.getPropertyOptions(e)), !(n.hasChanged ?? X9)(this[e], r)) return;
        this.P(e, r, n)
      }
      this.isUpdatePending === !1 && (this._$ES = this._$ET())
    }
    P(e, r, n) {
      this._$AL.has(e) || this._$AL.set(e, r), n.reflect === !0 && this._$Em !== e && (this._$Ej ?? (this._$Ej = new Set)).add(e)
    }
    async _$ET() {
      this.isUpdatePending = !0;
      try {
        await this._$ES
      } catch (r) {
        Promise.reject(r)
      }
      const e = this.scheduleUpdate();
      return e != null && await e, !this.isUpdatePending
    }
    scheduleUpdate() {
      return this.performUpdate()
    }
    performUpdate() {
      if (!this.isUpdatePending) return;
      if (!this.hasUpdated) {
        if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
          for (const [i, s] of this._$Ep) this[i] = s;
          this._$Ep = void 0
        }
        const n = this.constructor.elementProperties;
        if (n.size > 0)
          for (const [i, s] of n) s.wrapped !== !0 || this._$AL.has(i) || this[i] === void 0 || this.P(i, this[i], s)
      }
      let e = !1;
      const r = this._$AL;
      try {
        e = this.shouldUpdate(r), e ? (this.willUpdate(r), this._$EO?.forEach(n => n.hostUpdate?.()), this.update(r)) : this._$EU()
      } catch (n) {
        throw e = !1, this._$EU(), n
      }
      e && this._$AE(r)
    }
    willUpdate(e) {}
    _$AE(e) {
      this._$EO?.forEach(r => r.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e)
    }
    _$EU() {
      this._$AL = new Map, this.isUpdatePending = !1
    }
    get updateComplete() {
      return this.getUpdateComplete()
    }
    getUpdateComplete() {
      return this._$ES
    }
    shouldUpdate(e) {
      return !0
    }
    update(e) {
      this._$Ej && (this._$Ej = this._$Ej.forEach(r => this._$EC(r, this[r]))), this._$EU()
    }
    updated(e) {}
    firstUpdated(e) {}
  };
  t2.elementStyles = [], t2.shadowRootOptions = {
    mode: "open"
  }, t2[e2("elementProperties")] = new Map, t2[e2("finalized")] = new Map, Kse?.({
    ReactiveElement: t2
  }), (Yd.reactiveElementVersions ?? (Yd.reactiveElementVersions = [])).push("2.0.4");
  /**
   * @license
   * Copyright 2017 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  const r2 = globalThis,
    By = r2.trustedTypes,
    YM = By ? By.createPolicy("lit-html", {
      createHTML: t => t
    }) : void 0,
    QM = "$lit$",
    Qd = `lit$${Math.random().toFixed(9).slice(2)}$`,
    JM = "?" + Qd,
    Gse = `<${JM}>`,
    $f = document,
    Uy = () => $f.createComment(""),
    n2 = t => t === null || typeof t != "object" && typeof t != "function",
    ex = Array.isArray,
    Zse = t => ex(t) || typeof t?.[Symbol.iterator] == "function",
    tx = `[ 	
  \f\r]`,
    i2 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
    XM = /-->/g,
    eP = />/g,
    Of = RegExp(`>|${tx}(?:([^\\s"'>=/]+)(${tx}*=${tx}*(?:[^ 	
  \f\r"'\`<>=]|("|')|))|$)`, "g"),
    tP = /'/g,
    rP = /"/g,
    nP = /^(?:script|style|textarea|title)$/i,
    C1 = Symbol.for("lit-noChange"),
    ni = Symbol.for("lit-nothing"),
    iP = new WeakMap,
    Df = $f.createTreeWalker($f, 129);

  function sP(t, e) {
    if (!ex(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
    return YM !== void 0 ? YM.createHTML(e) : e
  }
  const Yse = (t, e) => {
    const r = t.length - 1,
      n = [];
    let i, s = e === 2 ? "<svg>" : e === 3 ? "<math>" : "",
      o = i2;
    for (let a = 0; a < r; a++) {
      const c = t[a];
      let l, h, f = -1,
        w = 0;
      for (; w < c.length && (o.lastIndex = w, h = o.exec(c), h !== null);) w = o.lastIndex, o === i2 ? h[1] === "!--" ? o = XM : h[1] !== void 0 ? o = eP : h[2] !== void 0 ? (nP.test(h[2]) && (i = RegExp("</" + h[2], "g")), o = Of) : h[3] !== void 0 && (o = Of) : o === Of ? h[0] === ">" ? (o = i ?? i2, f = -1) : h[1] === void 0 ? f = -2 : (f = o.lastIndex - h[2].length, l = h[1], o = h[3] === void 0 ? Of : h[3] === '"' ? rP : tP) : o === rP || o === tP ? o = Of : o === XM || o === eP ? o = i2 : (o = Of, i = void 0);
      const b = o === Of && t[a + 1].startsWith("/>") ? " " : "";
      s += o === i2 ? c + Gse : f >= 0 ? (n.push(l), c.slice(0, f) + QM + c.slice(f) + Qd + b) : c + Qd + (f === -2 ? a : b)
    }
    return [sP(t, s + (t[r] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), n]
  };
  let rx = class qZ {
    constructor({
      strings: e,
      _$litType$: r
    }, n) {
      let i;
      this.parts = [];
      let s = 0,
        o = 0;
      const a = e.length - 1,
        c = this.parts,
        [l, h] = Yse(e, r);
      if (this.el = qZ.createElement(l, n), Df.currentNode = this.el.content, r === 2 || r === 3) {
        const f = this.el.content.firstChild;
        f.replaceWith(...f.childNodes)
      }
      for (;
        (i = Df.nextNode()) !== null && c.length < a;) {
        if (i.nodeType === 1) {
          if (i.hasAttributes())
            for (const f of i.getAttributeNames())
              if (f.endsWith(QM)) {
                const w = h[o++],
                  b = i.getAttribute(f).split(Qd),
                  C = /([.?@])?(.*)/.exec(w);
                c.push({
                  type: 1,
                  index: s,
                  name: C[2],
                  strings: b,
                  ctor: C[1] === "." ? Jse : C[1] === "?" ? Xse : C[1] === "@" ? eoe : jy
                }), i.removeAttribute(f)
              } else f.startsWith(Qd) && (c.push({
                type: 6,
                index: s
              }), i.removeAttribute(f));
          if (nP.test(i.tagName)) {
            const f = i.textContent.split(Qd),
              w = f.length - 1;
            if (w > 0) {
              i.textContent = By ? By.emptyScript : "";
              for (let b = 0; b < w; b++) i.append(f[b], Uy()), Df.nextNode(), c.push({
                type: 2,
                index: ++s
              });
              i.append(f[w], Uy())
            }
          }
        } else if (i.nodeType === 8)
          if (i.data === JM) c.push({
            type: 2,
            index: s
          });
          else {
            let f = -1;
            for (;
              (f = i.data.indexOf(Qd, f + 1)) !== -1;) c.push({
              type: 7,
              index: s
            }), f += Qd.length - 1
          } s++
      }
    }
    static createElement(e, r) {
      const n = $f.createElement("template");
      return n.innerHTML = e, n
    }
  };

  function E1(t, e, r = t, n) {
    if (e === C1) return e;
    let i = n !== void 0 ? r._$Co?.[n] : r._$Cl;
    const s = n2(e) ? void 0 : e._$litDirective$;
    return i?.constructor !== s && (i?._$AO?.(!1), s === void 0 ? i = void 0 : (i = new s(t), i._$AT(t, r, n)), n !== void 0 ? (r._$Co ?? (r._$Co = []))[n] = i : r._$Cl = i), i !== void 0 && (e = E1(t, i._$AS(t, e.values), i, n)), e
  }
  let Qse = class {
      constructor(e, r) {
        this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = r
      }
      get parentNode() {
        return this._$AM.parentNode
      }
      get _$AU() {
        return this._$AM._$AU
      }
      u(e) {
        const {
          el: {
            content: r
          },
          parts: n
        } = this._$AD, i = (e?.creationScope ?? $f).importNode(r, !0);
        Df.currentNode = i;
        let s = Df.nextNode(),
          o = 0,
          a = 0,
          c = n[0];
        for (; c !== void 0;) {
          if (o === c.index) {
            let l;
            c.type === 2 ? l = new oP(s, s.nextSibling, this, e) : c.type === 1 ? l = new c.ctor(s, c.name, c.strings, this, e) : c.type === 6 && (l = new toe(s, this, e)), this._$AV.push(l), c = n[++a]
          }
          o !== c?.index && (s = Df.nextNode(), o++)
        }
        return Df.currentNode = $f, i
      }
      p(e) {
        let r = 0;
        for (const n of this._$AV) n !== void 0 && (n.strings !== void 0 ? (n._$AI(e, n, r), r += n.strings.length - 2) : n._$AI(e[r])), r++
      }
    },
    oP = class VZ {
      get _$AU() {
        return this._$AM?._$AU ?? this._$Cv
      }
      constructor(e, r, n, i) {
        this.type = 2, this._$AH = ni, this._$AN = void 0, this._$AA = e, this._$AB = r, this._$AM = n, this.options = i, this._$Cv = i?.isConnected ?? !0
      }
      get parentNode() {
        let e = this._$AA.parentNode;
        const r = this._$AM;
        return r !== void 0 && e?.nodeType === 11 && (e = r.parentNode), e
      }
      get startNode() {
        return this._$AA
      }
      get endNode() {
        return this._$AB
      }
      _$AI(e, r = this) {
        e = E1(this, e, r), n2(e) ? e === ni || e == null || e === "" ? (this._$AH !== ni && this._$AR(), this._$AH = ni) : e !== this._$AH && e !== C1 && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : Zse(e) ? this.k(e) : this._(e)
      }
      O(e) {
        return this._$AA.parentNode.insertBefore(e, this._$AB)
      }
      T(e) {
        this._$AH !== e && (this._$AR(), this._$AH = this.O(e))
      }
      _(e) {
        this._$AH !== ni && n2(this._$AH) ? this._$AA.nextSibling.data = e : this.T($f.createTextNode(e)), this._$AH = e
      }
      $(e) {
        const {
          values: r,
          _$litType$: n
        } = e, i = typeof n == "number" ? this._$AC(e) : (n.el === void 0 && (n.el = rx.createElement(sP(n.h, n.h[0]), this.options)), n);
        if (this._$AH?._$AD === i) this._$AH.p(r);
        else {
          const s = new Qse(i, this),
            o = s.u(this.options);
          s.p(r), this.T(o), this._$AH = s
        }
      }
      _$AC(e) {
        let r = iP.get(e.strings);
        return r === void 0 && iP.set(e.strings, r = new rx(e)), r
      }
      k(e) {
        ex(this._$AH) || (this._$AH = [], this._$AR());
        const r = this._$AH;
        let n, i = 0;
        for (const s of e) i === r.length ? r.push(n = new VZ(this.O(Uy()), this.O(Uy()), this, this.options)) : n = r[i], n._$AI(s), i++;
        i < r.length && (this._$AR(n && n._$AB.nextSibling, i), r.length = i)
      }
      _$AR(e = this._$AA.nextSibling, r) {
        for (this._$AP?.(!1, !0, r); e && e !== this._$AB;) {
          const n = e.nextSibling;
          e.remove(), e = n
        }
      }
      setConnected(e) {
        this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e))
      }
    },
    jy = class {
      get tagName() {
        return this.element.tagName
      }
      get _$AU() {
        return this._$AM._$AU
      }
      constructor(e, r, n, i, s) {
        this.type = 1, this._$AH = ni, this._$AN = void 0, this.element = e, this.name = r, this._$AM = i, this.options = s, n.length > 2 || n[0] !== "" || n[1] !== "" ? (this._$AH = Array(n.length - 1).fill(new String), this.strings = n) : this._$AH = ni
      }
      _$AI(e, r = this, n, i) {
        const s = this.strings;
        let o = !1;
        if (s === void 0) e = E1(this, e, r, 0), o = !n2(e) || e !== this._$AH && e !== C1, o && (this._$AH = e);
        else {
          const a = e;
          let c, l;
          for (e = s[0], c = 0; c < s.length - 1; c++) l = E1(this, a[n + c], r, c), l === C1 && (l = this._$AH[c]), o || (o = !n2(l) || l !== this._$AH[c]), l === ni ? e = ni : e !== ni && (e += (l ?? "") + s[c + 1]), this._$AH[c] = l
        }
        o && !i && this.j(e)
      }
      j(e) {
        e === ni ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "")
      }
    },
    Jse = class extends jy {
      constructor() {
        super(...arguments), this.type = 3
      }
      j(e) {
        this.element[this.name] = e === ni ? void 0 : e
      }
    },
    Xse = class extends jy {
      constructor() {
        super(...arguments), this.type = 4
      }
      j(e) {
        this.element.toggleAttribute(this.name, !!e && e !== ni)
      }
    },
    eoe = class extends jy {
      constructor(e, r, n, i, s) {
        super(e, r, n, i, s), this.type = 5
      }
      _$AI(e, r = this) {
        if ((e = E1(this, e, r, 0) ?? ni) === C1) return;
        const n = this._$AH,
          i = e === ni && n !== ni || e.capture !== n.capture || e.once !== n.once || e.passive !== n.passive,
          s = e !== ni && (n === ni || i);
        i && this.element.removeEventListener(this.name, this, n), s && this.element.addEventListener(this.name, this, e), this._$AH = e
      }
      handleEvent(e) {
        typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e)
      }
    },
    toe = class {
      constructor(e, r, n) {
        this.element = e, this.type = 6, this._$AN = void 0, this._$AM = r, this.options = n
      }
      get _$AU() {
        return this._$AM._$AU
      }
      _$AI(e) {
        E1(this, e)
      }
    };
  const roe = r2.litHtmlPolyfillSupport;
  roe?.(rx, oP), (r2.litHtmlVersions ?? (r2.litHtmlVersions = [])).push("3.2.1");
  /**
   * @license
   * Copyright 2019 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  const Fy = globalThis,
    nx = Fy.ShadowRoot && (Fy.ShadyCSS === void 0 || Fy.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
    ix = Symbol(),
    aP = new WeakMap;
  let cP = class {
    constructor(e, r, n) {
      if (this._$cssResult$ = !0, n !== ix) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
      this.cssText = e, this.t = r
    }
    get styleSheet() {
      let e = this.o;
      const r = this.t;
      if (nx && e === void 0) {
        const n = r !== void 0 && r.length === 1;
        n && (e = aP.get(r)), e === void 0 && ((this.o = e = new CSSStyleSheet).replaceSync(this.cssText), n && aP.set(r, e))
      }
      return e
    }
    toString() {
      return this.cssText
    }
  };
  const ha = t => new cP(typeof t == "string" ? t : t + "", void 0, ix),
    Re = (t, ...e) => {
      const r = t.length === 1 ? t[0] : e.reduce((n, i, s) => n + (o => {
        if (o._$cssResult$ === !0) return o.cssText;
        if (typeof o == "number") return o;
        throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")
      })(i) + t[s + 1], t[0]);
      return new cP(r, t, ix)
    },
    noe = (t, e) => {
      if (nx) t.adoptedStyleSheets = e.map(r => r instanceof CSSStyleSheet ? r : r.styleSheet);
      else
        for (const r of e) {
          const n = document.createElement("style"),
            i = Fy.litNonce;
          i !== void 0 && n.setAttribute("nonce", i), n.textContent = r.cssText, t.appendChild(n)
        }
    },
    lP = nx ? t => t : t => t instanceof CSSStyleSheet ? (e => {
      let r = "";
      for (const n of e.cssRules) r += n.cssText;
      return ha(r)
    })(t) : t;
  /**
   * @license
   * Copyright 2017 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  const {
    is: ioe,
    defineProperty: soe,
    getOwnPropertyDescriptor: ooe,
    getOwnPropertyNames: aoe,
    getOwnPropertySymbols: coe,
    getPrototypeOf: loe
  } = Object, Jd = globalThis, uP = Jd.trustedTypes, uoe = uP ? uP.emptyScript : "", doe = Jd.reactiveElementPolyfillSupport, s2 = (t, e) => t, sx = {
    toAttribute(t, e) {
      switch (e) {
        case Boolean:
          t = t ? uoe : null;
          break;
        case Object:
        case Array:
          t = t == null ? t : JSON.stringify(t)
      }
      return t
    },
    fromAttribute(t, e) {
      let r = t;
      switch (e) {
        case Boolean:
          r = t !== null;
          break;
        case Number:
          r = t === null ? null : Number(t);
          break;
        case Object:
        case Array:
          try {
            r = JSON.parse(t)
          } catch {
            r = null
          }
      }
      return r
    }
  }, dP = (t, e) => !ioe(t, e), hP = {
    attribute: !0,
    type: String,
    converter: sx,
    reflect: !1,
    hasChanged: dP
  };
  Symbol.metadata ?? (Symbol.metadata = Symbol("metadata")), Jd.litPropertyMetadata ?? (Jd.litPropertyMetadata = new WeakMap);
  let A1 = class extends HTMLElement {
    static addInitializer(e) {
      this._$Ei(), (this.l ?? (this.l = [])).push(e)
    }
    static get observedAttributes() {
      return this.finalize(), this._$Eh && [...this._$Eh.keys()]
    }
    static createProperty(e, r = hP) {
      if (r.state && (r.attribute = !1), this._$Ei(), this.elementProperties.set(e, r), !r.noAccessor) {
        const n = Symbol(),
          i = this.getPropertyDescriptor(e, n, r);
        i !== void 0 && soe(this.prototype, e, i)
      }
    }
    static getPropertyDescriptor(e, r, n) {
      const {
        get: i,
        set: s
      } = ooe(this.prototype, e) ?? {
        get() {
          return this[r]
        },
        set(o) {
          this[r] = o
        }
      };
      return {
        get() {
          return i?.call(this)
        },
        set(o) {
          const a = i?.call(this);
          s.call(this, o), this.requestUpdate(e, a, n)
        },
        configurable: !0,
        enumerable: !0
      }
    }
    static getPropertyOptions(e) {
      return this.elementProperties.get(e) ?? hP
    }
    static _$Ei() {
      if (this.hasOwnProperty(s2("elementProperties"))) return;
      const e = loe(this);
      e.finalize(), e.l !== void 0 && (this.l = [...e.l]), this.elementProperties = new Map(e.elementProperties)
    }
    static finalize() {
      if (this.hasOwnProperty(s2("finalized"))) return;
      if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(s2("properties"))) {
        const r = this.properties,
          n = [...aoe(r), ...coe(r)];
        for (const i of n) this.createProperty(i, r[i])
      }
      const e = this[Symbol.metadata];
      if (e !== null) {
        const r = litPropertyMetadata.get(e);
        if (r !== void 0)
          for (const [n, i] of r) this.elementProperties.set(n, i)
      }
      this._$Eh = new Map;
      for (const [r, n] of this.elementProperties) {
        const i = this._$Eu(r, n);
        i !== void 0 && this._$Eh.set(i, r)
      }
      this.elementStyles = this.finalizeStyles(this.styles)
    }
    static finalizeStyles(e) {
      const r = [];
      if (Array.isArray(e)) {
        const n = new Set(e.flat(1 / 0).reverse());
        for (const i of n) r.unshift(lP(i))
      } else e !== void 0 && r.push(lP(e));
      return r
    }
    static _$Eu(e, r) {
      const n = r.attribute;
      return n === !1 ? void 0 : typeof n == "string" ? n : typeof e == "string" ? e.toLowerCase() : void 0
    }
    constructor() {
      super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev()
    }
    _$Ev() {
      this._$ES = new Promise(e => this.enableUpdating = e), this._$AL = new Map, this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(e => e(this))
    }
    addController(e) {
      (this._$EO ?? (this._$EO = new Set)).add(e), this.renderRoot !== void 0 && this.isConnected && e.hostConnected?.()
    }
    removeController(e) {
      this._$EO?.delete(e)
    }
    _$E_() {
      const e = new Map,
        r = this.constructor.elementProperties;
      for (const n of r.keys()) this.hasOwnProperty(n) && (e.set(n, this[n]), delete this[n]);
      e.size > 0 && (this._$Ep = e)
    }
    createRenderRoot() {
      const e = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
      return noe(e, this.constructor.elementStyles), e
    }
    connectedCallback() {
      this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), this._$EO?.forEach(e => e.hostConnected?.())
    }
    enableUpdating(e) {}
    disconnectedCallback() {
      this._$EO?.forEach(e => e.hostDisconnected?.())
    }
    attributeChangedCallback(e, r, n) {
      this._$AK(e, n)
    }
    _$EC(e, r) {
      const n = this.constructor.elementProperties.get(e),
        i = this.constructor._$Eu(e, n);
      if (i !== void 0 && n.reflect === !0) {
        const s = (n.converter?.toAttribute !== void 0 ? n.converter : sx).toAttribute(r, n.type);
        this._$Em = e, s == null ? this.removeAttribute(i) : this.setAttribute(i, s), this._$Em = null
      }
    }
    _$AK(e, r) {
      const n = this.constructor,
        i = n._$Eh.get(e);
      if (i !== void 0 && this._$Em !== i) {
        const s = n.getPropertyOptions(i),
          o = typeof s.converter == "function" ? {
            fromAttribute: s.converter
          } : s.converter?.fromAttribute !== void 0 ? s.converter : sx;
        this._$Em = i, this[i] = o.fromAttribute(r, s.type), this._$Em = null
      }
    }
    requestUpdate(e, r, n) {
      if (e !== void 0) {
        if (n ?? (n = this.constructor.getPropertyOptions(e)), !(n.hasChanged ?? dP)(this[e], r)) return;
        this.P(e, r, n)
      }
      this.isUpdatePending === !1 && (this._$ES = this._$ET())
    }
    P(e, r, n) {
      this._$AL.has(e) || this._$AL.set(e, r), n.reflect === !0 && this._$Em !== e && (this._$Ej ?? (this._$Ej = new Set)).add(e)
    }
    async _$ET() {
      this.isUpdatePending = !0;
      try {
        await this._$ES
      } catch (r) {
        Promise.reject(r)
      }
      const e = this.scheduleUpdate();
      return e != null && await e, !this.isUpdatePending
    }
    scheduleUpdate() {
      return this.performUpdate()
    }
    performUpdate() {
      if (!this.isUpdatePending) return;
      if (!this.hasUpdated) {
        if (this.renderRoot ?? (this.renderRoot = this.createRenderRoot()), this._$Ep) {
          for (const [i, s] of this._$Ep) this[i] = s;
          this._$Ep = void 0
        }
        const n = this.constructor.elementProperties;
        if (n.size > 0)
          for (const [i, s] of n) s.wrapped !== !0 || this._$AL.has(i) || this[i] === void 0 || this.P(i, this[i], s)
      }
      let e = !1;
      const r = this._$AL;
      try {
        e = this.shouldUpdate(r), e ? (this.willUpdate(r), this._$EO?.forEach(n => n.hostUpdate?.()), this.update(r)) : this._$EU()
      } catch (n) {
        throw e = !1, this._$EU(), n
      }
      e && this._$AE(r)
    }
    willUpdate(e) {}
    _$AE(e) {
      this._$EO?.forEach(r => r.hostUpdated?.()), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e)
    }
    _$EU() {
      this._$AL = new Map, this.isUpdatePending = !1
    }
    get updateComplete() {
      return this.getUpdateComplete()
    }
    getUpdateComplete() {
      return this._$ES
    }
    shouldUpdate(e) {
      return !0
    }
    update(e) {
      this._$Ej && (this._$Ej = this._$Ej.forEach(r => this._$EC(r, this[r]))), this._$EU()
    }
    updated(e) {}
    firstUpdated(e) {}
  };
  A1.elementStyles = [], A1.shadowRootOptions = {
    mode: "open"
  }, A1[s2("elementProperties")] = new Map, A1[s2("finalized")] = new Map, doe?.({
    ReactiveElement: A1
  }), (Jd.reactiveElementVersions ?? (Jd.reactiveElementVersions = [])).push("2.0.4");
  /**
   * @license
   * Copyright 2017 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  const o2 = globalThis,
    Wy = o2.trustedTypes,
    fP = Wy ? Wy.createPolicy("lit-html", {
      createHTML: t => t
    }) : void 0,
    pP = "$lit$",
    Xd = `lit$${Math.random().toFixed(9).slice(2)}$`,
    gP = "?" + Xd,
    hoe = `<${gP}>`,
    Lf = document,
    a2 = () => Lf.createComment(""),
    c2 = t => t === null || typeof t != "object" && typeof t != "function",
    ox = Array.isArray,
    foe = t => ox(t) || typeof t?.[Symbol.iterator] == "function",
    ax = `[ 	
  \f\r]`,
    l2 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
    mP = /-->/g,
    wP = />/g,
    Bf = RegExp(`>|${ax}(?:([^\\s"'>=/]+)(${ax}*=${ax}*(?:[^ 	
  \f\r"'\`<>=]|("|')|))|$)`, "g"),
    vP = /'/g,
    bP = /"/g,
    yP = /^(?:script|style|textarea|title)$/i,
    _P = t => (e, ...r) => ({
      _$litType$: t,
      strings: e,
      values: r
    }),
    K = _P(1),
    Ke = _P(2),
    S1 = Symbol.for("lit-noChange"),
    ji = Symbol.for("lit-nothing"),
    xP = new WeakMap,
    Uf = Lf.createTreeWalker(Lf, 129);

  function CP(t, e) {
    if (!ox(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
    return fP !== void 0 ? fP.createHTML(e) : e
  }
  const poe = (t, e) => {
    const r = t.length - 1,
      n = [];
    let i, s = e === 2 ? "<svg>" : e === 3 ? "<math>" : "",
      o = l2;
    for (let a = 0; a < r; a++) {
      const c = t[a];
      let l, h, f = -1,
        w = 0;
      for (; w < c.length && (o.lastIndex = w, h = o.exec(c), h !== null);) w = o.lastIndex, o === l2 ? h[1] === "!--" ? o = mP : h[1] !== void 0 ? o = wP : h[2] !== void 0 ? (yP.test(h[2]) && (i = RegExp("</" + h[2], "g")), o = Bf) : h[3] !== void 0 && (o = Bf) : o === Bf ? h[0] === ">" ? (o = i ?? l2, f = -1) : h[1] === void 0 ? f = -2 : (f = o.lastIndex - h[2].length, l = h[1], o = h[3] === void 0 ? Bf : h[3] === '"' ? bP : vP) : o === bP || o === vP ? o = Bf : o === mP || o === wP ? o = l2 : (o = Bf, i = void 0);
      const b = o === Bf && t[a + 1].startsWith("/>") ? " " : "";
      s += o === l2 ? c + hoe : f >= 0 ? (n.push(l), c.slice(0, f) + pP + c.slice(f) + Xd + b) : c + Xd + (f === -2 ? a : b)
    }
    return [CP(t, s + (t[r] || "<?>") + (e === 2 ? "</svg>" : e === 3 ? "</math>" : "")), n]
  };
  let cx = class KZ {
    constructor({
      strings: e,
      _$litType$: r
    }, n) {
      let i;
      this.parts = [];
      let s = 0,
        o = 0;
      const a = e.length - 1,
        c = this.parts,
        [l, h] = poe(e, r);
      if (this.el = KZ.createElement(l, n), Uf.currentNode = this.el.content, r === 2 || r === 3) {
        const f = this.el.content.firstChild;
        f.replaceWith(...f.childNodes)
      }
      for (;
        (i = Uf.nextNode()) !== null && c.length < a;) {
        if (i.nodeType === 1) {
          if (i.hasAttributes())
            for (const f of i.getAttributeNames())
              if (f.endsWith(pP)) {
                const w = h[o++],
                  b = i.getAttribute(f).split(Xd),
                  C = /([.?@])?(.*)/.exec(w);
                c.push({
                  type: 1,
                  index: s,
                  name: C[2],
                  strings: b,
                  ctor: C[1] === "." ? moe : C[1] === "?" ? woe : C[1] === "@" ? voe : zy
                }), i.removeAttribute(f)
              } else f.startsWith(Xd) && (c.push({
                type: 6,
                index: s
              }), i.removeAttribute(f));
          if (yP.test(i.tagName)) {
            const f = i.textContent.split(Xd),
              w = f.length - 1;
            if (w > 0) {
              i.textContent = Wy ? Wy.emptyScript : "";
              for (let b = 0; b < w; b++) i.append(f[b], a2()), Uf.nextNode(), c.push({
                type: 2,
                index: ++s
              });
              i.append(f[w], a2())
            }
          }
        } else if (i.nodeType === 8)
          if (i.data === gP) c.push({
            type: 2,
            index: s
          });
          else {
            let f = -1;
            for (;
              (f = i.data.indexOf(Xd, f + 1)) !== -1;) c.push({
              type: 7,
              index: s
            }), f += Xd.length - 1
          } s++
      }
    }
    static createElement(e, r) {
      const n = Lf.createElement("template");
      return n.innerHTML = e, n
    }
  };

  function I1(t, e, r = t, n) {
    if (e === S1) return e;
    let i = n !== void 0 ? r._$Co?.[n] : r._$Cl;
    const s = c2(e) ? void 0 : e._$litDirective$;
    return i?.constructor !== s && (i?._$AO?.(!1), s === void 0 ? i = void 0 : (i = new s(t), i._$AT(t, r, n)), n !== void 0 ? (r._$Co ?? (r._$Co = []))[n] = i : r._$Cl = i), i !== void 0 && (e = I1(t, i._$AS(t, e.values), i, n)), e
  }
  let goe = class {
      constructor(e, r) {
        this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = r
      }
      get parentNode() {
        return this._$AM.parentNode
      }
      get _$AU() {
        return this._$AM._$AU
      }
      u(e) {
        const {
          el: {
            content: r
          },
          parts: n
        } = this._$AD, i = (e?.creationScope ?? Lf).importNode(r, !0);
        Uf.currentNode = i;
        let s = Uf.nextNode(),
          o = 0,
          a = 0,
          c = n[0];
        for (; c !== void 0;) {
          if (o === c.index) {
            let l;
            c.type === 2 ? l = new lx(s, s.nextSibling, this, e) : c.type === 1 ? l = new c.ctor(s, c.name, c.strings, this, e) : c.type === 6 && (l = new boe(s, this, e)), this._$AV.push(l), c = n[++a]
          }
          o !== c?.index && (s = Uf.nextNode(), o++)
        }
        return Uf.currentNode = Lf, i
      }
      p(e) {
        let r = 0;
        for (const n of this._$AV) n !== void 0 && (n.strings !== void 0 ? (n._$AI(e, n, r), r += n.strings.length - 2) : n._$AI(e[r])), r++
      }
    },
    lx = class GZ {
      get _$AU() {
        return this._$AM?._$AU ?? this._$Cv
      }
      constructor(e, r, n, i) {
        this.type = 2, this._$AH = ji, this._$AN = void 0, this._$AA = e, this._$AB = r, this._$AM = n, this.options = i, this._$Cv = i?.isConnected ?? !0
      }
      get parentNode() {
        let e = this._$AA.parentNode;
        const r = this._$AM;
        return r !== void 0 && e?.nodeType === 11 && (e = r.parentNode), e
      }
      get startNode() {
        return this._$AA
      }
      get endNode() {
        return this._$AB
      }
      _$AI(e, r = this) {
        e = I1(this, e, r), c2(e) ? e === ji || e == null || e === "" ? (this._$AH !== ji && this._$AR(), this._$AH = ji) : e !== this._$AH && e !== S1 && this._(e) : e._$litType$ !== void 0 ? this.$(e) : e.nodeType !== void 0 ? this.T(e) : foe(e) ? this.k(e) : this._(e)
      }
      O(e) {
        return this._$AA.parentNode.insertBefore(e, this._$AB)
      }
      T(e) {
        this._$AH !== e && (this._$AR(), this._$AH = this.O(e))
      }
      _(e) {
        this._$AH !== ji && c2(this._$AH) ? this._$AA.nextSibling.data = e : this.T(Lf.createTextNode(e)), this._$AH = e
      }
      $(e) {
        const {
          values: r,
          _$litType$: n
        } = e, i = typeof n == "number" ? this._$AC(e) : (n.el === void 0 && (n.el = cx.createElement(CP(n.h, n.h[0]), this.options)), n);
        if (this._$AH?._$AD === i) this._$AH.p(r);
        else {
          const s = new goe(i, this),
            o = s.u(this.options);
          s.p(r), this.T(o), this._$AH = s
        }
      }
      _$AC(e) {
        let r = xP.get(e.strings);
        return r === void 0 && xP.set(e.strings, r = new cx(e)), r
      }
      k(e) {
        ox(this._$AH) || (this._$AH = [], this._$AR());
        const r = this._$AH;
        let n, i = 0;
        for (const s of e) i === r.length ? r.push(n = new GZ(this.O(a2()), this.O(a2()), this, this.options)) : n = r[i], n._$AI(s), i++;
        i < r.length && (this._$AR(n && n._$AB.nextSibling, i), r.length = i)
      }
      _$AR(e = this._$AA.nextSibling, r) {
        for (this._$AP?.(!1, !0, r); e && e !== this._$AB;) {
          const n = e.nextSibling;
          e.remove(), e = n
        }
      }
      setConnected(e) {
        this._$AM === void 0 && (this._$Cv = e, this._$AP?.(e))
      }
    },
    zy = class {
      get tagName() {
        return this.element.tagName
      }
      get _$AU() {
        return this._$AM._$AU
      }
      constructor(e, r, n, i, s) {
        this.type = 1, this._$AH = ji, this._$AN = void 0, this.element = e, this.name = r, this._$AM = i, this.options = s, n.length > 2 || n[0] !== "" || n[1] !== "" ? (this._$AH = Array(n.length - 1).fill(new String), this.strings = n) : this._$AH = ji
      }
      _$AI(e, r = this, n, i) {
        const s = this.strings;
        let o = !1;
        if (s === void 0) e = I1(this, e, r, 0), o = !c2(e) || e !== this._$AH && e !== S1, o && (this._$AH = e);
        else {
          const a = e;
          let c, l;
          for (e = s[0], c = 0; c < s.length - 1; c++) l = I1(this, a[n + c], r, c), l === S1 && (l = this._$AH[c]), o || (o = !c2(l) || l !== this._$AH[c]), l === ji ? e = ji : e !== ji && (e += (l ?? "") + s[c + 1]), this._$AH[c] = l
        }
        o && !i && this.j(e)
      }
      j(e) {
        e === ji ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "")
      }
    },
    moe = class extends zy {
      constructor() {
        super(...arguments), this.type = 3
      }
      j(e) {
        this.element[this.name] = e === ji ? void 0 : e
      }
    },
    woe = class extends zy {
      constructor() {
        super(...arguments), this.type = 4
      }
      j(e) {
        this.element.toggleAttribute(this.name, !!e && e !== ji)
      }
    },
    voe = class extends zy {
      constructor(e, r, n, i, s) {
        super(e, r, n, i, s), this.type = 5
      }
      _$AI(e, r = this) {
        if ((e = I1(this, e, r, 0) ?? ji) === S1) return;
        const n = this._$AH,
          i = e === ji && n !== ji || e.capture !== n.capture || e.once !== n.once || e.passive !== n.passive,
          s = e !== ji && (n === ji || i);
        i && this.element.removeEventListener(this.name, this, n), s && this.element.addEventListener(this.name, this, e), this._$AH = e
      }
      handleEvent(e) {
        typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, e) : this._$AH.handleEvent(e)
      }
    },
    boe = class {
      constructor(e, r, n) {
        this.element = e, this.type = 6, this._$AN = void 0, this._$AM = r, this.options = n
      }
      get _$AU() {
        return this._$AM._$AU
      }
      _$AI(e) {
        I1(this, e)
      }
    };
  const yoe = o2.litHtmlPolyfillSupport;
  yoe?.(cx, lx), (o2.litHtmlVersions ?? (o2.litHtmlVersions = [])).push("3.2.1");
  const _oe = (t, e, r) => {
    const n = r?.renderBefore ?? e;
    let i = n._$litPart$;
    if (i === void 0) {
      const s = r?.renderBefore ?? null;
      n._$litPart$ = i = new lx(e.insertBefore(a2(), s), s, void 0, r ?? {})
    }
    return i._$AI(t), i
  };
  /**
   * @license
   * Copyright 2017 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  let _e = class extends A1 {
    constructor() {
      super(...arguments), this.renderOptions = {
        host: this
      }, this._$Do = void 0
    }
    createRenderRoot() {
      var r;
      const e = super.createRenderRoot();
      return (r = this.renderOptions).renderBefore ?? (r.renderBefore = e.firstChild), e
    }
    update(e) {
      const r = this.render();
      this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = _oe(r, this.renderRoot, this.renderOptions)
    }
    connectedCallback() {
      super.connectedCallback(), this._$Do?.setConnected(!0)
    }
    disconnectedCallback() {
      super.disconnectedCallback(), this._$Do?.setConnected(!1)
    }
    render() {
      return S1
    }
  };
  _e._$litElement$ = !0, _e.finalized = !0, globalThis.litElementHydrateSupport?.({
    LitElement: _e
  });
  const xoe = globalThis.litElementPolyfillSupport;
  xoe?.({
    LitElement: _e
  }), (globalThis.litElementVersions ?? (globalThis.litElementVersions = [])).push("4.1.1");
  const Coe = Ke`<svg class="input_mask" width="328" height="100" viewBox="0 0 328 100" fill="none">
    <mask id="path-1-inside-1_18299_4189">
      <path
        class="input_mask__border"
        fill-rule="evenodd"
        clip-rule="evenodd"
        d="M138.008 0H40C21.1438 0 11.7157 0 5.85786 5.85786C0 11.7157 0 21.1438 0 40V60C0 78.8562 0 88.2843 5.85786 94.1421C11.7157 100 21.1438 100 40 100H288C306.856 100 316.284 100 322.142 94.1421C328 88.2843 328 78.8562 328 60V40C328 21.1438 328 11.7157 322.142 5.85786C316.284 0 306.856 0 288 0H189.992C189.958 4.89122 189.786 7.76279 188.914 10.1564C187.095 15.1562 183.156 19.0947 178.156 20.9145C175.174 22 171.449 22 164 22C156.551 22 152.826 22 149.844 20.9145C144.844 19.0947 140.905 15.1562 139.086 10.1564C138.214 7.76279 138.042 4.89122 138.008 0Z"
      />
    </mask>
    <path
      class="input_mask__background"
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M138.008 0H40C21.1438 0 11.7157 0 5.85786 5.85786C0 11.7157 0 21.1438 0 40V60C0 78.8562 0 88.2843 5.85786 94.1421C11.7157 100 21.1438 100 40 100H288C306.856 100 316.284 100 322.142 94.1421C328 88.2843 328 78.8562 328 60V40C328 21.1438 328 11.7157 322.142 5.85786C316.284 0 306.856 0 288 0H189.992C189.958 4.89122 189.786 7.76279 188.914 10.1564C187.095 15.1562 183.156 19.0947 178.156 20.9145C175.174 22 171.449 22 164 22C156.551 22 152.826 22 149.844 20.9145C144.844 19.0947 140.905 15.1562 139.086 10.1564C138.214 7.76279 138.042 4.89122 138.008 0Z"
    />
    <path
      class="input_mask__border"
      d="M138.008 0L139.008 -0.00694413L139.001 -1H138.008V0ZM322.142 94.1421L322.849 94.8492H322.849L322.142 94.1421ZM322.142 5.85786L322.849 5.15076L322.849 5.15076L322.142 5.85786ZM189.992 0V-1H188.999L188.992 -0.00694413L189.992 0ZM188.914 10.1564L189.854 10.4984V10.4984L188.914 10.1564ZM178.156 20.9145L177.814 19.9748V19.9748L178.156 20.9145ZM149.844 20.9145L150.186 19.9748V19.9748L149.844 20.9145ZM139.086 10.1564L138.146 10.4984V10.4984L139.086 10.1564ZM40 1H138.008V-1H40V1ZM6.56497 6.56497C9.27713 3.85281 12.8524 2.44064 18.1878 1.72332C23.552 1.00212 30.5436 1 40 1V-1C30.6002 -1 23.4497 -1.00212 17.9213 -0.25885C12.3641 0.488292 8.29646 2.00506 5.15076 5.15076L6.56497 6.56497ZM1 40C1 30.5436 1.00212 23.552 1.72332 18.1878C2.44064 12.8524 3.85281 9.27713 6.56497 6.56497L5.15076 5.15076C2.00506 8.29646 0.488292 12.3641 -0.25885 17.9213C-1.00212 23.4497 -1 30.6002 -1 40H1ZM1 60V40H-1V60H1ZM6.56497 93.435C3.85281 90.7229 2.44064 87.1476 1.72332 81.8122C1.00212 76.448 1 69.4564 1 60H-1C-1 69.3998 -1.00212 76.5503 -0.25885 82.0787C0.488292 87.6358 2.00506 91.7035 5.15076 94.8492L6.56497 93.435ZM40 99C30.5436 99 23.552 98.9979 18.1878 98.2767C12.8524 97.5594 9.27713 96.1472 6.56497 93.435L5.15076 94.8492C8.29646 97.9949 12.3641 99.5117 17.9213 100.259C23.4497 101.002 30.6002 101 40 101V99ZM288 99H40V101H288V99ZM321.435 93.435C318.723 96.1472 315.148 97.5594 309.812 98.2767C304.448 98.9979 297.456 99 288 99V101C297.4 101 304.55 101.002 310.079 100.259C315.636 99.5117 319.704 97.9949 322.849 94.8492L321.435 93.435ZM327 60C327 69.4564 326.998 76.448 326.277 81.8122C325.559 87.1476 324.147 90.7229 321.435 93.435L322.849 94.8492C325.995 91.7035 327.512 87.6358 328.259 82.0787C329.002 76.5503 329 69.3998 329 60H327ZM327 40V60H329V40H327ZM321.435 6.56497C324.147 9.27713 325.559 12.8524 326.277 18.1878C326.998 23.552 327 30.5436 327 40H329C329 30.6002 329.002 23.4497 328.259 17.9213C327.512 12.3642 325.995 8.29646 322.849 5.15076L321.435 6.56497ZM288 1C297.456 1 304.448 1.00212 309.812 1.72332C315.148 2.44064 318.723 3.85281 321.435 6.56497L322.849 5.15076C319.704 2.00506 315.636 0.488292 310.079 -0.25885C304.55 -1.00212 297.4 -1 288 -1V1ZM189.992 1H288V-1H189.992V1ZM188.992 -0.00694413C188.958 4.90792 188.778 7.60788 187.975 9.81434L189.854 10.4984C190.793 7.9177 190.958 4.87452 190.992 0.00694413L188.992 -0.00694413ZM187.975 9.81434C186.256 14.5364 182.536 18.2561 177.814 19.9748L178.498 21.8542C183.776 19.9333 187.933 15.7759 189.854 10.4984L187.975 9.81434ZM177.814 19.9748C175.039 20.9848 171.536 21 164 21V23C171.362 23 175.308 23.0152 178.498 21.8542L177.814 19.9748ZM164 21C156.464 21 152.961 20.9848 150.186 19.9748L149.502 21.8542C152.692 23.0152 156.638 23 164 23V21ZM150.186 19.9748C145.464 18.2561 141.744 14.5364 140.025 9.81434L138.146 10.4984C140.067 15.7759 144.224 19.9333 149.502 21.8542L150.186 19.9748ZM140.025 9.81434C139.222 7.60788 139.042 4.90792 139.008 -0.00694413L137.008 0.00694413C137.042 4.87452 137.207 7.9177 138.146 10.4984L140.025 9.81434Z"
      mask="url(#path-1-inside-1_18299_4189)"
    />
  </svg>`,
    Eoe = Ke`<svg class="input_mask" width="328" height="100" viewBox="0 0 328 100" fill="none">
    <mask id="path-1-inside-1_18299_4168">
      <path
        class="input_mask__border"
        fill-rule="evenodd"
        clip-rule="evenodd"
        d="M5.85786 5.85786C0 11.7157 0 21.1438 0 40V60C0 78.8562 0 88.2843 5.85786 94.1421C11.7157 100 21.1438 100 40 100H138.008C138.042 95.1088 138.214 92.2372 139.086 89.8436C140.905 84.8438 144.844 80.9053 149.844 79.0855C152.826 78 156.551 78 164 78C171.449 78 175.174 78 178.156 79.0855C183.156 80.9053 187.095 84.8438 188.914 89.8436C189.786 92.2372 189.958 95.1088 189.992 100H288C306.856 100 316.284 100 322.142 94.1421C328 88.2843 328 78.8562 328 60V40C328 21.1438 328 11.7157 322.142 5.85786C316.284 0 306.856 0 288 0H40C21.1438 0 11.7157 0 5.85786 5.85786Z"
      />
    </mask>
    <path
      class="input_mask__background"
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M5.85786 5.85786C0 11.7157 0 21.1438 0 40V60C0 78.8562 0 88.2843 5.85786 94.1421C11.7157 100 21.1438 100 40 100H138.008C138.042 95.1088 138.214 92.2372 139.086 89.8436C140.905 84.8438 144.844 80.9053 149.844 79.0855C152.826 78 156.551 78 164 78C171.449 78 175.174 78 178.156 79.0855C183.156 80.9053 187.095 84.8438 188.914 89.8436C189.786 92.2372 189.958 95.1088 189.992 100H288C306.856 100 316.284 100 322.142 94.1421C328 88.2843 328 78.8562 328 60V40C328 21.1438 328 11.7157 322.142 5.85786C316.284 0 306.856 0 288 0H40C21.1438 0 11.7157 0 5.85786 5.85786Z"
    />
    <path
      class="input_mask__border"
      d="M138.008 100V101H139.001L139.008 100.007L138.008 100ZM139.086 89.8436L138.146 89.5016L139.086 89.8436ZM149.844 79.0855L150.186 80.0252L149.844 79.0855ZM178.156 79.0855L177.814 80.0252L178.156 79.0855ZM188.914 89.8436L189.854 89.5016L188.914 89.8436ZM189.992 100L188.992 100.007L188.999 101H189.992V100ZM322.142 94.1421L322.849 94.8492H322.849L322.142 94.1421ZM322.142 5.85786L322.849 5.15076L322.849 5.15076L322.142 5.85786ZM1 40C1 30.5436 1.00212 23.552 1.72332 18.1878C2.44064 12.8524 3.85281 9.27713 6.56497 6.56497L5.15076 5.15076C2.00506 8.29646 0.488292 12.3641 -0.25885 17.9213C-1.00212 23.4497 -1 30.6002 -1 40H1ZM1 60V40H-1V60H1ZM6.56497 93.435C3.85281 90.7229 2.44064 87.1476 1.72332 81.8122C1.00212 76.448 1 69.4564 1 60H-1C-1 69.3998 -1.00212 76.5503 -0.25885 82.0787C0.488292 87.6358 2.00506 91.7035 5.15076 94.8492L6.56497 93.435ZM40 99C30.5436 99 23.552 98.9979 18.1878 98.2767C12.8524 97.5594 9.27713 96.1472 6.56497 93.435L5.15076 94.8492C8.29646 97.9949 12.3641 99.5117 17.9213 100.259C23.4497 101.002 30.6002 101 40 101V99ZM138.008 99H40V101H138.008V99ZM139.008 100.007C139.042 95.0921 139.222 92.3921 140.025 90.1857L138.146 89.5016C137.207 92.0823 137.042 95.1255 137.008 99.9931L139.008 100.007ZM140.025 90.1857C141.744 85.4636 145.464 81.7439 150.186 80.0252L149.502 78.1458C144.224 80.0667 140.067 84.2241 138.146 89.5016L140.025 90.1857ZM150.186 80.0252C152.961 79.0152 156.464 79 164 79V77C156.638 77 152.692 76.9848 149.502 78.1458L150.186 80.0252ZM164 79C171.536 79 175.039 79.0152 177.814 80.0252L178.498 78.1458C175.308 76.9848 171.362 77 164 77V79ZM177.814 80.0252C182.536 81.7439 186.256 85.4636 187.975 90.1857L189.854 89.5016C187.933 84.2241 183.776 80.0667 178.498 78.1458L177.814 80.0252ZM187.975 90.1857C188.778 92.3921 188.958 95.0921 188.992 100.007L190.992 99.9931C190.958 95.1255 190.793 92.0823 189.854 89.5016L187.975 90.1857ZM288 99H189.992V101H288V99ZM321.435 93.435C318.723 96.1472 315.148 97.5594 309.812 98.2767C304.448 98.9979 297.456 99 288 99V101C297.4 101 304.55 101.002 310.079 100.259C315.636 99.5117 319.704 97.9949 322.849 94.8492L321.435 93.435ZM327 60C327 69.4564 326.998 76.448 326.277 81.8122C325.559 87.1476 324.147 90.7229 321.435 93.435L322.849 94.8492C325.995 91.7035 327.512 87.6358 328.259 82.0787C329.002 76.5503 329 69.3998 329 60H327ZM327 40V60H329V40H327ZM321.435 6.56497C324.147 9.27713 325.559 12.8524 326.277 18.1878C326.998 23.552 327 30.5436 327 40H329C329 30.6002 329.002 23.4497 328.259 17.9213C327.512 12.3642 325.995 8.29646 322.849 5.15076L321.435 6.56497ZM288 1C297.456 1 304.448 1.00212 309.812 1.72332C315.148 2.44064 318.723 3.85281 321.435 6.56497L322.849 5.15076C319.704 2.00506 315.636 0.488292 310.079 -0.25885C304.55 -1.00212 297.4 -1 288 -1V1ZM40 1H288V-1H40V1ZM6.56497 6.56497C9.27713 3.85281 12.8524 2.44064 18.1878 1.72332C23.552 1.00212 30.5436 1 40 1V-1C30.6002 -1 23.4497 -1.00212 17.9213 -0.25885C12.3641 0.488292 8.29646 2.00506 5.15076 5.15076L6.56497 6.56497Z"
      mask="url(#path-1-inside-1_18299_4168)"
    />
  </svg>`;
  let u2, eh, th;

  function EP(t, e) {
    u2 = document.createElement("style"), eh = document.createElement("style"), th = document.createElement("style"), u2.textContent = T1(t).core.cssText, eh.textContent = T1(t).dark.cssText, th.textContent = T1(t).light.cssText, document.head.appendChild(u2), document.head.appendChild(eh), document.head.appendChild(th), ux(e)
  }

  function ux(t) {
    eh && th && (t === "light" ? (eh.removeAttribute("media"), th.media = "enabled") : (th.removeAttribute("media"), eh.media = "enabled"))
  }

  function AP(t) {
    u2 && eh && th && (u2.textContent = T1(t).core.cssText, eh.textContent = T1(t).dark.cssText, th.textContent = T1(t).light.cssText)
  }

  function T1(t) {
    return {
      core: Re`
        @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
        @keyframes w4m-shake {
          0% {
            transform: scale(1) rotate(0deg);
          }
          20% {
            transform: scale(1) rotate(-1deg);
          }
          40% {
            transform: scale(1) rotate(1.5deg);
          }
          60% {
            transform: scale(1) rotate(-1.5deg);
          }
          80% {
            transform: scale(1) rotate(1deg);
          }
          100% {
            transform: scale(1) rotate(0deg);
          }
        }
        @keyframes w4m-iframe-fade-out {
          0% {
            opacity: 1;
          }
          100% {
            opacity: 0;
          }
        }
        @keyframes w4m-iframe-zoom-in {
          0% {
            transform: translateY(50px);
            opacity: 0;
          }
          100% {
            transform: translateY(0px);
            opacity: 1;
          }
        }
        @keyframes w4m-iframe-zoom-in-mobile {
          0% {
            transform: scale(0.95);
            opacity: 0;
          }
          100% {
            transform: scale(1);
            opacity: 1;
          }
        }
        :root {
          --w4m-modal-width: 360px;
          --w4m-color-mix-strength: ${ha(t?.["--w4m-color-mix-strength"]?`${t["--w4m-color-mix-strength"]}%`:"0%")};
          --w4m-font-family: ${ha(t?.["--w4m-font-family"]||"Inter, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;")};
          --w4m-font-size-master: ${ha(t?.["--w4m-font-size-master"]||"10px")};
          --w4m-border-radius-master: ${ha(t?.["--w4m-border-radius-master"]||"4px")};
          --w4m-z-index: ${ha(t?.["--w4m-z-index"]||999)};
  
          --wiu-font-family: var(--w4m-font-family);
  
          --wiu-font-size-mini: calc(var(--w4m-font-size-master) * 0.8);
          --wiu-font-size-micro: var(--w4m-font-size-master);
          --wiu-font-size-tiny: calc(var(--w4m-font-size-master) * 1.2);
          --wiu-font-size-small: calc(var(--w4m-font-size-master) * 1.4);
          --wiu-font-size-paragraph: calc(var(--w4m-font-size-master) * 1.6);
          --wiu-font-size-medium: calc(var(--w4m-font-size-master) * 1.8);
          --wiu-font-size-large: calc(var(--w4m-font-size-master) * 2);
          --wiu-font-size-title-6: calc(var(--w4m-font-size-master) * 2.2);
          --wiu-font-size-medium-title: calc(var(--w4m-font-size-master) * 2.4);
          --wiu-font-size-2xl: calc(var(--w4m-font-size-master) * 4);
  
          --wiu-border-radius-5xs: var(--w4m-border-radius-master);
          --wiu-border-radius-4xs: calc(var(--w4m-border-radius-master) * 1.5);
          --wiu-border-radius-3xs: calc(var(--w4m-border-radius-master) * 2);
          --wiu-border-radius-xxs: calc(var(--w4m-border-radius-master) * 3);
          --wiu-border-radius-xs: calc(var(--w4m-border-radius-master) * 4);
          --wiu-border-radius-s: calc(var(--w4m-border-radius-master) * 5);
          --wiu-border-radius-m: calc(var(--w4m-border-radius-master) * 7);
          --wiu-border-radius-l: calc(var(--w4m-border-radius-master) * 9);
          --wiu-border-radius-3xl: calc(var(--w4m-border-radius-master) * 20);
  
          --wiu-font-weight-light: 400;
          --wiu-font-weight-regular: 500;
          --wiu-font-weight-medium: 600;
          --wiu-font-weight-bold: 700;
  
          --wiu-letter-spacing-2xl: -1.6px;
          --wiu-letter-spacing-medium-title: -0.96px;
          --wiu-letter-spacing-title-6: -0.88px;
          --wiu-letter-spacing-large: -0.8px;
          --wiu-letter-spacing-medium: -0.72px;
          --wiu-letter-spacing-paragraph: -0.64px;
          --wiu-letter-spacing-small: -0.56px;
          --wiu-letter-spacing-tiny: -0.48px;
          --wiu-letter-spacing-micro: -0.2px;
          --wiu-letter-spacing-mini: -0.16px;
  
          --wiu-spacing-0: 0px;
          --wiu-spacing-4xs: 2px;
          --wiu-spacing-3xs: 4px;
          --wiu-spacing-xxs: 6px;
          --wiu-spacing-2xs: 7px;
          --wiu-spacing-xs: 8px;
          --wiu-spacing-1xs: 10px;
          --wiu-spacing-s: 12px;
          --wiu-spacing-m: 14px;
          --wiu-spacing-l: 16px;
          --wiu-spacing-2l: 18px;
          --wiu-spacing-xl: 20px;
          --wiu-spacing-xxl: 24px;
          --wiu-spacing-2xl: 32px;
          --wiu-spacing-3xl: 40px;
          --wiu-spacing-4xl: 90px;
          --wiu-spacing-5xl: 95px;
  
          --wiu-icon-box-size-xxs: 14px;
          --wiu-icon-box-size-xs: 20px;
          --wiu-icon-box-size-sm: 24px;
          --wiu-icon-box-size-md: 32px;
          --wiu-icon-box-size-lg: 40px;
          --wiu-icon-box-size-2lg: 48px;
          --wiu-icon-box-size-xl: 64px;
  
          --wiu-icon-size-inherit: inherit;
          --wiu-icon-size-xxs: 10px;
          --wiu-icon-size-xs: 12px;
          --wiu-icon-size-sm: 14px;
          --wiu-icon-size-md: 16px;
          --wiu-icon-size-mdl: 18px;
          --wiu-icon-size-lg: 20px;
          --wiu-icon-size-xl: 24px;
          --wiu-icon-size-xxl: 28px;
  
          --wiu-wallet-image-size-inherit: inherit;
          --wiu-wallet-image-size-sm: 40px;
          --wiu-wallet-image-size-md: 56px;
          --wiu-wallet-image-size-lg: 80px;
  
          --wiu-visual-size-size-inherit: inherit;
          --wiu-visual-size-sm: 40px;
          --wiu-visual-size-md: 55px;
          --wiu-visual-size-lg: 80px;
  
          --wiu-box-size-md: 100px;
          --wiu-box-size-lg: 120px;
  
          --wiu-ease-out-power-2: cubic-bezier(0, 0, 0.22, 1);
          --wiu-ease-out-power-1: cubic-bezier(0, 0, 0.55, 1);
  
          --wiu-ease-in-power-3: cubic-bezier(0.66, 0, 1, 1);
          --wiu-ease-in-power-2: cubic-bezier(0.45, 0, 1, 1);
          --wiu-ease-in-power-1: cubic-bezier(0.3, 0, 1, 1);
  
          --wiu-ease-inout-power-1: cubic-bezier(0.45, 0, 0.55, 1);
  
          --wiu-duration-lg: 200ms;
          --wiu-duration-md: 125ms;
          --wiu-duration-sm: 75ms;
  
          --wiu-path-network-sm: path(
            'M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.61 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z'
          );
  
          --wiu-path-network-md: path(
            'M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z'
          );
  
          --wiu-path-network-lg: path(
            'M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z'
          );
  
          --wiu-width-network-sm: 36px;
          --wiu-width-network-md: 48px;
          --wiu-width-network-lg: 86px;
  
          --wiu-height-network-sm: 40px;
          --wiu-height-network-md: 54px;
          --wiu-height-network-lg: 96px;
  
          --wiu-icon-size-network-xs: 12px;
          --wiu-icon-size-network-sm: 16px;
          --wiu-icon-size-network-md: 24px;
          --wiu-icon-size-network-lg: 42px;
  
          --wiu-color-inherit: inherit;
  
          --wiu-color-inverse-100: #fff;
          --wiu-color-inverse-000: #000;
  
          --wiu-cover: rgba(20, 20, 20, 0.8);
  
          --wiu-color-modal-bg: var(--wiu-color-modal-bg-base);
  
          --wiu-color-accent-100: var(--wiu-color-accent-base-100);
          --wiu-color-accent-090: var(--wiu-color-accent-base-090);
          --wiu-color-accent-080: var(--wiu-color-accent-base-080);
  
          --wiu-color-success-100: var(--wiu-color-success-base-100);
          --wiu-color-success-125: var(--wiu-color-success-base-125);
  
          --wiu-color-warning-100: var(--wiu-color-warning-base-100);
  
          --wiu-color-error-100: var(--wiu-color-error-base-100);
          --wiu-color-error-125: var(--wiu-color-error-base-125);
  
          --wiu-color-blue-100: var(--wiu-color-blue-base-100);
          --wiu-color-blue-90: var(--wiu-color-blue-base-90);
  
          --wiu-icon-box-bg-error-100: var(--wiu-icon-box-bg-error-base-100);
          --wiu-icon-box-bg-blue-100: var(--wiu-icon-box-bg-blue-base-100);
          --wiu-icon-box-bg-success-100: var(--wiu-icon-box-bg-success-base-100);
          --wiu-icon-box-bg-inverse-100: var(--wiu-icon-box-bg-inverse-base-100);
  
          --wiu-all-wallets-bg-100: var(--wiu-all-wallets-bg-100);
  
          --wiu-avatar-border: var(--wiu-avatar-border-base);
  
          --wiu-thumbnail-border: var(--wiu-thumbnail-border-base);
  
          --wiu-box-shadow-blue: var(--wiu-color-accent-glass-020);
        }
  
        @supports (background: color-mix(in srgb, white 50%, black)) {
          :root {
            --wiu-color-modal-bg: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-modal-bg-base)
            );
  
            --wiu-box-shadow-blue: color-mix(in srgb, var(--wiu-color-accent-100) 20%, transparent);
  
            --wiu-color-accent-100: color-mix(
              in srgb,
              var(--wiu-color-accent-base-100) 100%,
              transparent
            );
            --wiu-color-accent-090: color-mix(
              in srgb,
              var(--wiu-color-accent-base-100) 90%,
              transparent
            );
            --wiu-color-accent-080: color-mix(
              in srgb,
              var(--wiu-color-accent-base-100) 80%,
              transparent
            );
            --wiu-color-accent-glass-090: color-mix(
              in srgb,
              var(--wiu-color-accent-base-100) 90%,
              transparent
            );
            --wiu-color-accent-glass-080: color-mix(
              in srgb,
              var(--wiu-color-accent-base-100) 80%,
              transparent
            );
            --wiu-color-accent-glass-020: color-mix(
              in srgb,
              var(--wiu-color-accent-base-100) 20%,
              transparent
            );
            --wiu-color-accent-glass-015: color-mix(
              in srgb,
              var(--wiu-color-accent-base-100) 15%,
              transparent
            );
            --wiu-color-accent-glass-010: color-mix(
              in srgb,
              var(--wiu-color-accent-base-100) 10%,
              transparent
            );
            --wiu-color-accent-glass-005: color-mix(
              in srgb,
              var(--wiu-color-accent-base-100) 5%,
              transparent
            );
            --wiu-color-accent-002: color-mix(
              in srgb,
              var(--wiu-color-accent-base-100) 2%,
              transparent
            );
  
            --wiu-color-fg-100: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-fg-100)
            );
            --wiu-color-fg-125: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-fg-125)
            );
            --wiu-color-fg-150: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-fg-150)
            );
            --wiu-color-fg-175: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-fg-175)
            );
            --wiu-color-fg-200: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-fg-200)
            );
            --wiu-color-fg-225: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-fg-225)
            );
            --wiu-color-fg-250: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-fg-250)
            );
            --wiu-color-fg-275: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-fg-275)
            );
            --wiu-color-fg-300: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-fg-300)
            );
            --wiu-color-fg-325: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-fg-325)
            );
            --wiu-color-fg-350: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-fg-350)
            );
  
            --wiu-color-bg-100: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-bg-100)
            );
            --wiu-color-bg-125: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-bg-125)
            );
            --wiu-color-bg-150: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-bg-150)
            );
            --wiu-color-bg-175: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-bg-175)
            );
            --wiu-color-bg-200: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-bg-200)
            );
            --wiu-color-bg-225: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-bg-225)
            );
            --wiu-color-bg-250: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-bg-250)
            );
            --wiu-color-bg-275: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-bg-275)
            );
            --wiu-color-bg-300: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-bg-300)
            );
            --wiu-color-bg-325: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-bg-325)
            );
            --wiu-color-bg-350: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-bg-350)
            );
  
            --wiu-color-success-100: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-success-base-100)
            );
            --wiu-color-success-125: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-success-base-125)
            );
  
            --wiu-color-warning-100: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-warning-base-100)
            );
  
            --wiu-color-error-100: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-error-base-100)
            );
            --wiu-color-blue-100: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-blue-base-100)
            );
            --wiu-color-blue-90: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-blue-base-90)
            );
            --wiu-color-error-125: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-color-error-base-125)
            );
  
            --wiu-icon-box-bg-error-100: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-icon-box-bg-error-base-100)
            );
            --wiu-icon-box-bg-accent-100: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-icon-box-bg-blue-base-100)
            );
            --wiu-icon-box-bg-success-100: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-icon-box-bg-success-base-100)
            );
            --wiu-icon-box-bg-inverse-100: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-icon-box-bg-inverse-base-100)
            );
  
            --wiu-all-wallets-bg-100: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-all-wallets-bg-100)
            );
  
            --wiu-avatar-border: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-avatar-border-base)
            );
  
            --wiu-thumbnail-border: color-mix(
              in srgb,
              var(--w4m-color-mix) var(--w4m-color-mix-strength),
              var(--wiu-thumbnail-border-base)
            );
          }
        }
      `,
      light: Re`
        :root {
          --w4m-color-mix: ${ha(t?.["--w4m-color-mix"]||"#fff")};
          --w4m-accent: ${ha(Tu(t,"dark")["--w4m-accent"])};
          --w4m-default: #fff;
  
          --wiu-color-modal-bg-base: ${ha(Tu(t,"dark")["--w4m-background"])};
          --wiu-color-accent-base-100: var(--w4m-accent);
  
          --wiu-color-blueberry-100: hsla(230, 100%, 67%, 1);
          --wiu-color-blueberry-090: hsla(231, 76%, 61%, 1);
          --wiu-color-blueberry-080: hsla(230, 59%, 55%, 1);
          --wiu-color-blueberry-050: hsla(231, 100%, 70%, 0.1);
  
          --wiu-color-fg-100: #e4e7e7;
          --wiu-color-fg-125: #d0d5d5;
          --wiu-color-fg-150: #a8b1b1;
          --wiu-color-fg-175: #a8b0b0;
          --wiu-color-fg-200: #949e9e;
          --wiu-color-fg-225: #868f8f;
          --wiu-color-fg-250: #788080;
          --wiu-color-fg-275: #788181;
          --wiu-color-fg-300: #6e7777;
          --wiu-color-fg-325: #9a9a9a;
          --wiu-color-fg-350: #363636;
  
          --wiu-color-bg-100: #141414;
          --wiu-color-bg-125: #191a1a;
          --wiu-color-bg-150: #1e1f1f;
          --wiu-color-bg-175: #222525;
          --wiu-color-bg-200: #272a2a;
          --wiu-color-bg-225: #2c3030;
          --wiu-color-bg-250: #313535;
          --wiu-color-bg-275: #363b3b;
          --wiu-color-bg-300: #3b4040;
          --wiu-color-bg-325: #252525;
          --wiu-color-bg-350: #ffffff;
  
          --wiu-color-success-base-100: #26d962;
          --wiu-color-success-base-125: #30a46b;
  
          --wiu-color-warning-base-100: #f3a13f;
  
          --wiu-color-error-base-100: #f25a67;
          --wiu-color-error-base-125: #df4a34;
  
          --wiu-color-blue-base-100: rgba(102, 125, 255, 1);
          --wiu-color-blue-base-90: rgba(102, 125, 255, 0.9);
  
          --wiu-color-success-glass-001: rgba(38, 217, 98, 0.01);
          --wiu-color-success-glass-002: rgba(38, 217, 98, 0.02);
          --wiu-color-success-glass-005: rgba(38, 217, 98, 0.05);
          --wiu-color-success-glass-010: rgba(38, 217, 98, 0.1);
          --wiu-color-success-glass-015: rgba(38, 217, 98, 0.15);
          --wiu-color-success-glass-020: rgba(38, 217, 98, 0.2);
          --wiu-color-success-glass-025: rgba(38, 217, 98, 0.25);
          --wiu-color-success-glass-030: rgba(38, 217, 98, 0.3);
          --wiu-color-success-glass-060: rgba(38, 217, 98, 0.6);
          --wiu-color-success-glass-080: rgba(38, 217, 98, 0.8);
  
          --wiu-color-success-glass-reown-020: rgba(48, 164, 107, 0.2);
  
          --wiu-color-warning-glass-reown-020: rgba(243, 161, 63, 0.2);
  
          --wiu-color-error-glass-001: rgba(242, 90, 103, 0.01);
          --wiu-color-error-glass-002: rgba(242, 90, 103, 0.02);
          --wiu-color-error-glass-005: rgba(242, 90, 103, 0.05);
          --wiu-color-error-glass-010: rgba(242, 90, 103, 0.1);
          --wiu-color-error-glass-015: rgba(242, 90, 103, 0.15);
          --wiu-color-error-glass-020: rgba(242, 90, 103, 0.2);
          --wiu-color-error-glass-025: rgba(242, 90, 103, 0.25);
          --wiu-color-error-glass-030: rgba(242, 90, 103, 0.3);
          --wiu-color-error-glass-060: rgba(242, 90, 103, 0.6);
          --wiu-color-error-glass-080: rgba(242, 90, 103, 0.8);
  
          --wiu-color-error-glass-reown-020: rgba(223, 74, 52, 0.2);
  
          --wiu-color-gray-glass-001: rgba(255, 255, 255, 0.01);
          --wiu-color-gray-glass-002: rgba(255, 255, 255, 0.02);
          --wiu-color-gray-glass-005: rgba(255, 255, 255, 0.05);
          --wiu-color-gray-glass-010: rgba(255, 255, 255, 0.1);
          --wiu-color-gray-glass-015: rgba(255, 255, 255, 0.15);
          --wiu-color-gray-glass-020: rgba(255, 255, 255, 0.2);
          --wiu-color-gray-glass-025: rgba(255, 255, 255, 0.25);
          --wiu-color-gray-glass-030: rgba(255, 255, 255, 0.3);
          --wiu-color-gray-glass-060: rgba(255, 255, 255, 0.6);
          --wiu-color-gray-glass-080: rgba(255, 255, 255, 0.8);
          --wiu-color-gray-glass-090: rgba(255, 255, 255, 0.9);
  
          --wiu-color-dark-glass-100: rgba(42, 42, 42, 1);
  
          --wiu-icon-box-bg-error-base-100: #3c2426;
          --wiu-icon-box-bg-blue-base-100: #20303f;
          --wiu-icon-box-bg-success-base-100: #1f3a28;
          --wiu-icon-box-bg-inverse-base-100: #243240;
  
          --wiu-all-wallets-bg-100: #222b35;
  
          --wiu-avatar-border-base: #252525;
  
          --wiu-thumbnail-border-base: #252525;
        }
      `,
      dark: Re`
        :root {
          --w4m-color-mix: ${ha(t?.["--w4m-color-mix"]||"#000")};
          --w4m-accent: ${ha(Tu(t,"light")["--w4m-accent"])};
          --w4m-default: #000;
  
          --wiu-color-modal-bg-base: ${ha(Tu(t,"light")["--w4m-background"])};
          --wiu-color-accent-base-100: var(--w4m-accent);
  
          --wiu-color-blueberry-100: hsla(231, 100%, 70%, 1);
          --wiu-color-blueberry-090: hsla(231, 97%, 72%, 1);
          --wiu-color-blueberry-080: hsla(231, 92%, 74%, 1);
  
          --wiu-color-fg-100: #141414;
          --wiu-color-fg-125: #2d3131;
          --wiu-color-fg-150: #474d4d;
          --wiu-color-fg-175: #636d6d;
          --wiu-color-fg-200: #798686;
          --wiu-color-fg-225: #828f8f;
          --wiu-color-fg-250: #8b9797;
          --wiu-color-fg-275: #95a0a0;
          --wiu-color-fg-300: #9ea9a9;
          --wiu-color-fg-325: #9a9a9a;
          --wiu-color-fg-350: #d0d0d0;
  
          --wiu-color-bg-100: #ffffff;
          --wiu-color-bg-125: #f5fafa;
          --wiu-color-bg-150: #f3f8f8;
          --wiu-color-bg-175: #eef4f4;
          --wiu-color-bg-200: #eaf1f1;
          --wiu-color-bg-225: #e5eded;
          --wiu-color-bg-250: #e1e9e9;
          --wiu-color-bg-275: #dce7e7;
          --wiu-color-bg-300: #d8e3e3;
          --wiu-color-bg-325: #f3f3f3;
          --wiu-color-bg-350: #202020;
  
          --wiu-color-success-base-100: #26b562;
          --wiu-color-success-base-125: #30a46b;
  
          --wiu-color-warning-base-100: #f3a13f;
  
          --wiu-color-error-base-100: #f05142;
          --wiu-color-error-base-125: #df4a34;
  
          --wiu-color-blue-base-100: rgba(102, 125, 255, 1);
          --wiu-color-blue-base-90: rgba(102, 125, 255, 0.9);
  
          --wiu-color-success-glass-001: rgba(38, 181, 98, 0.01);
          --wiu-color-success-glass-002: rgba(38, 181, 98, 0.02);
          --wiu-color-success-glass-005: rgba(38, 181, 98, 0.05);
          --wiu-color-success-glass-010: rgba(38, 181, 98, 0.1);
          --wiu-color-success-glass-015: rgba(38, 181, 98, 0.15);
          --wiu-color-success-glass-020: rgba(38, 181, 98, 0.2);
          --wiu-color-success-glass-025: rgba(38, 181, 98, 0.25);
          --wiu-color-success-glass-030: rgba(38, 181, 98, 0.3);
          --wiu-color-success-glass-060: rgba(38, 181, 98, 0.6);
          --wiu-color-success-glass-080: rgba(38, 181, 98, 0.8);
  
          --wiu-color-success-glass-reown-020: rgba(48, 164, 107, 0.2);
  
          --wiu-color-warning-glass-reown-020: rgba(243, 161, 63, 0.2);
  
          --wiu-color-error-glass-001: rgba(240, 81, 66, 0.01);
          --wiu-color-error-glass-002: rgba(240, 81, 66, 0.02);
          --wiu-color-error-glass-005: rgba(240, 81, 66, 0.05);
          --wiu-color-error-glass-010: rgba(240, 81, 66, 0.1);
          --wiu-color-error-glass-015: rgba(240, 81, 66, 0.15);
          --wiu-color-error-glass-020: rgba(240, 81, 66, 0.2);
          --wiu-color-error-glass-025: rgba(240, 81, 66, 0.25);
          --wiu-color-error-glass-030: rgba(240, 81, 66, 0.3);
          --wiu-color-error-glass-060: rgba(240, 81, 66, 0.6);
          --wiu-color-error-glass-080: rgba(240, 81, 66, 0.8);
  
          --wiu-color-error-glass-reown-020: rgba(223, 74, 52, 0.2);
  
          --wiu-icon-box-bg-error-base-100: #f4dfdd;
          --wiu-icon-box-bg-blue-base-100: #d9ecfb;
          --wiu-icon-box-bg-success-base-100: #daf0e4;
          --wiu-icon-box-bg-inverse-base-100: #dcecfc;
  
          --wiu-all-wallets-bg-100: #e8f1fa;
  
          --wiu-avatar-border-base: #f3f4f4;
  
          --wiu-thumbnail-border-base: #eaefef;
  
          --wiu-color-gray-glass-001: rgba(0, 0, 0, 0.01);
          --wiu-color-gray-glass-002: rgba(0, 0, 0, 0.02);
          --wiu-color-gray-glass-005: rgba(0, 0, 0, 0.05);
          --wiu-color-gray-glass-010: rgba(0, 0, 0, 0.1);
          --wiu-color-gray-glass-015: rgba(0, 0, 0, 0.15);
          --wiu-color-gray-glass-020: rgba(0, 0, 0, 0.2);
          --wiu-color-gray-glass-025: rgba(0, 0, 0, 0.25);
          --wiu-color-gray-glass-030: rgba(0, 0, 0, 0.3);
          --wiu-color-gray-glass-060: rgba(0, 0, 0, 0.6);
          --wiu-color-gray-glass-080: rgba(0, 0, 0, 0.8);
          --wiu-color-gray-glass-090: rgba(0, 0, 0, 0.9);
  
          --wiu-color-dark-glass-100: rgba(233, 233, 233, 1);
        }
      `
    }
  }
  const ft = Re`
    *,
    *::after,
    *::before,
    :host {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-style: normal;
      text-rendering: optimizeSpeed;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      -webkit-tap-highlight-color: transparent;
      font-family: var(--wiu-font-family);
      backface-visibility: hidden;
    }
  `,
    ir = Re`
    button,
    a {
      cursor: pointer;
      display: flex;
      justify-content: center;
      align-items: center;
      position: relative;
      transition:
        color var(--wiu-duration-lg) var(--wiu-ease-out-power-1),
        background-color var(--wiu-duration-lg) var(--wiu-ease-out-power-1),
        border var(--wiu-duration-lg) var(--wiu-ease-out-power-1),
        box-shadow var(--wiu-duration-lg) var(--wiu-ease-out-power-1);
      will-change: background-color, color, border, box-shadow;
      outline: none;
      border: none;
      column-gap: var(--wiu-spacing-3xs);
      background-color: transparent;
      text-decoration: none;
    }
  
    button:disabled > wiu-wallet-image,
    button:disabled > wiu-all-wallets-image,
    button:disabled > wiu-network-image,
    button:disabled > wiu-image,
    button:disabled > wiu-transaction-visual,
    button:disabled > wiu-logo {
      filter: grayscale(1);
    }
  
    @media (hover: hover) and (pointer: fine) {
      button:hover:enabled {
        background-color: var(--wiu-color-gray-glass-005);
      }
  
      button:active:enabled {
        background-color: var(--wiu-color-gray-glass-010);
      }
    }
  
    button:disabled > wiu-icon-box {
      opacity: 0.5;
    }
  
    input {
      border: none;
      outline: none;
      appearance: none;
    }
  `,
    d2 = Re`
    .wiu-color-inherit {
      color: var(--wiu-color-inherit);
    }
  
    .wiu-color-accent-100 {
      color: var(--wiu-color-accent-100);
    }
  
    .wiu-color-error-100 {
      color: var(--wiu-color-error-100);
    }
  
    .wiu-color-blue-100 {
      color: var(--wiu-color-blue-100);
    }
  
    .wiu-color-blue-90 {
      color: var(--wiu-color-blue-90);
    }
  
    .wiu-color-error-125 {
      color: var(--wiu-color-error-125);
    }
  
    .wiu-color-success-100 {
      color: var(--wiu-color-success-100);
    }
  
    .wiu-color-success-125 {
      color: var(--wiu-color-success-125);
    }
  
    .wiu-color-inverse-100 {
      color: var(--wiu-color-inverse-100);
    }
  
    .wiu-color-inverse-000 {
      color: var(--wiu-color-inverse-000);
    }
  
    .wiu-color-fg-100 {
      color: var(--wiu-color-fg-100);
    }
  
    .wiu-color-fg-200 {
      color: var(--wiu-color-fg-200);
    }
  
    .wiu-color-fg-300 {
      color: var(--wiu-color-fg-300);
    }
  
    .wiu-color-fg-325 {
      color: var(--wiu-color-fg-325);
    }
  
    .wiu-color-fg-350 {
      color: var(--wiu-color-fg-350);
    }
  
    .wiu-bg-color-inherit {
      background-color: var(--wiu-color-inherit);
    }
  
    .wiu-bg-color-blue-100 {
      background-color: var(--wiu-color-accent-100);
    }
  
    .wiu-bg-color-error-100 {
      background-color: var(--wiu-color-error-100);
    }
  
    .wiu-bg-color-error-125 {
      background-color: var(--wiu-color-error-125);
    }
  
    .wiu-bg-color-success-100 {
      background-color: var(--wiu-color-success-100);
    }
  
    .wiu-bg-color-success-125 {
      background-color: var(--wiu-color-success-100);
    }
  
    .wiu-bg-color-inverse-100 {
      background-color: var(--wiu-color-inverse-100);
    }
  
    .wiu-bg-color-inverse-000 {
      background-color: var(--wiu-color-inverse-000);
    }
  
    .wiu-bg-color-fg-100 {
      background-color: var(--wiu-color-fg-100);
    }
  
    .wiu-bg-color-fg-200 {
      background-color: var(--wiu-color-fg-200);
    }
  
    .wiu-bg-color-fg-300 {
      background-color: var(--wiu-color-fg-300);
    }
  
    .wiu-color-fg-325 {
      background-color: var(--wiu-color-fg-325);
    }
  
    .wiu-color-fg-350 {
      background-color: var(--wiu-color-fg-350);
    }
  `;

  function Aoe(t, e) {
    const {
      kind: r,
      elements: n
    } = e;
    return {
      kind: r,
      elements: n,
      finisher(i) {
        customElements.get(t) || customElements.define(t, i)
      }
    }
  }

  function Soe(t, e) {
    return customElements.get(t) || customElements.define(t, e), e
  }

  function ye(t) {
    return function (r) {
      return typeof r == "function" ? Soe(t, r) : Aoe(t, r)
    }
  }
  const Ioe = Re`
    :host {
      display: block;
      border-radius: clamp(0px, var(--wiu-border-radius-l), 44px);
      box-shadow: 0 0 0 1px var(--wiu-color-gray-glass-005);
      background-color: var(--wiu-color-modal-bg);
      overflow: hidden;
    }
  `;
  var Toe = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Hy = class extends _e {
    render() {
      return K`<slot></slot>`
    }
  };
  Hy.styles = [ft, Ioe], Hy = Toe([ye("wiu-card")], Hy);
  /**
   * @license
   * Copyright 2017 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  const koe = {
      attribute: !0,
      type: String,
      converter: Ly,
      reflect: !1,
      hasChanged: X9
    },
    Roe = (t = koe, e, r) => {
      const {
        kind: n,
        metadata: i
      } = r;
      let s = globalThis.litPropertyMetadata.get(i);
      if (s === void 0 && globalThis.litPropertyMetadata.set(i, s = new Map), s.set(r.name, t), n === "accessor") {
        const {
          name: o
        } = r;
        return {
          set(a) {
            const c = e.get.call(this);
            e.set.call(this, a), this.requestUpdate(o, c, t)
          },
          init(a) {
            return a !== void 0 && this.P(o, void 0, t), a
          }
        }
      }
      if (n === "setter") {
        const {
          name: o
        } = r;
        return function (a) {
          const c = this[o];
          e.call(this, a), this.requestUpdate(o, c, t)
        }
      }
      throw Error("Unsupported decorator location: " + n)
    };

  function re(t) {
    return (e, r) => typeof r == "object" ? Roe(t, e, r) : ((n, i, s) => {
      const o = i.hasOwnProperty(s);
      return i.constructor.createProperty(s, o ? {
        ...n,
        wrapped: !0
      } : n), o ? Object.getOwnPropertyDescriptor(i, s) : void 0
    })(t, e, r)
  }
  /**
   * @license
   * Copyright 2017 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  function le(t) {
    return re({
      ...t,
      state: !0,
      attribute: !1
    })
  }
  const Noe = Re`
    :host {
      display: flex;
      aspect-ratio: 1 / 1;
      color: var(--local-color);
      width: var(--local-width);
    }
  
    svg {
      width: inherit;
      height: inherit;
      object-fit: contain;
      object-position: center;
    }
  `,
    Moe = Ke`<svg
    width="14"
    height="14"
    viewBox="0 0 14 14"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
  >
    <path
      fill="currentColor"
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M7.0023 0.875C7.48571 0.875 7.8776 1.26675 7.8776 1.75V6.125H12.2541C12.7375 6.125 13.1294 6.51675 13.1294 7C13.1294 7.48325 12.7375 7.875 12.2541 7.875H7.8776V12.25C7.8776 12.7332 7.48571 13.125 7.0023 13.125C6.51889 13.125 6.12701 12.7332 6.12701 12.25V7.875H1.75054C1.26713 7.875 0.875244 7.48325 0.875244 7C0.875244 6.51675 1.26713 6.125 1.75054 6.125H6.12701V1.75C6.12701 1.26675 6.51889 0.875 7.0023 0.875Z"
      fill="#667dff"
    /></svg
  >`,
    Poe = Ke`<svg fill="none" viewBox="0 0 24 24">
    <path
      style="fill: var(--wiu-color-accent-100);"
      d="M10.2 6.6a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0ZM21 6.6a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0ZM10.2 17.4a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0ZM21 17.4a3.6 3.6 0 1 1-7.2 0 3.6 3.6 0 0 1 7.2 0Z"
    />
  </svg>`,
    $oe = Ke`<svg
    fill="none"
    viewBox="0 0 21 20"
  >
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M10.5 2.42908C6.31875 2.42908 2.92859 5.81989 2.92859 10.0034C2.92859 14.1869 6.31875 17.5777 10.5 17.5777C14.6813 17.5777 18.0714 14.1869 18.0714 10.0034C18.0714 5.81989 14.6813 2.42908 10.5 2.42908ZM0.928589 10.0034C0.928589 4.71596 5.21355 0.429077 10.5 0.429077C15.7865 0.429077 20.0714 4.71596 20.0714 10.0034C20.0714 15.2908 15.7865 19.5777 10.5 19.5777C5.21355 19.5777 0.928589 15.2908 0.928589 10.0034ZM10.5 5.75003C11.0523 5.75003 11.5 6.19774 11.5 6.75003L11.5 10.8343L12.7929 9.54137C13.1834 9.15085 13.8166 9.15085 14.2071 9.54137C14.5976 9.9319 14.5976 10.5651 14.2071 10.9556L11.2071 13.9556C10.8166 14.3461 10.1834 14.3461 9.79291 13.9556L6.79291 10.9556C6.40239 10.5651 6.40239 9.9319 6.79291 9.54137C7.18343 9.15085 7.8166 9.15085 8.20712 9.54137L9.50002 10.8343L9.50002 6.75003C9.50002 6.19774 9.94773 5.75003 10.5 5.75003Z"
      clip-rule="evenodd"
    /></svg
  >`,
    Ooe = Ke`
  <svg width="36" height="36">
    <path
      d="M28.724 0H7.271A7.269 7.269 0 0 0 0 7.272v21.46A7.268 7.268 0 0 0 7.271 36H28.73A7.272 7.272 0 0 0 36 28.728V7.272A7.275 7.275 0 0 0 28.724 0Z"
      fill="url(#a)"
    />
    <path
      d="m17.845 8.271.729-1.26a1.64 1.64 0 1 1 2.843 1.638l-7.023 12.159h5.08c1.646 0 2.569 1.935 1.853 3.276H6.434a1.632 1.632 0 0 1-1.638-1.638c0-.909.73-1.638 1.638-1.638h4.176l5.345-9.265-1.67-2.898a1.642 1.642 0 0 1 2.844-1.638l.716 1.264Zm-6.317 17.5-1.575 2.732a1.64 1.64 0 1 1-2.844-1.638l1.17-2.025c1.323-.41 2.398-.095 3.249.931Zm13.56-4.954h4.262c.909 0 1.638.729 1.638 1.638 0 .909-.73 1.638-1.638 1.638h-2.367l1.597 2.772c.45.788.185 1.782-.602 2.241a1.642 1.642 0 0 1-2.241-.603c-2.69-4.666-4.711-8.159-6.052-10.485-1.372-2.367-.391-4.743.576-5.549 1.075 1.846 2.682 4.631 4.828 8.348Z"
      fill="#fff"
    />
    <defs>
      <linearGradient id="a" x1="18" y1="0" x2="18" y2="36" gradientUnits="userSpaceOnUse">
        <stop stop-color="#18BFFB" />
        <stop offset="1" stop-color="#2072F3" />
      </linearGradient>
    </defs>
  </svg>`,
    Doe = Ke`<svg fill="none" viewBox="0 0 40 40">
    <g clip-path="url(#a)">
      <g clip-path="url(#b)">
        <circle cx="20" cy="19.89" r="20" fill="#000" />
        <g clip-path="url(#c)">
          <path
            fill="#fff"
            d="M28.77 23.3c-.69 1.99-2.75 5.52-4.87 5.56-1.4.03-1.86-.84-3.46-.84-1.61 0-2.12.81-3.45.86-2.25.1-5.72-5.1-5.72-9.62 0-4.15 2.9-6.2 5.42-6.25 1.36-.02 2.64.92 3.47.92.83 0 2.38-1.13 4.02-.97.68.03 2.6.28 3.84 2.08-3.27 2.14-2.76 6.61.75 8.25ZM24.2 7.88c-2.47.1-4.49 2.69-4.2 4.84 2.28.17 4.47-2.39 4.2-4.84Z"
          />
        </g>
      </g>
    </g>
    <defs>
      <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
      <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
      <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
    </defs>
  </svg>`,
    Loe = Ke`<svg fill="none" viewBox="0 0 14 15">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M7 1.99a1 1 0 0 1 1 1v7.58l2.46-2.46a1 1 0 0 1 1.41 1.42L7.7 13.69a1 1 0 0 1-1.41 0L2.12 9.53A1 1 0 0 1 3.54 8.1L6 10.57V3a1 1 0 0 1 1-1Z"
      clip-rule="evenodd"
    />
  </svg>`,
    Boe = Ke`<svg fill="none" viewBox="0 0 14 15">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M13 7.99a1 1 0 0 1-1 1H4.4l2.46 2.46a1 1 0 1 1-1.41 1.41L1.29 8.7a1 1 0 0 1 0-1.41L5.46 3.1a1 1 0 0 1 1.41 1.42L4.41 6.99H12a1 1 0 0 1 1 1Z"
      clip-rule="evenodd"
    />
  </svg>`,
    Uoe = Ke`<svg fill="none" viewBox="0 0 14 15">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M1 7.99a1 1 0 0 1 1-1h7.58L7.12 4.53A1 1 0 1 1 8.54 3.1l4.16 4.17a1 1 0 0 1 0 1.41l-4.16 4.17a1 1 0 1 1-1.42-1.41l2.46-2.46H2a1 1 0 0 1-1-1Z"
      clip-rule="evenodd"
    />
  </svg>`,
    joe = Ke`<svg fill="none" viewBox="0 0 14 15">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M7 13.99a1 1 0 0 1-1-1V5.4L3.54 7.86a1 1 0 0 1-1.42-1.41L6.3 2.28a1 1 0 0 1 1.41 0l4.17 4.17a1 1 0 1 1-1.41 1.41L8 5.4v7.59a1 1 0 0 1-1 1Z"
      clip-rule="evenodd"
    />
  </svg>`,
    Foe = Ke`<svg
    xmlns="http://www.w3.org/2000/svg"
    width="12"
    height="13"
    viewBox="0 0 12 13"
    fill="none"
  >
    <path
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M5.61391 1.57124C5.85142 1.42873 6.14813 1.42873 6.38564 1.57124L11.0793 4.38749C11.9179 4.89067 11.5612 6.17864 10.5832 6.17864H9.96398V10.0358H10.2854C10.6996 10.0358 11.0354 10.3716 11.0354 10.7858C11.0354 11.2 10.6996 11.5358 10.2854 11.5358H1.71416C1.29995 11.5358 0.964172 11.2 0.964172 10.7858C0.964172 10.3716 1.29995 10.0358 1.71416 10.0358H2.03558L2.03558 6.17864H1.41637C0.438389 6.17864 0.0816547 4.89066 0.920263 4.38749L5.61391 1.57124ZM3.53554 6.17864V10.0358H5.24979V6.17864H3.53554ZM6.74976 6.17864V10.0358H8.46401V6.17864H6.74976ZM8.64913 4.67864H3.35043L5.99978 3.089L8.64913 4.67864Z"
      fill="currentColor"
    /></svg
  >`,
    Woe = Ke`<svg fill="none" viewBox="0 0 20 20">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M4 6.4a1 1 0 0 1-.46.89 6.98 6.98 0 0 0 .38 6.18A7 7 0 0 0 16.46 7.3a1 1 0 0 1-.47-.92 7 7 0 0 0-12 .03Zm-2.02-.5a9 9 0 1 1 16.03 8.2A9 9 0 0 1 1.98 5.9Z"
      clip-rule="evenodd"
    />
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M6.03 8.63c-1.46-.3-2.72-.75-3.6-1.35l-.02-.01-.14-.11a1 1 0 0 1 1.2-1.6l.1.08c.6.4 1.52.74 2.69 1 .16-.99.39-1.88.67-2.65.3-.79.68-1.5 1.15-2.02A2.58 2.58 0 0 1 9.99 1c.8 0 1.45.44 1.92.97.47.52.84 1.23 1.14 2.02.29.77.52 1.66.68 2.64a8 8 0 0 0 2.7-1l.26-.18h.48a1 1 0 0 1 .12 2c-.86.51-2.01.91-3.34 1.18a22.24 22.24 0 0 1-.03 3.19c1.45.29 2.7.73 3.58 1.31a1 1 0 0 1-1.1 1.68c-.6-.4-1.56-.76-2.75-1-.15.8-.36 1.55-.6 2.2-.3.79-.67 1.5-1.14 2.02-.47.53-1.12.97-1.92.97-.8 0-1.45-.44-1.91-.97a6.51 6.51 0 0 1-1.15-2.02c-.24-.65-.44-1.4-.6-2.2-1.18.24-2.13.6-2.73.99a1 1 0 1 1-1.1-1.67c.88-.58 2.12-1.03 3.57-1.31a22.03 22.03 0 0 1-.04-3.2Zm2.2-1.7c.15-.86.34-1.61.58-2.24.24-.65.51-1.12.76-1.4.25-.28.4-.29.42-.29.03 0 .17.01.42.3.25.27.52.74.77 1.4.23.62.43 1.37.57 2.22a19.96 19.96 0 0 1-3.52 0Zm-.18 4.6a20.1 20.1 0 0 1-.03-2.62 21.95 21.95 0 0 0 3.94 0 20.4 20.4 0 0 1-.03 2.63 21.97 21.97 0 0 0-3.88 0Zm.27 2c.13.66.3 1.26.49 1.78.24.65.51 1.12.76 1.4.25.28.4.29.42.29.03 0 .17-.01.42-.3.25-.27.52-.74.77-1.4.19-.5.36-1.1.49-1.78a20.03 20.03 0 0 0-3.35 0Z"
      clip-rule="evenodd"
    />
  </svg>`,
    zoe = Ke`<svg
    xmlns="http://www.w3.org/2000/svg"
    width="12"
    height="13"
    viewBox="0 0 12 13"
    fill="none"
  >
    <path
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M4.16072 2C4.17367 2 4.18665 2 4.19968 2L7.83857 2C8.36772 1.99998 8.82398 1.99996 9.19518 2.04018C9.5895 2.0829 9.97577 2.17811 10.3221 2.42971C10.5131 2.56849 10.6811 2.73647 10.8198 2.92749C11.0714 3.27379 11.1666 3.66007 11.2094 4.0544C11.2496 4.42561 11.2496 4.88188 11.2495 5.41105V7.58896C11.2496 8.11812 11.2496 8.57439 11.2094 8.94561C11.1666 9.33994 11.0714 9.72621 10.8198 10.0725C10.6811 10.2635 10.5131 10.4315 10.3221 10.5703C9.97577 10.8219 9.5895 10.9171 9.19518 10.9598C8.82398 11 8.36772 11 7.83856 11H4.16073C3.63157 11 3.17531 11 2.80411 10.9598C2.40979 10.9171 2.02352 10.8219 1.67722 10.5703C1.48621 10.4315 1.31824 10.2635 1.17946 10.0725C0.927858 9.72621 0.832652 9.33994 0.78993 8.94561C0.749713 8.5744 0.749733 8.11813 0.749757 7.58896L0.749758 5.45C0.749758 5.43697 0.749758 5.42399 0.749757 5.41104C0.749733 4.88188 0.749713 4.42561 0.78993 4.0544C0.832652 3.66007 0.927858 3.27379 1.17946 2.92749C1.31824 2.73647 1.48621 2.56849 1.67722 2.42971C2.02352 2.17811 2.40979 2.0829 2.80411 2.04018C3.17531 1.99996 3.63157 1.99998 4.16072 2ZM2.96567 3.53145C2.69897 3.56034 2.60687 3.60837 2.55888 3.64324C2.49521 3.6895 2.43922 3.74549 2.39296 3.80916C2.35809 3.85715 2.31007 3.94926 2.28117 4.21597C2.26629 4.35335 2.25844 4.51311 2.25431 4.70832H9.74498C9.74085 4.51311 9.733 4.35335 9.71812 4.21597C9.68922 3.94926 9.6412 3.85715 9.60633 3.80916C9.56007 3.74549 9.50408 3.6895 9.44041 3.64324C9.39242 3.60837 9.30031 3.56034 9.03362 3.53145C8.75288 3.50103 8.37876 3.5 7.79961 3.5H4.19968C3.62053 3.5 3.24641 3.50103 2.96567 3.53145ZM9.74956 6.20832H2.24973V7.55C2.24973 8.12917 2.25076 8.5033 2.28117 8.78404C2.31007 9.05074 2.35809 9.14285 2.39296 9.19084C2.43922 9.25451 2.49521 9.31051 2.55888 9.35677C2.60687 9.39163 2.69897 9.43966 2.96567 9.46856C3.24641 9.49897 3.62053 9.5 4.19968 9.5H7.79961C8.37876 9.5 8.75288 9.49897 9.03362 9.46856C9.30032 9.43966 9.39242 9.39163 9.44041 9.35677C9.50408 9.31051 9.56007 9.25451 9.60633 9.19084C9.6412 9.14285 9.68922 9.05075 9.71812 8.78404C9.74854 8.5033 9.74956 8.12917 9.74956 7.55V6.20832ZM6.74963 8C6.74963 7.58579 7.08541 7.25 7.49961 7.25H8.2496C8.6638 7.25 8.99958 7.58579 8.99958 8C8.99958 8.41422 8.6638 8.75 8.2496 8.75H7.49961C7.08541 8.75 6.74963 8.41422 6.74963 8Z"
      fill="currentColor"
    /></svg
  >`,
    Hoe = Ke`<svg fill="none" viewBox="0 0 14 14">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M12.9576 2.23383C13.3807 2.58873 13.4361 3.21947 13.0812 3.64263L6.37159 11.6426C6.19161 11.8572 5.92989 11.9865 5.65009 11.999C5.3703 12.0115 5.09808 11.9062 4.89965 11.7085L0.979321 7.80331C0.588042 7.41354 0.586817 6.78038 0.976585 6.3891C1.36635 5.99782 1.99952 5.99659 2.3908 6.38636L5.53928 9.52268L11.5488 2.35742C11.9037 1.93426 12.5344 1.87893 12.9576 2.23383Z"
      clip-rule="evenodd"
    />
  </svg>`,
    qoe = Ke`<svg
    width="28"
    height="28"
    viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg">
    <path
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M25.5297 4.92733C26.1221 5.4242 26.1996 6.30724 25.7027 6.89966L12.2836 22.8997C12.0316 23.2001 11.6652 23.3811 11.2735 23.3986C10.8817 23.4161 10.5006 23.2686 10.2228 22.9919L2.38218 15.1815C1.83439 14.6358 1.83268 13.7494 2.37835 13.2016C2.92403 12.6538 3.81046 12.6521 4.35825 13.1978L11.1183 19.9317L23.5573 5.10036C24.0542 4.50794 24.9372 4.43047 25.5297 4.92733Z"
      fill="currentColor"/>
  </svg>
  `,
    Voe = Ke`<svg fill="none" viewBox="0 0 16 16">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M1.46 4.96a1 1 0 0 1 1.41 0L8 10.09l5.13-5.13a1 1 0 1 1 1.41 1.41l-5.83 5.84a1 1 0 0 1-1.42 0L1.46 6.37a1 1 0 0 1 0-1.41Z"
      clip-rule="evenodd"
    />
  </svg>`,
    Koe = Ke`<svg fill="none" viewBox="0 0 16 16">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M11.04 1.46a1 1 0 0 1 0 1.41L5.91 8l5.13 5.13a1 1 0 1 1-1.41 1.41L3.79 8.71a1 1 0 0 1 0-1.42l5.84-5.83a1 1 0 0 1 1.41 0Z"
      clip-rule="evenodd"
    />
  </svg>`,
    Goe = Ke`<svg fill="none" viewBox="0 0 16 16">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M4.96 14.54a1 1 0 0 1 0-1.41L10.09 8 4.96 2.87a1 1 0 0 1 1.41-1.41l5.84 5.83a1 1 0 0 1 0 1.42l-5.84 5.83a1 1 0 0 1-1.41 0Z"
      clip-rule="evenodd"
    />
  </svg>`,
    Zoe = Ke`<svg fill="none" viewBox="0 0 16 16">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M14.54 11.04a1 1 0 0 1-1.41 0L8 5.92l-5.13 5.12a1 1 0 1 1-1.41-1.41l5.83-5.84a1 1 0 0 1 1.42 0l5.83 5.84a1 1 0 0 1 0 1.41Z"
      clip-rule="evenodd"
    />
  </svg>`,
    Yoe = Ke`<svg width="36" height="36" fill="none">
    <path
      fill="#fff"
      fill-opacity=".05"
      d="M0 14.94c0-5.55 0-8.326 1.182-10.4a9 9 0 0 1 3.359-3.358C6.614 0 9.389 0 14.94 0h6.12c5.55 0 8.326 0 10.4 1.182a9 9 0 0 1 3.358 3.359C36 6.614 36 9.389 36 14.94v6.12c0 5.55 0 8.326-1.182 10.4a9 9 0 0 1-3.359 3.358C29.386 36 26.611 36 21.06 36h-6.12c-5.55 0-8.326 0-10.4-1.182a9 9 0 0 1-3.358-3.359C0 29.386 0 26.611 0 21.06v-6.12Z"
    />
    <path
      stroke="#fff"
      stroke-opacity=".05"
      d="M14.94.5h6.12c2.785 0 4.84 0 6.46.146 1.612.144 2.743.43 3.691.97a8.5 8.5 0 0 1 3.172 3.173c.541.948.826 2.08.971 3.692.145 1.62.146 3.675.146 6.459v6.12c0 2.785 0 4.84-.146 6.46-.145 1.612-.43 2.743-.97 3.691a8.5 8.5 0 0 1-3.173 3.172c-.948.541-2.08.826-3.692.971-1.62.145-3.674.146-6.459.146h-6.12c-2.784 0-4.84 0-6.46-.146-1.612-.145-2.743-.43-3.691-.97a8.5 8.5 0 0 1-3.172-3.173c-.541-.948-.827-2.08-.971-3.692C.5 25.9.5 23.845.5 21.06v-6.12c0-2.784 0-4.84.146-6.46.144-1.612.43-2.743.97-3.691A8.5 8.5 0 0 1 4.79 1.617C5.737 1.076 6.869.79 8.48.646 10.1.5 12.156.5 14.94.5Z"
    />
    <path
      fill="url(#a)"
      d="M17.998 10.8h12.469a14.397 14.397 0 0 0-24.938.001l6.234 10.798.006-.001a7.19 7.19 0 0 1 6.23-10.799Z"
    />
    <path
      fill="url(#b)"
      d="m24.237 21.598-6.234 10.798A14.397 14.397 0 0 0 30.47 10.798H18.002l-.002.006a7.191 7.191 0 0 1 6.237 10.794Z"
    />
    <path
      fill="url(#c)"
      d="M11.765 21.601 5.531 10.803A14.396 14.396 0 0 0 18.001 32.4l6.235-10.798-.004-.004a7.19 7.19 0 0 1-12.466.004Z"
    />
    <path fill="#fff" d="M18 25.2a7.2 7.2 0 1 0 0-14.4 7.2 7.2 0 0 0 0 14.4Z" />
    <path fill="#1A73E8" d="M18 23.7a5.7 5.7 0 1 0 0-11.4 5.7 5.7 0 0 0 0 11.4Z" />
    <defs>
      <linearGradient
        id="a"
        x1="6.294"
        x2="41.1"
        y1="5.995"
        y2="5.995"
        gradientUnits="userSpaceOnUse"
      >
        <stop stop-color="#D93025" />
        <stop offset="1" stop-color="#EA4335" />
      </linearGradient>
      <linearGradient
        id="b"
        x1="20.953"
        x2="37.194"
        y1="32.143"
        y2="2.701"
        gradientUnits="userSpaceOnUse"
      >
        <stop stop-color="#FCC934" />
        <stop offset="1" stop-color="#FBBC04" />
      </linearGradient>
      <linearGradient
        id="c"
        x1="25.873"
        x2="9.632"
        y1="31.2"
        y2="1.759"
        gradientUnits="userSpaceOnUse"
      >
        <stop stop-color="#1E8E3E" />
        <stop offset="1" stop-color="#34A853" />
      </linearGradient>
    </defs>
  </svg>`,
    Qoe = Ke`<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
    <path 
      fill-rule="evenodd" 
      clip-rule="evenodd" 
      d="M7.00235 2C4.24 2 2.00067 4.23858 2.00067 7C2.00067 9.76142 4.24 12 7.00235 12C9.7647 12 12.004 9.76142 12.004 7C12.004 4.23858 9.7647 2 7.00235 2ZM0 7C0 3.13401 3.13506 0 7.00235 0C10.8696 0 14.0047 3.13401 14.0047 7C14.0047 10.866 10.8696 14 7.00235 14C3.13506 14 0 10.866 0 7ZM7.00235 3C7.55482 3 8.00269 3.44771 8.00269 4V6.58579L9.85327 8.43575C10.2439 8.82627 10.2439 9.45944 9.85327 9.84996C9.46262 10.2405 8.82924 10.2405 8.43858 9.84996L6.29501 7.70711C6.10741 7.51957 6.00201 7.26522 6.00201 7V4C6.00201 3.44771 6.44988 3 7.00235 3Z" 
      fill="currentColor"
    />
  </svg>`,
    Joe = Ke`<svg fill="none" viewBox="0 0 16 16">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M2.54 2.54a1 1 0 0 1 1.42 0L8 6.6l4.04-4.05a1 1 0 1 1 1.42 1.42L9.4 8l4.05 4.04a1 1 0 0 1-1.42 1.42L8 9.4l-4.04 4.05a1 1 0 0 1-1.42-1.42L6.6 8 2.54 3.96a1 1 0 0 1 0-1.42Z"
      clip-rule="evenodd"
    />
  </svg>`,
    Xoe = Ke`<svg fill="none" viewBox="0 0 20 20">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M10 3a7 7 0 0 0-6.85 8.44l8.29-8.3C10.97 3.06 10.49 3 10 3Zm3.49.93-9.56 9.56c.32.55.71 1.06 1.16 1.5L15 5.1a7.03 7.03 0 0 0-1.5-1.16Zm2.7 2.8-9.46 9.46a7 7 0 0 0 9.46-9.46ZM1.99 5.9A9 9 0 1 1 18 14.09 9 9 0 0 1 1.98 5.91Z"
      clip-rule="evenodd"
    />
  </svg>`,
    eae = Ke`<svg fill="none" viewBox="0 0 16 16">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2ZM0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm10.66-2.65a1 1 0 0 1 .23 1.06L9.83 9.24a1 1 0 0 1-.59.58l-2.83 1.06A1 1 0 0 1 5.13 9.6l1.06-2.82a1 1 0 0 1 .58-.59L9.6 5.12a1 1 0 0 1 1.06.23ZM7.9 7.89l-.13.35.35-.13.12-.35-.34.13Z"
      clip-rule="evenodd"
    />
  </svg>`,
    tae = Ke`<svg
    xmlns="http://www.w3.org/2000/svg"
    width="16"
    height="16"
    viewBox="0 0 16 16"
    fill="none"
  >
    <path
      fill="currentColor"
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M9.21498 1.28565H10.5944C11.1458 1.28562 11.6246 1.2856 12.0182 1.32093C12.4353 1.35836 12.853 1.44155 13.2486 1.66724C13.7005 1.92498 14.0749 2.29935 14.3326 2.75122C14.5583 3.14689 14.6415 3.56456 14.6789 3.9817C14.7143 4.37531 14.7142 4.85403 14.7142 5.40545V6.78489C14.7142 7.33631 14.7143 7.81503 14.6789 8.20865C14.6415 8.62578 14.5583 9.04345 14.3326 9.43912C14.0749 9.89099 13.7005 10.2654 13.2486 10.5231C12.853 10.7488 12.4353 10.832 12.0182 10.8694C11.7003 10.8979 11.3269 10.9034 10.9045 10.9045C10.9034 11.3269 10.8979 11.7003 10.8694 12.0182C10.832 12.4353 10.7488 12.853 10.5231 13.2486C10.2654 13.7005 9.89099 14.0749 9.43912 14.3326C9.04345 14.5583 8.62578 14.6415 8.20865 14.6789C7.81503 14.7143 7.33631 14.7142 6.78489 14.7142H5.40545C4.85403 14.7142 4.37531 14.7143 3.9817 14.6789C3.56456 14.6415 3.14689 14.5583 2.75122 14.3326C2.29935 14.0749 1.92498 13.7005 1.66724 13.2486C1.44155 12.853 1.35836 12.4353 1.32093 12.0182C1.2856 11.6246 1.28562 11.1458 1.28565 10.5944V9.21498C1.28562 8.66356 1.2856 8.18484 1.32093 7.79122C1.35836 7.37409 1.44155 6.95642 1.66724 6.56074C1.92498 6.10887 2.29935 5.73451 2.75122 5.47677C3.14689 5.25108 3.56456 5.16789 3.9817 5.13045C4.2996 5.10192 4.67301 5.09645 5.09541 5.09541C5.09645 4.67302 5.10192 4.2996 5.13045 3.9817C5.16789 3.56456 5.25108 3.14689 5.47676 2.75122C5.73451 2.29935 6.10887 1.92498 6.56074 1.66724C6.95642 1.44155 7.37409 1.35836 7.79122 1.32093C8.18484 1.2856 8.66356 1.28562 9.21498 1.28565ZM5.09541 7.09552C4.68397 7.09667 4.39263 7.10161 4.16046 7.12245C3.88053 7.14757 3.78516 7.18949 3.74214 7.21403C3.60139 7.29431 3.48478 7.41091 3.4045 7.55166C3.37997 7.59468 3.33804 7.69005 3.31292 7.96999C3.28659 8.26345 3.28565 8.65147 3.28565 9.25708V10.5523C3.28565 11.1579 3.28659 11.5459 3.31292 11.8394C3.33804 12.1193 3.37997 12.2147 3.4045 12.2577C3.48478 12.3985 3.60139 12.5151 3.74214 12.5954C3.78516 12.6199 3.88053 12.6618 4.16046 12.6869C4.45393 12.7133 4.84195 12.7142 5.44755 12.7142H6.74279C7.3484 12.7142 7.73641 12.7133 8.02988 12.6869C8.30981 12.6618 8.40518 12.6199 8.44821 12.5954C8.58895 12.5151 8.70556 12.3985 8.78584 12.2577C8.81038 12.2147 8.8523 12.1193 8.87742 11.8394C8.89825 11.6072 8.90319 11.3159 8.90435 10.9045C8.48219 10.9034 8.10898 10.8979 7.79122 10.8694C7.37409 10.832 6.95641 10.7488 6.56074 10.5231C6.10887 10.2654 5.73451 9.89099 5.47676 9.43912C5.25108 9.04345 5.16789 8.62578 5.13045 8.20865C5.10194 7.89089 5.09645 7.51767 5.09541 7.09552ZM7.96999 3.31292C7.69005 3.33804 7.59468 3.37997 7.55166 3.4045C7.41091 3.48478 7.29431 3.60139 7.21403 3.74214C7.18949 3.78516 7.14757 3.88053 7.12245 4.16046C7.09611 4.45393 7.09517 4.84195 7.09517 5.44755V6.74279C7.09517 7.3484 7.09611 7.73641 7.12245 8.02988C7.14757 8.30981 7.18949 8.40518 7.21403 8.4482C7.29431 8.58895 7.41091 8.70556 7.55166 8.78584C7.59468 8.81038 7.69005 8.8523 7.96999 8.87742C8.26345 8.90376 8.65147 8.9047 9.25708 8.9047H10.5523C11.1579 8.9047 11.5459 8.90376 11.8394 8.87742C12.1193 8.8523 12.2147 8.81038 12.2577 8.78584C12.3985 8.70556 12.5151 8.58895 12.5954 8.4482C12.6199 8.40518 12.6618 8.30981 12.6869 8.02988C12.7133 7.73641 12.7142 7.3484 12.7142 6.74279V5.44755C12.7142 4.84195 12.7133 4.45393 12.6869 4.16046C12.6618 3.88053 12.6199 3.78516 12.5954 3.74214C12.5151 3.60139 12.3985 3.48478 12.2577 3.4045C12.2147 3.37997 12.1193 3.33804 11.8394 3.31292C11.5459 3.28659 11.1579 3.28565 10.5523 3.28565H9.25708C8.65147 3.28565 8.26345 3.28659 7.96999 3.31292Z"
      fill="#788181"
    /></svg
  >`,
    rae = Ke` <svg fill="none" viewBox="0 0 13 4">
    <path fill="currentColor" d="M.5 0h12L8.9 3.13a3.76 3.76 0 0 1-4.8 0L.5 0Z" />
  </svg>`,
    nae = Ke`<svg fill="none" viewBox="0 0 14 6">
    <path style="fill: var(--wiu-color-bg-150);" d="M0 1h14L9.21 5.12a3.31 3.31 0 0 1-4.49 0L0 1Z" />
    <path
      style="stroke: var(--wiu-color-inverse-100);"
      stroke-opacity=".05"
      d="M1.33 1.5h11.32L8.88 4.75l-.01.01a2.81 2.81 0 0 1-3.8 0l-.02-.01L1.33 1.5Z"
    />
    <path
      style="fill: var(--wiu-color-bg-150);"
      d="M1.25.71h11.5L9.21 3.88a3.31 3.31 0 0 1-4.49 0L1.25.71Z"
    />
  </svg> `,
    iae = Ke`<svg fill="none" viewBox="0 0 20 20">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M13.66 2H6.34c-1.07 0-1.96 0-2.68.08-.74.08-1.42.25-2.01.68a4 4 0 0 0-.89.89c-.43.6-.6 1.27-.68 2.01C0 6.38 0 7.26 0 8.34v.89c0 1.07 0 1.96.08 2.68.08.74.25 1.42.68 2.01a4 4 0 0 0 .89.89c.6.43 1.27.6 2.01.68a27 27 0 0 0 2.68.08h7.32a27 27 0 0 0 2.68-.08 4.03 4.03 0 0 0 2.01-.68 4 4 0 0 0 .89-.89c.43-.6.6-1.27.68-2.01.08-.72.08-1.6.08-2.68v-.89c0-1.07 0-1.96-.08-2.68a4.04 4.04 0 0 0-.68-2.01 4 4 0 0 0-.89-.89c-.6-.43-1.27-.6-2.01-.68C15.62 2 14.74 2 13.66 2ZM2.82 4.38c.2-.14.48-.25 1.06-.31C4.48 4 5.25 4 6.4 4h7.2c1.15 0 1.93 0 2.52.07.58.06.86.17 1.06.31a2 2 0 0 1 .44.44c.14.2.25.48.31 1.06.07.6.07 1.37.07 2.52v.77c0 1.15 0 1.93-.07 2.52-.06.58-.17.86-.31 1.06a2 2 0 0 1-.44.44c-.2.14-.48.25-1.06.32-.6.06-1.37.06-2.52.06H6.4c-1.15 0-1.93 0-2.52-.06-.58-.07-.86-.18-1.06-.32a2 2 0 0 1-.44-.44c-.14-.2-.25-.48-.31-1.06C2 11.1 2 10.32 2 9.17V8.4c0-1.15 0-1.93.07-2.52.06-.58.17-.86.31-1.06a2 2 0 0 1 .44-.44Z"
      clip-rule="evenodd"
    />
    <path fill="currentColor" d="M6.14 17.57a1 1 0 1 0 0 2h7.72a1 1 0 1 0 0-2H6.14Z" />
  </svg>`,
    sae = Ke`<svg fill="none" viewBox="0 0 16 16">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M6.07 1h.57a1 1 0 0 1 0 2h-.52c-.98 0-1.64 0-2.14.06-.48.05-.7.14-.84.24-.13.1-.25.22-.34.35-.1.14-.2.35-.25.83-.05.5-.05 1.16-.05 2.15v2.74c0 .99 0 1.65.05 2.15.05.48.14.7.25.83.1.14.2.25.34.35.14.1.36.2.84.25.5.05 1.16.05 2.14.05h.52a1 1 0 0 1 0 2h-.57c-.92 0-1.69 0-2.3-.07a3.6 3.6 0 0 1-1.8-.61c-.3-.22-.57-.49-.8-.8a3.6 3.6 0 0 1-.6-1.79C.5 11.11.5 10.35.5 9.43V6.58c0-.92 0-1.7.06-2.31a3.6 3.6 0 0 1 .62-1.8c.22-.3.48-.57.79-.79a3.6 3.6 0 0 1 1.8-.61C4.37 1 5.14 1 6.06 1ZM9.5 3a1 1 0 0 1 1.42 0l4.28 4.3a1 1 0 0 1 0 1.4L10.93 13a1 1 0 0 1-1.42-1.42L12.1 9H6.8a1 1 0 1 1 0-2h5.3L9.51 4.42a1 1 0 0 1 0-1.41Z"
      clip-rule="evenodd"
    />
  </svg>`,
    oae = Ke`<svg fill="none" viewBox="0 0 40 40">
    <g clip-path="url(#a)">
      <g clip-path="url(#b)">
        <circle cx="20" cy="19.89" r="20" fill="#5865F2" />
        <path
          fill="#fff"
          fill-rule="evenodd"
          d="M25.71 28.15C30.25 28 32 25.02 32 25.02c0-6.61-2.96-11.98-2.96-11.98-2.96-2.22-5.77-2.15-5.77-2.15l-.29.32c3.5 1.07 5.12 2.61 5.12 2.61a16.75 16.75 0 0 0-10.34-1.93l-.35.04a15.43 15.43 0 0 0-5.88 1.9s1.71-1.63 5.4-2.7l-.2-.24s-2.81-.07-5.77 2.15c0 0-2.96 5.37-2.96 11.98 0 0 1.73 2.98 6.27 3.13l1.37-1.7c-2.6-.79-3.6-2.43-3.6-2.43l.58.35.09.06.08.04.02.01.08.05a17.25 17.25 0 0 0 4.52 1.58 14.4 14.4 0 0 0 8.3-.86c.72-.27 1.52-.66 2.37-1.21 0 0-1.03 1.68-3.72 2.44.61.78 1.35 1.67 1.35 1.67Zm-9.55-9.6c-1.17 0-2.1 1.03-2.1 2.28 0 1.25.95 2.28 2.1 2.28 1.17 0 2.1-1.03 2.1-2.28.01-1.25-.93-2.28-2.1-2.28Zm7.5 0c-1.17 0-2.1 1.03-2.1 2.28 0 1.25.95 2.28 2.1 2.28 1.17 0 2.1-1.03 2.1-2.28 0-1.25-.93-2.28-2.1-2.28Z"
          clip-rule="evenodd"
        />
      </g>
    </g>
    <defs>
      <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
      <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
    </defs>
  </svg>`,
    aae = Ke`<svg fill="none" viewBox="0 0 16 16">
    <path
      fill="currentColor"
      d="M4.25 7a.63.63 0 0 0-.63.63v3.97c0 .28-.2.51-.47.54l-.75.07a.93.93 0 0 1-.9-.47A7.51 7.51 0 0 1 5.54.92a7.5 7.5 0 0 1 9.54 4.62c.12.35.06.72-.16 1-.74.97-1.68 1.78-2.6 2.44V4.44a.64.64 0 0 0-.63-.64h-1.06c-.35 0-.63.3-.63.64v5.5c0 .23-.12.42-.32.5l-.52.23V6.05c0-.36-.3-.64-.64-.64H7.45c-.35 0-.64.3-.64.64v4.97c0 .25-.17.46-.4.52a5.8 5.8 0 0 0-.45.11v-4c0-.36-.3-.65-.64-.65H4.25ZM14.07 12.4A7.49 7.49 0 0 1 3.6 14.08c4.09-.58 9.14-2.5 11.87-6.6v.03a7.56 7.56 0 0 1-1.41 4.91Z"
    />
  </svg>`,
    cae = Ke`<svg fill="none" viewBox="0 0 14 15">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M6.71 2.99a.57.57 0 0 0-.57.57 1 1 0 0 1-1 1c-.58 0-.96 0-1.24.03-.27.03-.37.07-.42.1a.97.97 0 0 0-.36.35c-.04.08-.09.21-.11.67a2.57 2.57 0 0 1 0 5.13c.02.45.07.6.11.66.09.15.21.28.36.36.07.04.21.1.67.12a2.57 2.57 0 0 1 5.12 0c.46-.03.6-.08.67-.12a.97.97 0 0 0 .36-.36c.03-.04.07-.14.1-.41.02-.29.03-.66.03-1.24a1 1 0 0 1 1-1 .57.57 0 0 0 0-1.15 1 1 0 0 1-1-1c0-.58 0-.95-.03-1.24a1.04 1.04 0 0 0-.1-.42.97.97 0 0 0-.36-.36 1.04 1.04 0 0 0-.42-.1c-.28-.02-.65-.02-1.24-.02a1 1 0 0 1-1-1 .57.57 0 0 0-.57-.57ZM5.15 13.98a1 1 0 0 0 .99-1v-.78a.57.57 0 0 1 1.14 0v.78a1 1 0 0 0 .99 1H8.36a66.26 66.26 0 0 0 .73 0 3.78 3.78 0 0 0 1.84-.38c.46-.26.85-.64 1.1-1.1.23-.4.32-.8.36-1.22.02-.2.03-.4.03-.63a2.57 2.57 0 0 0 0-4.75c0-.23-.01-.44-.03-.63a2.96 2.96 0 0 0-.35-1.22 2.97 2.97 0 0 0-1.1-1.1c-.4-.22-.8-.31-1.22-.35a8.7 8.7 0 0 0-.64-.04 2.57 2.57 0 0 0-4.74 0c-.23 0-.44.02-.63.04-.42.04-.83.13-1.22.35-.46.26-.84.64-1.1 1.1-.33.57-.37 1.2-.39 1.84a21.39 21.39 0 0 0 0 .72v.1a1 1 0 0 0 1 .99h.78a.57.57 0 0 1 0 1.15h-.77a1 1 0 0 0-1 .98v.1a63.87 63.87 0 0 0 0 .73c0 .64.05 1.27.38 1.83.26.47.64.85 1.1 1.11.56.32 1.2.37 1.84.38a20.93 20.93 0 0 0 .72 0h.1Z"
      clip-rule="evenodd"
    />
  </svg>`,
    lae = Ke`<svg fill="none" viewBox="0 0 14 15">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M3.74 3.99a1 1 0 0 1 1-1H11a1 1 0 0 1 1 1v6.26a1 1 0 0 1-2 0V6.4l-6.3 6.3a1 1 0 0 1-1.4-1.42l6.29-6.3H4.74a1 1 0 0 1-1-1Z"
      clip-rule="evenodd"
    />
  </svg>`,
    uae = Ke`<svg fill="none" viewBox="0 0 40 40">
    <g clip-path="url(#a)">
      <g clip-path="url(#b)">
        <circle cx="20" cy="19.89" r="20" fill="#1877F2" />
        <g clip-path="url(#c)">
          <path
            fill="#fff"
            d="M26 12.38h-2.89c-.92 0-1.61.38-1.61 1.34v1.66H26l-.36 4.5H21.5v12H17v-12h-3v-4.5h3V12.5c0-3.03 1.6-4.62 5.2-4.62H26v4.5Z"
          />
        </g>
      </g>
      <path
        fill="#1877F2"
        d="M40 20a20 20 0 1 0-23.13 19.76V25.78H11.8V20h5.07v-4.4c0-5.02 3-7.79 7.56-7.79 2.19 0 4.48.4 4.48.4v4.91h-2.53c-2.48 0-3.25 1.55-3.25 3.13V20h5.54l-.88 5.78h-4.66v13.98A20 20 0 0 0 40 20Z"
      />
      <path
        fill="#fff"
        d="m27.79 25.78.88-5.78h-5.55v-3.75c0-1.58.78-3.13 3.26-3.13h2.53V8.2s-2.3-.39-4.48-.39c-4.57 0-7.55 2.77-7.55 7.78V20H11.8v5.78h5.07v13.98a20.15 20.15 0 0 0 6.25 0V25.78h4.67Z"
      />
    </g>
    <defs>
      <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
      <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
      <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
    </defs>
  </svg>`,
    dae = Ke`<svg style="border-radius: 9999px; overflow: hidden;"  fill="none" viewBox="0 0 1000 1000">
    <rect width="1000" height="1000" rx="9999" ry="9999" fill="#855DCD"/>
    <path fill="#855DCD" d="M0 0h1000v1000H0V0Z" />
    <path
      fill="#fff"
      d="M320 248h354v504h-51.96V521.13h-.5c-5.76-63.8-59.31-113.81-124.54-113.81s-118.78 50-124.53 113.81h-.5V752H320V248Z"
    />
    <path
      fill="#fff"
      d="m225 320 21.16 71.46h17.9v289.09a16.29 16.29 0 0 0-16.28 16.24v19.49h-3.25a16.3 16.3 0 0 0-16.28 16.24V752h182.26v-19.48a16.22 16.22 0 0 0-16.28-16.24h-3.25v-19.5a16.22 16.22 0 0 0-16.28-16.23h-19.52V320H225Zm400.3 360.55a16.3 16.3 0 0 0-15.04 10.02 16.2 16.2 0 0 0-1.24 6.22v19.49h-3.25a16.29 16.29 0 0 0-16.27 16.24V752h182.24v-19.48a16.23 16.23 0 0 0-16.27-16.24h-3.25v-19.5a16.2 16.2 0 0 0-10.04-15 16.3 16.3 0 0 0-6.23-1.23v-289.1h17.9L775 320H644.82v360.55H625.3Z"
    />
  </svg>`,
    hae = Ke`<svg fill="none" viewBox="0 0 16 16">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M0 3a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H1a1 1 0 0 1-1-1Zm2.63 5.25a1 1 0 0 1 1-1h8.75a1 1 0 1 1 0 2H3.63a1 1 0 0 1-1-1Zm2.62 5.25a1 1 0 0 1 1-1h3.5a1 1 0 0 1 0 2h-3.5a1 1 0 0 1-1-1Z"
      clip-rule="evenodd"
    />
  </svg>`,
    fae = Ke`<svg fill="none" viewBox="0 0 40 40">
    <g clip-path="url(#a)">
      <g clip-path="url(#b)">
        <circle cx="20" cy="19.89" r="20" fill="#1B1F23" />
        <g clip-path="url(#c)">
          <path
            fill="#fff"
            d="M8 19.89a12 12 0 1 1 15.8 11.38c-.6.12-.8-.26-.8-.57v-3.3c0-1.12-.4-1.85-.82-2.22 2.67-.3 5.48-1.31 5.48-5.92 0-1.31-.47-2.38-1.24-3.22.13-.3.54-1.52-.12-3.18 0 0-1-.32-3.3 1.23a11.54 11.54 0 0 0-6 0c-2.3-1.55-3.3-1.23-3.3-1.23a4.32 4.32 0 0 0-.12 3.18 4.64 4.64 0 0 0-1.24 3.22c0 4.6 2.8 5.63 5.47 5.93-.34.3-.65.83-.76 1.6-.69.31-2.42.84-3.5-1 0 0-.63-1.15-1.83-1.23 0 0-1.18-.02-.09.73 0 0 .8.37 1.34 1.76 0 0 .7 2.14 4.03 1.41v2.24c0 .31-.2.68-.8.57A12 12 0 0 1 8 19.9Z"
          />
        </g>
      </g>
    </g>
    <defs>
      <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
      <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
      <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
    </defs>
  </svg>`,
    pae = Ke`<svg fill="none" viewBox="0 0 40 40">
    <path
      fill="#4285F4"
      d="M32.74 20.3c0-.93-.08-1.81-.24-2.66H20.26v5.03h7a6 6 0 0 1-2.62 3.91v3.28h4.22c2.46-2.27 3.88-5.6 3.88-9.56Z"
    />
    <path
      fill="#34A853"
      d="M20.26 33a12.4 12.4 0 0 0 8.6-3.14l-4.22-3.28a7.74 7.74 0 0 1-4.38 1.26 7.76 7.76 0 0 1-7.28-5.36H8.65v3.36A12.99 12.99 0 0 0 20.26 33Z"
    />
    <path
      fill="#FBBC05"
      d="M12.98 22.47a7.79 7.79 0 0 1 0-4.94v-3.36H8.65a12.84 12.84 0 0 0 0 11.66l3.37-2.63.96-.73Z"
    />
    <path
      fill="#EA4335"
      d="M20.26 12.18a7.1 7.1 0 0 1 4.98 1.93l3.72-3.72A12.47 12.47 0 0 0 20.26 7c-5.08 0-9.47 2.92-11.6 7.17l4.32 3.36a7.76 7.76 0 0 1 7.28-5.35Z"
    />
  </svg>`,
    gae = Ke`<svg fill="none" viewBox="0 0 16 16">
    <path
      fill="currentColor"
      d="M8.51 5.66a.83.83 0 0 0-.57-.2.83.83 0 0 0-.52.28.8.8 0 0 0-.25.52 1 1 0 0 1-2 0c0-.75.34-1.43.81-1.91a2.75 2.75 0 0 1 4.78 1.92c0 1.24-.8 1.86-1.25 2.2l-.04.03c-.47.36-.5.43-.5.65a1 1 0 1 1-2 0c0-1.25.8-1.86 1.24-2.2l.04-.04c.47-.36.5-.43.5-.65 0-.3-.1-.49-.24-.6ZM9.12 11.87a1.13 1.13 0 1 1-2.25 0 1.13 1.13 0 0 1 2.25 0Z"
    />
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6a6 6 0 1 0 0 12A6 6 0 0 0 8 2Z"
      clip-rule="evenodd"
    />
  </svg>`,
    mae = Ke`<svg width="14" height="14" viewBox="0 0 14 14" fill="none">
    <path d="M4.98926 3.73932C4.2989 3.73932 3.73926 4.29896 3.73926 4.98932C3.73926 5.67968 4.2989 6.23932 4.98926 6.23932C5.67962 6.23932 6.23926 5.67968 6.23926 4.98932C6.23926 4.29896 5.67962 3.73932 4.98926 3.73932Z" fill="currentColor"/>
    <path fill-rule="evenodd" clip-rule="evenodd" d="M7.60497 0.500001H6.39504C5.41068 0.499977 4.59185 0.499958 3.93178 0.571471C3.24075 0.64634 2.60613 0.809093 2.04581 1.21619C1.72745 1.44749 1.44749 1.72745 1.21619 2.04581C0.809093 2.60613 0.64634 3.24075 0.571471 3.93178C0.499958 4.59185 0.499977 5.41065 0.500001 6.39501V7.57815C0.499998 8.37476 0.499995 9.05726 0.534869 9.62725C0.570123 10.2034 0.644114 10.7419 0.828442 11.2302C0.925651 11.4877 1.05235 11.7287 1.21619 11.9542C1.44749 12.2726 1.72745 12.5525 2.04581 12.7838C2.60613 13.1909 3.24075 13.3537 3.93178 13.4285C4.59185 13.5001 5.41066 13.5 6.39503 13.5H7.60496C8.58933 13.5 9.40815 13.5001 10.0682 13.4285C10.7593 13.3537 11.3939 13.1909 11.9542 12.7838C12.2726 12.5525 12.5525 12.2726 12.7838 11.9542C13.1909 11.3939 13.3537 10.7593 13.4285 10.0682C13.5 9.40816 13.5 8.58935 13.5 7.60497V6.39505C13.5 5.41068 13.5 4.59185 13.4285 3.93178C13.3537 3.24075 13.1909 2.60613 12.7838 2.04581C12.5525 1.72745 12.2726 1.44749 11.9542 1.21619C11.3939 0.809093 10.7593 0.64634 10.0682 0.571471C9.40816 0.499958 8.58933 0.499977 7.60497 0.500001ZM3.22138 2.83422C3.38394 2.71612 3.62634 2.61627 4.14721 2.55984C4.68679 2.50138 5.39655 2.5 6.45 2.5H7.55C8.60345 2.5 9.31322 2.50138 9.8528 2.55984C10.3737 2.61627 10.6161 2.71612 10.7786 2.83422C10.9272 2.94216 11.0578 3.07281 11.1658 3.22138C11.2839 3.38394 11.3837 3.62634 11.4402 4.14721C11.4986 4.68679 11.5 5.39655 11.5 6.45V6.49703C10.9674 6.11617 10.386 5.84936 9.74213 5.81948C8.40536 5.75745 7.3556 6.73051 6.40509 7.84229C6.33236 7.92737 6.27406 7.98735 6.22971 8.02911L6.1919 8.00514L6.17483 7.99427C6.09523 7.94353 5.98115 7.87083 5.85596 7.80302C5.56887 7.64752 5.18012 7.4921 4.68105 7.4921C4.66697 7.4921 4.6529 7.49239 4.63884 7.49299C3.79163 7.52878 3.09922 8.1106 2.62901 8.55472C2.58751 8.59392 2.54594 8.6339 2.50435 8.6745C2.50011 8.34653 2.5 7.97569 2.5 7.55V6.45C2.5 5.39655 2.50138 4.68679 2.55984 4.14721C2.61627 3.62634 2.71612 3.38394 2.83422 3.22138C2.94216 3.07281 3.07281 2.94216 3.22138 2.83422ZM10.3703 8.14825C10.6798 8.37526 11.043 8.71839 11.4832 9.20889C11.4744 9.44992 11.4608 9.662 11.4402 9.8528C11.3837 10.3737 11.2839 10.6161 11.1658 10.7786C11.0578 10.9272 10.9272 11.0578 10.7786 11.1658C10.6161 11.2839 10.3737 11.3837 9.8528 11.4402C9.31322 11.4986 8.60345 11.5 7.55 11.5H6.45C5.39655 11.5 4.68679 11.4986 4.14721 11.4402C3.62634 11.3837 3.38394 11.2839 3.22138 11.1658C3.15484 11.1174 3.0919 11.0645 3.03298 11.0075C3.10126 10.9356 3.16806 10.8649 3.23317 10.7959L3.29772 10.7276C3.55763 10.4525 3.78639 10.2126 4.00232 10.0087C4.22016 9.80294 4.39412 9.66364 4.53524 9.57742C4.63352 9.51738 4.69022 9.49897 4.71275 9.49345C4.76387 9.49804 4.81803 9.51537 4.90343 9.56162C4.96409 9.59447 5.02355 9.63225 5.11802 9.69238L5.12363 9.69595C5.20522 9.74789 5.32771 9.82587 5.46078 9.89278C5.76529 10.0459 6.21427 10.186 6.74977 10.0158C7.21485 9.86796 7.59367 9.52979 7.92525 9.14195C8.91377 7.98571 9.38267 7.80495 9.64941 7.81733C9.7858 7.82366 10.0101 7.884 10.3703 8.14825Z" fill="currentColor"/>
  </svg>`,
    wae = Ke`<svg fill="none" viewBox="0 0 14 15">
    <path
      fill="currentColor"
      d="M6 10.49a1 1 0 1 0 2 0v-2a1 1 0 0 0-2 0v2ZM7 4.49a1 1 0 1 0 0 2 1 1 0 0 0 0-2Z"
    />
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M7 14.99a7 7 0 1 0 0-14 7 7 0 0 0 0 14Zm5-7a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"
      clip-rule="evenodd"
    />
  </svg>`,
    vae = Ke`<svg fill="none" viewBox="0 0 16 16">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M4.83 1.34h6.34c.68 0 1.26 0 1.73.04.5.05.97.15 1.42.4.52.3.95.72 1.24 1.24.26.45.35.92.4 1.42.04.47.04 1.05.04 1.73v3.71c0 .69 0 1.26-.04 1.74-.05.5-.14.97-.4 1.41-.3.52-.72.95-1.24 1.25-.45.25-.92.35-1.42.4-.47.03-1.05.03-1.73.03H4.83c-.68 0-1.26 0-1.73-.04-.5-.04-.97-.14-1.42-.4-.52-.29-.95-.72-1.24-1.24a3.39 3.39 0 0 1-.4-1.41A20.9 20.9 0 0 1 0 9.88v-3.7c0-.7 0-1.27.04-1.74.05-.5.14-.97.4-1.42.3-.52.72-.95 1.24-1.24.45-.25.92-.35 1.42-.4.47-.04 1.05-.04 1.73-.04ZM3.28 3.38c-.36.03-.51.08-.6.14-.21.11-.39.29-.5.5a.8.8 0 0 0-.08.19l5.16 3.44c.45.3 1.03.3 1.48 0L13.9 4.2a.79.79 0 0 0-.08-.2c-.11-.2-.29-.38-.5-.5-.09-.05-.24-.1-.6-.13-.37-.04-.86-.04-1.6-.04H4.88c-.73 0-1.22 0-1.6.04ZM14 6.54 9.85 9.31a3.33 3.33 0 0 1-3.7 0L2 6.54v3.3c0 .74 0 1.22.03 1.6.04.36.1.5.15.6.11.2.29.38.5.5.09.05.24.1.6.14.37.03.86.03 1.6.03h6.25c.73 0 1.22 0 1.6-.03.35-.03.5-.09.6-.14.2-.12.38-.3.5-.5.05-.1.1-.24.14-.6.03-.38.03-.86.03-1.6v-3.3Z"
      clip-rule="evenodd"
    />
  </svg>`,
    bae = Ke`<svg fill="none" viewBox="0 0 20 20">
    <path fill="currentColor" d="M10.81 5.81a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" />
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M3 4.75A4.75 4.75 0 0 1 7.75 0h4.5A4.75 4.75 0 0 1 17 4.75v10.5A4.75 4.75 0 0 1 12.25 20h-4.5A4.75 4.75 0 0 1 3 15.25V4.75ZM7.75 2A2.75 2.75 0 0 0 5 4.75v10.5A2.75 2.75 0 0 0 7.75 18h4.5A2.75 2.75 0 0 0 15 15.25V4.75A2.75 2.75 0 0 0 12.25 2h-4.5Z"
      clip-rule="evenodd"
    />
  </svg>`,
    yae = Ke`<svg fill="none" viewBox="0 0 41 40">
    <path
      style="fill: var(--wiu-color-fg-100);"
      fill-opacity=".05"
      d="M.6 20a20 20 0 1 1 40 0 20 20 0 0 1-40 0Z"
    />
    <path
      fill="#949E9E"
      d="M15.6 20.31a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0ZM23.1 20.31a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0ZM28.1 22.81a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z"
    />
  </svg>`,
    _ae = Ke`<svg fill="none" viewBox="0 0 22 20">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M16.32 13.62a3.14 3.14 0 1 1-.99 1.72l-1.6-.93a3.83 3.83 0 0 1-3.71 1 3.66 3.66 0 0 1-1.74-1l-1.6.94a3.14 3.14 0 1 1-1-1.73l1.6-.94a3.7 3.7 0 0 1 0-2 3.81 3.81 0 0 1 1.8-2.33c.29-.17.6-.3.92-.38V6.1a3.14 3.14 0 1 1 2 0l-.01.02v1.85H12a3.82 3.82 0 0 1 2.33 1.8 3.7 3.7 0 0 1 .39 2.91l1.6.93ZM2.6 16.54a1.14 1.14 0 0 0 1.98-1.14 1.14 1.14 0 0 0-1.98 1.14ZM11 2.01a1.14 1.14 0 1 0 0 2.28 1.14 1.14 0 0 0 0-2.28Zm1.68 10.45c.08-.19.14-.38.16-.58v-.05l.02-.13v-.13a1.92 1.92 0 0 0-.24-.8l-.11-.15a1.89 1.89 0 0 0-.74-.6 1.86 1.86 0 0 0-.77-.17h-.19a1.97 1.97 0 0 0-.89.34 1.98 1.98 0 0 0-.61.74 1.99 1.99 0 0 0-.16.9v.05a1.87 1.87 0 0 0 .24.74l.1.15c.12.16.26.3.42.42l.16.1.13.07.04.02a1.84 1.84 0 0 0 .76.17h.17a2 2 0 0 0 .91-.35 1.78 1.78 0 0 0 .52-.58l.03-.05a.84.84 0 0 0 .05-.11Zm5.15 4.5a1.14 1.14 0 0 0 1.14-1.97 1.13 1.13 0 0 0-1.55.41c-.32.55-.13 1.25.41 1.56Z"
      clip-rule="evenodd"
    />
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M4.63 9.43a1.5 1.5 0 1 0 1.5-2.6 1.5 1.5 0 0 0-1.5 2.6Zm.32-1.55a.5.5 0 0 1 .68-.19.5.5 0 0 1 .18.68.5.5 0 0 1-.68.19.5.5 0 0 1-.18-.68ZM17.94 8.88a1.5 1.5 0 1 1-2.6-1.5 1.5 1.5 0 1 1 2.6 1.5ZM16.9 7.69a.5.5 0 0 0-.68.19.5.5 0 0 0 .18.68.5.5 0 0 0 .68-.19.5.5 0 0 0-.18-.68ZM9.75 17.75a1.5 1.5 0 1 1 2.6 1.5 1.5 1.5 0 1 1-2.6-1.5Zm1.05 1.18a.5.5 0 0 0 .68-.18.5.5 0 0 0-.18-.68.5.5 0 0 0-.68.18.5.5 0 0 0 .18.68Z"
      clip-rule="evenodd"
    />
  </svg>`,
    xae = Ke`<svg fill="none" viewBox="0 0 20 20">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M9.13 1h1.71c1.46 0 2.63 0 3.56.1.97.1 1.8.33 2.53.85a5 5 0 0 1 1.1 1.11c.53.73.75 1.56.86 2.53.1.93.1 2.1.1 3.55v1.72c0 1.45 0 2.62-.1 3.55-.1.97-.33 1.8-.86 2.53a5 5 0 0 1-1.1 1.1c-.73.53-1.56.75-2.53.86-.93.1-2.1.1-3.55.1H9.13c-1.45 0-2.62 0-3.56-.1-.96-.1-1.8-.33-2.52-.85a5 5 0 0 1-1.1-1.11 5.05 5.05 0 0 1-.86-2.53c-.1-.93-.1-2.1-.1-3.55V9.14c0-1.45 0-2.62.1-3.55.1-.97.33-1.8.85-2.53a5 5 0 0 1 1.1-1.1 5.05 5.05 0 0 1 2.53-.86C6.51 1 7.67 1 9.13 1ZM5.79 3.09a3.1 3.1 0 0 0-1.57.48 3 3 0 0 0-.66.67c-.24.32-.4.77-.48 1.56-.1.82-.1 1.88-.1 3.4v1.6c0 1.15 0 2.04.05 2.76l.41-.42c.5-.5.93-.92 1.32-1.24.41-.33.86-.6 1.43-.7a3 3 0 0 1 .94 0c.35.06.66.2.95.37a17.11 17.11 0 0 0 .8.45c.1-.08.2-.2.41-.4l.04-.03a27 27 0 0 1 1.95-1.84 4.03 4.03 0 0 1 1.91-.94 4 4 0 0 1 1.25 0c.73.11 1.33.46 1.91.94l.64.55V9.2c0-1.52 0-2.58-.1-3.4a3.1 3.1 0 0 0-.48-1.56 3 3 0 0 0-.66-.67 3.1 3.1 0 0 0-1.56-.48C13.37 3 12.3 3 10.79 3h-1.6c-1.52 0-2.59 0-3.4.09Zm11.18 10-.04-.05a26.24 26.24 0 0 0-1.83-1.74c-.45-.36-.73-.48-.97-.52a2 2 0 0 0-.63 0c-.24.04-.51.16-.97.52-.46.38-1.01.93-1.83 1.74l-.02.02c-.17.18-.34.34-.49.47a2.04 2.04 0 0 1-1.08.5 1.97 1.97 0 0 1-1.25-.27l-.79-.46-.02-.02a.65.65 0 0 0-.24-.1 1 1 0 0 0-.31 0c-.08.02-.21.06-.49.28-.3.24-.65.59-1.2 1.14l-.56.56-.65.66a3 3 0 0 0 .62.6c.33.24.77.4 1.57.49.81.09 1.88.09 3.4.09h1.6c1.52 0 2.58 0 3.4-.09a3.1 3.1 0 0 0 1.56-.48 3 3 0 0 0 .66-.67c.24-.32.4-.77.49-1.56l.07-1.12Zm-8.02-1.03ZM4.99 7a2 2 0 1 1 4 0 2 2 0 0 1-4 0Z"
      clip-rule="evenodd"
    />
  </svg>`,
    Cae = Ke`<svg fill="none" viewBox="0 0 16 16">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M8 0a1 1 0 0 1 1 1v5.38a1 1 0 0 1-2 0V1a1 1 0 0 1 1-1ZM5.26 2.6a1 1 0 0 1-.28 1.39 5.46 5.46 0 1 0 6.04 0 1 1 0 1 1 1.1-1.67 7.46 7.46 0 1 1-8.25 0 1 1 0 0 1 1.4.28Z"
      clip-rule="evenodd"
    />
  </svg>`,
    Eae = Ke` <svg
    width="36"
    height="36"
    fill="none"
  >
    <path
      d="M0 8a8 8 0 0 1 8-8h20a8 8 0 0 1 8 8v20a8 8 0 0 1-8 8H8a8 8 0 0 1-8-8V8Z"
      fill="#fff"
      fill-opacity=".05"
    />
    <path
      d="m18.262 17.513-8.944 9.49v.01a2.417 2.417 0 0 0 3.56 1.452l.026-.017 10.061-5.803-4.703-5.132Z"
      fill="#EA4335"
    />
    <path
      d="m27.307 15.9-.008-.008-4.342-2.52-4.896 4.36 4.913 4.912 4.325-2.494a2.42 2.42 0 0 0 .008-4.25Z"
      fill="#FBBC04"
    />
    <path
      d="M9.318 8.997c-.05.202-.084.403-.084.622V26.39c0 .218.025.42.084.621l9.246-9.247-9.246-8.768Z"
      fill="#4285F4"
    />
    <path
      d="m18.33 18 4.627-4.628-10.053-5.828a2.427 2.427 0 0 0-3.586 1.444L18.329 18Z"
      fill="#34A853"
    />
    <path
      d="M8 .5h20A7.5 7.5 0 0 1 35.5 8v20a7.5 7.5 0 0 1-7.5 7.5H8A7.5 7.5 0 0 1 .5 28V8A7.5 7.5 0 0 1 8 .5Z"
      stroke="#fff"
      stroke-opacity=".05"
    />
  </svg>`,
    Aae = Ke`<svg
    width="13"
    height="12"
    viewBox="0 0 13 12"
    fill="none"
  >
    <path
      fill="currentColor"
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M0.794373 5.99982C0.794373 5.52643 1.17812 5.14268 1.6515 5.14268H5.643V1.15109C5.643 0.677701 6.02675 0.293946 6.50012 0.293945C6.9735 0.293946 7.35725 0.677701 7.35725 1.15109V5.14268H11.3488C11.8221 5.14268 12.2059 5.52643 12.2059 5.99982C12.2059 6.47321 11.8221 6.85696 11.3488 6.85696H7.35725V10.8486C7.35725 11.3219 6.9735 11.7057 6.50012 11.7057C6.02675 11.7057 5.643 11.3219 5.643 10.8486V6.85696H1.6515C1.17812 6.85696 0.794373 6.47321 0.794373 5.99982Z"
    /></svg
  >`,
    Sae = Ke`<svg fill="none" viewBox="0 0 20 20">
    <path
      fill="currentColor"
      d="M3 6a3 3 0 0 1 3-3h1a1 1 0 1 0 0-2H6a5 5 0 0 0-5 5v1a1 1 0 0 0 2 0V6ZM13 1a1 1 0 1 0 0 2h1a3 3 0 0 1 3 3v1a1 1 0 1 0 2 0V6a5 5 0 0 0-5-5h-1ZM3 13a1 1 0 1 0-2 0v1a5 5 0 0 0 5 5h1a1 1 0 1 0 0-2H6a3 3 0 0 1-3-3v-1ZM19 13a1 1 0 1 0-2 0v1a3 3 0 0 1-3 3h-1a1 1 0 1 0 0 2h1.01a5 5 0 0 0 5-5v-1ZM5.3 6.36c-.04.2-.04.43-.04.89s0 .7.05.89c.14.52.54.92 1.06 1.06.19.05.42.05.89.05.46 0 .7 0 .88-.05A1.5 1.5 0 0 0 9.2 8.14c.06-.2.06-.43.06-.89s0-.7-.06-.89A1.5 1.5 0 0 0 8.14 5.3c-.19-.05-.42-.05-.88-.05-.47 0-.7 0-.9.05a1.5 1.5 0 0 0-1.05 1.06ZM10.8 6.36c-.04.2-.04.43-.04.89s0 .7.05.89c.14.52.54.92 1.06 1.06.19.05.42.05.89.05.46 0 .7 0 .88-.05a1.5 1.5 0 0 0 1.06-1.06c.06-.2.06-.43.06-.89s0-.7-.06-.89a1.5 1.5 0 0 0-1.06-1.06c-.19-.05-.42-.05-.88-.05-.47 0-.7 0-.9.05a1.5 1.5 0 0 0-1.05 1.06ZM5.26 12.75c0-.46 0-.7.05-.89a1.5 1.5 0 0 1 1.06-1.06c.19-.05.42-.05.89-.05.46 0 .7 0 .88.05.52.14.93.54 1.06 1.06.06.2.06.43.06.89s0 .7-.06.89a1.5 1.5 0 0 1-1.06 1.06c-.19.05-.42.05-.88.05-.47 0-.7 0-.9-.05a1.5 1.5 0 0 1-1.05-1.06c-.05-.2-.05-.43-.05-.89ZM10.8 11.86c-.04.2-.04.43-.04.89s0 .7.05.89c.14.52.54.92 1.06 1.06.19.05.42.05.89.05.46 0 .7 0 .88-.05a1.5 1.5 0 0 0 1.06-1.06c.06-.2.06-.43.06-.89s0-.7-.06-.89a1.5 1.5 0 0 0-1.06-1.06c-.19-.05-.42-.05-.88-.05-.47 0-.7 0-.9.05a1.5 1.5 0 0 0-1.05 1.06Z"
    />
  </svg>`,
    Iae = Ke`<svg
    fill="none"
    viewBox="0 0 21 20"
  >
    <path
      fill="currentColor"
      d="M8.8071 0.292893C9.19763 0.683417 9.19763 1.31658 8.8071 1.70711L6.91421 3.6H11.8404C14.3368 3.6 16.5533 5.1975 17.3427 7.56588L17.4487 7.88377C17.6233 8.40772 17.3402 8.97404 16.8162 9.14868C16.2923 9.32333 15.726 9.04017 15.5513 8.51623L15.4453 8.19834C14.9281 6.64664 13.476 5.6 11.8404 5.6H6.91421L8.8071 7.49289C9.19763 7.88342 9.19763 8.51658 8.8071 8.90711C8.41658 9.29763 7.78341 9.29763 7.39289 8.90711L3.79289 5.30711C3.40236 4.91658 3.40236 4.28342 3.79289 3.89289L7.39289 0.292893C7.78341 -0.0976311 8.41658 -0.0976311 8.8071 0.292893ZM4.18377 10.8513C4.70771 10.6767 5.27403 10.9598 5.44868 11.4838L5.55464 11.8017C6.07188 13.3534 7.52401 14.4 9.15964 14.4L14.0858 14.4L12.1929 12.5071C11.8024 12.1166 11.8024 11.4834 12.1929 11.0929C12.5834 10.7024 13.2166 10.7024 13.6071 11.0929L17.2071 14.6929C17.5976 15.0834 17.5976 15.7166 17.2071 16.1071L13.6071 19.7071C13.2166 20.0976 12.5834 20.0976 12.1929 19.7071C11.8024 19.3166 11.8024 18.6834 12.1929 18.2929L14.0858 16.4L9.15964 16.4C6.66314 16.4 4.44674 14.8025 3.65728 12.4341L3.55131 12.1162C3.37667 11.5923 3.65983 11.026 4.18377 10.8513Z"
    /></svg
  >`,
    Tae = Ke`<svg fill="none" viewBox="0 0 14 16">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M3.94 1.04a1 1 0 0 1 .7 1.23l-.48 1.68a5.85 5.85 0 0 1 8.53 4.32 5.86 5.86 0 0 1-11.4 2.56 1 1 0 0 1 1.9-.57 3.86 3.86 0 1 0 1.83-4.5l1.87.53a1 1 0 0 1-.55 1.92l-4.1-1.15a1 1 0 0 1-.69-1.23l1.16-4.1a1 1 0 0 1 1.23-.7Z"
      clip-rule="evenodd"
    />
  </svg>`,
    kae = Ke`<svg fill="none" viewBox="0 0 20 20">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M9.36 4.21a5.14 5.14 0 1 0 0 10.29 5.14 5.14 0 0 0 0-10.29ZM1.64 9.36a7.71 7.71 0 1 1 14 4.47l2.52 2.5a1.29 1.29 0 1 1-1.82 1.83l-2.51-2.51A7.71 7.71 0 0 1 1.65 9.36Z"
      clip-rule="evenodd"
    />
  </svg>`,
    Rae = Ke`<svg fill="none" viewBox="0 0 21 20">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M14.3808 4.34812C13.72 4.47798 12.8501 4.7587 11.5748 5.17296L9.00869 6.00646C6.90631 6.68935 5.40679 7.17779 4.38121 7.63178C3.87166 7.85734 3.5351 8.05091 3.32022 8.22035C3.11183 8.38466 3.07011 8.48486 3.05969 8.51817C2.98058 8.77103 2.98009 9.04195 3.05831 9.29509C3.06861 9.32844 3.10998 9.42878 3.31777 9.59384C3.53205 9.76404 3.86792 9.95881 4.37667 10.1862C5.29287 10.5957 6.58844 11.0341 8.35529 11.6164L10.8876 8.59854C11.2426 8.17547 11.8733 8.12028 12.2964 8.47528C12.7195 8.83029 12.7746 9.46104 12.4196 9.88412L9.88738 12.9019C10.7676 14.5408 11.4244 15.7406 11.9867 16.5718C12.299 17.0333 12.5491 17.3303 12.7539 17.5117C12.9526 17.6877 13.0586 17.711 13.0932 17.7154C13.3561 17.7484 13.6228 17.7009 13.8581 17.5791C13.8891 17.563 13.9805 17.5046 14.1061 17.2708C14.2357 17.0298 14.3679 16.6647 14.5015 16.1237C14.7705 15.0349 14.9912 13.4733 15.2986 11.2843L15.6738 8.61249C15.8603 7.28456 15.9857 6.37917 15.9989 5.7059C16.012 5.03702 15.9047 4.8056 15.8145 4.69183C15.7044 4.55297 15.5673 4.43792 15.4114 4.35365C15.2837 4.28459 15.0372 4.2191 14.3808 4.34812ZM7.99373 13.603C6.11919 12.9864 4.6304 12.4902 3.5606 12.0121C2.98683 11.7557 2.4778 11.4808 2.07383 11.1599C1.66337 10.8339 1.31312 10.4217 1.14744 9.88551C0.949667 9.24541 0.950886 8.56035 1.15094 7.92096C1.31852 7.38534 1.67024 6.97442 2.08185 6.64985C2.48697 6.33041 2.99697 6.05734 3.57166 5.80295C4.70309 5.3021 6.30179 4.78283 8.32903 4.12437L11.0196 3.25042C12.2166 2.86159 13.2017 2.54158 13.9951 2.38566C14.8065 2.22618 15.6202 2.19289 16.3627 2.59437C16.7568 2.80747 17.1035 3.09839 17.3818 3.4495C17.9062 4.111 18.0147 4.91815 17.9985 5.74496C17.9827 6.55332 17.8386 7.57903 17.6636 8.82534L17.2701 11.6268C16.9737 13.7376 16.7399 15.4022 16.4432 16.6034C16.2924 17.2135 16.1121 17.7632 15.8678 18.2176C15.6197 18.6794 15.2761 19.0971 14.7777 19.3551C14.1827 19.6632 13.5083 19.7833 12.8436 19.6997C12.2867 19.6297 11.82 19.3563 11.4277 19.0087C11.0415 18.6666 10.6824 18.213 10.3302 17.6925C9.67361 16.722 8.92648 15.342 7.99373 13.603Z"
      clip-rule="evenodd"
    />
    <svg
      xmlns="http://www.w3.org/2000/svg"
      width="21"
      height="20"
      viewBox="0 0 21 20"
      fill="none"
    ></svg></svg
  >`,
    Nae = Ke`<svg fill="none" viewBox="0 0 20 20">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M6.76.3a1 1 0 0 1 0 1.4L4.07 4.4h9a1 1 0 1 1 0 2h-9l2.69 2.68a1 1 0 1 1-1.42 1.42L.95 6.09a1 1 0 0 1 0-1.4l4.4-4.4a1 1 0 0 1 1.4 0Zm6.49 9.21a1 1 0 0 1 1.41 0l4.39 4.4a1 1 0 0 1 0 1.4l-4.39 4.4a1 1 0 0 1-1.41-1.42l2.68-2.68h-9a1 1 0 0 1 0-2h9l-2.68-2.68a1 1 0 0 1 0-1.42Z"
      clip-rule="evenodd"
    />
  </svg>`,
    Mae = Ke`<svg width="10" height="10" viewBox="0 0 10 10">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M3.77986 0.566631C4.0589 0.845577 4.0589 1.29784 3.77986 1.57678L3.08261 2.2738H6.34184C6.73647 2.2738 7.05637 2.5936 7.05637 2.98808C7.05637 3.38257 6.73647 3.70237 6.34184 3.70237H3.08261L3.77986 4.39938C4.0589 4.67833 4.0589 5.13059 3.77986 5.40954C3.50082 5.68848 3.04841 5.68848 2.76937 5.40954L0.852346 3.49316C0.573306 3.21421 0.573306 2.76195 0.852346 2.48301L2.76937 0.566631C3.04841 0.287685 3.50082 0.287685 3.77986 0.566631ZM6.22 4.59102C6.49904 4.31208 6.95145 4.31208 7.23049 4.59102L9.14751 6.5074C9.42655 6.78634 9.42655 7.23861 9.14751 7.51755L7.23049 9.43393C6.95145 9.71287 6.49904 9.71287 6.22 9.43393C5.94096 9.15498 5.94096 8.70272 6.22 8.42377L6.91725 7.72676L3.65802 7.72676C3.26339 7.72676 2.94349 7.40696 2.94349 7.01247C2.94349 6.61798 3.26339 6.29819 3.65802 6.29819L6.91725 6.29819L6.22 5.60117C5.94096 5.32223 5.94096 4.86997 6.22 4.59102Z"
      clip-rule="evenodd"
    />
  </svg>`,
    Pae = Ke`<svg
    width="14"
    height="14"
    viewBox="0 0 14 14"
    fill="none"
    xmlns="http://www.w3.org/2000/svg"
  >
    <path
      fill-rule="evenodd"
      clip-rule="evenodd"
      d="M13.7306 3.24213C14.0725 3.58384 14.0725 4.13786 13.7306 4.47957L10.7418 7.46737C10.4 7.80908 9.84581 7.80908 9.50399 7.46737C9.16216 7.12567 9.16216 6.57165 9.50399 6.22994L10.9986 4.73585H5.34082C4.85741 4.73585 4.46553 4.3441 4.46553 3.86085C4.46553 3.3776 4.85741 2.98585 5.34082 2.98585L10.9986 2.98585L9.50399 1.49177C9.16216 1.15006 9.16216 0.596037 9.50399 0.254328C9.84581 -0.0873803 10.4 -0.0873803 10.7418 0.254328L13.7306 3.24213ZM9.52515 10.1352C9.52515 10.6185 9.13327 11.0102 8.64986 11.0102L2.9921 11.0102L4.48669 12.5043C4.82852 12.846 4.82852 13.4001 4.48669 13.7418C4.14487 14.0835 3.59066 14.0835 3.24884 13.7418L0.26003 10.754C0.0958806 10.5899 0.0036621 10.3673 0.00366211 10.1352C0.00366212 9.90318 0.0958806 9.68062 0.26003 9.51652L3.24884 6.52872C3.59066 6.18701 4.14487 6.18701 4.48669 6.52872C4.82851 6.87043 4.82851 7.42445 4.48669 7.76616L2.9921 9.26024L8.64986 9.26024C9.13327 9.26024 9.52515 9.65199 9.52515 10.1352Z"
      fill="currentColor"
    />
  </svg>
  
  `,
    $ae = Ke`<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" fill="none">
    <path 
      fill="currentColor"
      fill-rule="evenodd" 
      clip-rule="evenodd" 
      d="M8.3071 0.292893C8.69763 0.683417 8.69763 1.31658 8.3071 1.70711L6.41421 3.6H11.3404C13.8368 3.6 16.0533 5.1975 16.8427 7.56588L16.9487 7.88377C17.1233 8.40772 16.8402 8.97404 16.3162 9.14868C15.7923 9.32333 15.226 9.04017 15.0513 8.51623L14.9453 8.19834C14.4281 6.64664 12.976 5.6 11.3404 5.6H6.41421L8.3071 7.49289C8.69763 7.88342 8.69763 8.51658 8.3071 8.90711C7.91658 9.29763 7.28341 9.29763 6.89289 8.90711L3.29289 5.30711C2.90236 4.91658 2.90236 4.28342 3.29289 3.89289L6.89289 0.292893C7.28341 -0.0976311 7.91658 -0.0976311 8.3071 0.292893ZM3.68377 10.8513C4.20771 10.6767 4.77403 10.9598 4.94868 11.4838L5.05464 11.8017C5.57188 13.3534 7.024 14.4 8.65964 14.4L13.5858 14.4L11.6929 12.5071C11.3024 12.1166 11.3024 11.4834 11.6929 11.0929C12.0834 10.7024 12.7166 10.7024 13.1071 11.0929L16.7071 14.6929C17.0976 15.0834 17.0976 15.7166 16.7071 16.1071L13.1071 19.7071C12.7166 20.0976 12.0834 20.0976 11.6929 19.7071C11.3024 19.3166 11.3024 18.6834 11.6929 18.2929L13.5858 16.4L8.65964 16.4C6.16314 16.4 3.94674 14.8025 3.15728 12.4341L3.05131 12.1162C2.87667 11.5923 3.15983 11.026 3.68377 10.8513Z" 
    />
  </svg>`,
    Oae = Ke`<svg fill="none" viewBox="0 0 14 14">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M3.48 2.18a1 1 0 0 1 1.41 0l2.68 2.68a1 1 0 1 1-1.41 1.42l-.98-.98v4.56a1 1 0 0 1-2 0V5.3l-.97.98A1 1 0 0 1 .79 4.86l2.69-2.68Zm6.34 2.93a1 1 0 0 1 1 1v4.56l.97-.98a1 1 0 1 1 1.42 1.42l-2.69 2.68a1 1 0 0 1-1.41 0l-2.68-2.68a1 1 0 0 1 1.41-1.42l.98.98V6.1a1 1 0 0 1 1-1Z"
      clip-rule="evenodd"
    />
  </svg>`,
    Dae = Ke`<svg width="32" height="32" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">
    <g clip-path="url(#a)">
      <path fill="url(#b)" d="M0 0h32v32H0z"/>
      <path fill-rule="evenodd" clip-rule="evenodd" d="M7.034 15.252c4.975-2.167 8.293-3.596 9.953-4.287 4.74-1.971 5.725-2.314 6.366-2.325.142-.002.457.033.662.198.172.14.22.33.243.463.022.132.05.435.028.671-.257 2.7-1.368 9.248-1.933 12.27-.24 1.28-.71 1.708-1.167 1.75-.99.091-1.743-.655-2.703-1.284-1.502-.985-2.351-1.598-3.81-2.558-1.684-1.11-.592-1.721.368-2.718.252-.261 4.619-4.233 4.703-4.594.01-.045.02-.213-.08-.301-.1-.09-.246-.059-.353-.035-.15.034-2.55 1.62-7.198 4.758-.682.468-1.298.696-1.851.684-.61-.013-1.782-.344-2.653-.628-1.069-.347-1.918-.53-1.845-1.12.039-.308.462-.623 1.27-.944Z" fill="#fff"/>
    </g>
    <path d="M.5 16C.5 7.44 7.44.5 16 .5 24.56.5 31.5 7.44 31.5 16c0 8.56-6.94 15.5-15.5 15.5C7.44 31.5.5 24.56.5 16Z" stroke="#141414" stroke-opacity=".05"/>
    <defs>
      <linearGradient id="b" x1="1600" y1="0" x2="1600" y2="3176.27" gradientUnits="userSpaceOnUse">
        <stop stop-color="#2AABEE"/>
        <stop offset="1" stop-color="#229ED9"/>
      </linearGradient>
      <clipPath id="a">
        <path d="M0 16C0 7.163 7.163 0 16 0s16 7.163 16 16-7.163 16-16 16S0 24.837 0 16Z" fill="#fff"/>
      </clipPath>
    </defs>
  </svg>`,
    Lae = Ke`<svg width="14" height="15" viewBox="0 0 14 15" fill="none" xmlns="http://www.w3.org/2000/svg">
    <path d="M7 3.71875C6.0335 3.71875 5.25 2.93525 5.25 1.96875C5.25 1.00225 6.0335 0.21875 7 0.21875C7.9665 0.21875 8.75 1.00225 8.75 1.96875C8.75 2.93525 7.9665 3.71875 7 3.71875Z" fill="#949E9E"/>
    <path d="M7 8.96875C6.0335 8.96875 5.25 8.18525 5.25 7.21875C5.25 6.25225 6.0335 5.46875 7 5.46875C7.9665 5.46875 8.75 6.25225 8.75 7.21875C8.75 8.18525 7.9665 8.96875 7 8.96875Z" fill="#949E9E"/>
    <path d="M5.25 12.4688C5.25 13.4352 6.0335 14.2187 7 14.2187C7.9665 14.2187 8.75 13.4352 8.75 12.4688C8.75 11.5023 7.9665 10.7188 7 10.7188C6.0335 10.7188 5.25 11.5023 5.25 12.4688Z" fill="#949E9E"/>
  </svg>`,
    Bae = Ke`<svg fill="none" viewBox="0 0 40 40">
    <g clip-path="url(#a)">
      <g clip-path="url(#b)">
        <circle cx="20" cy="19.89" r="20" fill="#5A3E85" />
        <g clip-path="url(#c)">
          <path
            fill="#fff"
            d="M18.22 25.7 20 23.91h3.34l2.1-2.1v-6.68H15.4v8.78h2.82v1.77Zm3.87-8.16h1.25v3.66H22.1v-3.66Zm-3.34 0H20v3.66h-1.25v-3.66ZM20 7.9a12 12 0 1 0 0 24 12 12 0 0 0 0-24Zm6.69 14.56-3.66 3.66h-2.72l-1.77 1.78h-1.88V26.1H13.3v-9.82l.94-2.4H26.7v8.56Z"
          />
        </g>
      </g>
    </g>
    <defs>
      <clipPath id="a"><rect width="40" height="40" fill="#fff" rx="20" /></clipPath>
      <clipPath id="b"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
      <clipPath id="c"><path fill="#fff" d="M8 7.89h24v24H8z" /></clipPath>
    </defs>
  </svg>`,
    Uae = Ke`<svg fill="none" viewBox="0 0 16 16">
    <path
      fill="currentColor"
      d="m14.36 4.74.01.42c0 4.34-3.3 9.34-9.34 9.34A9.3 9.3 0 0 1 0 13.03a6.6 6.6 0 0 0 4.86-1.36 3.29 3.29 0 0 1-3.07-2.28c.5.1 1 .07 1.48-.06A3.28 3.28 0 0 1 .64 6.11v-.04c.46.26.97.4 1.49.41A3.29 3.29 0 0 1 1.11 2.1a9.32 9.32 0 0 0 6.77 3.43 3.28 3.28 0 0 1 5.6-3 6.59 6.59 0 0 0 2.08-.8 3.3 3.3 0 0 1-1.45 1.82A6.53 6.53 0 0 0 16 3.04c-.44.66-1 1.23-1.64 1.7Z"
    />
  </svg>`,
    jae = Ke`<svg fill="none" viewBox="0 0 28 28">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M18.1 4.76c-.42-.73-1.33-1.01-2.09-.66l-1.42.66c-.37.18-.8.18-1.18 0l-1.4-.65a1.63 1.63 0 0 0-2.1.66l-.84 1.45c-.2.34-.53.59-.92.67l-1.7.35c-.83.17-1.39.94-1.3 1.78l.19 1.56c.04.39-.08.78-.33 1.07l-1.12 1.3c-.52.6-.52 1.5 0 2.11L5 16.38c.25.3.37.68.33 1.06l-.18 1.57c-.1.83.46 1.6 1.28 1.78l1.7.35c.4.08.73.32.93.66l.84 1.43a1.63 1.63 0 0 0 2.09.66l1.41-.66c.37-.17.8-.17 1.18 0l1.43.67c.76.35 1.66.07 2.08-.65l.86-1.45c.2-.34.54-.58.92-.66l1.68-.35A1.63 1.63 0 0 0 22.84 19l-.18-1.57a1.4 1.4 0 0 1 .33-1.06l1.12-1.32c.52-.6.52-1.5 0-2.11l-1.12-1.3a1.4 1.4 0 0 1-.33-1.07l.18-1.57c.1-.83-.46-1.6-1.28-1.77l-1.68-.35a1.4 1.4 0 0 1-.92-.66l-.86-1.47Zm-3.27-3.2a4.43 4.43 0 0 1 5.69 1.78l.54.93 1.07.22a4.43 4.43 0 0 1 3.5 4.84l-.11.96.7.83a4.43 4.43 0 0 1 .02 5.76l-.72.85.1.96a4.43 4.43 0 0 1-3.5 4.84l-1.06.22-.54.92a4.43 4.43 0 0 1-5.68 1.77l-.84-.4-.82.39a4.43 4.43 0 0 1-5.7-1.79l-.51-.89-1.09-.22a4.43 4.43 0 0 1-3.5-4.84l.1-.96-.72-.85a4.43 4.43 0 0 1 .01-5.76l.71-.83-.1-.95a4.43 4.43 0 0 1 3.5-4.84l1.08-.23.53-.9a4.43 4.43 0 0 1 5.7-1.8l.81.38.83-.39ZM18.2 9.4c.65.42.84 1.28.42 1.93l-4.4 6.87a1.4 1.4 0 0 1-2.26.14L9.5 15.39a1.4 1.4 0 0 1 2.15-1.8l1.23 1.48 3.38-5.26a1.4 1.4 0 0 1 1.93-.42Z"
      clip-rule="evenodd"
    />
  </svg>`,
    Fae = Ke`<svg fill="none" viewBox="0 0 14 14">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="m4.1 12.43-.45-.78-.93-.2a1.65 1.65 0 0 1-1.31-1.8l.1-.86-.61-.71a1.65 1.65 0 0 1 0-2.16l.6-.7-.09-.85c-.1-.86.47-1.64 1.3-1.81l.94-.2.45-.78A1.65 1.65 0 0 1 6.23.9l.77.36.78-.36c.77-.36 1.69-.07 2.12.66l.47.8.91.2c.84.17 1.4.95 1.31 1.8l-.1.86.6.7c.54.62.54 1.54.01 2.16l-.6.71.09.86c.1.85-.47 1.63-1.3 1.8l-.92.2-.47.79a1.65 1.65 0 0 1-2.12.66L7 12.74l-.77.36c-.78.35-1.7.07-2.13-.67Zm5.74-6.9a1 1 0 1 0-1.68-1.07L6.32 7.3l-.55-.66a1 1 0 0 0-1.54 1.28l1.43 1.71a1 1 0 0 0 1.61-.1l2.57-4Z"
      clip-rule="evenodd"
    />
  </svg>`,
    Wae = Ke`
    <svg fill="none" viewBox="0 0 48 44">
      <path
        style="fill: var(--wiu-color-bg-300);"
        d="M4.56 8.64c-1.23 1.68-1.23 4.08-1.23 8.88v8.96c0 4.8 0 7.2 1.23 8.88.39.55.87 1.02 1.41 1.42C7.65 38 10.05 38 14.85 38h14.3c4.8 0 7.2 0 8.88-1.22a6.4 6.4 0 0 0 1.41-1.42c.83-1.14 1.1-2.6 1.19-4.92a6.4 6.4 0 0 0 5.16-4.65c.21-.81.21-1.8.21-3.79 0-1.98 0-2.98-.22-3.79a6.4 6.4 0 0 0-5.15-4.65c-.1-2.32-.36-3.78-1.19-4.92a6.4 6.4 0 0 0-1.41-1.42C36.35 6 33.95 6 29.15 6h-14.3c-4.8 0-7.2 0-8.88 1.22a6.4 6.4 0 0 0-1.41 1.42Z"
      />
      <path
        style="fill: var(--wiu-color-fg-200);"
        fill-rule="evenodd"
        d="M2.27 11.33a6.4 6.4 0 0 1 6.4-6.4h26.66a6.4 6.4 0 0 1 6.4 6.4v1.7a6.4 6.4 0 0 1 5.34 6.3v5.34a6.4 6.4 0 0 1-5.34 6.3v1.7a6.4 6.4 0 0 1-6.4 6.4H8.67a6.4 6.4 0 0 1-6.4-6.4V11.33ZM39.6 31.07h-6.93a9.07 9.07 0 1 1 0-18.14h6.93v-1.6a4.27 4.27 0 0 0-4.27-4.26H8.67a4.27 4.27 0 0 0-4.27 4.26v21.34a4.27 4.27 0 0 0 4.27 4.26h26.66a4.27 4.27 0 0 0 4.27-4.26v-1.6Zm-6.93-16a6.93 6.93 0 0 0 0 13.86h8a4.27 4.27 0 0 0 4.26-4.26v-5.34a4.27 4.27 0 0 0-4.26-4.26h-8Z"
        clip-rule="evenodd"
      />
    </svg>
  `,
    zae = Ke`<svg fill="none" viewBox="0 0 20 20">
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M0 5.5c0-1.8 1.46-3.25 3.25-3.25H14.5c1.8 0 3.25 1.46 3.25 3.25v.28A3.25 3.25 0 0 1 20 8.88v2.24c0 1.45-.94 2.68-2.25 3.1v.28c0 1.8-1.46 3.25-3.25 3.25H3.25A3.25 3.25 0 0 1 0 14.5v-9Zm15.75 8.88h-2.38a4.38 4.38 0 0 1 0-8.76h2.38V5.5c0-.69-.56-1.25-1.25-1.25H3.25C2.56 4.25 2 4.81 2 5.5v9c0 .69.56 1.25 1.25 1.25H14.5c.69 0 1.25-.56 1.25-1.25v-.13Zm-2.38-6.76a2.37 2.37 0 1 0 0 4.75h3.38c.69 0 1.25-.55 1.25-1.24V8.87c0-.69-.56-1.24-1.25-1.24h-3.38Z"
      clip-rule="evenodd"
    />
  </svg>`,
    Hae = Ke`<svg fill="none" viewBox="0 0 96 67">
    <path
      fill="currentColor"
      d="M25.32 18.8a32.56 32.56 0 0 1 45.36 0l1.5 1.47c.63.62.63 1.61 0 2.22l-5.15 5.05c-.31.3-.82.3-1.14 0l-2.07-2.03a22.71 22.71 0 0 0-31.64 0l-2.22 2.18c-.31.3-.82.3-1.14 0l-5.15-5.05a1.55 1.55 0 0 1 0-2.22l1.65-1.62Zm56.02 10.44 4.59 4.5c.63.6.63 1.6 0 2.21l-20.7 20.26c-.62.61-1.63.61-2.26 0L48.28 41.83a.4.4 0 0 0-.56 0L33.03 56.21c-.63.61-1.64.61-2.27 0L10.07 35.95a1.55 1.55 0 0 1 0-2.22l4.59-4.5a1.63 1.63 0 0 1 2.27 0L31.6 43.63a.4.4 0 0 0 .57 0l14.69-14.38a1.63 1.63 0 0 1 2.26 0l14.69 14.38a.4.4 0 0 0 .57 0l14.68-14.38a1.63 1.63 0 0 1 2.27 0Z"
    />
    <path
      stroke="#000"
      stroke-opacity=".1"
      d="M25.67 19.15a32.06 32.06 0 0 1 44.66 0l1.5 1.48c.43.42.43 1.09 0 1.5l-5.15 5.05a.31.31 0 0 1-.44 0l-2.07-2.03a23.21 23.21 0 0 0-32.34 0l-2.22 2.18a.31.31 0 0 1-.44 0l-5.15-5.05a1.05 1.05 0 0 1 0-1.5l1.65-1.63ZM81 29.6l4.6 4.5c.42.41.42 1.09 0 1.5l-20.7 20.26c-.43.43-1.14.43-1.57 0L48.63 41.47a.9.9 0 0 0-1.26 0L32.68 55.85c-.43.43-1.14.43-1.57 0L10.42 35.6a1.05 1.05 0 0 1 0-1.5l4.59-4.5a1.13 1.13 0 0 1 1.57 0l14.68 14.38a.9.9 0 0 0 1.27 0l-.35-.35.35.35L47.22 29.6a1.13 1.13 0 0 1 1.56 0l14.7 14.38a.9.9 0 0 0 1.26 0L79.42 29.6a1.13 1.13 0 0 1 1.57 0Z"
    />
  </svg>`,
    qae = Ke`
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  <g clip-path="url(#clip0_22274_4692)">
  <path d="M0 6.64C0 4.17295 0 2.93942 0.525474 2.01817C0.880399 1.39592 1.39592 0.880399 2.01817 0.525474C2.93942 0 4.17295 0 6.64 0H9.36C11.8271 0 13.0606 0 13.9818 0.525474C14.6041 0.880399 15.1196 1.39592 15.4745 2.01817C16 2.93942 16 4.17295 16 6.64V9.36C16 11.8271 16 13.0606 15.4745 13.9818C15.1196 14.6041 14.6041 15.1196 13.9818 15.4745C13.0606 16 11.8271 16 9.36 16H6.64C4.17295 16 2.93942 16 2.01817 15.4745C1.39592 15.1196 0.880399 14.6041 0.525474 13.9818C0 13.0606 0 11.8271 0 9.36V6.64Z" fill="#C7B994"/>
  <path d="M4.49038 5.76609C6.42869 3.86833 9.5713 3.86833 11.5096 5.76609L11.7429 5.99449C11.8398 6.08938 11.8398 6.24323 11.7429 6.33811L10.9449 7.11942C10.8964 7.16686 10.8179 7.16686 10.7694 7.11942L10.4484 6.80512C9.09617 5.48119 6.90381 5.48119 5.5516 6.80512L5.20782 7.14171C5.15936 7.18915 5.08079 7.18915 5.03234 7.14171L4.23434 6.3604C4.13742 6.26552 4.13742 6.11167 4.23434 6.01678L4.49038 5.76609ZM13.1599 7.38192L13.8702 8.07729C13.9671 8.17217 13.9671 8.32602 13.8702 8.4209L10.6677 11.5564C10.5708 11.6513 10.4137 11.6513 10.3168 11.5564L8.04388 9.33105C8.01965 9.30733 7.98037 9.30733 7.95614 9.33105L5.6833 11.5564C5.58638 11.6513 5.42925 11.6513 5.33234 11.5564L2.12982 8.42087C2.0329 8.32598 2.0329 8.17213 2.12982 8.07724L2.84004 7.38188C2.93695 7.28699 3.09408 7.28699 3.191 7.38188L5.46392 9.60726C5.48815 9.63098 5.52743 9.63098 5.55166 9.60726L7.82447 7.38188C7.92138 7.28699 8.07851 7.28699 8.17543 7.38187L10.4484 9.60726C10.4726 9.63098 10.5119 9.63098 10.5361 9.60726L12.809 7.38192C12.9059 7.28703 13.063 7.28703 13.1599 7.38192Z" fill="#202020"/>
  </g>
  <defs>
  <clipPath id="clip0_22274_4692">
  <path d="M0 8C0 3.58172 3.58172 0 8 0C12.4183 0 16 3.58172 16 8C16 12.4183 12.4183 16 8 16C3.58172 16 0 12.4183 0 8Z" fill="white"/>
  </clipPath>
  </defs>
  </svg>
  `,
    Vae = Ke`
  <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
  <circle cx="11" cy="11" r="11" transform="matrix(-1 0 0 1 23 1)" fill="#202020"/>
  <circle cx="11" cy="11" r="11.5" transform="matrix(-1 0 0 1 23 1)" stroke="#C7B994" stroke-opacity="0.7"/>
  <path d="M15.4523 11.0686L16.7472 9.78167C13.8205 6.87297 10.1838 6.87297 7.25708 9.78167L8.55201 11.0686C10.7779 8.85645 13.2279 8.85645 15.4538 11.0686H15.4523Z" fill="#C7B994"/>
  <path d="M15.0199 14.067L12 11.0656L8.98 14.067L5.96004 11.0656L4.66663 12.3511L8.98 16.6393L12 13.638L15.0199 16.6393L19.3333 12.3511L18.0399 11.0656L15.0199 14.067Z" fill="#C7B994"/>
  </svg>
  `,
    Kae = Ke`<svg fill="none" viewBox="0 0 20 20">
    <path
      fill="currentColor"
      d="M11 6.67a1 1 0 1 0-2 0v2.66a1 1 0 0 0 2 0V6.67ZM10 14.5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z"
    />
    <path
      fill="currentColor"
      fill-rule="evenodd"
      d="M10 1a9 9 0 1 0 0 18 9 9 0 0 0 0-18Zm-7 9a7 7 0 1 1 14 0 7 7 0 0 1-14 0Z"
      clip-rule="evenodd"
    />
  </svg>`,
    Gae = Ke`<svg width="10" height="10" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg">
  <path fill-rule="evenodd" clip-rule="evenodd" d="M5.00177 1.78569C3.8179 1.78569 2.85819 2.74508 2.85819 3.92855C2.85819 4.52287 3.09928 5.05956 3.49077 5.4485L3.5005 5.45817C3.64381 5.60054 3.76515 5.72108 3.85631 5.81845C3.93747 5.90512 4.05255 6.03218 4.12889 6.1805C4.16999 6.26034 4.19 6.30843 4.21768 6.39385C4.22145 6.40546 4.22499 6.41703 4.22833 6.42855H5.77521C5.77854 6.41703 5.78208 6.40547 5.78585 6.39385C5.81353 6.30843 5.83354 6.26034 5.87464 6.1805C5.95098 6.03218 6.06606 5.90512 6.14722 5.81845C6.23839 5.72108 6.35973 5.60053 6.50304 5.45816L6.51276 5.4485C6.90425 5.05956 7.14534 4.52287 7.14534 3.92855C7.14534 2.74508 6.18563 1.78569 5.00177 1.78569ZM5.71629 7.85712H4.28724C4.28724 8.21403 4.28876 8.40985 4.30703 8.54571C4.30727 8.54748 4.30751 8.54921 4.30774 8.55091C4.30944 8.55115 4.31118 8.55138 4.31295 8.55162C4.44884 8.56989 4.64474 8.5714 5.00177 8.5714C5.3588 8.5714 5.55469 8.56989 5.69059 8.55162C5.69236 8.55138 5.69409 8.55115 5.69579 8.55091C5.69603 8.54921 5.69627 8.54748 5.6965 8.54571C5.71477 8.40985 5.71629 8.21403 5.71629 7.85712ZM2.85819 7.14283C2.85819 6.9948 2.85796 6.91114 2.8548 6.85032C2.85461 6.84656 2.85441 6.84309 2.85421 6.83988C2.84393 6.8282 2.83047 6.81334 2.81301 6.79469C2.74172 6.71856 2.63908 6.61643 2.48342 6.46178C1.83307 5.81566 1.42914 4.91859 1.42914 3.92855C1.42914 1.9561 3.02866 0.357117 5.00177 0.357117C6.97487 0.357117 8.57439 1.9561 8.57439 3.92855C8.57439 4.91859 8.17047 5.81566 7.52012 6.46178C7.36445 6.61643 7.26182 6.71856 7.19053 6.79469C7.17306 6.81334 7.1596 6.8282 7.14932 6.83988C7.14912 6.84309 7.14892 6.84656 7.14873 6.85032C7.14557 6.91114 7.14534 6.9948 7.14534 7.14283V7.85712C7.14534 7.87009 7.14535 7.88304 7.14535 7.89598C7.14541 8.19889 7.14547 8.49326 7.11281 8.73606C7.076 9.00978 6.98631 9.32212 6.72678 9.58156C6.46726 9.841 6.15481 9.93065 5.881 9.96745C5.63813 10.0001 5.34365 10 5.04064 9.99998C5.0277 9.99998 5.01474 9.99998 5.00177 9.99998C4.98879 9.99998 4.97583 9.99998 4.96289 9.99998C4.65988 10 4.36541 10.0001 4.12253 9.96745C3.84872 9.93065 3.53628 9.841 3.27675 9.58156C3.01722 9.32212 2.92753 9.00978 2.89072 8.73606C2.85807 8.49326 2.85812 8.19889 2.85818 7.89598C2.85819 7.88304 2.85819 7.87008 2.85819 7.85712V7.14283ZM7.1243 6.86977C7.12366 6.87069 7.1233 6.87116 7.12327 6.87119C7.12323 6.87123 7.12356 6.87076 7.1243 6.86977ZM2.88027 6.8712C2.88025 6.87119 2.87988 6.8707 2.87921 6.86975C2.87995 6.87072 2.88028 6.8712 2.88027 6.8712Z" fill="#949E9E"/>
  </svg>`,
    Zae = Ke`<svg
   xmlns="http://www.w3.org/2000/svg"
   width="28"
   height="28"
   viewBox="0 0 28 28"
   fill="none">
    <path
      fill="#949E9E"
      fill-rule="evenodd"
      d="M7.974 2.975h12.052c1.248 0 2.296 0 3.143.092.89.096 1.723.307 2.461.844a4.9 4.9 0 0 1 1.084 1.084c.537.738.748 1.57.844 2.461.092.847.092 1.895.092 3.143v6.802c0 1.248 0 2.296-.092 3.143-.096.89-.307 1.723-.844 2.461a4.9 4.9 0 0 1-1.084 1.084c-.738.537-1.57.748-2.461.844-.847.092-1.895.092-3.143.092H7.974c-1.247 0-2.296 0-3.143-.092-.89-.096-1.723-.307-2.461-.844a4.901 4.901 0 0 1-1.084-1.084c-.537-.738-.748-1.571-.844-2.461C.35 19.697.35 18.649.35 17.4v-6.802c0-1.248 0-2.296.092-3.143.096-.89.307-1.723.844-2.461A4.9 4.9 0 0 1 2.37 3.91c.738-.537 1.571-.748 2.461-.844.847-.092 1.895-.092 3.143-.092ZM5.133 5.85c-.652.071-.936.194-1.117.326a2.1 2.1 0 0 0-.465.465c-.132.181-.255.465-.325 1.117-.074.678-.076 1.573-.076 2.917v6.65c0 1.344.002 2.239.076 2.917.07.652.193.936.325 1.117a2.1 2.1 0 0 0 .465.465c.181.132.465.255 1.117.326.678.073 1.574.075 2.917.075h11.9c1.344 0 2.239-.002 2.917-.075.652-.071.936-.194 1.117-.326.179-.13.335-.286.465-.465.132-.181.255-.465.326-1.117.073-.678.075-1.573.075-2.917v-6.65c0-1.344-.002-2.239-.075-2.917-.071-.652-.194-.936-.326-1.117a2.1 2.1 0 0 0-.465-.465c-.181-.132-.465-.255-1.117-.326-.678-.073-1.573-.075-2.917-.075H8.05c-1.343 0-2.239.002-2.917.075Zm.467 7.275a3.15 3.15 0 1 1 6.3 0 3.15 3.15 0 0 1-6.3 0Zm8.75-1.75a1.4 1.4 0 0 1 1.4-1.4h3.5a1.4 1.4 0 0 1 0 2.8h-3.5a1.4 1.4 0 0 1-1.4-1.4Zm0 5.25a1.4 1.4 0 0 1 1.4-1.4H21a1.4 1.4 0 1 1 0 2.8h-5.25a1.4 1.4 0 0 1-1.4-1.4Z"
      clip-rule="evenodd"/>
  </svg>`,
    SP = Ke`<svg fill="none" viewBox="0 0 41 40">
    <g clip-path="url(#a)">
      <path fill="#000" d="M.8 0h40v40H.8z" />
      <path
        fill="#fff"
        d="m22.63 18.46 7.14-8.3h-1.69l-6.2 7.2-4.96-7.2H11.2l7.5 10.9-7.5 8.71h1.7l6.55-7.61 5.23 7.61h5.72l-7.77-11.31Zm-9.13-7.03h2.6l11.98 17.13h-2.6L13.5 11.43Z"
      />
    </g>
    <defs>
      <clipPath id="a"><path fill="#fff" d="M.8 20a20 20 0 1 1 40 0 20 20 0 0 1-40 0Z" /></clipPath>
    </defs>
  </svg>`,
    Yae = Ke`<svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
  <path d="M9.125 6.875C9.125 6.57833 9.21298 6.28832 9.3778 6.04165C9.54262 5.79497 9.77689 5.60271 10.051 5.48918C10.3251 5.37565 10.6267 5.34594 10.9176 5.40382C11.2086 5.4617 11.4759 5.60456 11.6857 5.81434C11.8954 6.02412 12.0383 6.29139 12.0962 6.58236C12.1541 6.87334 12.1244 7.17494 12.0108 7.44903C11.8973 7.72311 11.705 7.95738 11.4584 8.1222C11.2117 8.28703 10.9217 8.375 10.625 8.375C10.2272 8.375 9.84565 8.21696 9.56434 7.93566C9.28304 7.65436 9.125 7.27282 9.125 6.875ZM21.125 11C21.125 13.0025 20.5312 14.9601 19.4186 16.6251C18.3061 18.2902 16.7248 19.5879 14.8747 20.3543C13.0246 21.1206 10.9888 21.3211 9.02471 20.9305C7.06066 20.5398 5.25656 19.5755 3.84055 18.1595C2.42454 16.7435 1.46023 14.9393 1.06955 12.9753C0.678878 11.0112 0.879387 8.97543 1.64572 7.12533C2.41206 5.27523 3.70981 3.69392 5.37486 2.58137C7.0399 1.46882 8.99747 0.875 11 0.875C13.6844 0.877978 16.258 1.94567 18.1562 3.84383C20.0543 5.74199 21.122 8.3156 21.125 11ZM18.875 11C18.875 9.44247 18.4131 7.91992 17.5478 6.62488C16.6825 5.32985 15.4526 4.32049 14.0136 3.72445C12.5747 3.12841 10.9913 2.97246 9.46367 3.27632C7.93607 3.58017 6.53288 4.3302 5.43154 5.43153C4.3302 6.53287 3.58018 7.93606 3.27632 9.46366C2.97246 10.9913 3.12841 12.5747 3.72445 14.0136C4.32049 15.4526 5.32985 16.6825 6.62489 17.5478C7.91993 18.4131 9.44248 18.875 11 18.875C13.0879 18.8728 15.0896 18.0424 16.566 16.566C18.0424 15.0896 18.8728 13.0879 18.875 11ZM12.125 14.4387V11.375C12.125 10.8777 11.9275 10.4008 11.5758 10.0492C11.2242 9.69754 10.7473 9.5 10.25 9.5C9.98433 9.4996 9.72708 9.59325 9.52383 9.76435C9.32058 9.93544 9.18444 10.173 9.13952 10.4348C9.09461 10.6967 9.14381 10.966 9.27843 11.195C9.41304 11.4241 9.62438 11.5981 9.875 11.6863V14.75C9.875 15.2473 10.0725 15.7242 10.4242 16.0758C10.7758 16.4275 11.2527 16.625 11.75 16.625C12.0157 16.6254 12.2729 16.5318 12.4762 16.3607C12.6794 16.1896 12.8156 15.952 12.8605 15.6902C12.9054 15.4283 12.8562 15.159 12.7216 14.93C12.587 14.7009 12.3756 14.5269 12.125 14.4387Z" fill="currentColor"/>
  </svg>`,
    Qae = Ke`<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
  <path d="M15.0162 11.6312L9.55059 2.13937C9.39228 1.86862 9.16584 1.64405 8.8938 1.48798C8.62176 1.33192 8.3136 1.2498 7.99997 1.2498C7.68634 1.2498 7.37817 1.33192 7.10613 1.48798C6.83409 1.64405 6.60765 1.86862 6.44934 2.13937L0.983716 11.6312C0.830104 11.894 0.749146 12.1928 0.749146 12.4972C0.749146 12.8015 0.830104 13.1004 0.983716 13.3631C1.14027 13.6352 1.3664 13.8608 1.63889 14.0166C1.91139 14.1725 2.22044 14.253 2.53434 14.25H13.4656C13.7793 14.2528 14.0881 14.1721 14.3603 14.0163C14.6326 13.8604 14.8585 13.635 15.015 13.3631C15.1688 13.1005 15.2499 12.8017 15.2502 12.4973C15.2504 12.193 15.1696 11.8941 15.0162 11.6312ZM13.7162 12.6125C13.6908 12.6558 13.6541 12.6914 13.6101 12.7157C13.5661 12.7399 13.5164 12.7517 13.4662 12.75H2.53434C2.48415 12.7517 2.43442 12.7399 2.39042 12.7157C2.34641 12.6914 2.30976 12.6558 2.28434 12.6125C2.26278 12.5774 2.25137 12.5371 2.25137 12.4959C2.25137 12.4548 2.26278 12.4144 2.28434 12.3794L7.74997 2.88749C7.77703 2.84583 7.81408 2.8116 7.85774 2.7879C7.9014 2.7642 7.95029 2.75178 7.99997 2.75178C8.04964 2.75178 8.09854 2.7642 8.1422 2.7879C8.18586 2.8116 8.2229 2.84583 8.24997 2.88749L13.715 12.3794C13.7367 12.4143 13.7483 12.4546 13.7486 12.4958C13.7488 12.5369 13.7376 12.5773 13.7162 12.6125ZM7.24997 8.49999V6.49999C7.24997 6.30108 7.32898 6.11031 7.46964 5.96966C7.61029 5.82901 7.80105 5.74999 7.99997 5.74999C8.19888 5.74999 8.38964 5.82901 8.5303 5.96966C8.67095 6.11031 8.74997 6.30108 8.74997 6.49999V8.49999C8.74997 8.6989 8.67095 8.88967 8.5303 9.03032C8.38964 9.17097 8.19888 9.24999 7.99997 9.24999C7.80105 9.24999 7.61029 9.17097 7.46964 9.03032C7.32898 8.88967 7.24997 8.6989 7.24997 8.49999ZM8.99997 11C8.99997 11.1978 8.94132 11.3911 8.83144 11.5556C8.72155 11.72 8.56538 11.8482 8.38265 11.9239C8.19992 11.9996 7.99886 12.0194 7.80488 11.9808C7.6109 11.9422 7.43271 11.847 7.29286 11.7071C7.15301 11.5672 7.05777 11.3891 7.01918 11.1951C6.9806 11.0011 7.0004 10.8 7.07609 10.6173C7.15177 10.4346 7.27995 10.2784 7.4444 10.1685C7.60885 10.0586 7.80219 9.99999 7.99997 9.99999C8.26518 9.99999 8.51954 10.1053 8.70707 10.2929C8.89461 10.4804 8.99997 10.7348 8.99997 11Z" fill="currentColor"/>
  </svg>
  `;
  var qy = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const Jae = {
    add: Moe,
    allWallets: Poe,
    arrowBottomCircle: $oe,
    appStore: Ooe,
    apple: Doe,
    arrowBottom: Loe,
    arrowLeft: Boe,
    arrowRight: Uoe,
    arrowTop: joe,
    bank: Foe,
    browser: Woe,
    card: zoe,
    checkmark: qoe,
    checkmarkBold: Hoe,
    chevronBottom: Voe,
    chevronLeft: Koe,
    chevronRight: Goe,
    chevronTop: Zoe,
    chromeStore: Yoe,
    clock: Qoe,
    close: Joe,
    compass: eae,
    coinPlaceholder: Xoe,
    copy: tae,
    cursor: rae,
    cursorTransparent: nae,
    desktop: iae,
    disconnect: sae,
    discord: oae,
    etherscan: aae,
    extension: cae,
    externalLink: lae,
    facebook: uae,
    farcaster: dae,
    filters: hae,
    github: fae,
    google: pae,
    helpCircle: gae,
    image: mae,
    id: Zae,
    infoCircle: wae,
    lightbulb: Gae,
    mail: vae,
    mobile: bae,
    more: yae,
    networkPlaceholder: _ae,
    nftPlaceholder: xae,
    off: Cae,
    playStore: Eae,
    plus: Aae,
    qrCode: Sae,
    recycleHorizontal: Iae,
    refresh: Tae,
    search: kae,
    send: Rae,
    swapHorizontal: Nae,
    swapHorizontalMedium: Pae,
    swapHorizontalBold: Mae,
    swapHorizontalRoundedBold: $ae,
    swapVertical: Oae,
    telegram: Dae,
    threeDots: Lae,
    twitch: Bae,
    twitter: SP,
    twitterIcon: Uae,
    verify: jae,
    verifyFilled: Fae,
    wallet: zae,
    walletConnect: Hae,
    walletConnectLightBrown: qae,
    walletConnectBrown: Vae,
    walletPlaceholder: Wae,
    warningCircle: Kae,
    x: SP,
    info: Yae,
    exclamationTriangle: Qae
  };
  let jf = class extends _e {
    constructor() {
      super(...arguments), this.size = "md", this.name = "copy", this.color = "fg-300"
    }
    render() {
      return this.style.cssText = `
        --local-color: ${`var(--wiu-color-${this.color});`}
        --local-width: ${`var(--wiu-icon-size-${this.size});`}
      `, K`${Jae[this.name]}`
    }
  };
  jf.styles = [ft, d2, Noe], qy([re()], jf.prototype, "size", void 0), qy([re()], jf.prototype, "name", void 0), qy([re()], jf.prototype, "color", void 0), jf = qy([ye("wiu-icon")], jf);
  const Xae = Re`
    :host {
      display: block;
      width: var(--local-width);
      height: var(--local-height);
    }
  
    img {
      display: block;
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center center;
      border-radius: inherit;
    }
  `;
  var Vy = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Ff = class extends _e {
    constructor() {
      super(...arguments), this.src = "./path/to/image.jpg", this.alt = "Image", this.size = void 0
    }
    render() {
      return this.style.cssText = `
        --local-width: ${this.size?`var(--wiu-icon-size-${this.size});`:"100%"};
        --local-height: ${this.size?`var(--wiu-icon-size-${this.size});`:"100%"};
        `, K`<img src=${this.src} alt=${this.alt} @error=${this.handleImageError} />`
    }
    handleImageError() {
      this.dispatchEvent(new CustomEvent("onLoadError", {
        bubbles: !0,
        composed: !0
      }))
    }
  };
  Ff.styles = [ft, d2, Xae], Vy([re()], Ff.prototype, "src", void 0), Vy([re()], Ff.prototype, "alt", void 0), Vy([re()], Ff.prototype, "size", void 0), Ff = Vy([ye("wiu-image")], Ff);
  const ece = Re`
    :host {
      display: block;
      width: var(--wiu-box-size-lg);
      height: var(--wiu-box-size-lg);
    }
  
    svg {
      width: var(--wiu-box-size-lg);
      height: var(--wiu-box-size-lg);
      fill: none;
      stroke: transparent;
      stroke-linecap: round;
    }
  
    use {
      stroke: var(--wiu-color-accent-100);
      stroke-width: 2px;
      stroke-dasharray: 54, 118;
      stroke-dashoffset: 172;
      animation: dash 1s linear infinite;
    }
  
    @keyframes dash {
      to {
        stroke-dashoffset: 0px;
      }
    }
  `;
  var tce = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Ky = class extends _e {
    render() {
      return K`
        <svg viewBox="0 0 54 59">
          <path
            id="wiu-loader-path"
            d="M17.22 5.295c3.877-2.277 5.737-3.363 7.72-3.726a11.44 11.44 0 0 1 4.12 0c1.983.363 3.844 1.45 7.72 3.726l6.065 3.562c3.876 2.276 5.731 3.372 7.032 4.938a11.896 11.896 0 0 1 2.06 3.63c.683 1.928.688 4.11.688 8.663v7.124c0 4.553-.005 6.735-.688 8.664a11.896 11.896 0 0 1-2.06 3.63c-1.3 1.565-3.156 2.66-7.032 4.937l-6.065 3.563c-3.877 2.276-5.737 3.362-7.72 3.725a11.46 11.46 0 0 1-4.12 0c-1.983-.363-3.844-1.449-7.72-3.726l-6.065-3.562c-3.876-2.276-5.731-3.372-7.032-4.938a11.885 11.885 0 0 1-2.06-3.63c-.682-1.928-.688-4.11-.688-8.663v-7.124c0-4.553.006-6.735.688-8.664a11.885 11.885 0 0 1 2.06-3.63c1.3-1.565 3.156-2.66 7.032-4.937l6.065-3.562Z"
          />
          <use xlink:href="#wiu-loader-path"></use>
        </svg>
      `
    }
  };
  Ky.styles = [ft, ece], Ky = tce([ye("wiu-loading-hexagon")], Ky);
  const rce = Re`
    :host {
      display: flex;
    }
  
    :host([data-size='sm']) > svg {
      width: 12px;
      height: 12px;
    }
  
    :host([data-size='md']) > svg {
      width: 16px;
      height: 16px;
    }
  
    :host([data-size='lg']) > svg {
      width: 24px;
      height: 24px;
    }
  
    :host([data-size='xl']) > svg {
      width: 32px;
      height: 32px;
    }
  
    svg {
      animation: rotate 2s linear infinite;
    }
  
    circle {
      fill: none;
      stroke: var(--local-color);
      stroke-width: 4px;
      stroke-dasharray: 1, 124;
      stroke-dashoffset: 0;
      stroke-linecap: round;
      animation: dash 1.5s ease-in-out infinite;
    }
  
    :host([data-size='md']) > svg > circle {
      stroke-width: 6px;
    }
  
    :host([data-size='sm']) > svg > circle {
      stroke-width: 8px;
    }
  
    @keyframes rotate {
      100% {
        transform: rotate(360deg);
      }
    }
  
    @keyframes dash {
      0% {
        stroke-dasharray: 1, 124;
        stroke-dashoffset: 0;
      }
  
      50% {
        stroke-dasharray: 90, 124;
        stroke-dashoffset: -35;
      }
  
      100% {
        stroke-dashoffset: -125;
      }
    }
  `;
  var dx = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let k1 = class extends _e {
    constructor() {
      super(...arguments), this.color = "accent-100", this.size = "lg"
    }
    render() {
      return this.style.cssText = `--local-color: ${this.color==="inherit"?"inherit":`var(--wiu-color-${this.color})`}`, this.dataset.size = this.size, K`<svg viewBox="25 25 50 50">
        <circle r="20" cy="50" cx="50"></circle>
      </svg>`
    }
  };
  k1.styles = [ft, rce], dx([re()], k1.prototype, "color", void 0), dx([re()], k1.prototype, "size", void 0), k1 = dx([ye("wiu-loading-spinner")], k1);
  const nce = Re`
    :host {
      display: block;
      width: var(--wiu-box-size-md);
      height: var(--wiu-box-size-md);
    }
  
    svg {
      width: var(--wiu-box-size-md);
      height: var(--wiu-box-size-md);
    }
  
    rect {
      fill: none;
      stroke: var(--wiu-color-accent-100);
      stroke-width: 4px;
      stroke-linecap: round;
      animation: dash 1s linear infinite;
    }
  
    @keyframes dash {
      to {
        stroke-dashoffset: 0px;
      }
    }
  `;
  var IP = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let h2 = class extends _e {
    constructor() {
      super(...arguments), this.radius = 36
    }
    render() {
      return this.svgLoaderTemplate()
    }
    svgLoaderTemplate() {
      const e = this.radius > 50 ? 50 : this.radius,
        n = 36 - e,
        i = 116 + n,
        s = 245 + n,
        o = 360 + n * 1.75;
      return K`
        <svg viewBox="0 0 110 110" width="110" height="110">
          <rect
            x="2"
            y="2"
            width="106"
            height="106"
            rx=${e}
            stroke-dasharray="${i} ${s}"
            stroke-dashoffset=${o}
          />
        </svg>
      `
    }
  };
  h2.styles = [ft, nce], IP([re({
    type: Number
  })], h2.prototype, "radius", void 0), h2 = IP([ye("wiu-loading-thumbnail")], h2);
  const ice = Re`
    :host {
      display: block;
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-005);
      background: linear-gradient(
        120deg,
        var(--wiu-color-bg-200) 5%,
        var(--wiu-color-bg-200) 48%,
        var(--wiu-color-bg-300) 55%,
        var(--wiu-color-bg-300) 60%,
        var(--wiu-color-bg-300) calc(60% + 10px),
        var(--wiu-color-bg-200) calc(60% + 12px),
        var(--wiu-color-bg-200) 100%
      );
      background-size: 250%;
      animation: shimmer 3s linear infinite reverse;
    }
  
    :host([variant='light']) {
      background: linear-gradient(
        120deg,
        var(--wiu-color-bg-150) 5%,
        var(--wiu-color-bg-150) 48%,
        var(--wiu-color-bg-200) 55%,
        var(--wiu-color-bg-200) 60%,
        var(--wiu-color-bg-200) calc(60% + 10px),
        var(--wiu-color-bg-150) calc(60% + 12px),
        var(--wiu-color-bg-150) 100%
      );
      background-size: 250%;
    }
  
    @keyframes shimmer {
      from {
        background-position: -250% 0;
      }
      to {
        background-position: 250% 0;
      }
    }
  `;
  var f2 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let rh = class extends _e {
    constructor() {
      super(...arguments), this.width = "", this.height = "", this.borderRadius = "m", this.variant = "default"
    }
    render() {
      return this.style.cssText = `
        width: ${this.width};
        height: ${this.height};
        border-radius: ${`clamp(0px,var(--wiu-border-radius-${this.borderRadius}), 40px)`};
      `, K`<slot></slot>`
    }
  };
  rh.styles = [ice], f2([re()], rh.prototype, "width", void 0), f2([re()], rh.prototype, "height", void 0), f2([re()], rh.prototype, "borderRadius", void 0), f2([re()], rh.prototype, "variant", void 0), rh = f2([ye("wiu-shimmer")], rh);
  /**
   * @license
   * Copyright 2017 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  const TP = {
      ATTRIBUTE: 1,
      CHILD: 2,
      PROPERTY: 3,
      BOOLEAN_ATTRIBUTE: 4,
      EVENT: 5,
      ELEMENT: 6
    },
    kP = t => (...e) => ({
      _$litDirective$: t,
      values: e
    });
  let RP = class {
    constructor(e) {}
    get _$AU() {
      return this._$AM._$AU
    }
    _$AT(e, r, n) {
      this._$Ct = e, this._$AM = r, this._$Ci = n
    }
    _$AS(e, r) {
      return this.update(e, r)
    }
    update(e, r) {
      return this.render(...r)
    }
  };
  /**
   * @license
   * Copyright 2018 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  const p2 = kP(class extends RP {
      constructor(t) {
        if (super(t), t.type !== TP.ATTRIBUTE || t.name !== "class" || t.strings?.length > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")
      }
      render(t) {
        return " " + Object.keys(t).filter(e => t[e]).join(" ") + " "
      }
      update(t, [e]) {
        if (this.st === void 0) {
          this.st = new Set, t.strings !== void 0 && (this.nt = new Set(t.strings.join(" ").split(/\s/).filter(n => n !== "")));
          for (const n in e) e[n] && !this.nt?.has(n) && this.st.add(n);
          return this.render(e)
        }
        const r = t.element.classList;
        for (const n of this.st) n in e || (r.remove(n), this.st.delete(n));
        for (const n in e) {
          const i = !!e[n];
          i === this.st.has(n) || this.nt?.has(n) || (i ? (r.add(n), this.st.add(n)) : (r.remove(n), this.st.delete(n)))
        }
        return C1
      }
    }),
    sce = Re`
    :host {
      display: inline-flex !important;
    }
  
    slot {
      width: 100%;
      display: inline-block;
      font-style: normal;
      font-family: var(--wiu-font-family);
      font-feature-settings:
        'tnum' on,
        'lnum' on,
        'case' on;
      line-height: 130%;
      font-weight: var(--wiu-font-weight-regular);
      overflow: inherit;
      text-overflow: inherit;
      text-align: var(--local-align);
      color: var(--local-color);
    }
  
    .wiu-line-clamp-1 {
      overflow: hidden;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 1;
    }
  
    .wiu-line-clamp-2 {
      overflow: hidden;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
    }
  
    .wiu-font-medium-400 {
      font-size: var(--wiu-font-size-medium);
      font-weight: var(--wiu-font-weight-light);
      letter-spacing: var(--wiu-letter-spacing-medium);
    }
  
    .wiu-font-medium-600 {
      font-size: var(--wiu-font-size-medium);
      letter-spacing: var(--wiu-letter-spacing-medium);
    }
  
    .wiu-font-title-600 {
      font-size: var(--wiu-font-size-title);
      letter-spacing: var(--wiu-letter-spacing-title);
    }
  
    .wiu-font-title-6-600 {
      font-size: var(--wiu-font-size-title-6);
      letter-spacing: var(--wiu-letter-spacing-title-6);
    }
  
    .wiu-font-mini-700 {
      font-size: var(--wiu-font-size-mini);
      letter-spacing: var(--wiu-letter-spacing-mini);
      text-transform: uppercase;
    }
  
    .wiu-font-large-500,
    .wiu-font-large-600,
    .wiu-font-large-700 {
      font-size: var(--wiu-font-size-large);
      letter-spacing: var(--wiu-letter-spacing-large);
    }
  
    .wiu-font-2xl-500,
    .wiu-font-2xl-600,
    .wiu-font-2xl-700 {
      font-size: var(--wiu-font-size-2xl);
      letter-spacing: var(--wiu-letter-spacing-2xl);
    }
  
    .wiu-font-paragraph-400,
    .wiu-font-paragraph-500,
    .wiu-font-paragraph-600,
    .wiu-font-paragraph-700 {
      font-size: var(--wiu-font-size-paragraph);
      letter-spacing: var(--wiu-letter-spacing-paragraph);
    }
  
    .wiu-font-small-400,
    .wiu-font-small-500,
    .wiu-font-small-600 {
      font-size: var(--wiu-font-size-small);
      letter-spacing: var(--wiu-letter-spacing-small);
    }
  
    .wiu-font-tiny-400,
    .wiu-font-tiny-500,
    .wiu-font-tiny-600 {
      font-size: var(--wiu-font-size-tiny);
      letter-spacing: var(--wiu-letter-spacing-tiny);
    }
  
    .wiu-font-micro-700,
    .wiu-font-micro-600 {
      font-size: var(--wiu-font-size-micro);
      letter-spacing: var(--wiu-letter-spacing-micro);
      text-transform: uppercase;
    }
  
    .wiu-font-tiny-400,
    .wiu-font-small-400,
    .wiu-font-medium-400,
    .wiu-font-paragraph-400 {
      font-weight: var(--wiu-font-weight-light);
    }
  
    .wiu-font-large-700,
    .wiu-font-paragraph-700,
    .wiu-font-micro-700,
    .wiu-font-mini-700 {
      font-weight: var(--wiu-font-weight-bold);
    }
  
    .wiu-font-medium-600,
    .wiu-font-medium-title-600,
    .wiu-font-title-6-600,
    .wiu-font-large-600,
    .wiu-font-paragraph-600,
    .wiu-font-small-600,
    .wiu-font-tiny-600,
    .wiu-font-micro-600 {
      font-weight: var(--wiu-font-weight-medium);
    }
  
    :host([disabled]) {
      opacity: 0.4;
    }
  `;
  var g2 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let nh = class extends _e {
    constructor() {
      super(...arguments), this.variant = "paragraph-500", this.color = "fg-300", this.align = "left", this.lineClamp = void 0
    }
    render() {
      const e = {
        [`wiu-font-${this.variant}`]: !0,
        [`wiu-color-${this.color}`]: !0,
        [`wiu-line-clamp-${this.lineClamp}`]: !!this.lineClamp
      };
      return this.style.cssText = `
        --local-align: ${this.align};
        --local-color: var(--wiu-color-${this.color});
      `, K`<slot class=${p2(e)}></slot>`
    }
  };
  nh.styles = [ft, sce], g2([re()], nh.prototype, "variant", void 0), g2([re()], nh.prototype, "color", void 0), g2([re()], nh.prototype, "align", void 0), g2([re()], nh.prototype, "lineClamp", void 0), nh = g2([ye("wiu-text")], nh);
  const oce = Ke`<svg fill="none" viewBox="0 0 60 60">
    <rect width="60" height="60" fill="#1DC956" rx="30" />
    <circle cx="30" cy="30" r="3" fill="#fff" />
    <path
      fill="#2BEE6C"
      stroke="#fff"
      stroke-width="2"
      d="m45.32 17.9-.88-.42.88.42.02-.05c.1-.2.21-.44.26-.7l-.82-.15.82.16a2 2 0 0 0-.24-1.4c-.13-.23-.32-.42-.47-.57a8.42 8.42 0 0 1-.04-.04l-.04-.04a2.9 2.9 0 0 0-.56-.47l-.51.86.5-.86a2 2 0 0 0-1.4-.24c-.26.05-.5.16-.69.26l-.05.02-15.05 7.25-.1.05c-1.14.55-1.85.89-2.46 1.37a7 7 0 0 0-1.13 1.14c-.5.6-.83 1.32-1.38 2.45l-.05.11-7.25 15.05-.02.05c-.1.2-.21.43-.26.69a2 2 0 0 0 .24 1.4l.85-.5-.85.5c.13.23.32.42.47.57l.04.04.04.04c.15.15.34.34.56.47a2 2 0 0 0 1.41.24l-.2-.98.2.98c.25-.05.5-.17.69-.26l.05-.02-.42-.87.42.87 15.05-7.25.1-.05c1.14-.55 1.85-.89 2.46-1.38a7 7 0 0 0 1.13-1.13 12.87 12.87 0 0 0 1.43-2.56l7.25-15.05Z"
    />
    <path
      fill="#1DC956"
      d="M33.38 32.72 30.7 29.3 15.86 44.14l.2.2a1 1 0 0 0 1.14.2l15.1-7.27a3 3 0 0 0 1.08-4.55Z"
    />
    <path
      fill="#86F999"
      d="m26.62 27.28 2.67 3.43 14.85-14.85-.2-.2a1 1 0 0 0-1.14-.2l-15.1 7.27a3 3 0 0 0-1.08 4.55Z"
    />
    <circle cx="30" cy="30" r="3" fill="#fff" transform="rotate(45 30 30)" />
    <rect width="59" height="59" x=".5" y=".5" stroke="#062B2B" stroke-opacity=".1" rx="29.5" />
  </svg> `,
    ace = Ke`<svg viewBox="0 0 60 60" fill="none">
    <g clip-path="url(#clip0_7734_50402)">
      <path
        d="M0 24.9C0 15.6485 0 11.0228 1.97053 7.56812C3.3015 5.23468 5.23468 3.3015 7.56812 1.97053C11.0228 0 15.6485 0 24.9 0H35.1C44.3514 0 48.9772 0 52.4319 1.97053C54.7653 3.3015 56.6985 5.23468 58.0295 7.56812C60 11.0228 60 15.6485 60 24.9V35.1C60 44.3514 60 48.9772 58.0295 52.4319C56.6985 54.7653 54.7653 56.6985 52.4319 58.0295C48.9772 60 44.3514 60 35.1 60H24.9C15.6485 60 11.0228 60 7.56812 58.0295C5.23468 56.6985 3.3015 54.7653 1.97053 52.4319C0 48.9772 0 44.3514 0 35.1V24.9Z"
        fill="#EB8B47"
      />
      <path
        d="M0.5 24.9C0.5 20.2652 0.50047 16.8221 0.744315 14.105C0.987552 11.3946 1.46987 9.45504 2.40484 7.81585C3.69145 5.56019 5.56019 3.69145 7.81585 2.40484C9.45504 1.46987 11.3946 0.987552 14.105 0.744315C16.8221 0.50047 20.2652 0.5 24.9 0.5H35.1C39.7348 0.5 43.1779 0.50047 45.895 0.744315C48.6054 0.987552 50.545 1.46987 52.1841 2.40484C54.4398 3.69145 56.3086 5.56019 57.5952 7.81585C58.5301 9.45504 59.0124 11.3946 59.2557 14.105C59.4995 16.8221 59.5 20.2652 59.5 24.9V35.1C59.5 39.7348 59.4995 43.1779 59.2557 45.895C59.0124 48.6054 58.5301 50.545 57.5952 52.1841C56.3086 54.4398 54.4398 56.3086 52.1841 57.5952C50.545 58.5301 48.6054 59.0124 45.895 59.2557C43.1779 59.4995 39.7348 59.5 35.1 59.5H24.9C20.2652 59.5 16.8221 59.4995 14.105 59.2557C11.3946 59.0124 9.45504 58.5301 7.81585 57.5952C5.56019 56.3086 3.69145 54.4398 2.40484 52.1841C1.46987 50.545 0.987552 48.6054 0.744315 45.895C0.50047 43.1779 0.5 39.7348 0.5 35.1V24.9Z"
        stroke="#062B2B"
        stroke-opacity="0.1"
      />
      <path
        d="M19 52C24.5228 52 29 47.5228 29 42C29 36.4772 24.5228 32 19 32C13.4772 32 9 36.4772 9 42C9 47.5228 13.4772 52 19 52Z"
        fill="#FF974C"
        stroke="white"
        stroke-width="2"
      />
      <path
        fill-rule="evenodd"
        clip-rule="evenodd"
        d="M42.8437 8.3264C42.4507 7.70891 41.5493 7.70891 41.1564 8.32641L28.978 27.4638C28.5544 28.1295 29.0326 29.0007 29.8217 29.0007H54.1783C54.9674 29.0007 55.4456 28.1295 55.022 27.4638L42.8437 8.3264Z"
        fill="white"
      />
      <path
        fill-rule="evenodd"
        clip-rule="evenodd"
        d="M42.3348 11.6456C42.659 11.7608 42.9061 12.1492 43.4005 12.926L50.7332 24.4488C51.2952 25.332 51.5763 25.7737 51.5254 26.1382C51.4915 26.3808 51.3698 26.6026 51.1833 26.7614C50.9031 27 50.3796 27 49.3327 27H34.6673C33.6204 27 33.0969 27 32.8167 26.7614C32.6302 26.6026 32.5085 26.3808 32.4746 26.1382C32.4237 25.7737 32.7048 25.332 33.2669 24.4488L40.5995 12.926C41.0939 12.1492 41.341 11.7608 41.6652 11.6456C41.8818 11.5687 42.1182 11.5687 42.3348 11.6456ZM35.0001 26.999C38.8661 26.999 42.0001 23.865 42.0001 19.999C42.0001 23.865 45.1341 26.999 49.0001 26.999H35.0001Z"
        fill="#FF974C"
      />
      <path
        d="M10.1061 9.35712C9.9973 9.67775 9.99867 10.0388 9.99978 10.3323C9.99989 10.3611 10 10.3893 10 10.4167V25.5833C10 25.6107 9.99989 25.6389 9.99978 25.6677C9.99867 25.9612 9.9973 26.3222 10.1061 26.6429C10.306 27.2317 10.7683 27.694 11.3571 27.8939C11.6777 28.0027 12.0388 28.0013 12.3323 28.0002C12.3611 28.0001 12.3893 28 12.4167 28H19C24.5228 28 29 23.5228 29 18C29 12.4772 24.5228 8 19 8H12.4167C12.3893 8 12.3611 7.99989 12.3323 7.99978C12.0388 7.99867 11.6778 7.9973 11.3571 8.10614C10.7683 8.306 10.306 8.76834 10.1061 9.35712Z"
        fill="#FF974C"
        stroke="white"
        stroke-width="2"
      />
      <circle cx="19" cy="18" r="4" fill="#EB8B47" stroke="white" stroke-width="2" />
      <circle cx="19" cy="42" r="4" fill="#EB8B47" stroke="white" stroke-width="2" />
    </g>
    <defs>
      <clipPath id="clip0_7734_50402">
        <rect width="60" height="60" fill="white" />
      </clipPath>
    </defs>
  </svg> `,
    cce = Ke`<svg fill="none" viewBox="0 0 60 60">
    <g clip-path="url(#a)">
      <path
        fill="#1DC956"
        d="M0 25.01c0-9.25 0-13.88 1.97-17.33a15 15 0 0 1 5.6-5.6C11.02.11 15.65.11 24.9.11h10.2c9.25 0 13.88 0 17.33 1.97a15 15 0 0 1 5.6 5.6C60 11.13 60 15.76 60 25v10.2c0 9.25 0 13.88-1.97 17.33a15 15 0 0 1-5.6 5.6c-3.45 1.97-8.08 1.97-17.33 1.97H24.9c-9.25 0-13.88 0-17.33-1.97a15 15 0 0 1-5.6-5.6C0 49.1 0 44.46 0 35.21v-10.2Z"
      />
      <path
        fill="#2BEE6C"
        d="M16.1 60c-3.82-.18-6.4-.64-8.53-1.86a15 15 0 0 1-5.6-5.6C.55 50.06.16 46.97.04 41.98L4.2 40.6a4 4 0 0 0 2.48-2.39l4.65-12.4a2 2 0 0 1 2.5-1.2l2.53.84a2 2 0 0 0 2.43-1l2.96-5.94a2 2 0 0 1 3.7.32l3.78 12.58a2 2 0 0 0 3.03 1.09l3.34-2.23a2 2 0 0 0 .65-.7l5.3-9.72a2 2 0 0 1 1.42-1.01l4.14-.69a2 2 0 0 1 1.6.44l3.9 3.24a2 2 0 0 0 2.7-.12l4.62-4.63c.08 2.2.08 4.8.08 7.93v10.2c0 9.25 0 13.88-1.97 17.33a15 15 0 0 1-5.6 5.6c-2.13 1.22-4.7 1.68-8.54 1.86H16.11Z"
      />
      <path
        fill="#fff"
        d="m.07 43.03-.05-2.1 3.85-1.28a3 3 0 0 0 1.86-1.79l4.66-12.4a3 3 0 0 1 3.75-1.8l2.53.84a1 1 0 0 0 1.21-.5l2.97-5.94a3 3 0 0 1 5.56.48l3.77 12.58a1 1 0 0 0 1.51.55l3.34-2.23a1 1 0 0 0 .33-.35l5.3-9.71a3 3 0 0 1 2.14-1.53l4.13-.69a3 3 0 0 1 2.41.66l3.9 3.24a1 1 0 0 0 1.34-.06l5.28-5.28c.05.85.08 1.75.1 2.73L56 22.41a3 3 0 0 1-4.04.19l-3.9-3.25a1 1 0 0 0-.8-.21l-4.13.69a1 1 0 0 0-.72.5l-5.3 9.72a3 3 0 0 1-.97 1.05l-3.34 2.23a3 3 0 0 1-4.53-1.63l-3.78-12.58a1 1 0 0 0-1.85-.16l-2.97 5.94a3 3 0 0 1-3.63 1.5l-2.53-.84a1 1 0 0 0-1.25.6l-4.65 12.4a5 5 0 0 1-3.1 3L.07 43.02Z"
      />
      <path
        fill="#fff"
        fill-rule="evenodd"
        d="M49.5 19a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z"
        clip-rule="evenodd"
      />
      <path fill="#fff" d="M45 .28v59.66l-2 .1V.19c.7.02 1.37.05 2 .1Z" />
      <path fill="#2BEE6C" d="M47.5 19a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" />
      <path
        stroke="#fff"
        stroke-opacity=".1"
        d="M.5 25.01c0-4.63 0-8.08.24-10.8.25-2.7.73-4.64 1.66-6.28a14.5 14.5 0 0 1 5.42-5.41C9.46 1.58 11.39 1.1 14.1.85A133 133 0 0 1 24.9.61h10.2c4.63 0 8.08 0 10.8.24 2.7.25 4.65.73 6.28 1.67a14.5 14.5 0 0 1 5.42 5.4c.93 1.65 1.41 3.58 1.66 6.3.24 2.71.24 6.16.24 10.79v10.2c0 4.64 0 8.08-.24 10.8-.25 2.7-.73 4.65-1.66 6.28a14.5 14.5 0 0 1-5.42 5.42c-1.63.93-3.57 1.41-6.28 1.66-2.72.24-6.17.24-10.8.24H24.9c-4.63 0-8.08 0-10.8-.24-2.7-.25-4.64-.73-6.28-1.66a14.5 14.5 0 0 1-5.42-5.42C1.47 50.66 1 48.72.74 46.01A133 133 0 0 1 .5 35.2v-10.2Z"
      />
    </g>
    <defs>
      <clipPath id="a"><path fill="#fff" d="M0 0h60v60H0z" /></clipPath>
    </defs>
  </svg>`,
    lce = Ke`<svg fill="none" viewBox="0 0 60 60">
    <g clip-path="url(#a)">
      <rect width="60" height="60" fill="#C653C6" rx="30" />
      <path
        fill="#E87DE8"
        d="M57.98.01v19.5a4.09 4.09 0 0 0-2.63 2.29L50.7 34.2a2 2 0 0 1-2.5 1.2l-2.53-.84a2 2 0 0 0-2.42 1l-2.97 5.94a2 2 0 0 1-3.7-.32L32.8 28.6a2 2 0 0 0-3.02-1.09l-3.35 2.23a2 2 0 0 0-.64.7l-5.3 9.72a2 2 0 0 1-1.43 1.01l-4.13.69a2 2 0 0 1-1.61-.44l-3.9-3.24a2 2 0 0 0-2.69.12L2.1 42.93.02 43V.01h57.96Z"
      />
      <path
        fill="#fff"
        d="m61.95 16.94.05 2.1-3.85 1.28a3 3 0 0 0-1.86 1.79l-4.65 12.4a3 3 0 0 1-3.76 1.8l-2.53-.84a1 1 0 0 0-1.2.5l-2.98 5.94a3 3 0 0 1-5.55-.48l-3.78-12.58a1 1 0 0 0-1.5-.55l-3.35 2.23a1 1 0 0 0-.32.35l-5.3 9.72a3 3 0 0 1-2.14 1.52l-4.14.69a3 3 0 0 1-2.41-.66l-3.9-3.24a1 1 0 0 0-1.34.06l-5.28 5.28c-.05-.84-.08-1.75-.1-2.73l3.97-3.96a3 3 0 0 1 4.04-.19l3.89 3.25a1 1 0 0 0 .8.21l4.14-.68a1 1 0 0 0 .71-.51l5.3-9.71a3 3 0 0 1 .97-1.06l3.34-2.23a3 3 0 0 1 4.54 1.63l3.77 12.58a1 1 0 0 0 1.86.16l2.96-5.93a3 3 0 0 1 3.64-1.5l2.52.83a1 1 0 0 0 1.25-.6l4.66-12.4a5 5 0 0 1 3.1-2.99l4.43-1.48Z"
      />
      <path
        fill="#fff"
        fill-rule="evenodd"
        d="M35.5 27a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z"
        clip-rule="evenodd"
      />
      <path fill="#fff" d="M31 0v60h-2V0h2Z" />
      <path fill="#E87DE8" d="M33.5 27a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z" />
    </g>
    <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="29.5" />
    <defs>
      <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="30" /></clipPath>
    </defs>
  </svg> `,
    uce = Ke`<svg fill="none" viewBox="0 0 60 60">
    <g clip-path="url(#a)">
      <rect width="60" height="60" fill="#987DE8" rx="30" />
      <path
        fill="#fff"
        fill-rule="evenodd"
        d="m15.48 28.37 11.97-19.3a3 3 0 0 1 5.1 0l11.97 19.3a6 6 0 0 1 .9 3.14v.03a6 6 0 0 1-1.16 3.56L33.23 50.2a4 4 0 0 1-6.46 0L15.73 35.1a6 6 0 0 1-1.15-3.54v-.03a6 6 0 0 1 .9-3.16Z"
        clip-rule="evenodd"
      />
      <path
        fill="#643CDD"
        d="M30.84 10.11a1 1 0 0 0-.84-.46V24.5l12.6 5.53a2 2 0 0 0-.28-1.4L30.84 10.11Z"
      />
      <path
        fill="#BDADEB"
        d="M30 9.65a1 1 0 0 0-.85.46L17.66 28.64a2 2 0 0 0-.26 1.39L30 24.5V9.65Z"
      />
      <path
        fill="#643CDD"
        d="M30 50.54a1 1 0 0 0 .8-.4l11.24-15.38c.3-.44-.2-1-.66-.73l-9.89 5.68a3 3 0 0 1-1.5.4v10.43Z"
      />
      <path
        fill="#BDADEB"
        d="m17.97 34.76 11.22 15.37c.2.28.5.41.8.41V40.11a3 3 0 0 1-1.49-.4l-9.88-5.68c-.47-.27-.97.3-.65.73Z"
      />
      <path
        fill="#401AB3"
        d="M42.6 30.03 30 24.5v13.14a3 3 0 0 0 1.5-.4l10.14-5.83a2 2 0 0 0 .95-1.38Z"
      />
      <path
        fill="#7C5AE2"
        d="M30 37.64V24.46l-12.6 5.57a2 2 0 0 0 .97 1.39l10.13 5.82a3 3 0 0 0 1.5.4Z"
      />
    </g>
    <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="29.5" />
    <defs>
      <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="30" /></clipPath>
    </defs>
  </svg> `,
    dce = Ke`<svg fill="none" viewBox="0 0 60 60">
    <rect width="60" height="60" fill="#1DC956" rx="3" />
    <path
      fill="#1FAD7E"
      stroke="#fff"
      stroke-width="2"
      d="m30.49 29.13-.49-.27-.49.27-12.77 7.1-.05.02c-.86.48-1.58.88-2.1 1.24-.54.37-1.04.81-1.28 1.45a3 3 0 0 0 0 2.12c.24.63.74 1.08 1.27 1.45.53.36 1.25.76 2.11 1.24l.05.03 6.33 3.51.17.1c2.33 1.3 3.72 2.06 5.22 2.32a9 9 0 0 0 3.08 0c1.5-.26 2.9-1.03 5.22-2.32l.18-.1 6.32-3.51.05-.03a26.9 26.9 0 0 0 2.1-1.24 3.21 3.21 0 0 0 1.28-1.45l-.94-.35.94.35a3 3 0 0 0 0-2.12l-.94.35.94-.35a3.21 3.21 0 0 0-1.27-1.45c-.53-.36-1.25-.76-2.11-1.24l-.05-.03-12.77-7.1Z"
    />
    <path
      fill="#2BEE6C"
      stroke="#fff"
      stroke-width="2"
      d="m30.49 19.13-.49-.27-.49.27-12.77 7.1-.05.02c-.86.48-1.58.88-2.1 1.24-.54.37-1.04.81-1.28 1.45a3 3 0 0 0 0 2.12c.24.63.74 1.08 1.27 1.45.53.36 1.25.76 2.11 1.24l.05.03 6.33 3.51.17.1c2.33 1.3 3.72 2.06 5.22 2.32a9 9 0 0 0 3.08 0c1.5-.26 2.9-1.03 5.22-2.32l.18-.1 6.32-3.51.05-.03a26.9 26.9 0 0 0 2.1-1.24 3.21 3.21 0 0 0 1.28-1.45l-.94-.35.94.35a3 3 0 0 0 0-2.12l-.94.35.94-.35a3.21 3.21 0 0 0-1.27-1.45c-.53-.36-1.25-.76-2.11-1.24l-.05-.03-12.77-7.1Z"
    />
    <path
      fill="#86F999"
      stroke="#fff"
      stroke-width="2"
      d="m46.69 21.06-.94-.35.94.35a3 3 0 0 0 0-2.12l-.94.35.94-.35a3.21 3.21 0 0 0-1.27-1.45c-.53-.36-1.25-.76-2.11-1.24l-.05-.03-6.32-3.51-.18-.1c-2.33-1.3-3.72-2.06-5.22-2.33a9 9 0 0 0-3.08 0c-1.5.27-2.9 1.04-5.22 2.33l-.17.1-6.33 3.51-.05.03c-.86.48-1.58.88-2.1 1.24-.54.37-1.04.81-1.28 1.45a3 3 0 0 0 0 2.12c.24.63.74 1.08 1.27 1.45.53.36 1.25.76 2.11 1.24l.05.03 6.33 3.51.17.1c2.33 1.3 3.72 2.06 5.22 2.32a9 9 0 0 0 3.08 0c1.5-.26 2.9-1.03 5.22-2.32l.18-.1 6.32-3.51.05-.03a26.9 26.9 0 0 0 2.1-1.24 3.21 3.21 0 0 0 1.28-1.45Z"
    />
    <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
  </svg>`,
    hce = Ke`<svg fill="none" viewBox="0 0 60 60">
    <rect width="60" height="60" fill="#C653C6" rx="3" />
    <path
      fill="#fff"
      d="M20.03 15.22C20 15.6 20 16.07 20 17v2.8c0 1.14 0 1.7-.2 2.12-.15.31-.3.5-.58.71-.37.28-1.06.42-2.43.7-.59.12-1.11.29-1.6.51a9 9 0 0 0-4.35 4.36C10 30 10 32.34 10 37c0 4.66 0 7 .84 8.8a9 9 0 0 0 4.36 4.36C17 51 19.34 51 24 51h12c4.66 0 7 0 8.8-.84a9 9 0 0 0 4.36-4.36C50 44 50 41.66 50 37c0-4.66 0-7-.84-8.8a9 9 0 0 0-4.36-4.36c-.48-.22-1-.39-1.6-.5-1.36-.29-2.05-.43-2.42-.7-.27-.22-.43-.4-.58-.72-.2-.42-.2-.98-.2-2.11V17c0-.93 0-1.4-.03-1.78a9 9 0 0 0-8.19-8.19C31.4 7 30.93 7 30 7s-1.4 0-1.78.03a9 9 0 0 0-8.19 8.19Z"
    />
    <path
      fill="#E87DE8"
      d="M22 17c0-.93 0-1.4.04-1.78a7 7 0 0 1 6.18-6.18C28.6 9 29.07 9 30 9s1.4 0 1.78.04a7 7 0 0 1 6.18 6.18c.04.39.04.85.04 1.78v4.5a1.5 1.5 0 0 1-3 0V17c0-.93 0-1.4-.08-1.78a4 4 0 0 0-3.14-3.14C31.39 12 30.93 12 30 12s-1.4 0-1.78.08a4 4 0 0 0-3.14 3.14c-.08.39-.08.85-.08 1.78v4.5a1.5 1.5 0 0 1-3 0V17Z"
    />
    <path
      fill="#E87DE8"
      fill-rule="evenodd"
      d="M12 36.62c0-4.32 0-6.48.92-8.09a7 7 0 0 1 2.61-2.61C17.14 25 19.3 25 23.62 25h6.86c.46 0 .7 0 .9.02 2.73.22 4.37 2.43 4.62 4.98.27-2.7 2.11-5 5.02-5A6.98 6.98 0 0 1 48 31.98v5.4c0 4.32 0 6.48-.92 8.09a7 7 0 0 1-2.61 2.61c-1.61.92-3.77.92-8.09.92h-5.86c-.46 0-.7 0-.9-.02-2.73-.22-4.37-2.43-4.62-4.98-.26 2.58-1.94 4.82-4.71 4.99l-.7.01c-.55 0-.82 0-1.05-.02a7 7 0 0 1-6.52-6.52c-.02-.23-.02-.5-.02-1.05v-4.79Zm21.24-.27a4 4 0 1 0-6.48 0 31.28 31.28 0 0 1 1.57 2.23c.17.4.17.81.17 1.24V42.5a1.5 1.5 0 0 0 3 0V39.82c0-.43 0-.85.17-1.24.09-.2.58-.87 1.57-2.23Z"
      clip-rule="evenodd"
    />
    <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
  </svg>`,
    fce = Ke`<svg fill="none" viewBox="0 0 60 60">
    <g clip-path="url(#a)">
      <path
        fill="#EB8B47"
        d="M0 24.9c0-9.25 0-13.88 1.97-17.33a15 15 0 0 1 5.6-5.6C11.02 0 15.65 0 24.9 0h10.2c9.25 0 13.88 0 17.33 1.97a15 15 0 0 1 5.6 5.6C60 11.02 60 15.65 60 24.9v10.2c0 9.25 0 13.88-1.97 17.33a15 15 0 0 1-5.6 5.6C48.98 60 44.35 60 35.1 60H24.9c-9.25 0-13.88 0-17.33-1.97a15 15 0 0 1-5.6-5.6C0 48.98 0 44.35 0 35.1V24.9Z"
      />
      <path
        stroke="#062B2B"
        stroke-opacity=".1"
        d="M.5 24.9c0-4.64 0-8.08.24-10.8.25-2.7.73-4.65 1.66-6.28A14.5 14.5 0 0 1 7.82 2.4C9.46 1.47 11.39 1 14.1.74A133 133 0 0 1 24.9.5h10.2c4.63 0 8.08 0 10.8.24 2.7.25 4.65.73 6.28 1.66a14.5 14.5 0 0 1 5.42 5.42c.93 1.63 1.41 3.57 1.66 6.28.24 2.72.24 6.16.24 10.8v10.2c0 4.63 0 8.08-.24 10.8-.25 2.7-.73 4.64-1.66 6.28a14.5 14.5 0 0 1-5.42 5.41c-1.63.94-3.57 1.42-6.28 1.67-2.72.24-6.17.24-10.8.24H24.9c-4.63 0-8.08 0-10.8-.24-2.7-.25-4.64-.73-6.28-1.67a14.5 14.5 0 0 1-5.42-5.4C1.47 50.53 1 48.6.74 45.88A133 133 0 0 1 .5 35.1V24.9Z"
      />
      <path
        fill="#FF974C"
        stroke="#fff"
        stroke-width="2"
        d="M39.2 29.2a13 13 0 1 0-18.4 0l1.3 1.28a12.82 12.82 0 0 1 2.1 2.39 6 6 0 0 1 .6 1.47c.2.76.2 1.56.2 3.17v11.24c0 1.08 0 1.61.13 2.12a4 4 0 0 0 .41.98c.26.45.64.83 1.4 1.6l.3.29c.65.65.98.98 1.36 1.09.26.07.54.07.8 0 .38-.11.7-.44 1.36-1.1l3.48-3.47c.65-.65.98-.98 1.09-1.36a1.5 1.5 0 0 0 0-.8c-.1-.38-.44-.7-1.1-1.36l-.47-.48c-.65-.65-.98-.98-1.09-1.36a1.5 1.5 0 0 1 0-.8c.1-.38.44-.7 1.1-1.36l.47-.48c.65-.65.98-.98 1.09-1.36a1.5 1.5 0 0 0 0-.8c-.1-.38-.44-.7-1.1-1.36l-.48-.5c-.65-.64-.98-.97-1.08-1.35a1.5 1.5 0 0 1 0-.79c.1-.38.42-.7 1.06-1.36l5.46-5.55Z"
      />
      <circle cx="30" cy="17" r="4" fill="#EB8B47" stroke="#fff" stroke-width="2" />
    </g>
    <defs>
      <clipPath id="a"><path fill="#fff" d="M0 0h60v60H0z" /></clipPath>
    </defs>
  </svg> `,
    pce = Ke`<svg fill="none" viewBox="0 0 60 60">
    <g clip-path="url(#a)">
      <rect width="60" height="60" fill="#00ACE6" rx="30" />
      <circle cx="64" cy="39" r="50" fill="#1AC6FF" stroke="#fff" stroke-width="2" />
      <circle cx="78" cy="30" r="50" fill="#4DD2FF" stroke="#fff" stroke-width="2" />
      <circle cx="72" cy="15" r="35" fill="#80DFFF" stroke="#fff" stroke-width="2" />
      <circle cx="34" cy="-17" r="45" stroke="#fff" stroke-width="2" />
      <circle cx="34" cy="-5" r="50" stroke="#fff" stroke-width="2" />
      <circle cx="30" cy="45" r="4" fill="#4DD2FF" stroke="#fff" stroke-width="2" />
      <circle cx="39.5" cy="27.5" r="4" fill="#80DFFF" stroke="#fff" stroke-width="2" />
      <circle cx="16" cy="24" r="4" fill="#19C6FF" stroke="#fff" stroke-width="2" />
    </g>
    <rect width="59" height="59" x=".5" y=".5" stroke="#062B2B" stroke-opacity=".1" rx="29.5" />
    <defs>
      <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="30" /></clipPath>
    </defs>
  </svg>`,
    gce = Ke`<svg fill="none" viewBox="0 0 60 60">
    <g clip-path="url(#a)">
      <rect width="60" height="60" fill="#C653C6" rx="3" />
      <path
        fill="#E87DE8"
        stroke="#fff"
        stroke-width="2"
        d="M52.1 47.34c0-4.24-1.44-9.55-5.9-12.4a2.86 2.86 0 0 0-1.6-3.89v-.82c0-1.19-.52-2.26-1.35-3a4.74 4.74 0 0 0-2.4-6.26v-5.5a11.31 11.31 0 1 0-22.63 0v2.15a3.34 3.34 0 0 0-1.18 5.05 4.74 4.74 0 0 0-.68 6.44A5.22 5.22 0 0 0 14 35.92c-3.06 4.13-6.1 8.3-6.1 15.64 0 2.67.37 4.86.74 6.39a20.3 20.3 0 0 0 .73 2.39l.02.04v.01l.92-.39-.92.4.26.6h38.26l.3-.49-.87-.51.86.5.02-.01.03-.07a16.32 16.32 0 0 0 .57-1.05c.36-.72.85-1.74 1.33-2.96a25.51 25.51 0 0 0 1.94-9.07Z"
      />
      <path
        fill="#fff"
        fill-rule="evenodd"
        d="M26.5 29.5c-3-.5-5.5-3-5.5-7v-7c0-.47 0-.7.03-.9a3 3 0 0 1 2.58-2.57c.2-.03.42-.03.89-.03 2 0 2.5-2.5 2.5-2.5s0 2.5 2.5 2.5c1.4 0 2.1 0 2.65.23a3 3 0 0 1 1.62 1.62c.23.55.23 1.25.23 2.65v6c0 4-3 7-6.5 7 1.35.23 4 0 6.5-2v9.53C34 38.5 31.5 40 28 40s-6-1.5-6-2.97L24 34l2.5 1.5v-6ZM26 47h4.5c2.5 0 3 4 3 5.5h-3l-1-1.5H26v-4Zm-6.25 5.5H24V57h-8c0-1 1-4.5 3.75-4.5Z"
        clip-rule="evenodd"
      />
    </g>
    <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
    <defs>
      <clipPath id="a"><rect width="60" height="60" fill="#fff" rx="3" /></clipPath>
    </defs>
  </svg> `,
    mce = Ke`<svg fill="none" viewBox="0 0 60 60">
    <rect width="60" height="60" fill="#794CFF" rx="3" />
    <path
      fill="#987DE8"
      stroke="#fff"
      stroke-width="2"
      d="M33 22.5v-1H16v5H8.5V36H13v-5h3v7.5h17V31h1v7.5h17v-17H34v5h-1v-4Z"
    />
    <path fill="#fff" d="M37.5 25h10v10h-10z" />
    <path fill="#4019B2" d="M42.5 25h5v10h-5z" />
    <path fill="#fff" d="M19.5 25h10v10h-10z" />
    <path fill="#4019B2" d="M24.5 25h5v10h-5z" />
    <path fill="#fff" d="M12 30.5h4V37h-4v-6.5Z" />
    <rect width="59" height="59" x=".5" y=".5" stroke="#fff" stroke-opacity=".1" rx="2.5" />
  </svg>`,
    wce = Ke`<svg
    viewBox="0 0 60 60"
    fill="none"
  >
    <g clip-path="url(#1)">
      <rect width="60" height="60" rx="30" fill="#00ACE6" />
      <path
        d="M59 73C59 89.0163 46.0163 102 30 102C13.9837 102 1 89.0163 1 73C1 56.9837 12 44 30 44C48 44 59 56.9837 59 73Z"
        fill="#1AC6FF"
        stroke="white"
        stroke-width="2"
      />
      <path
        d="M18.6904 19.9015C19.6264 15.3286 23.3466 11.8445 27.9708 11.2096C29.3231 11.024 30.6751 11.0238 32.0289 11.2096C36.6532 11.8445 40.3733 15.3286 41.3094 19.9015C41.4868 20.7681 41.6309 21.6509 41.7492 22.5271C41.8811 23.5041 41.8811 24.4944 41.7492 25.4715C41.6309 26.3476 41.4868 27.2304 41.3094 28.097C40.3733 32.6699 36.6532 36.154 32.0289 36.7889C30.6772 36.9744 29.3216 36.9743 27.9708 36.7889C23.3466 36.154 19.6264 32.6699 18.6904 28.097C18.513 27.2304 18.3689 26.3476 18.2506 25.4715C18.1186 24.4944 18.1186 23.5041 18.2506 22.5271C18.3689 21.6509 18.513 20.7681 18.6904 19.9015Z"
        fill="#1AC6FF"
        stroke="white"
        stroke-width="2"
      />
      <circle cx="24.5" cy="23.5" r="1.5" fill="white" />
      <circle cx="35.5" cy="23.5" r="1.5" fill="white" />
      <path
        d="M31 20L28 28H32"
        stroke="white"
        stroke-width="2"
        stroke-linecap="round"
        stroke-linejoin="round"
      />
    </g>
    <rect x="0.5" y="0.5" width="59" height="59" rx="29.5" stroke="white" stroke-opacity="0.1" />
    <defs>
      <clipPath id="1">
        <rect width="60" height="60" rx="30" fill="white" />
      </clipPath>
    </defs>
  </svg> `,
    vce = Ke`<svg viewBox="0 0 60 60" fill="none">
    <g clip-path="url(#1)">
      <path
        d="M0 24.9C0 15.6485 0 11.0228 1.97053 7.56812C3.3015 5.23468 5.23468 3.3015 7.56812 1.97053C11.0228 0 15.6485 0 24.9 0H35.1C44.3514 0 48.9772 0 52.4319 1.97053C54.7653 3.3015 56.6985 5.23468 58.0295 7.56812C60 11.0228 60 15.6485 60 24.9V35.1C60 44.3514 60 48.9772 58.0295 52.4319C56.6985 54.7653 54.7653 56.6985 52.4319 58.0295C48.9772 60 44.3514 60 35.1 60H24.9C15.6485 60 11.0228 60 7.56812 58.0295C5.23468 56.6985 3.3015 54.7653 1.97053 52.4319C0 48.9772 0 44.3514 0 35.1V24.9Z"
        fill="#794CFF"
      />
      <path
        d="M0.5 24.9C0.5 20.2652 0.50047 16.8221 0.744315 14.105C0.987552 11.3946 1.46987 9.45504 2.40484 7.81585C3.69145 5.56019 5.56019 3.69145 7.81585 2.40484C9.45504 1.46987 11.3946 0.987552 14.105 0.744315C16.8221 0.50047 20.2652 0.5 24.9 0.5H35.1C39.7348 0.5 43.1779 0.50047 45.895 0.744315C48.6054 0.987552 50.545 1.46987 52.1841 2.40484C54.4398 3.69145 56.3086 5.56019 57.5952 7.81585C58.5301 9.45504 59.0124 11.3946 59.2557 14.105C59.4995 16.8221 59.5 20.2652 59.5 24.9V35.1C59.5 39.7348 59.4995 43.1779 59.2557 45.895C59.0124 48.6054 58.5301 50.545 57.5952 52.1841C56.3086 54.4398 54.4398 56.3086 52.1841 57.5952C50.545 58.5301 48.6054 59.0124 45.895 59.2557C43.1779 59.4995 39.7348 59.5 35.1 59.5H24.9C20.2652 59.5 16.8221 59.4995 14.105 59.2557C11.3946 59.0124 9.45504 58.5301 7.81585 57.5952C5.56019 56.3086 3.69145 54.4398 2.40484 52.1841C1.46987 50.545 0.987552 48.6054 0.744315 45.895C0.50047 43.1779 0.5 39.7348 0.5 35.1V24.9Z"
        stroke="#062B2B"
        stroke-opacity="0.1"
      />
      <path
        d="M35.1403 31.5016C35.1193 30.9637 35.388 30.4558 35.8446 30.1707C36.1207 29.9982 36.4761 29.8473 36.7921 29.7685C37.3143 29.6382 37.8664 29.7977 38.2386 30.1864C38.8507 30.8257 39.3004 31.6836 39.8033 32.408C40.2796 33.0942 41.4695 33.2512 41.9687 32.5047C42.4839 31.7341 42.9405 30.8229 43.572 30.1399C43.9375 29.7447 44.4866 29.5756 45.0111 29.6967C45.3283 29.7701 45.6863 29.9147 45.9655 30.0823C46.4269 30.3595 46.7045 30.8626 46.6928 31.4008C46.6731 32.3083 46.3764 33.2571 46.2158 34.1473C46.061 35.0048 46.9045 35.8337 47.7592 35.664C48.6464 35.4878 49.5899 35.1747 50.497 35.1391C51.0348 35.1181 51.5427 35.3868 51.8279 35.8433C52.0004 36.1195 52.1513 36.4749 52.2301 36.7908C52.3604 37.3131 52.2009 37.8651 51.8121 38.2374C51.1729 38.8495 50.3151 39.2991 49.5908 39.8019C48.9046 40.2782 48.7473 41.4683 49.4939 41.9675C50.2644 42.4827 51.1757 42.9393 51.8587 43.5708C52.2539 43.9362 52.423 44.4854 52.3018 45.0099C52.2285 45.3271 52.0839 45.6851 51.9162 45.9642C51.6391 46.4257 51.1359 46.7032 50.5978 46.6916C49.6903 46.6719 48.7417 46.3753 47.8516 46.2146C46.9939 46.0598 46.1648 46.9035 46.3346 47.7583C46.5108 48.6454 46.8239 49.5888 46.8594 50.4958C46.8805 51.0336 46.6117 51.5415 46.1552 51.8267C45.879 51.9992 45.5236 52.15 45.2077 52.2289C44.6854 52.3592 44.1334 52.1997 43.7611 51.8109C43.1491 51.1718 42.6996 50.314 42.1968 49.5897C41.7203 48.9034 40.5301 48.7463 40.0309 49.493C39.5157 50.2634 39.0592 51.1746 38.4278 51.8574C38.0623 52.2527 37.5132 52.4218 36.9887 52.3006C36.6715 52.2273 36.3135 52.0826 36.0343 51.915C35.5729 51.6379 35.2953 51.1347 35.307 50.5966C35.3267 49.6891 35.6233 48.7405 35.7839 47.8505C35.9388 46.9928 35.0951 46.1636 34.2402 46.3334C33.3531 46.5096 32.4098 46.8227 31.5028 46.8582C30.9649 46.8793 30.457 46.6105 30.1719 46.154C29.9994 45.8778 29.8485 45.5224 29.7697 45.2065C29.6394 44.6842 29.7989 44.1322 30.1877 43.7599C30.8269 43.1479 31.6847 42.6982 32.4091 42.1954C33.0954 41.7189 33.2522 40.5289 32.5056 40.0297C31.7351 39.5145 30.824 39.058 30.1411 38.4265C29.7459 38.0611 29.5768 37.5119 29.698 36.9875C29.7713 36.6702 29.9159 36.3122 30.0836 36.0331C30.3607 35.5717 30.8638 35.2941 31.402 35.3058C32.3095 35.3255 33.2583 35.6221 34.1485 35.7828C35.006 35.9376 35.8349 35.094 35.6652 34.2393C35.489 33.3521 35.1759 32.4087 35.1403 31.5016Z"
        fill="#906EF7"
        stroke="white"
        stroke-width="2"
      />
      <path
        d="M20.7706 8.22357C20.9036 7.51411 21.5231 7 22.2449 7H23.7551C24.4769 7 25.0964 7.51411 25.2294 8.22357C25.5051 9.69403 25.4829 11.6321 27.1202 12.2606C27.3092 12.3331 27.4958 12.4105 27.6798 12.4926C29.2818 13.2072 30.6374 11.8199 31.8721 10.9752C32.4678 10.5676 33.2694 10.6421 33.7798 11.1525L34.8477 12.2204C35.3581 12.7308 35.4326 13.5323 35.025 14.128C34.1802 15.3627 32.7931 16.7183 33.5077 18.3202C33.5898 18.5043 33.6672 18.6909 33.7398 18.88C34.3683 20.5171 36.3061 20.4949 37.7764 20.7706C38.4859 20.9036 39 21.5231 39 22.2449V23.7551C39 24.4769 38.4859 25.0964 37.7764 25.2294C36.3061 25.5051 34.3685 25.483 33.7401 27.1201C33.6675 27.3093 33.59 27.4961 33.5079 27.6803C32.7934 29.282 34.1803 30.6374 35.025 31.8719C35.4326 32.4677 35.3581 33.2692 34.8477 33.7796L33.7798 34.8475C33.2694 35.3579 32.4678 35.4324 31.8721 35.0248C30.6376 34.1801 29.2823 32.7934 27.6806 33.508C27.4962 33.5903 27.3093 33.6678 27.12 33.7405C25.483 34.3688 25.5051 36.3062 25.2294 37.7764C25.0964 38.4859 24.4769 39 23.7551 39H22.2449C21.5231 39 20.9036 38.4859 20.7706 37.7764C20.4949 36.3062 20.517 34.3688 18.88 33.7405C18.6908 33.6678 18.5039 33.5903 18.3196 33.5081C16.7179 32.7936 15.3625 34.1804 14.1279 35.0251C13.5322 35.4327 12.7307 35.3582 12.2203 34.8478L11.1524 33.7799C10.642 33.2695 10.5675 32.4679 10.9751 31.8722C11.8198 30.6376 13.2067 29.2822 12.4922 27.6804C12.41 27.4962 12.3325 27.3093 12.2599 27.1201C11.6315 25.483 9.69392 25.5051 8.22357 25.2294C7.51411 25.0964 7 24.4769 7 23.7551V22.2449C7 21.5231 7.51411 20.9036 8.22357 20.7706C9.69394 20.4949 11.6317 20.5171 12.2602 18.88C12.3328 18.6909 12.4103 18.5042 12.4924 18.3201C13.207 16.7181 11.8198 15.3625 10.975 14.1278C10.5674 13.5321 10.6419 12.7305 11.1523 12.2201L12.2202 11.1522C12.7306 10.6418 13.5322 10.5673 14.1279 10.9749C15.3626 11.8197 16.7184 13.2071 18.3204 12.4925C18.5044 12.4105 18.6909 12.3331 18.8799 12.2606C20.5171 11.6321 20.4949 9.69403 20.7706 8.22357Z"
        fill="#906EF7"
        stroke="white"
        stroke-width="2"
      />
      <circle cx="23" cy="23" r="6" fill="#794CFF" stroke="white" stroke-width="2" />
      <circle cx="41" cy="41" r="4" fill="#794CFF" stroke="white" stroke-width="2" />
    </g>
    <defs>
      <clipPath id="1">
        <rect width="60" height="60" fill="white" />
      </clipPath>
    </defs>
  </svg> `,
    bce = Ke`<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none">
    <g clip-path="url(#clip0_187_29)">
      <path d="M1.18187e-05 15.8055C1.18187e-05 9.8015 -5.19442e-07 6.91338 1.69991e-08 0C4.5 3.72236e-05 9.62249 0 16.5 0L23.5 4.31399e-05C29.9349 4.31399e-05 35.5 0.000206332 40 3.73468e-05C40 2.77754 40 9.36708 40 15.8055V22.8364C40 29.2647 40 33.7962 40 40C31.5 40 29.8337 40 23.4 40H16.6C10.5092 40 6.50004 40 4.04289e-05 40C3.05176e-05 32.2453 1.18187e-05 29.6382 1.18187e-05 22.8364V15.8055Z" fill="#0052FF"/>
      <path d="M20.0236 26.5C16.4342 26.5 13.5236 23.5931 13.5236 20C13.5236 16.4069 16.4342 13.5 20.0236 13.5C23.2411 13.5 25.9134 15.8472 26.4261 18.9167H32.9731C32.4206 12.2433 26.8342 7 20.02 7C12.8411 7 7.02002 12.8211 7.02002 20C7.02002 27.1789 12.8411 33 20.02 33C26.8342 33 32.4206 27.7567 32.9731 21.0833H26.4225C25.9061 24.1528 23.2411 26.5 20.0236 26.5Z" fill="white"/>
    </g>
    <defs>
      <clipPath id="clip0_187_29">
        <rect width="40" height="40" fill="white"/>
      </clipPath>
    </defs>
  </svg>`,
    yce = Ke`
    <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
      <g clip-path="url(#a)">
        <path
          d="M0 16.6c0-6.168 0-9.251 1.314-11.555a10 10 0 0 1 3.731-3.731C7.35 0 10.432 0 16.6 0h6.8c6.168 0 9.252 0 11.555 1.314a10 10 0 0 1 3.731 3.731C40 7.35 40 10.432 40 16.6v6.8c0 6.168 0 9.252-1.314 11.555a10 10 0 0 1-3.731 3.731C32.652 40 29.568 40 23.4 40h-6.8c-6.168 0-9.251 0-11.555-1.314a10 10 0 0 1-3.731-3.731C0 32.652 0 29.568 0 23.4v-6.8Z"
          fill="#7D00FF"
        />
        <path
          d="M.5 16.6c0-3.093 0-5.38.162-7.182.161-1.795.48-3.061 1.086-4.125a9.5 9.5 0 0 1 3.545-3.545C6.357 1.141 7.623.823 9.418.662 11.221.5 13.508.5 16.6.5h6.8c3.093 0 5.38 0 7.182.162 1.795.161 3.062.48 4.125 1.086a9.5 9.5 0 0 1 3.545 3.545c.607 1.064.925 2.33 1.086 4.125.161 1.803.162 4.09.162 7.182v6.8c0 3.093 0 5.38-.162 7.182-.161 1.795-.48 3.062-1.086 4.125a9.5 9.5 0 0 1-3.545 3.545c-1.063.607-2.33.925-4.125 1.086-1.803.161-4.09.162-7.182.162h-6.8c-3.093 0-5.38 0-7.182-.162-1.795-.161-3.061-.48-4.125-1.086a9.5 9.5 0 0 1-3.545-3.545c-.607-1.063-.925-2.33-1.086-4.125C.5 28.779.5 26.492.5 23.4v-6.8Z"
          stroke="#fff"
          stroke-opacity=".05"
        />
        <path
          d="M28.306 15.381a3.69 3.69 0 1 0 0-7.381 3.69 3.69 0 0 0 0 7.381ZM16.987 32a8.991 8.991 0 1 1 .016-17.983A8.991 8.991 0 0 1 16.988 32Z"
          fill="#fff"
        />
      </g>
      <defs>
        <clipPath id="a"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
      </defs>
    </svg>
  `,
    _ce = Ke`
    <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
      <g clip-path="url(#a)">
        <path
          d="M0 16.6c0-6.168 0-9.251 1.314-11.555a10 10 0 0 1 3.731-3.731C7.35 0 10.432 0 16.6 0h6.8c6.168 0 9.252 0 11.555 1.314a10 10 0 0 1 3.731 3.731C40 7.35 40 10.432 40 16.6v6.8c0 6.168 0 9.252-1.314 11.555a10 10 0 0 1-3.731 3.731C32.652 40 29.568 40 23.4 40h-6.8c-6.168 0-9.251 0-11.555-1.314a10 10 0 0 1-3.731-3.731C0 32.652 0 29.568 0 23.4v-6.8Z"
          fill="#635BFF"
        />
        <path
          d="M.5 16.6c0-3.093 0-5.38.162-7.182.161-1.795.48-3.061 1.086-4.125a9.5 9.5 0 0 1 3.545-3.545C6.357 1.141 7.623.823 9.418.662 11.221.5 13.508.5 16.6.5h6.8c3.093 0 5.38 0 7.182.162 1.795.161 3.062.48 4.125 1.086a9.5 9.5 0 0 1 3.545 3.545c.607 1.064.925 2.33 1.086 4.125.161 1.803.162 4.09.162 7.182v6.8c0 3.093 0 5.38-.162 7.182-.161 1.795-.48 3.062-1.086 4.125a9.5 9.5 0 0 1-3.545 3.545c-1.063.607-2.33.925-4.125 1.086-1.803.161-4.09.162-7.182.162h-6.8c-3.093 0-5.38 0-7.182-.162-1.795-.161-3.061-.48-4.125-1.086a9.5 9.5 0 0 1-3.545-3.545c-.607-1.063-.925-2.33-1.086-4.125C.5 28.779.5 26.492.5 23.4v-6.8Z"
          stroke="#fff"
          stroke-opacity=".05"
        />
        <path
          fill-rule="evenodd"
          clip-rule="evenodd"
          d="M18.299 15.147c0-1.028.844-1.424 2.242-1.424 2.004 0 4.536.607 6.54 1.688V9.213C24.892 8.343 22.73 8 20.541 8c-5.354 0-8.915 2.796-8.915 7.464 0 7.279 10.022 6.118 10.022 9.257 0 1.213-1.055 1.609-2.531 1.609-2.19 0-4.985-.897-7.2-2.11v6.277a18.283 18.283 0 0 0 7.2 1.503c5.485 0 9.257-2.716 9.257-7.437-.027-7.86-10.075-6.462-10.075-9.416Z"
          fill="#fff"
        />
      </g>
      <defs>
        <clipPath id="a"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
      </defs>
    </svg>
  `,
    xce = Ke`
    <svg width="40" height="40" fill="none" xmlns="http://www.w3.org/2000/svg">
      <g clip-path="url(#a)">
        <path
          d="M0 16.6c0-6.168 0-9.251 1.314-11.555a10 10 0 0 1 3.731-3.731C7.35 0 10.432 0 16.6 0h6.8c6.168 0 9.252 0 11.555 1.314a10 10 0 0 1 3.731 3.731C40 7.35 40 10.432 40 16.6v6.8c0 6.168 0 9.252-1.314 11.555a10 10 0 0 1-3.731 3.731C32.652 40 29.568 40 23.4 40h-6.8c-6.168 0-9.251 0-11.555-1.314a10 10 0 0 1-3.731-3.731C0 32.652 0 29.568 0 23.4v-6.8Z"
          fill="#fff"
        />
        <path
          d="M.5 16.6c0-3.093 0-5.38.162-7.182.161-1.795.48-3.061 1.086-4.125a9.5 9.5 0 0 1 3.545-3.545C6.357 1.141 7.623.823 9.418.662 11.221.5 13.508.5 16.6.5h6.8c3.093 0 5.38 0 7.182.162 1.795.161 3.062.48 4.125 1.086a9.5 9.5 0 0 1 3.545 3.545c.607 1.064.925 2.33 1.086 4.125.161 1.803.162 4.09.162 7.182v6.8c0 3.093 0 5.38-.162 7.182-.161 1.795-.48 3.062-1.086 4.125a9.5 9.5 0 0 1-3.545 3.545c-1.063.607-2.33.925-4.125 1.086-1.803.161-4.09.162-7.182.162h-6.8c-3.093 0-5.38 0-7.182-.162-1.795-.161-3.061-.48-4.125-1.086a9.5 9.5 0 0 1-3.545-3.545c-.607-1.063-.925-2.33-1.086-4.125C.5 28.779.5 26.492.5 23.4v-6.8Z"
          stroke="#fff"
          stroke-opacity=".05"
        />
        <path
          d="M18.606 12.642a.781.781 0 0 0-.771.66l-1.281 8.125a.78.78 0 0 1 .77-.66h3.755a7.668 7.668 0 0 0 7.57-6.49 6.26 6.26 0 0 0 .075-.843c-.96-.504-2.089-.792-3.325-.792h-6.793Z"
          fill="#001C64"
        />
        <path
          d="M28.724 13.434c-.006.282-.03.564-.075.843a7.668 7.668 0 0 1-7.57 6.491h-3.754a.78.78 0 0 0-.771.66l-1.916 12.15a.634.634 0 0 0 .626.734h4.075a.781.781 0 0 0 .77-.66l1.074-6.807a.781.781 0 0 1 .772-.66h2.4a7.668 7.668 0 0 0 7.57-6.491c.415-2.651-.92-5.064-3.201-6.26Z"
          fill="#0070E0"
        />
        <path
          d="M13.977 7.226a.78.78 0 0 0-.771.658l-3.198 20.277a.634.634 0 0 0 .626.733h4.742l1.178-7.467 1.281-8.125a.782.782 0 0 1 .771-.66H25.4c1.237 0 2.364.289 3.325.792.065-3.4-2.74-6.208-6.599-6.208h-8.148Z"
          fill="#003087"
        />
      </g>
      <defs>
        <clipPath id="a"><path fill="#fff" d="M0 0h40v40H0z" /></clipPath>
      </defs>
    </svg>
  `,
    Cce = Ke`<svg width="60" height="60" viewBox="0 0 60 60" fill="none">
  <g clip-path="url(#clip0_13859_31161)">
    <path d="M0 24.8995C0 15.6481 0 11.0223 1.97053 7.56763C3.3015 5.2342 5.23468 3.30101 7.56812 1.97004C11.0228 -0.000488281 15.6485 -0.000488281 24.9 -0.000488281H35.1C44.3514 -0.000488281 48.9772 -0.000488281 52.4319 1.97004C54.7653 3.30101 56.6985 5.2342 58.0295 7.56763C60 11.0223 60 15.6481 60 24.8995V35.0995C60 44.351 60 48.9767 58.0295 52.4314C56.6985 54.7648 54.7653 56.698 52.4319 58.029C48.9772 59.9995 44.3514 59.9995 35.1 59.9995H24.9C15.6485 59.9995 11.0228 59.9995 7.56812 58.029C5.23468 56.698 3.3015 54.7648 1.97053 52.4314C0 48.9767 0 44.351 0 35.0995V24.8995Z" fill="#EB8B47"/>
    <path d="M0.5 24.8995C0.5 20.2647 0.50047 16.8216 0.744315 14.1045C0.987552 11.3941 1.46987 9.45455 2.40484 7.81536C3.69145 5.55971 5.56019 3.69096 7.81585 2.40435C9.45504 1.46938 11.3946 0.987064 14.105 0.743826C16.8221 0.499981 20.2652 0.499512 24.9 0.499512H35.1C39.7348 0.499512 43.1779 0.499981 45.895 0.743826C48.6054 0.987064 50.545 1.46938 52.1841 2.40435C54.4398 3.69096 56.3086 5.55971 57.5952 7.81536C58.5301 9.45455 59.0124 11.3941 59.2557 14.1045C59.4995 16.8216 59.5 20.2647 59.5 24.8995V35.0995C59.5 39.7343 59.4995 43.1774 59.2557 45.8945C59.0124 48.6049 58.5301 50.5445 57.5952 52.1837C56.3086 54.4393 54.4398 56.3081 52.1841 57.5947C50.545 58.5296 48.6054 59.012 45.895 59.2552C43.1779 59.499 39.7348 59.4995 35.1 59.4995H24.9C20.2652 59.4995 16.8221 59.499 14.105 59.2552C11.3946 59.012 9.45504 58.5296 7.81585 57.5947C5.56019 56.3081 3.69145 54.4393 2.40484 52.1837C1.46987 50.5445 0.987552 48.6049 0.744315 45.8945C0.50047 43.1774 0.5 39.7343 0.5 35.0995V24.8995Z" stroke="#141414" stroke-opacity="0.1"/>
    <path d="M13 26.0335C13 21.7838 13 19.659 14.0822 18.1694C14.4318 17.6883 14.8548 17.2653 15.3359 16.9157C16.8255 15.8335 18.9503 15.8335 23.2 15.8335H36.8C41.0497 15.8335 43.1745 15.8335 44.6641 16.9157C45.1452 17.2653 45.5682 17.6883 45.9178 18.1694C47 19.659 47 21.7838 47 26.0335V33.9668C47 38.2165 47 40.3414 45.9178 41.831C45.5682 42.312 45.1452 42.7351 44.6641 43.0846C43.1745 44.1668 41.0497 44.1668 36.8 44.1668H23.2C18.9503 44.1668 16.8255 44.1668 15.3359 43.0846C14.8548 42.7351 14.4318 42.312 14.0822 41.831C13 40.3414 13 38.2165 13 33.9668V26.0335Z" fill="#FF974C" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
    <path d="M39.5 36.667H36.6666" stroke="white" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>
    <path d="M45.2 23.0645H14.8C14.0501 23.0645 13.6751 23.0645 13.4122 23.2554C13.3273 23.3171 13.2527 23.3918 13.191 23.4767C13 23.7395 13 24.1145 13 24.8645V27.2645C13 28.0144 13 28.3894 13.191 28.6522C13.2527 28.7371 13.3273 28.8118 13.4122 28.8735C13.6751 29.0645 14.0501 29.0645 14.8 29.0645H45.2C45.9499 29.0645 46.3249 29.0645 46.5878 28.8735C46.6727 28.8118 46.7473 28.7371 46.809 28.6522C47 28.3894 47 28.0144 47 27.2645V24.8645C47 24.1145 47 23.7395 46.809 23.4767C46.7473 23.3918 46.6727 23.3171 46.5878 23.2554C46.3249 23.0645 45.9499 23.0645 45.2 23.0645Z" fill="white" fill-opacity="0.4" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
  </g>
  <defs>
    <clipPath id="clip0_13859_31161">
      <rect width="60" height="60" fill="white"/>
    </clipPath>
  </defs>
  </svg>`,
    Ece = Ke`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
    <rect width="64" height="64" rx="30" fill="#1DC956"/>
    <rect x="0.5" y="0.5" width="63" height="63" rx="29.5" stroke="#141414" stroke-opacity="0.1"/>
    <path d="M32.4053 19.8031C35.3901 19.8031 38.0431 20.8349 40.1619 22.8247L45.9656 17.0211C42.4465 13.7416 37.8773 11.7333 32.4053 11.7333C24.4829 11.7333 17.6475 16.2841 14.3127 22.9168L21.056 28.1493C22.6589 23.359 27.136 19.8031 32.4053 19.8031Z" fill="#1DC956" stroke="white" stroke-width="2" stroke-linejoin="round"/>
    <path d="M32.4053 52.2667C37.8773 52.2667 42.465 50.4611 45.8182 47.3658L39.2407 42.2623C37.4351 43.4783 35.1321 44.2153 32.4053 44.2153C27.136 44.2153 22.6589 40.6594 21.056 35.8691L14.3127 41.1016C17.6475 47.7159 24.4829 52.2667 32.4053 52.2667Z" fill="#2BEE6C"/>
    <path d="M21.056 35.8507L19.5636 36.993L14.3127 41.0832M39.2407 42.2623L45.8182 47.3658C42.465 50.4611 37.8773 52.2667 32.4053 52.2667C24.4829 52.2667 17.6475 47.7159 14.3127 41.1016L21.056 35.8691C22.6589 40.6594 27.136 44.2153 32.4053 44.2153C35.1321 44.2153 37.4351 43.4783 39.2407 42.2623Z" stroke="white" stroke-width="2" stroke-linejoin="round"/>
    <path d="M51.8613 32.4606C51.8613 31.0235 51.7323 29.6417 51.4928 28.3151H32.4053V36.1638H43.3124C42.8334 38.688 41.3963 40.8252 39.2407 42.2623L45.8181 47.3658C49.6503 43.8283 51.8613 38.6327 51.8613 32.4606Z" fill="#1FAD7E" stroke="white" stroke-width="2" stroke-linejoin="round"/>
    <path d="M21.056 35.8507C20.6507 34.6347 20.4111 33.345 20.4111 32C20.4111 30.655 20.6507 29.3653 21.056 28.1493L14.3127 22.9169C12.9309 25.6437 12.1387 28.7205 12.1387 32C12.1387 35.2795 12.9309 38.3564 14.3127 41.0831L19.5636 36.993L21.056 35.8507Z" fill="#86F999"/>
    <path d="M21.056 35.8691L14.3127 41.1016M21.056 35.8507C20.6507 34.6347 20.4111 33.345 20.4111 32C20.4111 30.655 20.6507 29.3653 21.056 28.1493L14.3127 22.9169C12.9309 25.6437 12.1387 28.7205 12.1387 32C12.1387 35.2795 12.9309 38.3564 14.3127 41.0831L19.5636 36.993L21.056 35.8507Z" stroke="white" stroke-width="2" stroke-linejoin="round"/>
  </svg>
  `,
    Ace = Ke`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
    <g clip-path="url(#clip0_241_31635)">
      <path d="M0 26.5595C0 16.6913 0 11.7572 2.1019 8.07217C3.5216 5.58317 5.58366 3.52111 8.07266 2.10141C11.7577 -0.000488281 16.6918 -0.000488281 26.56 -0.000488281H37.44C47.3082 -0.000488281 52.2423 -0.000488281 55.9273 2.10141C58.4163 3.52111 60.4784 5.58317 61.8981 8.07217C64 11.7572 64 16.6913 64 26.5595V37.4395C64 47.3077 64 52.2418 61.8981 55.9268C60.4784 58.4158 58.4163 60.4779 55.9273 61.8976C52.2423 63.9995 47.3082 63.9995 37.44 63.9995H26.56C16.6918 63.9995 11.7577 63.9995 8.07266 61.8976C5.58366 60.4779 3.5216 58.4158 2.1019 55.9268C0 52.2418 0 47.3077 0 37.4395V26.5595Z" fill="#EB8B47"/>
      <path d="M0.5 26.5595C0.5 21.6163 0.50047 17.942 0.760736 15.0418C1.02039 12.1485 1.53555 10.0742 2.53621 8.3199C3.91155 5.90869 5.90917 3.91106 8.32039 2.53572C10.0747 1.53506 12.1489 1.01991 15.0423 0.760247C17.9425 0.499981 21.6168 0.499512 26.56 0.499512H37.44C42.3832 0.499512 46.0575 0.499981 48.9577 0.760247C51.8511 1.01991 53.9253 1.53506 55.6796 2.53572C58.0908 3.91106 60.0885 5.90869 61.4638 8.3199C62.4645 10.0742 62.9796 12.1485 63.2393 15.0418C63.4995 17.942 63.5 21.6163 63.5 26.5595V37.4395C63.5 42.3827 63.4995 46.057 63.2393 48.9572C62.9796 51.8506 62.4645 53.9248 61.4638 55.6791C60.0885 58.0903 58.0908 60.088 55.6796 61.4633C53.9253 62.464 51.8511 62.9791 48.9577 63.2388C46.0575 63.499 42.3832 63.4995 37.44 63.4995H26.56C21.6168 63.4995 17.9425 63.499 15.0423 63.2388C12.1489 62.9791 10.0747 62.464 8.32039 61.4633C5.90917 60.088 3.91155 58.0903 2.53621 55.6791C1.53555 53.9248 1.02039 51.8506 0.760736 48.9572C0.50047 46.057 0.5 42.3827 0.5 37.4395V26.5595Z" stroke="#141414" stroke-opacity="0.1"/>
      <path d="M28.1042 49.2329L13.1024 51.2077L15.0772 36.2059L37.1015 14.1815C39.2441 12.039 40.3154 10.9677 41.5718 10.624C42.4205 10.3918 43.3159 10.3918 44.1645 10.624C45.421 10.9677 46.4922 12.039 48.6348 14.1815L50.1286 15.6753C52.2711 17.8179 53.3424 18.8891 53.6861 20.1456C53.9183 20.9942 53.9183 21.8896 53.6861 22.7383C53.3424 23.9947 52.2711 25.066 50.1286 27.2086L28.1042 49.2329Z" fill="#FF974C" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
      <path d="M38.5962 20.5376L22.4199 36.7139" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
      <path d="M43.7727 25.714L27.5964 41.8903" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
      <path d="M22.3703 36.7635C19.3258 39.808 16.0198 36.6395 16.2616 35.0324" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
      <path d="M27.5466 41.9399C24.5034 44.9831 28.155 48.7098 29.2738 48.0475" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
      <path d="M27.5468 41.9398C23.428 46.0586 18.2516 40.8822 22.3704 36.7634" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
      <path d="M15.8191 50.5214C15.4711 49.5823 14.728 48.8392 13.7889 48.4912" stroke="#E4E7E7" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
      <path d="M49.2862 29.5805L34.7275 15.0219" stroke="#E4E7E7" stroke-width="2" stroke-linejoin="round"/>
    </g>
    <defs>
      <clipPath id="clip0_241_31635">
        <rect width="64" height="64" fill="white"/>
      </clipPath>
    </defs>
  </svg>
  `,
    Sce = Ke`<svg width="64" height="64" viewBox="0 0 64 64" fill="none" xmlns="http://www.w3.org/2000/svg">
    <g clip-path="url(#clip0_241_31636)">
      <path d="M0 26.5595C0 16.6913 0 11.7572 2.1019 8.07217C3.5216 5.58318 5.58366 3.52111 8.07266 2.10141C11.7577 -0.000488281 16.6918 -0.000488281 26.56 -0.000488281H37.44C47.3082 -0.000488281 52.2423 -0.000488281 55.9273 2.10141C58.4163 3.52111 60.4784 5.58318 61.8981 8.07217C64 11.7572 64 16.6913 64 26.5595V37.4395C64 47.3077 64 52.2418 61.8981 55.9269C60.4784 58.4159 58.4163 60.4779 55.9273 61.8976C52.2423 63.9995 47.3082 63.9995 37.44 63.9995H26.56C16.6918 63.9995 11.7577 63.9995 8.07266 61.8976C5.58366 60.4779 3.5216 58.4159 2.1019 55.9269C0 52.2418 0 47.3077 0 37.4395V26.5595Z" fill="#794CFF"/>
      <path d="M0.5 26.5595C0.5 21.6163 0.50047 17.942 0.760736 15.0418C1.02039 12.1485 1.53555 10.0742 2.53621 8.3199C3.91155 5.90869 5.90917 3.91106 8.32039 2.53572C10.0747 1.53506 12.1489 1.01991 15.0423 0.760247C17.9425 0.499981 21.6168 0.499512 26.56 0.499512H37.44C42.3832 0.499512 46.0575 0.499981 48.9577 0.760247C51.8511 1.01991 53.9253 1.53506 55.6796 2.53572C58.0908 3.91106 60.0885 5.90869 61.4638 8.3199C62.4645 10.0742 62.9796 12.1485 63.2393 15.0418C63.4995 17.942 63.5 21.6163 63.5 26.5595V37.4395C63.5 42.3827 63.4995 46.057 63.2393 48.9572C62.9796 51.8506 62.4645 53.9248 61.4638 55.6791C60.0885 58.0903 58.0908 60.088 55.6796 61.4633C53.9253 62.464 51.8511 62.9791 48.9577 63.2388C46.0575 63.499 42.3832 63.4995 37.44 63.4995H26.56C21.6168 63.4995 17.9425 63.499 15.0423 63.2388C12.1489 62.9791 10.0747 62.464 8.32039 61.4633C5.90917 60.088 3.91155 58.0903 2.53621 55.6791C1.53555 53.9248 1.02039 51.8506 0.760736 48.9572C0.50047 46.057 0.5 42.3827 0.5 37.4395V26.5595Z" stroke="#141414" stroke-opacity="0.1"/>
      <path d="M40 39.4595C44.7824 36.693 48 31.5222 48 25.6C48 16.7634 40.8366 9.59998 32 9.59998C23.1634 9.59998 16 16.7634 16 25.6C16 31.5222 19.2176 36.693 24 39.4595V45.8144H40V39.4595Z" fill="#906EF7"/>
      <path d="M24 49.9689C24 51.8192 24 52.7444 24.3941 53.4353C24.6603 53.902 25.0469 54.2886 25.5136 54.5548C26.2046 54.9489 27.1297 54.9489 28.98 54.9489H35.02C36.8703 54.9489 37.7954 54.9489 38.4864 54.5548C38.9531 54.2886 39.3397 53.902 39.6059 53.4353C40 52.7444 40 51.8192 40 49.9689V45.8144H24V49.9689Z" fill="#906EF7"/>
      <path d="M24 45.8144V39.4595C19.2176 36.693 16 31.5222 16 25.6C16 16.7634 23.1634 9.59998 32 9.59998C40.8366 9.59998 48 16.7634 48 25.6C48 31.5222 44.7824 36.693 40 39.4595V45.8144M24 45.8144H40M24 45.8144V49.9689C24 51.8192 24 52.7444 24.3941 53.4353C24.6603 53.902 25.0469 54.2886 25.5136 54.5548C26.2046 54.9489 27.1297 54.9489 28.98 54.9489H35.02C36.8703 54.9489 37.7954 54.9489 38.4864 54.5548C38.9531 54.2886 39.3397 53.902 39.6059 53.4353C40 52.7444 40 51.8192 40 49.9689V45.8144" stroke="white" stroke-width="2" stroke-linejoin="round"/>
      <path d="M24 49.9689C24 51.8192 24 52.7444 24.3941 53.4353C24.6603 53.902 25.0469 54.2886 25.5136 54.5548C26.2046 54.9489 27.1297 54.9489 28.98 54.9489H35.02C36.8703 54.9489 37.7954 54.9489 38.4864 54.5548C38.9531 54.2886 39.3397 53.902 39.6059 53.4353C40 52.7444 40 51.8192 40 49.9689V45.8144H24V49.9689Z" fill="#643CDD" stroke="white" stroke-width="2" stroke-linejoin="round"/>
      <path d="M29.6735 26.9101V29.1109H34.0753V26.9101C34.0753 25.6945 35.0607 24.7092 36.2762 24.7092C37.4917 24.7092 38.4771 25.6945 38.4771 26.9101C38.4771 28.1256 37.4917 29.1109 36.2762 29.1109H34.0753H29.6735H27.4726C26.2571 29.1109 25.2717 28.1256 25.2717 26.9101C25.2717 25.6945 26.2571 24.7092 27.4726 24.7092C28.6881 24.7092 29.6735 25.6945 29.6735 26.9101Z" fill="#906EF7"/>
      <path d="M29.6735 45.3183V26.9101C29.6735 25.6945 28.6881 24.7092 27.4726 24.7092V24.7092C26.2571 24.7092 25.2717 25.6945 25.2717 26.9101V26.9101C25.2717 28.1256 26.2571 29.1109 27.4726 29.1109H36.2762C37.4917 29.1109 38.4771 28.1256 38.4771 26.9101V26.9101C38.4771 25.6945 37.4917 24.7092 36.2762 24.7092V24.7092C35.0607 24.7092 34.0753 25.6945 34.0753 26.9101V45.3183" stroke="white" stroke-width="2" stroke-linejoin="round"/>
    </g>
    <defs>
      <clipPath id="clip0_241_31636">
        <rect width="64" height="64" fill="white"/>
      </clipPath>
    </defs>
  </svg>
  `,
    Ice = Ke`<svg width="40" height="42" viewBox="0 0 40 42" fill="none">
  <path opacity="0.7" d="M19.9526 41.9076L7.3877 34.655V26.1226L19.9526 33.3751V41.9076Z" fill="url(#paint0_linear_2113_32117)"/>
  <path opacity="0.7" d="M19.9521 41.9076L32.5171 34.655V26.1226L19.9521 33.3751V41.9076Z" fill="url(#paint1_linear_2113_32117)"/>
  <path opacity="0.7" d="M39.9095 7.34521V21.8562L32.5166 26.1225V11.6114L39.9095 7.34521Z" fill="url(#paint2_linear_2113_32117)"/>
  <path d="M39.9099 7.34536L27.345 0.0927734L19.9521 4.359L32.5171 11.6116L39.9099 7.34536Z" fill="url(#paint3_linear_2113_32117)"/>
  <path d="M0 7.34536L12.5649 0.0927734L19.9519 4.359L7.387 11.6116L0 7.34536Z" fill="#F969D3"/>
  <path opacity="0.7" d="M0 7.34521V21.8562L7.387 26.1225V11.6114L0 7.34521Z" fill="url(#paint4_linear_2113_32117)"/>
  <defs>
  <linearGradient id="paint0_linear_2113_32117" x1="18.6099" y1="41.8335" x2="7.73529" y2="8.31842" gradientUnits="userSpaceOnUse">
  <stop stop-color="#E98ADA"/>
  <stop offset="1" stop-color="#7E4DBD"/>
  </linearGradient>
  <linearGradient id="paint1_linear_2113_32117" x1="26.2346" y1="26.1226" x2="26.2346" y2="41.9076" gradientUnits="userSpaceOnUse">
  <stop stop-color="#719DED"/>
  <stop offset="1" stop-color="#2545BE"/>
  </linearGradient>
  <linearGradient id="paint2_linear_2113_32117" x1="36.213" y1="7.34521" x2="36.213" y2="26.1225" gradientUnits="userSpaceOnUse">
  <stop stop-color="#93EBFF"/>
  <stop offset="1" stop-color="#197DDB"/>
  </linearGradient>
  <linearGradient id="paint3_linear_2113_32117" x1="29.931" y1="0.0927734" x2="38.2156" y2="14.8448" gradientUnits="userSpaceOnUse">
  <stop stop-color="#F969D3"/>
  <stop offset="1" stop-color="#4F51C0"/>
  </linearGradient>
  <linearGradient id="paint4_linear_2113_32117" x1="18.1251" y1="44.2539" x2="-7.06792" y2="15.2763" gradientUnits="userSpaceOnUse">
  <stop stop-color="#E98ADA"/>
  <stop offset="1" stop-color="#7E4DBD"/>
  </linearGradient>
  </defs>
  </svg>`,
    Tce = Re`
    :host {
      display: block;
      width: var(--local-size);
      height: var(--local-size);
    }
  
    :host svg {
      width: 100%;
      height: 100%;
    }
  `,
    kce = Ke`<svg fill="none" viewBox="0 0 80 80">
    <g clip-path="url(#a)">
      <path fill="url(#b)" d="M40 80a40 40 0 1 0 0-80 40 40 0 0 0 0 80Z" />
      <path
        stroke="#fff"
        stroke-opacity=".1"
        d="M79.5 40a39.5 39.5 0 1 1-79 0 39.5 39.5 0 0 1 79 0Z"
      />
      <path
        fill="#fff"
        d="m62.62 51.54-7.54 7.91a1.75 1.75 0 0 1-1.29.55H18.02a.9.9 0 0 1-.8-.52.84.84 0 0 1 .16-.92l7.55-7.92a1.75 1.75 0 0 1 1.28-.55h35.77a.87.87 0 0 1 .8.52.84.84 0 0 1-.16.93Zm-7.54-15.95a1.75 1.75 0 0 0-1.29-.54H18.02a.89.89 0 0 0-.8.51.84.84 0 0 0 .16.93l7.55 7.92a1.75 1.75 0 0 0 1.28.54h35.77a.89.89 0 0 0 .8-.51.84.84 0 0 0-.16-.93l-7.54-7.92ZM18.02 29.9h35.77a1.79 1.79 0 0 0 1.29-.54l7.54-7.92a.85.85 0 0 0 .16-.93.87.87 0 0 0-.8-.51H26.21a1.79 1.79 0 0 0-1.28.54l-7.55 7.92a.85.85 0 0 0-.16.93.89.89 0 0 0 .8.52Z"
      />
    </g>
    <defs>
      <linearGradient id="b" x1="6.75" x2="80.68" y1="81.91" y2="7.37" gradientUnits="userSpaceOnUse">
        <stop offset=".08" stop-color="#9945FF" />
        <stop offset=".3" stop-color="#8752F3" />
        <stop offset=".5" stop-color="#5497D5" />
        <stop offset=".6" stop-color="#43B4CA" />
        <stop offset=".72" stop-color="#28E0B9" />
        <stop offset=".97" stop-color="#19FB9B" />
      </linearGradient>
      <clipPath id="a"><path fill="#fff" d="M0 0h80v80H0z" /></clipPath>
    </defs>
  </svg> `;
  var hx = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const Rce = {
    browser: oce,
    dao: ace,
    defi: cce,
    defiAlt: lce,
    eth: uce,
    layers: dce,
    lock: hce,
    login: fce,
    network: pce,
    nft: gce,
    noun: mce,
    profile: wce,
    system: vce,
    coinbase: bce,
    meld: Ice,
    onrampCard: Cce,
    moonpay: yce,
    stripe: _ce,
    paypal: xce,
    google: Ece,
    pencil: Ace,
    lightbulb: Sce,
    solana: kce
  };
  let R1 = class extends _e {
    constructor() {
      super(...arguments), this.name = "browser", this.size = "md"
    }
    render() {
      return this.style.cssText = `
         --local-size: var(--wiu-visual-size-${this.size});
     `, K`${Rce[this.name]}`
    }
  };
  R1.styles = [ft, Tce], hx([re()], R1.prototype, "name", void 0), hx([re()], R1.prototype, "size", void 0), R1 = hx([ye("wiu-visual")], R1);
  /**
   * @license
   * Copyright 2018 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  const $e = t => t ?? ni,
    Vt = {
      getSpacingStyles(t, e) {
        if (Array.isArray(t)) return t[e] ? `var(--wiu-spacing-${t[e]})` : void 0;
        if (typeof t == "string") return `var(--wiu-spacing-${t})`
      },
      getFormattedDate(t) {
        return new Intl.DateTimeFormat("en-US", {
          month: "short",
          day: "numeric"
        }).format(t)
      },
      getHostName(t) {
        try {
          return new URL(t).hostname
        } catch {
          return ""
        }
      },
      getTruncateString({
        string: t,
        charsStart: e,
        charsEnd: r,
        truncate: n
      }) {
        return t.length <= e + r ? t : n === "end" ? `${t.substring(0,e)}...` : n === "start" ? `...${t.substring(t.length-r)}` : `${t.substring(0,Math.floor(e))}...${t.substring(t.length-Math.floor(r))}`
      },
      generateAvatarColors(t) {
        const r = t.toLowerCase().replace(/^0x/iu, "").replace(/[^a-f0-9]/gu, "").substring(0, 6).padEnd(6, "0"),
          n = this.hexToRgb(r),
          i = getComputedStyle(document.documentElement).getPropertyValue("--w4m-border-radius-master"),
          o = 100 - 3 * Number(i?.replace("px", "")),
          a = `${o}% ${o}% at 65% 40%`,
          c = [];
        for (let l = 0; l < 5; l += 1) {
          const h = this.tintColor(n, .15 * l);
          c.push(`rgb(${h[0]}, ${h[1]}, ${h[2]})`)
        }
        return `
      --local-color-1: ${c[0]};
      --local-color-2: ${c[1]};
      --local-color-3: ${c[2]};
      --local-color-4: ${c[3]};
      --local-color-5: ${c[4]};
      --local-radial-circle: ${a}
     `
      },
      hexToRgb(t) {
        const e = parseInt(t, 16),
          r = e >> 16 & 255,
          n = e >> 8 & 255,
          i = e & 255;
        return [r, n, i]
      },
      tintColor(t, e) {
        const [r, n, i] = t, s = Math.round(r + (255 - r) * e), o = Math.round(n + (255 - n) * e), a = Math.round(i + (255 - i) * e);
        return [s, o, a]
      },
      isNumber(t) {
        return {
          number: /^[0-9]+$/u
        }.number.test(t)
      },
      getColorTheme(t) {
        return t || (typeof window < "u" && window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : "dark")
      },
      splitBalance(t) {
        const e = t.split(".");
        return e.length === 2 ? [e[0], e[1]] : ["0", "00"]
      },
      roundNumber(t, e, r) {
        return t.toString().length >= e ? Number(t).toFixed(r) : t
      },
      formatNumberToLocalString(t, e = 2) {
        return t === void 0 ? "0.00" : typeof t == "number" ? t.toLocaleString("en-US", {
          maximumFractionDigits: e,
          minimumFractionDigits: e
        }) : parseFloat(t).toLocaleString("en-US", {
          maximumFractionDigits: e,
          minimumFractionDigits: e
        })
      }
    },
    Nce = Re`
    :host {
      display: flex;
      width: inherit;
      height: inherit;
    }
  `;
  var Po = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let _s = class extends _e {
    render() {
      return this.style.cssText = `
        flex-direction: ${this.flexDirection};
        flex-wrap: ${this.flexWrap};
        flex-basis: ${this.flexBasis};
        flex-grow: ${this.flexGrow};
        flex-shrink: ${this.flexShrink};
        align-items: ${this.alignItems};
        justify-content: ${this.justifyContent};
        column-gap: ${this.columnGap&&`var(--wiu-spacing-${this.columnGap})`};
        row-gap: ${this.rowGap&&`var(--wiu-spacing-${this.rowGap})`};
        gap: ${this.gap&&`var(--wiu-spacing-${this.gap})`};
        padding-top: ${this.padding&&Vt.getSpacingStyles(this.padding,0)};
        padding-right: ${this.padding&&Vt.getSpacingStyles(this.padding,1)};
        padding-bottom: ${this.padding&&Vt.getSpacingStyles(this.padding,2)};
        padding-left: ${this.padding&&Vt.getSpacingStyles(this.padding,3)};
        margin-top: ${this.margin&&Vt.getSpacingStyles(this.margin,0)};
        margin-right: ${this.margin&&Vt.getSpacingStyles(this.margin,1)};
        margin-bottom: ${this.margin&&Vt.getSpacingStyles(this.margin,2)};
        margin-left: ${this.margin&&Vt.getSpacingStyles(this.margin,3)};
      `, K`<slot></slot>`
    }
  };
  _s.styles = [ft, Nce], Po([re()], _s.prototype, "flexDirection", void 0), Po([re()], _s.prototype, "flexWrap", void 0), Po([re()], _s.prototype, "flexBasis", void 0), Po([re()], _s.prototype, "flexGrow", void 0), Po([re()], _s.prototype, "flexShrink", void 0), Po([re()], _s.prototype, "alignItems", void 0), Po([re()], _s.prototype, "justifyContent", void 0), Po([re()], _s.prototype, "columnGap", void 0), Po([re()], _s.prototype, "rowGap", void 0), Po([re()], _s.prototype, "gap", void 0), Po([re()], _s.prototype, "padding", void 0), Po([re()], _s.prototype, "margin", void 0), _s = Po([ye("wiu-flex")], _s);
  const Mce = Re`
    :host {
      display: block;
      width: var(--local-width);
      height: var(--local-height);
      border-radius: var(--wiu-border-radius-3xl);
      box-shadow: 0 0 0 8px var(--wiu-color-gray-glass-005);
      overflow: hidden;
      position: relative;
    }
  
    :host([data-variant='generated']) {
      --mixed-local-color-1: var(--local-color-1);
      --mixed-local-color-2: var(--local-color-2);
      --mixed-local-color-3: var(--local-color-3);
      --mixed-local-color-4: var(--local-color-4);
      --mixed-local-color-5: var(--local-color-5);
    }
  
    @supports (background: color-mix(in srgb, white 50%, black)) {
      :host([data-variant='generated']) {
        --mixed-local-color-1: color-mix(
          in srgb,
          var(--w4m-color-mix) var(--w4m-color-mix-strength),
          var(--local-color-1)
        );
        --mixed-local-color-2: color-mix(
          in srgb,
          var(--w4m-color-mix) var(--w4m-color-mix-strength),
          var(--local-color-2)
        );
        --mixed-local-color-3: color-mix(
          in srgb,
          var(--w4m-color-mix) var(--w4m-color-mix-strength),
          var(--local-color-3)
        );
        --mixed-local-color-4: color-mix(
          in srgb,
          var(--w4m-color-mix) var(--w4m-color-mix-strength),
          var(--local-color-4)
        );
        --mixed-local-color-5: color-mix(
          in srgb,
          var(--w4m-color-mix) var(--w4m-color-mix-strength),
          var(--local-color-5)
        );
      }
    }
  
    :host([data-variant='generated']) {
      box-shadow: 0 0 0 8px var(--wiu-color-gray-glass-005);
      background: radial-gradient(
        var(--local-radial-circle),
        #fff 0.52%,
        var(--mixed-local-color-5) 31.25%,
        var(--mixed-local-color-3) 51.56%,
        var(--mixed-local-color-2) 65.63%,
        var(--mixed-local-color-1) 82.29%,
        var(--mixed-local-color-4) 100%
      );
    }
  
    :host([data-variant='default']) {
      box-shadow: 0 0 0 8px var(--wiu-color-gray-glass-005);
      background: radial-gradient(
        75.29% 75.29% at 64.96% 24.36%,
        #fff 0.52%,
        #f5ccfc 31.25%,
        #dba4f5 51.56%,
        #9a8ee8 65.63%,
        #6493da 82.29%,
        #6ebdea 100%
      );
    }
  `;
  var m2 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let ih = class extends _e {
    constructor() {
      super(...arguments), this.imageSrc = void 0, this.alt = void 0, this.address = void 0, this.size = "xl"
    }
    render() {
      return this.style.cssText = `
      --local-width: var(--wiu-icon-box-size-${this.size});
      --local-height: var(--wiu-icon-box-size-${this.size});
      `, K`${this.visualTemplate()}`
    }
    visualTemplate() {
      if (this.imageSrc) return this.dataset.variant = "image", K`<wiu-image src=${this.imageSrc} alt=${this.alt??"avatar"}></wiu-image>`;
      if (this.address) {
        this.dataset.variant = "generated";
        const e = Vt.generateAvatarColors(this.address);
        return this.style.cssText += `
   ${e}`, null
      }
      return this.dataset.variant = "default", null
    }
  };
  ih.styles = [ft, Mce], m2([re()], ih.prototype, "imageSrc", void 0), m2([re()], ih.prototype, "alt", void 0), m2([re()], ih.prototype, "address", void 0), m2([re()], ih.prototype, "size", void 0), ih = m2([ye("wiu-avatar")], ih);
  const Pce = Re`
    :host {
      display: inline-flex;
      justify-content: center;
      align-items: center;
      position: relative;
      overflow: hidden;
      background-color: var(--wiu-color-gray-glass-020);
      border-radius: var(--local-border-radius);
      border: var(--local-border);
      box-sizing: content-box;
      width: var(--local-size);
      height: var(--local-size);
      min-height: var(--local-size);
      min-width: var(--local-size);
    }
  
    @supports (background: color-mix(in srgb, white 50%, black)) {
      :host {
        background-color: color-mix(in srgb, var(--local-bg-value) var(--local-bg-mix), transparent);
      }
    }
  `;
  var $u = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let fa = class extends _e {
    constructor() {
      super(...arguments), this.size = "md", this.backgroundColor = "accent-100", this.iconColor = "accent-100", this.background = "transparent", this.border = !1, this.borderColor = "wiu-color-bg-125", this.icon = "copy"
    }
    render() {
      const e = this.iconSize || this.size,
        r = this.size === "lg",
        n = this.size === "xl",
        i = r ? "12%" : "16%",
        s = r ? "xxs" : n ? "s" : "3xl",
        o = this.background === "gray",
        a = this.background === "opaque",
        c = this.backgroundColor === "accent-100" && a || this.backgroundColor === "success-100" && a || this.backgroundColor === "error-100" && a || this.backgroundColor === "inverse-100" && a;
      let l = `var(--wiu-color-${this.backgroundColor})`;
      return c ? l = `var(--wiu-icon-box-bg-${this.backgroundColor})` : o && (l = `var(--wiu-color-gray-${this.backgroundColor})`), this.style.cssText = `
         --local-bg-value: ${l};
         --local-bg-mix: ${c||o?"100%":i};
         --local-border-radius: var(--wiu-border-radius-${s});
         --local-size: var(--wiu-icon-box-size-${this.size});
         --local-border: ${this.borderColor==="wiu-color-bg-125"?"2px":"1px"} solid ${this.border?`var(--${this.borderColor})`:"transparent"}
     `, K` <wiu-icon color=${this.iconColor} size=${e} name=${this.icon}></wiu-icon> `
    }
  };
  fa.styles = [ft, ir, Pce], $u([re()], fa.prototype, "size", void 0), $u([re()], fa.prototype, "backgroundColor", void 0), $u([re()], fa.prototype, "iconColor", void 0), $u([re()], fa.prototype, "iconSize", void 0), $u([re()], fa.prototype, "background", void 0), $u([re({
    type: Boolean
  })], fa.prototype, "border", void 0), $u([re()], fa.prototype, "borderColor", void 0), $u([re()], fa.prototype, "icon", void 0), fa = $u([ye("wiu-icon-box")], fa);
  const $ce = Re`
    :host {
      display: block;
    }
  
    button {
      border-radius: var(--wiu-border-radius-3xl);
      background: var(--wiu-color-gray-glass-002);
      display: flex;
      gap: var(--wiu-spacing-xs);
      padding: var(--wiu-spacing-3xs) var(--wiu-spacing-xs) var(--wiu-spacing-3xs)
        var(--wiu-spacing-xs);
      border: 1px solid var(--wiu-color-gray-glass-005);
    }
  
    button:disabled {
      background: var(--wiu-color-gray-glass-015);
    }
  
    button:disabled > wiu-text {
      color: var(--wiu-color-gray-glass-015);
    }
  
    button:disabled > wiu-flex > wiu-text {
      color: var(--wiu-color-gray-glass-015);
    }
  
    button:disabled > wiu-image,
    button:disabled > wiu-flex > wiu-avatar {
      filter: grayscale(1);
    }
  
    button:has(wiu-image) {
      padding: var(--wiu-spacing-3xs) var(--wiu-spacing-3xs) var(--wiu-spacing-3xs)
        var(--wiu-spacing-xs);
    }
  
    wiu-text {
      color: var(--wiu-color-fg-100);
    }
  
    wiu-flex > wiu-text {
      color: var(--wiu-color-fg-200);
    }
  
    wiu-image,
    wiu-icon-box {
      border-radius: var(--wiu-border-radius-3xl);
      width: 24px;
      height: 24px;
      box-shadow: 0 0 0 2px var(--wiu-color-gray-glass-005);
    }
  
    wiu-flex {
      border-radius: var(--wiu-border-radius-3xl);
      border: 1px solid var(--wiu-color-gray-glass-005);
      background: var(--wiu-color-gray-glass-005);
      padding: 4px var(--wiu-spacing-m) 4px var(--wiu-spacing-xxs);
    }
  
    button.local-no-balance {
      border-radius: 0px;
      border: none;
      background: transparent;
    }
  
    wiu-avatar {
      width: 20px;
      height: 20px;
      box-shadow: 0 0 0 2px var(--wiu-color-accent-glass-010);
    }
  
    @media (max-width: 500px) {
      button {
        gap: 0px;
        padding: var(--wiu-spacing-3xs) var(--wiu-spacing-xs) !important;
        height: 32px;
      }
      wiu-image,
      wiu-icon-box,
      button > wiu-text {
        visibility: hidden;
        width: 0px;
        height: 0px;
      }
      button {
        border-radius: 0px;
        border: none;
        background: transparent;
        padding: 0px;
      }
    }
  
    @media (hover: hover) and (pointer: fine) {
      button:hover:enabled > wiu-flex > wiu-text {
        color: var(--wiu-color-fg-175);
      }
  
      button:active:enabled > wiu-flex > wiu-text {
        color: var(--wiu-color-fg-175);
      }
    }
  `;
  var nl = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let $o = class extends _e {
    constructor() {
      super(...arguments), this.networkSrc = void 0, this.avatarSrc = void 0, this.balance = void 0, this.isUnsupportedChain = void 0, this.disabled = !1, this.address = "", this.profileName = "", this.charsStart = 4, this.charsEnd = 6
    }
    render() {
      return K`
        <button
          ?disabled=${this.disabled}
          class=${$e(this.balance?void 0:"local-no-balance")}
        >
          ${this.balanceTemplate()}
          <wiu-flex gap="xxs" alignItems="center">
            <wiu-avatar
              .imageSrc=${this.avatarSrc}
              alt=${this.address}
              address=${this.address}
            ></wiu-avatar>
            <wiu-text variant="paragraph-600" color="inherit">
              ${this.address?Vt.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?18:this.charsStart,charsEnd:this.profileName?0:this.charsEnd,truncate:this.profileName?"end":"middle"}):null}
            </wiu-text>
          </wiu-flex>
        </button>
      `
    }
    balanceTemplate() {
      if (this.isUnsupportedChain) return K` <wiu-icon-box
            size="sm"
            iconColor="error-100"
            backgroundColor="error-100"
            icon="warningCircle"
          ></wiu-icon-box>
          <wiu-text variant="paragraph-600" color="inherit"> Switch Network</wiu-text>`;
      if (this.balance) {
        const e = this.networkSrc ? K`<wiu-image src=${this.networkSrc}></wiu-image>` : K`
              <wiu-icon-box
                size="sm"
                iconColor="fg-200"
                backgroundColor="fg-300"
                icon="networkPlaceholder"
              ></wiu-icon-box>
            `;
        return K`
          ${e}
          <wiu-text variant="paragraph-600" color="inherit"> ${this.balance}</wiu-text>
        `
      }
      return null
    }
  };
  $o.styles = [ft, ir, $ce], nl([re()], $o.prototype, "networkSrc", void 0), nl([re()], $o.prototype, "avatarSrc", void 0), nl([re()], $o.prototype, "balance", void 0), nl([re({
    type: Boolean
  })], $o.prototype, "isUnsupportedChain", void 0), nl([re({
    type: Boolean
  })], $o.prototype, "disabled", void 0), nl([re()], $o.prototype, "address", void 0), nl([re()], $o.prototype, "profileName", void 0), nl([re()], $o.prototype, "charsStart", void 0), nl([re()], $o.prototype, "charsEnd", void 0), $o = nl([ye("wiu-account-button")], $o);
  const Oce = Re`
    :host {
      position: relative;
      background-color: var(--wiu-color-gray-glass-002);
      display: flex;
      justify-content: center;
      align-items: center;
      width: var(--local-size);
      height: var(--local-size);
      border-radius: inherit;
      border-radius: var(--local-border-radius);
    }
  
    :host > wiu-flex {
      overflow: hidden;
      border-radius: inherit;
      border-radius: var(--local-border-radius);
    }
  
    :host::after {
      content: '';
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      border-radius: inherit;
      border: 1px solid var(--wiu-color-gray-glass-010);
      pointer-events: none;
    }
  
    :host([name='Extension'])::after {
      border: 1px solid var(--wiu-color-accent-glass-010);
    }
  
    :host([data-wallet-icon='allWallets']) {
      background-color: var(--wiu-all-wallets-bg-100);
    }
  
    :host([data-wallet-icon='allWallets'])::after {
      border: 1px solid var(--wiu-color-accent-glass-010);
    }
  
    wiu-icon[data-parent-size='inherit'] {
      width: 75%;
      height: 75%;
      align-items: center;
    }
  
    wiu-icon[data-parent-size='sm'] {
      width: 18px;
      height: 18px;
    }
  
    wiu-icon[data-parent-size='md'] {
      width: 24px;
      height: 24px;
    }
  
    wiu-icon[data-parent-size='lg'] {
      width: 42px;
      height: 42px;
    }
  
    wiu-icon[data-parent-size='full'] {
      width: 100%;
      height: 100%;
    }
  
    :host > wiu-icon-box {
      position: absolute;
      overflow: hidden;
      right: -1px;
      bottom: -2px;
      z-index: 1;
      border: 2px solid var(--wiu-color-bg-150, #1e1f1f);
      padding: 1px;
    }
  `;
  var Wf = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let il = class extends _e {
    constructor() {
      super(...arguments), this.size = "md", this.name = "", this.installed = !1, this.badgeSize = "xs"
    }
    render() {
      let e = "xxs";
      return this.size === "lg" ? e = "m" : this.size === "md" ? e = "xs" : e = "xxs", this.style.cssText = `
         --local-border-radius: var(--wiu-border-radius-${e});
         --local-size: var(--wiu-wallet-image-size-${this.size});
     `, this.walletIcon && (this.dataset.walletIcon = this.walletIcon), K`
        <wiu-flex justifyContent="center" alignItems="center"> ${this.templateVisual()} </wiu-flex>
      `
    }
    templateVisual() {
      return this.imageSrc ? K`<wiu-image src=${this.imageSrc} alt=${this.name}></wiu-image>` : this.walletIcon ? K`<wiu-icon
          data-parent-size="md"
          size="md"
          color="inherit"
          name=${this.walletIcon}
        ></wiu-icon>` : K`<wiu-icon
        data-parent-size=${this.size}
        size="inherit"
        color="inherit"
        name="walletPlaceholder"
      ></wiu-icon>`
    }
  };
  il.styles = [ft, Oce], Wf([re()], il.prototype, "size", void 0), Wf([re()], il.prototype, "name", void 0), Wf([re()], il.prototype, "imageSrc", void 0), Wf([re()], il.prototype, "walletIcon", void 0), Wf([re({
    type: Boolean
  })], il.prototype, "installed", void 0), Wf([re()], il.prototype, "badgeSize", void 0), il = Wf([ye("wiu-wallet-image")], il);
  const Dce = Re`
    :host {
      position: relative;
      border-radius: var(--wiu-border-radius-xxs);
      width: 40px;
      height: 40px;
      overflow: hidden;
      background: var(--wiu-color-gray-glass-002);
      display: flex;
      justify-content: center;
      align-items: center;
      flex-wrap: wrap;
      gap: var(--wiu-spacing-4xs);
      padding: 3.75px !important;
    }
  
    :host::after {
      content: '';
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      border-radius: inherit;
      border: 1px solid var(--wiu-color-gray-glass-010);
      pointer-events: none;
    }
  
    :host > wiu-wallet-image {
      width: 14px;
      height: 14px;
      border-radius: var(--wiu-border-radius-5xs);
    }
  
    :host > wiu-flex {
      padding: 2px;
      position: fixed;
      overflow: hidden;
      left: 34px;
      bottom: 8px;
      background: var(--dark-background-150, #1e1f1f);
      border-radius: 50%;
      z-index: 2;
      display: flex;
    }
  `;
  var NP = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const fx = 4;
  let w2 = class extends _e {
    constructor() {
      super(...arguments), this.walletImages = []
    }
    render() {
      const e = this.walletImages.length < fx;
      return K`${this.walletImages.slice(0,fx).map(({src:r,walletName:n})=>K` <
        wui - wallet - image
      size = "inherit"
      imageSrc = $ {
        r
      }
      name = $ {
          $e(n)
        } >
        < /wiu-wallet-image>
      `)}
        ${e?[...Array(fx-this.walletImages.length)].map(()=>K` <wiu-wallet-image size="inherit" name=""></wiu-wallet-image>`):null}
        <wiu-flex>
          <wiu-icon-box
            size="xxs"
            iconSize="xxs"
            iconcolor="success-100"
            backgroundcolor="success-100"
            icon="checkmark"
            background="opaque"
          ></wiu-icon-box>
        </wiu-flex>`
    }
  };
  w2.styles = [ft, Dce], NP([re({
    type: Array
  })], w2.prototype, "walletImages", void 0), w2 = NP([ye("wiu-all-wallets-image")], w2);
  const Lce = Re`
    :host {
      width: var(--local-width);
      position: relative;
    }
  
    button {
      border: none;
      border-radius: var(--local-border-radius);
      width: var(--local-width);
      white-space: nowrap;
    }
  
    /* -- Sizes --------------------------------------------------- */
    button[data-size='md'] {
      padding: 8.2px var(--wiu-spacing-l) 9px var(--wiu-spacing-l);
      height: 36px;
    }
  
    button[data-size='md'][data-icon-left='true'][data-icon-right='false'] {
      padding: 8.2px var(--wiu-spacing-l) 9px var(--wiu-spacing-s);
    }
  
    button[data-size='md'][data-icon-right='true'][data-icon-left='false'] {
      padding: 8.2px var(--wiu-spacing-s) 9px var(--wiu-spacing-l);
    }
  
    button[data-size='lg'] {
      padding: var(--wiu-spacing-m) var(--wiu-spacing-2l);
      height: 48px;
    }
  
    /* -- Variants --------------------------------------------------------- */
    button[data-variant='main'] {
      background-color: var(--wiu-color-accent-100);
      color: var(--wiu-color-inverse-100);
      border: none;
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-010);
    }
  
    button[data-variant='inverse'] {
      background-color: var(--wiu-color-inverse-100);
      color: var(--wiu-color-inverse-000);
      border: none;
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-010);
    }
  
    button[data-variant='accent'] {
      background-color: var(--wiu-color-accent-glass-010);
      color: var(--wiu-color-accent-100);
      border: none;
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-005);
    }
  
    button[data-variant='accent-error'] {
      background: var(--wiu-color-error-glass-015);
      color: var(--wiu-color-error-100);
      border: none;
      box-shadow: inset 0 0 0 1px var(--wiu-color-error-glass-010);
    }
  
    button[data-variant='accent-success'] {
      background: var(--wiu-color-success-glass-015);
      color: var(--wiu-color-success-100);
      border: none;
      box-shadow: inset 0 0 0 1px var(--wiu-color-success-glass-010);
    }
  
    button[data-variant='neutral'] {
      background: transparent;
      color: var(--wiu-color-fg-100);
      border: none;
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-005);
    }
  
    /* -- Focus states --------------------------------------------------- */
    button[data-variant='main']:focus-visible:enabled {
      background-color: var(--wiu-color-accent-090);
      box-shadow:
        inset 0 0 0 1px var(--wiu-color-accent-100),
        0 0 0 4px var(--wiu-color-accent-glass-020);
    }
    button[data-variant='inverse']:focus-visible:enabled {
      background-color: var(--wiu-color-inverse-100);
      box-shadow:
        inset 0 0 0 1px var(--wiu-color-gray-glass-010),
        0 0 0 4px var(--wiu-color-accent-glass-020);
    }
    button[data-variant='accent']:focus-visible:enabled {
      background-color: var(--wiu-color-accent-glass-010);
      box-shadow:
        inset 0 0 0 1px var(--wiu-color-accent-100),
        0 0 0 4px var(--wiu-color-accent-glass-020);
    }
    button[data-variant='accent-error']:focus-visible:enabled {
      background: var(--wiu-color-error-glass-015);
      box-shadow:
        inset 0 0 0 1px var(--wiu-color-error-100),
        0 0 0 4px var(--wiu-color-error-glass-020);
    }
    button[data-variant='accent-success']:focus-visible:enabled {
      background: var(--wiu-color-success-glass-015);
      box-shadow:
        inset 0 0 0 1px var(--wiu-color-success-100),
        0 0 0 4px var(--wiu-color-success-glass-020);
    }
    button[data-variant='neutral']:focus-visible:enabled {
      background: var(--wiu-color-gray-glass-005);
      box-shadow:
        inset 0 0 0 1px var(--wiu-color-gray-glass-010),
        0 0 0 4px var(--wiu-color-gray-glass-002);
    }
  
    /* -- Hover & Active states ----------------------------------------------------------- */
    @media (hover: hover) and (pointer: fine) {
      button[data-variant='main']:hover:enabled {
        background-color: var(--wiu-color-accent-090);
      }
  
      button[data-variant='main']:active:enabled {
        background-color: var(--wiu-color-accent-080);
      }
  
      button[data-variant='accent']:hover:enabled {
        background-color: var(--wiu-color-accent-glass-015);
      }
  
      button[data-variant='accent']:active:enabled {
        background-color: var(--wiu-color-accent-glass-020);
      }
  
      button[data-variant='accent-error']:hover:enabled {
        background: var(--wiu-color-error-glass-020);
        color: var(--wiu-color-error-100);
      }
  
      button[data-variant='accent-error']:active:enabled {
        background: var(--wiu-color-error-glass-030);
        color: var(--wiu-color-error-100);
      }
  
      button[data-variant='accent-success']:hover:enabled {
        background: var(--wiu-color-success-glass-020);
        color: var(--wiu-color-success-100);
      }
  
      button[data-variant='accent-success']:active:enabled {
        background: var(--wiu-color-success-glass-030);
        color: var(--wiu-color-success-100);
      }
  
      button[data-variant='neutral']:hover:enabled {
        background: var(--wiu-color-gray-glass-002);
      }
  
      button[data-variant='neutral']:active:enabled {
        background: var(--wiu-color-gray-glass-005);
      }
  
      button[data-size='lg'][data-icon-left='true'][data-icon-right='false'] {
        padding-left: var(--wiu-spacing-m);
      }
  
      button[data-size='lg'][data-icon-right='true'][data-icon-left='false'] {
        padding-right: var(--wiu-spacing-m);
      }
    }
  
    /* -- Disabled state --------------------------------------------------- */
    button:disabled {
      background-color: var(--wiu-color-gray-glass-002);
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-002);
      color: var(--wiu-color-gray-glass-020);
      cursor: not-allowed;
    }
  
    button > wiu-text {
      transition: opacity var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: opacity;
      opacity: var(--local-opacity-100);
    }
  
    ::slotted(*) {
      transition: opacity var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: opacity;
      opacity: var(--local-opacity-100);
    }
  
    wiu-loading-spinner {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      opacity: var(--local-opacity-000);
    }
  `;
  var sl = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const MP = {
      main: "inverse-100",
      inverse: "inverse-000",
      accent: "accent-100",
      "accent-error": "error-100",
      "accent-success": "success-100",
      neutral: "fg-100",
      disabled: "gray-glass-020"
    },
    Bce = {
      lg: "paragraph-600",
      md: "small-600"
    },
    Uce = {
      lg: "md",
      md: "md"
    };
  let Oo = class extends _e {
    constructor() {
      super(...arguments), this.size = "lg", this.disabled = !1, this.fullWidth = !1, this.loading = !1, this.variant = "main", this.hasIconLeft = !1, this.hasIconRight = !1, this.borderRadius = "m"
    }
    render() {
      this.style.cssText = `
      --local-width: ${this.fullWidth?"100%":"auto"};
      --local-opacity-100: ${this.loading?0:1};
      --local-opacity-000: ${this.loading?1:0};
      --local-border-radius: var(--wiu-border-radius-${this.borderRadius});
      `;
      const e = this.textVariant ?? Bce[this.size];
      return K`
        <button
          data-variant=${this.variant}
          data-icon-left=${this.hasIconLeft}
          data-icon-right=${this.hasIconRight}
          data-size=${this.size}
          ?disabled=${this.disabled}
          ontouchstart
        >
          ${this.loadingTemplate()}
          <slot name="iconLeft" @slotchange=${()=>this.handleSlotLeftChange()}></slot>
          <wiu-text variant=${e} color="inherit">
            <slot></slot>
          </wiu-text>
          <slot name="iconRight" @slotchange=${()=>this.handleSlotRightChange()}></slot>
        </button>
      `
    }
    handleSlotLeftChange() {
      this.hasIconLeft = !0
    }
    handleSlotRightChange() {
      this.hasIconRight = !0
    }
    loadingTemplate() {
      if (this.loading) {
        const e = Uce[this.size],
          r = this.disabled ? MP.disabled : MP[this.variant];
        return K`<wiu-loading-spinner color=${r} size=${e}></wiu-loading-spinner>`
      }
      return K``
    }
  };
  Oo.styles = [ft, ir, Lce], sl([re()], Oo.prototype, "size", void 0), sl([re({
    type: Boolean
  })], Oo.prototype, "disabled", void 0), sl([re({
    type: Boolean
  })], Oo.prototype, "fullWidth", void 0), sl([re({
    type: Boolean
  })], Oo.prototype, "loading", void 0), sl([re()], Oo.prototype, "variant", void 0), sl([re({
    type: Boolean
  })], Oo.prototype, "hasIconLeft", void 0), sl([re({
    type: Boolean
  })], Oo.prototype, "hasIconRight", void 0), sl([re()], Oo.prototype, "borderRadius", void 0), sl([re()], Oo.prototype, "textVariant", void 0), Oo = sl([ye("wiu-button")], Oo);
  const PP = Ke`<svg  viewBox="0 0 48 54" fill="none">
    <path
      d="M43.4605 10.7248L28.0485 1.61089C25.5438 0.129705 22.4562 0.129705 19.9515 1.61088L4.53951 10.7248C2.03626 12.2051 0.5 14.9365 0.5 17.886V36.1139C0.5 39.0635 2.03626 41.7949 4.53951 43.2752L19.9515 52.3891C22.4562 53.8703 25.5438 53.8703 28.0485 52.3891L43.4605 43.2752C45.9637 41.7949 47.5 39.0635 47.5 36.114V17.8861C47.5 14.9365 45.9637 12.2051 43.4605 10.7248Z"
    />
  </svg>`,
    jce = Re`
    :host {
      display: flex;
      flex-direction: column;
      align-items: center;
      width: 104px;
      row-gap: var(--wiu-spacing-xs);
      padding: var(--wiu-spacing-xs) 10px;
      background-color: var(--wiu-color-gray-glass-002);
      border-radius: clamp(0px, var(--wiu-border-radius-xs), 20px);
      position: relative;
    }
  
    wiu-shimmer[data-type='network'] {
      border: none;
      -webkit-clip-path: var(--wiu-path-network);
      clip-path: var(--wiu-path-network);
    }
  
    svg {
      position: absolute;
      width: 48px;
      height: 54px;
      z-index: 1;
    }
  
    svg > path {
      stroke: var(--wiu-color-gray-glass-010);
      stroke-width: 1px;
    }
  
    @media (max-width: 350px) {
      :host {
        width: 100%;
      }
    }
  `;
  var $P = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let v2 = class extends _e {
    constructor() {
      super(...arguments), this.type = "wallet"
    }
    render() {
      return K`
        ${this.shimmerTemplate()}
        <wiu-shimmer width="56px" height="20px" borderRadius="xs"></wiu-shimmer>
      `
    }
    shimmerTemplate() {
      return this.type === "network" ? K` <wiu-shimmer
            data-type=${this.type}
            width="48px"
            height="54px"
            borderRadius="xs"
          ></wiu-shimmer>
          ${PP}` : K`<wiu-shimmer width="56px" height="56px" borderRadius="xs"></wiu-shimmer>`
    }
  };
  v2.styles = [ft, ir, jce], $P([re()], v2.prototype, "type", void 0), v2 = $P([ye("wiu-card-select-loader")], v2);
  const Fce = Ke`
    <svg fill="none" viewBox="0 0 36 40">
      <path
        d="M15.4 2.1a5.21 5.21 0 0 1 5.2 0l11.61 6.7a5.21 5.21 0 0 1 2.61 4.52v13.4c0 1.87-1 3.59-2.6 4.52l-11.61 6.7c-1.62.93-3.6.93-5.22 0l-11.6-6.7a5.21 5.21 0 0 1-2.61-4.51v-13.4c0-1.87 1-3.6 2.6-4.52L15.4 2.1Z"
      />
    </svg>
  `,
    Wce = Ke`<svg width="86" height="96" fill="none">
    <path
      d="M78.3244 18.926L50.1808 2.45078C45.7376 -0.150261 40.2624 -0.150262 35.8192 2.45078L7.6756 18.926C3.23322 21.5266 0.5 26.3301 0.5 31.5248V64.4752C0.5 69.6699 3.23322 74.4734 7.6756 77.074L35.8192 93.5492C40.2624 96.1503 45.7376 96.1503 50.1808 93.5492L78.3244 77.074C82.7668 74.4734 85.5 69.6699 85.5 64.4752V31.5248C85.5 26.3301 82.7668 21.5266 78.3244 18.926Z"
    />
  </svg>`,
    zce = Re`
    :host {
      position: relative;
      border-radius: inherit;
      display: flex;
      justify-content: center;
      align-items: center;
      width: var(--local-width);
      height: var(--local-height);
    }
  
    :host([data-round='true']) {
      background: var(--wiu-color-gray-glass-002);
      border-radius: 100%;
      outline: 1px solid var(--wiu-color-gray-glass-005);
    }
  
    svg {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 1;
      fill: var(--wiu-color-gray-glass-002);
    }
  
    svg > path {
      stroke: var(--local-stroke);
    }
  
    wiu-image {
      width: 100%;
      height: 100%;
      -webkit-clip-path: var(--local-path);
      clip-path: var(--local-path);
      background: var(--wiu-color-gray-glass-002);
    }
  
    wiu-icon {
      transform: translateY(-5%);
      width: var(--local-icon-size);
      height: var(--local-icon-size);
    }
  `;
  var zf = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let ol = class extends _e {
    constructor() {
      super(...arguments), this.size = "md", this.name = "uknown", this.networkImagesBySize = {
        sm: Fce,
        md: PP,
        lg: Wce
      }, this.selected = !1, this.round = !1
    }
    render() {
      return this.round ? (this.dataset.round = "true", this.style.cssText = `
        --local-width: var(--wiu-spacing-3xl);
        --local-height: var(--wiu-spacing-3xl);
        --local-icon-size: var(--wiu-spacing-l);
      `) : this.style.cssText = `
  
        --local-path: var(--wiu-path-network-${this.size});
        --local-width:  var(--wiu-width-network-${this.size});
        --local-height:  var(--wiu-height-network-${this.size});
        --local-icon-size:  var(--wiu-icon-size-network-${this.size});
      `, K`${this.templateVisual()} ${this.svgTemplate()} `
    }
    svgTemplate() {
      return this.round ? null : this.networkImagesBySize[this.size]
    }
    templateVisual() {
      return this.imageSrc ? K`<wiu-image src=${this.imageSrc} alt=${this.name}></wiu-image>` : K`<wiu-icon size="inherit" color="fg-200" name="networkPlaceholder"></wiu-icon>`
    }
  };
  ol.styles = [ft, zce], zf([re()], ol.prototype, "size", void 0), zf([re()], ol.prototype, "name", void 0), zf([re({
    type: Object
  })], ol.prototype, "networkImagesBySize", void 0), zf([re()], ol.prototype, "imageSrc", void 0), zf([re({
    type: Boolean
  })], ol.prototype, "selected", void 0), zf([re({
    type: Boolean
  })], ol.prototype, "round", void 0), ol = zf([ye("wiu-network-image")], ol);
  const Hce = Re`
    button {
      flex-direction: column;
      width: 76px;
      row-gap: var(--wiu-spacing-xs);
      padding: var(--wiu-spacing-xs) var(--wiu-spacing-0);
      background-color: var(--wiu-color-gray-glass-002);
      border-radius: clamp(0px, var(--wiu-border-radius-xs), 20px);
    }
  
    button > wiu-text {
      color: var(--wiu-color-fg-100);
      max-width: var(--wiu-icon-box-size-xl);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      justify-content: center;
    }
  
    button:disabled > wiu-text {
      color: var(--wiu-color-gray-glass-015);
    }
  
    [data-selected='true'] {
      background-color: var(--wiu-color-accent-glass-020);
    }
  
    @media (hover: hover) and (pointer: fine) {
      [data-selected='true']:hover:enabled {
        background-color: var(--wiu-color-accent-glass-015);
      }
    }
  
    [data-selected='true']:active:enabled {
      background-color: var(--wiu-color-accent-glass-010);
    }
  `;
  var Hf = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let al = class extends _e {
    constructor() {
      super(...arguments), this.name = "Unknown", this.type = "wallet", this.imageSrc = void 0, this.disabled = !1, this.selected = !1, this.installed = !1
    }
    render() {
      return K`
        <button data-selected=${$e(this.selected)} ?disabled=${this.disabled} ontouchstart>
          ${this.imageTemplate()}
          <wiu-text variant="tiny-500" color=${this.selected?"accent-100":"inherit"}>
            ${this.name}
          </wiu-text>
        </button>
      `
    }
    imageTemplate() {
      return this.type === "network" ? K`
          <wiu-network-image
            .selected=${this.selected}
            imageSrc=${$e(this.imageSrc)}
            name=${this.name}
          >
          </wiu-network-image>
        ` : K`
        <wiu-wallet-image
          size="md"
          imageSrc=${$e(this.imageSrc)}
          name=${this.name}
          .installed=${this.installed}
          badgeSize="sm"
        >
        </wiu-wallet-image>
      `
    }
  };
  al.styles = [ft, ir, Hce], Hf([re()], al.prototype, "name", void 0), Hf([re()], al.prototype, "type", void 0), Hf([re()], al.prototype, "imageSrc", void 0), Hf([re({
    type: Boolean
  })], al.prototype, "disabled", void 0), Hf([re({
    type: Boolean
  })], al.prototype, "selected", void 0), Hf([re({
    type: Boolean
  })], al.prototype, "installed", void 0), al = Hf([ye("wiu-card-select")], al);
  const qce = Re`
    a {
      border: 1px solid var(--wiu-color-gray-glass-010);
      border-radius: var(--wiu-border-radius-3xl);
    }
  
    wiu-image {
      border-radius: var(--wiu-border-radius-3xl);
      overflow: hidden;
    }
  
    a.disabled > wiu-icon:not(.image-icon),
    a.disabled > wiu-image {
      filter: grayscale(1);
    }
  
    a[data-variant='fill'] {
      color: var(--wiu-color-inverse-100);
      background-color: var(--wiu-color-accent-100);
    }
  
    a[data-variant='shade'],
    a[data-variant='shadeSmall'] {
      background-color: transparent;
      background-color: var(--wiu-color-gray-glass-010);
      color: var(--wiu-color-fg-200);
    }
  
    a[data-variant='success'] {
      column-gap: var(--wiu-spacing-xxs);
      border: 1px solid var(--wiu-color-success-glass-010);
      background-color: var(--wiu-color-success-glass-010);
      color: var(--wiu-color-success-100);
    }
  
    a[data-variant='error'] {
      column-gap: var(--wiu-spacing-xxs);
      border: 1px solid var(--wiu-color-error-glass-010);
      background-color: var(--wiu-color-error-glass-010);
      color: var(--wiu-color-error-100);
    }
  
    a[data-variant='transparent'] {
      column-gap: var(--wiu-spacing-xxs);
      background-color: transparent;
      color: var(--wiu-color-fg-150);
    }
  
    a[data-variant='transparent'],
    a[data-variant='success'],
    a[data-variant='shadeSmall'],
    a[data-variant='error'] {
      padding: 7px var(--wiu-spacing-s) 7px 10px;
    }
  
    a[data-variant='transparent']:has(wiu-text:first-child),
    a[data-variant='success']:has(wiu-text:first-child),
    a[data-variant='shadeSmall']:has(wiu-text:first-child),
    a[data-variant='error']:has(wiu-text:first-child) {
      padding: 7px var(--wiu-spacing-s);
    }
  
    a[data-variant='fill'],
    a[data-variant='shade'] {
      column-gap: var(--wiu-spacing-xs);
      padding: var(--wiu-spacing-xxs) var(--wiu-spacing-m) var(--wiu-spacing-xxs)
        var(--wiu-spacing-xs);
    }
  
    a[data-variant='fill']:has(wiu-text:first-child),
    a[data-variant='shade']:has(wiu-text:first-child) {
      padding: 9px var(--wiu-spacing-m) 9px var(--wiu-spacing-m);
    }
  
    a[data-variant='fill'] > wiu-image,
    a[data-variant='shade'] > wiu-image {
      width: 24px;
      height: 24px;
    }
  
    a[data-variant='fill'] > wiu-image {
      box-shadow: inset 0 0 0 1px var(--wiu-color-accent-090);
    }
  
    a[data-variant='shade'] > wiu-image,
    a[data-variant='shadeSmall'] > wiu-image {
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-010);
    }
  
    a[data-variant='fill'] > wiu-icon:not(.image-icon),
    a[data-variant='shade'] > wiu-icon:not(.image-icon) {
      width: 14px;
      height: 14px;
    }
  
    a[data-variant='transparent'] > wiu-image,
    a[data-variant='success'] > wiu-image,
    a[data-variant='shadeSmall'] > wiu-image,
    a[data-variant='error'] > wiu-image {
      width: 14px;
      height: 14px;
    }
  
    a[data-variant='transparent'] > wiu-icon:not(.image-icon),
    a[data-variant='success'] > wiu-icon:not(.image-icon),
    a[data-variant='shadeSmall'] > wiu-icon:not(.image-icon),
    a[data-variant='error'] > wiu-icon:not(.image-icon) {
      width: 12px;
      height: 12px;
    }
  
    a[data-variant='fill']:focus-visible {
      background-color: var(--wiu-color-accent-090);
    }
  
    a[data-variant='shade']:focus-visible,
    a[data-variant='shadeSmall']:focus-visible {
      background-color: var(--wiu-color-gray-glass-015);
    }
  
    a[data-variant='transparent']:focus-visible {
      background-color: var(--wiu-color-gray-glass-005);
    }
  
    a[data-variant='success']:focus-visible {
      background-color: var(--wiu-color-success-glass-015);
    }
  
    a[data-variant='error']:focus-visible {
      background-color: var(--wiu-color-error-glass-015);
    }
  
    a.disabled {
      color: var(--wiu-color-gray-glass-015);
      background-color: var(--wiu-color-gray-glass-015);
      pointer-events: none;
    }
  
    @media (hover: hover) and (pointer: fine) {
      a[data-variant='fill']:hover {
        background-color: var(--wiu-color-accent-090);
      }
  
      a[data-variant='shade']:hover,
      a[data-variant='shadeSmall']:hover {
        background-color: var(--wiu-color-gray-glass-015);
      }
  
      a[data-variant='transparent']:hover {
        background-color: var(--wiu-color-gray-glass-005);
      }
  
      a[data-variant='success']:hover {
        background-color: var(--wiu-color-success-glass-015);
      }
  
      a[data-variant='error']:hover {
        background-color: var(--wiu-color-error-glass-015);
      }
    }
  
    a[data-variant='fill']:active {
      background-color: var(--wiu-color-accent-080);
    }
  
    a[data-variant='shade']:active,
    a[data-variant='shadeSmall']:active {
      background-color: var(--wiu-color-gray-glass-020);
    }
  
    a[data-variant='transparent']:active {
      background-color: var(--wiu-color-gray-glass-010);
    }
  
    a[data-variant='success']:active {
      background-color: var(--wiu-color-success-glass-020);
    }
  
    a[data-variant='error']:active {
      background-color: var(--wiu-color-error-glass-020);
    }
  `;
  var Ou = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let pa = class extends _e {
    constructor() {
      super(...arguments), this.variant = "fill", this.imageSrc = void 0, this.imageIcon = void 0, this.imageIconSize = "md", this.disabled = !1, this.icon = "externalLink", this.href = "", this.text = void 0
    }
    render() {
      const r = this.variant === "success" || this.variant === "transparent" || this.variant === "shadeSmall" ? "small-600" : "paragraph-600";
      return K`
        <a
          rel="noreferrer"
          target="_blank"
          href=${this.href}
          class=${this.disabled?"disabled":""}
          data-variant=${this.variant}
        >
          ${this.imageTemplate()}
          <wiu-text variant=${r} color="inherit">
            ${this.title?this.title:Vt.getHostName(this.href)}
          </wiu-text>
          <wiu-icon name=${this.icon} color="inherit" size="inherit"></wiu-icon>
        </a>
      `
    }
    imageTemplate() {
      return this.imageSrc ? K`<wiu-image src=${this.imageSrc}></wiu-image>` : this.imageIcon ? K`<wiu-icon
          name=${this.imageIcon}
          color="inherit"
          size=${this.imageIconSize}
          class="image-icon"
        ></wiu-icon>` : null
    }
  };
  pa.styles = [ft, ir, qce], Ou([re()], pa.prototype, "variant", void 0), Ou([re()], pa.prototype, "imageSrc", void 0), Ou([re()], pa.prototype, "imageIcon", void 0), Ou([re()], pa.prototype, "imageIconSize", void 0), Ou([re({
    type: Boolean
  })], pa.prototype, "disabled", void 0), Ou([re()], pa.prototype, "icon", void 0), Ou([re()], pa.prototype, "href", void 0), Ou([re()], pa.prototype, "text", void 0), pa = Ou([ye("wiu-chip")], pa);
  const Vce = Re`
    :host {
      position: relative;
      display: block;
    }
  
    button {
      background: var(--wiu-color-accent-100);
      border: 1px solid var(--wiu-color-gray-glass-010);
      border-radius: var(--wiu-border-radius-m);
      gap: var(--wiu-spacing-xs);
    }
  
    button.loading {
      background: var(--wiu-color-gray-glass-010);
      border: 1px solid var(--wiu-color-gray-glass-010);
      pointer-events: none;
    }
  
    button:disabled {
      background-color: var(--wiu-color-gray-glass-015);
      border: 1px solid var(--wiu-color-gray-glass-010);
    }
  
    button:disabled > wiu-text {
      color: var(--wiu-color-gray-glass-015);
    }
  
    @media (hover: hover) and (pointer: fine) {
      button:hover:enabled {
        background-color: var(--wiu-color-accent-090);
      }
  
      button:active:enabled {
        background-color: var(--wiu-color-accent-080);
      }
    }
  
    button:focus-visible {
      border: 1px solid var(--wiu-color-gray-glass-010);
      background-color: var(--wiu-color-accent-090);
      -webkit-box-shadow: 0px 0px 0px 4px var(--wiu-box-shadow-blue);
      -moz-box-shadow: 0px 0px 0px 4px var(--wiu-box-shadow-blue);
      box-shadow: 0px 0px 0px 4px var(--wiu-box-shadow-blue);
    }
  
    button[data-size='sm'] {
      padding: 6.75px 10px 7.25px;
    }
  
    ::slotted(*) {
      transition: opacity var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: opacity;
      opacity: var(--local-opacity-100);
    }
  
    button > wiu-text {
      transition: opacity var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: opacity;
      opacity: var(--local-opacity-100);
      color: var(--wiu-color-inverse-100);
    }
  
    button[data-size='md'] {
      padding: 9px var(--wiu-spacing-l) 9px var(--wiu-spacing-l);
    }
  
    button[data-size='md'] + wiu-text {
      padding-left: var(--wiu-spacing-3xs);
    }
  
    @media (max-width: 500px) {
      button[data-size='md'] {
        height: 32px;
        padding: 5px 12px;
      }
  
      button[data-size='md'] > wiu-text > slot {
        font-size: 14px !important;
      }
    }
  
    wiu-loading-spinner {
      width: 14px;
      height: 14px;
    }
  
    wiu-loading-spinner::slotted(svg) {
      width: 10px !important;
      height: 10px !important;
    }
  
    button[data-size='sm'] > wiu-loading-spinner {
      width: 12px;
      height: 12px;
    }
  `;
  var px = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let N1 = class extends _e {
    constructor() {
      super(...arguments), this.size = "md", this.loading = !1
    }
    render() {
      const e = this.size === "md" ? "paragraph-600" : "small-600";
      return K`
        <button data-size=${this.size} ?disabled=${this.loading} ontouchstart>
          ${this.loadingTemplate()}
          <wiu-text variant=${e} color=${this.loading?"accent-100":"inherit"}>
            <slot></slot>
          </wiu-text>
        </button>
      `
    }
    loadingTemplate() {
      return this.loading ? K`<wiu-loading-spinner size=${this.size} color="accent-100"></wiu-loading-spinner>` : null
    }
  };
  N1.styles = [ft, ir, Vce], px([re()], N1.prototype, "size", void 0), px([re({
    type: Boolean
  })], N1.prototype, "loading", void 0), N1 = px([ye("wiu-connect-button")], N1);
  const Kce = Re`
    wiu-flex {
      width: 100%;
      background-color: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-xs);
    }
  `;
  var Gy = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let qf = class extends _e {
    constructor() {
      super(...arguments), this.disabled = !1, this.label = "", this.buttonLabel = ""
    }
    render() {
      return K`
        <wiu-flex
          justifyContent="space-between"
          alignItems="center"
          .padding=${["1xs","2l","1xs","2l"]}
        >
          <wiu-text variant="paragraph-500" color="fg-200">${this.label}</wiu-text>
          <wiu-chip-button size="sm" variant="shade" text=${this.buttonLabel} icon="chevronRight">
          </wiu-chip-button>
        </wiu-flex>
      `
    }
  };
  qf.styles = [ft, ir, Kce], Gy([re({
    type: Boolean
  })], qf.prototype, "disabled", void 0), Gy([re()], qf.prototype, "label", void 0), Gy([re()], qf.prototype, "buttonLabel", void 0), qf = Gy([ye("wiu-cta-button")], qf);
  const Gce = Re`
    :host {
      display: block;
      padding: var(--wiu-spacing-l) var(--wiu-spacing-m);
      background-color: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-xs);
      width: 100%;
    }
  `;
  var Zce = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Zy = class extends _e {
    render() {
      return K`
        <wiu-flex gap="xl" flexDirection="column" justifyContent="space-between" alignItems="center">
          <slot></slot>
        </wiu-flex>
      `
    }
  };
  Zy.styles = [ft, ir, Gce], Zy = Zce([ye("wiu-details-group")], Zy);
  const Yce = Re`
    :host {
      display: flex;
      flex-direction: row;
      gap: var(--wiu-spacing-l);
      width: 100%;
      border-radius: var(--wiu-border-radius-xs);
    }
  `;
  var OP = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let b2 = class extends _e {
    constructor() {
      super(...arguments), this.name = ""
    }
    render() {
      return K`
        <wiu-flex justifyContent="space-between" alignItems="center">
          <wiu-text variant="paragraph-500" color="fg-200">${this.name}</wiu-text>
          <wiu-flex gap="xs" alignItems="center">
            <slot></slot>
          </wiu-flex>
        </wiu-flex>
      `
    }
  };
  b2.styles = [ft, ir, Yce], OP([re()], b2.prototype, "name", void 0), b2 = OP([ye("wiu-details-group-item")], b2);
  const Qce = Re`
    :host {
      z-index: calc(var(--w4m-z-index) + 1);
      width: 200px;
      padding: var(--wiu-spacing-3xs);
      align-items: center;
      display: inherit;
      border-radius: var(--wiu-border-radius-xs);
      border: 1px solid var(--wiu-color-gray-glass-002);
      background: var(--wiu-color-fg-base-125);
      /* Dark/Elevation/L */
      box-shadow:
        0px 8px 22px -6px rgba(0, 0, 0, 0.12),
        0px 14px 64px -4px rgba(0, 0, 0, 0.12);
    }
  `;
  var gx = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let M1 = class extends _e {
    constructor() {
      super(...arguments), this.actions = [], this.isOpen = !1
    }
    render() {
      return this.isOpen ? K`
        <wiu-flex flexDirection="column" gap="4xs">
          ${this.actions.map(e=>K`
              <wiu-list-item
                icon=${e.icon}
                iconSize="sm"
                variant="icon"
                @click=${e.onClick}
              >
                <wiu-text variant="small-400" color="fg-100">${e.label}</wiu-text>
              </wiu-list-item>
            `)}
        </wiu-flex>
      ` : null
    }
  };
  M1.styles = [ft, ir, Qce], gx([re({
    type: Array
  })], M1.prototype, "actions", void 0), gx([re({
    type: Boolean
  })], M1.prototype, "isOpen", void 0), M1 = gx([ye("wiu-dropdown-menu")], M1);
  /**
   * @license
   * Copyright 2020 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  const Jce = t => t.strings === void 0;
  /**
   * @license
   * Copyright 2017 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  const y2 = (t, e) => {
      const r = t._$AN;
      if (r === void 0) return !1;
      for (const n of r) n._$AO?.(e, !1), y2(n, e);
      return !0
    },
    Yy = t => {
      let e, r;
      do {
        if ((e = t._$AM) === void 0) break;
        r = e._$AN, r.delete(t), t = e
      } while (r?.size === 0)
    },
    DP = t => {
      for (let e; e = t._$AM; t = e) {
        let r = e._$AN;
        if (r === void 0) e._$AN = r = new Set;
        else if (r.has(t)) break;
        r.add(t), tle(e)
      }
    };

  function Xce(t) {
    this._$AN !== void 0 ? (Yy(this), this._$AM = t, DP(this)) : this._$AM = t
  }

  function ele(t, e = !1, r = 0) {
    const n = this._$AH,
      i = this._$AN;
    if (i !== void 0 && i.size !== 0)
      if (e)
        if (Array.isArray(n))
          for (let s = r; s < n.length; s++) y2(n[s], !1), Yy(n[s]);
        else n != null && (y2(n, !1), Yy(n));
    else y2(this, t)
  }
  const tle = t => {
    t.type == TP.CHILD && (t._$AP ?? (t._$AP = ele), t._$AQ ?? (t._$AQ = Xce))
  };
  let rle = class extends RP {
    constructor() {
      super(...arguments), this._$AN = void 0
    }
    _$AT(e, r, n) {
      super._$AT(e, r, n), DP(this), this.isConnected = e._$AU
    }
    _$AO(e, r = !0) {
      e !== this.isConnected && (this.isConnected = e, e ? this.reconnected?.() : this.disconnected?.()), r && (y2(this, e), Yy(this))
    }
    setValue(e) {
      if (Jce(this._$Ct)) this._$Ct._$AI(e, this);
      else {
        const r = [...this._$Ct._$AH];
        r[this._$Ci] = e, this._$Ct._$AI(r, this, 0)
      }
    }
    disconnected() {}
    reconnected() {}
  };
  /**
   * @license
   * Copyright 2020 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  const cl = () => new nle;
  let nle = class {};
  const mx = new WeakMap,
    ll = kP(class extends rle {
      render(t) {
        return ni
      }
      update(t, [e]) {
        const r = e !== this.Y;
        return r && this.Y !== void 0 && this.rt(void 0), (r || this.lt !== this.ct) && (this.Y = e, this.ht = t.options?.host, this.rt(this.ct = t.element)), ni
      }
      rt(t) {
        if (this.isConnected || (t = void 0), typeof this.Y == "function") {
          const e = this.ht ?? globalThis;
          let r = mx.get(e);
          r === void 0 && (r = new WeakMap, mx.set(e, r)), r.get(this.Y) !== void 0 && this.Y.call(this.ht, void 0), r.set(this.Y, t), t !== void 0 && this.Y.call(this.ht, t)
        } else this.Y.value = t
      }
      get lt() {
        return typeof this.Y == "function" ? mx.get(this.ht ?? globalThis)?.get(this.Y) : this.Y?.value
      }
      disconnected() {
        this.lt === this.ct && this.rt(void 0)
      }
      reconnected() {
        this.rt(this.ct)
      }
    }),
    ile = Re`
    :host {
      position: relative;
      width: 100%;
      display: inline-block;
      color: var(--wiu-color-fg-275);
    }
  
    input {
      width: 100%;
      border-radius: var(--wiu-border-radius-xs);
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-002);
      background: var(--wiu-color-gray-glass-002);
      font-size: var(--wiu-font-size-paragraph);
      letter-spacing: var(--wiu-letter-spacing-paragraph);
      color: var(--wiu-color-fg-100);
      transition:
        background-color var(--wiu-ease-inout-power-1) var(--wiu-duration-md),
        border-color var(--wiu-ease-inout-power-1) var(--wiu-duration-md),
        box-shadow var(--wiu-ease-inout-power-1) var(--wiu-duration-md);
      will-change: background-color, border-color, box-shadow;
      caret-color: var(--wiu-color-accent-100);
    }
  
    input:disabled {
      cursor: not-allowed;
      border: 1px solid var(--wiu-color-gray-glass-010);
    }
  
    input:disabled::placeholder,
    input:disabled + wiu-icon {
      color: var(--wiu-color-fg-300);
    }
  
    input::placeholder {
      color: var(--wiu-color-fg-275);
    }
  
    input:focus:enabled {
      background-color: var(--wiu-color-gray-glass-005);
      -webkit-box-shadow:
        inset 0 0 0 1px var(--wiu-color-accent-100),
        0px 0px 0px 4px var(--wiu-box-shadow-blue);
      -moz-box-shadow:
        inset 0 0 0 1px var(--wiu-color-accent-100),
        0px 0px 0px 4px var(--wiu-box-shadow-blue);
      box-shadow:
        inset 0 0 0 1px var(--wiu-color-accent-100),
        0px 0px 0px 4px var(--wiu-box-shadow-blue);
    }
  
    input:hover:enabled {
      background-color: var(--wiu-color-gray-glass-005);
    }
  
    wiu-icon {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      pointer-events: none;
    }
  
    .wiu-size-sm {
      padding: 9px var(--wiu-spacing-m) 10px var(--wiu-spacing-s);
    }
  
    wiu-icon + .wiu-size-sm {
      padding: 9px var(--wiu-spacing-m) 10px 36px;
    }
  
    wiu-icon[data-input='sm'] {
      left: var(--wiu-spacing-s);
    }
  
    .wiu-size-md {
      padding: 15px var(--wiu-spacing-m) var(--wiu-spacing-l) var(--wiu-spacing-m);
    }
  
    wiu-icon + .wiu-size-md,
    wiu-loading-spinner + .wiu-size-md {
      padding: 10.5px var(--wiu-spacing-3xl) 10.5px var(--wiu-spacing-3xl);
    }
  
    wiu-icon[data-input='md'] {
      left: var(--wiu-spacing-l);
    }
  
    .wiu-size-lg {
      padding: var(--wiu-spacing-s) var(--wiu-spacing-s) var(--wiu-spacing-s) var(--wiu-spacing-l);
      letter-spacing: var(--wiu-letter-spacing-medium-title);
      font-size: var(--wiu-font-size-medium-title);
      font-weight: var(--wiu-font-weight-light);
      line-height: 130%;
      color: var(--wiu-color-fg-100);
      height: 64px;
    }
  
    .wiu-padding-right-xs {
      padding-right: var(--wiu-spacing-xs);
    }
  
    .wiu-padding-right-s {
      padding-right: var(--wiu-spacing-s);
    }
  
    .wiu-padding-right-m {
      padding-right: var(--wiu-spacing-m);
    }
  
    .wiu-padding-right-l {
      padding-right: var(--wiu-spacing-l);
    }
  
    .wiu-padding-right-xl {
      padding-right: var(--wiu-spacing-xl);
    }
  
    .wiu-padding-right-2xl {
      padding-right: var(--wiu-spacing-2xl);
    }
  
    .wiu-padding-right-3xl {
      padding-right: var(--wiu-spacing-3xl);
    }
  
    .wiu-padding-right-4xl {
      padding-right: var(--wiu-spacing-4xl);
    }
  
    .wiu-padding-right-5xl {
      padding-right: var(--wiu-spacing-5xl);
    }
  
    wiu-icon + .wiu-size-lg,
    wiu-loading-spinner + .wiu-size-lg {
      padding-left: 50px;
    }
  
    wiu-icon[data-input='lg'] {
      left: var(--wiu-spacing-l);
    }
  
    .wiu-size-mdl {
      padding: 17.25px var(--wiu-spacing-m) 17.25px var(--wiu-spacing-m);
    }
    wiu-icon + .wiu-size-mdl,
    wiu-loading-spinner + .wiu-size-mdl {
      padding: 17.25px var(--wiu-spacing-3xl) 17.25px 40px;
    }
    wiu-icon[data-input='mdl'] {
      left: var(--wiu-spacing-m);
    }
  
    input:placeholder-shown ~ ::slotted(wiu-input-element),
    input:placeholder-shown ~ ::slotted(wiu-icon) {
      opacity: 0;
      pointer-events: none;
    }
  
    input::-webkit-outer-spin-button,
    input::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }
  
    input[type='number'] {
      -moz-appearance: textfield;
    }
  
    ::slotted(wiu-input-element),
    ::slotted(wiu-icon) {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
    }
  
    ::slotted(wiu-input-element) {
      right: var(--wiu-spacing-m);
    }
  
    ::slotted(wiu-icon) {
      right: 0px;
    }
  `;
  var ul = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Do = class extends _e {
    constructor() {
      super(...arguments), this.inputElementRef = cl(), this.size = "md", this.disabled = !1, this.placeholder = "", this.type = "text", this.value = ""
    }
    render() {
      const e = `wiu-padding-right-${this.inputRightPadding}`,
        n = {
          [`wiu-size-${this.size}`]: !0,
          [e]: !!this.inputRightPadding
        };
      return K`${this.templateIcon()}
        <input
          data-testid="wiu-input-text"
          ${ll(this.inputElementRef)}
          class=${p2(n)}
          type=${this.type}
          enterkeyhint=${$e(this.enterKeyHint)}
          ?disabled=${this.disabled}
          placeholder=${this.placeholder}
          @input=${this.dispatchInputChangeEvent.bind(this)}
          .value=${this.value||""}
          tabindex=${$e(this.tabIdx)}
        />
        <slot></slot>`
    }
    templateIcon() {
      return this.icon ? K`<wiu-icon
          data-input=${this.size}
          size=${this.size}
          color="inherit"
          name=${this.icon}
        ></wiu-icon>` : null
    }
    dispatchInputChangeEvent() {
      this.dispatchEvent(new CustomEvent("inputChange", {
        detail: this.inputElementRef.value?.value,
        bubbles: !0,
        composed: !0
      }))
    }
  };
  Do.styles = [ft, ir, ile], ul([re()], Do.prototype, "size", void 0), ul([re()], Do.prototype, "icon", void 0), ul([re({
    type: Boolean
  })], Do.prototype, "disabled", void 0), ul([re()], Do.prototype, "placeholder", void 0), ul([re()], Do.prototype, "type", void 0), ul([re()], Do.prototype, "keyHint", void 0), ul([re()], Do.prototype, "value", void 0), ul([re()], Do.prototype, "inputRightPadding", void 0), ul([re()], Do.prototype, "tabIdx", void 0), Do = ul([ye("wiu-input-text")], Do);
  const sle = Re`
    :host {
      position: relative;
      display: inline-block;
    }
  
    wiu-text {
      margin: var(--wiu-spacing-xxs) var(--wiu-spacing-m) var(--wiu-spacing-0) var(--wiu-spacing-m);
    }
  `;
  var _2 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let sh = class extends _e {
    constructor() {
      super(...arguments), this.disabled = !1
    }
    render() {
      return K`
        <wiu-input-text
          type="email"
          placeholder="Email"
          icon="mail"
          size="mdl"
          .disabled=${this.disabled}
          .value=${this.value}
          data-testid="wiu-email-input"
          tabIdx=${$e(this.tabIdx)}
        ></wiu-input-text>
        ${this.templateError()}
      `
    }
    templateError() {
      return this.errorMessage ? K`<wiu-text variant="tiny-500" color="error-100">${this.errorMessage}</wiu-text>` : null
    }
  };
  sh.styles = [ft, sle], _2([re()], sh.prototype, "errorMessage", void 0), _2([re({
    type: Boolean
  })], sh.prototype, "disabled", void 0), _2([re()], sh.prototype, "value", void 0), _2([re()], sh.prototype, "tabIdx", void 0), sh = _2([ye("wiu-email-input")], sh);
  const ole = Re`
    :host {
      position: relative;
      width: 100%;
      display: inline-block;
      color: var(--wiu-color-fg-275);
    }
  
    .error {
      margin: var(--wiu-spacing-xxs) var(--wiu-spacing-m) var(--wiu-spacing-0) var(--wiu-spacing-m);
    }
  
    .base-name {
      position: absolute;
      right: 45px;
      top: 15px;
      text-align: right;
    }
  `;
  var x2 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let oh = class extends _e {
    constructor() {
      super(...arguments), this.disabled = !1, this.loading = !1
    }
    render() {
      return K`
        <wiu-input-text
          value=${$e(this.value)}
          ?disabled=${this.disabled}
          .value=${this.value||""}
          data-testid="wiu-ens-input"
          inputRightPadding="5xl"
        >
          ${this.baseNameTemplate()} ${this.errorTemplate()}${this.loadingTemplate()}
        </wiu-input-text>
      `
    }
    baseNameTemplate() {
      return K`<wiu-text variant="paragraph-400" color="fg-200" class="base-name">
        ${pr.WC_NAME_SUFFIX}
      </wiu-text>`
    }
    loadingTemplate() {
      return this.loading ? K`<wiu-loading-spinner size="md" color="accent-100"></wiu-loading-spinner>` : null
    }
    errorTemplate() {
      return this.errorMessage ? K`<wiu-text variant="tiny-500" color="error-100" class="error"
          >${this.errorMessage}</wiu-text
        >` : null
    }
  };
  oh.styles = [ft, ole], x2([re()], oh.prototype, "errorMessage", void 0), x2([re({
    type: Boolean
  })], oh.prototype, "disabled", void 0), x2([re()], oh.prototype, "value", void 0), x2([re({
    type: Boolean
  })], oh.prototype, "loading", void 0), oh = x2([ye("wiu-ens-input")], oh);
  const ale = Re`
    button {
      border-radius: var(--local-border-radius);
      color: var(--wiu-color-fg-100);
      padding: var(--local-padding);
    }
  
    @media (max-width: 700px) {
      button {
        padding: var(--wiu-spacing-s);
      }
    }
  
    button > wiu-icon {
      pointer-events: none;
    }
  
    button:disabled > wiu-icon {
      color: var(--wiu-color-bg-300) !important;
    }
  
    button:disabled {
      background-color: transparent;
    }
  `;
  var C2 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let ah = class extends _e {
    constructor() {
      super(...arguments), this.size = "md", this.disabled = !1, this.icon = "copy", this.iconColor = "inherit"
    }
    render() {
      const e = this.size === "lg" ? "--wiu-border-radius-xs" : "--wiu-border-radius-xxs",
        r = this.size === "lg" ? "--wiu-spacing-1xs" : "--wiu-spacing-2xs";
      return this.style.cssText = `
      --local-border-radius: var(${e});
      --local-padding: var(${r});
  `, K`
        <button ?disabled=${this.disabled} ontouchstart>
          <wiu-icon color=${this.iconColor} size=${this.size} name=${this.icon}></wiu-icon>
        </button>
      `
    }
  };
  ah.styles = [ft, ir, d2, ale], C2([re()], ah.prototype, "size", void 0), C2([re({
    type: Boolean
  })], ah.prototype, "disabled", void 0), C2([re()], ah.prototype, "icon", void 0), C2([re()], ah.prototype, "iconColor", void 0), ah = C2([ye("wiu-icon-link")], ah);
  const cle = Re`
    button {
      background-color: var(--wiu-color-fg-300);
      border-radius: var(--wiu-border-radius-4xs);
      width: 16px;
      height: 16px;
    }
  
    button:disabled {
      background-color: var(--wiu-color-bg-300);
    }
  
    wiu-icon {
      color: var(--wiu-color-bg-200) !important;
    }
  
    button:focus-visible {
      background-color: var(--wiu-color-fg-250);
      border: 1px solid var(--wiu-color-accent-100);
    }
  
    @media (hover: hover) and (pointer: fine) {
      button:hover:enabled {
        background-color: var(--wiu-color-fg-250);
      }
  
      button:active:enabled {
        background-color: var(--wiu-color-fg-225);
      }
    }
  `;
  var LP = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let E2 = class extends _e {
    constructor() {
      super(...arguments), this.icon = "copy"
    }
    render() {
      return K`
        <button>
          <wiu-icon color="inherit" size="xxs" name=${this.icon}></wiu-icon>
        </button>
      `
    }
  };
  E2.styles = [ft, ir, cle], LP([re()], E2.prototype, "icon", void 0), E2 = LP([ye("wiu-input-element")], E2);
  const lle = Re`
    :host {
      position: relative;
      display: inline-block;
    }
  
    input {
      width: 50px;
      height: 50px;
      background: var(--wiu-color-gray-glass-010);
      border-radius: var(--wiu-border-radius-xs);
      border: 1px solid var(--wiu-color-gray-glass-005);
      font-family: var(--wiu-font-family);
      font-size: var(--wiu-font-size-large);
      font-weight: var(--wiu-font-weight-regular);
      letter-spacing: var(--wiu-letter-spacing-large);
      text-align: center;
      color: var(--wiu-color-fg-100);
      caret-color: var(--wiu-color-accent-100);
      transition:
        background-color var(--wiu-ease-inout-power-1) var(--wiu-duration-md),
        border-color var(--wiu-ease-inout-power-1) var(--wiu-duration-md),
        box-shadow var(--wiu-ease-inout-power-1) var(--wiu-duration-md);
      will-change: background-color, border-color, box-shadow;
      box-sizing: border-box;
      -webkit-appearance: none;
      -moz-appearance: textfield;
      padding: 0px;
    }
  
    input::-webkit-outer-spin-button,
    input::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }
  
    input[type='number'] {
      -moz-appearance: textfield;
    }
  
    input:disabled {
      cursor: not-allowed;
      border: 1px solid var(--wiu-color-gray-glass-010);
      background: var(--wiu-color-gray-glass-005);
    }
  
    input:focus:enabled {
      background-color: var(--wiu-color-gray-glass-015);
      border: 1px solid var(--wiu-color-accent-100);
      -webkit-box-shadow: 0px 0px 0px 4px var(--wiu-box-shadow-blue);
      -moz-box-shadow: 0px 0px 0px 4px var(--wiu-box-shadow-blue);
      box-shadow: 0px 0px 0px 4px var(--wiu-box-shadow-blue);
    }
  
    @media (hover: hover) and (pointer: fine) {
      input:hover:enabled {
        background-color: var(--wiu-color-gray-glass-015);
      }
    }
  `;
  var wx = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let P1 = class extends _e {
    constructor() {
      super(...arguments), this.disabled = !1, this.value = ""
    }
    render() {
      return K`<input
        type="number"
        maxlength="1"
        inputmode="numeric"
        autofocus
        ?disabled=${this.disabled}
        value=${this.value}
      /> `
    }
  };
  P1.styles = [ft, ir, lle], wx([re({
    type: Boolean
  })], P1.prototype, "disabled", void 0), wx([re({
    type: String
  })], P1.prototype, "value", void 0), P1 = wx([ye("wiu-input-numeric")], P1);
  const ule = Re`
    button {
      padding: var(--wiu-spacing-4xs) var(--wiu-spacing-xxs);
      border-radius: var(--wiu-border-radius-3xs);
      background-color: transparent;
      color: var(--wiu-color-accent-100);
    }
  
    button:disabled {
      background-color: transparent;
      color: var(--wiu-color-gray-glass-015);
    }
  
    button:hover {
      background-color: var(--wiu-color-gray-glass-005);
    }
  `;
  var Qy = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Vf = class extends _e {
    constructor() {
      super(...arguments), this.tabIdx = void 0, this.disabled = !1, this.color = "inherit"
    }
    render() {
      return K`
        <button ?disabled=${this.disabled} tabindex=${$e(this.tabIdx)} ontouchstart>
          <slot name="iconLeft"></slot>
          <wiu-text variant="small-600" color=${this.color}>
            <slot></slot>
          </wiu-text>
          <slot name="iconRight"></slot>
        </button>
      `
    }
  };
  Vf.styles = [ft, ir, ule], Qy([re()], Vf.prototype, "tabIdx", void 0), Qy([re({
    type: Boolean
  })], Vf.prototype, "disabled", void 0), Qy([re()], Vf.prototype, "color", void 0), Vf = Qy([ye("wiu-link")], Vf);
  const dle = Re`
    button {
      column-gap: var(--wiu-spacing-s);
      padding: 11px 18px 11px var(--wiu-spacing-s);
      width: 100%;
      background-color: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-xs);
      color: var(--wiu-color-fg-250);
      transition:
        color var(--wiu-ease-out-power-1) var(--wiu-duration-md),
        background-color var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: color, background-color;
    }
  
    button[data-iconvariant='square'],
    button[data-iconvariant='square-blue'] {
      padding: 6px 18px 6px 9px;
    }
  
    button > wiu-flex {
      flex: 1;
    }
  
    button > wiu-image {
      width: 32px;
      height: 32px;
      box-shadow: 0 0 0 2px var(--wiu-color-gray-glass-005);
      border-radius: var(--wiu-border-radius-3xl);
    }
  
    button > wiu-icon {
      width: 36px;
      height: 36px;
      transition: opacity var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: opacity;
    }
  
    button > wiu-icon-box[data-variant='blue'] {
      box-shadow: 0 0 0 2px var(--wiu-color-accent-glass-005);
    }
  
    button > wiu-icon-box[data-variant='overlay'] {
      box-shadow: 0 0 0 2px var(--wiu-color-gray-glass-005);
    }
  
    button > wiu-icon-box[data-variant='square-blue'] {
      border-radius: var(--wiu-border-radius-3xs);
      position: relative;
      border: none;
      width: 36px;
      height: 36px;
    }
  
    button > wiu-icon-box[data-variant='square-blue']::after {
      content: '';
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      border-radius: inherit;
      border: 1px solid var(--wiu-color-accent-glass-010);
      pointer-events: none;
    }
  
    button > wiu-icon:last-child {
      width: 14px;
      height: 14px;
    }
  
    button:disabled {
      color: var(--wiu-color-gray-glass-020);
    }
  
    button[data-loading='true'] > wiu-icon {
      opacity: 0;
    }
  
    wiu-loading-spinner {
      position: absolute;
      right: 18px;
      top: 50%;
      transform: translateY(-50%);
    }
  `;
  var uc = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let ao = class extends _e {
    constructor() {
      super(...arguments), this.tabIdx = void 0, this.variant = "icon", this.disabled = !1, this.imageSrc = void 0, this.alt = void 0, this.chevron = !1, this.loading = !1
    }
    render() {
      return K`
        <button
          ?disabled=${this.loading?!0:!!this.disabled}
          data-loading=${this.loading}
          data-iconvariant=${$e(this.iconVariant)}
          tabindex=${$e(this.tabIdx)}
          ontouchstart
        >
          ${this.loadingTemplate()} ${this.visualTemplate()}
          <wiu-flex gap="3xs">
            <slot></slot>
          </wiu-flex>
          ${this.chevronTemplate()}
        </button>
      `
    }
    visualTemplate() {
      if (this.variant === "image" && this.imageSrc) return K`<wiu-image src=${this.imageSrc} alt=${this.alt??"list item"}></wiu-image>`;
      if (this.iconVariant === "square" && this.icon && this.variant === "icon") return K`<wiu-icon name=${this.icon}></wiu-icon>`;
      if (this.variant === "icon" && this.icon && this.iconVariant) {
        const e = ["blue", "square-blue"].includes(this.iconVariant) ? "accent-100" : "fg-200",
          r = this.iconVariant === "square-blue" ? "mdl" : "md",
          n = this.iconSize ? this.iconSize : r;
        return K`
          <wiu-icon-box
            data-variant=${this.iconVariant}
            icon=${this.icon}
            iconSize=${n}
            background="transparent"
            iconColor=${e}
            backgroundColor=${e}
            size=${r}
          ></wiu-icon-box>
        `
      }
      return null
    }
    loadingTemplate() {
      return this.loading ? K`<wiu-loading-spinner color="fg-300"></wiu-loading-spinner>` : K``
    }
    chevronTemplate() {
      return this.chevron ? K`<wiu-icon size="inherit" color="fg-200" name="chevronRight"></wiu-icon>` : null
    }
  };
  ao.styles = [ft, ir, dle], uc([re()], ao.prototype, "icon", void 0), uc([re()], ao.prototype, "iconSize", void 0), uc([re()], ao.prototype, "tabIdx", void 0), uc([re()], ao.prototype, "variant", void 0), uc([re()], ao.prototype, "iconVariant", void 0), uc([re({
    type: Boolean
  })], ao.prototype, "disabled", void 0), uc([re()], ao.prototype, "imageSrc", void 0), uc([re()], ao.prototype, "alt", void 0), uc([re({
    type: Boolean
  })], ao.prototype, "chevron", void 0), uc([re({
    type: Boolean
  })], ao.prototype, "loading", void 0), ao = uc([ye("wiu-list-item")], ao);
  var vx;
  (function (t) {
    t.approve = "approved", t.bought = "bought", t.borrow = "borrowed", t.burn = "burnt", t.cancel = "canceled", t.claim = "claimed", t.deploy = "deployed", t.deposit = "deposited", t.execute = "executed", t.mint = "minted", t.receive = "received", t.repay = "repaid", t.send = "sent", t.sell = "sold", t.stake = "staked", t.trade = "swapped", t.unstake = "unstaked", t.withdraw = "withdrawn"
  })(vx || (vx = {}));
  const hle = Re`
    :host > wiu-flex {
      display: flex;
      justify-content: center;
      align-items: center;
      position: relative;
      width: 40px;
      height: 40px;
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-005);
      background-color: var(--wiu-color-gray-glass-005);
    }
  
    :host > wiu-flex wiu-image {
      display: block;
    }
  
    :host > wiu-flex,
    :host > wiu-flex wiu-image,
    .swap-images-container,
    .swap-images-container.nft,
    wiu-image.nft {
      border-top-left-radius: var(--local-left-border-radius);
      border-top-right-radius: var(--local-right-border-radius);
      border-bottom-left-radius: var(--local-left-border-radius);
      border-bottom-right-radius: var(--local-right-border-radius);
    }
  
    wiu-icon {
      width: 20px;
      height: 20px;
    }
  
    wiu-icon-box {
      position: absolute;
      right: 0;
      bottom: 0;
      transform: translate(20%, 20%);
    }
  
    .swap-images-container {
      position: relative;
      width: 40px;
      height: 40px;
      overflow: hidden;
    }
  
    .swap-images-container wiu-image:first-child {
      position: absolute;
      width: 40px;
      height: 40px;
      top: 0;
      left: 0%;
      clip-path: inset(0px calc(50% + 2px) 0px 0%);
    }
  
    .swap-images-container wiu-image:last-child {
      clip-path: inset(0px 0px 0px calc(50% + 2px));
    }
  `;
  var Kf = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let dl = class extends _e {
    constructor() {
      super(...arguments), this.images = [], this.secondImage = {
        type: void 0,
        url: ""
      }
    }
    render() {
      const [e, r] = this.images, n = e?.type === "NFT", i = r?.url ? r.type === "NFT" : n, s = n ? "var(--wiu-border-radius-xxs)" : "var(--wiu-border-radius-s)", o = i ? "var(--wiu-border-radius-xxs)" : "var(--wiu-border-radius-s)";
      return this.style.cssText = `
      --local-left-border-radius: ${s};
      --local-right-border-radius: ${o};
      `, K`<wiu-flex> ${this.templateVisual()} ${this.templateIcon()} </wiu-flex>`
    }
    templateVisual() {
      const [e, r] = this.images, n = e?.type;
      return this.images.length === 2 && (e?.url || r?.url) ? K`<div class="swap-images-container">
          ${e?.url?K`<wiu-image src=${e.url} alt="Transaction image"></wiu-image>`:null}
          ${r?.url?K`<wiu-image src=${r.url} alt="Transaction image"></wiu-image>`:null}
        </div>` : e?.url ? K`<wiu-image src=${e.url} alt="Transaction image"></wiu-image>` : n === "NFT" ? K`<wiu-icon size="inherit" color="fg-200" name="nftPlaceholder"></wiu-icon>` : K`<wiu-icon size="inherit" color="fg-200" name="coinPlaceholder"></wiu-icon>`
    }
    templateIcon() {
      let e = "accent-100",
        r;
      return r = this.getIcon(), this.status && (e = this.getStatusColor()), r ? K`
        <wiu-icon-box
          size="xxs"
          iconColor=${e}
          backgroundColor=${e}
          background="opaque"
          icon=${r}
          ?border=${!0}
          borderColor="wiu-color-bg-125"
        ></wiu-icon-box>
      ` : null
    }
    getDirectionIcon() {
      switch (this.direction) {
        case "in":
          return "arrowBottom";
        case "out":
          return "arrowTop";
        default:
          return
      }
    }
    getIcon() {
      return this.onlyDirectionIcon ? this.getDirectionIcon() : this.type === "trade" ? "swapHorizontalBold" : this.type === "approve" ? "checkmark" : this.type === "cancel" ? "close" : this.getDirectionIcon()
    }
    getStatusColor() {
      switch (this.status) {
        case "confirmed":
          return "success-100";
        case "failed":
          return "error-100";
        case "pending":
          return "inverse-100";
        default:
          return "accent-100"
      }
    }
  };
  dl.styles = [hle], Kf([re()], dl.prototype, "type", void 0), Kf([re()], dl.prototype, "status", void 0), Kf([re()], dl.prototype, "direction", void 0), Kf([re({
    type: Boolean
  })], dl.prototype, "onlyDirectionIcon", void 0), Kf([re({
    type: Array
  })], dl.prototype, "images", void 0), Kf([re({
    type: Object
  })], dl.prototype, "secondImage", void 0), dl = Kf([ye("wiu-transaction-visual")], dl);
  const fle = Re`
    :host > wiu-flex:first-child {
      align-items: center;
      column-gap: var(--wiu-spacing-s);
      padding: 6.5px var(--wiu-spacing-xs) 6.5px var(--wiu-spacing-xs);
      width: 100%;
    }
  
    :host > wiu-flex:first-child wiu-text:nth-child(1) {
      text-transform: capitalize;
    }
  
    wiu-transaction-visual {
      width: 40px;
      height: 40px;
    }
  
    wiu-flex {
      flex: 1;
    }
  
    :host wiu-flex wiu-flex {
      overflow: hidden;
    }
  
    :host .description-container wiu-text span {
      word-break: break-all;
    }
  
    :host .description-container wiu-text {
      overflow: hidden;
    }
  
    :host .description-separator-icon {
      margin: 0px 6px;
    }
  
    :host wiu-text > span {
      overflow: hidden;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 1;
    }
  `;
  var dc = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let co = class extends _e {
    constructor() {
      super(...arguments), this.type = "approve", this.onlyDirectionIcon = !1, this.images = [], this.price = [], this.amount = [], this.symbol = []
    }
    render() {
      return K`
        <wiu-flex>
          <wiu-transaction-visual
            .status=${this.status}
            direction=${$e(this.direction)}
            type=${this.type}
            onlyDirectionIcon=${$e(this.onlyDirectionIcon)}
            .images=${this.images}
          ></wiu-transaction-visual>
          <wiu-flex flexDirection="column" gap="3xs">
            <wiu-text variant="paragraph-600" color="fg-100">
              ${vx[this.type]||this.type}
            </wiu-text>
            <wiu-flex class="description-container">
              ${this.templateDescription()} ${this.templateSecondDescription()}
            </wiu-flex>
          </wiu-flex>
          <wiu-text variant="micro-700" color="fg-300"><span>${this.date}</span></wiu-text>
        </wiu-flex>
      `
    }
    templateDescription() {
      const e = this.descriptions?.[0];
      return e ? K`
            <wiu-text variant="small-500" color="fg-200">
              <span>${e}</span>
            </wiu-text>
          ` : null
    }
    templateSecondDescription() {
      const e = this.descriptions?.[1];
      return e ? K`
            <wiu-icon class="description-separator-icon" size="xxs" name="arrowRight"></wiu-icon>
            <wiu-text variant="small-400" color="fg-200">
              <span>${e}</span>
            </wiu-text>
          ` : null
    }
  };
  co.styles = [ft, fle], dc([re()], co.prototype, "type", void 0), dc([re({
    type: Array
  })], co.prototype, "descriptions", void 0), dc([re()], co.prototype, "date", void 0), dc([re({
    type: Boolean
  })], co.prototype, "onlyDirectionIcon", void 0), dc([re()], co.prototype, "status", void 0), dc([re()], co.prototype, "direction", void 0), dc([re({
    type: Array
  })], co.prototype, "images", void 0), dc([re({
    type: Array
  })], co.prototype, "price", void 0), dc([re({
    type: Array
  })], co.prototype, "amount", void 0), dc([re({
    type: Array
  })], co.prototype, "symbol", void 0), co = dc([ye("wiu-transaction-list-item")], co);
  const ple = Re`
    :host > wiu-flex:first-child {
      column-gap: var(--wiu-spacing-s);
      padding: 7px var(--wiu-spacing-l) 7px var(--wiu-spacing-xs);
      width: 100%;
    }
  
    wiu-flex {
      display: flex;
      flex: 1;
    }
  `;
  var gle = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Jy = class extends _e {
    render() {
      return K`
        <wiu-flex alignItems="center">
          <wiu-shimmer width="40px" height="40px"></wiu-shimmer>
          <wiu-flex flexDirection="column" gap="2xs">
            <wiu-shimmer width="72px" height="16px" borderRadius="4xs"></wiu-shimmer>
            <wiu-shimmer width="148px" height="14px" borderRadius="4xs"></wiu-shimmer>
          </wiu-flex>
          <wiu-shimmer width="24px" height="12px" borderRadius="5xs"></wiu-shimmer>
        </wiu-flex>
      `
    }
  };
  Jy.styles = [ft, ple], Jy = gle([ye("wiu-transaction-list-item-loader")], Jy);
  const mle = Re`
    :host {
      display: flex;
      justify-content: center;
      align-items: center;
      height: var(--wiu-spacing-m);
      padding: 0 var(--wiu-spacing-3xs) !important;
      border-radius: var(--wiu-border-radius-5xs);
    }
  
    :host > wiu-text {
      transform: translateY(5%);
    }
  
    :host([data-variant='main']) {
      background-color: var(--wiu-color-accent-glass-015);
      color: var(--wiu-color-accent-100);
    }
  
    :host([data-variant='shade']) {
      background-color: var(--wiu-color-gray-glass-010);
      color: var(--wiu-color-fg-200);
    }
  
    :host([data-variant='success']) {
      background-color: var(--wiu-icon-box-bg-success-100);
      color: var(--wiu-color-success-100);
    }
  
    :host([data-variant='error']) {
      background-color: var(--wiu-icon-box-bg-error-100);
      color: var(--wiu-color-error-100);
    }
  
    :host([data-size='lg']) {
      padding: 11px 5px !important;
    }
  
    :host([data-size='lg']) > wiu-text {
      transform: translateY(2%);
    }
  `;
  var bx = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let $1 = class extends _e {
    constructor() {
      super(...arguments), this.variant = "main", this.size = "lg"
    }
    render() {
      this.dataset.variant = this.variant, this.dataset.size = this.size;
      const e = this.size === "md" ? "mini-700" : "micro-700";
      return K`
        <wiu-text data-variant=${this.variant} variant=${e} color="inherit">
          <slot></slot>
        </wiu-text>
      `
    }
  };
  $1.styles = [ft, mle], bx([re()], $1.prototype, "variant", void 0), bx([re()], $1.prototype, "size", void 0), $1 = bx([ye("wiu-tag")], $1);
  const wle = Re`
    button {
      column-gap: var(--wiu-spacing-s);
      padding: 7px var(--wiu-spacing-l) 7px var(--wiu-spacing-xs);
      width: 100%;
      background-color: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-xs);
      color: var(--wiu-color-fg-100);
    }
  
    button > wiu-text:nth-child(2) {
      display: flex;
      flex: 1;
    }
  
    button:disabled {
      background-color: var(--wiu-color-gray-glass-015);
      color: var(--wiu-color-gray-glass-015);
    }
  
    button:disabled > wiu-tag {
      background-color: var(--wiu-color-gray-glass-010);
      color: var(--wiu-color-fg-300);
    }
  
    wiu-icon {
      color: var(--wiu-color-fg-200) !important;
    }
  `;
  var ga = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Ms = class extends _e {
    constructor() {
      super(...arguments), this.walletImages = [], this.imageSrc = "", this.name = "", this.tabIdx = void 0, this.installed = !1, this.disabled = !1, this.showAllWallets = !1
    }
    render() {
      return K`
        <button ?disabled=${this.disabled} tabindex=${$e(this.tabIdx)} ontouchstart>
          ${this.templateAllWallets()} ${this.templateWalletImage()}
          <wiu-text variant="paragraph-500" color="inherit">${this.name}</wiu-text>
          ${this.templateStatus()}
        </button>
      `
    }
    templateAllWallets() {
      return this.showAllWallets && this.imageSrc ? K` <wiu-all-wallets-image .imageeSrc=${this.imageSrc}> </wiu-all-wallets-image> ` : this.showAllWallets && this.walletIcon ? K` <wiu-wallet-image .walletIcon=${this.walletIcon} size="sm"> </wiu-wallet-image> ` : null
    }
    templateWalletImage() {
      return !this.showAllWallets && this.imageSrc ? K`<wiu-wallet-image
          size="sm"
          imageSrc=${this.imageSrc}
          name=${this.name}
          .installed=${this.installed}
        ></wiu-wallet-image>` : !this.showAllWallets && !this.imageSrc ? K`<wiu-wallet-image size="sm" name=${this.name}></wiu-wallet-image>` : null
    }
    templateStatus() {
      return this.tagLabel && this.tagVariant ? K`<wiu-tag variant=${this.tagVariant}>${this.tagLabel}</wiu-tag>` : this.icon ? K`<wiu-icon color="inherit" size="sm" name=${this.icon}></wiu-icon>` : null
    }
  };
  Ms.styles = [ft, ir, wle], ga([re({
    type: Array
  })], Ms.prototype, "walletImages", void 0), ga([re()], Ms.prototype, "imageSrc", void 0), ga([re()], Ms.prototype, "name", void 0), ga([re()], Ms.prototype, "tagLabel", void 0), ga([re()], Ms.prototype, "tagVariant", void 0), ga([re()], Ms.prototype, "icon", void 0), ga([re()], Ms.prototype, "walletIcon", void 0), ga([re()], Ms.prototype, "tabIdx", void 0), ga([re({
    type: Boolean
  })], Ms.prototype, "installed", void 0), ga([re({
    type: Boolean
  })], Ms.prototype, "disabled", void 0), ga([re({
    type: Boolean
  })], Ms.prototype, "showAllWallets", void 0), Ms = ga([ye("wiu-list-wallet")], Ms);
  const vle = Re`
    :host {
      display: flex;
      justify-content: center;
      align-items: center;
      width: 40px;
      height: 40px;
      border-radius: var(--wiu-border-radius-3xl);
      border: 1px solid var(--wiu-color-gray-glass-005);
      overflow: hidden;
    }
  
    wiu-icon {
      width: 100%;
      height: 100%;
    }
  `;
  var BP = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let A2 = class extends _e {
    constructor() {
      super(...arguments), this.logo = "google"
    }
    render() {
      return K`<wiu-icon color="inherit" size="inherit" name=${this.logo}></wiu-icon> `
    }
  };
  A2.styles = [ft, vle], BP([re()], A2.prototype, "logo", void 0), A2 = BP([ye("wiu-logo")], A2);
  const ble = Re`
    :host {
      display: block;
      width: 100%;
    }
  
    button {
      width: 100%;
      height: 56px;
      background: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-xs);
    }
  `;
  var Xy = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Gf = class extends _e {
    constructor() {
      super(...arguments), this.logo = "google", this.disabled = !1, this.tabIdx = void 0
    }
    render() {
      return K`
        <button ?disabled=${this.disabled} tabindex=${$e(this.tabIdx)} ontouchstart>
          <wiu-logo logo=${this.logo}></wiu-logo>
        </button>
      `
    }
  };
  Gf.styles = [ft, ir, ble], Xy([re()], Gf.prototype, "logo", void 0), Xy([re({
    type: Boolean
  })], Gf.prototype, "disabled", void 0), Xy([re()], Gf.prototype, "tabIdx", void 0), Gf = Xy([ye("wiu-logo-select")], Gf);
  const yle = Re`
    :host {
      display: block;
    }
  
    button {
      border-radius: var(--wiu-border-radius-3xl);
      display: flex;
      gap: var(--wiu-spacing-xs);
      padding: var(--wiu-spacing-2xs) var(--wiu-spacing-s) var(--wiu-spacing-2xs)
        var(--wiu-spacing-xs);
      border: 1px solid var(--wiu-color-gray-glass-010);
      background-color: var(--wiu-color-gray-glass-005);
      color: var(--wiu-color-fg-100);
    }
  
    button:disabled {
      border: 1px solid var(--wiu-color-gray-glass-005);
      background-color: var(--wiu-color-gray-glass-015);
      color: var(--wiu-color-gray-glass-015);
    }
  
    @media (hover: hover) and (pointer: fine) {
      button:hover:enabled {
        background-color: var(--wiu-color-gray-glass-010);
      }
  
      button:active:enabled {
        background-color: var(--wiu-color-gray-glass-015);
      }
    }
  
    wiu-image,
    wiu-icon-box {
      border-radius: var(--wiu-border-radius-3xl);
      width: 24px;
      height: 24px;
      box-shadow: 0 0 0 2px var(--wiu-color-gray-glass-005);
    }
  `;
  var e5 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Zf = class extends _e {
    constructor() {
      super(...arguments), this.imageSrc = void 0, this.isUnsupportedChain = void 0, this.disabled = !1
    }
    render() {
      return K`
        <button data-testid="wiu-network-button" ?disabled=${this.disabled}>
          ${this.visualTemplate()}
          <wiu-text variant="paragraph-600" color="inherit">
            <slot></slot>
          </wiu-text>
        </button>
      `
    }
    visualTemplate() {
      return this.isUnsupportedChain ? K`
          <wiu-icon-box
            size="sm"
            iconColor="error-100"
            backgroundColor="error-100"
            icon="warningCircle"
          ></wiu-icon-box>
        ` : this.imageSrc ? K`<wiu-image src=${this.imageSrc}></wiu-image>` : K`
        <wiu-icon-box
          size="sm"
          iconColor="inverse-100"
          backgroundColor="fg-100"
          icon="networkPlaceholder"
        ></wiu-icon-box>
      `
    }
  };
  Zf.styles = [ft, ir, yle], e5([re()], Zf.prototype, "imageSrc", void 0), e5([re({
    type: Boolean
  })], Zf.prototype, "isUnsupportedChain", void 0), e5([re({
    type: Boolean
  })], Zf.prototype, "disabled", void 0), Zf = e5([ye("wiu-network-button")], Zf);
  const _le = Re`
    :host {
      position: relative;
      display: block;
    }
  `;
  var t5 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Yf = class extends _e {
    constructor() {
      super(...arguments), this.length = 6, this.otp = "", this.values = Array.from({
        length: this.length
      }).map(() => ""), this.numerics = [], this.shouldInputBeEnabled = e => this.values.slice(0, e).every(n => n !== ""), this.handleKeyDown = (e, r) => {
        const n = e.target,
          i = this.getInputElement(n),
          s = ["ArrowLeft", "ArrowRight", "Shift", "Delete"];
        if (!i) return;
        s.includes(e.key) && e.preventDefault();
        const o = i.selectionStart;
        switch (e.key) {
          case "ArrowLeft":
            o && i.setSelectionRange(o + 1, o + 1), this.focusInputField("prev", r);
            break;
          case "ArrowRight":
            this.focusInputField("next", r);
            break;
          case "Shift":
            this.focusInputField("next", r);
            break;
          case "Delete":
            i.value === "" ? this.focusInputField("prev", r) : this.updateInput(i, r, "");
            break;
          case "Backspace":
            i.value === "" ? this.focusInputField("prev", r) : this.updateInput(i, r, "");
            break
        }
      }, this.focusInputField = (e, r) => {
        if (e === "next") {
          const n = r + 1;
          if (!this.shouldInputBeEnabled(n)) return;
          const i = this.numerics[n < this.length ? n : r],
            s = i ? this.getInputElement(i) : void 0;
          s && (s.disabled = !1, s.focus())
        }
        if (e === "prev") {
          const n = r - 1,
            i = this.numerics[n > -1 ? n : r],
            s = i ? this.getInputElement(i) : void 0;
          s && s.focus()
        }
      }
    }
    firstUpdated() {
      this.otp && (this.values = this.otp.split(""));
      const e = this.shadowRoot?.querySelectorAll("wiu-input-numeric");
      e && (this.numerics = Array.from(e)), this.numerics[0]?.focus()
    }
    render() {
      return K`
        <wiu-flex gap="xxs" data-testid="wiu-otp-input">
          ${Array.from({length:this.length}).map((e,r)=>K` <
        wui - input - numeric
      @input = $ {
        n => this.handleInput(n, r)
      }
      @click = $ {
        n => this.selectInput(n)
      }
      @keydown = $ {
          n => this.handleKeyDown(n, r)
        }
        .disabled = $ {
          !this.shouldInputBeEnabled(r)
        }
        .value = $ {
          this.values[r] || ""
        } >
        <
        /wiu-input-numeric>
      `)}
        </wiu-flex>
      `
    }
    updateInput(e, r, n) {
      const i = this.numerics[r],
        s = e || (i ? this.getInputElement(i) : void 0);
      s && (s.value = n, this.values = this.values.map((o, a) => a === r ? n : o))
    }
    selectInput(e) {
      const r = e.target;
      r && this.getInputElement(r)?.select()
    }
    handleInput(e, r) {
      const n = e.target,
        i = this.getInputElement(n);
      if (i) {
        const s = i.value;
        e.inputType === "insertFromPaste" ? this.handlePaste(i, s, r) : Vt.isNumber(s) && e.data ? (this.updateInput(i, r, e.data), this.focusInputField("next", r)) : this.updateInput(i, r, "")
      }
      this.dispatchInputChangeEvent()
    }
    handlePaste(e, r, n) {
      const i = r[0];
      if (i && Vt.isNumber(i)) {
        this.updateInput(e, n, i);
        const o = r.substring(1);
        if (n + 1 < this.length && o.length) {
          const a = this.numerics[n + 1],
            c = a ? this.getInputElement(a) : void 0;
          c && this.handlePaste(c, o, n + 1)
        } else this.focusInputField("next", n)
      } else this.updateInput(e, n, "")
    }
    getInputElement(e) {
      return e.shadowRoot?.querySelector("input") ? e.shadowRoot.querySelector("input") : null
    }
    dispatchInputChangeEvent() {
      const e = this.values.join("");
      this.dispatchEvent(new CustomEvent("inputChange", {
        detail: e,
        bubbles: !0,
        composed: !0
      }))
    }
  };
  Yf.styles = [ft, _le], t5([re({
    type: Number
  })], Yf.prototype, "length", void 0), t5([re({
    type: String
  })], Yf.prototype, "otp", void 0), t5([le()], Yf.prototype, "values", void 0), Yf = t5([ye("wiu-otp")], Yf);
  var O1 = {},
    xle = function () {
      return typeof Promise == "function" && Promise.prototype && Promise.prototype.then
    },
    UP = {},
    Lo = {};
  let yx;
  const Cle = [0, 26, 44, 70, 100, 134, 172, 196, 242, 292, 346, 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085, 1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185, 2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706];
  Lo.getSymbolSize = function (e) {
    if (!e) throw new Error('"version" cannot be null or undefined');
    if (e < 1 || e > 40) throw new Error('"version" should be in range from 1 to 40');
    return e * 4 + 17
  }, Lo.getSymbolTotalCodewords = function (e) {
    return Cle[e]
  }, Lo.getBCHDigit = function (t) {
    let e = 0;
    for (; t !== 0;) e++, t >>>= 1;
    return e
  }, Lo.setToSJISFunction = function (e) {
    if (typeof e != "function") throw new Error('"toSJISFunc" is not a valid function.');
    yx = e
  }, Lo.isKanjiModeEnabled = function () {
    return typeof yx < "u"
  }, Lo.toSJIS = function (e) {
    return yx(e)
  };
  var r5 = {};
  (function (t) {
    t.L = {
      bit: 1
    }, t.M = {
      bit: 0
    }, t.Q = {
      bit: 3
    }, t.H = {
      bit: 2
    };

    function e(r) {
      if (typeof r != "string") throw new Error("Param is not a string");
      switch (r.toLowerCase()) {
        case "l":
        case "low":
          return t.L;
        case "m":
        case "medium":
          return t.M;
        case "q":
        case "quartile":
          return t.Q;
        case "h":
        case "high":
          return t.H;
        default:
          throw new Error("Unknown EC Level: " + r)
      }
    }
    t.isValid = function (n) {
      return n && typeof n.bit < "u" && n.bit >= 0 && n.bit < 4
    }, t.from = function (n, i) {
      if (t.isValid(n)) return n;
      try {
        return e(n)
      } catch {
        return i
      }
    }
  })(r5);

  function jP() {
    this.buffer = [], this.length = 0
  }
  jP.prototype = {
    get: function (t) {
      const e = Math.floor(t / 8);
      return (this.buffer[e] >>> 7 - t % 8 & 1) === 1
    },
    put: function (t, e) {
      for (let r = 0; r < e; r++) this.putBit((t >>> e - r - 1 & 1) === 1)
    },
    getLengthInBits: function () {
      return this.length
    },
    putBit: function (t) {
      const e = Math.floor(this.length / 8);
      this.buffer.length <= e && this.buffer.push(0), t && (this.buffer[e] |= 128 >>> this.length % 8), this.length++
    }
  };
  var Ele = jP;

  function S2(t) {
    if (!t || t < 1) throw new Error("BitMatrix size must be defined and greater than 0");
    this.size = t, this.data = new Uint8Array(t * t), this.reservedBit = new Uint8Array(t * t)
  }
  S2.prototype.set = function (t, e, r, n) {
    const i = t * this.size + e;
    this.data[i] = r, n && (this.reservedBit[i] = !0)
  }, S2.prototype.get = function (t, e) {
    return this.data[t * this.size + e]
  }, S2.prototype.xor = function (t, e, r) {
    this.data[t * this.size + e] ^= r
  }, S2.prototype.isReserved = function (t, e) {
    return this.reservedBit[t * this.size + e]
  };
  var Ale = S2,
    FP = {};
  (function (t) {
    const e = Lo.getSymbolSize;
    t.getRowColCoords = function (n) {
      if (n === 1) return [];
      const i = Math.floor(n / 7) + 2,
        s = e(n),
        o = s === 145 ? 26 : Math.ceil((s - 13) / (2 * i - 2)) * 2,
        a = [s - 7];
      for (let c = 1; c < i - 1; c++) a[c] = a[c - 1] - o;
      return a.push(6), a.reverse()
    }, t.getPositions = function (n) {
      const i = [],
        s = t.getRowColCoords(n),
        o = s.length;
      for (let a = 0; a < o; a++)
        for (let c = 0; c < o; c++) a === 0 && c === 0 || a === 0 && c === o - 1 || a === o - 1 && c === 0 || i.push([s[a], s[c]]);
      return i
    }
  })(FP);
  var WP = {};
  const Sle = Lo.getSymbolSize,
    zP = 7;
  WP.getPositions = function (e) {
    const r = Sle(e);
    return [
      [0, 0],
      [r - zP, 0],
      [0, r - zP]
    ]
  };
  var HP = {};
  (function (t) {
    t.Patterns = {
      PATTERN000: 0,
      PATTERN001: 1,
      PATTERN010: 2,
      PATTERN011: 3,
      PATTERN100: 4,
      PATTERN101: 5,
      PATTERN110: 6,
      PATTERN111: 7
    };
    const e = {
      N1: 3,
      N2: 3,
      N3: 40,
      N4: 10
    };
    t.isValid = function (i) {
      return i != null && i !== "" && !isNaN(i) && i >= 0 && i <= 7
    }, t.from = function (i) {
      return t.isValid(i) ? parseInt(i, 10) : void 0
    }, t.getPenaltyN1 = function (i) {
      const s = i.size;
      let o = 0,
        a = 0,
        c = 0,
        l = null,
        h = null;
      for (let f = 0; f < s; f++) {
        a = c = 0, l = h = null;
        for (let w = 0; w < s; w++) {
          let b = i.get(f, w);
          b === l ? a++ : (a >= 5 && (o += e.N1 + (a - 5)), l = b, a = 1), b = i.get(w, f), b === h ? c++ : (c >= 5 && (o += e.N1 + (c - 5)), h = b, c = 1)
        }
        a >= 5 && (o += e.N1 + (a - 5)), c >= 5 && (o += e.N1 + (c - 5))
      }
      return o
    }, t.getPenaltyN2 = function (i) {
      const s = i.size;
      let o = 0;
      for (let a = 0; a < s - 1; a++)
        for (let c = 0; c < s - 1; c++) {
          const l = i.get(a, c) + i.get(a, c + 1) + i.get(a + 1, c) + i.get(a + 1, c + 1);
          (l === 4 || l === 0) && o++
        }
      return o * e.N2
    }, t.getPenaltyN3 = function (i) {
      const s = i.size;
      let o = 0,
        a = 0,
        c = 0;
      for (let l = 0; l < s; l++) {
        a = c = 0;
        for (let h = 0; h < s; h++) a = a << 1 & 2047 | i.get(l, h), h >= 10 && (a === 1488 || a === 93) && o++, c = c << 1 & 2047 | i.get(h, l), h >= 10 && (c === 1488 || c === 93) && o++
      }
      return o * e.N3
    }, t.getPenaltyN4 = function (i) {
      let s = 0;
      const o = i.data.length;
      for (let c = 0; c < o; c++) s += i.data[c];
      return Math.abs(Math.ceil(s * 100 / o / 5) - 10) * e.N4
    };

    function r(n, i, s) {
      switch (n) {
        case t.Patterns.PATTERN000:
          return (i + s) % 2 === 0;
        case t.Patterns.PATTERN001:
          return i % 2 === 0;
        case t.Patterns.PATTERN010:
          return s % 3 === 0;
        case t.Patterns.PATTERN011:
          return (i + s) % 3 === 0;
        case t.Patterns.PATTERN100:
          return (Math.floor(i / 2) + Math.floor(s / 3)) % 2 === 0;
        case t.Patterns.PATTERN101:
          return i * s % 2 + i * s % 3 === 0;
        case t.Patterns.PATTERN110:
          return (i * s % 2 + i * s % 3) % 2 === 0;
        case t.Patterns.PATTERN111:
          return (i * s % 3 + (i + s) % 2) % 2 === 0;
        default:
          throw new Error("bad maskPattern:" + n)
      }
    }
    t.applyMask = function (i, s) {
      const o = s.size;
      for (let a = 0; a < o; a++)
        for (let c = 0; c < o; c++) s.isReserved(c, a) || s.xor(c, a, r(i, c, a))
    }, t.getBestMask = function (i, s) {
      const o = Object.keys(t.Patterns).length;
      let a = 0,
        c = 1 / 0;
      for (let l = 0; l < o; l++) {
        s(l), t.applyMask(l, i);
        const h = t.getPenaltyN1(i) + t.getPenaltyN2(i) + t.getPenaltyN3(i) + t.getPenaltyN4(i);
        t.applyMask(l, i), h < c && (c = h, a = l)
      }
      return a
    }
  })(HP);
  var n5 = {};
  const ch = r5,
    i5 = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 2, 4, 1, 2, 4, 4, 2, 4, 4, 4, 2, 4, 6, 5, 2, 4, 6, 6, 2, 5, 8, 8, 4, 5, 8, 8, 4, 5, 8, 11, 4, 8, 10, 11, 4, 9, 12, 16, 4, 9, 16, 16, 6, 10, 12, 18, 6, 10, 17, 16, 6, 11, 16, 19, 6, 13, 18, 21, 7, 14, 21, 25, 8, 16, 20, 25, 8, 17, 23, 25, 9, 17, 23, 34, 9, 18, 25, 30, 10, 20, 27, 32, 12, 21, 29, 35, 12, 23, 34, 37, 12, 25, 34, 40, 13, 26, 35, 42, 14, 28, 38, 45, 15, 29, 40, 48, 16, 31, 43, 51, 17, 33, 45, 54, 18, 35, 48, 57, 19, 37, 51, 60, 19, 38, 53, 63, 20, 40, 56, 66, 21, 43, 59, 70, 22, 45, 62, 74, 24, 47, 65, 77, 25, 49, 68, 81],
    s5 = [7, 10, 13, 17, 10, 16, 22, 28, 15, 26, 36, 44, 20, 36, 52, 64, 26, 48, 72, 88, 36, 64, 96, 112, 40, 72, 108, 130, 48, 88, 132, 156, 60, 110, 160, 192, 72, 130, 192, 224, 80, 150, 224, 264, 96, 176, 260, 308, 104, 198, 288, 352, 120, 216, 320, 384, 132, 240, 360, 432, 144, 280, 408, 480, 168, 308, 448, 532, 180, 338, 504, 588, 196, 364, 546, 650, 224, 416, 600, 700, 224, 442, 644, 750, 252, 476, 690, 816, 270, 504, 750, 900, 300, 560, 810, 960, 312, 588, 870, 1050, 336, 644, 952, 1110, 360, 700, 1020, 1200, 390, 728, 1050, 1260, 420, 784, 1140, 1350, 450, 812, 1200, 1440, 480, 868, 1290, 1530, 510, 924, 1350, 1620, 540, 980, 1440, 1710, 570, 1036, 1530, 1800, 570, 1064, 1590, 1890, 600, 1120, 1680, 1980, 630, 1204, 1770, 2100, 660, 1260, 1860, 2220, 720, 1316, 1950, 2310, 750, 1372, 2040, 2430];
  n5.getBlocksCount = function (e, r) {
    switch (r) {
      case ch.L:
        return i5[(e - 1) * 4 + 0];
      case ch.M:
        return i5[(e - 1) * 4 + 1];
      case ch.Q:
        return i5[(e - 1) * 4 + 2];
      case ch.H:
        return i5[(e - 1) * 4 + 3];
      default:
        return
    }
  }, n5.getTotalCodewordsCount = function (e, r) {
    switch (r) {
      case ch.L:
        return s5[(e - 1) * 4 + 0];
      case ch.M:
        return s5[(e - 1) * 4 + 1];
      case ch.Q:
        return s5[(e - 1) * 4 + 2];
      case ch.H:
        return s5[(e - 1) * 4 + 3];
      default:
        return
    }
  };
  var qP = {},
    o5 = {};
  const I2 = new Uint8Array(512),
    a5 = new Uint8Array(256);
  (function () {
    let e = 1;
    for (let r = 0; r < 255; r++) I2[r] = e, a5[e] = r, e <<= 1, e & 256 && (e ^= 285);
    for (let r = 255; r < 512; r++) I2[r] = I2[r - 255]
  })(), o5.log = function (e) {
      if (e < 1) throw new Error("log(" + e + ")");
      return a5[e]
    }, o5.exp = function (e) {
      return I2[e]
    }, o5.mul = function (e, r) {
      return e === 0 || r === 0 ? 0 : I2[a5[e] + a5[r]]
    },
    function (t) {
      const e = o5;
      t.mul = function (n, i) {
        const s = new Uint8Array(n.length + i.length - 1);
        for (let o = 0; o < n.length; o++)
          for (let a = 0; a < i.length; a++) s[o + a] ^= e.mul(n[o], i[a]);
        return s
      }, t.mod = function (n, i) {
        let s = new Uint8Array(n);
        for (; s.length - i.length >= 0;) {
          const o = s[0];
          for (let c = 0; c < i.length; c++) s[c] ^= e.mul(i[c], o);
          let a = 0;
          for (; a < s.length && s[a] === 0;) a++;
          s = s.slice(a)
        }
        return s
      }, t.generateECPolynomial = function (n) {
        let i = new Uint8Array([1]);
        for (let s = 0; s < n; s++) i = t.mul(i, new Uint8Array([1, e.exp(s)]));
        return i
      }
    }(qP);
  const VP = qP;

  function _x(t) {
    this.genPoly = void 0, this.degree = t, this.degree && this.initialize(this.degree)
  }
  _x.prototype.initialize = function (e) {
    this.degree = e, this.genPoly = VP.generateECPolynomial(this.degree)
  }, _x.prototype.encode = function (e) {
    if (!this.genPoly) throw new Error("Encoder not initialized");
    const r = new Uint8Array(e.length + this.degree);
    r.set(e);
    const n = VP.mod(r, this.genPoly),
      i = this.degree - n.length;
    if (i > 0) {
      const s = new Uint8Array(this.degree);
      return s.set(n, i), s
    }
    return n
  };
  var Ile = _x,
    KP = {},
    lh = {},
    xx = {};
  xx.isValid = function (e) {
    return !isNaN(e) && e >= 1 && e <= 40
  };
  var hl = {};
  const GP = "[0-9]+",
    Tle = "[A-Z $%*+\\-./:]+";
  let T2 = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
  T2 = T2.replace(/u/g, "\\u");
  const kle = "(?:(?![A-Z0-9 $%*+\\-./:]|" + T2 + `)(?:.|[\r
  ]))+`;
  hl.KANJI = new RegExp(T2, "g"), hl.BYTE_KANJI = new RegExp("[^A-Z0-9 $%*+\\-./:]+", "g"), hl.BYTE = new RegExp(kle, "g"), hl.NUMERIC = new RegExp(GP, "g"), hl.ALPHANUMERIC = new RegExp(Tle, "g");
  const Rle = new RegExp("^" + T2 + "$"),
    Nle = new RegExp("^" + GP + "$"),
    Mle = new RegExp("^[A-Z0-9 $%*+\\-./:]+$");
  hl.testKanji = function (e) {
      return Rle.test(e)
    }, hl.testNumeric = function (e) {
      return Nle.test(e)
    }, hl.testAlphanumeric = function (e) {
      return Mle.test(e)
    },
    function (t) {
      const e = xx,
        r = hl;
      t.NUMERIC = {
        id: "Numeric",
        bit: 1,
        ccBits: [10, 12, 14]
      }, t.ALPHANUMERIC = {
        id: "Alphanumeric",
        bit: 2,
        ccBits: [9, 11, 13]
      }, t.BYTE = {
        id: "Byte",
        bit: 4,
        ccBits: [8, 16, 16]
      }, t.KANJI = {
        id: "Kanji",
        bit: 8,
        ccBits: [8, 10, 12]
      }, t.MIXED = {
        bit: -1
      }, t.getCharCountIndicator = function (s, o) {
        if (!s.ccBits) throw new Error("Invalid mode: " + s);
        if (!e.isValid(o)) throw new Error("Invalid version: " + o);
        return o >= 1 && o < 10 ? s.ccBits[0] : o < 27 ? s.ccBits[1] : s.ccBits[2]
      }, t.getBestModeForData = function (s) {
        return r.testNumeric(s) ? t.NUMERIC : r.testAlphanumeric(s) ? t.ALPHANUMERIC : r.testKanji(s) ? t.KANJI : t.BYTE
      }, t.toString = function (s) {
        if (s && s.id) return s.id;
        throw new Error("Invalid mode")
      }, t.isValid = function (s) {
        return s && s.bit && s.ccBits
      };

      function n(i) {
        if (typeof i != "string") throw new Error("Param is not a string");
        switch (i.toLowerCase()) {
          case "numeric":
            return t.NUMERIC;
          case "alphanumeric":
            return t.ALPHANUMERIC;
          case "kanji":
            return t.KANJI;
          case "byte":
            return t.BYTE;
          default:
            throw new Error("Unknown mode: " + i)
        }
      }
      t.from = function (s, o) {
        if (t.isValid(s)) return s;
        try {
          return n(s)
        } catch {
          return o
        }
      }
    }(lh),
    function (t) {
      const e = Lo,
        r = n5,
        n = r5,
        i = lh,
        s = xx,
        o = 7973,
        a = e.getBCHDigit(o);

      function c(w, b, C) {
        for (let M = 1; M <= 40; M++)
          if (b <= t.getCapacity(M, C, w)) return M
      }

      function l(w, b) {
        return i.getCharCountIndicator(w, b) + 4
      }

      function h(w, b) {
        let C = 0;
        return w.forEach(function (M) {
          const N = l(M.mode, b);
          C += N + M.getBitsLength()
        }), C
      }

      function f(w, b) {
        for (let C = 1; C <= 40; C++)
          if (h(w, C) <= t.getCapacity(C, b, i.MIXED)) return C
      }
      t.from = function (b, C) {
        return s.isValid(b) ? parseInt(b, 10) : C
      }, t.getCapacity = function (b, C, M) {
        if (!s.isValid(b)) throw new Error("Invalid QR Code version");
        typeof M > "u" && (M = i.BYTE);
        const N = e.getSymbolTotalCodewords(b),
          $ = r.getTotalCodewordsCount(b, C),
          k = (N - $) * 8;
        if (M === i.MIXED) return k;
        const B = k - l(M, b);
        switch (M) {
          case i.NUMERIC:
            return Math.floor(B / 10 * 3);
          case i.ALPHANUMERIC:
            return Math.floor(B / 11 * 2);
          case i.KANJI:
            return Math.floor(B / 13);
          case i.BYTE:
          default:
            return Math.floor(B / 8)
        }
      }, t.getBestVersionForData = function (b, C) {
        let M;
        const N = n.from(C, n.M);
        if (Array.isArray(b)) {
          if (b.length > 1) return f(b, N);
          if (b.length === 0) return 1;
          M = b[0]
        } else M = b;
        return c(M.mode, M.getLength(), N)
      }, t.getEncodedBits = function (b) {
        if (!s.isValid(b) || b < 7) throw new Error("Invalid QR Code version");
        let C = b << 12;
        for (; e.getBCHDigit(C) - a >= 0;) C ^= o << e.getBCHDigit(C) - a;
        return b << 12 | C
      }
    }(KP);
  var ZP = {};
  const Cx = Lo,
    YP = 1335,
    Ple = 21522,
    QP = Cx.getBCHDigit(YP);
  ZP.getEncodedBits = function (e, r) {
    const n = e.bit << 3 | r;
    let i = n << 10;
    for (; Cx.getBCHDigit(i) - QP >= 0;) i ^= YP << Cx.getBCHDigit(i) - QP;
    return (n << 10 | i) ^ Ple
  };
  var JP = {};
  const $le = lh;

  function D1(t) {
    this.mode = $le.NUMERIC, this.data = t.toString()
  }
  D1.getBitsLength = function (e) {
    return 10 * Math.floor(e / 3) + (e % 3 ? e % 3 * 3 + 1 : 0)
  }, D1.prototype.getLength = function () {
    return this.data.length
  }, D1.prototype.getBitsLength = function () {
    return D1.getBitsLength(this.data.length)
  }, D1.prototype.write = function (e) {
    let r, n, i;
    for (r = 0; r + 3 <= this.data.length; r += 3) n = this.data.substr(r, 3), i = parseInt(n, 10), e.put(i, 10);
    const s = this.data.length - r;
    s > 0 && (n = this.data.substr(r), i = parseInt(n, 10), e.put(i, s * 3 + 1))
  };
  var Ole = D1;
  const Dle = lh,
    Ex = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "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", " ", "$", "%", "*", "+", "-", ".", "/", ":"];

  function L1(t) {
    this.mode = Dle.ALPHANUMERIC, this.data = t
  }
  L1.getBitsLength = function (e) {
    return 11 * Math.floor(e / 2) + 6 * (e % 2)
  }, L1.prototype.getLength = function () {
    return this.data.length
  }, L1.prototype.getBitsLength = function () {
    return L1.getBitsLength(this.data.length)
  }, L1.prototype.write = function (e) {
    let r;
    for (r = 0; r + 2 <= this.data.length; r += 2) {
      let n = Ex.indexOf(this.data[r]) * 45;
      n += Ex.indexOf(this.data[r + 1]), e.put(n, 11)
    }
    this.data.length % 2 && e.put(Ex.indexOf(this.data[r]), 6)
  };
  var Lle = L1,
    Ble = function (e) {
      for (var r = [], n = e.length, i = 0; i < n; i++) {
        var s = e.charCodeAt(i);
        if (s >= 55296 && s <= 56319 && n > i + 1) {
          var o = e.charCodeAt(i + 1);
          o >= 56320 && o <= 57343 && (s = (s - 55296) * 1024 + o - 56320 + 65536, i += 1)
        }
        if (s < 128) {
          r.push(s);
          continue
        }
        if (s < 2048) {
          r.push(s >> 6 | 192), r.push(s & 63 | 128);
          continue
        }
        if (s < 55296 || s >= 57344 && s < 65536) {
          r.push(s >> 12 | 224), r.push(s >> 6 & 63 | 128), r.push(s & 63 | 128);
          continue
        }
        if (s >= 65536 && s <= 1114111) {
          r.push(s >> 18 | 240), r.push(s >> 12 & 63 | 128), r.push(s >> 6 & 63 | 128), r.push(s & 63 | 128);
          continue
        }
        r.push(239, 191, 189)
      }
      return new Uint8Array(r).buffer
    };
  const Ule = Ble,
    jle = lh;

  function B1(t) {
    this.mode = jle.BYTE, typeof t == "string" && (t = Ule(t)), this.data = new Uint8Array(t)
  }
  B1.getBitsLength = function (e) {
    return e * 8
  }, B1.prototype.getLength = function () {
    return this.data.length
  }, B1.prototype.getBitsLength = function () {
    return B1.getBitsLength(this.data.length)
  }, B1.prototype.write = function (t) {
    for (let e = 0, r = this.data.length; e < r; e++) t.put(this.data[e], 8)
  };
  var Fle = B1;
  const Wle = lh,
    zle = Lo;

  function U1(t) {
    this.mode = Wle.KANJI, this.data = t
  }
  U1.getBitsLength = function (e) {
    return e * 13
  }, U1.prototype.getLength = function () {
    return this.data.length
  }, U1.prototype.getBitsLength = function () {
    return U1.getBitsLength(this.data.length)
  }, U1.prototype.write = function (t) {
    let e;
    for (e = 0; e < this.data.length; e++) {
      let r = zle.toSJIS(this.data[e]);
      if (r >= 33088 && r <= 40956) r -= 33088;
      else if (r >= 57408 && r <= 60351) r -= 49472;
      else throw new Error("Invalid SJIS character: " + this.data[e] + `
  Make sure your charset is UTF-8`);
      r = (r >>> 8 & 255) * 192 + (r & 255), t.put(r, 13)
    }
  };
  var Hle = U1,
    XP = {
      exports: {}
    };
  (function (t) {
    var e = {
      single_source_shortest_paths: function (r, n, i) {
        var s = {},
          o = {};
        o[n] = 0;
        var a = e.PriorityQueue.make();
        a.push(n, 0);
        for (var c, l, h, f, w, b, C, M, N; !a.empty();) {
          c = a.pop(), l = c.value, f = c.cost, w = r[l] || {};
          for (h in w) w.hasOwnProperty(h) && (b = w[h], C = f + b, M = o[h], N = typeof o[h] > "u", (N || M > C) && (o[h] = C, a.push(h, C), s[h] = l))
        }
        if (typeof i < "u" && typeof o[i] > "u") {
          var $ = ["Could not find a path from ", n, " to ", i, "."].join("");
          throw new Error($)
        }
        return s
      },
      extract_shortest_path_from_predecessor_list: function (r, n) {
        for (var i = [], s = n; s;) i.push(s), r[s], s = r[s];
        return i.reverse(), i
      },
      find_path: function (r, n, i) {
        var s = e.single_source_shortest_paths(r, n, i);
        return e.extract_shortest_path_from_predecessor_list(s, i)
      },
      PriorityQueue: {
        make: function (r) {
          var n = e.PriorityQueue,
            i = {},
            s;
          r = r || {};
          for (s in n) n.hasOwnProperty(s) && (i[s] = n[s]);
          return i.queue = [], i.sorter = r.sorter || n.default_sorter, i
        },
        default_sorter: function (r, n) {
          return r.cost - n.cost
        },
        push: function (r, n) {
          var i = {
            value: r,
            cost: n
          };
          this.queue.push(i), this.queue.sort(this.sorter)
        },
        pop: function () {
          return this.queue.shift()
        },
        empty: function () {
          return this.queue.length === 0
        }
      }
    };
    t.exports = e
  })(XP);
  var qle = XP.exports;
  (function (t) {
    const e = lh,
      r = Ole,
      n = Lle,
      i = Fle,
      s = Hle,
      o = hl,
      a = Lo,
      c = qle;

    function l($) {
      return unescape(encodeURIComponent($)).length
    }

    function h($, k, B) {
      const F = [];
      let D;
      for (;
        (D = $.exec(B)) !== null;) F.push({
        data: D[0],
        index: D.index,
        mode: k,
        length: D[0].length
      });
      return F
    }

    function f($) {
      const k = h(o.NUMERIC, e.NUMERIC, $),
        B = h(o.ALPHANUMERIC, e.ALPHANUMERIC, $);
      let F, D;
      return a.isKanjiModeEnabled() ? (F = h(o.BYTE, e.BYTE, $), D = h(o.KANJI, e.KANJI, $)) : (F = h(o.BYTE_KANJI, e.BYTE, $), D = []), k.concat(B, F, D).sort(function (R, P) {
        return R.index - P.index
      }).map(function (R) {
        return {
          data: R.data,
          mode: R.mode,
          length: R.length
        }
      })
    }

    function w($, k) {
      switch (k) {
        case e.NUMERIC:
          return r.getBitsLength($);
        case e.ALPHANUMERIC:
          return n.getBitsLength($);
        case e.KANJI:
          return s.getBitsLength($);
        case e.BYTE:
          return i.getBitsLength($)
      }
    }

    function b($) {
      return $.reduce(function (k, B) {
        const F = k.length - 1 >= 0 ? k[k.length - 1] : null;
        return F && F.mode === B.mode ? (k[k.length - 1].data += B.data, k) : (k.push(B), k)
      }, [])
    }

    function C($) {
      const k = [];
      for (let B = 0; B < $.length; B++) {
        const F = $[B];
        switch (F.mode) {
          case e.NUMERIC:
            k.push([F, {
              data: F.data,
              mode: e.ALPHANUMERIC,
              length: F.length
            }, {
              data: F.data,
              mode: e.BYTE,
              length: F.length
            }]);
            break;
          case e.ALPHANUMERIC:
            k.push([F, {
              data: F.data,
              mode: e.BYTE,
              length: F.length
            }]);
            break;
          case e.KANJI:
            k.push([F, {
              data: F.data,
              mode: e.BYTE,
              length: l(F.data)
            }]);
            break;
          case e.BYTE:
            k.push([{
              data: F.data,
              mode: e.BYTE,
              length: l(F.data)
            }])
        }
      }
      return k
    }

    function M($, k) {
      const B = {},
        F = {
          start: {}
        };
      let D = ["start"];
      for (let V = 0; V < $.length; V++) {
        const R = $[V],
          P = [];
        for (let j = 0; j < R.length; j++) {
          const Y = R[j],
            U = "" + V + j;
          P.push(U), B[U] = {
            node: Y,
            lastCount: 0
          }, F[U] = {};
          for (let I = 0; I < D.length; I++) {
            const g = D[I];
            B[g] && B[g].node.mode === Y.mode ? (F[g][U] = w(B[g].lastCount + Y.length, Y.mode) - w(B[g].lastCount, Y.mode), B[g].lastCount += Y.length) : (B[g] && (B[g].lastCount = Y.length), F[g][U] = w(Y.length, Y.mode) + 4 + e.getCharCountIndicator(Y.mode, k))
          }
        }
        D = P
      }
      for (let V = 0; V < D.length; V++) F[D[V]].end = 0;
      return {
        map: F,
        table: B
      }
    }

    function N($, k) {
      let B;
      const F = e.getBestModeForData($);
      if (B = e.from(k, F), B !== e.BYTE && B.bit < F.bit) throw new Error('"' + $ + '" cannot be encoded with mode ' + e.toString(B) + `.
   Suggested mode is: ` + e.toString(F));
      switch (B === e.KANJI && !a.isKanjiModeEnabled() && (B = e.BYTE), B) {
        case e.NUMERIC:
          return new r($);
        case e.ALPHANUMERIC:
          return new n($);
        case e.KANJI:
          return new s($);
        case e.BYTE:
          return new i($)
      }
    }
    t.fromArray = function (k) {
      return k.reduce(function (B, F) {
        return typeof F == "string" ? B.push(N(F, null)) : F.data && B.push(N(F.data, F.mode)), B
      }, [])
    }, t.fromString = function (k, B) {
      const F = f(k, a.isKanjiModeEnabled()),
        D = C(F),
        V = M(D, B),
        R = c.find_path(V.map, "start", "end"),
        P = [];
      for (let j = 1; j < R.length - 1; j++) P.push(V.table[R[j]].node);
      return t.fromArray(b(P))
    }, t.rawSplit = function (k) {
      return t.fromArray(f(k, a.isKanjiModeEnabled()))
    }
  })(JP);
  const c5 = Lo,
    Ax = r5,
    Vle = Ele,
    Kle = Ale,
    Gle = FP,
    Zle = WP,
    Sx = HP,
    Ix = n5,
    Yle = Ile,
    l5 = KP,
    Qle = ZP,
    Jle = lh,
    Tx = JP;

  function Xle(t, e) {
    const r = t.size,
      n = Zle.getPositions(e);
    for (let i = 0; i < n.length; i++) {
      const s = n[i][0],
        o = n[i][1];
      for (let a = -1; a <= 7; a++)
        if (!(s + a <= -1 || r <= s + a))
          for (let c = -1; c <= 7; c++) o + c <= -1 || r <= o + c || (a >= 0 && a <= 6 && (c === 0 || c === 6) || c >= 0 && c <= 6 && (a === 0 || a === 6) || a >= 2 && a <= 4 && c >= 2 && c <= 4 ? t.set(s + a, o + c, !0, !0) : t.set(s + a, o + c, !1, !0))
    }
  }

  function eue(t) {
    const e = t.size;
    for (let r = 8; r < e - 8; r++) {
      const n = r % 2 === 0;
      t.set(r, 6, n, !0), t.set(6, r, n, !0)
    }
  }

  function tue(t, e) {
    const r = Gle.getPositions(e);
    for (let n = 0; n < r.length; n++) {
      const i = r[n][0],
        s = r[n][1];
      for (let o = -2; o <= 2; o++)
        for (let a = -2; a <= 2; a++) o === -2 || o === 2 || a === -2 || a === 2 || o === 0 && a === 0 ? t.set(i + o, s + a, !0, !0) : t.set(i + o, s + a, !1, !0)
    }
  }

  function rue(t, e) {
    const r = t.size,
      n = l5.getEncodedBits(e);
    let i, s, o;
    for (let a = 0; a < 18; a++) i = Math.floor(a / 3), s = a % 3 + r - 8 - 3, o = (n >> a & 1) === 1, t.set(i, s, o, !0), t.set(s, i, o, !0)
  }

  function kx(t, e, r) {
    const n = t.size,
      i = Qle.getEncodedBits(e, r);
    let s, o;
    for (s = 0; s < 15; s++) o = (i >> s & 1) === 1, s < 6 ? t.set(s, 8, o, !0) : s < 8 ? t.set(s + 1, 8, o, !0) : t.set(n - 15 + s, 8, o, !0), s < 8 ? t.set(8, n - s - 1, o, !0) : s < 9 ? t.set(8, 15 - s - 1 + 1, o, !0) : t.set(8, 15 - s - 1, o, !0);
    t.set(n - 8, 8, 1, !0)
  }

  function nue(t, e) {
    const r = t.size;
    let n = -1,
      i = r - 1,
      s = 7,
      o = 0;
    for (let a = r - 1; a > 0; a -= 2)
      for (a === 6 && a--;;) {
        for (let c = 0; c < 2; c++)
          if (!t.isReserved(i, a - c)) {
            let l = !1;
            o < e.length && (l = (e[o] >>> s & 1) === 1), t.set(i, a - c, l), s--, s === -1 && (o++, s = 7)
          } if (i += n, i < 0 || r <= i) {
          i -= n, n = -n;
          break
        }
      }
  }

  function iue(t, e, r) {
    const n = new Vle;
    r.forEach(function (c) {
      n.put(c.mode.bit, 4), n.put(c.getLength(), Jle.getCharCountIndicator(c.mode, t)), c.write(n)
    });
    const i = c5.getSymbolTotalCodewords(t),
      s = Ix.getTotalCodewordsCount(t, e),
      o = (i - s) * 8;
    for (n.getLengthInBits() + 4 <= o && n.put(0, 4); n.getLengthInBits() % 8 !== 0;) n.putBit(0);
    const a = (o - n.getLengthInBits()) / 8;
    for (let c = 0; c < a; c++) n.put(c % 2 ? 17 : 236, 8);
    return sue(n, t, e)
  }

  function sue(t, e, r) {
    const n = c5.getSymbolTotalCodewords(e),
      i = Ix.getTotalCodewordsCount(e, r),
      s = n - i,
      o = Ix.getBlocksCount(e, r),
      a = n % o,
      c = o - a,
      l = Math.floor(n / o),
      h = Math.floor(s / o),
      f = h + 1,
      w = l - h,
      b = new Yle(w);
    let C = 0;
    const M = new Array(o),
      N = new Array(o);
    let $ = 0;
    const k = new Uint8Array(t.buffer);
    for (let R = 0; R < o; R++) {
      const P = R < c ? h : f;
      M[R] = k.slice(C, C + P), N[R] = b.encode(M[R]), C += P, $ = Math.max($, P)
    }
    const B = new Uint8Array(n);
    let F = 0,
      D, V;
    for (D = 0; D < $; D++)
      for (V = 0; V < o; V++) D < M[V].length && (B[F++] = M[V][D]);
    for (D = 0; D < w; D++)
      for (V = 0; V < o; V++) B[F++] = N[V][D];
    return B
  }

  function oue(t, e, r, n) {
    let i;
    if (Array.isArray(t)) i = Tx.fromArray(t);
    else if (typeof t == "string") {
      let l = e;
      if (!l) {
        const h = Tx.rawSplit(t);
        l = l5.getBestVersionForData(h, r)
      }
      i = Tx.fromString(t, l || 40)
    } else throw new Error("Invalid data");
    const s = l5.getBestVersionForData(i, r);
    if (!s) throw new Error("The amount of data is too big to be stored in a QR Code");
    if (!e) e = s;
    else if (e < s) throw new Error(`
  The chosen QR Code version cannot contain this amount of data.
  Minimum version required to store current data is: ` + s + `.
  `);
    const o = iue(e, r, i),
      a = c5.getSymbolSize(e),
      c = new Kle(a);
    return Xle(c, e), eue(c), tue(c, e), kx(c, r, 0), e >= 7 && rue(c, e), nue(c, o), isNaN(n) && (n = Sx.getBestMask(c, kx.bind(null, c, r))), Sx.applyMask(n, c), kx(c, r, n), {
      modules: c,
      version: e,
      errorCorrectionLevel: r,
      maskPattern: n,
      segments: i
    }
  }
  UP.create = function (e, r) {
    if (typeof e > "u" || e === "") throw new Error("No input text");
    let n = Ax.M,
      i, s;
    return typeof r < "u" && (n = Ax.from(r.errorCorrectionLevel, Ax.M), i = l5.from(r.version), s = Sx.from(r.maskPattern), r.toSJISFunc && c5.setToSJISFunction(r.toSJISFunc)), oue(e, i, n, s)
  };
  var e$ = {},
    Rx = {};
  (function (t) {
    function e(r) {
      if (typeof r == "number" && (r = r.toString()), typeof r != "string") throw new Error("Color should be defined as hex string");
      let n = r.slice().replace("#", "").split("");
      if (n.length < 3 || n.length === 5 || n.length > 8) throw new Error("Invalid hex color: " + r);
      (n.length === 3 || n.length === 4) && (n = Array.prototype.concat.apply([], n.map(function (s) {
        return [s, s]
      }))), n.length === 6 && n.push("F", "F");
      const i = parseInt(n.join(""), 16);
      return {
        r: i >> 24 & 255,
        g: i >> 16 & 255,
        b: i >> 8 & 255,
        a: i & 255,
        hex: "#" + n.slice(0, 6).join("")
      }
    }
    t.getOptions = function (n) {
      n || (n = {}), n.color || (n.color = {});
      const i = typeof n.margin > "u" || n.margin === null || n.margin < 0 ? 4 : n.margin,
        s = n.width && n.width >= 21 ? n.width : void 0,
        o = n.scale || 4;
      return {
        width: s,
        scale: s ? 4 : o,
        margin: i,
        color: {
          dark: e(n.color.dark || "#000000ff"),
          light: e(n.color.light || "#ffffffff")
        },
        type: n.type,
        rendererOpts: n.rendererOpts || {}
      }
    }, t.getScale = function (n, i) {
      return i.width && i.width >= n + i.margin * 2 ? i.width / (n + i.margin * 2) : i.scale
    }, t.getImageWidth = function (n, i) {
      const s = t.getScale(n, i);
      return Math.floor((n + i.margin * 2) * s)
    }, t.qrToImageData = function (n, i, s) {
      const o = i.modules.size,
        a = i.modules.data,
        c = t.getScale(o, s),
        l = Math.floor((o + s.margin * 2) * c),
        h = s.margin * c,
        f = [s.color.light, s.color.dark];
      for (let w = 0; w < l; w++)
        for (let b = 0; b < l; b++) {
          let C = (w * l + b) * 4,
            M = s.color.light;
          if (w >= h && b >= h && w < l - h && b < l - h) {
            const N = Math.floor((w - h) / c),
              $ = Math.floor((b - h) / c);
            M = f[a[N * o + $] ? 1 : 0]
          }
          n[C++] = M.r, n[C++] = M.g, n[C++] = M.b, n[C] = M.a
        }
    }
  })(Rx),
  function (t) {
    const e = Rx;

    function r(i, s, o) {
      i.clearRect(0, 0, s.width, s.height), s.style || (s.style = {}), s.height = o, s.width = o, s.style.height = o + "px", s.style.width = o + "px"
    }

    function n() {
      try {
        return document.createElement("canvas")
      } catch {
        throw new Error("You need to specify a canvas element")
      }
    }
    t.render = function (s, o, a) {
      let c = a,
        l = o;
      typeof c > "u" && (!o || !o.getContext) && (c = o, o = void 0), o || (l = n()), c = e.getOptions(c);
      const h = e.getImageWidth(s.modules.size, c),
        f = l.getContext("2d"),
        w = f.createImageData(h, h);
      return e.qrToImageData(w.data, s, c), r(f, l, h), f.putImageData(w, 0, 0), l
    }, t.renderToDataURL = function (s, o, a) {
      let c = a;
      typeof c > "u" && (!o || !o.getContext) && (c = o, o = void 0), c || (c = {});
      const l = t.render(s, o, c),
        h = c.type || "image/png",
        f = c.rendererOpts || {};
      return l.toDataURL(h, f.quality)
    }
  }(e$);
  var t$ = {};
  const aue = Rx;

  function r$(t, e) {
    const r = t.a / 255,
      n = e + '="' + t.hex + '"';
    return r < 1 ? n + " " + e + '-opacity="' + r.toFixed(2).slice(1) + '"' : n
  }

  function Nx(t, e, r) {
    let n = t + e;
    return typeof r < "u" && (n += " " + r), n
  }

  function cue(t, e, r) {
    let n = "",
      i = 0,
      s = !1,
      o = 0;
    for (let a = 0; a < t.length; a++) {
      const c = Math.floor(a % e),
        l = Math.floor(a / e);
      !c && !s && (s = !0), t[a] ? (o++, a > 0 && c > 0 && t[a - 1] || (n += s ? Nx("M", c + r, .5 + l + r) : Nx("m", i, 0), i = 0, s = !1), c + 1 < e && t[a + 1] || (n += Nx("h", o), o = 0)) : i++
    }
    return n
  }
  t$.render = function (e, r, n) {
    const i = aue.getOptions(r),
      s = e.modules.size,
      o = e.modules.data,
      a = s + i.margin * 2,
      c = i.color.light.a ? "<path " + r$(i.color.light, "fill") + ' d="M0 0h' + a + "v" + a + 'H0z"/>' : "",
      l = "<path " + r$(i.color.dark, "stroke") + ' d="' + cue(o, s, i.margin) + '"/>',
      h = 'viewBox="0 0 ' + a + " " + a + '"',
      w = '<svg xmlns="http://www.w3.org/2000/svg" ' + (i.width ? 'width="' + i.width + '" height="' + i.width + '" ' : "") + h + ' shape-rendering="crispEdges">' + c + l + `</svg>
  `;
    return typeof n == "function" && n(null, w), w
  };
  const lue = xle,
    Mx = UP,
    n$ = e$,
    uue = t$;

  function Px(t, e, r, n, i) {
    const s = [].slice.call(arguments, 1),
      o = s.length,
      a = typeof s[o - 1] == "function";
    if (!a && !lue()) throw new Error("Callback required as last argument");
    if (a) {
      if (o < 2) throw new Error("Too few arguments provided");
      o === 2 ? (i = r, r = e, e = n = void 0) : o === 3 && (e.getContext && typeof i > "u" ? (i = n, n = void 0) : (i = n, n = r, r = e, e = void 0))
    } else {
      if (o < 1) throw new Error("Too few arguments provided");
      return o === 1 ? (r = e, e = n = void 0) : o === 2 && !e.getContext && (n = r, r = e, e = void 0), new Promise(function (c, l) {
        try {
          const h = Mx.create(r, n);
          c(t(h, e, n))
        } catch (h) {
          l(h)
        }
      })
    }
    try {
      const c = Mx.create(r, n);
      i(null, t(c, e, n))
    } catch (c) {
      i(c)
    }
  }
  O1.create = Mx.create, O1.toCanvas = Px.bind(null, n$.render), O1.toDataURL = Px.bind(null, n$.renderToDataURL), O1.toString = Px.bind(null, function (t, e, r) {
    return uue.render(t, r)
  });
  const due = .1,
    i$ = 2.5,
    Du = 7;

  function $x(t, e, r) {
    return t === e ? !1 : (t - e < 0 ? e - t : t - e) <= r + due
  }

  function hue(t, e) {
    const r = Array.prototype.slice.call(O1.create(t, {
        errorCorrectionLevel: e
      }).modules.data, 0),
      n = Math.sqrt(r.length);
    return r.reduce((i, s, o) => (o % n === 0 ? i.push([s]) : i[i.length - 1].push(s)) && i, [])
  }
  const fue = {
      generate(t, e, r) {
        const n = "#141414",
          i = "transparent",
          o = [],
          a = hue(t, "Q"),
          c = e / a.length,
          l = [{
            x: 0,
            y: 0
          }, {
            x: 1,
            y: 0
          }, {
            x: 0,
            y: 1
          }];
        l.forEach(({
          x: M,
          y: N
        }) => {
          const $ = (a.length - Du) * c * M,
            k = (a.length - Du) * c * N,
            B = .45;
          for (let F = 0; F < l.length; F += 1) {
            const D = c * (Du - F * 2);
            o.push(Ke`
              <rect
                fill=${F===2?n:i}
                width=${F===0?D-5:D}
                rx= ${F===0?(D-5)*B:D*B}
                ry= ${F===0?(D-5)*B:D*B}
                stroke=${n}
                stroke-width=${F===0?5:0}
                height=${F===0?D-5:D}
                x= ${F===0?k+c*F+5/2:k+c*F}
                y= ${F===0?$+c*F+5/2:$+c*F}
              />
            `)
          }
        });
        const h = Math.floor((r + 25) / c),
          f = a.length / 2 - h / 2,
          w = a.length / 2 + h / 2 - 1,
          b = [];
        a.forEach((M, N) => {
          M.forEach(($, k) => {
            if (a[N][k] && !(N < Du && k < Du || N > a.length - (Du + 1) && k < Du || N < Du && k > a.length - (Du + 1)) && !(N > f && N < w && k > f && k < w)) {
              const B = N * c + c / 2,
                F = k * c + c / 2;
              b.push([B, F])
            }
          })
        });
        const C = {};
        return b.forEach(([M, N]) => {
          C[M] ? C[M]?.push(N) : C[M] = [N]
        }), Object.entries(C).map(([M, N]) => {
          const $ = N.filter(k => N.every(B => !$x(k, B, c)));
          return [Number(M), $]
        }).forEach(([M, N]) => {
          N.forEach($ => {
            o.push(Ke`<circle cx=${M} cy=${$} fill=${n} r=${c/i$} />`)
          })
        }), Object.entries(C).filter(([M, N]) => N.length > 1).map(([M, N]) => {
          const $ = N.filter(k => N.some(B => $x(k, B, c)));
          return [Number(M), $]
        }).map(([M, N]) => {
          N.sort((k, B) => k < B ? -1 : 1);
          const $ = [];
          for (const k of N) {
            const B = $.find(F => F.some(D => $x(k, D, c)));
            B ? B.push(k) : $.push([k])
          }
          return [M, $.map(k => [k[0], k[k.length - 1]])]
        }).forEach(([M, N]) => {
          N.forEach(([$, k]) => {
            o.push(Ke`
                <line
                  x1=${M}
                  x2=${M}
                  y1=${$}
                  y2=${k}
                  stroke=${n}
                  stroke-width=${c/(i$/2)}
                  stroke-linecap="round"
                />
              `)
          })
        }), o
      }
    },
    pue = Re`
    :host {
      position: relative;
      user-select: none;
      display: block;
      overflow: hidden;
      aspect-ratio: 1 / 1;
      width: var(--local-size);
    }
  
    :host([data-theme='dark']) {
      border-radius: clamp(0px, var(--wiu-border-radius-l), 40px);
      background-color: var(--wiu-color-inverse-100);
      padding: var(--wiu-spacing-l);
    }
  
    :host([data-theme='light']) {
      box-shadow: 0 0 0 1px var(--wiu-color-bg-125);
      background-color: var(--wiu-color-bg-125);
    }
  
    :host([data-clear='true']) > wiu-icon {
      display: none;
    }
  
    svg:first-child,
    wiu-image,
    wiu-icon {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translateY(-50%) translateX(-50%);
    }
  
    wiu-image {
      width: 25%;
      height: 25%;
      border-radius: var(--wiu-border-radius-xs);
    }
  
    wiu-icon {
      width: 100%;
      height: 100%;
      color: #3396ff !important;
      transform: translateY(-50%) translateX(-50%) scale(0.25);
    }
  `;
  var uh = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let hc = class extends _e {
    constructor() {
      super(...arguments), this.uri = "", this.size = 0, this.theme = "dark", this.imageSrc = void 0, this.alt = void 0, this.arenaClear = void 0, this.farcaster = void 0
    }
    render() {
      return this.dataset.theme = this.theme, this.dataset.clear = String(this.arenaClear), this.style.cssText = `--local-size: ${this.size}px`, K`${this.templateVisual()} ${this.templateSvg()}`
    }
    templateSvg() {
      const e = this.theme === "light" ? this.size : this.size - 32;
      return Ke`
        <svg height=${e} width=${e}>
          ${fue.generate(this.uri,e,this.arenaClear?0:e/4)}
        </svg>
      `
    }
    templateVisual() {
      return this.imageSrc ? K`<wiu-image src=${this.imageSrc} alt=${this.alt??"logo"}></wiu-image>` : this.farcaster ? K`<wiu-icon
          class="farcaster"
          size="inherit"
          color="inherit"
          name="farcaster"
        ></wiu-icon>` : K`<wiu-icon size="inherit" color="inherit" name="walletConnect"></wiu-icon>`
    }
  };
  hc.styles = [ft, pue], uh([re()], hc.prototype, "uri", void 0), uh([re({
    type: Number
  })], hc.prototype, "size", void 0), uh([re()], hc.prototype, "theme", void 0), uh([re()], hc.prototype, "imageSrc", void 0), uh([re()], hc.prototype, "alt", void 0), uh([re({
    type: Boolean
  })], hc.prototype, "arenaClear", void 0), uh([re({
    type: Boolean
  })], hc.prototype, "farcaster", void 0), hc = uh([ye("wiu-qr-code")], hc);
  const gue = Re`
    :host {
      position: relative;
      display: inline-block;
      width: 100%;
    }
  `;
  var mue = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let u5 = class extends _e {
    constructor() {
      super(...arguments), this.inputComponentRef = cl()
    }
    render() {
      return K`
        <wiu-input-text
          ${ll(this.inputComponentRef)}
          placeholder="Search wallet"
          icon="search"
          type="search"
          enterKeyHint="search"
          size="sm"
        >
          <wiu-input-element @click=${this.clearValue} icon="close"></wiu-input-element>
        </wiu-input-text>
      `
    }
    clearValue() {
      const r = this.inputComponentRef.value?.inputElementRef.value;
      r && (r.value = "", r.focus(), r.dispatchEvent(new Event("input")))
    }
  };
  u5.styles = [ft, gue], u5 = mue([ye("wiu-search-bar")], u5);
  const wue = Re`
    :host {
      display: flex;
      column-gap: var(--wiu-spacing-s);
      align-items: center;
      padding: var(--wiu-spacing-xs) var(--wiu-spacing-m) var(--wiu-spacing-xs) var(--wiu-spacing-xs);
      border-radius: var(--wiu-border-radius-s);
      border: 1px solid var(--wiu-color-gray-glass-005);
      box-sizing: border-box;
      background-color: var(--wiu-color-bg-175);
      box-shadow:
        0px 14px 64px -4px rgba(0, 0, 0, 0.15),
        0px 8px 22px -6px rgba(0, 0, 0, 0.15);
  
      max-width: 300px;
    }
  
    :host wiu-loading-spinner {
      margin-left: var(--wiu-spacing-3xs);
    }
  `;
  var Qf = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let fl = class extends _e {
    constructor() {
      super(...arguments), this.backgroundColor = "accent-100", this.iconColor = "accent-100", this.icon = "checkmark", this.message = "", this.loading = !1, this.iconType = "default"
    }
    render() {
      return K`
        ${this.templateIcon()}
        <wiu-text variant="paragraph-500" color="fg-100" data-testid="wiu-snackbar-message"
          >${this.message}</wiu-text
        >
      `
    }
    templateIcon() {
      return this.loading ? K`<wiu-loading-spinner size="md" color="accent-100"></wiu-loading-spinner>` : this.iconType === "default" ? K`<wiu-icon size="xl" color=${this.iconColor} name=${this.icon}></wiu-icon>` : K`<wiu-icon-box
        size="sm"
        iconSize="xs"
        iconColor=${this.iconColor}
        backgroundColor=${this.backgroundColor}
        icon=${this.icon}
        background="opaque"
      ></wiu-icon-box>`
    }
  };
  fl.styles = [ft, wue], Qf([re()], fl.prototype, "backgroundColor", void 0), Qf([re()], fl.prototype, "iconColor", void 0), Qf([re()], fl.prototype, "icon", void 0), Qf([re()], fl.prototype, "message", void 0), Qf([re()], fl.prototype, "loading", void 0), Qf([re()], fl.prototype, "iconType", void 0), fl = Qf([ye("wiu-snackbar")], fl);
  const vue = Re`
    :host {
      display: flex;
      align-items: center;
      justify-content: center;
      padding: var(--wiu-spacing-s);
      border-radius: var(--wiu-border-radius-s);
      border: 1px solid var(--wiu-color-dark-glass-100);
      box-sizing: border-box;
      background-color: var(--wiu-color-bg-325);
      box-shadow: 0px 0px 16px 0px rgba(0, 0, 0, 0.25);
    }
  
    wiu-flex {
      width: 100%;
    }
  
    wiu-text {
      word-break: break-word;
      flex: 1;
    }
  
    .close {
      cursor: pointer;
    }
  
    .icon-box {
      height: 40px;
      width: 40px;
      border-radius: var(--wiu-border-radius-3xs);
      background-color: var(--local-icon-bg-value);
    }
  `;
  var k2 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let dh = class extends _e {
    constructor() {
      super(...arguments), this.message = "", this.backgroundColor = "accent-100", this.iconColor = "accent-100", this.icon = "info"
    }
    render() {
      return this.style.cssText = `
        --local-icon-bg-value: var(--wiu-color-${this.backgroundColor});
     `, K`
        <wiu-flex flexDirection="row" justifyContent="space-between" alignItems="center">
          <wiu-flex columnGap="xs" flexDirection="row" alignItems="center">
            <wiu-flex
              flexDirection="row"
              alignItems="center"
              justifyContent="center"
              class="icon-box"
            >
              <wiu-icon color=${this.iconColor} size="md" name=${this.icon}></wiu-icon>
            </wiu-flex>
            <wiu-text variant="small-500" color="bg-350" data-testid="wiu-alertbar-text"
              >${this.message}</wiu-text
            >
          </wiu-flex>
          <wiu-icon
            class="close"
            color="bg-350"
            size="sm"
            name="close"
            @click=${this.onClose}
          ></wiu-icon>
        </wiu-flex>
      `
    }
    onClose() {
      Zd.close()
    }
  };
  dh.styles = [ft, vue], k2([re()], dh.prototype, "message", void 0), k2([re()], dh.prototype, "backgroundColor", void 0), k2([re()], dh.prototype, "iconColor", void 0), k2([re()], dh.prototype, "icon", void 0), dh = k2([ye("wiu-alertbar")], dh);
  const bue = Re`
    :host {
      display: inline-flex;
      background-color: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-3xl);
      padding: var(--wiu-spacing-3xs);
      position: relative;
      height: 36px;
      min-height: 36px;
      overflow: hidden;
    }
  
    :host::before {
      content: '';
      position: absolute;
      pointer-events: none;
      top: 4px;
      left: 4px;
      display: block;
      width: var(--local-tab-width);
      height: 28px;
      border-radius: var(--wiu-border-radius-3xl);
      background-color: var(--wiu-color-gray-glass-002);
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-002);
      transform: translateX(calc(var(--local-tab) * var(--local-tab-width)));
      transition: transform var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: background-color, opacity;
    }
  
    :host([data-type='flex'])::before {
      left: 3px;
      transform: translateX(calc((var(--local-tab) * 34px) + (var(--local-tab) * 4px)));
    }
  
    :host([data-type='flex']) {
      display: flex;
      padding: 0px 0px 0px 12px;
      gap: 4px;
    }
  
    :host([data-type='flex']) > button > wiu-text {
      position: absolute;
      left: 18px;
      opacity: 0;
    }
  
    button[data-active='true'] > wiu-icon,
    button[data-active='true'] > wiu-text {
      color: var(--wiu-color-fg-100);
    }
  
    button[data-active='false'] > wiu-icon,
    button[data-active='false'] > wiu-text {
      color: var(--wiu-color-fg-200);
    }
  
    button[data-active='true']:disabled,
    button[data-active='false']:disabled {
      background-color: transparent;
      opacity: 0.5;
      cursor: not-allowed;
    }
  
    button[data-active='true']:disabled > wiu-text {
      color: var(--wiu-color-fg-200);
    }
  
    button[data-active='false']:disabled > wiu-text {
      color: var(--wiu-color-fg-300);
    }
  
    button > wiu-icon,
    button > wiu-text {
      pointer-events: none;
      transition: color var(--wiu-e ase-out-power-1) var(--wiu-duration-md);
      will-change: color;
    }
  
    button {
      width: var(--local-tab-width);
      transition: background-color var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: background-color;
    }
  
    :host([data-type='flex']) > button {
      width: 34px;
      position: relative;
      display: flex;
      justify-content: flex-start;
    }
  
    button:hover:enabled,
    button:active:enabled {
      background-color: transparent !important;
    }
  
    button:hover:enabled > wiu-icon,
    button:active:enabled > wiu-icon {
      transition: all var(--wiu-ease-out-power-1) var(--wiu-duration-lg);
      color: var(--wiu-color-fg-125);
    }
  
    button:hover:enabled > wiu-text,
    button:active:enabled > wiu-text {
      transition: all var(--wiu-ease-out-power-1) var(--wiu-duration-lg);
      color: var(--wiu-color-fg-125);
    }
  
    button {
      border-radius: var(--wiu-border-radius-3xl);
    }
  `;
  var hh = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let fc = class extends _e {
    constructor() {
      super(...arguments), this.tabs = [], this.onTabChange = () => null, this.buttons = [], this.disabled = !1, this.localTabWidth = "100px", this.activeTab = 0, this.isDense = !1
    }
    render() {
      return this.isDense = this.tabs.length > 3, this.style.cssText = `
        --local-tab: ${this.activeTab};
        --local-tab-width: ${this.localTabWidth};
      `, this.dataset.type = this.isDense ? "flex" : "block", this.tabs.map((e, r) => {
        const n = r === this.activeTab;
        return K`
          <button
            ?disabled=${this.disabled}
            @click=${()=>this.onTabClick(r)}
            data-active=${n}
            data-testid="tab-${e.label?.toLowerCase()}"
          >
            ${this.iconTemplate(e)}
            <wiu-text variant="small-600" color="inherit"> ${e.label} </wiu-text>
          </button>
        `
      })
    }
    firstUpdated() {
      this.shadowRoot && this.isDense && (this.buttons = [...this.shadowRoot.querySelectorAll("button")], setTimeout(() => {
        this.animateTabs(0, !0)
      }, 0))
    }
    iconTemplate(e) {
      return e.icon ? K`<wiu-icon size="xs" color="inherit" name=${e.icon}></wiu-icon>` : null
    }
    onTabClick(e) {
      this.buttons && this.animateTabs(e, !1), this.activeTab = e, this.onTabChange(e)
    }
    animateTabs(e, r) {
      const n = this.buttons[this.activeTab],
        i = this.buttons[e],
        s = n?.querySelector("wiu-text"),
        o = i?.querySelector("wiu-text"),
        a = i?.getBoundingClientRect(),
        c = o?.getBoundingClientRect();
      n && s && !r && e !== this.activeTab && (s.animate([{
        opacity: 0
      }], {
        duration: 50,
        easing: "ease",
        fill: "forwards"
      }), n.animate([{
        width: "34px"
      }], {
        duration: 500,
        easing: "ease",
        fill: "forwards"
      })), i && a && c && o && (e !== this.activeTab || r) && (this.localTabWidth = `${Math.round(a.width+c.width)+6}px`, i.animate([{
        width: `${a.width+c.width}px`
      }], {
        duration: r ? 0 : 500,
        fill: "forwards",
        easing: "ease"
      }), o.animate([{
        opacity: 1
      }], {
        duration: r ? 0 : 125,
        delay: r ? 0 : 200,
        fill: "forwards",
        easing: "ease"
      }))
    }
  };
  fc.styles = [ft, ir, bue], hh([re({
    type: Array
  })], fc.prototype, "tabs", void 0), hh([re()], fc.prototype, "onTabChange", void 0), hh([re({
    type: Array
  })], fc.prototype, "buttons", void 0), hh([re({
    type: Boolean
  })], fc.prototype, "disabled", void 0), hh([re()], fc.prototype, "localTabWidth", void 0), hh([le()], fc.prototype, "activeTab", void 0), hh([le()], fc.prototype, "isDense", void 0), fc = hh([ye("wiu-tabs")], fc);
  const yue = Re`
    :host {
      display: block;
    }
  
    :host > button {
      gap: var(--wiu-spacing-xxs);
      padding: var(--wiu-spacing-xs);
      padding-right: var(--wiu-spacing-1xs);
      height: 40px;
      border-radius: var(--wiu-border-radius-l);
      background: var(--wiu-color-gray-glass-002);
      border-width: 0px;
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-002);
    }
  
    :host > button wiu-image {
      width: 24px;
      height: 24px;
      border-radius: var(--wiu-border-radius-s);
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-010);
    }
  `;
  var Ox = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let j1 = class extends _e {
    constructor() {
      super(...arguments), this.text = ""
    }
    render() {
      return K`
        <button ontouchstart>
          ${this.tokenTemplate()}
          <wiu-text variant="paragraph-600" color="fg-100">${this.text}</wiu-text>
        </button>
      `
    }
    tokenTemplate() {
      return this.imageSrc ? K`<wiu-image src=${this.imageSrc}></wiu-image>` : K`
        <wiu-icon-box
          size="sm"
          iconColor="fg-200"
          backgroundColor="fg-300"
          icon="networkPlaceholder"
        ></wiu-icon-box>
      `
    }
  };
  j1.styles = [ft, ir, yue], Ox([re()], j1.prototype, "imageSrc", void 0), Ox([re()], j1.prototype, "text", void 0), j1 = Ox([ye("wiu-token-button")], j1);
  const _ue = Re`
    :host {
      display: block;
      padding: 9px var(--wiu-spacing-s) 10px var(--wiu-spacing-s);
      border-radius: var(--wiu-border-radius-xxs);
  
      color: var(--wiu-color-bg-100);
      position: relative;
    }
  
    :host([data-variant='shade']) {
      background-color: var(--wiu-color-bg-150);
      border: 1px solid var(--wiu-color-gray-glass-005);
    }
  
    :host([data-variant='shade']) > wiu-text {
      color: var(--wiu-color-fg-150);
    }
  
    :host([data-variant='fill']) {
      background-color: var(--wiu-color-fg-100);
      border: none;
    }
  
    wiu-icon {
      position: absolute;
      width: 12px !important;
      height: 4px !important;
    }
  
    wiu-icon[data-placement='top'] {
      bottom: 0px;
      left: 50%;
      transform: translate(-50%, 95%);
    }
  
    wiu-icon[data-placement='bottom'] {
      top: 0;
      left: 50%;
      transform: translate(-50%, -95%) rotate(180deg);
    }
  
    wiu-icon[data-placement='right'] {
      top: 50%;
      left: 0;
      transform: translate(-65%, -50%) rotate(90deg);
    }
  
    wiu-icon[data-placement='left'] {
      top: 50%;
      right: 0%;
      transform: translate(65%, -50%) rotate(270deg);
    }
  `;
  var d5 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Jf = class extends _e {
    constructor() {
      super(...arguments), this.placement = "top", this.variant = "fill", this.message = ""
    }
    render() {
      return this.dataset.variant = this.variant, K`<wiu-icon
          data-placement=${this.placement}
          color="fg-100"
          size="inherit"
          name=${this.variant==="fill"?"cursor":"cursorTransparent"}
        ></wiu-icon>
        <wiu-text color="inherit" variant="small-500">${this.message}</wiu-text>`
    }
  };
  Jf.styles = [ft, ir, _ue], d5([re()], Jf.prototype, "placement", void 0), d5([re()], Jf.prototype, "variant", void 0), d5([re()], Jf.prototype, "message", void 0), Jf = d5([ye("wiu-tooltip")], Jf);
  const xue = Re`
    :host {
      height: 60px;
      min-height: 60px;
    }
  
    :host > wiu-flex {
      cursor: pointer;
      height: 100%;
      display: flex;
      column-gap: var(--wiu-spacing-s);
      padding: var(--wiu-spacing-xs);
      padding-right: var(--wiu-spacing-l);
      width: 100%;
      background-color: transparent;
      border-radius: var(--wiu-border-radius-xs);
      color: var(--wiu-color-fg-250);
      transition:
        background-color var(--wiu-ease-out-power-1) var(--wiu-duration-lg),
        opacity var(--wiu-ease-out-power-1) var(--wiu-duration-lg);
      will-change: background-color, opacity;
    }
  
    @media (hover: hover) and (pointer: fine) {
      :host > wiu-flex:hover {
        background-color: var(--wiu-color-gray-glass-002);
      }
  
      :host > wiu-flex:active {
        background-color: var(--wiu-color-gray-glass-005);
      }
    }
  
    :host([disabled]) > wiu-flex {
      opacity: 0.6;
    }
  
    :host([disabled]) > wiu-flex:hover {
      background-color: transparent;
    }
  
    :host > wiu-flex > wiu-flex {
      flex: 1;
    }
  
    :host > wiu-flex > wiu-image,
    :host > wiu-flex > .token-item-image-placeholder {
      width: 40px;
      max-width: 40px;
      height: 40px;
      border-radius: var(--wiu-border-radius-3xl);
      position: relative;
    }
  
    :host > wiu-flex > .token-item-image-placeholder {
      display: flex;
      align-items: center;
      justify-content: center;
    }
  
    :host > wiu-flex > wiu-image::after,
    :host > wiu-flex > .token-item-image-placeholder::after {
      position: absolute;
      content: '';
      inset: 0;
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-010);
      border-radius: var(--wiu-border-radius-l);
    }
  
    button > wiu-icon-box[data-variant='square-blue'] {
      border-radius: var(--wiu-border-radius-3xs);
      position: relative;
      border: none;
      width: 36px;
      height: 36px;
    }
  `;
  var fh = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let pc = class extends _e {
    constructor() {
      super(), this.observer = new IntersectionObserver(() => {}), this.imageSrc = void 0, this.name = void 0, this.symbol = void 0, this.price = void 0, this.amount = void 0, this.visible = !1, this.imageError = !1, this.observer = new IntersectionObserver(e => {
        e.forEach(r => {
          r.isIntersecting ? this.visible = !0 : this.visible = !1
        })
      }, {
        threshold: .1
      })
    }
    firstUpdated() {
      this.observer.observe(this)
    }
    disconnectedCallback() {
      this.observer.disconnect()
    }
    render() {
      if (!this.visible) return null;
      const e = this.amount && this.price ? Or.multiply(this.price, this.amount)?.toFixed(3) : null;
      return K`
        <wiu-flex alignItems="center">
          ${this.visualTemplate()}
          <wiu-flex flexDirection="column" gap="3xs">
            <wiu-flex justifyContent="space-between">
              <wiu-text variant="paragraph-500" color="fg-100" lineClamp="1">${this.name}</wiu-text>
              ${e?K`
                    <wiu-text variant="paragraph-500" color="fg-100">
                      $${Vt.formatNumberToLocalString(e,3)}
                    </wiu-text>
                  `:null}
            </wiu-flex>
            <wiu-flex justifyContent="space-between">
              <wiu-text variant="small-400" color="fg-200" lineClamp="1">${this.symbol}</wiu-text>
              ${this.amount?K`<wiu-text variant="small-400" color="fg-200">
                    ${Vt.formatNumberToLocalString(this.amount,4)}
                  </wiu-text>`:null}
            </wiu-flex>
          </wiu-flex>
        </wiu-flex>
      `
    }
    visualTemplate() {
      return this.imageError ? K`<wiu-flex class="token-item-image-placeholder">
          <wiu-icon name="image" color="inherit"></wiu-icon>
        </wiu-flex>` : this.imageSrc ? K`<wiu-image
          width="40"
          height="40"
          src=${this.imageSrc}
          @onLoadError=${this.imageLoadError}
        ></wiu-image>` : null
    }
    imageLoadError() {
      this.imageError = !0
    }
  };
  pc.styles = [ft, ir, xue], fh([re()], pc.prototype, "imageSrc", void 0), fh([re()], pc.prototype, "name", void 0), fh([re()], pc.prototype, "symbol", void 0), fh([re()], pc.prototype, "price", void 0), fh([re()], pc.prototype, "amount", void 0), fh([le()], pc.prototype, "visible", void 0), fh([le()], pc.prototype, "imageError", void 0), pc = fh([ye("wiu-token-list-item")], pc);
  const Cue = Re`
    :host {
      display: flex;
      justify-content: center;
      align-items: center;
      width: var(--wiu-icon-box-size-xl);
      height: var(--wiu-icon-box-size-xl);
      box-shadow: 0 0 0 8px var(--wiu-thumbnail-border);
      border-radius: var(--local-border-radius);
      overflow: hidden;
    }
  
    wiu-icon {
      width: 32px;
      height: 32px;
    }
  `;
  var h5 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Xf = class extends _e {
    render() {
      return this.style.cssText = `--local-border-radius: ${this.borderRadiusFull?"1000px":"20px"}; background-color: var(--wiu-color-modal-bg);`, K`${this.templateVisual()}`
    }
    templateVisual() {
      return this.imageSrc ? K`<wiu-image src=${this.imageSrc} alt=${this.alt??""}></wiu-image>` : K`<wiu-icon
        data-parent-size="md"
        size="inherit"
        color="inherit"
        name="walletPlaceholder"
      ></wiu-icon>`
    }
  };
  Xf.styles = [ft, Cue], h5([re()], Xf.prototype, "imageSrc", void 0), h5([re()], Xf.prototype, "alt", void 0), h5([re({
    type: Boolean
  })], Xf.prototype, "borderRadiusFull", void 0), Xf = h5([ye("wiu-visual-thumbnail")], Xf);
  const Eue = Re`
    :host {
      display: block;
    }
  
    button {
      width: 100%;
      display: block;
      padding-top: var(--wiu-spacing-l);
      padding-bottom: var(--wiu-spacing-l);
      padding-left: var(--wiu-spacing-s);
      padding-right: var(--wiu-spacing-2l);
      border-radius: var(--wiu-border-radius-s);
      background-color: var(--wiu-color-accent-glass-010);
    }
  
    button:hover {
      background-color: var(--wiu-color-accent-glass-015) !important;
    }
  
    button:active {
      background-color: var(--wiu-color-accent-glass-020) !important;
    }
  `;
  var f5 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let e0 = class extends _e {
    constructor() {
      super(...arguments), this.label = "", this.description = "", this.icon = "wallet"
    }
    render() {
      return K`
        <button>
          <wiu-flex gap="m" alignItems="center" justifyContent="space-between">
            <wiu-icon-box
              size="lg"
              iconcolor="accent-100"
              backgroundcolor="accent-100"
              icon=${this.icon}
              background="transparent"
            ></wiu-icon-box>
  
            <wiu-flex flexDirection="column" gap="3xs">
              <wiu-text variant="paragraph-500" color="fg-100">${this.label}</wiu-text>
              <wiu-text variant="small-400" color="fg-200">${this.description}</wiu-text>
            </wiu-flex>
  
            <wiu-icon size="md" color="fg-200" name="chevronRight"></wiu-icon>
          </wiu-flex>
        </button>
      `
    }
  };
  e0.styles = [ft, ir, Eue], f5([re()], e0.prototype, "label", void 0), f5([re()], e0.prototype, "description", void 0), f5([re()], e0.prototype, "icon", void 0), e0 = f5([ye("wiu-notice-card")], e0);
  const Aue = Re`
    button {
      height: auto;
      position: relative;
      flex-direction: column;
      gap: var(--wiu-spacing-s);
      padding: 17px 18px 17px var(--wiu-spacing-m);
      width: 100%;
      background-color: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-xs);
      color: var(--wiu-color-fg-250);
    }
  
    .overflowedContent {
      width: 100%;
      overflow: hidden;
    }
  
    .overflowedContent[data-active='false']:after {
      content: '';
      position: absolute;
      top: 50%;
      left: 0;
      right: 0;
      bottom: 0;
      background: linear-gradient(to top, var(--wiu-color-bg-150), transparent);
      border-bottom-left-radius: var(--wiu-border-radius-xs);
      border-bottom-right-radius: var(--wiu-border-radius-xs);
    }
  
    .heightContent {
      max-height: 100px;
    }
  
    pre {
      text-align: left;
      white-space: pre-wrap;
      height: auto;
      overflow-x: auto;
      overflow-wrap: anywhere;
    }
  `;
  var Dx = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const Lx = 100;
  let F1 = class extends _e {
    constructor() {
      super(...arguments), this.textTitle = "", this.overflowedContent = "", this.toggled = !1, this.enableAccordion = !1, this.scrollElement = void 0, this.scrollHeightElement = 0
    }
    updated(e) {
      super.updated(e), (e.has("textTitle") || e.has("overflowedContent")) && setTimeout(() => {
        this.checkHeight()
      }, 1)
    }
    checkHeight() {
      this.updateComplete.then(() => {
        const e = this.shadowRoot?.querySelector(".heightContent"),
          r = this.shadowRoot?.querySelector(".textContent");
        if (e && r) {
          this.scrollElement = e;
          const n = r?.scrollHeight;
          n && n > Lx && (this.enableAccordion = !0, this.scrollHeightElement = n, this.requestUpdate())
        }
      })
    }
    render() {
      return K`
        <button ontouchstart @click=${()=>this.onClick()}>
          <wiu-flex justifyContent="space-between" alignItems="center">
            <wiu-text variant="paragraph-500" color="fg-100">${this.textTitle}</wiu-text>
            ${this.chevronTemplate()}
          </wiu-flex>
          <div
            data-active=${this.enableAccordion?!!this.toggled:!0}
            class="overflowedContent"
          >
            <div class="heightContent">
              <wiu-text class="textContent" variant="paragraph-400" color="fg-200">
                <pre>${this.overflowedContent}</pre>
              </wiu-text>
            </div>
          </div>
        </button>
      `
    }
    onClick() {
      const e = this.shadowRoot?.querySelector("wiu-icon");
      this.enableAccordion && (this.toggled = !this.toggled, this.requestUpdate(), this.scrollElement && this.scrollElement.animate([{
        maxHeight: this.toggled ? `${Lx}px` : `${this.scrollHeightElement}px`
      }, {
        maxHeight: this.toggled ? `${this.scrollHeightElement}px` : `${Lx}px`
      }], {
        duration: 300,
        fill: "forwards",
        easing: "ease"
      }), e && e.animate([{
        transform: this.toggled ? "rotate(0deg)" : "rotate(180deg)"
      }, {
        transform: this.toggled ? "rotate(180deg)" : "rotate(0deg)"
      }], {
        duration: 300,
        fill: "forwards",
        easing: "ease"
      }))
    }
    chevronTemplate() {
      return this.enableAccordion ? K` <wiu-icon color="fg-100" size="sm" name="chevronBottom"></wiu-icon>` : null
    }
  };
  F1.styles = [ft, ir, Aue], Dx([re()], F1.prototype, "textTitle", void 0), Dx([re()], F1.prototype, "overflowedContent", void 0), F1 = Dx([ye("wiu-list-accordion")], F1);
  const Sue = Re`
    :host {
      display: flex;
      column-gap: var(--wiu-spacing-s);
      padding: 17px 18px 17px var(--wiu-spacing-m);
      width: 100%;
      background-color: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-xs);
      color: var(--wiu-color-fg-250);
    }
  
    wiu-image {
      width: var(--wiu-icon-size-lg);
      height: var(--wiu-icon-size-lg);
      border-radius: var(--wiu-border-radius-3xl);
    }
  
    wiu-icon {
      width: var(--wiu-icon-size-lg);
      height: var(--wiu-icon-size-lg);
    }
  `;
  var p5 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let t0 = class extends _e {
    constructor() {
      super(...arguments), this.imageSrc = void 0, this.textTitle = "", this.textValue = void 0
    }
    render() {
      return K`
        <wiu-flex justifyContent="space-between" alignItems="center">
          <wiu-text variant="paragraph-500" color=${this.textValue?"fg-200":"fg-100"}>
            ${this.textTitle}
          </wiu-text>
          ${this.templateContent()}
        </wiu-flex>
      `
    }
    templateContent() {
      return this.imageSrc ? K`<wiu-image src=${this.imageSrc} alt=${this.textTitle}></wiu-image>` : this.textValue ? K` <wiu-text variant="paragraph-400" color="fg-100"> ${this.textValue} </wiu-text>` : K`<wiu-icon size="inherit" color="fg-200" name="networkPlaceholder"></wiu-icon>`
    }
  };
  t0.styles = [ft, ir, Sue], p5([re()], t0.prototype, "imageSrc", void 0), p5([re()], t0.prototype, "textTitle", void 0), p5([re()], t0.prototype, "textValue", void 0), t0 = p5([ye("wiu-list-content")], t0);
  const Iue = Re`
    button {
      column-gap: var(--wiu-spacing-s);
      padding: 7px var(--wiu-spacing-l) 7px var(--wiu-spacing-xs);
      width: 100%;
      transition: all var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      border-radius: var(--wiu-border-radius-xs);
      color: var(--wiu-color-fg-100);
    }
  
    button > wiu-text:nth-child(2) {
      display: flex;
      flex: 1;
    }
  
    button[data-transparent='true'] {
      pointer-events: none;
      background-color: transparent;
    }
  
    button:hover {
      background-color: var(--wiu-color-gray-glass-002);
    }
  
    button:active {
      background-color: var(--wiu-color-gray-glass-005);
    }
  
    wiu-image {
      width: var(--wiu-spacing-3xl);
      height: var(--wiu-spacing-3xl);
      border-radius: 100%;
    }
  
    button:disabled {
      background-color: var(--wiu-color-gray-glass-002);
      opacity: 0.5;
      cursor: not-allowed;
    }
  
    button:disabled > wiu-tag {
      background-color: var(--wiu-color-gray-glass-010);
      color: var(--wiu-color-fg-300);
    }
  `;
  var W1 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Lu = class extends _e {
    constructor() {
      super(...arguments), this.imageSrc = "", this.name = "", this.disabled = !1, this.selected = !1, this.transparent = !1
    }
    render() {
      return K`
        <button data-transparent=${this.transparent} ?disabled=${this.disabled} ontouchstart>
          <wiu-flex gap="s" alignItems="center">
            ${this.templateNetworkImage()}
            <wiu-text variant="paragraph-500" color="inherit">${this.name}</wiu-text></wiu-flex
          >
          ${this.checkmarkTemplate()}
        </button>
      `
    }
    checkmarkTemplate() {
      return this.selected ? K`<wiu-icon size="sm" color="accent-100" name="checkmarkBold"></wiu-icon>` : null
    }
    templateNetworkImage() {
      return this.imageSrc ? K`<wiu-image size="sm" src=${this.imageSrc} name=${this.name}></wiu-image>` : this.imageSrc ? null : K`<wiu-network-image
          ?round=${!0}
          size="md"
          name=${this.name}
        ></wiu-network-image>`
    }
  };
  Lu.styles = [ft, ir, Iue], W1([re()], Lu.prototype, "imageSrc", void 0), W1([re()], Lu.prototype, "name", void 0), W1([re({
    type: Boolean
  })], Lu.prototype, "disabled", void 0), W1([re({
    type: Boolean
  })], Lu.prototype, "selected", void 0), W1([re({
    type: Boolean
  })], Lu.prototype, "transparent", void 0), Lu = W1([ye("wiu-list-network")], Lu);
  const Tue = Re`
    :host {
      display: flex;
      flex-direction: column;
      gap: var(--wiu-spacing-l);
      padding: 17px 18px 17px var(--wiu-spacing-m);
      width: 100%;
      background-color: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-xs);
      color: var(--wiu-color-fg-250);
    }
  
    wiu-image {
      width: var(--wiu-icon-size-lg);
      height: var(--wiu-icon-size-lg);
      border-radius: var(--wiu-border-radius-3xl);
    }
  
    wiu-icon {
      width: var(--wiu-icon-size-lg);
      height: var(--wiu-icon-size-lg);
    }
  `;
  var z1 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Bu = class extends _e {
    constructor() {
      super(...arguments), this.amount = "", this.networkCurreny = "", this.networkImageUrl = "", this.receiverAddress = "", this.addressExplorerUrl = ""
    }
    render() {
      return K`
        <wiu-flex justifyContent="space-between" alignItems="center">
          <wiu-text variant="paragraph-500" color="fg-200">Sending</wiu-text>
          <wiu-flex gap="xs" alignItems="center">
            <wiu-text variant="paragraph-400" color="fg-100">
              ${this.amount} ${this.networkCurreny}
            </wiu-text>
            ${this.templateNetworkVisual()}
          </wiu-flex>
        </wiu-flex>
        <wiu-flex justifyContent="space-between" alignItems="center">
          <wiu-text variant="paragraph-500" color="fg-200">To</wiu-text>
          <wiu-chip
            icon="externalLink"
            variant="shadeSmall"
            href=${this.addressExplorerUrl}
            title=${this.receiverAddress}
          ></wiu-chip>
        </wiu-flex>
      `
    }
    templateNetworkVisual() {
      return this.networkImageUrl ? K`<wiu-image src=${this.networkImageUrl} alt="Network Image"></wiu-image>` : K`<wiu-icon size="inherit" color="fg-200" name="networkPlaceholder"></wiu-icon>`
    }
  };
  Bu.styles = [ft, ir, Tue], z1([re()], Bu.prototype, "amount", void 0), z1([re()], Bu.prototype, "networkCurreny", void 0), z1([re()], Bu.prototype, "networkImageUrl", void 0), z1([re()], Bu.prototype, "receiverAddress", void 0), z1([re()], Bu.prototype, "addressExplorerUrl", void 0), Bu = z1([ye("wiu-list-wallet-transaction")], Bu);
  const kue = Re`
    button {
      display: flex;
      gap: var(--wiu-spacing-3xs);
      align-items: center;
      padding: 6.25px var(--wiu-spacing-xs) 7.25px var(--wiu-spacing-s);
      background-color: var(--wiu-color-gray-glass-090);
      border-radius: var(--wiu-border-radius-3xl);
      border: 1px solid var(--wiu-color-gray-glass-060);
      transition: background-color var(--wiu-duration-md) var(--wiu-ease-inout-power-1);
      will-change: background-color;
    }
  
    @media (hover: hover) and (pointer: fine) {
      button:hover:enabled {
        background-color: var(--wiu-color-gray-glass-080);
      }
  
      button:active:enabled {
        background-color: var(--wiu-color-gray-glass-060);
      }
    }
  `;
  var s$ = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let R2 = class extends _e {
    constructor() {
      super(...arguments), this.text = ""
    }
    render() {
      return K`<button ontouchstart>
        <wiu-text variant="small-600" color="bg-100">${this.text}</wiu-text>
        <wiu-icon color="bg-100" size="xs" name="arrowRight"></wiu-icon>
      </button>`
    }
  };
  R2.styles = [ft, ir, kue], s$([re()], R2.prototype, "text", void 0), R2 = s$([ye("wiu-promo")], R2);
  const Rue = Re`
    span {
      font-weight: 500;
      font-size: 40px;
      color: var(--wiu-color-fg-100);
      line-height: 130%; /* 52px */
      letter-spacing: -1.6px;
      text-align: center;
    }
  
    .pennies {
      color: var(--wiu-color-fg-200);
    }
  `;
  var Bx = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let H1 = class extends _e {
    constructor() {
      super(...arguments), this.dollars = "0", this.pennies = "00"
    }
    render() {
      return K`<span>$${this.dollars}<span class="pennies">.${this.pennies}</span></span>`
    }
  };
  H1.styles = [ft, Rue], Bx([re()], H1.prototype, "dollars", void 0), Bx([re()], H1.prototype, "pennies", void 0), H1 = Bx([ye("wiu-balance")], H1);
  const Nue = Re`
    button {
      background-color: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-3xl);
      border: 1px solid var(--wiu-color-gray-glass-002);
      padding: var(--wiu-spacing-xs) var(--wiu-spacing-s) var(--wiu-spacing-xs) var(--wiu-spacing-xs);
      position: relative;
    }
  
    wiu-avatar {
      width: 32px;
      height: 32px;
      box-shadow: 0 0 0 0;
      outline: 3px solid var(--wiu-color-gray-glass-005);
    }
  
    wiu-icon-box,
    wiu-image {
      width: 16px;
      height: 16px;
      border-radius: var(--wiu-border-radius-3xl);
      position: absolute;
      left: 26px;
      top: 24px;
    }
  
    wiu-image {
      outline: 2px solid var(--wiu-color-bg-125);
    }
  
    wiu-icon-box {
      outline: 2px solid var(--wiu-color-bg-200);
      background-color: var(--wiu-color-bg-250);
    }
  `;
  var q1 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Uu = class extends _e {
    constructor() {
      super(...arguments), this.networkSrc = void 0, this.avatarSrc = void 0, this.profileName = "", this.address = "", this.icon = "chevronBottom"
    }
    render() {
      return K`<button ontouchstart data-testid="wiu-profile-button">
        <wiu-flex gap="xs" alignItems="center">
          <wiu-avatar
            .imageSrc=${this.avatarSrc}
            alt=${this.address}
            address=${this.address}
          ></wiu-avatar>
          ${this.networkImageTemplate()}
          <wiu-flex gap="xs" alignItems="center">
            <wiu-text variant="large-600" color="fg-100">
              ${Vt.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?18:4,charsEnd:this.profileName?0:4,truncate:this.profileName?"end":"middle"})}
            </wiu-text>
            <wiu-icon size="sm" color="fg-200" name=${this.icon}></wiu-icon>
          </wiu-flex>
        </wiu-flex>
      </button>`
    }
    networkImageTemplate() {
      return this.networkSrc ? K`<wiu-image src=${this.networkSrc}></wiu-image>` : K`
        <wiu-icon-box
          size="xxs"
          iconColor="fg-200"
          backgroundColor="bg-100"
          icon="networkPlaceholder"
        ></wiu-icon-box>
      `
    }
  };
  Uu.styles = [ft, ir, Nue], q1([re()], Uu.prototype, "networkSrc", void 0), q1([re()], Uu.prototype, "avatarSrc", void 0), q1([re()], Uu.prototype, "profileName", void 0), q1([re()], Uu.prototype, "address", void 0), q1([re()], Uu.prototype, "icon", void 0), Uu = q1([ye("wiu-profile-button")], Uu);
  const Mue = Re`
    button {
      background-color: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-3xl);
      border: 1px solid var(--wiu-color-gray-glass-002);
      padding: var(--wiu-spacing-xs) var(--wiu-spacing-s) var(--wiu-spacing-xs) var(--wiu-spacing-xs);
      position: relative;
    }
  
    wiu-avatar {
      width: 32px;
      height: 32px;
      box-shadow: 0 0 0 0;
      outline: 3px solid var(--wiu-color-gray-glass-005);
    }
  
    wiu-icon-box,
    wiu-image {
      width: 16px;
      height: 16px;
      border-radius: var(--wiu-border-radius-3xl);
      position: absolute;
      left: 26px;
      top: 24px;
    }
  
    wiu-image {
      outline: 2px solid var(--wiu-color-bg-125);
    }
  
    wiu-icon-box {
      outline: 2px solid var(--wiu-color-bg-200);
      background-color: var(--wiu-color-bg-250);
    }
  `;
  var r0 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let pl = class extends _e {
    constructor() {
      super(...arguments), this.avatarSrc = void 0, this.profileName = "", this.address = "", this.icon = "mail", this.connectedConnector = Ar.getConnectedConnector(), this.shouldShowIcon = this.connectedConnector === "AUTH"
    }
    render() {
      return K`<button ontouchstart data-testid="wiu-profile-button" @click=${this.handleClick}>
        <wiu-flex gap="xs" alignItems="center">
          <wiu-avatar
            .imageSrc=${this.avatarSrc}
            alt=${this.address}
            address=${this.address}
          ></wiu-avatar>
          ${this.shouldShowIcon?this.getIconTemplate(this.icon):""}
          <wiu-flex gap="xs" alignItems="center">
            <wiu-text variant="large-600" color="fg-100">
              ${Vt.getTruncateString({string:this.profileName||this.address,charsStart:this.profileName?18:4,charsEnd:this.profileName?0:4,truncate:this.profileName?"end":"middle"})}
            </wiu-text>
            <wiu-icon size="sm" color="fg-200" name="copy" id="copy-address"></wiu-icon>
          </wiu-flex>
        </wiu-flex>
      </button>`
    }
    handleClick(e) {
      if (e.target instanceof HTMLElement && e.target.id === "copy-address") {
        this.onCopyClick?.(e);
        return
      }
      this.onProfileClick?.(e)
    }
    getIconTemplate(e) {
      return K`
        <wiu-icon-box
          size="xxs"
          iconColor="fg-200"
          backgroundColor="bg-100"
          icon="${e||"networkPlaceholder"}"
        ></wiu-icon-box>
      `
    }
  };
  pl.styles = [ft, ir, Mue], r0([re()], pl.prototype, "avatarSrc", void 0), r0([re()], pl.prototype, "profileName", void 0), r0([re()], pl.prototype, "address", void 0), r0([re()], pl.prototype, "icon", void 0), r0([re()], pl.prototype, "onProfileClick", void 0), r0([re()], pl.prototype, "onCopyClick", void 0), pl = r0([ye("wiu-profile-button-v2")], pl);
  const Pue = Re`
    button {
      border: none;
      border-radius: var(--wiu-border-radius-3xl);
    }
  
    button[data-variant='main'] {
      background-color: var(--wiu-color-accent-100);
      color: var(--wiu-color-inverse-100);
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-010);
    }
  
    button[data-variant='accent'] {
      background-color: var(--wiu-color-accent-glass-010);
      color: var(--wiu-color-accent-100);
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-005);
    }
  
    button[data-variant='gray'] {
      background-color: transparent;
      color: var(--wiu-color-fg-200);
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-010);
    }
  
    button[data-variant='shade'] {
      background-color: transparent;
      color: var(--wiu-color-accent-100);
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-010);
    }
  
    button[data-size='sm'] {
      height: 32px;
      padding: 0 var(--wiu-spacing-s);
    }
  
    button[data-size='md'] {
      height: 40px;
      padding: 0 var(--wiu-spacing-l);
    }
  
    button[data-size='sm'] > wiu-image {
      width: 16px;
      height: 16px;
    }
  
    button[data-size='md'] > wiu-image {
      width: 24px;
      height: 24px;
    }
  
    button[data-size='sm'] > wiu-icon {
      width: 12px;
      height: 12px;
    }
  
    button[data-size='md'] > wiu-icon {
      width: 14px;
      height: 14px;
    }
  
    wiu-image {
      border-radius: var(--wiu-border-radius-3xl);
      overflow: hidden;
    }
  
    button.disabled > wiu-icon,
    button.disabled > wiu-image {
      filter: grayscale(1);
    }
  
    button[data-variant='main'] > wiu-image {
      box-shadow: inset 0 0 0 1px var(--wiu-color-accent-090);
    }
  
    button[data-variant='shade'] > wiu-image,
    button[data-variant='gray'] > wiu-image {
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-010);
    }
  
    @media (hover: hover) and (pointer: fine) {
      button[data-variant='main']:focus-visible {
        background-color: var(--wiu-color-accent-090);
      }
  
      button[data-variant='main']:hover:enabled {
        background-color: var(--wiu-color-accent-090);
      }
  
      button[data-variant='main']:active:enabled {
        background-color: var(--wiu-color-accent-080);
      }
  
      button[data-variant='accent']:hover:enabled {
        background-color: var(--wiu-color-accent-glass-015);
      }
  
      button[data-variant='accent']:active:enabled {
        background-color: var(--wiu-color-accent-glass-020);
      }
  
      button[data-variant='shade']:focus-visible,
      button[data-variant='gray']:focus-visible,
      button[data-variant='shade']:hover,
      button[data-variant='gray']:hover {
        background-color: var(--wiu-color-gray-glass-002);
      }
  
      button[data-variant='gray']:active,
      button[data-variant='shade']:active {
        background-color: var(--wiu-color-gray-glass-005);
      }
    }
  
    button.disabled {
      color: var(--wiu-color-gray-glass-020);
      background-color: var(--wiu-color-gray-glass-002);
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-002);
      pointer-events: none;
    }
  `;
  var n0 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let gl = class extends _e {
    constructor() {
      super(...arguments), this.variant = "accent", this.imageSrc = "", this.disabled = !1, this.icon = "externalLink", this.size = "md", this.text = ""
    }
    render() {
      const e = this.size === "sm" ? "small-600" : "paragraph-600";
      return K`
        <button
          class=${this.disabled?"disabled":""}
          data-variant=${this.variant}
          data-size=${this.size}
        >
          ${this.imageSrc?K`<wiu-image src=${this.imageSrc}></wiu-image>`:null}
          <wiu-text variant=${e} color="inherit"> ${this.text} </wiu-text>
          <wiu-icon name=${this.icon} color="inherit" size="inherit"></wiu-icon>
        </button>
      `
    }
  };
  gl.styles = [ft, ir, Pue], n0([re()], gl.prototype, "variant", void 0), n0([re()], gl.prototype, "imageSrc", void 0), n0([re({
    type: Boolean
  })], gl.prototype, "disabled", void 0), n0([re()], gl.prototype, "icon", void 0), n0([re()], gl.prototype, "size", void 0), n0([re()], gl.prototype, "text", void 0), gl = n0([ye("wiu-chip-button")], gl);
  const $ue = Re`
    button {
      display: flex;
      gap: var(--wiu-spacing-xl);
      width: 100%;
      background-color: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-xxs);
      padding: var(--wiu-spacing-m) var(--wiu-spacing-s);
    }
  
    wiu-text {
      width: 100%;
    }
  
    wiu-flex {
      width: auto;
    }
  
    .network-icon {
      width: var(--wiu-spacing-2l);
      height: var(--wiu-spacing-2l);
      border-radius: calc(var(--wiu-spacing-2l) / 2);
      overflow: hidden;
      box-shadow:
        0 0 0 3px var(--wiu-color-gray-glass-002),
        0 0 0 3px var(--wiu-color-modal-bg);
    }
  `;
  var Ux = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let V1 = class extends _e {
    constructor() {
      super(...arguments), this.networkImages = [""], this.text = ""
    }
    render() {
      return K`
        <button ontouchstart>
          <wiu-text variant="small-400" color="fg-200">${this.text}</wiu-text>
          <wiu-flex gap="3xs" alignItems="center">
            ${this.networksTemplate()}
            <wiu-icon name="chevronRight" size="sm" color="fg-200"></wiu-icon>
          </wiu-flex>
        </button>
      `
    }
    networksTemplate() {
      const e = this.networkImages.slice(0, 5);
      return K` <wiu-flex class="networks">
        ${e?.map(r=>K` <wiu-flex class="network-icon"> <wiu-image src=${r}></wiu-image> </wiu-flex>`)}
      </wiu-flex>`
    }
  };
  V1.styles = [ft, ir, $ue], Ux([re({
    type: Array
  })], V1.prototype, "networkImages", void 0), Ux([re()], V1.prototype, "text", void 0), V1 = Ux([ye("wiu-compatible-network")], V1);
  const Oue = Re`
    wiu-flex {
      width: 100%;
      background-color: var(--wiu-color-gray-glass-005);
      border-radius: var(--wiu-border-radius-s);
      padding: var(--wiu-spacing-1xs) var(--wiu-spacing-s) var(--wiu-spacing-1xs)
        var(--wiu-spacing-1xs);
    }
  `;
  var jx = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let K1 = class extends _e {
    constructor() {
      super(...arguments), this.icon = "externalLink", this.text = ""
    }
    render() {
      return K`
        <wiu-flex gap="1xs" alignItems="center">
          <wiu-icon-box
            size="sm"
            iconcolor="fg-200"
            backgroundcolor="fg-200"
            icon=${this.icon}
            background="transparent"
          ></wiu-icon-box>
          <wiu-text variant="small-400" color="fg-200">${this.text}</wiu-text>
        </wiu-flex>
      `
    }
  };
  K1.styles = [ft, ir, Oue], jx([re()], K1.prototype, "icon", void 0), jx([re()], K1.prototype, "text", void 0), K1 = jx([ye("wiu-banner")], K1);
  const Due = Re`
    wiu-flex {
      width: 100%;
      background-color: var(--wiu-color-gray-glass-005);
      border-radius: var(--wiu-border-radius-m);
      padding: var(--wiu-spacing-1xs) var(--wiu-spacing-s) var(--wiu-spacing-1xs)
        var(--wiu-spacing-1xs);
    }
  `;
  var g5 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let i0 = class extends _e {
    constructor() {
      super(...arguments), this.imageSrc = "", this.text = "", this.size = ""
    }
    render() {
      return K`
        <wiu-flex gap="1xs" alignItems="center">
          <wiu-avatar size=${this.size} imageSrc=${this.imageSrc}></wiu-avatar>
          <wiu-text variant="small-400" color="fg-200">${this.text}</wiu-text>
        </wiu-flex>
      `
    }
  };
  i0.styles = [ft, ir, Due], g5([re()], i0.prototype, "imageSrc", void 0), g5([re()], i0.prototype, "text", void 0), g5([re()], i0.prototype, "size", void 0), i0 = g5([ye("wiu-banner-img")], i0);
  const Lue = Re`
    button {
      padding: 6.5px var(--wiu-spacing-l) 6.5px var(--wiu-spacing-xs);
      display: flex;
      justify-content: space-between;
      width: 100%;
      border-radius: var(--wiu-border-radius-xs);
      background-color: var(--wiu-color-gray-glass-002);
    }
  
    button[data-clickable='false'] {
      pointer-events: none;
      background-color: transparent;
    }
  
    wiu-image,
    wiu-icon {
      width: var(--wiu-spacing-3xl);
      height: var(--wiu-spacing-3xl);
    }
  
    wiu-image {
      border-radius: var(--wiu-border-radius-3xl);
    }
  `;
  var s0 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let ml = class extends _e {
    constructor() {
      super(...arguments), this.tokenName = "", this.tokenImageUrl = "", this.tokenValue = 0, this.tokenAmount = "0.0", this.tokenCurrency = "", this.clickable = !1
    }
    render() {
      return K`
        <button data-clickable=${String(this.clickable)} ontouchstart>
          <wiu-flex gap="s" alignItems="center">
            ${this.visualTemplate()}
            <wiu-flex flexDirection="column" justifyContent="spaceBetween">
              <wiu-text variant="paragraph-500" color="fg-100">${this.tokenName}</wiu-text>
              <wiu-text variant="small-400" color="fg-200">
                ${Vt.formatNumberToLocalString(this.tokenAmount,4)} ${this.tokenCurrency}
              </wiu-text>
            </wiu-flex>
          </wiu-flex>
          <wiu-text variant="paragraph-500" color="fg-100">$${this.tokenValue.toFixed(2)}</wiu-text>
        </button>
      `
    }
    visualTemplate() {
      return this.tokenName && this.tokenImageUrl ? K`<wiu-image alt=${this.tokenName} src=${this.tokenImageUrl}></wiu-image>` : K`<wiu-icon name="coinPlaceholder" color="fg-100"></wiu-icon>`
    }
  };
  ml.styles = [ft, ir, Lue], s0([re()], ml.prototype, "tokenName", void 0), s0([re()], ml.prototype, "tokenImageUrl", void 0), s0([re({
    type: Number
  })], ml.prototype, "tokenValue", void 0), s0([re()], ml.prototype, "tokenAmount", void 0), s0([re()], ml.prototype, "tokenCurrency", void 0), s0([re({
    type: Boolean
  })], ml.prototype, "clickable", void 0), ml = s0([ye("wiu-list-token")], ml);
  const Bue = Re`
    button {
      width: 100%;
      display: flex;
      gap: var(--wiu-spacing-s);
      align-items: center;
      justify-content: flex-start;
      padding: var(--wiu-spacing-s) var(--wiu-spacing-m) var(--wiu-spacing-s) var(--wiu-spacing-s);
      background-color: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-xs);
    }
  
    wiu-icon-box {
      width: var(--wiu-spacing-2xl);
      height: var(--wiu-spacing-2xl);
    }
  
    wiu-flex {
      width: auto;
    }
  `;
  var ph = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let gc = class extends _e {
    constructor() {
      super(...arguments), this.icon = "card", this.text = "", this.description = "", this.tag = void 0, this.iconBackgroundColor = "accent-100", this.iconColor = "accent-100", this.disabled = !1
    }
    render() {
      return K`
        <button ontouchstart ?disabled=${this.disabled}>
          <wiu-icon-box
            iconColor=${this.iconColor}
            backgroundColor=${this.iconBackgroundColor}
            size="inherit"
            icon=${this.icon}
            iconSize="md"
          ></wiu-icon-box>
          <wiu-flex flexDirection="column" justifyContent="spaceBetween">
            ${this.titleTemplate()}
            <wiu-text variant="small-400" color="fg-200"> ${this.description}</wiu-text></wiu-flex
          >
        </button>
      `
    }
    titleTemplate() {
      return this.tag ? K` <wiu-flex alignItems="center" gap="xxs"
          ><wiu-text variant="paragraph-500" color="fg-100">${this.text}</wiu-text
          ><wiu-tag tagType="main" size="md">${this.tag}</wiu-tag>
        </wiu-flex>` : K`<wiu-text variant="paragraph-500" color="fg-100">${this.text}</wiu-text>`
    }
  };
  gc.styles = [ft, ir, Bue], ph([re()], gc.prototype, "icon", void 0), ph([re()], gc.prototype, "text", void 0), ph([re()], gc.prototype, "description", void 0), ph([re()], gc.prototype, "tag", void 0), ph([re()], gc.prototype, "iconBackgroundColor", void 0), ph([re()], gc.prototype, "iconColor", void 0), ph([re({
    type: Boolean
  })], gc.prototype, "disabled", void 0), gc = ph([ye("wiu-list-description")], gc);
  const Uue = Re`
    :host {
      position: relative;
      display: inline-block;
    }
  
    input {
      background: transparent;
      width: 100%;
      height: auto;
      font-family: var(--wiu-font-family);
      color: var(--wiu-color-fg-100);
  
      font-feature-settings: 'case' on;
      font-size: 32px;
      font-weight: var(--wiu-font-weight-light);
      caret-color: var(--wiu-color-accent-100);
      line-height: 130%;
      letter-spacing: -1.28px;
      box-sizing: border-box;
      -webkit-appearance: none;
      -moz-appearance: textfield;
      padding: 0px;
    }
  
    input::-webkit-outer-spin-button,
    input::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }
  
    input::placeholder {
      color: var(--wiu-color-fg-275);
    }
  `,
    jue = /[.*+?^${}()|[\]\\]/gu,
    Fue = /[0-9,.]/u;
  var m5 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let o0 = class extends _e {
    constructor() {
      super(...arguments), this.inputElementRef = cl(), this.disabled = !1, this.value = "", this.placeholder = "0"
    }
    render() {
      return this.inputElementRef?.value && this.value && (this.inputElementRef.value.value = this.value), K`<input
        ${ll(this.inputElementRef)}
        type="text"
        inputmode="decimal"
        pattern="[0-9,.]*"
        placeholder=${this.placeholder}
        ?disabled=${this.disabled}
        autofocus
        value=${this.value??""}
        @input=${this.dispatchInputChangeEvent.bind(this)}
      /> `
    }
    dispatchInputChangeEvent(e) {
      const r = e.data;
      if (r && this.inputElementRef?.value)
        if (r === ",") {
          const n = this.inputElementRef.value.value.replace(",", ".");
          this.inputElementRef.value.value = n, this.value = `${this.value}${n}`
        } else Fue.test(r) || (this.inputElementRef.value.value = this.value.replace(new RegExp(r.replace(jue, "\\$&"), "gu"), ""));
      this.dispatchEvent(new CustomEvent("inputChange", {
        detail: this.inputElementRef.value?.value,
        bubbles: !0,
        composed: !0
      }))
    }
  };
  o0.styles = [ft, ir, Uue], m5([re({
    type: Boolean
  })], o0.prototype, "disabled", void 0), m5([re({
    type: String
  })], o0.prototype, "value", void 0), m5([re({
    type: String
  })], o0.prototype, "placeholder", void 0), o0 = m5([ye("wiu-input-amount")], o0);
  const Wue = Re`
    :host {
      display: flex;
      gap: var(--wiu-spacing-xs);
      border-radius: var(--wiu-border-radius-3xl);
      border: 1px solid var(--wiu-color-gray-glass-002);
      background: var(--wiu-color-gray-glass-002);
      padding: var(--wiu-spacing-2xs) var(--wiu-spacing-xs) var(--wiu-spacing-2xs)
        var(--wiu-spacing-s);
      align-items: center;
    }
  
    wiu-avatar,
    wiu-icon,
    wiu-image {
      width: 32px;
      height: 32px;
      border: 1px solid var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-3xl);
      box-shadow: 0 0 0 2px var(--wiu-color-gray-glass-002);
    }
  `;
  var N2 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let gh = class extends _e {
    constructor() {
      super(...arguments), this.text = "", this.address = "", this.isAddress = !1
    }
    render() {
      return K`<wiu-text variant="large-500" color="fg-100">${this.text}</wiu-text>
        ${this.imageTemplate()}`
    }
    imageTemplate() {
      return this.isAddress ? K`<wiu-avatar address=${this.address} .imageSrc=${this.imageSrc}></wiu-avatar>` : this.imageSrc ? K`<wiu-image src=${this.imageSrc}></wiu-image>` : K`<wiu-icon size="inherit" color="fg-200" name="networkPlaceholder"></wiu-icon>`
    }
  };
  gh.styles = [ft, ir, Wue], N2([re()], gh.prototype, "text", void 0), N2([re()], gh.prototype, "address", void 0), N2([re()], gh.prototype, "imageSrc", void 0), N2([re({
    type: Boolean
  })], gh.prototype, "isAddress", void 0), gh = N2([ye("wiu-preview-item")], gh);
  const zue = Re`
    button {
      padding: 6.5px var(--wiu-spacing-l) 6.5px var(--wiu-spacing-xs);
      display: flex;
      justify-content: space-between;
      width: 100%;
      border-radius: var(--wiu-border-radius-xs);
      background-color: var(--wiu-color-gray-glass-002);
    }
  
    button[data-clickable='false'] {
      pointer-events: none;
      background-color: transparent;
    }
  
    wiu-image {
      width: var(--wiu-spacing-3xl);
      height: var(--wiu-spacing-3xl);
      border-radius: var(--wiu-border-radius-3xl);
    }
  
    wiu-avatar {
      width: var(--wiu-spacing-3xl);
      height: var(--wiu-spacing-3xl);
      box-shadow: 0 0 0 0;
    }
    .address {
      color: var(--wiu-color-fg-base-100);
    }
    .address-description {
      text-transform: capitalize;
      color: var(--wiu-color-fg-base-200);
    }
  
    wiu-icon-box {
      position: relative;
      right: 15px;
      top: 15px;
      border: 2px solid var(--wiu-color-bg-150);
      background-color: var(--wiu-color-bg-125);
    }
  `;
  var M2 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let mh = class extends _e {
    constructor() {
      super(...arguments), this.accountAddress = "", this.accountType = "", this.connectedConnector = Ar.getConnectedConnector(), this.labels = ke.state.addressLabels, this.caipNetwork = fe.state.activeCaipNetwork, this.socialProvider = Ar.getConnectedSocialProvider(), this.balance = 0, this.fetchingBalance = !0, this.shouldShowIcon = !1, this.selected = !1
    }
    connectedCallback() {
      super.connectedCallback(), An.getBalance(this.accountAddress, this.caipNetwork?.caipNetworkId).then(e => {
        let r = this.balance;
        e.balances.length > 0 && (r = e.balances.reduce((n, i) => n + (i?.value || 0), 0)), this.balance = r, this.fetchingBalance = !1, this.requestUpdate()
      }).catch(() => {
        this.fetchingBalance = !1, this.requestUpdate()
      })
    }
    render() {
      const e = this.getLabel();
      return this.shouldShowIcon = this.connectedConnector === "AUTH", K`
        <wiu-flex
          flexDirection="row"
          justifyContent="space-between"
          .padding=${["0","0","s","1xs"]}
        >
          <wiu-flex gap="md" alignItems="center">
            <wiu-avatar address=${this.accountAddress}></wiu-avatar>
            ${this.shouldShowIcon?K`<wiu-icon-box
                  size="sm"
                  iconcolor="fg-200"
                  backgroundcolor="fg-300"
                  icon=${this.accountType===nr.ACCOUNT_TYPES.EOA?this.socialProvider??"mail":"lightbulb"}
                  background="fg-300"
                ></wiu-icon-box>`:K`<wiu-flex .padding="${["0","0","0","s"]}"></wiu-flex>`}
            <wiu-flex flexDirection="column">
              <wiu-text class="address" variant="paragraph-500" color="fg-100"
                >${Vt.getTruncateString({string:this.accountAddress,charsStart:4,charsEnd:6,truncate:"middle"})}</wiu-text
              >
              <wiu-text class="address-description" variant="small-400">${e}</wiu-text></wiu-flex
            >
          </wiu-flex>
          <wiu-flex gap="s" alignItems="center">
            <slot name="action"></slot>
            ${this.fetchingBalance?K`<wiu-loading-spinner size="sm" color="accent-100"></wiu-loading-spinner>`:K` <wiu-text variant="small-400">$${this.balance.toFixed(2)}</wiu-text>`}
          </wiu-flex>
        </wiu-flex>
      `
    }
    getLabel() {
      let e = this.labels?.get(this.accountAddress);
      return !e && this.connectedConnector === "AUTH" ? e = `${this.accountType==="eoa"?this.socialProvider??"Email":"Smart"} Account` : !e && this.connectedConnector === "INJECTED" || this.connectedConnector === "ANNOUNCED" ? e = "Injected Account" : e || (e = "EOA"), e
    }
  };
  mh.styles = [ft, ir, zue], M2([re()], mh.prototype, "accountAddress", void 0), M2([re()], mh.prototype, "accountType", void 0), M2([re({
    type: Boolean
  })], mh.prototype, "selected", void 0), M2([re({
    type: Function
  })], mh.prototype, "onSelect", void 0), mh = M2([ye("wiu-list-account")], mh);
  const Hue = Re`
    :host {
      position: relative;
    }
  
    button {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 48px;
      width: 100%;
      background-color: var(--wiu-color-accent-glass-010);
      border-radius: var(--wiu-border-radius-xs);
      border: 1px solid var(--wiu-color-accent-glass-010);
      transition: background-color var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: background-color;
    }
  
    wiu-tooltip {
      padding: 7px var(--wiu-spacing-s) 8px var(--wiu-spacing-s);
      position: absolute;
      top: -8px;
      left: 50%;
      transform: translate(-50%, -100%);
      opacity: 0;
      display: none;
    }
  
    @media (hover: hover) and (pointer: fine) {
      button:hover:enabled {
        background-color: var(--wiu-color-accent-glass-015);
      }
  
      button:active:enabled {
        background-color: var(--wiu-color-accent-glass-020);
      }
    }
  `;
  var Fx = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let G1 = class extends _e {
    constructor() {
      super(...arguments), this.text = "", this.icon = "card"
    }
    render() {
      return K`<button>
        <wiu-icon color="accent-100" name=${this.icon} size="lg"></wiu-icon>
      </button>`
    }
  };
  G1.styles = [ft, ir, Hue], Fx([re()], G1.prototype, "text", void 0), Fx([re()], G1.prototype, "icon", void 0), G1 = Fx([ye("wiu-icon-button")], G1);
  const que = Re`
    button {
      column-gap: var(--wiu-spacing-s);
      padding: 16.5px var(--wiu-spacing-l) 16.5px var(--wiu-spacing-xs);
      width: 100%;
      background-color: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-xs);
      color: var(--wiu-color-fg-100);
      justify-content: center;
      align-items: center;
    }
  
    button:disabled {
      background-color: var(--wiu-color-gray-glass-015);
      color: var(--wiu-color-gray-glass-015);
    }
  `;
  var w5 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let a0 = class extends _e {
    constructor() {
      super(...arguments), this.text = "", this.disabled = !1, this.tabIdx = void 0
    }
    render() {
      return K`
        <button ?disabled=${this.disabled} tabindex=${$e(this.tabIdx)} ontouchstart>
          <wiu-text align="center" variant="paragraph-500" color="inherit">${this.text}</wiu-text>
        </button>
      `
    }
  };
  a0.styles = [ft, ir, que], w5([re()], a0.prototype, "text", void 0), w5([re({
    type: Boolean
  })], a0.prototype, "disabled", void 0), w5([re()], a0.prototype, "tabIdx", void 0), a0 = w5([ye("wiu-list-button")], a0);
  const Vue = Re`
    button {
      column-gap: var(--wiu-spacing-s);
      padding: 7px var(--wiu-spacing-l) 7px var(--wiu-spacing-xs);
      width: 100%;
      justify-content: flex-start;
      background-color: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-xs);
      color: var(--wiu-color-fg-100);
    }
  
    wiu-text {
      text-transform: capitalize;
    }
  
    wiu-text[data-align='left'] {
      display: flex;
      flex: 1;
    }
  
    wiu-text[data-align='center'] {
      display: flex;
      flex: 1;
      justify-content: center;
    }
  
    .invisible {
      opacity: 0;
      pointer-events: none;
    }
  
    button:disabled {
      background-color: var(--wiu-color-gray-glass-015);
      color: var(--wiu-color-gray-glass-015);
    }
  `;
  var Z1 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let ju = class extends _e {
    constructor() {
      super(...arguments), this.logo = "google", this.name = "Continue with google", this.align = "left", this.disabled = !1
    }
    render() {
      return K`
        <button ?disabled=${this.disabled} tabindex=${$e(this.tabIdx)} ontouchstart>
          <wiu-logo logo=${this.logo}></wiu-logo>
          <wiu-text
            data-align=${this.align}
            variant="paragraph-500"
            color="inherit"
            align=${this.align}
            >${this.name}</wiu-text
          >
          ${this.templatePlacement()}
        </button>
      `
    }
    templatePlacement() {
      return this.align === "center" ? K` <wiu-logo class="invisible" logo=${this.logo}></wiu-logo>` : null
    }
  };
  ju.styles = [ft, ir, Vue], Z1([re()], ju.prototype, "logo", void 0), Z1([re()], ju.prototype, "name", void 0), Z1([re()], ju.prototype, "align", void 0), Z1([re()], ju.prototype, "tabIdx", void 0), Z1([re({
    type: Boolean
  })], ju.prototype, "disabled", void 0), ju = Z1([ye("wiu-list-social")], ju);
  const Kue = Re`
    button {
      display: block;
      display: flex;
      align-items: center;
      padding: var(--wiu-spacing-xxs);
      gap: var(--wiu-spacing-xxs);
      transition: all var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      border-radius: var(--wiu-border-radius-xxs);
    }
  
    wiu-image {
      border-radius: 100%;
      width: var(--wiu-spacing-xl);
      height: var(--wiu-spacing-xl);
    }
  
    wiu-icon-box {
      width: var(--wiu-spacing-xl);
      height: var(--wiu-spacing-xl);
    }
  
    button:hover {
      background-color: var(--wiu-color-gray-glass-002);
    }
  
    button:active {
      background-color: var(--wiu-color-gray-glass-005);
    }
  `;
  var o$ = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let P2 = class extends _e {
    constructor() {
      super(...arguments), this.imageSrc = ""
    }
    render() {
      return K`<button>
        ${this.imageTemplate()}
        <wiu-icon size="xs" color="fg-200" name="chevronBottom"></wiu-icon>
      </button>`
    }
    imageTemplate() {
      return this.imageSrc ? K`<wiu-image src=${this.imageSrc} alt="select visual"></wiu-image>` : K`<wiu-icon-box
        size="xxs"
        iconColor="fg-200"
        backgroundColor="fg-100"
        background="opaque"
        icon="networkPlaceholder"
      ></wiu-icon-box>`
    }
  };
  P2.styles = [ft, ir, d2, Kue], o$([re()], P2.prototype, "imageSrc", void 0), P2 = o$([ye("wiu-select")], P2);
  const Gue = Re`
    label {
      display: flex;
      align-items: center;
      cursor: pointer;
      -webkit-user-select: none;
      -moz-user-select: none;
      -ms-user-select: none;
      user-select: none;
      column-gap: var(--wiu-spacing-1xs);
    }
  
    label > input[type='checkbox'] {
      height: 0;
      width: 0;
      opacity: 0;
      pointer-events: none;
      position: absolute;
    }
  
    label > span {
      width: var(--wiu-spacing-xl);
      height: var(--wiu-spacing-xl);
      min-width: var(--wiu-spacing-xl);
      min-height: var(--wiu-spacing-xl);
      border-radius: var(--wiu-border-radius-3xs);
      border-width: 1px;
      border-style: solid;
      border-color: var(--wiu-color-gray-glass-010);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background-color var(--wiu-ease-out-power-1) var(--wiu-duration-lg);
      will-change: background-color;
    }
  
    label > span:hover,
    label > input[type='checkbox']:focus-visible + span {
      background-color: var(--wiu-color-gray-glass-010);
    }
  
    label input[type='checkbox']:checked + span {
      background-color: var(--wiu-color-blue-base-90);
    }
  
    label > span > wiu-icon {
      opacity: 0;
      transition: opacity var(--wiu-ease-out-power-1) var(--wiu-duration-lg);
      will-change: opacity;
    }
  
    label > input[type='checkbox']:checked + span wiu-icon {
      opacity: 1;
    }
  `;
  var a$ = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let $2 = class extends _e {
    constructor() {
      super(...arguments), this.inputElementRef = cl(), this.checked = void 0
    }
    render() {
      return K`
        <label>
          <input
            ${ll(this.inputElementRef)}
            ?checked=${$e(this.checked)}
            type="checkbox"
            @change=${this.dispatchChangeEvent}
          />
          <span>
            <wiu-icon name="checkmarkBold" color="inverse-100" size="xxs"></wiu-icon>
          </span>
          <slot></slot>
        </label>
      `
    }
    dispatchChangeEvent() {
      this.dispatchEvent(new CustomEvent("checkboxChange", {
        detail: this.inputElementRef.value?.checked,
        bubbles: !0,
        composed: !0
      }))
    }
  };
  $2.styles = [ft, Gue], a$([re({
    type: Boolean
  })], $2.prototype, "checked", void 0), $2 = a$([ye("wiu-checkbox")], $2);
  const Zue = Re`
    :host {
      display: flex;
      align-items: center;
      justify-content: center;
    }
  
    label {
      position: relative;
      display: inline-block;
      width: 32px;
      height: 22px;
    }
  
    input {
      width: 0;
      height: 0;
      opacity: 0;
    }
  
    span {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: var(--wiu-color-blue-100);
      border-width: 1px;
      border-style: solid;
      border-color: var(--wiu-color-gray-glass-002);
      border-radius: 999px;
      transition:
        background-color var(--wiu-ease-inout-power-1) var(--wiu-duration-md),
        border-color var(--wiu-ease-inout-power-1) var(--wiu-duration-md);
      will-change: background-color, border-color;
    }
  
    span:before {
      position: absolute;
      content: '';
      height: 16px;
      width: 16px;
      left: 3px;
      top: 2px;
      background-color: var(--wiu-color-inverse-100);
      transition: transform var(--wiu-ease-inout-power-1) var(--wiu-duration-lg);
      will-change: transform;
      border-radius: 50%;
    }
  
    input:checked + span {
      border-color: var(--wiu-color-gray-glass-005);
      background-color: var(--wiu-color-blue-100);
    }
  
    input:not(:checked) + span {
      background-color: var(--wiu-color-gray-glass-010);
    }
  
    input:checked + span:before {
      transform: translateX(calc(100% - 7px));
    }
  `;
  var c$ = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let O2 = class extends _e {
    constructor() {
      super(...arguments), this.inputElementRef = cl(), this.checked = void 0
    }
    render() {
      return K`
        <label>
          <input
            ${ll(this.inputElementRef)}
            type="checkbox"
            ?checked=${$e(this.checked)}
            @change=${this.dispatchChangeEvent.bind(this)}
          />
          <span></span>
        </label>
      `
    }
    dispatchChangeEvent() {
      this.dispatchEvent(new CustomEvent("switchChange", {
        detail: this.inputElementRef.value?.checked,
        bubbles: !0,
        composed: !0
      }))
    }
  };
  O2.styles = [ft, ir, d2, Zue], c$([re({
    type: Boolean
  })], O2.prototype, "checked", void 0), O2 = c$([ye("wiu-switch")], O2);
  const Yue = Re`
    :host {
      height: 100%;
    }
  
    button {
      display: flex;
      align-items: center;
      justify-content: center;
      column-gap: var(--wiu-spacing-1xs);
      padding: var(--wiu-spacing-xs) var(--wiu-spacing-s);
      background-color: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-xs);
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-002);
      transition: background-color var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: background-color;
      cursor: pointer;
    }
  
    wiu-switch {
      pointer-events: none;
    }
  `;
  var l$ = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let D2 = class extends _e {
    constructor() {
      super(...arguments), this.checked = void 0
    }
    render() {
      return K`
        <button>
          <wiu-icon size="xl" name="walletConnectBrown"></wiu-icon>
          <wiu-switch ?checked=${$e(this.checked)}></wiu-switch>
        </button>
      `
    }
  };
  D2.styles = [ft, ir, Yue], l$([re({
    type: Boolean
  })], D2.prototype, "checked", void 0), D2 = l$([ye("wiu-certified-switch")], D2);
  const Que = Re`
    :host {
      display: grid;
      width: inherit;
      height: inherit;
    }
  `;
  var ma = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Ps = class extends _e {
    render() {
      return this.style.cssText = `
        grid-template-rows: ${this.gridTemplateRows};
        grid-template-columns: ${this.gridTemplateColumns};
        justify-items: ${this.justifyItems};
        align-items: ${this.alignItems};
        justify-content: ${this.justifyContent};
        align-content: ${this.alignContent};
        column-gap: ${this.columnGap&&`var(--wiu-spacing-${this.columnGap})`};
        row-gap: ${this.rowGap&&`var(--wiu-spacing-${this.rowGap})`};
        gap: ${this.gap&&`var(--wiu-spacing-${this.gap})`};
        padding-top: ${this.padding&&Vt.getSpacingStyles(this.padding,0)};
        padding-right: ${this.padding&&Vt.getSpacingStyles(this.padding,1)};
        padding-bottom: ${this.padding&&Vt.getSpacingStyles(this.padding,2)};
        padding-left: ${this.padding&&Vt.getSpacingStyles(this.padding,3)};
        margin-top: ${this.margin&&Vt.getSpacingStyles(this.margin,0)};
        margin-right: ${this.margin&&Vt.getSpacingStyles(this.margin,1)};
        margin-bottom: ${this.margin&&Vt.getSpacingStyles(this.margin,2)};
        margin-left: ${this.margin&&Vt.getSpacingStyles(this.margin,3)};
      `, K`<slot></slot>`
    }
  };
  Ps.styles = [ft, Que], ma([re()], Ps.prototype, "gridTemplateRows", void 0), ma([re()], Ps.prototype, "gridTemplateColumns", void 0), ma([re()], Ps.prototype, "justifyItems", void 0), ma([re()], Ps.prototype, "alignItems", void 0), ma([re()], Ps.prototype, "justifyContent", void 0), ma([re()], Ps.prototype, "alignContent", void 0), ma([re()], Ps.prototype, "columnGap", void 0), ma([re()], Ps.prototype, "rowGap", void 0), ma([re()], Ps.prototype, "gap", void 0), ma([re()], Ps.prototype, "padding", void 0), ma([re()], Ps.prototype, "margin", void 0), Ps = ma([ye("wiu-grid")], Ps);
  const Jue = Re`
    :host {
      position: relative;
      display: flex;
      width: 100%;
      height: 1px;
      background-color: var(--wiu-color-gray-glass-005);
      justify-content: center;
      align-items: center;
    }
  
    :host > wiu-text {
      position: absolute;
      padding: 0px 10px;
      background-color: var(--wiu-color-modal-bg);
    }
  `;
  var u$ = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let L2 = class extends _e {
    constructor() {
      super(...arguments), this.text = ""
    }
    render() {
      return K`${this.template()}`
    }
    template() {
      return this.text ? K`<wiu-text variant="small-500" color="fg-200">${this.text}</wiu-text>` : null
    }
  };
  L2.styles = [ft, Jue], u$([re()], L2.prototype, "text", void 0), L2 = u$([ye("wiu-separator")], L2);
  const c0 = {
      interpolate(t, e, r) {
        if (t.length !== 2 || e.length !== 2) throw new Error("inputRange and outputRange must be an array of length 2");
        const n = t[0] || 0,
          i = t[1] || 0,
          s = e[0] || 0,
          o = e[1] || 0;
        return r < n ? s : r > i ? o : (o - s) / (i - n) * (r - n) + s
      }
    },
    Xue = 3,
    ede = ["receive", "deposit", "borrow", "claim"],
    tde = ["withdraw", "repay", "burn"],
    wh = {
      getMonthName(t) {
        const e = new Date;
        return e.setMonth(t), e.toLocaleString("en-US", {
          month: "long"
        })
      },
      getTransactionGroupTitle(t, e) {
        const r = P9.getYear(),
          n = this.getMonthName(e);
        return t === r ? n : `${n} ${t}`
      },
      getTransactionImages(t) {
        const [e, r] = t, n = !!e && t?.every(o => !!o.nft_info), i = t?.length > 1;
        return t?.length === 2 && !n ? [this.getTransactionImage(e), this.getTransactionImage(r)] : i ? t.map(o => this.getTransactionImage(o)) : [this.getTransactionImage(e)]
      },
      getTransactionImage(t) {
        return {
          type: wh.getTransactionTransferTokenType(t),
          url: wh.getTransactionImageURL(t)
        }
      },
      getTransactionImageURL(t) {
        let e;
        const r = !!t?.nft_info,
          n = !!t?.fungible_info;
        return t && r ? e = t?.nft_info?.content?.preview?.url : t && n && (e = t?.fungible_info?.icon?.url), e
      },
      getTransactionTransferTokenType(t) {
        if (t?.fungible_info) return "FUNGIBLE";
        if (t?.nft_info) return "NFT"
      },
      getTransactionDescriptions(t) {
        const e = t?.metadata?.operationType,
          r = t?.transfers,
          n = t?.transfers?.length > 0,
          i = t?.transfers?.length > 1,
          s = n && r?.every(f => !!f?.fungible_info),
          [o, a] = r;
        let c = this.getTransferDescription(o),
          l = this.getTransferDescription(a);
        if (!n) return (e === "send" || e === "receive") && s ? (c = Vt.getTruncateString({
          string: t?.metadata.sentFrom,
          charsStart: 4,
          charsEnd: 6,
          truncate: "middle"
        }), l = Vt.getTruncateString({
          string: t?.metadata.sentTo,
          charsStart: 4,
          charsEnd: 6,
          truncate: "middle"
        }), [c, l]) : [t.metadata.status];
        if (i) return r.map(f => this.getTransferDescription(f));
        let h = "";
        return ede.includes(e) ? h = "+" : tde.includes(e) && (h = "-"), c = h.concat(c), [c]
      },
      getTransferDescription(t) {
        let e = "";
        return t && (t?.nft_info ? e = t?.nft_info?.name || "-" : t?.fungible_info && (e = this.getFungibleTransferDescription(t) || "-")), e
      },
      getFungibleTransferDescription(t) {
        return t ? [this.getQuantityFixedValue(t?.quantity.numeric), t?.fungible_info?.symbol].join(" ").trim() : null
      },
      getQuantityFixedValue(t) {
        return t ? parseFloat(t).toFixed(Xue) : null
      }
    },
    rde = Object.freeze(Object.defineProperty({
      __proto__: null,
      MathUtil: c0,
      TransactionUtil: wh,
      UiHelperUtil: Vt,
      get WuiAccountButton() {
        return $o
      },
      get WuiAlertBar() {
        return dh
      },
      get WuiAllWalletsImage() {
        return w2
      },
      get WuiAvatar() {
        return ih
      },
      get WuiBalance() {
        return H1
      },
      get WuiBanner() {
        return K1
      },
      get WuiBannerImg() {
        return i0
      },
      get WuiButton() {
        return Oo
      },
      get WuiCard() {
        return Hy
      },
      get WuiCardSelect() {
        return al
      },
      get WuiCardSelectLoader() {
        return v2
      },
      get WuiCertifiedSwitch() {
        return D2
      },
      get WuiCheckBox() {
        return $2
      },
      get WuiChip() {
        return pa
      },
      get WuiChipButton() {
        return gl
      },
      get WuiCompatibleNetwork() {
        return V1
      },
      get WuiConnectButton() {
        return N1
      },
      get WuiCtaButton() {
        return qf
      },
      get WuiDetailsGroup() {
        return Zy
      },
      get WuiDetailsGroupItem() {
        return b2
      },
      get WuiDropdownMenu() {
        return M1
      },
      get WuiEmailInput() {
        return sh
      },
      get WuiEnsInput() {
        return oh
      },
      get WuiFlex() {
        return _s
      },
      get WuiGrid() {
        return Ps
      },
      get WuiIcon() {
        return jf
      },
      get WuiIconBox() {
        return fa
      },
      get WuiIconButton() {
        return G1
      },
      get WuiIconLink() {
        return ah
      },
      get WuiImage() {
        return Ff
      },
      get WuiInputAmount() {
        return o0
      },
      get WuiInputElement() {
        return E2
      },
      get WuiInputNumeric() {
        return P1
      },
      get WuiInputText() {
        return Do
      },
      get WuiLink() {
        return Vf
      },
      get WuiListAccordion() {
        return F1
      },
      get WuiListAccount() {
        return mh
      },
      get WuiListButton() {
        return a0
      },
      get WuiListContent() {
        return t0
      },
      get WuiListDescription() {
        return gc
      },
      get WuiListItem() {
        return ao
      },
      get WuiListNetwork() {
        return Lu
      },
      get WuiListSocial() {
        return ju
      },
      get WuiListToken() {
        return ml
      },
      get WuiListWallet() {
        return Ms
      },
      get WuiListWalletTransaction() {
        return Bu
      },
      get WuiLoadingHexagon() {
        return Ky
      },
      get WuiLoadingSpinner() {
        return k1
      },
      get WuiLoadingThumbnail() {
        return h2
      },
      get WuiLogo() {
        return A2
      },
      get WuiLogoSelect() {
        return Gf
      },
      get WuiNetworkButton() {
        return Zf
      },
      get WuiNetworkImage() {
        return ol
      },
      get WuiNoticeCard() {
        return e0
      },
      get WuiOtp() {
        return Yf
      },
      get WuiPreviewItem() {
        return gh
      },
      get WuiProfileButton() {
        return Uu
      },
      get WuiProfileButtonV2() {
        return pl
      },
      get WuiPromo() {
        return R2
      },
      get WuiQrCode() {
        return hc
      },
      get WuiSearchBar() {
        return u5
      },
      get WuiSelect() {
        return P2
      },
      get WuiSeparator() {
        return L2
      },
      get WuiShimmer() {
        return rh
      },
      get WuiSnackbar() {
        return fl
      },
      get WuiSwitch() {
        return O2
      },
      get WuiTabs() {
        return fc
      },
      get WuiTag() {
        return $1
      },
      get WuiText() {
        return nh
      },
      get WuiTokenButton() {
        return j1
      },
      get WuiTokenListItem() {
        return pc
      },
      get WuiTooltip() {
        return Jf
      },
      get WuiTransactionListItem() {
        return co
      },
      get WuiTransactionListItemLoader() {
        return Jy
      },
      get WuiTransactionVisual() {
        return dl
      },
      get WuiVisual() {
        return R1
      },
      get WuiVisualThumbnail() {
        return Xf
      },
      get WuiWalletImage() {
        return il
      },
      customElement: ye,
      initializeTheming: EP,
      setColorTheme: ux,
      setThemeVariables: AP,
      swapInputMaskBottomSvg: Coe,
      swapInputMaskTopSvg: Eoe
    }, Symbol.toStringTag, {
      value: "Module"
    })),
    mr = {
      WALLET_CONNECT_CONNECTOR_ID: "walletConnect",
      INJECTED_CONNECTOR_ID: "injected",
      WALLET_STANDARD_CONNECTOR_ID: "announced",
      COINBASE_CONNECTOR_ID: "coinbaseWallet",
      COINBASE_SDK_CONNECTOR_ID: "coinbaseWalletSDK",
      SAFE_CONNECTOR_ID: "safe",
      LEDGER_CONNECTOR_ID: "ledger",
      EIP6963_CONNECTOR_ID: "eip6963",
      AUTH_CONNECTOR_ID: "w3mAuth",
      EIP155: "eip155",
      ADD_CHAIN_METHOD: "wallet_addEthereumChain",
      EIP6963_ANNOUNCE_EVENT: "eip6963:announceProvider",
      EIP6963_REQUEST_EVENT: "eip6963:requestProvider",
      CONNECTOR_RDNS_MAP: {
        coinbaseWallet: "com.coinbase.wallet",
        coinbaseWalletSDK: "com.coinbase.wallet"
      }
    },
    Fu = {
      ConnectorExplorerIds: {
        [mr.COINBASE_CONNECTOR_ID]: "fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",
        [mr.COINBASE_SDK_CONNECTOR_ID]: "fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa",
        [mr.SAFE_CONNECTOR_ID]: "225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",
        [mr.LEDGER_CONNECTOR_ID]: "19177a98252e07ddfc9af2083ba8e07ef627cb6103467ffebb3f8f4205fd7927"
      },
      NetworkImageIds: {
        1: "ba0ba0cd-17c6-4806-ad93-f9d174f17900",
        42161: "3bff954d-5cb0-47a0-9a23-d20192e74600",
        43114: "30c46e53-e989-45fb-4549-be3bd4eb3b00",
        56: "93564157-2e8e-4ce7-81df-b264dbee9b00",
        250: "06b26297-fe0c-4733-5d6b-ffa5498aac00",
        10: "ab9c186a-c52f-464b-2906-ca59d760a400",
        137: "41d04d42-da3b-4453-8506-668cc0727900",
        100: "02b53f6a-e3d4-479e-1cb4-21178987d100",
        9001: "f926ff41-260d-4028-635e-91913fc28e00",
        324: "b310f07f-4ef7-49f3-7073-2a0a39685800",
        314: "5a73b3dd-af74-424e-cae0-0de859ee9400",
        4689: "34e68754-e536-40da-c153-6ef2e7188a00",
        1088: "3897a66d-40b9-4833-162f-a2c90531c900",
        1284: "161038da-44ae-4ec7-1208-0ea569454b00",
        1285: "f1d73bb6-5450-4e18-38f7-fb6484264a00",
        7777777: "845c60df-d429-4991-e687-91ae45791600",
        42220: "ab781bbc-ccc6-418d-d32d-789b15da1f00",
        8453: "7289c336-3981-4081-c5f4-efc26ac64a00",
        1313161554: "3ff73439-a619-4894-9262-4470c773a100",
        2020: "b8101fc0-9c19-4b6f-ec65-f6dfff106e00",
        2021: "b8101fc0-9c19-4b6f-ec65-f6dfff106e00",
        "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp": "a1b58899-f671-4276-6a5e-56ca5bd59700",
        "4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z": "a1b58899-f671-4276-6a5e-56ca5bd59700",
        EtWTRABZaYq6iMfeYKouRu166VU2xqa1: "a1b58899-f671-4276-6a5e-56ca5bd59700"
      },
      ConnectorImageIds: {
        [mr.COINBASE_CONNECTOR_ID]: "0c2840c3-5b04-4c44-9661-fbd4b49e1800",
        [mr.COINBASE_SDK_CONNECTOR_ID]: "0c2840c3-5b04-4c44-9661-fbd4b49e1800",
        [mr.SAFE_CONNECTOR_ID]: "461db637-8616-43ce-035a-d89b8a1d5800",
        [mr.LEDGER_CONNECTOR_ID]: "54a1aa77-d202-4f8d-0fb2-5d2bb6db0300",
        [mr.WALLET_CONNECT_CONNECTOR_ID]: "ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400",
        [mr.INJECTED_CONNECTOR_ID]: "07ba87ed-43aa-4adf-4540-9e6a2b9cae00"
      },
      ConnectorNamesMap: {
        [mr.INJECTED_CONNECTOR_ID]: "Browser Wallet",
        [mr.WALLET_CONNECT_CONNECTOR_ID]: "WalletConnect",
        [mr.COINBASE_CONNECTOR_ID]: "Coinbase",
        [mr.COINBASE_SDK_CONNECTOR_ID]: "Coinbase",
        [mr.LEDGER_CONNECTOR_ID]: "Ledger",
        [mr.SAFE_CONNECTOR_ID]: "Safe"
      },
      ConnectorTypesMap: {
        [mr.INJECTED_CONNECTOR_ID]: "INJECTED",
        [mr.WALLET_CONNECT_CONNECTOR_ID]: "WALLET_CONNECT",
        [mr.EIP6963_CONNECTOR_ID]: "ANNOUNCED",
        [mr.AUTH_CONNECTOR_ID]: "AUTH"
      },
      WalletConnectRpcChainIds: [1, 5, 11155111, 10, 420, 42161, 421613, 137, 80001, 42220, 1313161554, 1313161555, 56, 97, 43114, 43113, 100, 8453, 84531, 7777777, 999, 324, 280]
    },
    d$ = {
      getCaipTokens(t) {
        if (!t) return;
        const e = {};
        return Object.entries(t).forEach(([r, n]) => {
          e[`${mr.EIP155}:${r}`] = n
        }), e
      }
    },
    Y1 = {
      UniversalProviderErrors: {
        UNAUTHORIZED_DOMAIN_NOT_ALLOWED: {
          message: "Unauthorized: origin not allowed",
          alertErrorKey: "INVALID_APP_CONFIGURATION"
        },
        JWT_VALIDATION_ERROR: {
          message: "JWT validation error: JWT Token is not yet valid",
          alertErrorKey: "JWT_TOKEN_NOT_VALID"
        }
      },
      ALERT_ERRORS: {
        SWITCH_NETWORK_NOT_FOUND: {
          shortMessage: "Network Not Found",
          longMessage: "Network not found - please make sure it is included in 'networks' array in createAppKit function"
        },
        INVALID_APP_CONFIGURATION: {
          shortMessage: "Invalid App Configuration",
          longMessage: () => `Origin ${nde()?window.origin:"unknown"} not found on Allowlist - update configuration on cloud.reown.com`
        },
        SOCIALS_TIMEOUT: {
          shortMessage: "Invalid App Configuration",
          longMessage: () => "There was an issue loading the embedded wallet. Please verify that your domain is allowed at cloud.reown.com"
        },
        JWT_TOKEN_NOT_VALID: {
          shortMessage: "Session Expired",
          longMessage: "Invalid session found on UniversalProvider - please check your time settings and connect again"
        },
        PROJECT_ID_NOT_CONFIGURED: {
          shortMessage: "Project ID Not Configured",
          longMessage: "Project ID Not Configured - update configuration on cloud.reown.com"
        }
      }
    };

  function nde() {
    return typeof window < "u"
  }
  const ide = {
      createLogger(t, e = "error") {
        const r = y1({
            level: e
          }),
          {
            logger: n
          } = Y9({
            opts: r
          });
        return n.error = (...i) => {
          for (const s of i)
            if (s instanceof Error) {
              t(s, ...i);
              return
            } t(void 0, ...i)
        }, n
      }
    },
    sde = "rpc.walletconnect.org";

  function ode(t, e) {
    const r = new URL("https://rpc.walletconnect.org/v1/");
    return r.searchParams.set("chainId", t), r.searchParams.set("projectId", e), r.toString()
  }
  const h$ = ["near:mainnet", "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp", "eip155:1101", "eip155:56", "eip155:42161", "eip155:7777777", "eip155:59144", "eip155:324", "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1", "eip155:5000", "solana:4sgjmw1sunhzsxgspuhpqldx6wiyjntz", "eip155:80084", "eip155:5003", "eip155:100", "eip155:8453", "eip155:42220", "eip155:1313161555", "eip155:17000", "eip155:1", "eip155:300", "eip155:1313161554", "eip155:1329", "eip155:84532", "eip155:421614", "eip155:11155111", "eip155:8217", "eip155:43114", "solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z", "eip155:999999999", "eip155:11155420", "eip155:80002", "eip155:97", "eip155:43113", "eip155:137", "eip155:10", "eip155:1301"],
    B2 = {
      extendRpcUrlWithProjectId(t, e) {
        let r = !1;
        try {
          r = new URL(t).host === sde
        } catch {
          r = !1
        }
        if (r) {
          const n = new URL(t);
          return n.searchParams.has("projectId") || n.searchParams.set("projectId", e), n.toString()
        }
        return t
      },
      isCaipNetwork(t) {
        return "chainNamespace" in t && "caipNetworkId" in t
      },
      getChainNamespace(t) {
        return this.isCaipNetwork(t) ? t.chainNamespace : pr.CHAIN.EVM
      },
      getCaipNetworkId(t) {
        return this.isCaipNetwork(t) ? t.caipNetworkId : `${pr.CHAIN.EVM}:${t.id}`
      },
      getRpcUrl(t, e, r) {
        const n = t.rpcUrls?.default?.http?.[0];
        return h$.includes(e) ? ode(e, r) : n || ""
      },
      extendCaipNetwork(t, {
        customNetworkImageUrls: e,
        projectId: r
      }) {
        const n = this.getCaipNetworkId(t),
          i = this.getChainNamespace(t),
          s = this.getRpcUrl(t, n, r);
        return {
          ...t,
          chainNamespace: i,
          caipNetworkId: n,
          assets: {
            imageId: Fu.NetworkImageIds[t.id],
            imageUrl: e?.[t.id]
          },
          rpcUrls: {
            ...t.rpcUrls,
            default: {
              http: [s]
            }
          }
        }
      },
      extendCaipNetworks(t, {
        customNetworkImageUrls: e,
        projectId: r
      }) {
        return t.map(n => B2.extendCaipNetwork(n, {
          customNetworkImageUrls: e,
          projectId: r
        }))
      },
      getViemTransport(t) {
        const e = t.rpcUrls.default.http?.[0];
        return h$.includes(t.caipNetworkId) ? _te([iy(e, {
          fetchOptions: {
            headers: {
              "Content-Type": "text/plain"
            }
          }
        }), iy(e)]) : iy(e)
      }
    };
  var v5;
  (function (t) {
    t.Google = "google", t.Github = "github", t.Apple = "apple", t.Facebook = "facebook", t.X = "x", t.Discord = "discord", t.Farcaster = "farcaster"
  })(v5 || (v5 = {}));
  var Wx = {
      exports: {}
    },
    Q1 = typeof Reflect == "object" ? Reflect : null,
    f$ = Q1 && typeof Q1.apply == "function" ? Q1.apply : function (e, r, n) {
      return Function.prototype.apply.call(e, r, n)
    },
    b5;
  Q1 && typeof Q1.ownKeys == "function" ? b5 = Q1.ownKeys : Object.getOwnPropertySymbols ? b5 = function (e) {
    return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))
  } : b5 = function (e) {
    return Object.getOwnPropertyNames(e)
  };

  function ade(t) {
    console && console.warn && console.warn(t)
  }
  var p$ = Number.isNaN || function (e) {
    return e !== e
  };

  function an() {
    an.init.call(this)
  }
  Wx.exports = an, Wx.exports.once = dde, an.EventEmitter = an, an.prototype._events = void 0, an.prototype._eventsCount = 0, an.prototype._maxListeners = void 0;
  var g$ = 10;

  function y5(t) {
    if (typeof t != "function") throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t)
  }
  Object.defineProperty(an, "defaultMaxListeners", {
    enumerable: !0,
    get: function () {
      return g$
    },
    set: function (t) {
      if (typeof t != "number" || t < 0 || p$(t)) throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + ".");
      g$ = t
    }
  }), an.init = function () {
    (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0
  }, an.prototype.setMaxListeners = function (e) {
    if (typeof e != "number" || e < 0 || p$(e)) throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e + ".");
    return this._maxListeners = e, this
  };

  function m$(t) {
    return t._maxListeners === void 0 ? an.defaultMaxListeners : t._maxListeners
  }
  an.prototype.getMaxListeners = function () {
    return m$(this)
  }, an.prototype.emit = function (e) {
    for (var r = [], n = 1; n < arguments.length; n++) r.push(arguments[n]);
    var i = e === "error",
      s = this._events;
    if (s !== void 0) i = i && s.error === void 0;
    else if (!i) return !1;
    if (i) {
      var o;
      if (r.length > 0 && (o = r[0]), o instanceof Error) throw o;
      var a = new Error("Unhandled error." + (o ? " (" + o.message + ")" : ""));
      throw a.context = o, a
    }
    var c = s[e];
    if (c === void 0) return !1;
    if (typeof c == "function") f$(c, this, r);
    else
      for (var l = c.length, h = _$(c, l), n = 0; n < l; ++n) f$(h[n], this, r);
    return !0
  };

  function w$(t, e, r, n) {
    var i, s, o;
    if (y5(r), s = t._events, s === void 0 ? (s = t._events = Object.create(null), t._eventsCount = 0) : (s.newListener !== void 0 && (t.emit("newListener", e, r.listener ? r.listener : r), s = t._events), o = s[e]), o === void 0) o = s[e] = r, ++t._eventsCount;
    else if (typeof o == "function" ? o = s[e] = n ? [r, o] : [o, r] : n ? o.unshift(r) : o.push(r), i = m$(t), i > 0 && o.length > i && !o.warned) {
      o.warned = !0;
      var a = new Error("Possible EventEmitter memory leak detected. " + o.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
      a.name = "MaxListenersExceededWarning", a.emitter = t, a.type = e, a.count = o.length, ade(a)
    }
    return t
  }
  an.prototype.addListener = function (e, r) {
    return w$(this, e, r, !1)
  }, an.prototype.on = an.prototype.addListener, an.prototype.prependListener = function (e, r) {
    return w$(this, e, r, !0)
  };

  function cde() {
    if (!this.fired) return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments)
  }

  function v$(t, e, r) {
    var n = {
        fired: !1,
        wrapFn: void 0,
        target: t,
        type: e,
        listener: r
      },
      i = cde.bind(n);
    return i.listener = r, n.wrapFn = i, i
  }
  an.prototype.once = function (e, r) {
    return y5(r), this.on(e, v$(this, e, r)), this
  }, an.prototype.prependOnceListener = function (e, r) {
    return y5(r), this.prependListener(e, v$(this, e, r)), this
  }, an.prototype.removeListener = function (e, r) {
    var n, i, s, o, a;
    if (y5(r), i = this._events, i === void 0) return this;
    if (n = i[e], n === void 0) return this;
    if (n === r || n.listener === r) --this._eventsCount === 0 ? this._events = Object.create(null) : (delete i[e], i.removeListener && this.emit("removeListener", e, n.listener || r));
    else if (typeof n != "function") {
      for (s = -1, o = n.length - 1; o >= 0; o--)
        if (n[o] === r || n[o].listener === r) {
          a = n[o].listener, s = o;
          break
        } if (s < 0) return this;
      s === 0 ? n.shift() : lde(n, s), n.length === 1 && (i[e] = n[0]), i.removeListener !== void 0 && this.emit("removeListener", e, a || r)
    }
    return this
  }, an.prototype.off = an.prototype.removeListener, an.prototype.removeAllListeners = function (e) {
    var r, n, i;
    if (n = this._events, n === void 0) return this;
    if (n.removeListener === void 0) return arguments.length === 0 ? (this._events = Object.create(null), this._eventsCount = 0) : n[e] !== void 0 && (--this._eventsCount === 0 ? this._events = Object.create(null) : delete n[e]), this;
    if (arguments.length === 0) {
      var s = Object.keys(n),
        o;
      for (i = 0; i < s.length; ++i) o = s[i], o !== "removeListener" && this.removeAllListeners(o);
      return this.removeAllListeners("removeListener"), this._events = Object.create(null), this._eventsCount = 0, this
    }
    if (r = n[e], typeof r == "function") this.removeListener(e, r);
    else if (r !== void 0)
      for (i = r.length - 1; i >= 0; i--) this.removeListener(e, r[i]);
    return this
  };

  function b$(t, e, r) {
    var n = t._events;
    if (n === void 0) return [];
    var i = n[e];
    return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ? ude(i) : _$(i, i.length)
  }
  an.prototype.listeners = function (e) {
    return b$(this, e, !0)
  }, an.prototype.rawListeners = function (e) {
    return b$(this, e, !1)
  }, an.listenerCount = function (t, e) {
    return typeof t.listenerCount == "function" ? t.listenerCount(e) : y$.call(t, e)
  }, an.prototype.listenerCount = y$;

  function y$(t) {
    var e = this._events;
    if (e !== void 0) {
      var r = e[t];
      if (typeof r == "function") return 1;
      if (r !== void 0) return r.length
    }
    return 0
  }
  an.prototype.eventNames = function () {
    return this._eventsCount > 0 ? b5(this._events) : []
  };

  function _$(t, e) {
    for (var r = new Array(e), n = 0; n < e; ++n) r[n] = t[n];
    return r
  }

  function lde(t, e) {
    for (; e + 1 < t.length; e++) t[e] = t[e + 1];
    t.pop()
  }

  function ude(t) {
    for (var e = new Array(t.length), r = 0; r < e.length; ++r) e[r] = t[r].listener || t[r];
    return e
  }

  function dde(t, e) {
    return new Promise(function (r, n) {
      function i(o) {
        t.removeListener(e, s), n(o)
      }

      function s() {
        typeof t.removeListener == "function" && t.removeListener("error", i), r([].slice.call(arguments))
      }
      x$(t, e, s, {
        once: !0
      }), e !== "error" && hde(t, i, {
        once: !0
      })
    })
  }

  function hde(t, e, r) {
    typeof t.on == "function" && x$(t, "error", e, r)
  }

  function x$(t, e, r, n) {
    if (typeof t.on == "function") n.once ? t.once(e, r) : t.on(e, r);
    else if (typeof t.addEventListener == "function") t.addEventListener(e, function i(s) {
      n.once && t.removeEventListener(e, i), r(s)
    });
    else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof t)
  }
  var Fi = Wx.exports;
  const zx = Za(Fi);
  var at = {};
  /*! *****************************************************************************
      Copyright (c) Microsoft Corporation.
    
      Permission to use, copy, modify, and/or distribute this software for any
      purpose with or without fee is hereby granted.
    
      THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
      REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
      AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
      INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
      LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
      OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
      PERFORMANCE OF THIS SOFTWARE.
      ***************************************************************************** */
  var Hx = function (t, e) {
    return Hx = Object.setPrototypeOf || {
      __proto__: []
    }
    instanceof Array && function (r, n) {
      r.__proto__ = n
    } || function (r, n) {
      for (var i in n) n.hasOwnProperty(i) && (r[i] = n[i])
    }, Hx(t, e)
  };

  function fde(t, e) {
    Hx(t, e);

    function r() {
      this.constructor = t
    }
    t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r)
  }
  var qx = function () {
    return qx = Object.assign || function (e) {
      for (var r, n = 1, i = arguments.length; n < i; n++) {
        r = arguments[n];
        for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && (e[s] = r[s])
      }
      return e
    }, qx.apply(this, arguments)
  };

  function pde(t, e) {
    var r = {};
    for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
    if (t != null && typeof Object.getOwnPropertySymbols == "function")
      for (var i = 0, n = Object.getOwnPropertySymbols(t); i < n.length; i++) e.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[i]) && (r[n[i]] = t[n[i]]);
    return r
  }

  function gde(t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  }

  function mde(t, e) {
    return function (r, n) {
      e(r, n, t)
    }
  }

  function wde(t, e) {
    if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(t, e)
  }

  function vde(t, e, r, n) {
    function i(s) {
      return s instanceof r ? s : new r(function (o) {
        o(s)
      })
    }
    return new(r || (r = Promise))(function (s, o) {
      function a(h) {
        try {
          l(n.next(h))
        } catch (f) {
          o(f)
        }
      }

      function c(h) {
        try {
          l(n.throw(h))
        } catch (f) {
          o(f)
        }
      }

      function l(h) {
        h.done ? s(h.value) : i(h.value).then(a, c)
      }
      l((n = n.apply(t, e || [])).next())
    })
  }

  function bde(t, e) {
    var r = {
        label: 0,
        sent: function () {
          if (s[0] & 1) throw s[1];
          return s[1]
        },
        trys: [],
        ops: []
      },
      n, i, s, o;
    return o = {
      next: a(0),
      throw: a(1),
      return: a(2)
    }, typeof Symbol == "function" && (o[Symbol.iterator] = function () {
      return this
    }), o;

    function a(l) {
      return function (h) {
        return c([l, h])
      }
    }

    function c(l) {
      if (n) throw new TypeError("Generator is already executing.");
      for (; r;) try {
        if (n = 1, i && (s = l[0] & 2 ? i.return : l[0] ? i.throw || ((s = i.return) && s.call(i), 0) : i.next) && !(s = s.call(i, l[1])).done) return s;
        switch (i = 0, s && (l = [l[0] & 2, s.value]), l[0]) {
          case 0:
          case 1:
            s = l;
            break;
          case 4:
            return r.label++, {
              value: l[1],
              done: !1
            };
          case 5:
            r.label++, i = l[1], l = [0];
            continue;
          case 7:
            l = r.ops.pop(), r.trys.pop();
            continue;
          default:
            if (s = r.trys, !(s = s.length > 0 && s[s.length - 1]) && (l[0] === 6 || l[0] === 2)) {
              r = 0;
              continue
            }
            if (l[0] === 3 && (!s || l[1] > s[0] && l[1] < s[3])) {
              r.label = l[1];
              break
            }
            if (l[0] === 6 && r.label < s[1]) {
              r.label = s[1], s = l;
              break
            }
            if (s && r.label < s[2]) {
              r.label = s[2], r.ops.push(l);
              break
            }
            s[2] && r.ops.pop(), r.trys.pop();
            continue
        }
        l = e.call(t, r)
      } catch (h) {
        l = [6, h], i = 0
      } finally {
        n = s = 0
      }
      if (l[0] & 5) throw l[1];
      return {
        value: l[0] ? l[1] : void 0,
        done: !0
      }
    }
  }

  function yde(t, e, r, n) {
    n === void 0 && (n = r), t[n] = e[r]
  }

  function _de(t, e) {
    for (var r in t) r !== "default" && !e.hasOwnProperty(r) && (e[r] = t[r])
  }

  function Vx(t) {
    var e = typeof Symbol == "function" && Symbol.iterator,
      r = e && t[e],
      n = 0;
    if (r) return r.call(t);
    if (t && typeof t.length == "number") return {
      next: function () {
        return t && n >= t.length && (t = void 0), {
          value: t && t[n++],
          done: !t
        }
      }
    };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
  }

  function C$(t, e) {
    var r = typeof Symbol == "function" && t[Symbol.iterator];
    if (!r) return t;
    var n = r.call(t),
      i, s = [],
      o;
    try {
      for (;
        (e === void 0 || e-- > 0) && !(i = n.next()).done;) s.push(i.value)
    } catch (a) {
      o = {
        error: a
      }
    } finally {
      try {
        i && !i.done && (r = n.return) && r.call(n)
      } finally {
        if (o) throw o.error
      }
    }
    return s
  }

  function xde() {
    for (var t = [], e = 0; e < arguments.length; e++) t = t.concat(C$(arguments[e]));
    return t
  }

  function Cde() {
    for (var t = 0, e = 0, r = arguments.length; e < r; e++) t += arguments[e].length;
    for (var n = Array(t), i = 0, e = 0; e < r; e++)
      for (var s = arguments[e], o = 0, a = s.length; o < a; o++, i++) n[i] = s[o];
    return n
  }

  function U2(t) {
    return this instanceof U2 ? (this.v = t, this) : new U2(t)
  }

  function Ede(t, e, r) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var n = r.apply(t, e || []),
      i, s = [];
    return i = {}, o("next"), o("throw"), o("return"), i[Symbol.asyncIterator] = function () {
      return this
    }, i;

    function o(w) {
      n[w] && (i[w] = function (b) {
        return new Promise(function (C, M) {
          s.push([w, b, C, M]) > 1 || a(w, b)
        })
      })
    }

    function a(w, b) {
      try {
        c(n[w](b))
      } catch (C) {
        f(s[0][3], C)
      }
    }

    function c(w) {
      w.value instanceof U2 ? Promise.resolve(w.value.v).then(l, h) : f(s[0][2], w)
    }

    function l(w) {
      a("next", w)
    }

    function h(w) {
      a("throw", w)
    }

    function f(w, b) {
      w(b), s.shift(), s.length && a(s[0][0], s[0][1])
    }
  }

  function Ade(t) {
    var e, r;
    return e = {}, n("next"), n("throw", function (i) {
      throw i
    }), n("return"), e[Symbol.iterator] = function () {
      return this
    }, e;

    function n(i, s) {
      e[i] = t[i] ? function (o) {
        return (r = !r) ? {
          value: U2(t[i](o)),
          done: i === "return"
        } : s ? s(o) : o
      } : s
    }
  }

  function Sde(t) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var e = t[Symbol.asyncIterator],
      r;
    return e ? e.call(t) : (t = typeof Vx == "function" ? Vx(t) : t[Symbol.iterator](), r = {}, n("next"), n("throw"), n("return"), r[Symbol.asyncIterator] = function () {
      return this
    }, r);

    function n(s) {
      r[s] = t[s] && function (o) {
        return new Promise(function (a, c) {
          o = t[s](o), i(a, c, o.done, o.value)
        })
      }
    }

    function i(s, o, a, c) {
      Promise.resolve(c).then(function (l) {
        s({
          value: l,
          done: a
        })
      }, o)
    }
  }

  function Ide(t, e) {
    return Object.defineProperty ? Object.defineProperty(t, "raw", {
      value: e
    }) : t.raw = e, t
  }

  function Tde(t) {
    if (t && t.__esModule) return t;
    var e = {};
    if (t != null)
      for (var r in t) Object.hasOwnProperty.call(t, r) && (e[r] = t[r]);
    return e.default = t, e
  }

  function kde(t) {
    return t && t.__esModule ? t : {
      default: t
    }
  }

  function Rde(t, e) {
    if (!e.has(t)) throw new TypeError("attempted to get private field on non-instance");
    return e.get(t)
  }

  function Nde(t, e, r) {
    if (!e.has(t)) throw new TypeError("attempted to set private field on non-instance");
    return e.set(t, r), r
  }
  const j2 = bu(Object.freeze(Object.defineProperty({
    __proto__: null,
    get __assign() {
      return qx
    },
    __asyncDelegator: Ade,
    __asyncGenerator: Ede,
    __asyncValues: Sde,
    __await: U2,
    __awaiter: vde,
    __classPrivateFieldGet: Rde,
    __classPrivateFieldSet: Nde,
    __createBinding: yde,
    __decorate: gde,
    __exportStar: _de,
    __extends: fde,
    __generator: bde,
    __importDefault: kde,
    __importStar: Tde,
    __makeTemplateObject: Ide,
    __metadata: wde,
    __param: mde,
    __read: C$,
    __rest: pde,
    __spread: xde,
    __spreadArrays: Cde,
    __values: Vx
  }, Symbol.toStringTag, {
    value: "Module"
  })));
  var Kx = {},
    F2 = {},
    E$;

  function Mde() {
    if (E$) return F2;
    E$ = 1, Object.defineProperty(F2, "__esModule", {
      value: !0
    }), F2.delay = void 0;

    function t(e) {
      return new Promise(r => {
        setTimeout(() => {
          r(!0)
        }, e)
      })
    }
    return F2.delay = t, F2
  }
  var l0 = {},
    Gx = {},
    u0 = {},
    A$;

  function Pde() {
    return A$ || (A$ = 1, Object.defineProperty(u0, "__esModule", {
      value: !0
    }), u0.ONE_THOUSAND = u0.ONE_HUNDRED = void 0, u0.ONE_HUNDRED = 100, u0.ONE_THOUSAND = 1e3), u0
  }
  var Zx = {},
    S$;

  function $de() {
    return S$ || (S$ = 1, function (t) {
      Object.defineProperty(t, "__esModule", {
        value: !0
      }), t.ONE_YEAR = t.FOUR_WEEKS = t.THREE_WEEKS = t.TWO_WEEKS = t.ONE_WEEK = t.THIRTY_DAYS = t.SEVEN_DAYS = t.FIVE_DAYS = t.THREE_DAYS = t.ONE_DAY = t.TWENTY_FOUR_HOURS = t.TWELVE_HOURS = t.SIX_HOURS = t.THREE_HOURS = t.ONE_HOUR = t.SIXTY_MINUTES = t.THIRTY_MINUTES = t.TEN_MINUTES = t.FIVE_MINUTES = t.ONE_MINUTE = t.SIXTY_SECONDS = t.THIRTY_SECONDS = t.TEN_SECONDS = t.FIVE_SECONDS = t.ONE_SECOND = void 0, t.ONE_SECOND = 1, t.FIVE_SECONDS = 5, t.TEN_SECONDS = 10, t.THIRTY_SECONDS = 30, t.SIXTY_SECONDS = 60, t.ONE_MINUTE = t.SIXTY_SECONDS, t.FIVE_MINUTES = t.ONE_MINUTE * 5, t.TEN_MINUTES = t.ONE_MINUTE * 10, t.THIRTY_MINUTES = t.ONE_MINUTE * 30, t.SIXTY_MINUTES = t.ONE_MINUTE * 60, t.ONE_HOUR = t.SIXTY_MINUTES, t.THREE_HOURS = t.ONE_HOUR * 3, t.SIX_HOURS = t.ONE_HOUR * 6, t.TWELVE_HOURS = t.ONE_HOUR * 12, t.TWENTY_FOUR_HOURS = t.ONE_HOUR * 24, t.ONE_DAY = t.TWENTY_FOUR_HOURS, t.THREE_DAYS = t.ONE_DAY * 3, t.FIVE_DAYS = t.ONE_DAY * 5, t.SEVEN_DAYS = t.ONE_DAY * 7, t.THIRTY_DAYS = t.ONE_DAY * 30, t.ONE_WEEK = t.SEVEN_DAYS, t.TWO_WEEKS = t.ONE_WEEK * 2, t.THREE_WEEKS = t.ONE_WEEK * 3, t.FOUR_WEEKS = t.ONE_WEEK * 4, t.ONE_YEAR = t.ONE_DAY * 365
    }(Zx)), Zx
  }
  var I$;

  function T$() {
    return I$ || (I$ = 1, function (t) {
      Object.defineProperty(t, "__esModule", {
        value: !0
      });
      const e = j2;
      e.__exportStar(Pde(), t), e.__exportStar($de(), t)
    }(Gx)), Gx
  }
  var k$;

  function Ode() {
    if (k$) return l0;
    k$ = 1, Object.defineProperty(l0, "__esModule", {
      value: !0
    }), l0.fromMiliseconds = l0.toMiliseconds = void 0;
    const t = T$();

    function e(n) {
      return n * t.ONE_THOUSAND
    }
    l0.toMiliseconds = e;

    function r(n) {
      return Math.floor(n / t.ONE_THOUSAND)
    }
    return l0.fromMiliseconds = r, l0
  }
  var R$;

  function Dde() {
    return R$ || (R$ = 1, function (t) {
      Object.defineProperty(t, "__esModule", {
        value: !0
      });
      const e = j2;
      e.__exportStar(Mde(), t), e.__exportStar(Ode(), t)
    }(Kx)), Kx
  }
  var J1 = {},
    N$;

  function Lde() {
    if (N$) return J1;
    N$ = 1, Object.defineProperty(J1, "__esModule", {
      value: !0
    }), J1.Watch = void 0;
    class t {
      constructor() {
        this.timestamps = new Map
      }
      start(r) {
        if (this.timestamps.has(r)) throw new Error(`Watch already started for label: ${r}`);
        this.timestamps.set(r, {
          started: Date.now()
        })
      }
      stop(r) {
        const n = this.get(r);
        if (typeof n.elapsed < "u") throw new Error(`Watch already stopped for label: ${r}`);
        const i = Date.now() - n.started;
        this.timestamps.set(r, {
          started: n.started,
          elapsed: i
        })
      }
      get(r) {
        const n = this.timestamps.get(r);
        if (typeof n > "u") throw new Error(`No timestamp found for label: ${r}`);
        return n
      }
      elapsed(r) {
        const n = this.get(r);
        return n.elapsed || Date.now() - n.started
      }
    }
    return J1.Watch = t, J1.default = t, J1
  }
  var Yx = {},
    W2 = {},
    M$;

  function Bde() {
    if (M$) return W2;
    M$ = 1, Object.defineProperty(W2, "__esModule", {
      value: !0
    }), W2.IWatch = void 0;
    class t {}
    return W2.IWatch = t, W2
  }
  var P$;

  function Ude() {
    return P$ || (P$ = 1, function (t) {
      Object.defineProperty(t, "__esModule", {
        value: !0
      }), j2.__exportStar(Bde(), t)
    }(Yx)), Yx
  }(function (t) {
    Object.defineProperty(t, "__esModule", {
      value: !0
    });
    const e = j2;
    e.__exportStar(Dde(), t), e.__exportStar(Lde(), t), e.__exportStar(Ude(), t), e.__exportStar(T$(), t)
  })(at);
  class d0 {}
  let jde = class extends d0 {
    constructor(e) {
      super()
    }
  };
  const $$ = at.FIVE_SECONDS,
    X1 = {
      pulse: "heartbeat_pulse"
    };
  let Fde = class ZZ extends jde {
    constructor(e) {
      super(e), this.events = new Fi.EventEmitter, this.interval = $$, this.interval = e?.interval || $$
    }
    static async init(e) {
      const r = new ZZ(e);
      return await r.init(), r
    }
    async init() {
      await this.initialize()
    }
    stop() {
      clearInterval(this.intervalRef)
    }
    on(e, r) {
      this.events.on(e, r)
    }
    once(e, r) {
      this.events.once(e, r)
    }
    off(e, r) {
      this.events.off(e, r)
    }
    removeListener(e, r) {
      this.events.removeListener(e, r)
    }
    async initialize() {
      this.intervalRef = setInterval(() => this.pulse(), at.toMiliseconds(this.interval))
    }
    pulse() {
      this.events.emit(X1.pulse)
    }
  };
  const Wde = /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,
    zde = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,
    Hde = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;

  function qde(t, e) {
    if (t === "__proto__" || t === "constructor" && e && typeof e == "object" && "prototype" in e) {
      Vde(t);
      return
    }
    return e
  }

  function Vde(t) {
    console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)
  }

  function _5(t, e = {}) {
    if (typeof t != "string") return t;
    const r = t.trim();
    if (t[0] === '"' && t.endsWith('"') && !t.includes("\\")) return r.slice(1, -1);
    if (r.length <= 9) {
      const n = r.toLowerCase();
      if (n === "true") return !0;
      if (n === "false") return !1;
      if (n === "undefined") return;
      if (n === "null") return null;
      if (n === "nan") return Number.NaN;
      if (n === "infinity") return Number.POSITIVE_INFINITY;
      if (n === "-infinity") return Number.NEGATIVE_INFINITY
    }
    if (!Hde.test(t)) {
      if (e.strict) throw new SyntaxError("[destr] Invalid JSON");
      return t
    }
    try {
      if (Wde.test(t) || zde.test(t)) {
        if (e.strict) throw new Error("[destr] Possible prototype pollution");
        return JSON.parse(t, qde)
      }
      return JSON.parse(t)
    } catch (n) {
      if (e.strict) throw n;
      return t
    }
  }

  function Kde(t) {
    return !t || typeof t.then != "function" ? Promise.resolve(t) : t
  }

  function Wi(t, ...e) {
    try {
      return Kde(t(...e))
    } catch (r) {
      return Promise.reject(r)
    }
  }

  function Gde(t) {
    const e = typeof t;
    return t === null || e !== "object" && e !== "function"
  }

  function Zde(t) {
    const e = Object.getPrototypeOf(t);
    return !e || e.isPrototypeOf(Object)
  }

  function x5(t) {
    if (Gde(t)) return String(t);
    if (Zde(t) || Array.isArray(t)) return JSON.stringify(t);
    if (typeof t.toJSON == "function") return x5(t.toJSON());
    throw new Error("[unstorage] Cannot stringify value!")
  }

  function O$() {
    if (typeof Buffer > "u") throw new TypeError("[unstorage] Buffer is not supported!")
  }
  const Qx = "base64:";

  function Yde(t) {
    if (typeof t == "string") return t;
    O$();
    const e = Buffer.from(t).toString("base64");
    return Qx + e
  }

  function Qde(t) {
    return typeof t != "string" || !t.startsWith(Qx) ? t : (O$(), Buffer.from(t.slice(Qx.length), "base64"))
  }

  function lo(t) {
    return t ? t.split("?")[0].replace(/[/\\]/g, ":").replace(/:+/g, ":").replace(/^:|:$/g, "") : ""
  }

  function Jde(...t) {
    return lo(t.join(":"))
  }

  function C5(t) {
    return t = lo(t), t ? t + ":" : ""
  }

  function yFe(t) {
    return t
  }
  const Xde = "memory",
    ehe = () => {
      const t = new Map;
      return {
        name: Xde,
        getInstance: () => t,
        hasItem(e) {
          return t.has(e)
        },
        getItem(e) {
          return t.get(e) ?? null
        },
        getItemRaw(e) {
          return t.get(e) ?? null
        },
        setItem(e, r) {
          t.set(e, r)
        },
        setItemRaw(e, r) {
          t.set(e, r)
        },
        removeItem(e) {
          t.delete(e)
        },
        getKeys() {
          return [...t.keys()]
        },
        clear() {
          t.clear()
        },
        dispose() {
          t.clear()
        }
      }
    };

  function the(t = {}) {
    const e = {
        mounts: {
          "": t.driver || ehe()
        },
        mountpoints: [""],
        watching: !1,
        watchListeners: [],
        unwatch: {}
      },
      r = l => {
        for (const h of e.mountpoints)
          if (l.startsWith(h)) return {
            base: h,
            relativeKey: l.slice(h.length),
            driver: e.mounts[h]
          };
        return {
          base: "",
          relativeKey: l,
          driver: e.mounts[""]
        }
      },
      n = (l, h) => e.mountpoints.filter(f => f.startsWith(l) || h && l.startsWith(f)).map(f => ({
        relativeBase: l.length > f.length ? l.slice(f.length) : void 0,
        mountpoint: f,
        driver: e.mounts[f]
      })),
      i = (l, h) => {
        if (e.watching) {
          h = lo(h);
          for (const f of e.watchListeners) f(l, h)
        }
      },
      s = async () => {
        if (!e.watching) {
          e.watching = !0;
          for (const l in e.mounts) e.unwatch[l] = await D$(e.mounts[l], i, l)
        }
      }, o = async () => {
        if (e.watching) {
          for (const l in e.unwatch) await e.unwatch[l]();
          e.unwatch = {}, e.watching = !1
        }
      }, a = (l, h, f) => {
        const w = new Map,
          b = C => {
            let M = w.get(C.base);
            return M || (M = {
              driver: C.driver,
              base: C.base,
              items: []
            }, w.set(C.base, M)), M
          };
        for (const C of l) {
          const M = typeof C == "string",
            N = lo(M ? C : C.key),
            $ = M ? void 0 : C.value,
            k = M || !C.options ? h : {
              ...h,
              ...C.options
            },
            B = r(N);
          b(B).items.push({
            key: N,
            value: $,
            relativeKey: B.relativeKey,
            options: k
          })
        }
        return Promise.all([...w.values()].map(C => f(C))).then(C => C.flat())
      }, c = {
        hasItem(l, h = {}) {
          l = lo(l);
          const {
            relativeKey: f,
            driver: w
          } = r(l);
          return Wi(w.hasItem, f, h)
        },
        getItem(l, h = {}) {
          l = lo(l);
          const {
            relativeKey: f,
            driver: w
          } = r(l);
          return Wi(w.getItem, f, h).then(b => _5(b))
        },
        getItems(l, h) {
          return a(l, h, f => f.driver.getItems ? Wi(f.driver.getItems, f.items.map(w => ({
            key: w.relativeKey,
            options: w.options
          })), h).then(w => w.map(b => ({
            key: Jde(f.base, b.key),
            value: _5(b.value)
          }))) : Promise.all(f.items.map(w => Wi(f.driver.getItem, w.relativeKey, w.options).then(b => ({
            key: w.key,
            value: _5(b)
          })))))
        },
        getItemRaw(l, h = {}) {
          l = lo(l);
          const {
            relativeKey: f,
            driver: w
          } = r(l);
          return w.getItemRaw ? Wi(w.getItemRaw, f, h) : Wi(w.getItem, f, h).then(b => Qde(b))
        },
        async setItem(l, h, f = {}) {
          if (h === void 0) return c.removeItem(l);
          l = lo(l);
          const {
            relativeKey: w,
            driver: b
          } = r(l);
          b.setItem && (await Wi(b.setItem, w, x5(h), f), b.watch || i("update", l))
        },
        async setItems(l, h) {
          await a(l, h, async f => {
            if (f.driver.setItems) return Wi(f.driver.setItems, f.items.map(w => ({
              key: w.relativeKey,
              value: x5(w.value),
              options: w.options
            })), h);
            f.driver.setItem && await Promise.all(f.items.map(w => Wi(f.driver.setItem, w.relativeKey, x5(w.value), w.options)))
          })
        },
        async setItemRaw(l, h, f = {}) {
          if (h === void 0) return c.removeItem(l, f);
          l = lo(l);
          const {
            relativeKey: w,
            driver: b
          } = r(l);
          if (b.setItemRaw) await Wi(b.setItemRaw, w, h, f);
          else if (b.setItem) await Wi(b.setItem, w, Yde(h), f);
          else return;
          b.watch || i("update", l)
        },
        async removeItem(l, h = {}) {
          typeof h == "boolean" && (h = {
            removeMeta: h
          }), l = lo(l);
          const {
            relativeKey: f,
            driver: w
          } = r(l);
          w.removeItem && (await Wi(w.removeItem, f, h), (h.removeMeta || h.removeMata) && await Wi(w.removeItem, f + "$", h), w.watch || i("remove", l))
        },
        async getMeta(l, h = {}) {
          typeof h == "boolean" && (h = {
            nativeOnly: h
          }), l = lo(l);
          const {
            relativeKey: f,
            driver: w
          } = r(l), b = Object.create(null);
          if (w.getMeta && Object.assign(b, await Wi(w.getMeta, f, h)), !h.nativeOnly) {
            const C = await Wi(w.getItem, f + "$", h).then(M => _5(M));
            C && typeof C == "object" && (typeof C.atime == "string" && (C.atime = new Date(C.atime)), typeof C.mtime == "string" && (C.mtime = new Date(C.mtime)), Object.assign(b, C))
          }
          return b
        },
        setMeta(l, h, f = {}) {
          return this.setItem(l + "$", h, f)
        },
        removeMeta(l, h = {}) {
          return this.removeItem(l + "$", h)
        },
        async getKeys(l, h = {}) {
          l = C5(l);
          const f = n(l, !0);
          let w = [];
          const b = [];
          for (const C of f) {
            const M = await Wi(C.driver.getKeys, C.relativeBase, h);
            for (const N of M) {
              const $ = C.mountpoint + lo(N);
              w.some(k => $.startsWith(k)) || b.push($)
            }
            w = [C.mountpoint, ...w.filter(N => !N.startsWith(C.mountpoint))]
          }
          return l ? b.filter(C => C.startsWith(l) && C[C.length - 1] !== "$") : b.filter(C => C[C.length - 1] !== "$")
        },
        async clear(l, h = {}) {
          l = C5(l), await Promise.all(n(l, !1).map(async f => {
            if (f.driver.clear) return Wi(f.driver.clear, f.relativeBase, h);
            if (f.driver.removeItem) {
              const w = await f.driver.getKeys(f.relativeBase || "", h);
              return Promise.all(w.map(b => f.driver.removeItem(b, h)))
            }
          }))
        },
        async dispose() {
          await Promise.all(Object.values(e.mounts).map(l => L$(l)))
        },
        async watch(l) {
          return await s(), e.watchListeners.push(l), async () => {
            e.watchListeners = e.watchListeners.filter(h => h !== l), e.watchListeners.length === 0 && await o()
          }
        },
        async unwatch() {
          e.watchListeners = [], await o()
        },
        mount(l, h) {
          if (l = C5(l), l && e.mounts[l]) throw new Error(`already mounted at ${l}`);
          return l && (e.mountpoints.push(l), e.mountpoints.sort((f, w) => w.length - f.length)), e.mounts[l] = h, e.watching && Promise.resolve(D$(h, i, l)).then(f => {
            e.unwatch[l] = f
          }).catch(console.error), c
        },
        async unmount(l, h = !0) {
          l = C5(l), !(!l || !e.mounts[l]) && (e.watching && l in e.unwatch && (e.unwatch[l](), delete e.unwatch[l]), h && await L$(e.mounts[l]), e.mountpoints = e.mountpoints.filter(f => f !== l), delete e.mounts[l])
        },
        getMount(l = "") {
          l = lo(l) + ":";
          const h = r(l);
          return {
            driver: h.driver,
            base: h.base
          }
        },
        getMounts(l = "", h = {}) {
          return l = lo(l), n(l, h.parents).map(w => ({
            driver: w.driver,
            base: w.mountpoint
          }))
        },
        keys: (l, h = {}) => c.getKeys(l, h),
        get: (l, h = {}) => c.getItem(l, h),
        set: (l, h, f = {}) => c.setItem(l, h, f),
        has: (l, h = {}) => c.hasItem(l, h),
        del: (l, h = {}) => c.removeItem(l, h),
        remove: (l, h = {}) => c.removeItem(l, h)
      };
    return c
  }

  function D$(t, e, r) {
    return t.watch ? t.watch((n, i) => e(n, r + i)) : () => {}
  }
  async function L$(t) {
    typeof t.dispose == "function" && await Wi(t.dispose)
  }

  function h0(t) {
    return new Promise((e, r) => {
      t.oncomplete = t.onsuccess = () => e(t.result), t.onabort = t.onerror = () => r(t.error)
    })
  }

  function B$(t, e) {
    const r = indexedDB.open(t);
    r.onupgradeneeded = () => r.result.createObjectStore(e);
    const n = h0(r);
    return (i, s) => n.then(o => s(o.transaction(e, i).objectStore(e)))
  }
  let Jx;

  function z2() {
    return Jx || (Jx = B$("keyval-store", "keyval")), Jx
  }

  function U$(t, e = z2()) {
    return e("readonly", r => h0(r.get(t)))
  }

  function rhe(t, e, r = z2()) {
    return r("readwrite", n => (n.put(e, t), h0(n.transaction)))
  }

  function nhe(t, e = z2()) {
    return e("readwrite", r => (r.delete(t), h0(r.transaction)))
  }

  function ihe(t = z2()) {
    return t("readwrite", e => (e.clear(), h0(e.transaction)))
  }

  function she(t, e) {
    return t.openCursor().onsuccess = function () {
      this.result && (e(this.result), this.result.continue())
    }, h0(t.transaction)
  }

  function ohe(t = z2()) {
    return t("readonly", e => {
      if (e.getAllKeys) return h0(e.getAllKeys());
      const r = [];
      return she(e, n => r.push(n.key)).then(() => r)
    })
  }
  const ahe = "idb-keyval";
  var che = (t = {}) => {
    const e = t.base && t.base.length > 0 ? `${t.base}:` : "",
      r = i => e + i;
    let n;
    return t.dbName && t.storeName && (n = B$(t.dbName, t.storeName)), {
      name: ahe,
      options: t,
      async hasItem(i) {
        return !(typeof await U$(r(i), n) > "u")
      },
      async getItem(i) {
        return await U$(r(i), n) ?? null
      },
      setItem(i, s) {
        return rhe(r(i), s, n)
      },
      removeItem(i) {
        return nhe(r(i), n)
      },
      getKeys() {
        return ohe(n)
      },
      clear() {
        return ihe(n)
      }
    }
  };
  const lhe = "WALLET_CONNECT_V2_INDEXED_DB",
    uhe = "keyvaluestorage";
  let dhe = class {
    constructor() {
      this.indexedDb = the({
        driver: che({
          dbName: lhe,
          storeName: uhe
        })
      })
    }
    async getKeys() {
      return this.indexedDb.getKeys()
    }
    async getEntries() {
      return (await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e => [e.key, e.value])
    }
    async getItem(e) {
      const r = await this.indexedDb.getItem(e);
      if (r !== null) return r
    }
    async setItem(e, r) {
      await this.indexedDb.setItem(e, Nu(r))
    }
    async removeItem(e) {
      await this.indexedDb.removeItem(e)
    }
  };
  var Xx = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {},
    E5 = {
      exports: {}
    };
  (function () {
    let t;

    function e() {}
    t = e, t.prototype.getItem = function (r) {
      return this.hasOwnProperty(r) ? String(this[r]) : null
    }, t.prototype.setItem = function (r, n) {
      this[r] = String(n)
    }, t.prototype.removeItem = function (r) {
      delete this[r]
    }, t.prototype.clear = function () {
      const r = this;
      Object.keys(r).forEach(function (n) {
        r[n] = void 0, delete r[n]
      })
    }, t.prototype.key = function (r) {
      return r = r || 0, Object.keys(this)[r]
    }, t.prototype.__defineGetter__("length", function () {
      return Object.keys(this).length
    }), typeof Xx < "u" && Xx.localStorage ? E5.exports = Xx.localStorage : typeof window < "u" && window.localStorage ? E5.exports = window.localStorage : E5.exports = new e
  })();

  function hhe(t) {
    var e;
    return [t[0], Pf((e = t[1]) != null ? e : "")]
  }
  let fhe = class {
    constructor() {
      this.localStorage = E5.exports
    }
    async getKeys() {
      return Object.keys(this.localStorage)
    }
    async getEntries() {
      return Object.entries(this.localStorage).map(hhe)
    }
    async getItem(e) {
      const r = this.localStorage.getItem(e);
      if (r !== null) return Pf(r)
    }
    async setItem(e, r) {
      this.localStorage.setItem(e, Nu(r))
    }
    async removeItem(e) {
      this.localStorage.removeItem(e)
    }
  };
  const phe = "wc_storage_version",
    j$ = 1,
    ghe = async (t, e, r) => {
      const n = phe,
        i = await e.getItem(n);
      if (i && i >= j$) {
        r(e);
        return
      }
      const s = await t.getKeys();
      if (!s.length) {
        r(e);
        return
      }
      const o = [];
      for (; s.length;) {
        const a = s.shift();
        if (!a) continue;
        const c = a.toLowerCase();
        if (c.includes("wc@") || c.includes("walletconnect") || c.includes("wc_") || c.includes("wallet_connect")) {
          const l = await t.getItem(a);
          await e.setItem(a, l), o.push(a)
        }
      }
      await e.setItem(n, j$), r(e), mhe(t, o)
    }, mhe = async (t, e) => {
      e.length && e.forEach(async r => {
        await t.removeItem(r)
      })
    };
  let whe = class {
      constructor() {
        this.initialized = !1, this.setInitialized = r => {
          this.storage = r, this.initialized = !0
        };
        const e = new fhe;
        this.storage = e;
        try {
          const r = new dhe;
          ghe(e, r, this.setInitialized)
        } catch {
          this.initialized = !0
        }
      }
      async getKeys() {
        return await this.initialize(), this.storage.getKeys()
      }
      async getEntries() {
        return await this.initialize(), this.storage.getEntries()
      }
      async getItem(e) {
        return await this.initialize(), this.storage.getItem(e)
      }
      async setItem(e, r) {
        return await this.initialize(), this.storage.setItem(e, r)
      }
      async removeItem(e) {
        return await this.initialize(), this.storage.removeItem(e)
      }
      async initialize() {
        this.initialized || await new Promise(e => {
          const r = setInterval(() => {
            this.initialized && (clearInterval(r), e())
          }, 20)
        })
      }
    },
    vhe = class extends d0 {
      constructor(e) {
        super(), this.opts = e, this.protocol = "wc", this.version = 2
      }
    },
    bhe = class extends d0 {
      constructor(e, r) {
        super(), this.core = e, this.logger = r, this.records = new Map
      }
    },
    yhe = class {
      constructor(e, r) {
        this.logger = e, this.core = r
      }
    },
    _he = class extends d0 {
      constructor(e, r) {
        super(), this.relayer = e, this.logger = r
      }
    },
    xhe = class extends d0 {
      constructor(e) {
        super()
      }
    },
    Che = class {
      constructor(e, r, n, i) {
        this.core = e, this.logger = r, this.name = n
      }
    },
    Ehe = class extends d0 {
      constructor(e, r) {
        super(), this.relayer = e, this.logger = r
      }
    },
    Ahe = class extends d0 {
      constructor(e, r) {
        super(), this.core = e, this.logger = r
      }
    },
    She = class {
      constructor(e, r, n) {
        this.core = e, this.logger = r, this.store = n
      }
    },
    Ihe = class {
      constructor(e, r) {
        this.projectId = e, this.logger = r
      }
    },
    The = class {
      constructor(e, r, n) {
        this.core = e, this.logger = r, this.telemetryEnabled = n
      }
    },
    khe = class {
      constructor(e) {
        this.opts = e, this.protocol = "wc", this.version = 2
      }
    },
    Rhe = class {
      constructor(e) {
        this.client = e
      }
    };
  var eC = {},
    vh = {},
    A5 = {},
    S5 = {};
  Object.defineProperty(S5, "__esModule", {
    value: !0
  }), S5.BrowserRandomSource = void 0;
  const F$ = 65536;
  class Nhe {
    constructor() {
      this.isAvailable = !1, this.isInstantiated = !1;
      const e = typeof self < "u" ? self.crypto || self.msCrypto : null;
      e && e.getRandomValues !== void 0 && (this._crypto = e, this.isAvailable = !0, this.isInstantiated = !0)
    }
    randomBytes(e) {
      if (!this.isAvailable || !this._crypto) throw new Error("Browser random byte generator is not available.");
      const r = new Uint8Array(e);
      for (let n = 0; n < r.length; n += F$) this._crypto.getRandomValues(r.subarray(n, n + Math.min(r.length - n, F$)));
      return r
    }
  }
  S5.BrowserRandomSource = Nhe;

  function Mhe(t) {
    throw new Error('Could not dynamically require "' + t + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')
  }
  var I5 = {},
    Bo = {};
  Object.defineProperty(Bo, "__esModule", {
    value: !0
  });

  function Phe(t) {
    for (var e = 0; e < t.length; e++) t[e] = 0;
    return t
  }
  Bo.wipe = Phe;
  const eg = bu(Object.freeze(Object.defineProperty({
    __proto__: null,
    default: {}
  }, Symbol.toStringTag, {
    value: "Module"
  })));
  Object.defineProperty(I5, "__esModule", {
    value: !0
  }), I5.NodeRandomSource = void 0;
  const $he = Bo;
  class Ohe {
    constructor() {
      if (this.isAvailable = !1, this.isInstantiated = !1, typeof Mhe < "u") {
        const e = eg;
        e && e.randomBytes && (this._crypto = e, this.isAvailable = !0, this.isInstantiated = !0)
      }
    }
    randomBytes(e) {
      if (!this.isAvailable || !this._crypto) throw new Error("Node.js random byte generator is not available.");
      let r = this._crypto.randomBytes(e);
      if (r.length !== e) throw new Error("NodeRandomSource: got fewer bytes than requested");
      const n = new Uint8Array(e);
      for (let i = 0; i < n.length; i++) n[i] = r[i];
      return (0, $he.wipe)(r), n
    }
  }
  I5.NodeRandomSource = Ohe, Object.defineProperty(A5, "__esModule", {
    value: !0
  }), A5.SystemRandomSource = void 0;
  const Dhe = S5,
    Lhe = I5;
  class Bhe {
    constructor() {
      if (this.isAvailable = !1, this.name = "", this._source = new Dhe.BrowserRandomSource, this._source.isAvailable) {
        this.isAvailable = !0, this.name = "Browser";
        return
      }
      if (this._source = new Lhe.NodeRandomSource, this._source.isAvailable) {
        this.isAvailable = !0, this.name = "Node";
        return
      }
    }
    randomBytes(e) {
      if (!this.isAvailable) throw new Error("System random byte generator is not available.");
      return this._source.randomBytes(e)
    }
  }
  A5.SystemRandomSource = Bhe;
  var wr = {},
    W$ = {};
  (function (t) {
    Object.defineProperty(t, "__esModule", {
      value: !0
    });

    function e(a, c) {
      var l = a >>> 16 & 65535,
        h = a & 65535,
        f = c >>> 16 & 65535,
        w = c & 65535;
      return h * w + (l * w + h * f << 16 >>> 0) | 0
    }
    t.mul = Math.imul || e;

    function r(a, c) {
      return a + c | 0
    }
    t.add = r;

    function n(a, c) {
      return a - c | 0
    }
    t.sub = n;

    function i(a, c) {
      return a << c | a >>> 32 - c
    }
    t.rotl = i;

    function s(a, c) {
      return a << 32 - c | a >>> c
    }
    t.rotr = s;

    function o(a) {
      return typeof a == "number" && isFinite(a) && Math.floor(a) === a
    }
    t.isInteger = Number.isInteger || o, t.MAX_SAFE_INTEGER = 9007199254740991, t.isSafeInteger = function (a) {
      return t.isInteger(a) && a >= -t.MAX_SAFE_INTEGER && a <= t.MAX_SAFE_INTEGER
    }
  })(W$), Object.defineProperty(wr, "__esModule", {
    value: !0
  });
  var z$ = W$;

  function Uhe(t, e) {
    return e === void 0 && (e = 0), (t[e + 0] << 8 | t[e + 1]) << 16 >> 16
  }
  wr.readInt16BE = Uhe;

  function jhe(t, e) {
    return e === void 0 && (e = 0), (t[e + 0] << 8 | t[e + 1]) >>> 0
  }
  wr.readUint16BE = jhe;

  function Fhe(t, e) {
    return e === void 0 && (e = 0), (t[e + 1] << 8 | t[e]) << 16 >> 16
  }
  wr.readInt16LE = Fhe;

  function Whe(t, e) {
    return e === void 0 && (e = 0), (t[e + 1] << 8 | t[e]) >>> 0
  }
  wr.readUint16LE = Whe;

  function H$(t, e, r) {
    return e === void 0 && (e = new Uint8Array(2)), r === void 0 && (r = 0), e[r + 0] = t >>> 8, e[r + 1] = t >>> 0, e
  }
  wr.writeUint16BE = H$, wr.writeInt16BE = H$;

  function q$(t, e, r) {
    return e === void 0 && (e = new Uint8Array(2)), r === void 0 && (r = 0), e[r + 0] = t >>> 0, e[r + 1] = t >>> 8, e
  }
  wr.writeUint16LE = q$, wr.writeInt16LE = q$;

  function tC(t, e) {
    return e === void 0 && (e = 0), t[e] << 24 | t[e + 1] << 16 | t[e + 2] << 8 | t[e + 3]
  }
  wr.readInt32BE = tC;

  function rC(t, e) {
    return e === void 0 && (e = 0), (t[e] << 24 | t[e + 1] << 16 | t[e + 2] << 8 | t[e + 3]) >>> 0
  }
  wr.readUint32BE = rC;

  function nC(t, e) {
    return e === void 0 && (e = 0), t[e + 3] << 24 | t[e + 2] << 16 | t[e + 1] << 8 | t[e]
  }
  wr.readInt32LE = nC;

  function iC(t, e) {
    return e === void 0 && (e = 0), (t[e + 3] << 24 | t[e + 2] << 16 | t[e + 1] << 8 | t[e]) >>> 0
  }
  wr.readUint32LE = iC;

  function T5(t, e, r) {
    return e === void 0 && (e = new Uint8Array(4)), r === void 0 && (r = 0), e[r + 0] = t >>> 24, e[r + 1] = t >>> 16, e[r + 2] = t >>> 8, e[r + 3] = t >>> 0, e
  }
  wr.writeUint32BE = T5, wr.writeInt32BE = T5;

  function k5(t, e, r) {
    return e === void 0 && (e = new Uint8Array(4)), r === void 0 && (r = 0), e[r + 0] = t >>> 0, e[r + 1] = t >>> 8, e[r + 2] = t >>> 16, e[r + 3] = t >>> 24, e
  }
  wr.writeUint32LE = k5, wr.writeInt32LE = k5;

  function zhe(t, e) {
    e === void 0 && (e = 0);
    var r = tC(t, e),
      n = tC(t, e + 4);
    return r * 4294967296 + n - (n >> 31) * 4294967296
  }
  wr.readInt64BE = zhe;

  function Hhe(t, e) {
    e === void 0 && (e = 0);
    var r = rC(t, e),
      n = rC(t, e + 4);
    return r * 4294967296 + n
  }
  wr.readUint64BE = Hhe;

  function qhe(t, e) {
    e === void 0 && (e = 0);
    var r = nC(t, e),
      n = nC(t, e + 4);
    return n * 4294967296 + r - (r >> 31) * 4294967296
  }
  wr.readInt64LE = qhe;

  function Vhe(t, e) {
    e === void 0 && (e = 0);
    var r = iC(t, e),
      n = iC(t, e + 4);
    return n * 4294967296 + r
  }
  wr.readUint64LE = Vhe;

  function V$(t, e, r) {
    return e === void 0 && (e = new Uint8Array(8)), r === void 0 && (r = 0), T5(t / 4294967296 >>> 0, e, r), T5(t >>> 0, e, r + 4), e
  }
  wr.writeUint64BE = V$, wr.writeInt64BE = V$;

  function K$(t, e, r) {
    return e === void 0 && (e = new Uint8Array(8)), r === void 0 && (r = 0), k5(t >>> 0, e, r), k5(t / 4294967296 >>> 0, e, r + 4), e
  }
  wr.writeUint64LE = K$, wr.writeInt64LE = K$;

  function Khe(t, e, r) {
    if (r === void 0 && (r = 0), t % 8 !== 0) throw new Error("readUintBE supports only bitLengths divisible by 8");
    if (t / 8 > e.length - r) throw new Error("readUintBE: array is too short for the given bitLength");
    for (var n = 0, i = 1, s = t / 8 + r - 1; s >= r; s--) n += e[s] * i, i *= 256;
    return n
  }
  wr.readUintBE = Khe;

  function Ghe(t, e, r) {
    if (r === void 0 && (r = 0), t % 8 !== 0) throw new Error("readUintLE supports only bitLengths divisible by 8");
    if (t / 8 > e.length - r) throw new Error("readUintLE: array is too short for the given bitLength");
    for (var n = 0, i = 1, s = r; s < r + t / 8; s++) n += e[s] * i, i *= 256;
    return n
  }
  wr.readUintLE = Ghe;

  function Zhe(t, e, r, n) {
    if (r === void 0 && (r = new Uint8Array(t / 8)), n === void 0 && (n = 0), t % 8 !== 0) throw new Error("writeUintBE supports only bitLengths divisible by 8");
    if (!z$.isSafeInteger(e)) throw new Error("writeUintBE value must be an integer");
    for (var i = 1, s = t / 8 + n - 1; s >= n; s--) r[s] = e / i & 255, i *= 256;
    return r
  }
  wr.writeUintBE = Zhe;

  function Yhe(t, e, r, n) {
    if (r === void 0 && (r = new Uint8Array(t / 8)), n === void 0 && (n = 0), t % 8 !== 0) throw new Error("writeUintLE supports only bitLengths divisible by 8");
    if (!z$.isSafeInteger(e)) throw new Error("writeUintLE value must be an integer");
    for (var i = 1, s = n; s < n + t / 8; s++) r[s] = e / i & 255, i *= 256;
    return r
  }
  wr.writeUintLE = Yhe;

  function Qhe(t, e) {
    e === void 0 && (e = 0);
    var r = new DataView(t.buffer, t.byteOffset, t.byteLength);
    return r.getFloat32(e)
  }
  wr.readFloat32BE = Qhe;

  function Jhe(t, e) {
    e === void 0 && (e = 0);
    var r = new DataView(t.buffer, t.byteOffset, t.byteLength);
    return r.getFloat32(e, !0)
  }
  wr.readFloat32LE = Jhe;

  function Xhe(t, e) {
    e === void 0 && (e = 0);
    var r = new DataView(t.buffer, t.byteOffset, t.byteLength);
    return r.getFloat64(e)
  }
  wr.readFloat64BE = Xhe;

  function efe(t, e) {
    e === void 0 && (e = 0);
    var r = new DataView(t.buffer, t.byteOffset, t.byteLength);
    return r.getFloat64(e, !0)
  }
  wr.readFloat64LE = efe;

  function tfe(t, e, r) {
    e === void 0 && (e = new Uint8Array(4)), r === void 0 && (r = 0);
    var n = new DataView(e.buffer, e.byteOffset, e.byteLength);
    return n.setFloat32(r, t), e
  }
  wr.writeFloat32BE = tfe;

  function rfe(t, e, r) {
    e === void 0 && (e = new Uint8Array(4)), r === void 0 && (r = 0);
    var n = new DataView(e.buffer, e.byteOffset, e.byteLength);
    return n.setFloat32(r, t, !0), e
  }
  wr.writeFloat32LE = rfe;

  function nfe(t, e, r) {
    e === void 0 && (e = new Uint8Array(8)), r === void 0 && (r = 0);
    var n = new DataView(e.buffer, e.byteOffset, e.byteLength);
    return n.setFloat64(r, t), e
  }
  wr.writeFloat64BE = nfe;

  function ife(t, e, r) {
    e === void 0 && (e = new Uint8Array(8)), r === void 0 && (r = 0);
    var n = new DataView(e.buffer, e.byteOffset, e.byteLength);
    return n.setFloat64(r, t, !0), e
  }
  wr.writeFloat64LE = ife,
    function (t) {
      Object.defineProperty(t, "__esModule", {
        value: !0
      }), t.randomStringForEntropy = t.randomString = t.randomUint32 = t.randomBytes = t.defaultRandomSource = void 0;
      const e = A5,
        r = wr,
        n = Bo;
      t.defaultRandomSource = new e.SystemRandomSource;

      function i(l, h = t.defaultRandomSource) {
        return h.randomBytes(l)
      }
      t.randomBytes = i;

      function s(l = t.defaultRandomSource) {
        const h = i(4, l),
          f = (0, r.readUint32LE)(h);
        return (0, n.wipe)(h), f
      }
      t.randomUint32 = s;
      const o = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";

      function a(l, h = o, f = t.defaultRandomSource) {
        if (h.length < 2) throw new Error("randomString charset is too short");
        if (h.length > 256) throw new Error("randomString charset is too long");
        let w = "";
        const b = h.length,
          C = 256 - 256 % b;
        for (; l > 0;) {
          const M = i(Math.ceil(l * 256 / C), f);
          for (let N = 0; N < M.length && l > 0; N++) {
            const $ = M[N];
            $ < C && (w += h.charAt($ % b), l--)
          }(0, n.wipe)(M)
        }
        return w
      }
      t.randomString = a;

      function c(l, h = o, f = t.defaultRandomSource) {
        const w = Math.ceil(l / (Math.log(h.length) / Math.LN2));
        return a(w, h, f)
      }
      t.randomStringForEntropy = c
    }(vh);
  var G$ = {};
  (function (t) {
    Object.defineProperty(t, "__esModule", {
      value: !0
    });
    var e = wr,
      r = Bo;
    t.DIGEST_LENGTH = 64, t.BLOCK_SIZE = 128;
    var n = function () {
      function a() {
        this.digestLength = t.DIGEST_LENGTH, this.blockSize = t.BLOCK_SIZE, this._stateHi = new Int32Array(8), this._stateLo = new Int32Array(8), this._tempHi = new Int32Array(16), this._tempLo = new Int32Array(16), this._buffer = new Uint8Array(256), this._bufferLength = 0, this._bytesHashed = 0, this._finished = !1, this.reset()
      }
      return a.prototype._initState = function () {
        this._stateHi[0] = 1779033703, this._stateHi[1] = 3144134277, this._stateHi[2] = 1013904242, this._stateHi[3] = 2773480762, this._stateHi[4] = 1359893119, this._stateHi[5] = 2600822924, this._stateHi[6] = 528734635, this._stateHi[7] = 1541459225, this._stateLo[0] = 4089235720, this._stateLo[1] = 2227873595, this._stateLo[2] = 4271175723, this._stateLo[3] = 1595750129, this._stateLo[4] = 2917565137, this._stateLo[5] = 725511199, this._stateLo[6] = 4215389547, this._stateLo[7] = 327033209
      }, a.prototype.reset = function () {
        return this._initState(), this._bufferLength = 0, this._bytesHashed = 0, this._finished = !1, this
      }, a.prototype.clean = function () {
        r.wipe(this._buffer), r.wipe(this._tempHi), r.wipe(this._tempLo), this.reset()
      }, a.prototype.update = function (c, l) {
        if (l === void 0 && (l = c.length), this._finished) throw new Error("SHA512: can't update because hash was finished.");
        var h = 0;
        if (this._bytesHashed += l, this._bufferLength > 0) {
          for (; this._bufferLength < t.BLOCK_SIZE && l > 0;) this._buffer[this._bufferLength++] = c[h++], l--;
          this._bufferLength === this.blockSize && (s(this._tempHi, this._tempLo, this._stateHi, this._stateLo, this._buffer, 0, this.blockSize), this._bufferLength = 0)
        }
        for (l >= this.blockSize && (h = s(this._tempHi, this._tempLo, this._stateHi, this._stateLo, c, h, l), l %= this.blockSize); l > 0;) this._buffer[this._bufferLength++] = c[h++], l--;
        return this
      }, a.prototype.finish = function (c) {
        if (!this._finished) {
          var l = this._bytesHashed,
            h = this._bufferLength,
            f = l / 536870912 | 0,
            w = l << 3,
            b = l % 128 < 112 ? 128 : 256;
          this._buffer[h] = 128;
          for (var C = h + 1; C < b - 8; C++) this._buffer[C] = 0;
          e.writeUint32BE(f, this._buffer, b - 8), e.writeUint32BE(w, this._buffer, b - 4), s(this._tempHi, this._tempLo, this._stateHi, this._stateLo, this._buffer, 0, b), this._finished = !0
        }
        for (var C = 0; C < this.digestLength / 8; C++) e.writeUint32BE(this._stateHi[C], c, C * 8), e.writeUint32BE(this._stateLo[C], c, C * 8 + 4);
        return this
      }, a.prototype.digest = function () {
        var c = new Uint8Array(this.digestLength);
        return this.finish(c), c
      }, a.prototype.saveState = function () {
        if (this._finished) throw new Error("SHA256: cannot save finished state");
        return {
          stateHi: new Int32Array(this._stateHi),
          stateLo: new Int32Array(this._stateLo),
          buffer: this._bufferLength > 0 ? new Uint8Array(this._buffer) : void 0,
          bufferLength: this._bufferLength,
          bytesHashed: this._bytesHashed
        }
      }, a.prototype.restoreState = function (c) {
        return this._stateHi.set(c.stateHi), this._stateLo.set(c.stateLo), this._bufferLength = c.bufferLength, c.buffer && this._buffer.set(c.buffer), this._bytesHashed = c.bytesHashed, this._finished = !1, this
      }, a.prototype.cleanSavedState = function (c) {
        r.wipe(c.stateHi), r.wipe(c.stateLo), c.buffer && r.wipe(c.buffer), c.bufferLength = 0, c.bytesHashed = 0
      }, a
    }();
    t.SHA512 = n;
    var i = new Int32Array([1116352408, 3609767458, 1899447441, 602891725, 3049323471, 3964484399, 3921009573, 2173295548, 961987163, 4081628472, 1508970993, 3053834265, 2453635748, 2937671579, 2870763221, 3664609560, 3624381080, 2734883394, 310598401, 1164996542, 607225278, 1323610764, 1426881987, 3590304994, 1925078388, 4068182383, 2162078206, 991336113, 2614888103, 633803317, 3248222580, 3479774868, 3835390401, 2666613458, 4022224774, 944711139, 264347078, 2341262773, 604807628, 2007800933, 770255983, 1495990901, 1249150122, 1856431235, 1555081692, 3175218132, 1996064986, 2198950837, 2554220882, 3999719339, 2821834349, 766784016, 2952996808, 2566594879, 3210313671, 3203337956, 3336571891, 1034457026, 3584528711, 2466948901, 113926993, 3758326383, 338241895, 168717936, 666307205, 1188179964, 773529912, 1546045734, 1294757372, 1522805485, 1396182291, 2643833823, 1695183700, 2343527390, 1986661051, 1014477480, 2177026350, 1206759142, 2456956037, 344077627, 2730485921, 1290863460, 2820302411, 3158454273, 3259730800, 3505952657, 3345764771, 106217008, 3516065817, 3606008344, 3600352804, 1432725776, 4094571909, 1467031594, 275423344, 851169720, 430227734, 3100823752, 506948616, 1363258195, 659060556, 3750685593, 883997877, 3785050280, 958139571, 3318307427, 1322822218, 3812723403, 1537002063, 2003034995, 1747873779, 3602036899, 1955562222, 1575990012, 2024104815, 1125592928, 2227730452, 2716904306, 2361852424, 442776044, 2428436474, 593698344, 2756734187, 3733110249, 3204031479, 2999351573, 3329325298, 3815920427, 3391569614, 3928383900, 3515267271, 566280711, 3940187606, 3454069534, 4118630271, 4000239992, 116418474, 1914138554, 174292421, 2731055270, 289380356, 3203993006, 460393269, 320620315, 685471733, 587496836, 852142971, 1086792851, 1017036298, 365543100, 1126000580, 2618297676, 1288033470, 3409855158, 1501505948, 4234509866, 1607167915, 987167468, 1816402316, 1246189591]);

    function s(a, c, l, h, f, w, b) {
      for (var C = l[0], M = l[1], N = l[2], $ = l[3], k = l[4], B = l[5], F = l[6], D = l[7], V = h[0], R = h[1], P = h[2], j = h[3], Y = h[4], U = h[5], I = h[6], g = h[7], u, p, v, x, E, S, _, y; b >= 128;) {
        for (var A = 0; A < 16; A++) {
          var G = 8 * A + w;
          a[A] = e.readUint32BE(f, G), c[A] = e.readUint32BE(f, G + 4)
        }
        for (var A = 0; A < 80; A++) {
          var ce = C,
            W = M,
            X = N,
            Z = $,
            ee = k,
            ne = B,
            O = F,
            H = D,
            Q = V,
            de = R,
            ge = P,
            Te = j,
            Oe = Y,
            De = U,
            et = I,
            rt = g;
          if (u = D, p = g, E = p & 65535, S = p >>> 16, _ = u & 65535, y = u >>> 16, u = (k >>> 14 | Y << 18) ^ (k >>> 18 | Y << 14) ^ (Y >>> 9 | k << 23), p = (Y >>> 14 | k << 18) ^ (Y >>> 18 | k << 14) ^ (k >>> 9 | Y << 23), E += p & 65535, S += p >>> 16, _ += u & 65535, y += u >>> 16, u = k & B ^ ~k & F, p = Y & U ^ ~Y & I, E += p & 65535, S += p >>> 16, _ += u & 65535, y += u >>> 16, u = i[A * 2], p = i[A * 2 + 1], E += p & 65535, S += p >>> 16, _ += u & 65535, y += u >>> 16, u = a[A % 16], p = c[A % 16], E += p & 65535, S += p >>> 16, _ += u & 65535, y += u >>> 16, S += E >>> 16, _ += S >>> 16, y += _ >>> 16, v = _ & 65535 | y << 16, x = E & 65535 | S << 16, u = v, p = x, E = p & 65535, S = p >>> 16, _ = u & 65535, y = u >>> 16, u = (C >>> 28 | V << 4) ^ (V >>> 2 | C << 30) ^ (V >>> 7 | C << 25), p = (V >>> 28 | C << 4) ^ (C >>> 2 | V << 30) ^ (C >>> 7 | V << 25), E += p & 65535, S += p >>> 16, _ += u & 65535, y += u >>> 16, u = C & M ^ C & N ^ M & N, p = V & R ^ V & P ^ R & P, E += p & 65535, S += p >>> 16, _ += u & 65535, y += u >>> 16, S += E >>> 16, _ += S >>> 16, y += _ >>> 16, H = _ & 65535 | y << 16, rt = E & 65535 | S << 16, u = Z, p = Te, E = p & 65535, S = p >>> 16, _ = u & 65535, y = u >>> 16, u = v, p = x, E += p & 65535, S += p >>> 16, _ += u & 65535, y += u >>> 16, S += E >>> 16, _ += S >>> 16, y += _ >>> 16, Z = _ & 65535 | y << 16, Te = E & 65535 | S << 16, M = ce, N = W, $ = X, k = Z, B = ee, F = ne, D = O, C = H, R = Q, P = de, j = ge, Y = Te, U = Oe, I = De, g = et, V = rt, A % 16 === 15)
            for (var G = 0; G < 16; G++) u = a[G], p = c[G], E = p & 65535, S = p >>> 16, _ = u & 65535, y = u >>> 16, u = a[(G + 9) % 16], p = c[(G + 9) % 16], E += p & 65535, S += p >>> 16, _ += u & 65535, y += u >>> 16, v = a[(G + 1) % 16], x = c[(G + 1) % 16], u = (v >>> 1 | x << 31) ^ (v >>> 8 | x << 24) ^ v >>> 7, p = (x >>> 1 | v << 31) ^ (x >>> 8 | v << 24) ^ (x >>> 7 | v << 25), E += p & 65535, S += p >>> 16, _ += u & 65535, y += u >>> 16, v = a[(G + 14) % 16], x = c[(G + 14) % 16], u = (v >>> 19 | x << 13) ^ (x >>> 29 | v << 3) ^ v >>> 6, p = (x >>> 19 | v << 13) ^ (v >>> 29 | x << 3) ^ (x >>> 6 | v << 26), E += p & 65535, S += p >>> 16, _ += u & 65535, y += u >>> 16, S += E >>> 16, _ += S >>> 16, y += _ >>> 16, a[G] = _ & 65535 | y << 16, c[G] = E & 65535 | S << 16
        }
        u = C, p = V, E = p & 65535, S = p >>> 16, _ = u & 65535, y = u >>> 16, u = l[0], p = h[0], E += p & 65535, S += p >>> 16, _ += u & 65535, y += u >>> 16, S += E >>> 16, _ += S >>> 16, y += _ >>> 16, l[0] = C = _ & 65535 | y << 16, h[0] = V = E & 65535 | S << 16, u = M, p = R, E = p & 65535, S = p >>> 16, _ = u & 65535, y = u >>> 16, u = l[1], p = h[1], E += p & 65535, S += p >>> 16, _ += u & 65535, y += u >>> 16, S += E >>> 16, _ += S >>> 16, y += _ >>> 16, l[1] = M = _ & 65535 | y << 16, h[1] = R = E & 65535 | S << 16, u = N, p = P, E = p & 65535, S = p >>> 16, _ = u & 65535, y = u >>> 16, u = l[2], p = h[2], E += p & 65535, S += p >>> 16, _ += u & 65535, y += u >>> 16, S += E >>> 16, _ += S >>> 16, y += _ >>> 16, l[2] = N = _ & 65535 | y << 16, h[2] = P = E & 65535 | S << 16, u = $, p = j, E = p & 65535, S = p >>> 16, _ = u & 65535, y = u >>> 16, u = l[3], p = h[3], E += p & 65535, S += p >>> 16, _ += u & 65535, y += u >>> 16, S += E >>> 16, _ += S >>> 16, y += _ >>> 16, l[3] = $ = _ & 65535 | y << 16, h[3] = j = E & 65535 | S << 16, u = k, p = Y, E = p & 65535, S = p >>> 16, _ = u & 65535, y = u >>> 16, u = l[4], p = h[4], E += p & 65535, S += p >>> 16, _ += u & 65535, y += u >>> 16, S += E >>> 16, _ += S >>> 16, y += _ >>> 16, l[4] = k = _ & 65535 | y << 16, h[4] = Y = E & 65535 | S << 16, u = B, p = U, E = p & 65535, S = p >>> 16, _ = u & 65535, y = u >>> 16, u = l[5], p = h[5], E += p & 65535, S += p >>> 16, _ += u & 65535, y += u >>> 16, S += E >>> 16, _ += S >>> 16, y += _ >>> 16, l[5] = B = _ & 65535 | y << 16, h[5] = U = E & 65535 | S << 16, u = F, p = I, E = p & 65535, S = p >>> 16, _ = u & 65535, y = u >>> 16, u = l[6], p = h[6], E += p & 65535, S += p >>> 16, _ += u & 65535, y += u >>> 16, S += E >>> 16, _ += S >>> 16, y += _ >>> 16, l[6] = F = _ & 65535 | y << 16, h[6] = I = E & 65535 | S << 16, u = D, p = g, E = p & 65535, S = p >>> 16, _ = u & 65535, y = u >>> 16, u = l[7], p = h[7], E += p & 65535, S += p >>> 16, _ += u & 65535, y += u >>> 16, S += E >>> 16, _ += S >>> 16, y += _ >>> 16, l[7] = D = _ & 65535 | y << 16, h[7] = g = E & 65535 | S << 16, w += 128, b -= 128
      }
      return w
    }

    function o(a) {
      var c = new n;
      c.update(a);
      var l = c.digest();
      return c.clean(), l
    }
    t.hash = o
  })(G$),
  function (t) {
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.convertSecretKeyToX25519 = t.convertPublicKeyToX25519 = t.verify = t.sign = t.extractPublicKeyFromSecretKey = t.generateKeyPair = t.generateKeyPairFromSeed = t.SEED_LENGTH = t.SECRET_KEY_LENGTH = t.PUBLIC_KEY_LENGTH = t.SIGNATURE_LENGTH = void 0;
    const e = vh,
      r = G$,
      n = Bo;
    t.SIGNATURE_LENGTH = 64, t.PUBLIC_KEY_LENGTH = 32, t.SECRET_KEY_LENGTH = 64, t.SEED_LENGTH = 32;

    function i(Z) {
      const ee = new Float64Array(16);
      if (Z)
        for (let ne = 0; ne < Z.length; ne++) ee[ne] = Z[ne];
      return ee
    }
    const s = new Uint8Array(32);
    s[0] = 9;
    const o = i(),
      a = i([1]),
      c = i([30883, 4953, 19914, 30187, 55467, 16705, 2637, 112, 59544, 30585, 16505, 36039, 65139, 11119, 27886, 20995]),
      l = i([61785, 9906, 39828, 60374, 45398, 33411, 5274, 224, 53552, 61171, 33010, 6542, 64743, 22239, 55772, 9222]),
      h = i([54554, 36645, 11616, 51542, 42930, 38181, 51040, 26924, 56412, 64982, 57905, 49316, 21502, 52590, 14035, 8553]),
      f = i([26200, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214, 26214]),
      w = i([41136, 18958, 6951, 50414, 58488, 44335, 6150, 12099, 55207, 15867, 153, 11085, 57099, 20417, 9344, 11139]);

    function b(Z, ee) {
      for (let ne = 0; ne < 16; ne++) Z[ne] = ee[ne] | 0
    }

    function C(Z) {
      let ee = 1;
      for (let ne = 0; ne < 16; ne++) {
        let O = Z[ne] + ee + 65535;
        ee = Math.floor(O / 65536), Z[ne] = O - ee * 65536
      }
      Z[0] += ee - 1 + 37 * (ee - 1)
    }

    function M(Z, ee, ne) {
      const O = ~(ne - 1);
      for (let H = 0; H < 16; H++) {
        const Q = O & (Z[H] ^ ee[H]);
        Z[H] ^= Q, ee[H] ^= Q
      }
    }

    function N(Z, ee) {
      const ne = i(),
        O = i();
      for (let H = 0; H < 16; H++) O[H] = ee[H];
      C(O), C(O), C(O);
      for (let H = 0; H < 2; H++) {
        ne[0] = O[0] - 65517;
        for (let de = 1; de < 15; de++) ne[de] = O[de] - 65535 - (ne[de - 1] >> 16 & 1), ne[de - 1] &= 65535;
        ne[15] = O[15] - 32767 - (ne[14] >> 16 & 1);
        const Q = ne[15] >> 16 & 1;
        ne[14] &= 65535, M(O, ne, 1 - Q)
      }
      for (let H = 0; H < 16; H++) Z[2 * H] = O[H] & 255, Z[2 * H + 1] = O[H] >> 8
    }

    function $(Z, ee) {
      let ne = 0;
      for (let O = 0; O < 32; O++) ne |= Z[O] ^ ee[O];
      return (1 & ne - 1 >>> 8) - 1
    }

    function k(Z, ee) {
      const ne = new Uint8Array(32),
        O = new Uint8Array(32);
      return N(ne, Z), N(O, ee), $(ne, O)
    }

    function B(Z) {
      const ee = new Uint8Array(32);
      return N(ee, Z), ee[0] & 1
    }

    function F(Z, ee) {
      for (let ne = 0; ne < 16; ne++) Z[ne] = ee[2 * ne] + (ee[2 * ne + 1] << 8);
      Z[15] &= 32767
    }

    function D(Z, ee, ne) {
      for (let O = 0; O < 16; O++) Z[O] = ee[O] + ne[O]
    }

    function V(Z, ee, ne) {
      for (let O = 0; O < 16; O++) Z[O] = ee[O] - ne[O]
    }

    function R(Z, ee, ne) {
      let O, H, Q = 0,
        de = 0,
        ge = 0,
        Te = 0,
        Oe = 0,
        De = 0,
        et = 0,
        rt = 0,
        Ze = 0,
        qe = 0,
        He = 0,
        we = 0,
        xe = 0,
        Ie = 0,
        Pe = 0,
        J = 0,
        L = 0,
        z = 0,
        ie = 0,
        ue = 0,
        me = 0,
        be = 0,
        Le = 0,
        ze = 0,
        Qe = 0,
        Xe = 0,
        Je = 0,
        kt = 0,
        Ut = 0,
        Ft = 0,
        Wt = 0,
        pt = ne[0],
        ct = ne[1],
        gt = ne[2],
        mt = ne[3],
        ht = ne[4],
        lt = ne[5],
        xt = ne[6],
        Ct = ne[7],
        wt = ne[8],
        Et = ne[9],
        vt = ne[10],
        yt = ne[11],
        bt = ne[12],
        st = ne[13],
        At = ne[14],
        St = ne[15];
      O = ee[0], Q += O * pt, de += O * ct, ge += O * gt, Te += O * mt, Oe += O * ht, De += O * lt, et += O * xt, rt += O * Ct, Ze += O * wt, qe += O * Et, He += O * vt, we += O * yt, xe += O * bt, Ie += O * st, Pe += O * At, J += O * St, O = ee[1], de += O * pt, ge += O * ct, Te += O * gt, Oe += O * mt, De += O * ht, et += O * lt, rt += O * xt, Ze += O * Ct, qe += O * wt, He += O * Et, we += O * vt, xe += O * yt, Ie += O * bt, Pe += O * st, J += O * At, L += O * St, O = ee[2], ge += O * pt, Te += O * ct, Oe += O * gt, De += O * mt, et += O * ht, rt += O * lt, Ze += O * xt, qe += O * Ct, He += O * wt, we += O * Et, xe += O * vt, Ie += O * yt, Pe += O * bt, J += O * st, L += O * At, z += O * St, O = ee[3], Te += O * pt, Oe += O * ct, De += O * gt, et += O * mt, rt += O * ht, Ze += O * lt, qe += O * xt, He += O * Ct, we += O * wt, xe += O * Et, Ie += O * vt, Pe += O * yt, J += O * bt, L += O * st, z += O * At, ie += O * St, O = ee[4], Oe += O * pt, De += O * ct, et += O * gt, rt += O * mt, Ze += O * ht, qe += O * lt, He += O * xt, we += O * Ct, xe += O * wt, Ie += O * Et, Pe += O * vt, J += O * yt, L += O * bt, z += O * st, ie += O * At, ue += O * St, O = ee[5], De += O * pt, et += O * ct, rt += O * gt, Ze += O * mt, qe += O * ht, He += O * lt, we += O * xt, xe += O * Ct, Ie += O * wt, Pe += O * Et, J += O * vt, L += O * yt, z += O * bt, ie += O * st, ue += O * At, me += O * St, O = ee[6], et += O * pt, rt += O * ct, Ze += O * gt, qe += O * mt, He += O * ht, we += O * lt, xe += O * xt, Ie += O * Ct, Pe += O * wt, J += O * Et, L += O * vt, z += O * yt, ie += O * bt, ue += O * st, me += O * At, be += O * St, O = ee[7], rt += O * pt, Ze += O * ct, qe += O * gt, He += O * mt, we += O * ht, xe += O * lt, Ie += O * xt, Pe += O * Ct, J += O * wt, L += O * Et, z += O * vt, ie += O * yt, ue += O * bt, me += O * st, be += O * At, Le += O * St, O = ee[8], Ze += O * pt, qe += O * ct, He += O * gt, we += O * mt, xe += O * ht, Ie += O * lt, Pe += O * xt, J += O * Ct, L += O * wt, z += O * Et, ie += O * vt, ue += O * yt, me += O * bt, be += O * st, Le += O * At, ze += O * St, O = ee[9], qe += O * pt, He += O * ct, we += O * gt, xe += O * mt, Ie += O * ht, Pe += O * lt, J += O * xt, L += O * Ct, z += O * wt, ie += O * Et, ue += O * vt, me += O * yt, be += O * bt, Le += O * st, ze += O * At, Qe += O * St, O = ee[10], He += O * pt, we += O * ct, xe += O * gt, Ie += O * mt, Pe += O * ht, J += O * lt, L += O * xt, z += O * Ct, ie += O * wt, ue += O * Et, me += O * vt, be += O * yt, Le += O * bt, ze += O * st, Qe += O * At, Xe += O * St, O = ee[11], we += O * pt, xe += O * ct, Ie += O * gt, Pe += O * mt, J += O * ht, L += O * lt, z += O * xt, ie += O * Ct, ue += O * wt, me += O * Et, be += O * vt, Le += O * yt, ze += O * bt, Qe += O * st, Xe += O * At, Je += O * St, O = ee[12], xe += O * pt, Ie += O * ct, Pe += O * gt, J += O * mt, L += O * ht, z += O * lt, ie += O * xt, ue += O * Ct, me += O * wt, be += O * Et, Le += O * vt, ze += O * yt, Qe += O * bt, Xe += O * st, Je += O * At, kt += O * St, O = ee[13], Ie += O * pt, Pe += O * ct, J += O * gt, L += O * mt, z += O * ht, ie += O * lt, ue += O * xt, me += O * Ct, be += O * wt, Le += O * Et, ze += O * vt, Qe += O * yt, Xe += O * bt, Je += O * st, kt += O * At, Ut += O * St, O = ee[14], Pe += O * pt, J += O * ct, L += O * gt, z += O * mt, ie += O * ht, ue += O * lt, me += O * xt, be += O * Ct, Le += O * wt, ze += O * Et, Qe += O * vt, Xe += O * yt, Je += O * bt, kt += O * st, Ut += O * At, Ft += O * St, O = ee[15], J += O * pt, L += O * ct, z += O * gt, ie += O * mt, ue += O * ht, me += O * lt, be += O * xt, Le += O * Ct, ze += O * wt, Qe += O * Et, Xe += O * vt, Je += O * yt, kt += O * bt, Ut += O * st, Ft += O * At, Wt += O * St, Q += 38 * L, de += 38 * z, ge += 38 * ie, Te += 38 * ue, Oe += 38 * me, De += 38 * be, et += 38 * Le, rt += 38 * ze, Ze += 38 * Qe, qe += 38 * Xe, He += 38 * Je, we += 38 * kt, xe += 38 * Ut, Ie += 38 * Ft, Pe += 38 * Wt, H = 1, O = Q + H + 65535, H = Math.floor(O / 65536), Q = O - H * 65536, O = de + H + 65535, H = Math.floor(O / 65536), de = O - H * 65536, O = ge + H + 65535, H = Math.floor(O / 65536), ge = O - H * 65536, O = Te + H + 65535, H = Math.floor(O / 65536), Te = O - H * 65536, O = Oe + H + 65535, H = Math.floor(O / 65536), Oe = O - H * 65536, O = De + H + 65535, H = Math.floor(O / 65536), De = O - H * 65536, O = et + H + 65535, H = Math.floor(O / 65536), et = O - H * 65536, O = rt + H + 65535, H = Math.floor(O / 65536), rt = O - H * 65536, O = Ze + H + 65535, H = Math.floor(O / 65536), Ze = O - H * 65536, O = qe + H + 65535, H = Math.floor(O / 65536), qe = O - H * 65536, O = He + H + 65535, H = Math.floor(O / 65536), He = O - H * 65536, O = we + H + 65535, H = Math.floor(O / 65536), we = O - H * 65536, O = xe + H + 65535, H = Math.floor(O / 65536), xe = O - H * 65536, O = Ie + H + 65535, H = Math.floor(O / 65536), Ie = O - H * 65536, O = Pe + H + 65535, H = Math.floor(O / 65536), Pe = O - H * 65536, O = J + H + 65535, H = Math.floor(O / 65536), J = O - H * 65536, Q += H - 1 + 37 * (H - 1), H = 1, O = Q + H + 65535, H = Math.floor(O / 65536), Q = O - H * 65536, O = de + H + 65535, H = Math.floor(O / 65536), de = O - H * 65536, O = ge + H + 65535, H = Math.floor(O / 65536), ge = O - H * 65536, O = Te + H + 65535, H = Math.floor(O / 65536), Te = O - H * 65536, O = Oe + H + 65535, H = Math.floor(O / 65536), Oe = O - H * 65536, O = De + H + 65535, H = Math.floor(O / 65536), De = O - H * 65536, O = et + H + 65535, H = Math.floor(O / 65536), et = O - H * 65536, O = rt + H + 65535, H = Math.floor(O / 65536), rt = O - H * 65536, O = Ze + H + 65535, H = Math.floor(O / 65536), Ze = O - H * 65536, O = qe + H + 65535, H = Math.floor(O / 65536), qe = O - H * 65536, O = He + H + 65535, H = Math.floor(O / 65536), He = O - H * 65536, O = we + H + 65535, H = Math.floor(O / 65536), we = O - H * 65536, O = xe + H + 65535, H = Math.floor(O / 65536), xe = O - H * 65536, O = Ie + H + 65535, H = Math.floor(O / 65536), Ie = O - H * 65536, O = Pe + H + 65535, H = Math.floor(O / 65536), Pe = O - H * 65536, O = J + H + 65535, H = Math.floor(O / 65536), J = O - H * 65536, Q += H - 1 + 37 * (H - 1), Z[0] = Q, Z[1] = de, Z[2] = ge, Z[3] = Te, Z[4] = Oe, Z[5] = De, Z[6] = et, Z[7] = rt, Z[8] = Ze, Z[9] = qe, Z[10] = He, Z[11] = we, Z[12] = xe, Z[13] = Ie, Z[14] = Pe, Z[15] = J
    }

    function P(Z, ee) {
      R(Z, ee, ee)
    }

    function j(Z, ee) {
      const ne = i();
      let O;
      for (O = 0; O < 16; O++) ne[O] = ee[O];
      for (O = 253; O >= 0; O--) P(ne, ne), O !== 2 && O !== 4 && R(ne, ne, ee);
      for (O = 0; O < 16; O++) Z[O] = ne[O]
    }

    function Y(Z, ee) {
      const ne = i();
      let O;
      for (O = 0; O < 16; O++) ne[O] = ee[O];
      for (O = 250; O >= 0; O--) P(ne, ne), O !== 1 && R(ne, ne, ee);
      for (O = 0; O < 16; O++) Z[O] = ne[O]
    }

    function U(Z, ee) {
      const ne = i(),
        O = i(),
        H = i(),
        Q = i(),
        de = i(),
        ge = i(),
        Te = i(),
        Oe = i(),
        De = i();
      V(ne, Z[1], Z[0]), V(De, ee[1], ee[0]), R(ne, ne, De), D(O, Z[0], Z[1]), D(De, ee[0], ee[1]), R(O, O, De), R(H, Z[3], ee[3]), R(H, H, l), R(Q, Z[2], ee[2]), D(Q, Q, Q), V(de, O, ne), V(ge, Q, H), D(Te, Q, H), D(Oe, O, ne), R(Z[0], de, ge), R(Z[1], Oe, Te), R(Z[2], Te, ge), R(Z[3], de, Oe)
    }

    function I(Z, ee, ne) {
      for (let O = 0; O < 4; O++) M(Z[O], ee[O], ne)
    }

    function g(Z, ee) {
      const ne = i(),
        O = i(),
        H = i();
      j(H, ee[2]), R(ne, ee[0], H), R(O, ee[1], H), N(Z, O), Z[31] ^= B(ne) << 7
    }

    function u(Z, ee, ne) {
      b(Z[0], o), b(Z[1], a), b(Z[2], a), b(Z[3], o);
      for (let O = 255; O >= 0; --O) {
        const H = ne[O / 8 | 0] >> (O & 7) & 1;
        I(Z, ee, H), U(ee, Z), U(Z, Z), I(Z, ee, H)
      }
    }

    function p(Z, ee) {
      const ne = [i(), i(), i(), i()];
      b(ne[0], h), b(ne[1], f), b(ne[2], a), R(ne[3], h, f), u(Z, ne, ee)
    }

    function v(Z) {
      if (Z.length !== t.SEED_LENGTH) throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);
      const ee = (0, r.hash)(Z);
      ee[0] &= 248, ee[31] &= 127, ee[31] |= 64;
      const ne = new Uint8Array(32),
        O = [i(), i(), i(), i()];
      p(O, ee), g(ne, O);
      const H = new Uint8Array(64);
      return H.set(Z), H.set(ne, 32), {
        publicKey: ne,
        secretKey: H
      }
    }
    t.generateKeyPairFromSeed = v;

    function x(Z) {
      const ee = (0, e.randomBytes)(32, Z),
        ne = v(ee);
      return (0, n.wipe)(ee), ne
    }
    t.generateKeyPair = x;

    function E(Z) {
      if (Z.length !== t.SECRET_KEY_LENGTH) throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);
      return new Uint8Array(Z.subarray(32))
    }
    t.extractPublicKeyFromSecretKey = E;
    const S = new Float64Array([237, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16]);

    function _(Z, ee) {
      let ne, O, H, Q;
      for (O = 63; O >= 32; --O) {
        for (ne = 0, H = O - 32, Q = O - 12; H < Q; ++H) ee[H] += ne - 16 * ee[O] * S[H - (O - 32)], ne = Math.floor((ee[H] + 128) / 256), ee[H] -= ne * 256;
        ee[H] += ne, ee[O] = 0
      }
      for (ne = 0, H = 0; H < 32; H++) ee[H] += ne - (ee[31] >> 4) * S[H], ne = ee[H] >> 8, ee[H] &= 255;
      for (H = 0; H < 32; H++) ee[H] -= ne * S[H];
      for (O = 0; O < 32; O++) ee[O + 1] += ee[O] >> 8, Z[O] = ee[O] & 255
    }

    function y(Z) {
      const ee = new Float64Array(64);
      for (let ne = 0; ne < 64; ne++) ee[ne] = Z[ne];
      for (let ne = 0; ne < 64; ne++) Z[ne] = 0;
      _(Z, ee)
    }

    function A(Z, ee) {
      const ne = new Float64Array(64),
        O = [i(), i(), i(), i()],
        H = (0, r.hash)(Z.subarray(0, 32));
      H[0] &= 248, H[31] &= 127, H[31] |= 64;
      const Q = new Uint8Array(64);
      Q.set(H.subarray(32), 32);
      const de = new r.SHA512;
      de.update(Q.subarray(32)), de.update(ee);
      const ge = de.digest();
      de.clean(), y(ge), p(O, ge), g(Q, O), de.reset(), de.update(Q.subarray(0, 32)), de.update(Z.subarray(32)), de.update(ee);
      const Te = de.digest();
      y(Te);
      for (let Oe = 0; Oe < 32; Oe++) ne[Oe] = ge[Oe];
      for (let Oe = 0; Oe < 32; Oe++)
        for (let De = 0; De < 32; De++) ne[Oe + De] += Te[Oe] * H[De];
      return _(Q.subarray(32), ne), Q
    }
    t.sign = A;

    function G(Z, ee) {
      const ne = i(),
        O = i(),
        H = i(),
        Q = i(),
        de = i(),
        ge = i(),
        Te = i();
      return b(Z[2], a), F(Z[1], ee), P(H, Z[1]), R(Q, H, c), V(H, H, Z[2]), D(Q, Z[2], Q), P(de, Q), P(ge, de), R(Te, ge, de), R(ne, Te, H), R(ne, ne, Q), Y(ne, ne), R(ne, ne, H), R(ne, ne, Q), R(ne, ne, Q), R(Z[0], ne, Q), P(O, Z[0]), R(O, O, Q), k(O, H) && R(Z[0], Z[0], w), P(O, Z[0]), R(O, O, Q), k(O, H) ? -1 : (B(Z[0]) === ee[31] >> 7 && V(Z[0], o, Z[0]), R(Z[3], Z[0], Z[1]), 0)
    }

    function ce(Z, ee, ne) {
      const O = new Uint8Array(32),
        H = [i(), i(), i(), i()],
        Q = [i(), i(), i(), i()];
      if (ne.length !== t.SIGNATURE_LENGTH) throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);
      if (G(Q, Z)) return !1;
      const de = new r.SHA512;
      de.update(ne.subarray(0, 32)), de.update(Z), de.update(ee);
      const ge = de.digest();
      return y(ge), u(H, Q, ge), p(Q, ne.subarray(32)), U(H, Q), g(O, H), !$(ne, O)
    }
    t.verify = ce;

    function W(Z) {
      let ee = [i(), i(), i(), i()];
      if (G(ee, Z)) throw new Error("Ed25519: invalid public key");
      let ne = i(),
        O = i(),
        H = ee[1];
      D(ne, a, H), V(O, a, H), j(O, O), R(ne, ne, O);
      let Q = new Uint8Array(32);
      return N(Q, ne), Q
    }
    t.convertPublicKeyToX25519 = W;

    function X(Z) {
      const ee = (0, r.hash)(Z.subarray(0, 32));
      ee[0] &= 248, ee[31] &= 127, ee[31] |= 64;
      const ne = new Uint8Array(ee.subarray(0, 32));
      return (0, n.wipe)(ee), ne
    }
    t.convertSecretKeyToX25519 = X
  }(eC);
  const sfe = "EdDSA",
    ofe = "JWT",
    R5 = ".",
    N5 = "base64url",
    Z$ = "utf8",
    Y$ = "utf8",
    afe = ":",
    cfe = "did",
    lfe = "key",
    Q$ = "base58btc",
    ufe = "z",
    dfe = "K36",
    hfe = 32;

  function sC(t) {
    return globalThis.Buffer != null ? new Uint8Array(t.buffer, t.byteOffset, t.byteLength) : t
  }

  function J$(t = 0) {
    return globalThis.Buffer != null && globalThis.Buffer.allocUnsafe != null ? sC(globalThis.Buffer.allocUnsafe(t)) : new Uint8Array(t)
  }

  function ffe(t, e) {
    e || (e = t.reduce((i, s) => i + s.length, 0));
    const r = J$(e);
    let n = 0;
    for (const i of t) r.set(i, n), n += i.length;
    return sC(r)
  }

  function pfe(t, e) {
    if (t.length >= 255) throw new TypeError("Alphabet too long");
    for (var r = new Uint8Array(256), n = 0; n < r.length; n++) r[n] = 255;
    for (var i = 0; i < t.length; i++) {
      var s = t.charAt(i),
        o = s.charCodeAt(0);
      if (r[o] !== 255) throw new TypeError(s + " is ambiguous");
      r[o] = i
    }
    var a = t.length,
      c = t.charAt(0),
      l = Math.log(a) / Math.log(256),
      h = Math.log(256) / Math.log(a);

    function f(C) {
      if (C instanceof Uint8Array || (ArrayBuffer.isView(C) ? C = new Uint8Array(C.buffer, C.byteOffset, C.byteLength) : Array.isArray(C) && (C = Uint8Array.from(C))), !(C instanceof Uint8Array)) throw new TypeError("Expected Uint8Array");
      if (C.length === 0) return "";
      for (var M = 0, N = 0, $ = 0, k = C.length; $ !== k && C[$] === 0;) $++, M++;
      for (var B = (k - $) * h + 1 >>> 0, F = new Uint8Array(B); $ !== k;) {
        for (var D = C[$], V = 0, R = B - 1;
          (D !== 0 || V < N) && R !== -1; R--, V++) D += 256 * F[R] >>> 0, F[R] = D % a >>> 0, D = D / a >>> 0;
        if (D !== 0) throw new Error("Non-zero carry");
        N = V, $++
      }
      for (var P = B - N; P !== B && F[P] === 0;) P++;
      for (var j = c.repeat(M); P < B; ++P) j += t.charAt(F[P]);
      return j
    }

    function w(C) {
      if (typeof C != "string") throw new TypeError("Expected String");
      if (C.length === 0) return new Uint8Array;
      var M = 0;
      if (C[M] !== " ") {
        for (var N = 0, $ = 0; C[M] === c;) N++, M++;
        for (var k = (C.length - M) * l + 1 >>> 0, B = new Uint8Array(k); C[M];) {
          var F = r[C.charCodeAt(M)];
          if (F === 255) return;
          for (var D = 0, V = k - 1;
            (F !== 0 || D < $) && V !== -1; V--, D++) F += a * B[V] >>> 0, B[V] = F % 256 >>> 0, F = F / 256 >>> 0;
          if (F !== 0) throw new Error("Non-zero carry");
          $ = D, M++
        }
        if (C[M] !== " ") {
          for (var R = k - $; R !== k && B[R] === 0;) R++;
          for (var P = new Uint8Array(N + (k - R)), j = N; R !== k;) P[j++] = B[R++];
          return P
        }
      }
    }

    function b(C) {
      var M = w(C);
      if (M) return M;
      throw new Error(`Non-${e} character`)
    }
    return {
      encode: f,
      decodeUnsafe: w,
      decode: b
    }
  }
  var gfe = pfe,
    mfe = gfe;
  const wfe = t => {
      if (t instanceof Uint8Array && t.constructor.name === "Uint8Array") return t;
      if (t instanceof ArrayBuffer) return new Uint8Array(t);
      if (ArrayBuffer.isView(t)) return new Uint8Array(t.buffer, t.byteOffset, t.byteLength);
      throw new Error("Unknown type, must be binary type")
    },
    vfe = t => new TextEncoder().encode(t),
    bfe = t => new TextDecoder().decode(t);
  class yfe {
    constructor(e, r, n) {
      this.name = e, this.prefix = r, this.baseEncode = n
    }
    encode(e) {
      if (e instanceof Uint8Array) return `${this.prefix}${this.baseEncode(e)}`;
      throw Error("Unknown type, must be binary type")
    }
  }
  class _fe {
    constructor(e, r, n) {
      if (this.name = e, this.prefix = r, r.codePointAt(0) === void 0) throw new Error("Invalid prefix character");
      this.prefixCodePoint = r.codePointAt(0), this.baseDecode = n
    }
    decode(e) {
      if (typeof e == "string") {
        if (e.codePointAt(0) !== this.prefixCodePoint) throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);
        return this.baseDecode(e.slice(this.prefix.length))
      } else throw Error("Can only multibase decode strings")
    }
    or(e) {
      return X$(this, e)
    }
  }
  class xfe {
    constructor(e) {
      this.decoders = e
    }
    or(e) {
      return X$(this, e)
    }
    decode(e) {
      const r = e[0],
        n = this.decoders[r];
      if (n) return n.decode(e);
      throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)
    }
  }
  const X$ = (t, e) => new xfe({
    ...t.decoders || {
      [t.prefix]: t
    },
    ...e.decoders || {
      [e.prefix]: e
    }
  });
  class Cfe {
    constructor(e, r, n, i) {
      this.name = e, this.prefix = r, this.baseEncode = n, this.baseDecode = i, this.encoder = new yfe(e, r, n), this.decoder = new _fe(e, r, i)
    }
    encode(e) {
      return this.encoder.encode(e)
    }
    decode(e) {
      return this.decoder.decode(e)
    }
  }
  const M5 = ({
      name: t,
      prefix: e,
      encode: r,
      decode: n
    }) => new Cfe(t, e, r, n),
    H2 = ({
      prefix: t,
      name: e,
      alphabet: r
    }) => {
      const {
        encode: n,
        decode: i
      } = mfe(r, e);
      return M5({
        prefix: t,
        name: e,
        encode: n,
        decode: s => wfe(i(s))
      })
    },
    Efe = (t, e, r, n) => {
      const i = {};
      for (let h = 0; h < e.length; ++h) i[e[h]] = h;
      let s = t.length;
      for (; t[s - 1] === "=";) --s;
      const o = new Uint8Array(s * r / 8 | 0);
      let a = 0,
        c = 0,
        l = 0;
      for (let h = 0; h < s; ++h) {
        const f = i[t[h]];
        if (f === void 0) throw new SyntaxError(`Non-${n} character`);
        c = c << r | f, a += r, a >= 8 && (a -= 8, o[l++] = 255 & c >> a)
      }
      if (a >= r || 255 & c << 8 - a) throw new SyntaxError("Unexpected end of data");
      return o
    },
    Afe = (t, e, r) => {
      const n = e[e.length - 1] === "=",
        i = (1 << r) - 1;
      let s = "",
        o = 0,
        a = 0;
      for (let c = 0; c < t.length; ++c)
        for (a = a << 8 | t[c], o += 8; o > r;) o -= r, s += e[i & a >> o];
      if (o && (s += e[i & a << r - o]), n)
        for (; s.length * r & 7;) s += "=";
      return s
    },
    rs = ({
      name: t,
      prefix: e,
      bitsPerChar: r,
      alphabet: n
    }) => M5({
      prefix: e,
      name: t,
      encode(i) {
        return Afe(i, n, r)
      },
      decode(i) {
        return Efe(i, n, r, t)
      }
    }),
    Sfe = M5({
      prefix: "\0",
      name: "identity",
      encode: t => bfe(t),
      decode: t => vfe(t)
    }),
    Ife = Object.freeze(Object.defineProperty({
      __proto__: null,
      identity: Sfe
    }, Symbol.toStringTag, {
      value: "Module"
    })),
    Tfe = rs({
      prefix: "0",
      name: "base2",
      alphabet: "01",
      bitsPerChar: 1
    }),
    kfe = Object.freeze(Object.defineProperty({
      __proto__: null,
      base2: Tfe
    }, Symbol.toStringTag, {
      value: "Module"
    })),
    Rfe = rs({
      prefix: "7",
      name: "base8",
      alphabet: "01234567",
      bitsPerChar: 3
    }),
    Nfe = Object.freeze(Object.defineProperty({
      __proto__: null,
      base8: Rfe
    }, Symbol.toStringTag, {
      value: "Module"
    })),
    Mfe = H2({
      prefix: "9",
      name: "base10",
      alphabet: "0123456789"
    }),
    Pfe = Object.freeze(Object.defineProperty({
      __proto__: null,
      base10: Mfe
    }, Symbol.toStringTag, {
      value: "Module"
    })),
    $fe = rs({
      prefix: "f",
      name: "base16",
      alphabet: "0123456789abcdef",
      bitsPerChar: 4
    }),
    Ofe = rs({
      prefix: "F",
      name: "base16upper",
      alphabet: "0123456789ABCDEF",
      bitsPerChar: 4
    }),
    Dfe = Object.freeze(Object.defineProperty({
      __proto__: null,
      base16: $fe,
      base16upper: Ofe
    }, Symbol.toStringTag, {
      value: "Module"
    })),
    Lfe = rs({
      prefix: "b",
      name: "base32",
      alphabet: "abcdefghijklmnopqrstuvwxyz234567",
      bitsPerChar: 5
    }),
    Bfe = rs({
      prefix: "B",
      name: "base32upper",
      alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",
      bitsPerChar: 5
    }),
    Ufe = rs({
      prefix: "c",
      name: "base32pad",
      alphabet: "abcdefghijklmnopqrstuvwxyz234567=",
      bitsPerChar: 5
    }),
    jfe = rs({
      prefix: "C",
      name: "base32padupper",
      alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",
      bitsPerChar: 5
    }),
    Ffe = rs({
      prefix: "v",
      name: "base32hex",
      alphabet: "0123456789abcdefghijklmnopqrstuv",
      bitsPerChar: 5
    }),
    Wfe = rs({
      prefix: "V",
      name: "base32hexupper",
      alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV",
      bitsPerChar: 5
    }),
    zfe = rs({
      prefix: "t",
      name: "base32hexpad",
      alphabet: "0123456789abcdefghijklmnopqrstuv=",
      bitsPerChar: 5
    }),
    Hfe = rs({
      prefix: "T",
      name: "base32hexpadupper",
      alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV=",
      bitsPerChar: 5
    }),
    qfe = rs({
      prefix: "h",
      name: "base32z",
      alphabet: "ybndrfg8ejkmcpqxot1uwisza345h769",
      bitsPerChar: 5
    }),
    Vfe = Object.freeze(Object.defineProperty({
      __proto__: null,
      base32: Lfe,
      base32hex: Ffe,
      base32hexpad: zfe,
      base32hexpadupper: Hfe,
      base32hexupper: Wfe,
      base32pad: Ufe,
      base32padupper: jfe,
      base32upper: Bfe,
      base32z: qfe
    }, Symbol.toStringTag, {
      value: "Module"
    })),
    Kfe = H2({
      prefix: "k",
      name: "base36",
      alphabet: "0123456789abcdefghijklmnopqrstuvwxyz"
    }),
    Gfe = H2({
      prefix: "K",
      name: "base36upper",
      alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    }),
    Zfe = Object.freeze(Object.defineProperty({
      __proto__: null,
      base36: Kfe,
      base36upper: Gfe
    }, Symbol.toStringTag, {
      value: "Module"
    })),
    Yfe = H2({
      name: "base58btc",
      prefix: "z",
      alphabet: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
    }),
    Qfe = H2({
      name: "base58flickr",
      prefix: "Z",
      alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"
    }),
    Jfe = Object.freeze(Object.defineProperty({
      __proto__: null,
      base58btc: Yfe,
      base58flickr: Qfe
    }, Symbol.toStringTag, {
      value: "Module"
    })),
    Xfe = rs({
      prefix: "m",
      name: "base64",
      alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
      bitsPerChar: 6
    }),
    e0e = rs({
      prefix: "M",
      name: "base64pad",
      alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
      bitsPerChar: 6
    }),
    t0e = rs({
      prefix: "u",
      name: "base64url",
      alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
      bitsPerChar: 6
    }),
    r0e = rs({
      prefix: "U",
      name: "base64urlpad",
      alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",
      bitsPerChar: 6
    }),
    n0e = Object.freeze(Object.defineProperty({
      __proto__: null,
      base64: Xfe,
      base64pad: e0e,
      base64url: t0e,
      base64urlpad: r0e
    }, Symbol.toStringTag, {
      value: "Module"
    })),
    eO = Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),
    i0e = eO.reduce((t, e, r) => (t[r] = e, t), []),
    s0e = eO.reduce((t, e, r) => (t[e.codePointAt(0)] = r, t), []);

  function o0e(t) {
    return t.reduce((e, r) => (e += i0e[r], e), "")
  }

  function a0e(t) {
    const e = [];
    for (const r of t) {
      const n = s0e[r.codePointAt(0)];
      if (n === void 0) throw new Error(`Non-base256emoji character: ${r}`);
      e.push(n)
    }
    return new Uint8Array(e)
  }
  const c0e = M5({
      prefix: "🚀",
      name: "base256emoji",
      encode: o0e,
      decode: a0e
    }),
    l0e = Object.freeze(Object.defineProperty({
      __proto__: null,
      base256emoji: c0e
    }, Symbol.toStringTag, {
      value: "Module"
    }));
  new TextEncoder, new TextDecoder;
  const P5 = {
    ...Ife,
    ...kfe,
    ...Nfe,
    ...Pfe,
    ...Dfe,
    ...Vfe,
    ...Zfe,
    ...Jfe,
    ...n0e,
    ...l0e
  };

  function tO(t, e, r, n) {
    return {
      name: t,
      prefix: e,
      encoder: {
        name: t,
        prefix: e,
        encode: r
      },
      decoder: {
        decode: n
      }
    }
  }
  const rO = tO("utf8", "u", t => "u" + new TextDecoder("utf8").decode(t), t => new TextEncoder().encode(t.substring(1))),
    oC = tO("ascii", "a", t => {
      let e = "a";
      for (let r = 0; r < t.length; r++) e += String.fromCharCode(t[r]);
      return e
    }, t => {
      t = t.substring(1);
      const e = J$(t.length);
      for (let r = 0; r < t.length; r++) e[r] = t.charCodeAt(r);
      return e
    }),
    nO = {
      utf8: rO,
      "utf-8": rO,
      hex: P5.base16,
      latin1: oC,
      ascii: oC,
      binary: oC,
      ...P5
    };

  function $5(t, e = "utf8") {
    const r = nO[e];
    if (!r) throw new Error(`Unsupported encoding "${e}"`);
    return (e === "utf8" || e === "utf-8") && globalThis.Buffer != null && globalThis.Buffer.from != null ? globalThis.Buffer.from(t.buffer, t.byteOffset, t.byteLength).toString("utf8") : r.encoder.encode(t).substring(1)
  }

  function tg(t, e = "utf8") {
    const r = nO[e];
    if (!r) throw new Error(`Unsupported encoding "${e}"`);
    return (e === "utf8" || e === "utf-8") && globalThis.Buffer != null && globalThis.Buffer.from != null ? sC(globalThis.Buffer.from(t, "utf-8")) : r.decoder.decode(`${r.prefix}${t}`)
  }

  function iO(t) {
    return Pf($5(tg(t, N5), Z$))
  }

  function O5(t) {
    return $5(tg(Nu(t), Z$), N5)
  }

  function sO(t) {
    const e = tg(dfe, Q$),
      r = ufe + $5(ffe([e, t]), Q$);
    return [cfe, lfe, r].join(afe)
  }

  function u0e(t) {
    return $5(t, N5)
  }

  function d0e(t) {
    return tg(t, N5)
  }

  function h0e(t) {
    return tg([O5(t.header), O5(t.payload)].join(R5), Y$)
  }

  function f0e(t) {
    return [O5(t.header), O5(t.payload), u0e(t.signature)].join(R5)
  }

  function aC(t) {
    const e = t.split(R5),
      r = iO(e[0]),
      n = iO(e[1]),
      i = d0e(e[2]),
      s = tg(e.slice(0, 2).join(R5), Y$);
    return {
      header: r,
      payload: n,
      signature: i,
      data: s
    }
  }

  function oO(t = vh.randomBytes(hfe)) {
    return eC.generateKeyPairFromSeed(t)
  }
  async function p0e(t, e, r, n, i = at.fromMiliseconds(Date.now())) {
    const s = {
        alg: sfe,
        typ: ofe
      },
      o = sO(n.publicKey),
      a = i + r,
      c = {
        iss: o,
        sub: t,
        aud: e,
        iat: i,
        exp: a
      },
      l = h0e({
        header: s,
        payload: c
      }),
      h = eC.sign(n.secretKey, l);
    return f0e({
      header: s,
      payload: c,
      signature: h
    })
  }
  var aO = function (t, e, r) {
      if (r || arguments.length === 2)
        for (var n = 0, i = e.length, s; n < i; n++)(s || !(n in e)) && (s || (s = Array.prototype.slice.call(e, 0, n)), s[n] = e[n]);
      return t.concat(s || Array.prototype.slice.call(e))
    },
    g0e = function () {
      function t(e, r, n) {
        this.name = e, this.version = r, this.os = n, this.type = "browser"
      }
      return t
    }(),
    m0e = function () {
      function t(e) {
        this.version = e, this.type = "node", this.name = "node", this.os = process.platform
      }
      return t
    }(),
    w0e = function () {
      function t(e, r, n, i) {
        this.name = e, this.version = r, this.os = n, this.bot = i, this.type = "bot-device"
      }
      return t
    }(),
    v0e = function () {
      function t() {
        this.type = "bot", this.bot = !0, this.name = "bot", this.version = null, this.os = null
      }
      return t
    }(),
    b0e = function () {
      function t() {
        this.type = "react-native", this.name = "react-native", this.version = null, this.os = null
      }
      return t
    }(),
    y0e = /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,
    _0e = /(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,
    cO = 3,
    x0e = [
      ["aol", /AOLShield\/([0-9\._]+)/],
      ["edge", /Edge\/([0-9\._]+)/],
      ["edge-ios", /EdgiOS\/([0-9\._]+)/],
      ["yandexbrowser", /YaBrowser\/([0-9\._]+)/],
      ["kakaotalk", /KAKAOTALK\s([0-9\.]+)/],
      ["samsung", /SamsungBrowser\/([0-9\.]+)/],
      ["silk", /\bSilk\/([0-9._-]+)\b/],
      ["miui", /MiuiBrowser\/([0-9\.]+)$/],
      ["beaker", /BeakerBrowser\/([0-9\.]+)/],
      ["edge-chromium", /EdgA?\/([0-9\.]+)/],
      ["chromium-webview", /(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],
      ["chrome", /(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],
      ["phantomjs", /PhantomJS\/([0-9\.]+)(:?\s|$)/],
      ["crios", /CriOS\/([0-9\.]+)(:?\s|$)/],
      ["firefox", /Firefox\/([0-9\.]+)(?:\s|$)/],
      ["fxios", /FxiOS\/([0-9\.]+)/],
      ["opera-mini", /Opera Mini.*Version\/([0-9\.]+)/],
      ["opera", /Opera\/([0-9\.]+)(?:\s|$)/],
      ["opera", /OPR\/([0-9\.]+)(:?\s|$)/],
      ["pie", /^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],
      ["pie", /^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],
      ["netfront", /^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],
      ["ie", /Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],
      ["ie", /MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],
      ["ie", /MSIE\s(7\.0)/],
      ["bb10", /BB10;\sTouch.*Version\/([0-9\.]+)/],
      ["android", /Android\s([0-9\.]+)/],
      ["ios", /Version\/([0-9\._]+).*Mobile.*Safari.*/],
      ["safari", /Version\/([0-9\._]+).*Safari/],
      ["facebook", /FB[AS]V\/([0-9\.]+)/],
      ["instagram", /Instagram\s([0-9\.]+)/],
      ["ios-webview", /AppleWebKit\/([0-9\.]+).*Mobile/],
      ["ios-webview", /AppleWebKit\/([0-9\.]+).*Gecko\)$/],
      ["curl", /^curl\/([0-9\.]+)$/],
      ["searchbot", y0e]
    ],
    lO = [
      ["iOS", /iP(hone|od|ad)/],
      ["Android OS", /Android/],
      ["BlackBerry OS", /BlackBerry|BB10/],
      ["Windows Mobile", /IEMobile/],
      ["Amazon OS", /Kindle/],
      ["Windows 3.11", /Win16/],
      ["Windows 95", /(Windows 95)|(Win95)|(Windows_95)/],
      ["Windows 98", /(Windows 98)|(Win98)/],
      ["Windows 2000", /(Windows NT 5.0)|(Windows 2000)/],
      ["Windows XP", /(Windows NT 5.1)|(Windows XP)/],
      ["Windows Server 2003", /(Windows NT 5.2)/],
      ["Windows Vista", /(Windows NT 6.0)/],
      ["Windows 7", /(Windows NT 6.1)/],
      ["Windows 8", /(Windows NT 6.2)/],
      ["Windows 8.1", /(Windows NT 6.3)/],
      ["Windows 10", /(Windows NT 10.0)/],
      ["Windows ME", /Windows ME/],
      ["Windows CE", /Windows CE|WinCE|Microsoft Pocket Internet Explorer/],
      ["Open BSD", /OpenBSD/],
      ["Sun OS", /SunOS/],
      ["Chrome OS", /CrOS/],
      ["Linux", /(Linux)|(X11)/],
      ["Mac OS", /(Mac_PowerPC)|(Macintosh)/],
      ["QNX", /QNX/],
      ["BeOS", /BeOS/],
      ["OS/2", /OS\/2/]
    ];

  function C0e(t) {
    return typeof document > "u" && typeof navigator < "u" && navigator.product === "ReactNative" ? new b0e : typeof navigator < "u" ? A0e(navigator.userAgent) : I0e()
  }

  function E0e(t) {
    return t !== "" && x0e.reduce(function (e, r) {
      var n = r[0],
        i = r[1];
      if (e) return e;
      var s = i.exec(t);
      return !!s && [n, s]
    }, !1)
  }

  function A0e(t) {
    var e = E0e(t);
    if (!e) return null;
    var r = e[0],
      n = e[1];
    if (r === "searchbot") return new v0e;
    var i = n[1] && n[1].split(".").join("_").split("_").slice(0, 3);
    i ? i.length < cO && (i = aO(aO([], i, !0), T0e(cO - i.length), !0)) : i = [];
    var s = i.join("."),
      o = S0e(t),
      a = _0e.exec(t);
    return a && a[1] ? new w0e(r, s, o, a[1]) : new g0e(r, s, o)
  }

  function S0e(t) {
    for (var e = 0, r = lO.length; e < r; e++) {
      var n = lO[e],
        i = n[0],
        s = n[1],
        o = s.exec(t);
      if (o) return i
    }
    return null
  }

  function I0e() {
    var t = typeof process < "u" && process.version;
    return t ? new m0e(process.version.slice(1)) : null
  }

  function T0e(t) {
    for (var e = [], r = 0; r < t; r++) e.push("0");
    return e
  }
  var xn = {};
  Object.defineProperty(xn, "__esModule", {
    value: !0
  }), xn.getLocalStorage = xn.getLocalStorageOrThrow = xn.getCrypto = xn.getCryptoOrThrow = uO = xn.getLocation = xn.getLocationOrThrow = cC = xn.getNavigator = xn.getNavigatorOrThrow = D5 = xn.getDocument = xn.getDocumentOrThrow = xn.getFromWindowOrThrow = xn.getFromWindow = void 0;

  function f0(t) {
    let e;
    return typeof window < "u" && typeof window[t] < "u" && (e = window[t]), e
  }
  xn.getFromWindow = f0;

  function rg(t) {
    const e = f0(t);
    if (!e) throw new Error(`${t} is not defined in Window`);
    return e
  }
  xn.getFromWindowOrThrow = rg;

  function k0e() {
    return rg("document")
  }
  xn.getDocumentOrThrow = k0e;

  function R0e() {
    return f0("document")
  }
  var D5 = xn.getDocument = R0e;

  function N0e() {
    return rg("navigator")
  }
  xn.getNavigatorOrThrow = N0e;

  function M0e() {
    return f0("navigator")
  }
  var cC = xn.getNavigator = M0e;

  function P0e() {
    return rg("location")
  }
  xn.getLocationOrThrow = P0e;

  function $0e() {
    return f0("location")
  }
  var uO = xn.getLocation = $0e;

  function O0e() {
    return rg("crypto")
  }
  xn.getCryptoOrThrow = O0e;

  function D0e() {
    return f0("crypto")
  }
  xn.getCrypto = D0e;

  function L0e() {
    return rg("localStorage")
  }
  xn.getLocalStorageOrThrow = L0e;

  function B0e() {
    return f0("localStorage")
  }
  xn.getLocalStorage = B0e;
  var lC = {};
  Object.defineProperty(lC, "__esModule", {
    value: !0
  });
  var dO = lC.getWindowMetadata = void 0;
  const hO = xn;

  function U0e() {
    let t, e;
    try {
      t = hO.getDocumentOrThrow(), e = hO.getLocationOrThrow()
    } catch {
      return null
    }

    function r() {
      const f = t.getElementsByTagName("link"),
        w = [];
      for (let b = 0; b < f.length; b++) {
        const C = f[b],
          M = C.getAttribute("rel");
        if (M && M.toLowerCase().indexOf("icon") > -1) {
          const N = C.getAttribute("href");
          if (N)
            if (N.toLowerCase().indexOf("https:") === -1 && N.toLowerCase().indexOf("http:") === -1 && N.indexOf("//") !== 0) {
              let $ = e.protocol + "//" + e.host;
              if (N.indexOf("/") === 0) $ += N;
              else {
                const k = e.pathname.split("/");
                k.pop();
                const B = k.join("/");
                $ += B + "/" + N
              }
              w.push($)
            } else if (N.indexOf("//") === 0) {
            const $ = e.protocol + N;
            w.push($)
          } else w.push(N)
        }
      }
      return w
    }

    function n(...f) {
      const w = t.getElementsByTagName("meta");
      for (let b = 0; b < w.length; b++) {
        const C = w[b],
          M = ["itemprop", "property", "name"].map(N => C.getAttribute(N)).filter(N => N ? f.includes(N) : !1);
        if (M.length && M) {
          const N = C.getAttribute("content");
          if (N) return N
        }
      }
      return ""
    }

    function i() {
      let f = n("name", "og:site_name", "og:title", "twitter:title");
      return f || (f = t.title), f
    }

    function s() {
      return n("description", "og:description", "twitter:description", "keywords")
    }
    const o = i(),
      a = s(),
      c = e.origin,
      l = r();
    return {
      description: a,
      url: c,
      icons: l,
      name: o
    }
  }
  dO = lC.getWindowMetadata = U0e;
  var q2 = {},
    j0e = t => encodeURIComponent(t).replace(/[!'()*]/g, e => `%${e.charCodeAt(0).toString(16).toUpperCase()}`),
    fO = "%[a-f0-9]{2}",
    pO = new RegExp("(" + fO + ")|([^%]+?)", "gi"),
    gO = new RegExp("(" + fO + ")+", "gi");

  function uC(t, e) {
    try {
      return [decodeURIComponent(t.join(""))]
    } catch {}
    if (t.length === 1) return t;
    e = e || 1;
    var r = t.slice(0, e),
      n = t.slice(e);
    return Array.prototype.concat.call([], uC(r), uC(n))
  }

  function F0e(t) {
    try {
      return decodeURIComponent(t)
    } catch {
      for (var e = t.match(pO) || [], r = 1; r < e.length; r++) t = uC(e, r).join(""), e = t.match(pO) || [];
      return t
    }
  }

  function W0e(t) {
    for (var e = {
        "%FE%FF": "��",
        "%FF%FE": "��"
      }, r = gO.exec(t); r;) {
      try {
        e[r[0]] = decodeURIComponent(r[0])
      } catch {
        var n = F0e(r[0]);
        n !== r[0] && (e[r[0]] = n)
      }
      r = gO.exec(t)
    }
    e["%C2"] = "�";
    for (var i = Object.keys(e), s = 0; s < i.length; s++) {
      var o = i[s];
      t = t.replace(new RegExp(o, "g"), e[o])
    }
    return t
  }
  var z0e = function (t) {
      if (typeof t != "string") throw new TypeError("Expected `encodedURI` to be of type `string`, got `" + typeof t + "`");
      try {
        return t = t.replace(/\+/g, " "), decodeURIComponent(t)
      } catch {
        return W0e(t)
      }
    },
    H0e = (t, e) => {
      if (!(typeof t == "string" && typeof e == "string")) throw new TypeError("Expected the arguments to be of type `string`");
      if (e === "") return [t];
      const r = t.indexOf(e);
      return r === -1 ? [t] : [t.slice(0, r), t.slice(r + e.length)]
    },
    q0e = function (t, e) {
      for (var r = {}, n = Object.keys(t), i = Array.isArray(e), s = 0; s < n.length; s++) {
        var o = n[s],
          a = t[o];
        (i ? e.indexOf(o) !== -1 : e(o, a, t)) && (r[o] = a)
      }
      return r
    };
  (function (t) {
    const e = j0e,
      r = z0e,
      n = H0e,
      i = q0e,
      s = k => k == null,
      o = Symbol("encodeFragmentIdentifier");

    function a(k) {
      switch (k.arrayFormat) {
        case "index":
          return B => (F, D) => {
            const V = F.length;
            return D === void 0 || k.skipNull && D === null || k.skipEmptyString && D === "" ? F : D === null ? [...F, [h(B, k), "[", V, "]"].join("")] : [...F, [h(B, k), "[", h(V, k), "]=", h(D, k)].join("")]
          };
        case "bracket":
          return B => (F, D) => D === void 0 || k.skipNull && D === null || k.skipEmptyString && D === "" ? F : D === null ? [...F, [h(B, k), "[]"].join("")] : [...F, [h(B, k), "[]=", h(D, k)].join("")];
        case "colon-list-separator":
          return B => (F, D) => D === void 0 || k.skipNull && D === null || k.skipEmptyString && D === "" ? F : D === null ? [...F, [h(B, k), ":list="].join("")] : [...F, [h(B, k), ":list=", h(D, k)].join("")];
        case "comma":
        case "separator":
        case "bracket-separator": {
          const B = k.arrayFormat === "bracket-separator" ? "[]=" : "=";
          return F => (D, V) => V === void 0 || k.skipNull && V === null || k.skipEmptyString && V === "" ? D : (V = V === null ? "" : V, D.length === 0 ? [
            [h(F, k), B, h(V, k)].join("")
          ] : [
            [D, h(V, k)].join(k.arrayFormatSeparator)
          ])
        }
        default:
          return B => (F, D) => D === void 0 || k.skipNull && D === null || k.skipEmptyString && D === "" ? F : D === null ? [...F, h(B, k)] : [...F, [h(B, k), "=", h(D, k)].join("")]
      }
    }

    function c(k) {
      let B;
      switch (k.arrayFormat) {
        case "index":
          return (F, D, V) => {
            if (B = /\[(\d*)\]$/.exec(F), F = F.replace(/\[\d*\]$/, ""), !B) {
              V[F] = D;
              return
            }
            V[F] === void 0 && (V[F] = {}), V[F][B[1]] = D
          };
        case "bracket":
          return (F, D, V) => {
            if (B = /(\[\])$/.exec(F), F = F.replace(/\[\]$/, ""), !B) {
              V[F] = D;
              return
            }
            if (V[F] === void 0) {
              V[F] = [D];
              return
            }
            V[F] = [].concat(V[F], D)
          };
        case "colon-list-separator":
          return (F, D, V) => {
            if (B = /(:list)$/.exec(F), F = F.replace(/:list$/, ""), !B) {
              V[F] = D;
              return
            }
            if (V[F] === void 0) {
              V[F] = [D];
              return
            }
            V[F] = [].concat(V[F], D)
          };
        case "comma":
        case "separator":
          return (F, D, V) => {
            const R = typeof D == "string" && D.includes(k.arrayFormatSeparator),
              P = typeof D == "string" && !R && f(D, k).includes(k.arrayFormatSeparator);
            D = P ? f(D, k) : D;
            const j = R || P ? D.split(k.arrayFormatSeparator).map(Y => f(Y, k)) : D === null ? D : f(D, k);
            V[F] = j
          };
        case "bracket-separator":
          return (F, D, V) => {
            const R = /(\[\])$/.test(F);
            if (F = F.replace(/\[\]$/, ""), !R) {
              V[F] = D && f(D, k);
              return
            }
            const P = D === null ? [] : D.split(k.arrayFormatSeparator).map(j => f(j, k));
            if (V[F] === void 0) {
              V[F] = P;
              return
            }
            V[F] = [].concat(V[F], P)
          };
        default:
          return (F, D, V) => {
            if (V[F] === void 0) {
              V[F] = D;
              return
            }
            V[F] = [].concat(V[F], D)
          }
      }
    }

    function l(k) {
      if (typeof k != "string" || k.length !== 1) throw new TypeError("arrayFormatSeparator must be single character string")
    }

    function h(k, B) {
      return B.encode ? B.strict ? e(k) : encodeURIComponent(k) : k
    }

    function f(k, B) {
      return B.decode ? r(k) : k
    }

    function w(k) {
      return Array.isArray(k) ? k.sort() : typeof k == "object" ? w(Object.keys(k)).sort((B, F) => Number(B) - Number(F)).map(B => k[B]) : k
    }

    function b(k) {
      const B = k.indexOf("#");
      return B !== -1 && (k = k.slice(0, B)), k
    }

    function C(k) {
      let B = "";
      const F = k.indexOf("#");
      return F !== -1 && (B = k.slice(F)), B
    }

    function M(k) {
      k = b(k);
      const B = k.indexOf("?");
      return B === -1 ? "" : k.slice(B + 1)
    }

    function N(k, B) {
      return B.parseNumbers && !Number.isNaN(Number(k)) && typeof k == "string" && k.trim() !== "" ? k = Number(k) : B.parseBooleans && k !== null && (k.toLowerCase() === "true" || k.toLowerCase() === "false") && (k = k.toLowerCase() === "true"), k
    }

    function $(k, B) {
      B = Object.assign({
        decode: !0,
        sort: !0,
        arrayFormat: "none",
        arrayFormatSeparator: ",",
        parseNumbers: !1,
        parseBooleans: !1
      }, B), l(B.arrayFormatSeparator);
      const F = c(B),
        D = Object.create(null);
      if (typeof k != "string" || (k = k.trim().replace(/^[?#&]/, ""), !k)) return D;
      for (const V of k.split("&")) {
        if (V === "") continue;
        let [R, P] = n(B.decode ? V.replace(/\+/g, " ") : V, "=");
        P = P === void 0 ? null : ["comma", "separator", "bracket-separator"].includes(B.arrayFormat) ? P : f(P, B), F(f(R, B), P, D)
      }
      for (const V of Object.keys(D)) {
        const R = D[V];
        if (typeof R == "object" && R !== null)
          for (const P of Object.keys(R)) R[P] = N(R[P], B);
        else D[V] = N(R, B)
      }
      return B.sort === !1 ? D : (B.sort === !0 ? Object.keys(D).sort() : Object.keys(D).sort(B.sort)).reduce((V, R) => {
        const P = D[R];
        return P && typeof P == "object" && !Array.isArray(P) ? V[R] = w(P) : V[R] = P, V
      }, Object.create(null))
    }
    t.extract = M, t.parse = $, t.stringify = (k, B) => {
      if (!k) return "";
      B = Object.assign({
        encode: !0,
        strict: !0,
        arrayFormat: "none",
        arrayFormatSeparator: ","
      }, B), l(B.arrayFormatSeparator);
      const F = P => B.skipNull && s(k[P]) || B.skipEmptyString && k[P] === "",
        D = a(B),
        V = {};
      for (const P of Object.keys(k)) F(P) || (V[P] = k[P]);
      const R = Object.keys(V);
      return B.sort !== !1 && R.sort(B.sort), R.map(P => {
        const j = k[P];
        return j === void 0 ? "" : j === null ? h(P, B) : Array.isArray(j) ? j.length === 0 && B.arrayFormat === "bracket-separator" ? h(P, B) + "[]" : j.reduce(D(P), []).join("&") : h(P, B) + "=" + h(j, B)
      }).filter(P => P.length > 0).join("&")
    }, t.parseUrl = (k, B) => {
      B = Object.assign({
        decode: !0
      }, B);
      const [F, D] = n(k, "#");
      return Object.assign({
        url: F.split("?")[0] || "",
        query: $(M(k), B)
      }, B && B.parseFragmentIdentifier && D ? {
        fragmentIdentifier: f(D, B)
      } : {})
    }, t.stringifyUrl = (k, B) => {
      B = Object.assign({
        encode: !0,
        strict: !0,
        [o]: !0
      }, B);
      const F = b(k.url).split("?")[0] || "",
        D = t.extract(k.url),
        V = t.parse(D, {
          sort: !1
        }),
        R = Object.assign(V, k.query);
      let P = t.stringify(R, B);
      P && (P = `?${P}`);
      let j = C(k.url);
      return k.fragmentIdentifier && (j = `#${B[o]?h(k.fragmentIdentifier,B):k.fragmentIdentifier}`), `${F}${P}${j}`
    }, t.pick = (k, B, F) => {
      F = Object.assign({
        parseFragmentIdentifier: !0,
        [o]: !1
      }, F);
      const {
        url: D,
        query: V,
        fragmentIdentifier: R
      } = t.parseUrl(k, F);
      return t.stringifyUrl({
        url: D,
        query: i(V, B),
        fragmentIdentifier: R
      }, F)
    }, t.exclude = (k, B, F) => {
      const D = Array.isArray(B) ? V => !B.includes(V) : (V, R) => !B(V, R);
      return t.pick(k, D, F)
    }
  })(q2);
  var dC = {},
    L5 = {};
  Object.defineProperty(L5, "__esModule", {
    value: !0
  });
  var xs = wr,
    hC = Bo,
    V0e = 20;

  function K0e(t, e, r) {
    for (var n = 1634760805, i = 857760878, s = 2036477234, o = 1797285236, a = r[3] << 24 | r[2] << 16 | r[1] << 8 | r[0], c = r[7] << 24 | r[6] << 16 | r[5] << 8 | r[4], l = r[11] << 24 | r[10] << 16 | r[9] << 8 | r[8], h = r[15] << 24 | r[14] << 16 | r[13] << 8 | r[12], f = r[19] << 24 | r[18] << 16 | r[17] << 8 | r[16], w = r[23] << 24 | r[22] << 16 | r[21] << 8 | r[20], b = r[27] << 24 | r[26] << 16 | r[25] << 8 | r[24], C = r[31] << 24 | r[30] << 16 | r[29] << 8 | r[28], M = e[3] << 24 | e[2] << 16 | e[1] << 8 | e[0], N = e[7] << 24 | e[6] << 16 | e[5] << 8 | e[4], $ = e[11] << 24 | e[10] << 16 | e[9] << 8 | e[8], k = e[15] << 24 | e[14] << 16 | e[13] << 8 | e[12], B = n, F = i, D = s, V = o, R = a, P = c, j = l, Y = h, U = f, I = w, g = b, u = C, p = M, v = N, x = $, E = k, S = 0; S < V0e; S += 2) B = B + R | 0, p ^= B, p = p >>> 16 | p << 16, U = U + p | 0, R ^= U, R = R >>> 20 | R << 12, F = F + P | 0, v ^= F, v = v >>> 16 | v << 16, I = I + v | 0, P ^= I, P = P >>> 20 | P << 12, D = D + j | 0, x ^= D, x = x >>> 16 | x << 16, g = g + x | 0, j ^= g, j = j >>> 20 | j << 12, V = V + Y | 0, E ^= V, E = E >>> 16 | E << 16, u = u + E | 0, Y ^= u, Y = Y >>> 20 | Y << 12, D = D + j | 0, x ^= D, x = x >>> 24 | x << 8, g = g + x | 0, j ^= g, j = j >>> 25 | j << 7, V = V + Y | 0, E ^= V, E = E >>> 24 | E << 8, u = u + E | 0, Y ^= u, Y = Y >>> 25 | Y << 7, F = F + P | 0, v ^= F, v = v >>> 24 | v << 8, I = I + v | 0, P ^= I, P = P >>> 25 | P << 7, B = B + R | 0, p ^= B, p = p >>> 24 | p << 8, U = U + p | 0, R ^= U, R = R >>> 25 | R << 7, B = B + P | 0, E ^= B, E = E >>> 16 | E << 16, g = g + E | 0, P ^= g, P = P >>> 20 | P << 12, F = F + j | 0, p ^= F, p = p >>> 16 | p << 16, u = u + p | 0, j ^= u, j = j >>> 20 | j << 12, D = D + Y | 0, v ^= D, v = v >>> 16 | v << 16, U = U + v | 0, Y ^= U, Y = Y >>> 20 | Y << 12, V = V + R | 0, x ^= V, x = x >>> 16 | x << 16, I = I + x | 0, R ^= I, R = R >>> 20 | R << 12, D = D + Y | 0, v ^= D, v = v >>> 24 | v << 8, U = U + v | 0, Y ^= U, Y = Y >>> 25 | Y << 7, V = V + R | 0, x ^= V, x = x >>> 24 | x << 8, I = I + x | 0, R ^= I, R = R >>> 25 | R << 7, F = F + j | 0, p ^= F, p = p >>> 24 | p << 8, u = u + p | 0, j ^= u, j = j >>> 25 | j << 7, B = B + P | 0, E ^= B, E = E >>> 24 | E << 8, g = g + E | 0, P ^= g, P = P >>> 25 | P << 7;
    xs.writeUint32LE(B + n | 0, t, 0), xs.writeUint32LE(F + i | 0, t, 4), xs.writeUint32LE(D + s | 0, t, 8), xs.writeUint32LE(V + o | 0, t, 12), xs.writeUint32LE(R + a | 0, t, 16), xs.writeUint32LE(P + c | 0, t, 20), xs.writeUint32LE(j + l | 0, t, 24), xs.writeUint32LE(Y + h | 0, t, 28), xs.writeUint32LE(U + f | 0, t, 32), xs.writeUint32LE(I + w | 0, t, 36), xs.writeUint32LE(g + b | 0, t, 40), xs.writeUint32LE(u + C | 0, t, 44), xs.writeUint32LE(p + M | 0, t, 48), xs.writeUint32LE(v + N | 0, t, 52), xs.writeUint32LE(x + $ | 0, t, 56), xs.writeUint32LE(E + k | 0, t, 60)
  }

  function mO(t, e, r, n, i) {
    if (i === void 0 && (i = 0), t.length !== 32) throw new Error("ChaCha: key size must be 32 bytes");
    if (n.length < r.length) throw new Error("ChaCha: destination is shorter than source");
    var s, o;
    if (i === 0) {
      if (e.length !== 8 && e.length !== 12) throw new Error("ChaCha nonce must be 8 or 12 bytes");
      s = new Uint8Array(16), o = s.length - e.length, s.set(e, o)
    } else {
      if (e.length !== 16) throw new Error("ChaCha nonce with counter must be 16 bytes");
      s = e, o = i
    }
    for (var a = new Uint8Array(64), c = 0; c < r.length; c += 64) {
      K0e(a, s, t);
      for (var l = c; l < c + 64 && l < r.length; l++) n[l] = r[l] ^ a[l - c];
      Z0e(s, 0, o)
    }
    return hC.wipe(a), i === 0 && hC.wipe(s), n
  }
  L5.streamXOR = mO;

  function G0e(t, e, r, n) {
    return n === void 0 && (n = 0), hC.wipe(r), mO(t, e, r, r, n)
  }
  L5.stream = G0e;

  function Z0e(t, e, r) {
    for (var n = 1; r--;) n = n + (t[e] & 255) | 0, t[e] = n & 255, n >>>= 8, e++;
    if (n > 0) throw new Error("ChaCha: counter overflow")
  }
  var wO = {},
    bh = {};
  Object.defineProperty(bh, "__esModule", {
    value: !0
  });

  function Y0e(t, e, r) {
    return ~(t - 1) & e | t - 1 & r
  }
  bh.select = Y0e;

  function Q0e(t, e) {
    return (t | 0) - (e | 0) - 1 >>> 31 & 1
  }
  bh.lessOrEqual = Q0e;

  function vO(t, e) {
    if (t.length !== e.length) return 0;
    for (var r = 0, n = 0; n < t.length; n++) r |= t[n] ^ e[n];
    return 1 & r - 1 >>> 8
  }
  bh.compare = vO;

  function J0e(t, e) {
    return t.length === 0 || e.length === 0 ? !1 : vO(t, e) !== 0
  }
  bh.equal = J0e,
    function (t) {
      Object.defineProperty(t, "__esModule", {
        value: !0
      });
      var e = bh,
        r = Bo;
      t.DIGEST_LENGTH = 16;
      var n = function () {
        function o(a) {
          this.digestLength = t.DIGEST_LENGTH, this._buffer = new Uint8Array(16), this._r = new Uint16Array(10), this._h = new Uint16Array(10), this._pad = new Uint16Array(8), this._leftover = 0, this._fin = 0, this._finished = !1;
          var c = a[0] | a[1] << 8;
          this._r[0] = c & 8191;
          var l = a[2] | a[3] << 8;
          this._r[1] = (c >>> 13 | l << 3) & 8191;
          var h = a[4] | a[5] << 8;
          this._r[2] = (l >>> 10 | h << 6) & 7939;
          var f = a[6] | a[7] << 8;
          this._r[3] = (h >>> 7 | f << 9) & 8191;
          var w = a[8] | a[9] << 8;
          this._r[4] = (f >>> 4 | w << 12) & 255, this._r[5] = w >>> 1 & 8190;
          var b = a[10] | a[11] << 8;
          this._r[6] = (w >>> 14 | b << 2) & 8191;
          var C = a[12] | a[13] << 8;
          this._r[7] = (b >>> 11 | C << 5) & 8065;
          var M = a[14] | a[15] << 8;
          this._r[8] = (C >>> 8 | M << 8) & 8191, this._r[9] = M >>> 5 & 127, this._pad[0] = a[16] | a[17] << 8, this._pad[1] = a[18] | a[19] << 8, this._pad[2] = a[20] | a[21] << 8, this._pad[3] = a[22] | a[23] << 8, this._pad[4] = a[24] | a[25] << 8, this._pad[5] = a[26] | a[27] << 8, this._pad[6] = a[28] | a[29] << 8, this._pad[7] = a[30] | a[31] << 8
        }
        return o.prototype._blocks = function (a, c, l) {
          for (var h = this._fin ? 0 : 2048, f = this._h[0], w = this._h[1], b = this._h[2], C = this._h[3], M = this._h[4], N = this._h[5], $ = this._h[6], k = this._h[7], B = this._h[8], F = this._h[9], D = this._r[0], V = this._r[1], R = this._r[2], P = this._r[3], j = this._r[4], Y = this._r[5], U = this._r[6], I = this._r[7], g = this._r[8], u = this._r[9]; l >= 16;) {
            var p = a[c + 0] | a[c + 1] << 8;
            f += p & 8191;
            var v = a[c + 2] | a[c + 3] << 8;
            w += (p >>> 13 | v << 3) & 8191;
            var x = a[c + 4] | a[c + 5] << 8;
            b += (v >>> 10 | x << 6) & 8191;
            var E = a[c + 6] | a[c + 7] << 8;
            C += (x >>> 7 | E << 9) & 8191;
            var S = a[c + 8] | a[c + 9] << 8;
            M += (E >>> 4 | S << 12) & 8191, N += S >>> 1 & 8191;
            var _ = a[c + 10] | a[c + 11] << 8;
            $ += (S >>> 14 | _ << 2) & 8191;
            var y = a[c + 12] | a[c + 13] << 8;
            k += (_ >>> 11 | y << 5) & 8191;
            var A = a[c + 14] | a[c + 15] << 8;
            B += (y >>> 8 | A << 8) & 8191, F += A >>> 5 | h;
            var G = 0,
              ce = G;
            ce += f * D, ce += w * (5 * u), ce += b * (5 * g), ce += C * (5 * I), ce += M * (5 * U), G = ce >>> 13, ce &= 8191, ce += N * (5 * Y), ce += $ * (5 * j), ce += k * (5 * P), ce += B * (5 * R), ce += F * (5 * V), G += ce >>> 13, ce &= 8191;
            var W = G;
            W += f * V, W += w * D, W += b * (5 * u), W += C * (5 * g), W += M * (5 * I), G = W >>> 13, W &= 8191, W += N * (5 * U), W += $ * (5 * Y), W += k * (5 * j), W += B * (5 * P), W += F * (5 * R), G += W >>> 13, W &= 8191;
            var X = G;
            X += f * R, X += w * V, X += b * D, X += C * (5 * u), X += M * (5 * g), G = X >>> 13, X &= 8191, X += N * (5 * I), X += $ * (5 * U), X += k * (5 * Y), X += B * (5 * j), X += F * (5 * P), G += X >>> 13, X &= 8191;
            var Z = G;
            Z += f * P, Z += w * R, Z += b * V, Z += C * D, Z += M * (5 * u), G = Z >>> 13, Z &= 8191, Z += N * (5 * g), Z += $ * (5 * I), Z += k * (5 * U), Z += B * (5 * Y), Z += F * (5 * j), G += Z >>> 13, Z &= 8191;
            var ee = G;
            ee += f * j, ee += w * P, ee += b * R, ee += C * V, ee += M * D, G = ee >>> 13, ee &= 8191, ee += N * (5 * u), ee += $ * (5 * g), ee += k * (5 * I), ee += B * (5 * U), ee += F * (5 * Y), G += ee >>> 13, ee &= 8191;
            var ne = G;
            ne += f * Y, ne += w * j, ne += b * P, ne += C * R, ne += M * V, G = ne >>> 13, ne &= 8191, ne += N * D, ne += $ * (5 * u), ne += k * (5 * g), ne += B * (5 * I), ne += F * (5 * U), G += ne >>> 13, ne &= 8191;
            var O = G;
            O += f * U, O += w * Y, O += b * j, O += C * P, O += M * R, G = O >>> 13, O &= 8191, O += N * V, O += $ * D, O += k * (5 * u), O += B * (5 * g), O += F * (5 * I), G += O >>> 13, O &= 8191;
            var H = G;
            H += f * I, H += w * U, H += b * Y, H += C * j, H += M * P, G = H >>> 13, H &= 8191, H += N * R, H += $ * V, H += k * D, H += B * (5 * u), H += F * (5 * g), G += H >>> 13, H &= 8191;
            var Q = G;
            Q += f * g, Q += w * I, Q += b * U, Q += C * Y, Q += M * j, G = Q >>> 13, Q &= 8191, Q += N * P, Q += $ * R, Q += k * V, Q += B * D, Q += F * (5 * u), G += Q >>> 13, Q &= 8191;
            var de = G;
            de += f * u, de += w * g, de += b * I, de += C * U, de += M * Y, G = de >>> 13, de &= 8191, de += N * j, de += $ * P, de += k * R, de += B * V, de += F * D, G += de >>> 13, de &= 8191, G = (G << 2) + G | 0, G = G + ce | 0, ce = G & 8191, G = G >>> 13, W += G, f = ce, w = W, b = X, C = Z, M = ee, N = ne, $ = O, k = H, B = Q, F = de, c += 16, l -= 16
          }
          this._h[0] = f, this._h[1] = w, this._h[2] = b, this._h[3] = C, this._h[4] = M, this._h[5] = N, this._h[6] = $, this._h[7] = k, this._h[8] = B, this._h[9] = F
        }, o.prototype.finish = function (a, c) {
          c === void 0 && (c = 0);
          var l = new Uint16Array(10),
            h, f, w, b;
          if (this._leftover) {
            for (b = this._leftover, this._buffer[b++] = 1; b < 16; b++) this._buffer[b] = 0;
            this._fin = 1, this._blocks(this._buffer, 0, 16)
          }
          for (h = this._h[1] >>> 13, this._h[1] &= 8191, b = 2; b < 10; b++) this._h[b] += h, h = this._h[b] >>> 13, this._h[b] &= 8191;
          for (this._h[0] += h * 5, h = this._h[0] >>> 13, this._h[0] &= 8191, this._h[1] += h, h = this._h[1] >>> 13, this._h[1] &= 8191, this._h[2] += h, l[0] = this._h[0] + 5, h = l[0] >>> 13, l[0] &= 8191, b = 1; b < 10; b++) l[b] = this._h[b] + h, h = l[b] >>> 13, l[b] &= 8191;
          for (l[9] -= 8192, f = (h ^ 1) - 1, b = 0; b < 10; b++) l[b] &= f;
          for (f = ~f, b = 0; b < 10; b++) this._h[b] = this._h[b] & f | l[b];
          for (this._h[0] = (this._h[0] | this._h[1] << 13) & 65535, this._h[1] = (this._h[1] >>> 3 | this._h[2] << 10) & 65535, this._h[2] = (this._h[2] >>> 6 | this._h[3] << 7) & 65535, this._h[3] = (this._h[3] >>> 9 | this._h[4] << 4) & 65535, this._h[4] = (this._h[4] >>> 12 | this._h[5] << 1 | this._h[6] << 14) & 65535, this._h[5] = (this._h[6] >>> 2 | this._h[7] << 11) & 65535, this._h[6] = (this._h[7] >>> 5 | this._h[8] << 8) & 65535, this._h[7] = (this._h[8] >>> 8 | this._h[9] << 5) & 65535, w = this._h[0] + this._pad[0], this._h[0] = w & 65535, b = 1; b < 8; b++) w = (this._h[b] + this._pad[b] | 0) + (w >>> 16) | 0, this._h[b] = w & 65535;
          return a[c + 0] = this._h[0] >>> 0, a[c + 1] = this._h[0] >>> 8, a[c + 2] = this._h[1] >>> 0, a[c + 3] = this._h[1] >>> 8, a[c + 4] = this._h[2] >>> 0, a[c + 5] = this._h[2] >>> 8, a[c + 6] = this._h[3] >>> 0, a[c + 7] = this._h[3] >>> 8, a[c + 8] = this._h[4] >>> 0, a[c + 9] = this._h[4] >>> 8, a[c + 10] = this._h[5] >>> 0, a[c + 11] = this._h[5] >>> 8, a[c + 12] = this._h[6] >>> 0, a[c + 13] = this._h[6] >>> 8, a[c + 14] = this._h[7] >>> 0, a[c + 15] = this._h[7] >>> 8, this._finished = !0, this
        }, o.prototype.update = function (a) {
          var c = 0,
            l = a.length,
            h;
          if (this._leftover) {
            h = 16 - this._leftover, h > l && (h = l);
            for (var f = 0; f < h; f++) this._buffer[this._leftover + f] = a[c + f];
            if (l -= h, c += h, this._leftover += h, this._leftover < 16) return this;
            this._blocks(this._buffer, 0, 16), this._leftover = 0
          }
          if (l >= 16 && (h = l - l % 16, this._blocks(a, c, h), c += h, l -= h), l) {
            for (var f = 0; f < l; f++) this._buffer[this._leftover + f] = a[c + f];
            this._leftover += l
          }
          return this
        }, o.prototype.digest = function () {
          if (this._finished) throw new Error("Poly1305 was finished");
          var a = new Uint8Array(16);
          return this.finish(a), a
        }, o.prototype.clean = function () {
          return r.wipe(this._buffer), r.wipe(this._r), r.wipe(this._h), r.wipe(this._pad), this._leftover = 0, this._fin = 0, this._finished = !0, this
        }, o
      }();
      t.Poly1305 = n;

      function i(o, a) {
        var c = new n(o);
        c.update(a);
        var l = c.digest();
        return c.clean(), l
      }
      t.oneTimeAuth = i;

      function s(o, a) {
        return o.length !== t.DIGEST_LENGTH || a.length !== t.DIGEST_LENGTH ? !1 : e.equal(o, a)
      }
      t.equal = s
    }(wO),
    function (t) {
      Object.defineProperty(t, "__esModule", {
        value: !0
      });
      var e = L5,
        r = wO,
        n = Bo,
        i = wr,
        s = bh;
      t.KEY_LENGTH = 32, t.NONCE_LENGTH = 12, t.TAG_LENGTH = 16;
      var o = new Uint8Array(16),
        a = function () {
          function c(l) {
            if (this.nonceLength = t.NONCE_LENGTH, this.tagLength = t.TAG_LENGTH, l.length !== t.KEY_LENGTH) throw new Error("ChaCha20Poly1305 needs 32-byte key");
            this._key = new Uint8Array(l)
          }
          return c.prototype.seal = function (l, h, f, w) {
            if (l.length > 16) throw new Error("ChaCha20Poly1305: incorrect nonce length");
            var b = new Uint8Array(16);
            b.set(l, b.length - l.length);
            var C = new Uint8Array(32);
            e.stream(this._key, b, C, 4);
            var M = h.length + this.tagLength,
              N;
            if (w) {
              if (w.length !== M) throw new Error("ChaCha20Poly1305: incorrect destination length");
              N = w
            } else N = new Uint8Array(M);
            return e.streamXOR(this._key, b, h, N, 4), this._authenticate(N.subarray(N.length - this.tagLength, N.length), C, N.subarray(0, N.length - this.tagLength), f), n.wipe(b), N
          }, c.prototype.open = function (l, h, f, w) {
            if (l.length > 16) throw new Error("ChaCha20Poly1305: incorrect nonce length");
            if (h.length < this.tagLength) return null;
            var b = new Uint8Array(16);
            b.set(l, b.length - l.length);
            var C = new Uint8Array(32);
            e.stream(this._key, b, C, 4);
            var M = new Uint8Array(this.tagLength);
            if (this._authenticate(M, C, h.subarray(0, h.length - this.tagLength), f), !s.equal(M, h.subarray(h.length - this.tagLength, h.length))) return null;
            var N = h.length - this.tagLength,
              $;
            if (w) {
              if (w.length !== N) throw new Error("ChaCha20Poly1305: incorrect destination length");
              $ = w
            } else $ = new Uint8Array(N);
            return e.streamXOR(this._key, b, h.subarray(0, h.length - this.tagLength), $, 4), n.wipe(b), $
          }, c.prototype.clean = function () {
            return n.wipe(this._key), this
          }, c.prototype._authenticate = function (l, h, f, w) {
            var b = new r.Poly1305(h);
            w && (b.update(w), w.length % 16 > 0 && b.update(o.subarray(w.length % 16))), b.update(f), f.length % 16 > 0 && b.update(o.subarray(f.length % 16));
            var C = new Uint8Array(8);
            w && i.writeUint64LE(w.length, C), b.update(C), i.writeUint64LE(f.length, C), b.update(C);
            for (var M = b.digest(), N = 0; N < M.length; N++) l[N] = M[N];
            b.clean(), n.wipe(M), n.wipe(C)
          }, c
        }();
      t.ChaCha20Poly1305 = a
    }(dC);
  var bO = {},
    V2 = {},
    fC = {};
  Object.defineProperty(fC, "__esModule", {
    value: !0
  });

  function X0e(t) {
    return typeof t.saveState < "u" && typeof t.restoreState < "u" && typeof t.cleanSavedState < "u"
  }
  fC.isSerializableHash = X0e, Object.defineProperty(V2, "__esModule", {
    value: !0
  });
  var wl = fC,
    epe = bh,
    tpe = Bo,
    yO = function () {
      function t(e, r) {
        this._finished = !1, this._inner = new e, this._outer = new e, this.blockSize = this._outer.blockSize, this.digestLength = this._outer.digestLength;
        var n = new Uint8Array(this.blockSize);
        r.length > this.blockSize ? this._inner.update(r).finish(n).clean() : n.set(r);
        for (var i = 0; i < n.length; i++) n[i] ^= 54;
        this._inner.update(n);
        for (var i = 0; i < n.length; i++) n[i] ^= 106;
        this._outer.update(n), wl.isSerializableHash(this._inner) && wl.isSerializableHash(this._outer) && (this._innerKeyedState = this._inner.saveState(), this._outerKeyedState = this._outer.saveState()), tpe.wipe(n)
      }
      return t.prototype.reset = function () {
        if (!wl.isSerializableHash(this._inner) || !wl.isSerializableHash(this._outer)) throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");
        return this._inner.restoreState(this._innerKeyedState), this._outer.restoreState(this._outerKeyedState), this._finished = !1, this
      }, t.prototype.clean = function () {
        wl.isSerializableHash(this._inner) && this._inner.cleanSavedState(this._innerKeyedState), wl.isSerializableHash(this._outer) && this._outer.cleanSavedState(this._outerKeyedState), this._inner.clean(), this._outer.clean()
      }, t.prototype.update = function (e) {
        return this._inner.update(e), this
      }, t.prototype.finish = function (e) {
        return this._finished ? (this._outer.finish(e), this) : (this._inner.finish(e), this._outer.update(e.subarray(0, this.digestLength)).finish(e), this._finished = !0, this)
      }, t.prototype.digest = function () {
        var e = new Uint8Array(this.digestLength);
        return this.finish(e), e
      }, t.prototype.saveState = function () {
        if (!wl.isSerializableHash(this._inner)) throw new Error("hmac: can't saveState() because hash doesn't implement it");
        return this._inner.saveState()
      }, t.prototype.restoreState = function (e) {
        if (!wl.isSerializableHash(this._inner) || !wl.isSerializableHash(this._outer)) throw new Error("hmac: can't restoreState() because hash doesn't implement it");
        return this._inner.restoreState(e), this._outer.restoreState(this._outerKeyedState), this._finished = !1, this
      }, t.prototype.cleanSavedState = function (e) {
        if (!wl.isSerializableHash(this._inner)) throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");
        this._inner.cleanSavedState(e)
      }, t
    }();
  V2.HMAC = yO;

  function rpe(t, e, r) {
    var n = new yO(t, e);
    n.update(r);
    var i = n.digest();
    return n.clean(), i
  }
  V2.hmac = rpe, V2.equal = epe.equal, Object.defineProperty(bO, "__esModule", {
    value: !0
  });
  var _O = V2,
    xO = Bo,
    npe = function () {
      function t(e, r, n, i) {
        n === void 0 && (n = new Uint8Array(0)), this._counter = new Uint8Array(1), this._hash = e, this._info = i;
        var s = _O.hmac(this._hash, n, r);
        this._hmac = new _O.HMAC(e, s), this._buffer = new Uint8Array(this._hmac.digestLength), this._bufpos = this._buffer.length
      }
      return t.prototype._fillBuffer = function () {
        this._counter[0]++;
        var e = this._counter[0];
        if (e === 0) throw new Error("hkdf: cannot expand more");
        this._hmac.reset(), e > 1 && this._hmac.update(this._buffer), this._info && this._hmac.update(this._info), this._hmac.update(this._counter), this._hmac.finish(this._buffer), this._bufpos = 0
      }, t.prototype.expand = function (e) {
        for (var r = new Uint8Array(e), n = 0; n < r.length; n++) this._bufpos === this._buffer.length && this._fillBuffer(), r[n] = this._buffer[this._bufpos++];
        return r
      }, t.prototype.clean = function () {
        this._hmac.clean(), xO.wipe(this._buffer), xO.wipe(this._counter), this._bufpos = 0
      }, t
    }(),
    ipe = bO.HKDF = npe,
    K2 = {};
  (function (t) {
    Object.defineProperty(t, "__esModule", {
      value: !0
    });
    var e = wr,
      r = Bo;
    t.DIGEST_LENGTH = 32, t.BLOCK_SIZE = 64;
    var n = function () {
      function a() {
        this.digestLength = t.DIGEST_LENGTH, this.blockSize = t.BLOCK_SIZE, this._state = new Int32Array(8), this._temp = new Int32Array(64), this._buffer = new Uint8Array(128), this._bufferLength = 0, this._bytesHashed = 0, this._finished = !1, this.reset()
      }
      return a.prototype._initState = function () {
        this._state[0] = 1779033703, this._state[1] = 3144134277, this._state[2] = 1013904242, this._state[3] = 2773480762, this._state[4] = 1359893119, this._state[5] = 2600822924, this._state[6] = 528734635, this._state[7] = 1541459225
      }, a.prototype.reset = function () {
        return this._initState(), this._bufferLength = 0, this._bytesHashed = 0, this._finished = !1, this
      }, a.prototype.clean = function () {
        r.wipe(this._buffer), r.wipe(this._temp), this.reset()
      }, a.prototype.update = function (c, l) {
        if (l === void 0 && (l = c.length), this._finished) throw new Error("SHA256: can't update because hash was finished.");
        var h = 0;
        if (this._bytesHashed += l, this._bufferLength > 0) {
          for (; this._bufferLength < this.blockSize && l > 0;) this._buffer[this._bufferLength++] = c[h++], l--;
          this._bufferLength === this.blockSize && (s(this._temp, this._state, this._buffer, 0, this.blockSize), this._bufferLength = 0)
        }
        for (l >= this.blockSize && (h = s(this._temp, this._state, c, h, l), l %= this.blockSize); l > 0;) this._buffer[this._bufferLength++] = c[h++], l--;
        return this
      }, a.prototype.finish = function (c) {
        if (!this._finished) {
          var l = this._bytesHashed,
            h = this._bufferLength,
            f = l / 536870912 | 0,
            w = l << 3,
            b = l % 64 < 56 ? 64 : 128;
          this._buffer[h] = 128;
          for (var C = h + 1; C < b - 8; C++) this._buffer[C] = 0;
          e.writeUint32BE(f, this._buffer, b - 8), e.writeUint32BE(w, this._buffer, b - 4), s(this._temp, this._state, this._buffer, 0, b), this._finished = !0
        }
        for (var C = 0; C < this.digestLength / 4; C++) e.writeUint32BE(this._state[C], c, C * 4);
        return this
      }, a.prototype.digest = function () {
        var c = new Uint8Array(this.digestLength);
        return this.finish(c), c
      }, a.prototype.saveState = function () {
        if (this._finished) throw new Error("SHA256: cannot save finished state");
        return {
          state: new Int32Array(this._state),
          buffer: this._bufferLength > 0 ? new Uint8Array(this._buffer) : void 0,
          bufferLength: this._bufferLength,
          bytesHashed: this._bytesHashed
        }
      }, a.prototype.restoreState = function (c) {
        return this._state.set(c.state), this._bufferLength = c.bufferLength, c.buffer && this._buffer.set(c.buffer), this._bytesHashed = c.bytesHashed, this._finished = !1, this
      }, a.prototype.cleanSavedState = function (c) {
        r.wipe(c.state), c.buffer && r.wipe(c.buffer), c.bufferLength = 0, c.bytesHashed = 0
      }, a
    }();
    t.SHA256 = n;
    var i = new Int32Array([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]);

    function s(a, c, l, h, f) {
      for (; f >= 64;) {
        for (var w = c[0], b = c[1], C = c[2], M = c[3], N = c[4], $ = c[5], k = c[6], B = c[7], F = 0; F < 16; F++) {
          var D = h + F * 4;
          a[F] = e.readUint32BE(l, D)
        }
        for (var F = 16; F < 64; F++) {
          var V = a[F - 2],
            R = (V >>> 17 | V << 15) ^ (V >>> 19 | V << 13) ^ V >>> 10;
          V = a[F - 15];
          var P = (V >>> 7 | V << 25) ^ (V >>> 18 | V << 14) ^ V >>> 3;
          a[F] = (R + a[F - 7] | 0) + (P + a[F - 16] | 0)
        }
        for (var F = 0; F < 64; F++) {
          var R = (((N >>> 6 | N << 26) ^ (N >>> 11 | N << 21) ^ (N >>> 25 | N << 7)) + (N & $ ^ ~N & k) | 0) + (B + (i[F] + a[F] | 0) | 0) | 0,
            P = ((w >>> 2 | w << 30) ^ (w >>> 13 | w << 19) ^ (w >>> 22 | w << 10)) + (w & b ^ w & C ^ b & C) | 0;
          B = k, k = $, $ = N, N = M + R | 0, M = C, C = b, b = w, w = R + P | 0
        }
        c[0] += w, c[1] += b, c[2] += C, c[3] += M, c[4] += N, c[5] += $, c[6] += k, c[7] += B, h += 64, f -= 64
      }
      return h
    }

    function o(a) {
      var c = new n;
      c.update(a);
      var l = c.digest();
      return c.clean(), l
    }
    t.hash = o
  })(K2);
  var pC = {};
  (function (t) {
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.sharedKey = t.generateKeyPair = t.generateKeyPairFromSeed = t.scalarMultBase = t.scalarMult = t.SHARED_KEY_LENGTH = t.SECRET_KEY_LENGTH = t.PUBLIC_KEY_LENGTH = void 0;
    const e = vh,
      r = Bo;
    t.PUBLIC_KEY_LENGTH = 32, t.SECRET_KEY_LENGTH = 32, t.SHARED_KEY_LENGTH = 32;

    function n(F) {
      const D = new Float64Array(16);
      if (F)
        for (let V = 0; V < F.length; V++) D[V] = F[V];
      return D
    }
    const i = new Uint8Array(32);
    i[0] = 9;
    const s = n([56129, 1]);

    function o(F) {
      let D = 1;
      for (let V = 0; V < 16; V++) {
        let R = F[V] + D + 65535;
        D = Math.floor(R / 65536), F[V] = R - D * 65536
      }
      F[0] += D - 1 + 37 * (D - 1)
    }

    function a(F, D, V) {
      const R = ~(V - 1);
      for (let P = 0; P < 16; P++) {
        const j = R & (F[P] ^ D[P]);
        F[P] ^= j, D[P] ^= j
      }
    }

    function c(F, D) {
      const V = n(),
        R = n();
      for (let P = 0; P < 16; P++) R[P] = D[P];
      o(R), o(R), o(R);
      for (let P = 0; P < 2; P++) {
        V[0] = R[0] - 65517;
        for (let Y = 1; Y < 15; Y++) V[Y] = R[Y] - 65535 - (V[Y - 1] >> 16 & 1), V[Y - 1] &= 65535;
        V[15] = R[15] - 32767 - (V[14] >> 16 & 1);
        const j = V[15] >> 16 & 1;
        V[14] &= 65535, a(R, V, 1 - j)
      }
      for (let P = 0; P < 16; P++) F[2 * P] = R[P] & 255, F[2 * P + 1] = R[P] >> 8
    }

    function l(F, D) {
      for (let V = 0; V < 16; V++) F[V] = D[2 * V] + (D[2 * V + 1] << 8);
      F[15] &= 32767
    }

    function h(F, D, V) {
      for (let R = 0; R < 16; R++) F[R] = D[R] + V[R]
    }

    function f(F, D, V) {
      for (let R = 0; R < 16; R++) F[R] = D[R] - V[R]
    }

    function w(F, D, V) {
      let R, P, j = 0,
        Y = 0,
        U = 0,
        I = 0,
        g = 0,
        u = 0,
        p = 0,
        v = 0,
        x = 0,
        E = 0,
        S = 0,
        _ = 0,
        y = 0,
        A = 0,
        G = 0,
        ce = 0,
        W = 0,
        X = 0,
        Z = 0,
        ee = 0,
        ne = 0,
        O = 0,
        H = 0,
        Q = 0,
        de = 0,
        ge = 0,
        Te = 0,
        Oe = 0,
        De = 0,
        et = 0,
        rt = 0,
        Ze = V[0],
        qe = V[1],
        He = V[2],
        we = V[3],
        xe = V[4],
        Ie = V[5],
        Pe = V[6],
        J = V[7],
        L = V[8],
        z = V[9],
        ie = V[10],
        ue = V[11],
        me = V[12],
        be = V[13],
        Le = V[14],
        ze = V[15];
      R = D[0], j += R * Ze, Y += R * qe, U += R * He, I += R * we, g += R * xe, u += R * Ie, p += R * Pe, v += R * J, x += R * L, E += R * z, S += R * ie, _ += R * ue, y += R * me, A += R * be, G += R * Le, ce += R * ze, R = D[1], Y += R * Ze, U += R * qe, I += R * He, g += R * we, u += R * xe, p += R * Ie, v += R * Pe, x += R * J, E += R * L, S += R * z, _ += R * ie, y += R * ue, A += R * me, G += R * be, ce += R * Le, W += R * ze, R = D[2], U += R * Ze, I += R * qe, g += R * He, u += R * we, p += R * xe, v += R * Ie, x += R * Pe, E += R * J, S += R * L, _ += R * z, y += R * ie, A += R * ue, G += R * me, ce += R * be, W += R * Le, X += R * ze, R = D[3], I += R * Ze, g += R * qe, u += R * He, p += R * we, v += R * xe, x += R * Ie, E += R * Pe, S += R * J, _ += R * L, y += R * z, A += R * ie, G += R * ue, ce += R * me, W += R * be, X += R * Le, Z += R * ze, R = D[4], g += R * Ze, u += R * qe, p += R * He, v += R * we, x += R * xe, E += R * Ie, S += R * Pe, _ += R * J, y += R * L, A += R * z, G += R * ie, ce += R * ue, W += R * me, X += R * be, Z += R * Le, ee += R * ze, R = D[5], u += R * Ze, p += R * qe, v += R * He, x += R * we, E += R * xe, S += R * Ie, _ += R * Pe, y += R * J, A += R * L, G += R * z, ce += R * ie, W += R * ue, X += R * me, Z += R * be, ee += R * Le, ne += R * ze, R = D[6], p += R * Ze, v += R * qe, x += R * He, E += R * we, S += R * xe, _ += R * Ie, y += R * Pe, A += R * J, G += R * L, ce += R * z, W += R * ie, X += R * ue, Z += R * me, ee += R * be, ne += R * Le, O += R * ze, R = D[7], v += R * Ze, x += R * qe, E += R * He, S += R * we, _ += R * xe, y += R * Ie, A += R * Pe, G += R * J, ce += R * L, W += R * z, X += R * ie, Z += R * ue, ee += R * me, ne += R * be, O += R * Le, H += R * ze, R = D[8], x += R * Ze, E += R * qe, S += R * He, _ += R * we, y += R * xe, A += R * Ie, G += R * Pe, ce += R * J, W += R * L, X += R * z, Z += R * ie, ee += R * ue, ne += R * me, O += R * be, H += R * Le, Q += R * ze, R = D[9], E += R * Ze, S += R * qe, _ += R * He, y += R * we, A += R * xe, G += R * Ie, ce += R * Pe, W += R * J, X += R * L, Z += R * z, ee += R * ie, ne += R * ue, O += R * me, H += R * be, Q += R * Le, de += R * ze, R = D[10], S += R * Ze, _ += R * qe, y += R * He, A += R * we, G += R * xe, ce += R * Ie, W += R * Pe, X += R * J, Z += R * L, ee += R * z, ne += R * ie, O += R * ue, H += R * me, Q += R * be, de += R * Le, ge += R * ze, R = D[11], _ += R * Ze, y += R * qe, A += R * He, G += R * we, ce += R * xe, W += R * Ie, X += R * Pe, Z += R * J, ee += R * L, ne += R * z, O += R * ie, H += R * ue, Q += R * me, de += R * be, ge += R * Le, Te += R * ze, R = D[12], y += R * Ze, A += R * qe, G += R * He, ce += R * we, W += R * xe, X += R * Ie, Z += R * Pe, ee += R * J, ne += R * L, O += R * z, H += R * ie, Q += R * ue, de += R * me, ge += R * be, Te += R * Le, Oe += R * ze, R = D[13], A += R * Ze, G += R * qe, ce += R * He, W += R * we, X += R * xe, Z += R * Ie, ee += R * Pe, ne += R * J, O += R * L, H += R * z, Q += R * ie, de += R * ue, ge += R * me, Te += R * be, Oe += R * Le, De += R * ze, R = D[14], G += R * Ze, ce += R * qe, W += R * He, X += R * we, Z += R * xe, ee += R * Ie, ne += R * Pe, O += R * J, H += R * L, Q += R * z, de += R * ie, ge += R * ue, Te += R * me, Oe += R * be, De += R * Le, et += R * ze, R = D[15], ce += R * Ze, W += R * qe, X += R * He, Z += R * we, ee += R * xe, ne += R * Ie, O += R * Pe, H += R * J, Q += R * L, de += R * z, ge += R * ie, Te += R * ue, Oe += R * me, De += R * be, et += R * Le, rt += R * ze, j += 38 * W, Y += 38 * X, U += 38 * Z, I += 38 * ee, g += 38 * ne, u += 38 * O, p += 38 * H, v += 38 * Q, x += 38 * de, E += 38 * ge, S += 38 * Te, _ += 38 * Oe, y += 38 * De, A += 38 * et, G += 38 * rt, P = 1, R = j + P + 65535, P = Math.floor(R / 65536), j = R - P * 65536, R = Y + P + 65535, P = Math.floor(R / 65536), Y = R - P * 65536, R = U + P + 65535, P = Math.floor(R / 65536), U = R - P * 65536, R = I + P + 65535, P = Math.floor(R / 65536), I = R - P * 65536, R = g + P + 65535, P = Math.floor(R / 65536), g = R - P * 65536, R = u + P + 65535, P = Math.floor(R / 65536), u = R - P * 65536, R = p + P + 65535, P = Math.floor(R / 65536), p = R - P * 65536, R = v + P + 65535, P = Math.floor(R / 65536), v = R - P * 65536, R = x + P + 65535, P = Math.floor(R / 65536), x = R - P * 65536, R = E + P + 65535, P = Math.floor(R / 65536), E = R - P * 65536, R = S + P + 65535, P = Math.floor(R / 65536), S = R - P * 65536, R = _ + P + 65535, P = Math.floor(R / 65536), _ = R - P * 65536, R = y + P + 65535, P = Math.floor(R / 65536), y = R - P * 65536, R = A + P + 65535, P = Math.floor(R / 65536), A = R - P * 65536, R = G + P + 65535, P = Math.floor(R / 65536), G = R - P * 65536, R = ce + P + 65535, P = Math.floor(R / 65536), ce = R - P * 65536, j += P - 1 + 37 * (P - 1), P = 1, R = j + P + 65535, P = Math.floor(R / 65536), j = R - P * 65536, R = Y + P + 65535, P = Math.floor(R / 65536), Y = R - P * 65536, R = U + P + 65535, P = Math.floor(R / 65536), U = R - P * 65536, R = I + P + 65535, P = Math.floor(R / 65536), I = R - P * 65536, R = g + P + 65535, P = Math.floor(R / 65536), g = R - P * 65536, R = u + P + 65535, P = Math.floor(R / 65536), u = R - P * 65536, R = p + P + 65535, P = Math.floor(R / 65536), p = R - P * 65536, R = v + P + 65535, P = Math.floor(R / 65536), v = R - P * 65536, R = x + P + 65535, P = Math.floor(R / 65536), x = R - P * 65536, R = E + P + 65535, P = Math.floor(R / 65536), E = R - P * 65536, R = S + P + 65535, P = Math.floor(R / 65536), S = R - P * 65536, R = _ + P + 65535, P = Math.floor(R / 65536), _ = R - P * 65536, R = y + P + 65535, P = Math.floor(R / 65536), y = R - P * 65536, R = A + P + 65535, P = Math.floor(R / 65536), A = R - P * 65536, R = G + P + 65535, P = Math.floor(R / 65536), G = R - P * 65536, R = ce + P + 65535, P = Math.floor(R / 65536), ce = R - P * 65536, j += P - 1 + 37 * (P - 1), F[0] = j, F[1] = Y, F[2] = U, F[3] = I, F[4] = g, F[5] = u, F[6] = p, F[7] = v, F[8] = x, F[9] = E, F[10] = S, F[11] = _, F[12] = y, F[13] = A, F[14] = G, F[15] = ce
    }

    function b(F, D) {
      w(F, D, D)
    }

    function C(F, D) {
      const V = n();
      for (let R = 0; R < 16; R++) V[R] = D[R];
      for (let R = 253; R >= 0; R--) b(V, V), R !== 2 && R !== 4 && w(V, V, D);
      for (let R = 0; R < 16; R++) F[R] = V[R]
    }

    function M(F, D) {
      const V = new Uint8Array(32),
        R = new Float64Array(80),
        P = n(),
        j = n(),
        Y = n(),
        U = n(),
        I = n(),
        g = n();
      for (let x = 0; x < 31; x++) V[x] = F[x];
      V[31] = F[31] & 127 | 64, V[0] &= 248, l(R, D);
      for (let x = 0; x < 16; x++) j[x] = R[x];
      P[0] = U[0] = 1;
      for (let x = 254; x >= 0; --x) {
        const E = V[x >>> 3] >>> (x & 7) & 1;
        a(P, j, E), a(Y, U, E), h(I, P, Y), f(P, P, Y), h(Y, j, U), f(j, j, U), b(U, I), b(g, P), w(P, Y, P), w(Y, j, I), h(I, P, Y), f(P, P, Y), b(j, P), f(Y, U, g), w(P, Y, s), h(P, P, U), w(Y, Y, P), w(P, U, g), w(U, j, R), b(j, I), a(P, j, E), a(Y, U, E)
      }
      for (let x = 0; x < 16; x++) R[x + 16] = P[x], R[x + 32] = Y[x], R[x + 48] = j[x], R[x + 64] = U[x];
      const u = R.subarray(32),
        p = R.subarray(16);
      C(u, u), w(p, p, u);
      const v = new Uint8Array(32);
      return c(v, p), v
    }
    t.scalarMult = M;

    function N(F) {
      return M(F, i)
    }
    t.scalarMultBase = N;

    function $(F) {
      if (F.length !== t.SECRET_KEY_LENGTH) throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);
      const D = new Uint8Array(F);
      return {
        publicKey: N(D),
        secretKey: D
      }
    }
    t.generateKeyPairFromSeed = $;

    function k(F) {
      const D = (0, e.randomBytes)(32, F),
        V = $(D);
      return (0, r.wipe)(D), V
    }
    t.generateKeyPair = k;

    function B(F, D, V = !1) {
      if (F.length !== t.PUBLIC_KEY_LENGTH) throw new Error("X25519: incorrect secret key length");
      if (D.length !== t.PUBLIC_KEY_LENGTH) throw new Error("X25519: incorrect public key length");
      const R = M(F, D);
      if (V) {
        let P = 0;
        for (let j = 0; j < R.length; j++) P |= R[j];
        if (P === 0) throw new Error("X25519: invalid shared key")
      }
      return R
    }
    t.sharedKey = B
  })(pC);

  function CO(t = 0) {
    return globalThis.Buffer != null && globalThis.Buffer.allocUnsafe != null ? globalThis.Buffer.allocUnsafe(t) : new Uint8Array(t)
  }

  function gC(t, e) {
    e || (e = t.reduce((i, s) => i + s.length, 0));
    const r = CO(e);
    let n = 0;
    for (const i of t) r.set(i, n), n += i.length;
    return r
  }

  function EO(t, e, r, n) {
    return {
      name: t,
      prefix: e,
      encoder: {
        name: t,
        prefix: e,
        encode: r
      },
      decoder: {
        decode: n
      }
    }
  }
  const AO = EO("utf8", "u", t => "u" + new TextDecoder("utf8").decode(t), t => new TextEncoder().encode(t.substring(1))),
    mC = EO("ascii", "a", t => {
      let e = "a";
      for (let r = 0; r < t.length; r++) e += String.fromCharCode(t[r]);
      return e
    }, t => {
      t = t.substring(1);
      const e = CO(t.length);
      for (let r = 0; r < t.length; r++) e[r] = t.charCodeAt(r);
      return e
    }),
    SO = {
      utf8: AO,
      "utf-8": AO,
      hex: P5.base16,
      latin1: mC,
      ascii: mC,
      binary: mC,
      ...P5
    };

  function wa(t, e = "utf8") {
    const r = SO[e];
    if (!r) throw new Error(`Unsupported encoding "${e}"`);
    return (e === "utf8" || e === "utf-8") && globalThis.Buffer != null && globalThis.Buffer.from != null ? globalThis.Buffer.from(t, "utf8") : r.decoder.decode(`${r.prefix}${t}`)
  }

  function uo(t, e = "utf8") {
    const r = SO[e];
    if (!r) throw new Error(`Unsupported encoding "${e}"`);
    return (e === "utf8" || e === "utf-8") && globalThis.Buffer != null && globalThis.Buffer.from != null ? globalThis.Buffer.from(t.buffer, t.byteOffset, t.byteLength).toString("utf8") : r.encoder.encode(t).substring(1)
  }
  var IO = {};
  const spe = {
    name: "elliptic",
    version: "6.6.0",
    description: "EC cryptography",
    main: "lib/elliptic.js",
    files: ["lib"],
    scripts: {
      lint: "eslint lib test",
      "lint:fix": "npm run lint -- --fix",
      unit: "istanbul test _mocha --reporter=spec test/index.js",
      test: "npm run lint && npm run unit",
      version: "grunt dist && git add dist/"
    },
    repository: {
      type: "git",
      url: "git@github.com:indutny/elliptic"
    },
    keywords: ["EC", "Elliptic", "curve", "Cryptography"],
    author: "Fedor Indutny <fedor@indutny.com>",
    license: "MIT",
    bugs: {
      url: "https://github.com/indutny/elliptic/issues"
    },
    homepage: "https://github.com/indutny/elliptic",
    devDependencies: {
      brfs: "^2.0.2",
      coveralls: "^3.1.0",
      eslint: "^7.6.0",
      grunt: "^1.2.1",
      "grunt-browserify": "^5.3.0",
      "grunt-cli": "^1.3.2",
      "grunt-contrib-connect": "^3.0.0",
      "grunt-contrib-copy": "^1.0.0",
      "grunt-contrib-uglify": "^5.0.0",
      "grunt-mocha-istanbul": "^5.0.2",
      "grunt-saucelabs": "^9.0.1",
      istanbul: "^0.4.5",
      mocha: "^8.0.1"
    },
    dependencies: {
      "bn.js": "^4.11.9",
      brorand: "^1.1.0",
      "hash.js": "^1.0.0",
      "hmac-drbg": "^1.0.1",
      inherits: "^2.0.4",
      "minimalistic-assert": "^1.0.1",
      "minimalistic-crypto-utils": "^1.0.1"
    }
  };
  var Uo = {},
    wC = {
      exports: {}
    };
  wC.exports,
    function (t) {
      (function (e, r) {
        function n(U, I) {
          if (!U) throw new Error(I || "Assertion failed")
        }

        function i(U, I) {
          U.super_ = I;
          var g = function () {};
          g.prototype = I.prototype, U.prototype = new g, U.prototype.constructor = U
        }

        function s(U, I, g) {
          if (s.isBN(U)) return U;
          this.negative = 0, this.words = null, this.length = 0, this.red = null, U !== null && ((I === "le" || I === "be") && (g = I, I = 10), this._init(U || 0, I || 10, g || "be"))
        }
        typeof e == "object" ? e.exports = s : r.BN = s, s.BN = s, s.wordSize = 26;
        var o;
        try {
          typeof window < "u" && typeof window.Buffer < "u" ? o = window.Buffer : o = eg.Buffer
        } catch {}
        s.isBN = function (I) {
          return I instanceof s ? !0 : I !== null && typeof I == "object" && I.constructor.wordSize === s.wordSize && Array.isArray(I.words)
        }, s.max = function (I, g) {
          return I.cmp(g) > 0 ? I : g
        }, s.min = function (I, g) {
          return I.cmp(g) < 0 ? I : g
        }, s.prototype._init = function (I, g, u) {
          if (typeof I == "number") return this._initNumber(I, g, u);
          if (typeof I == "object") return this._initArray(I, g, u);
          g === "hex" && (g = 16), n(g === (g | 0) && g >= 2 && g <= 36), I = I.toString().replace(/\s+/g, "");
          var p = 0;
          I[0] === "-" && (p++, this.negative = 1), p < I.length && (g === 16 ? this._parseHex(I, p, u) : (this._parseBase(I, g, p), u === "le" && this._initArray(this.toArray(), g, u)))
        }, s.prototype._initNumber = function (I, g, u) {
          I < 0 && (this.negative = 1, I = -I), I < 67108864 ? (this.words = [I & 67108863], this.length = 1) : I < 4503599627370496 ? (this.words = [I & 67108863, I / 67108864 & 67108863], this.length = 2) : (n(I < 9007199254740992), this.words = [I & 67108863, I / 67108864 & 67108863, 1], this.length = 3), u === "le" && this._initArray(this.toArray(), g, u)
        }, s.prototype._initArray = function (I, g, u) {
          if (n(typeof I.length == "number"), I.length <= 0) return this.words = [0], this.length = 1, this;
          this.length = Math.ceil(I.length / 3), this.words = new Array(this.length);
          for (var p = 0; p < this.length; p++) this.words[p] = 0;
          var v, x, E = 0;
          if (u === "be")
            for (p = I.length - 1, v = 0; p >= 0; p -= 3) x = I[p] | I[p - 1] << 8 | I[p - 2] << 16, this.words[v] |= x << E & 67108863, this.words[v + 1] = x >>> 26 - E & 67108863, E += 24, E >= 26 && (E -= 26, v++);
          else if (u === "le")
            for (p = 0, v = 0; p < I.length; p += 3) x = I[p] | I[p + 1] << 8 | I[p + 2] << 16, this.words[v] |= x << E & 67108863, this.words[v + 1] = x >>> 26 - E & 67108863, E += 24, E >= 26 && (E -= 26, v++);
          return this.strip()
        };

        function a(U, I) {
          var g = U.charCodeAt(I);
          return g >= 65 && g <= 70 ? g - 55 : g >= 97 && g <= 102 ? g - 87 : g - 48 & 15
        }

        function c(U, I, g) {
          var u = a(U, g);
          return g - 1 >= I && (u |= a(U, g - 1) << 4), u
        }
        s.prototype._parseHex = function (I, g, u) {
          this.length = Math.ceil((I.length - g) / 6), this.words = new Array(this.length);
          for (var p = 0; p < this.length; p++) this.words[p] = 0;
          var v = 0,
            x = 0,
            E;
          if (u === "be")
            for (p = I.length - 1; p >= g; p -= 2) E = c(I, g, p) << v, this.words[x] |= E & 67108863, v >= 18 ? (v -= 18, x += 1, this.words[x] |= E >>> 26) : v += 8;
          else {
            var S = I.length - g;
            for (p = S % 2 === 0 ? g + 1 : g; p < I.length; p += 2) E = c(I, g, p) << v, this.words[x] |= E & 67108863, v >= 18 ? (v -= 18, x += 1, this.words[x] |= E >>> 26) : v += 8
          }
          this.strip()
        };

        function l(U, I, g, u) {
          for (var p = 0, v = Math.min(U.length, g), x = I; x < v; x++) {
            var E = U.charCodeAt(x) - 48;
            p *= u, E >= 49 ? p += E - 49 + 10 : E >= 17 ? p += E - 17 + 10 : p += E
          }
          return p
        }
        s.prototype._parseBase = function (I, g, u) {
          this.words = [0], this.length = 1;
          for (var p = 0, v = 1; v <= 67108863; v *= g) p++;
          p--, v = v / g | 0;
          for (var x = I.length - u, E = x % p, S = Math.min(x, x - E) + u, _ = 0, y = u; y < S; y += p) _ = l(I, y, y + p, g), this.imuln(v), this.words[0] + _ < 67108864 ? this.words[0] += _ : this._iaddn(_);
          if (E !== 0) {
            var A = 1;
            for (_ = l(I, y, I.length, g), y = 0; y < E; y++) A *= g;
            this.imuln(A), this.words[0] + _ < 67108864 ? this.words[0] += _ : this._iaddn(_)
          }
          this.strip()
        }, s.prototype.copy = function (I) {
          I.words = new Array(this.length);
          for (var g = 0; g < this.length; g++) I.words[g] = this.words[g];
          I.length = this.length, I.negative = this.negative, I.red = this.red
        }, s.prototype.clone = function () {
          var I = new s(null);
          return this.copy(I), I
        }, s.prototype._expand = function (I) {
          for (; this.length < I;) this.words[this.length++] = 0;
          return this
        }, s.prototype.strip = function () {
          for (; this.length > 1 && this.words[this.length - 1] === 0;) this.length--;
          return this._normSign()
        }, s.prototype._normSign = function () {
          return this.length === 1 && this.words[0] === 0 && (this.negative = 0), this
        }, s.prototype.inspect = function () {
          return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">"
        };
        var h = ["", "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"],
          f = [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],
          w = [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];
        s.prototype.toString = function (I, g) {
          I = I || 10, g = g | 0 || 1;
          var u;
          if (I === 16 || I === "hex") {
            u = "";
            for (var p = 0, v = 0, x = 0; x < this.length; x++) {
              var E = this.words[x],
                S = ((E << p | v) & 16777215).toString(16);
              v = E >>> 24 - p & 16777215, v !== 0 || x !== this.length - 1 ? u = h[6 - S.length] + S + u : u = S + u, p += 2, p >= 26 && (p -= 26, x--)
            }
            for (v !== 0 && (u = v.toString(16) + u); u.length % g !== 0;) u = "0" + u;
            return this.negative !== 0 && (u = "-" + u), u
          }
          if (I === (I | 0) && I >= 2 && I <= 36) {
            var _ = f[I],
              y = w[I];
            u = "";
            var A = this.clone();
            for (A.negative = 0; !A.isZero();) {
              var G = A.modn(y).toString(I);
              A = A.idivn(y), A.isZero() ? u = G + u : u = h[_ - G.length] + G + u
            }
            for (this.isZero() && (u = "0" + u); u.length % g !== 0;) u = "0" + u;
            return this.negative !== 0 && (u = "-" + u), u
          }
          n(!1, "Base should be between 2 and 36")
        }, s.prototype.toNumber = function () {
          var I = this.words[0];
          return this.length === 2 ? I += this.words[1] * 67108864 : this.length === 3 && this.words[2] === 1 ? I += 4503599627370496 + this.words[1] * 67108864 : this.length > 2 && n(!1, "Number can only safely store up to 53 bits"), this.negative !== 0 ? -I : I
        }, s.prototype.toJSON = function () {
          return this.toString(16)
        }, s.prototype.toBuffer = function (I, g) {
          return n(typeof o < "u"), this.toArrayLike(o, I, g)
        }, s.prototype.toArray = function (I, g) {
          return this.toArrayLike(Array, I, g)
        }, s.prototype.toArrayLike = function (I, g, u) {
          var p = this.byteLength(),
            v = u || Math.max(1, p);
          n(p <= v, "byte array longer than desired length"), n(v > 0, "Requested array length <= 0"), this.strip();
          var x = g === "le",
            E = new I(v),
            S, _, y = this.clone();
          if (x) {
            for (_ = 0; !y.isZero(); _++) S = y.andln(255), y.iushrn(8), E[_] = S;
            for (; _ < v; _++) E[_] = 0
          } else {
            for (_ = 0; _ < v - p; _++) E[_] = 0;
            for (_ = 0; !y.isZero(); _++) S = y.andln(255), y.iushrn(8), E[v - _ - 1] = S
          }
          return E
        }, Math.clz32 ? s.prototype._countBits = function (I) {
          return 32 - Math.clz32(I)
        } : s.prototype._countBits = function (I) {
          var g = I,
            u = 0;
          return g >= 4096 && (u += 13, g >>>= 13), g >= 64 && (u += 7, g >>>= 7), g >= 8 && (u += 4, g >>>= 4), g >= 2 && (u += 2, g >>>= 2), u + g
        }, s.prototype._zeroBits = function (I) {
          if (I === 0) return 26;
          var g = I,
            u = 0;
          return g & 8191 || (u += 13, g >>>= 13), g & 127 || (u += 7, g >>>= 7), g & 15 || (u += 4, g >>>= 4), g & 3 || (u += 2, g >>>= 2), g & 1 || u++, u
        }, s.prototype.bitLength = function () {
          var I = this.words[this.length - 1],
            g = this._countBits(I);
          return (this.length - 1) * 26 + g
        };

        function b(U) {
          for (var I = new Array(U.bitLength()), g = 0; g < I.length; g++) {
            var u = g / 26 | 0,
              p = g % 26;
            I[g] = (U.words[u] & 1 << p) >>> p
          }
          return I
        }
        s.prototype.zeroBits = function () {
          if (this.isZero()) return 0;
          for (var I = 0, g = 0; g < this.length; g++) {
            var u = this._zeroBits(this.words[g]);
            if (I += u, u !== 26) break
          }
          return I
        }, s.prototype.byteLength = function () {
          return Math.ceil(this.bitLength() / 8)
        }, s.prototype.toTwos = function (I) {
          return this.negative !== 0 ? this.abs().inotn(I).iaddn(1) : this.clone()
        }, s.prototype.fromTwos = function (I) {
          return this.testn(I - 1) ? this.notn(I).iaddn(1).ineg() : this.clone()
        }, s.prototype.isNeg = function () {
          return this.negative !== 0
        }, s.prototype.neg = function () {
          return this.clone().ineg()
        }, s.prototype.ineg = function () {
          return this.isZero() || (this.negative ^= 1), this
        }, s.prototype.iuor = function (I) {
          for (; this.length < I.length;) this.words[this.length++] = 0;
          for (var g = 0; g < I.length; g++) this.words[g] = this.words[g] | I.words[g];
          return this.strip()
        }, s.prototype.ior = function (I) {
          return n((this.negative | I.negative) === 0), this.iuor(I)
        }, s.prototype.or = function (I) {
          return this.length > I.length ? this.clone().ior(I) : I.clone().ior(this)
        }, s.prototype.uor = function (I) {
          return this.length > I.length ? this.clone().iuor(I) : I.clone().iuor(this)
        }, s.prototype.iuand = function (I) {
          var g;
          this.length > I.length ? g = I : g = this;
          for (var u = 0; u < g.length; u++) this.words[u] = this.words[u] & I.words[u];
          return this.length = g.length, this.strip()
        }, s.prototype.iand = function (I) {
          return n((this.negative | I.negative) === 0), this.iuand(I)
        }, s.prototype.and = function (I) {
          return this.length > I.length ? this.clone().iand(I) : I.clone().iand(this)
        }, s.prototype.uand = function (I) {
          return this.length > I.length ? this.clone().iuand(I) : I.clone().iuand(this)
        }, s.prototype.iuxor = function (I) {
          var g, u;
          this.length > I.length ? (g = this, u = I) : (g = I, u = this);
          for (var p = 0; p < u.length; p++) this.words[p] = g.words[p] ^ u.words[p];
          if (this !== g)
            for (; p < g.length; p++) this.words[p] = g.words[p];
          return this.length = g.length, this.strip()
        }, s.prototype.ixor = function (I) {
          return n((this.negative | I.negative) === 0), this.iuxor(I)
        }, s.prototype.xor = function (I) {
          return this.length > I.length ? this.clone().ixor(I) : I.clone().ixor(this)
        }, s.prototype.uxor = function (I) {
          return this.length > I.length ? this.clone().iuxor(I) : I.clone().iuxor(this)
        }, s.prototype.inotn = function (I) {
          n(typeof I == "number" && I >= 0);
          var g = Math.ceil(I / 26) | 0,
            u = I % 26;
          this._expand(g), u > 0 && g--;
          for (var p = 0; p < g; p++) this.words[p] = ~this.words[p] & 67108863;
          return u > 0 && (this.words[p] = ~this.words[p] & 67108863 >> 26 - u), this.strip()
        }, s.prototype.notn = function (I) {
          return this.clone().inotn(I)
        }, s.prototype.setn = function (I, g) {
          n(typeof I == "number" && I >= 0);
          var u = I / 26 | 0,
            p = I % 26;
          return this._expand(u + 1), g ? this.words[u] = this.words[u] | 1 << p : this.words[u] = this.words[u] & ~(1 << p), this.strip()
        }, s.prototype.iadd = function (I) {
          var g;
          if (this.negative !== 0 && I.negative === 0) return this.negative = 0, g = this.isub(I), this.negative ^= 1, this._normSign();
          if (this.negative === 0 && I.negative !== 0) return I.negative = 0, g = this.isub(I), I.negative = 1, g._normSign();
          var u, p;
          this.length > I.length ? (u = this, p = I) : (u = I, p = this);
          for (var v = 0, x = 0; x < p.length; x++) g = (u.words[x] | 0) + (p.words[x] | 0) + v, this.words[x] = g & 67108863, v = g >>> 26;
          for (; v !== 0 && x < u.length; x++) g = (u.words[x] | 0) + v, this.words[x] = g & 67108863, v = g >>> 26;
          if (this.length = u.length, v !== 0) this.words[this.length] = v, this.length++;
          else if (u !== this)
            for (; x < u.length; x++) this.words[x] = u.words[x];
          return this
        }, s.prototype.add = function (I) {
          var g;
          return I.negative !== 0 && this.negative === 0 ? (I.negative = 0, g = this.sub(I), I.negative ^= 1, g) : I.negative === 0 && this.negative !== 0 ? (this.negative = 0, g = I.sub(this), this.negative = 1, g) : this.length > I.length ? this.clone().iadd(I) : I.clone().iadd(this)
        }, s.prototype.isub = function (I) {
          if (I.negative !== 0) {
            I.negative = 0;
            var g = this.iadd(I);
            return I.negative = 1, g._normSign()
          } else if (this.negative !== 0) return this.negative = 0, this.iadd(I), this.negative = 1, this._normSign();
          var u = this.cmp(I);
          if (u === 0) return this.negative = 0, this.length = 1, this.words[0] = 0, this;
          var p, v;
          u > 0 ? (p = this, v = I) : (p = I, v = this);
          for (var x = 0, E = 0; E < v.length; E++) g = (p.words[E] | 0) - (v.words[E] | 0) + x, x = g >> 26, this.words[E] = g & 67108863;
          for (; x !== 0 && E < p.length; E++) g = (p.words[E] | 0) + x, x = g >> 26, this.words[E] = g & 67108863;
          if (x === 0 && E < p.length && p !== this)
            for (; E < p.length; E++) this.words[E] = p.words[E];
          return this.length = Math.max(this.length, E), p !== this && (this.negative = 1), this.strip()
        }, s.prototype.sub = function (I) {
          return this.clone().isub(I)
        };

        function C(U, I, g) {
          g.negative = I.negative ^ U.negative;
          var u = U.length + I.length | 0;
          g.length = u, u = u - 1 | 0;
          var p = U.words[0] | 0,
            v = I.words[0] | 0,
            x = p * v,
            E = x & 67108863,
            S = x / 67108864 | 0;
          g.words[0] = E;
          for (var _ = 1; _ < u; _++) {
            for (var y = S >>> 26, A = S & 67108863, G = Math.min(_, I.length - 1), ce = Math.max(0, _ - U.length + 1); ce <= G; ce++) {
              var W = _ - ce | 0;
              p = U.words[W] | 0, v = I.words[ce] | 0, x = p * v + A, y += x / 67108864 | 0, A = x & 67108863
            }
            g.words[_] = A | 0, S = y | 0
          }
          return S !== 0 ? g.words[_] = S | 0 : g.length--, g.strip()
        }
        var M = function (I, g, u) {
          var p = I.words,
            v = g.words,
            x = u.words,
            E = 0,
            S, _, y, A = p[0] | 0,
            G = A & 8191,
            ce = A >>> 13,
            W = p[1] | 0,
            X = W & 8191,
            Z = W >>> 13,
            ee = p[2] | 0,
            ne = ee & 8191,
            O = ee >>> 13,
            H = p[3] | 0,
            Q = H & 8191,
            de = H >>> 13,
            ge = p[4] | 0,
            Te = ge & 8191,
            Oe = ge >>> 13,
            De = p[5] | 0,
            et = De & 8191,
            rt = De >>> 13,
            Ze = p[6] | 0,
            qe = Ze & 8191,
            He = Ze >>> 13,
            we = p[7] | 0,
            xe = we & 8191,
            Ie = we >>> 13,
            Pe = p[8] | 0,
            J = Pe & 8191,
            L = Pe >>> 13,
            z = p[9] | 0,
            ie = z & 8191,
            ue = z >>> 13,
            me = v[0] | 0,
            be = me & 8191,
            Le = me >>> 13,
            ze = v[1] | 0,
            Qe = ze & 8191,
            Xe = ze >>> 13,
            Je = v[2] | 0,
            kt = Je & 8191,
            Ut = Je >>> 13,
            Ft = v[3] | 0,
            Wt = Ft & 8191,
            pt = Ft >>> 13,
            ct = v[4] | 0,
            gt = ct & 8191,
            mt = ct >>> 13,
            ht = v[5] | 0,
            lt = ht & 8191,
            xt = ht >>> 13,
            Ct = v[6] | 0,
            wt = Ct & 8191,
            Et = Ct >>> 13,
            vt = v[7] | 0,
            yt = vt & 8191,
            bt = vt >>> 13,
            st = v[8] | 0,
            At = st & 8191,
            St = st >>> 13,
            Gt = v[9] | 0,
            Zt = Gt & 8191,
            Yt = Gt >>> 13;
          u.negative = I.negative ^ g.negative, u.length = 19, S = Math.imul(G, be), _ = Math.imul(G, Le), _ = _ + Math.imul(ce, be) | 0, y = Math.imul(ce, Le);
          var Pt = (E + S | 0) + ((_ & 8191) << 13) | 0;
          E = (y + (_ >>> 13) | 0) + (Pt >>> 26) | 0, Pt &= 67108863, S = Math.imul(X, be), _ = Math.imul(X, Le), _ = _ + Math.imul(Z, be) | 0, y = Math.imul(Z, Le), S = S + Math.imul(G, Qe) | 0, _ = _ + Math.imul(G, Xe) | 0, _ = _ + Math.imul(ce, Qe) | 0, y = y + Math.imul(ce, Xe) | 0;
          var br = (E + S | 0) + ((_ & 8191) << 13) | 0;
          E = (y + (_ >>> 13) | 0) + (br >>> 26) | 0, br &= 67108863, S = Math.imul(ne, be), _ = Math.imul(ne, Le), _ = _ + Math.imul(O, be) | 0, y = Math.imul(O, Le), S = S + Math.imul(X, Qe) | 0, _ = _ + Math.imul(X, Xe) | 0, _ = _ + Math.imul(Z, Qe) | 0, y = y + Math.imul(Z, Xe) | 0, S = S + Math.imul(G, kt) | 0, _ = _ + Math.imul(G, Ut) | 0, _ = _ + Math.imul(ce, kt) | 0, y = y + Math.imul(ce, Ut) | 0;
          var Nn = (E + S | 0) + ((_ & 8191) << 13) | 0;
          E = (y + (_ >>> 13) | 0) + (Nn >>> 26) | 0, Nn &= 67108863, S = Math.imul(Q, be), _ = Math.imul(Q, Le), _ = _ + Math.imul(de, be) | 0, y = Math.imul(de, Le), S = S + Math.imul(ne, Qe) | 0, _ = _ + Math.imul(ne, Xe) | 0, _ = _ + Math.imul(O, Qe) | 0, y = y + Math.imul(O, Xe) | 0, S = S + Math.imul(X, kt) | 0, _ = _ + Math.imul(X, Ut) | 0, _ = _ + Math.imul(Z, kt) | 0, y = y + Math.imul(Z, Ut) | 0, S = S + Math.imul(G, Wt) | 0, _ = _ + Math.imul(G, pt) | 0, _ = _ + Math.imul(ce, Wt) | 0, y = y + Math.imul(ce, pt) | 0;
          var Mn = (E + S | 0) + ((_ & 8191) << 13) | 0;
          E = (y + (_ >>> 13) | 0) + (Mn >>> 26) | 0, Mn &= 67108863, S = Math.imul(Te, be), _ = Math.imul(Te, Le), _ = _ + Math.imul(Oe, be) | 0, y = Math.imul(Oe, Le), S = S + Math.imul(Q, Qe) | 0, _ = _ + Math.imul(Q, Xe) | 0, _ = _ + Math.imul(de, Qe) | 0, y = y + Math.imul(de, Xe) | 0, S = S + Math.imul(ne, kt) | 0, _ = _ + Math.imul(ne, Ut) | 0, _ = _ + Math.imul(O, kt) | 0, y = y + Math.imul(O, Ut) | 0, S = S + Math.imul(X, Wt) | 0, _ = _ + Math.imul(X, pt) | 0, _ = _ + Math.imul(Z, Wt) | 0, y = y + Math.imul(Z, pt) | 0, S = S + Math.imul(G, gt) | 0, _ = _ + Math.imul(G, mt) | 0, _ = _ + Math.imul(ce, gt) | 0, y = y + Math.imul(ce, mt) | 0;
          var Pn = (E + S | 0) + ((_ & 8191) << 13) | 0;
          E = (y + (_ >>> 13) | 0) + (Pn >>> 26) | 0, Pn &= 67108863, S = Math.imul(et, be), _ = Math.imul(et, Le), _ = _ + Math.imul(rt, be) | 0, y = Math.imul(rt, Le), S = S + Math.imul(Te, Qe) | 0, _ = _ + Math.imul(Te, Xe) | 0, _ = _ + Math.imul(Oe, Qe) | 0, y = y + Math.imul(Oe, Xe) | 0, S = S + Math.imul(Q, kt) | 0, _ = _ + Math.imul(Q, Ut) | 0, _ = _ + Math.imul(de, kt) | 0, y = y + Math.imul(de, Ut) | 0, S = S + Math.imul(ne, Wt) | 0, _ = _ + Math.imul(ne, pt) | 0, _ = _ + Math.imul(O, Wt) | 0, y = y + Math.imul(O, pt) | 0, S = S + Math.imul(X, gt) | 0, _ = _ + Math.imul(X, mt) | 0, _ = _ + Math.imul(Z, gt) | 0, y = y + Math.imul(Z, mt) | 0, S = S + Math.imul(G, lt) | 0, _ = _ + Math.imul(G, xt) | 0, _ = _ + Math.imul(ce, lt) | 0, y = y + Math.imul(ce, xt) | 0;
          var $n = (E + S | 0) + ((_ & 8191) << 13) | 0;
          E = (y + (_ >>> 13) | 0) + ($n >>> 26) | 0, $n &= 67108863, S = Math.imul(qe, be), _ = Math.imul(qe, Le), _ = _ + Math.imul(He, be) | 0, y = Math.imul(He, Le), S = S + Math.imul(et, Qe) | 0, _ = _ + Math.imul(et, Xe) | 0, _ = _ + Math.imul(rt, Qe) | 0, y = y + Math.imul(rt, Xe) | 0, S = S + Math.imul(Te, kt) | 0, _ = _ + Math.imul(Te, Ut) | 0, _ = _ + Math.imul(Oe, kt) | 0, y = y + Math.imul(Oe, Ut) | 0, S = S + Math.imul(Q, Wt) | 0, _ = _ + Math.imul(Q, pt) | 0, _ = _ + Math.imul(de, Wt) | 0, y = y + Math.imul(de, pt) | 0, S = S + Math.imul(ne, gt) | 0, _ = _ + Math.imul(ne, mt) | 0, _ = _ + Math.imul(O, gt) | 0, y = y + Math.imul(O, mt) | 0, S = S + Math.imul(X, lt) | 0, _ = _ + Math.imul(X, xt) | 0, _ = _ + Math.imul(Z, lt) | 0, y = y + Math.imul(Z, xt) | 0, S = S + Math.imul(G, wt) | 0, _ = _ + Math.imul(G, Et) | 0, _ = _ + Math.imul(ce, wt) | 0, y = y + Math.imul(ce, Et) | 0;
          var tn = (E + S | 0) + ((_ & 8191) << 13) | 0;
          E = (y + (_ >>> 13) | 0) + (tn >>> 26) | 0, tn &= 67108863, S = Math.imul(xe, be), _ = Math.imul(xe, Le), _ = _ + Math.imul(Ie, be) | 0, y = Math.imul(Ie, Le), S = S + Math.imul(qe, Qe) | 0, _ = _ + Math.imul(qe, Xe) | 0, _ = _ + Math.imul(He, Qe) | 0, y = y + Math.imul(He, Xe) | 0, S = S + Math.imul(et, kt) | 0, _ = _ + Math.imul(et, Ut) | 0, _ = _ + Math.imul(rt, kt) | 0, y = y + Math.imul(rt, Ut) | 0, S = S + Math.imul(Te, Wt) | 0, _ = _ + Math.imul(Te, pt) | 0, _ = _ + Math.imul(Oe, Wt) | 0, y = y + Math.imul(Oe, pt) | 0, S = S + Math.imul(Q, gt) | 0, _ = _ + Math.imul(Q, mt) | 0, _ = _ + Math.imul(de, gt) | 0, y = y + Math.imul(de, mt) | 0, S = S + Math.imul(ne, lt) | 0, _ = _ + Math.imul(ne, xt) | 0, _ = _ + Math.imul(O, lt) | 0, y = y + Math.imul(O, xt) | 0, S = S + Math.imul(X, wt) | 0, _ = _ + Math.imul(X, Et) | 0, _ = _ + Math.imul(Z, wt) | 0, y = y + Math.imul(Z, Et) | 0, S = S + Math.imul(G, yt) | 0, _ = _ + Math.imul(G, bt) | 0, _ = _ + Math.imul(ce, yt) | 0, y = y + Math.imul(ce, bt) | 0;
          var Qn = (E + S | 0) + ((_ & 8191) << 13) | 0;
          E = (y + (_ >>> 13) | 0) + (Qn >>> 26) | 0, Qn &= 67108863, S = Math.imul(J, be), _ = Math.imul(J, Le), _ = _ + Math.imul(L, be) | 0, y = Math.imul(L, Le), S = S + Math.imul(xe, Qe) | 0, _ = _ + Math.imul(xe, Xe) | 0, _ = _ + Math.imul(Ie, Qe) | 0, y = y + Math.imul(Ie, Xe) | 0, S = S + Math.imul(qe, kt) | 0, _ = _ + Math.imul(qe, Ut) | 0, _ = _ + Math.imul(He, kt) | 0, y = y + Math.imul(He, Ut) | 0, S = S + Math.imul(et, Wt) | 0, _ = _ + Math.imul(et, pt) | 0, _ = _ + Math.imul(rt, Wt) | 0, y = y + Math.imul(rt, pt) | 0, S = S + Math.imul(Te, gt) | 0, _ = _ + Math.imul(Te, mt) | 0, _ = _ + Math.imul(Oe, gt) | 0, y = y + Math.imul(Oe, mt) | 0, S = S + Math.imul(Q, lt) | 0, _ = _ + Math.imul(Q, xt) | 0, _ = _ + Math.imul(de, lt) | 0, y = y + Math.imul(de, xt) | 0, S = S + Math.imul(ne, wt) | 0, _ = _ + Math.imul(ne, Et) | 0, _ = _ + Math.imul(O, wt) | 0, y = y + Math.imul(O, Et) | 0, S = S + Math.imul(X, yt) | 0, _ = _ + Math.imul(X, bt) | 0, _ = _ + Math.imul(Z, yt) | 0, y = y + Math.imul(Z, bt) | 0, S = S + Math.imul(G, At) | 0, _ = _ + Math.imul(G, St) | 0, _ = _ + Math.imul(ce, At) | 0, y = y + Math.imul(ce, St) | 0;
          var Ii = (E + S | 0) + ((_ & 8191) << 13) | 0;
          E = (y + (_ >>> 13) | 0) + (Ii >>> 26) | 0, Ii &= 67108863, S = Math.imul(ie, be), _ = Math.imul(ie, Le), _ = _ + Math.imul(ue, be) | 0, y = Math.imul(ue, Le), S = S + Math.imul(J, Qe) | 0, _ = _ + Math.imul(J, Xe) | 0, _ = _ + Math.imul(L, Qe) | 0, y = y + Math.imul(L, Xe) | 0, S = S + Math.imul(xe, kt) | 0, _ = _ + Math.imul(xe, Ut) | 0, _ = _ + Math.imul(Ie, kt) | 0, y = y + Math.imul(Ie, Ut) | 0, S = S + Math.imul(qe, Wt) | 0, _ = _ + Math.imul(qe, pt) | 0, _ = _ + Math.imul(He, Wt) | 0, y = y + Math.imul(He, pt) | 0, S = S + Math.imul(et, gt) | 0, _ = _ + Math.imul(et, mt) | 0, _ = _ + Math.imul(rt, gt) | 0, y = y + Math.imul(rt, mt) | 0, S = S + Math.imul(Te, lt) | 0, _ = _ + Math.imul(Te, xt) | 0, _ = _ + Math.imul(Oe, lt) | 0, y = y + Math.imul(Oe, xt) | 0, S = S + Math.imul(Q, wt) | 0, _ = _ + Math.imul(Q, Et) | 0, _ = _ + Math.imul(de, wt) | 0, y = y + Math.imul(de, Et) | 0, S = S + Math.imul(ne, yt) | 0, _ = _ + Math.imul(ne, bt) | 0, _ = _ + Math.imul(O, yt) | 0, y = y + Math.imul(O, bt) | 0, S = S + Math.imul(X, At) | 0, _ = _ + Math.imul(X, St) | 0, _ = _ + Math.imul(Z, At) | 0, y = y + Math.imul(Z, St) | 0, S = S + Math.imul(G, Zt) | 0, _ = _ + Math.imul(G, Yt) | 0, _ = _ + Math.imul(ce, Zt) | 0, y = y + Math.imul(ce, Yt) | 0;
          var Jn = (E + S | 0) + ((_ & 8191) << 13) | 0;
          E = (y + (_ >>> 13) | 0) + (Jn >>> 26) | 0, Jn &= 67108863, S = Math.imul(ie, Qe), _ = Math.imul(ie, Xe), _ = _ + Math.imul(ue, Qe) | 0, y = Math.imul(ue, Xe), S = S + Math.imul(J, kt) | 0, _ = _ + Math.imul(J, Ut) | 0, _ = _ + Math.imul(L, kt) | 0, y = y + Math.imul(L, Ut) | 0, S = S + Math.imul(xe, Wt) | 0, _ = _ + Math.imul(xe, pt) | 0, _ = _ + Math.imul(Ie, Wt) | 0, y = y + Math.imul(Ie, pt) | 0, S = S + Math.imul(qe, gt) | 0, _ = _ + Math.imul(qe, mt) | 0, _ = _ + Math.imul(He, gt) | 0, y = y + Math.imul(He, mt) | 0, S = S + Math.imul(et, lt) | 0, _ = _ + Math.imul(et, xt) | 0, _ = _ + Math.imul(rt, lt) | 0, y = y + Math.imul(rt, xt) | 0, S = S + Math.imul(Te, wt) | 0, _ = _ + Math.imul(Te, Et) | 0, _ = _ + Math.imul(Oe, wt) | 0, y = y + Math.imul(Oe, Et) | 0, S = S + Math.imul(Q, yt) | 0, _ = _ + Math.imul(Q, bt) | 0, _ = _ + Math.imul(de, yt) | 0, y = y + Math.imul(de, bt) | 0, S = S + Math.imul(ne, At) | 0, _ = _ + Math.imul(ne, St) | 0, _ = _ + Math.imul(O, At) | 0, y = y + Math.imul(O, St) | 0, S = S + Math.imul(X, Zt) | 0, _ = _ + Math.imul(X, Yt) | 0, _ = _ + Math.imul(Z, Zt) | 0, y = y + Math.imul(Z, Yt) | 0;
          var Ti = (E + S | 0) + ((_ & 8191) << 13) | 0;
          E = (y + (_ >>> 13) | 0) + (Ti >>> 26) | 0, Ti &= 67108863, S = Math.imul(ie, kt), _ = Math.imul(ie, Ut), _ = _ + Math.imul(ue, kt) | 0, y = Math.imul(ue, Ut), S = S + Math.imul(J, Wt) | 0, _ = _ + Math.imul(J, pt) | 0, _ = _ + Math.imul(L, Wt) | 0, y = y + Math.imul(L, pt) | 0, S = S + Math.imul(xe, gt) | 0, _ = _ + Math.imul(xe, mt) | 0, _ = _ + Math.imul(Ie, gt) | 0, y = y + Math.imul(Ie, mt) | 0, S = S + Math.imul(qe, lt) | 0, _ = _ + Math.imul(qe, xt) | 0, _ = _ + Math.imul(He, lt) | 0, y = y + Math.imul(He, xt) | 0, S = S + Math.imul(et, wt) | 0, _ = _ + Math.imul(et, Et) | 0, _ = _ + Math.imul(rt, wt) | 0, y = y + Math.imul(rt, Et) | 0, S = S + Math.imul(Te, yt) | 0, _ = _ + Math.imul(Te, bt) | 0, _ = _ + Math.imul(Oe, yt) | 0, y = y + Math.imul(Oe, bt) | 0, S = S + Math.imul(Q, At) | 0, _ = _ + Math.imul(Q, St) | 0, _ = _ + Math.imul(de, At) | 0, y = y + Math.imul(de, St) | 0, S = S + Math.imul(ne, Zt) | 0, _ = _ + Math.imul(ne, Yt) | 0, _ = _ + Math.imul(O, Zt) | 0, y = y + Math.imul(O, Yt) | 0;
          var ki = (E + S | 0) + ((_ & 8191) << 13) | 0;
          E = (y + (_ >>> 13) | 0) + (ki >>> 26) | 0, ki &= 67108863, S = Math.imul(ie, Wt), _ = Math.imul(ie, pt), _ = _ + Math.imul(ue, Wt) | 0, y = Math.imul(ue, pt), S = S + Math.imul(J, gt) | 0, _ = _ + Math.imul(J, mt) | 0, _ = _ + Math.imul(L, gt) | 0, y = y + Math.imul(L, mt) | 0, S = S + Math.imul(xe, lt) | 0, _ = _ + Math.imul(xe, xt) | 0, _ = _ + Math.imul(Ie, lt) | 0, y = y + Math.imul(Ie, xt) | 0, S = S + Math.imul(qe, wt) | 0, _ = _ + Math.imul(qe, Et) | 0, _ = _ + Math.imul(He, wt) | 0, y = y + Math.imul(He, Et) | 0, S = S + Math.imul(et, yt) | 0, _ = _ + Math.imul(et, bt) | 0, _ = _ + Math.imul(rt, yt) | 0, y = y + Math.imul(rt, bt) | 0, S = S + Math.imul(Te, At) | 0, _ = _ + Math.imul(Te, St) | 0, _ = _ + Math.imul(Oe, At) | 0, y = y + Math.imul(Oe, St) | 0, S = S + Math.imul(Q, Zt) | 0, _ = _ + Math.imul(Q, Yt) | 0, _ = _ + Math.imul(de, Zt) | 0, y = y + Math.imul(de, Yt) | 0;
          var Xn = (E + S | 0) + ((_ & 8191) << 13) | 0;
          E = (y + (_ >>> 13) | 0) + (Xn >>> 26) | 0, Xn &= 67108863, S = Math.imul(ie, gt), _ = Math.imul(ie, mt), _ = _ + Math.imul(ue, gt) | 0, y = Math.imul(ue, mt), S = S + Math.imul(J, lt) | 0, _ = _ + Math.imul(J, xt) | 0, _ = _ + Math.imul(L, lt) | 0, y = y + Math.imul(L, xt) | 0, S = S + Math.imul(xe, wt) | 0, _ = _ + Math.imul(xe, Et) | 0, _ = _ + Math.imul(Ie, wt) | 0, y = y + Math.imul(Ie, Et) | 0, S = S + Math.imul(qe, yt) | 0, _ = _ + Math.imul(qe, bt) | 0, _ = _ + Math.imul(He, yt) | 0, y = y + Math.imul(He, bt) | 0, S = S + Math.imul(et, At) | 0, _ = _ + Math.imul(et, St) | 0, _ = _ + Math.imul(rt, At) | 0, y = y + Math.imul(rt, St) | 0, S = S + Math.imul(Te, Zt) | 0, _ = _ + Math.imul(Te, Yt) | 0, _ = _ + Math.imul(Oe, Zt) | 0, y = y + Math.imul(Oe, Yt) | 0;
          var mi = (E + S | 0) + ((_ & 8191) << 13) | 0;
          E = (y + (_ >>> 13) | 0) + (mi >>> 26) | 0, mi &= 67108863, S = Math.imul(ie, lt), _ = Math.imul(ie, xt), _ = _ + Math.imul(ue, lt) | 0, y = Math.imul(ue, xt), S = S + Math.imul(J, wt) | 0, _ = _ + Math.imul(J, Et) | 0, _ = _ + Math.imul(L, wt) | 0, y = y + Math.imul(L, Et) | 0, S = S + Math.imul(xe, yt) | 0, _ = _ + Math.imul(xe, bt) | 0, _ = _ + Math.imul(Ie, yt) | 0, y = y + Math.imul(Ie, bt) | 0, S = S + Math.imul(qe, At) | 0, _ = _ + Math.imul(qe, St) | 0, _ = _ + Math.imul(He, At) | 0, y = y + Math.imul(He, St) | 0, S = S + Math.imul(et, Zt) | 0, _ = _ + Math.imul(et, Yt) | 0, _ = _ + Math.imul(rt, Zt) | 0, y = y + Math.imul(rt, Yt) | 0;
          var wi = (E + S | 0) + ((_ & 8191) << 13) | 0;
          E = (y + (_ >>> 13) | 0) + (wi >>> 26) | 0, wi &= 67108863, S = Math.imul(ie, wt), _ = Math.imul(ie, Et), _ = _ + Math.imul(ue, wt) | 0, y = Math.imul(ue, Et), S = S + Math.imul(J, yt) | 0, _ = _ + Math.imul(J, bt) | 0, _ = _ + Math.imul(L, yt) | 0, y = y + Math.imul(L, bt) | 0, S = S + Math.imul(xe, At) | 0, _ = _ + Math.imul(xe, St) | 0, _ = _ + Math.imul(Ie, At) | 0, y = y + Math.imul(Ie, St) | 0, S = S + Math.imul(qe, Zt) | 0, _ = _ + Math.imul(qe, Yt) | 0, _ = _ + Math.imul(He, Zt) | 0, y = y + Math.imul(He, Yt) | 0;
          var hn = (E + S | 0) + ((_ & 8191) << 13) | 0;
          E = (y + (_ >>> 13) | 0) + (hn >>> 26) | 0, hn &= 67108863, S = Math.imul(ie, yt), _ = Math.imul(ie, bt), _ = _ + Math.imul(ue, yt) | 0, y = Math.imul(ue, bt), S = S + Math.imul(J, At) | 0, _ = _ + Math.imul(J, St) | 0, _ = _ + Math.imul(L, At) | 0, y = y + Math.imul(L, St) | 0, S = S + Math.imul(xe, Zt) | 0, _ = _ + Math.imul(xe, Yt) | 0, _ = _ + Math.imul(Ie, Zt) | 0, y = y + Math.imul(Ie, Yt) | 0;
          var Vs = (E + S | 0) + ((_ & 8191) << 13) | 0;
          E = (y + (_ >>> 13) | 0) + (Vs >>> 26) | 0, Vs &= 67108863, S = Math.imul(ie, At), _ = Math.imul(ie, St), _ = _ + Math.imul(ue, At) | 0, y = Math.imul(ue, St), S = S + Math.imul(J, Zt) | 0, _ = _ + Math.imul(J, Yt) | 0, _ = _ + Math.imul(L, Zt) | 0, y = y + Math.imul(L, Yt) | 0;
          var Ks = (E + S | 0) + ((_ & 8191) << 13) | 0;
          E = (y + (_ >>> 13) | 0) + (Ks >>> 26) | 0, Ks &= 67108863, S = Math.imul(ie, Zt), _ = Math.imul(ie, Yt), _ = _ + Math.imul(ue, Zt) | 0, y = Math.imul(ue, Yt);
          var Gs = (E + S | 0) + ((_ & 8191) << 13) | 0;
          return E = (y + (_ >>> 13) | 0) + (Gs >>> 26) | 0, Gs &= 67108863, x[0] = Pt, x[1] = br, x[2] = Nn, x[3] = Mn, x[4] = Pn, x[5] = $n, x[6] = tn, x[7] = Qn, x[8] = Ii, x[9] = Jn, x[10] = Ti, x[11] = ki, x[12] = Xn, x[13] = mi, x[14] = wi, x[15] = hn, x[16] = Vs, x[17] = Ks, x[18] = Gs, E !== 0 && (x[19] = E, u.length++), u
        };
        Math.imul || (M = C);

        function N(U, I, g) {
          g.negative = I.negative ^ U.negative, g.length = U.length + I.length;
          for (var u = 0, p = 0, v = 0; v < g.length - 1; v++) {
            var x = p;
            p = 0;
            for (var E = u & 67108863, S = Math.min(v, I.length - 1), _ = Math.max(0, v - U.length + 1); _ <= S; _++) {
              var y = v - _,
                A = U.words[y] | 0,
                G = I.words[_] | 0,
                ce = A * G,
                W = ce & 67108863;
              x = x + (ce / 67108864 | 0) | 0, W = W + E | 0, E = W & 67108863, x = x + (W >>> 26) | 0, p += x >>> 26, x &= 67108863
            }
            g.words[v] = E, u = x, x = p
          }
          return u !== 0 ? g.words[v] = u : g.length--, g.strip()
        }

        function $(U, I, g) {
          var u = new k;
          return u.mulp(U, I, g)
        }
        s.prototype.mulTo = function (I, g) {
          var u, p = this.length + I.length;
          return this.length === 10 && I.length === 10 ? u = M(this, I, g) : p < 63 ? u = C(this, I, g) : p < 1024 ? u = N(this, I, g) : u = $(this, I, g), u
        };

        function k(U, I) {
          this.x = U, this.y = I
        }
        k.prototype.makeRBT = function (I) {
          for (var g = new Array(I), u = s.prototype._countBits(I) - 1, p = 0; p < I; p++) g[p] = this.revBin(p, u, I);
          return g
        }, k.prototype.revBin = function (I, g, u) {
          if (I === 0 || I === u - 1) return I;
          for (var p = 0, v = 0; v < g; v++) p |= (I & 1) << g - v - 1, I >>= 1;
          return p
        }, k.prototype.permute = function (I, g, u, p, v, x) {
          for (var E = 0; E < x; E++) p[E] = g[I[E]], v[E] = u[I[E]]
        }, k.prototype.transform = function (I, g, u, p, v, x) {
          this.permute(x, I, g, u, p, v);
          for (var E = 1; E < v; E <<= 1)
            for (var S = E << 1, _ = Math.cos(2 * Math.PI / S), y = Math.sin(2 * Math.PI / S), A = 0; A < v; A += S)
              for (var G = _, ce = y, W = 0; W < E; W++) {
                var X = u[A + W],
                  Z = p[A + W],
                  ee = u[A + W + E],
                  ne = p[A + W + E],
                  O = G * ee - ce * ne;
                ne = G * ne + ce * ee, ee = O, u[A + W] = X + ee, p[A + W] = Z + ne, u[A + W + E] = X - ee, p[A + W + E] = Z - ne, W !== S && (O = _ * G - y * ce, ce = _ * ce + y * G, G = O)
              }
        }, k.prototype.guessLen13b = function (I, g) {
          var u = Math.max(g, I) | 1,
            p = u & 1,
            v = 0;
          for (u = u / 2 | 0; u; u = u >>> 1) v++;
          return 1 << v + 1 + p
        }, k.prototype.conjugate = function (I, g, u) {
          if (!(u <= 1))
            for (var p = 0; p < u / 2; p++) {
              var v = I[p];
              I[p] = I[u - p - 1], I[u - p - 1] = v, v = g[p], g[p] = -g[u - p - 1], g[u - p - 1] = -v
            }
        }, k.prototype.normalize13b = function (I, g) {
          for (var u = 0, p = 0; p < g / 2; p++) {
            var v = Math.round(I[2 * p + 1] / g) * 8192 + Math.round(I[2 * p] / g) + u;
            I[p] = v & 67108863, v < 67108864 ? u = 0 : u = v / 67108864 | 0
          }
          return I
        }, k.prototype.convert13b = function (I, g, u, p) {
          for (var v = 0, x = 0; x < g; x++) v = v + (I[x] | 0), u[2 * x] = v & 8191, v = v >>> 13, u[2 * x + 1] = v & 8191, v = v >>> 13;
          for (x = 2 * g; x < p; ++x) u[x] = 0;
          n(v === 0), n((v & -8192) === 0)
        }, k.prototype.stub = function (I) {
          for (var g = new Array(I), u = 0; u < I; u++) g[u] = 0;
          return g
        }, k.prototype.mulp = function (I, g, u) {
          var p = 2 * this.guessLen13b(I.length, g.length),
            v = this.makeRBT(p),
            x = this.stub(p),
            E = new Array(p),
            S = new Array(p),
            _ = new Array(p),
            y = new Array(p),
            A = new Array(p),
            G = new Array(p),
            ce = u.words;
          ce.length = p, this.convert13b(I.words, I.length, E, p), this.convert13b(g.words, g.length, y, p), this.transform(E, x, S, _, p, v), this.transform(y, x, A, G, p, v);
          for (var W = 0; W < p; W++) {
            var X = S[W] * A[W] - _[W] * G[W];
            _[W] = S[W] * G[W] + _[W] * A[W], S[W] = X
          }
          return this.conjugate(S, _, p), this.transform(S, _, ce, x, p, v), this.conjugate(ce, x, p), this.normalize13b(ce, p), u.negative = I.negative ^ g.negative, u.length = I.length + g.length, u.strip()
        }, s.prototype.mul = function (I) {
          var g = new s(null);
          return g.words = new Array(this.length + I.length), this.mulTo(I, g)
        }, s.prototype.mulf = function (I) {
          var g = new s(null);
          return g.words = new Array(this.length + I.length), $(this, I, g)
        }, s.prototype.imul = function (I) {
          return this.clone().mulTo(I, this)
        }, s.prototype.imuln = function (I) {
          n(typeof I == "number"), n(I < 67108864);
          for (var g = 0, u = 0; u < this.length; u++) {
            var p = (this.words[u] | 0) * I,
              v = (p & 67108863) + (g & 67108863);
            g >>= 26, g += p / 67108864 | 0, g += v >>> 26, this.words[u] = v & 67108863
          }
          return g !== 0 && (this.words[u] = g, this.length++), this
        }, s.prototype.muln = function (I) {
          return this.clone().imuln(I)
        }, s.prototype.sqr = function () {
          return this.mul(this)
        }, s.prototype.isqr = function () {
          return this.imul(this.clone())
        }, s.prototype.pow = function (I) {
          var g = b(I);
          if (g.length === 0) return new s(1);
          for (var u = this, p = 0; p < g.length && g[p] === 0; p++, u = u.sqr());
          if (++p < g.length)
            for (var v = u.sqr(); p < g.length; p++, v = v.sqr()) g[p] !== 0 && (u = u.mul(v));
          return u
        }, s.prototype.iushln = function (I) {
          n(typeof I == "number" && I >= 0);
          var g = I % 26,
            u = (I - g) / 26,
            p = 67108863 >>> 26 - g << 26 - g,
            v;
          if (g !== 0) {
            var x = 0;
            for (v = 0; v < this.length; v++) {
              var E = this.words[v] & p,
                S = (this.words[v] | 0) - E << g;
              this.words[v] = S | x, x = E >>> 26 - g
            }
            x && (this.words[v] = x, this.length++)
          }
          if (u !== 0) {
            for (v = this.length - 1; v >= 0; v--) this.words[v + u] = this.words[v];
            for (v = 0; v < u; v++) this.words[v] = 0;
            this.length += u
          }
          return this.strip()
        }, s.prototype.ishln = function (I) {
          return n(this.negative === 0), this.iushln(I)
        }, s.prototype.iushrn = function (I, g, u) {
          n(typeof I == "number" && I >= 0);
          var p;
          g ? p = (g - g % 26) / 26 : p = 0;
          var v = I % 26,
            x = Math.min((I - v) / 26, this.length),
            E = 67108863 ^ 67108863 >>> v << v,
            S = u;
          if (p -= x, p = Math.max(0, p), S) {
            for (var _ = 0; _ < x; _++) S.words[_] = this.words[_];
            S.length = x
          }
          if (x !== 0)
            if (this.length > x)
              for (this.length -= x, _ = 0; _ < this.length; _++) this.words[_] = this.words[_ + x];
            else this.words[0] = 0, this.length = 1;
          var y = 0;
          for (_ = this.length - 1; _ >= 0 && (y !== 0 || _ >= p); _--) {
            var A = this.words[_] | 0;
            this.words[_] = y << 26 - v | A >>> v, y = A & E
          }
          return S && y !== 0 && (S.words[S.length++] = y), this.length === 0 && (this.words[0] = 0, this.length = 1), this.strip()
        }, s.prototype.ishrn = function (I, g, u) {
          return n(this.negative === 0), this.iushrn(I, g, u)
        }, s.prototype.shln = function (I) {
          return this.clone().ishln(I)
        }, s.prototype.ushln = function (I) {
          return this.clone().iushln(I)
        }, s.prototype.shrn = function (I) {
          return this.clone().ishrn(I)
        }, s.prototype.ushrn = function (I) {
          return this.clone().iushrn(I)
        }, s.prototype.testn = function (I) {
          n(typeof I == "number" && I >= 0);
          var g = I % 26,
            u = (I - g) / 26,
            p = 1 << g;
          if (this.length <= u) return !1;
          var v = this.words[u];
          return !!(v & p)
        }, s.prototype.imaskn = function (I) {
          n(typeof I == "number" && I >= 0);
          var g = I % 26,
            u = (I - g) / 26;
          if (n(this.negative === 0, "imaskn works only with positive numbers"), this.length <= u) return this;
          if (g !== 0 && u++, this.length = Math.min(u, this.length), g !== 0) {
            var p = 67108863 ^ 67108863 >>> g << g;
            this.words[this.length - 1] &= p
          }
          return this.strip()
        }, s.prototype.maskn = function (I) {
          return this.clone().imaskn(I)
        }, s.prototype.iaddn = function (I) {
          return n(typeof I == "number"), n(I < 67108864), I < 0 ? this.isubn(-I) : this.negative !== 0 ? this.length === 1 && (this.words[0] | 0) < I ? (this.words[0] = I - (this.words[0] | 0), this.negative = 0, this) : (this.negative = 0, this.isubn(I), this.negative = 1, this) : this._iaddn(I)
        }, s.prototype._iaddn = function (I) {
          this.words[0] += I;
          for (var g = 0; g < this.length && this.words[g] >= 67108864; g++) this.words[g] -= 67108864, g === this.length - 1 ? this.words[g + 1] = 1 : this.words[g + 1]++;
          return this.length = Math.max(this.length, g + 1), this
        }, s.prototype.isubn = function (I) {
          if (n(typeof I == "number"), n(I < 67108864), I < 0) return this.iaddn(-I);
          if (this.negative !== 0) return this.negative = 0, this.iaddn(I), this.negative = 1, this;
          if (this.words[0] -= I, this.length === 1 && this.words[0] < 0) this.words[0] = -this.words[0], this.negative = 1;
          else
            for (var g = 0; g < this.length && this.words[g] < 0; g++) this.words[g] += 67108864, this.words[g + 1] -= 1;
          return this.strip()
        }, s.prototype.addn = function (I) {
          return this.clone().iaddn(I)
        }, s.prototype.subn = function (I) {
          return this.clone().isubn(I)
        }, s.prototype.iabs = function () {
          return this.negative = 0, this
        }, s.prototype.abs = function () {
          return this.clone().iabs()
        }, s.prototype._ishlnsubmul = function (I, g, u) {
          var p = I.length + u,
            v;
          this._expand(p);
          var x, E = 0;
          for (v = 0; v < I.length; v++) {
            x = (this.words[v + u] | 0) + E;
            var S = (I.words[v] | 0) * g;
            x -= S & 67108863, E = (x >> 26) - (S / 67108864 | 0), this.words[v + u] = x & 67108863
          }
          for (; v < this.length - u; v++) x = (this.words[v + u] | 0) + E, E = x >> 26, this.words[v + u] = x & 67108863;
          if (E === 0) return this.strip();
          for (n(E === -1), E = 0, v = 0; v < this.length; v++) x = -(this.words[v] | 0) + E, E = x >> 26, this.words[v] = x & 67108863;
          return this.negative = 1, this.strip()
        }, s.prototype._wordDiv = function (I, g) {
          var u = this.length - I.length,
            p = this.clone(),
            v = I,
            x = v.words[v.length - 1] | 0,
            E = this._countBits(x);
          u = 26 - E, u !== 0 && (v = v.ushln(u), p.iushln(u), x = v.words[v.length - 1] | 0);
          var S = p.length - v.length,
            _;
          if (g !== "mod") {
            _ = new s(null), _.length = S + 1, _.words = new Array(_.length);
            for (var y = 0; y < _.length; y++) _.words[y] = 0
          }
          var A = p.clone()._ishlnsubmul(v, 1, S);
          A.negative === 0 && (p = A, _ && (_.words[S] = 1));
          for (var G = S - 1; G >= 0; G--) {
            var ce = (p.words[v.length + G] | 0) * 67108864 + (p.words[v.length + G - 1] | 0);
            for (ce = Math.min(ce / x | 0, 67108863), p._ishlnsubmul(v, ce, G); p.negative !== 0;) ce--, p.negative = 0, p._ishlnsubmul(v, 1, G), p.isZero() || (p.negative ^= 1);
            _ && (_.words[G] = ce)
          }
          return _ && _.strip(), p.strip(), g !== "div" && u !== 0 && p.iushrn(u), {
            div: _ || null,
            mod: p
          }
        }, s.prototype.divmod = function (I, g, u) {
          if (n(!I.isZero()), this.isZero()) return {
            div: new s(0),
            mod: new s(0)
          };
          var p, v, x;
          return this.negative !== 0 && I.negative === 0 ? (x = this.neg().divmod(I, g), g !== "mod" && (p = x.div.neg()), g !== "div" && (v = x.mod.neg(), u && v.negative !== 0 && v.iadd(I)), {
            div: p,
            mod: v
          }) : this.negative === 0 && I.negative !== 0 ? (x = this.divmod(I.neg(), g), g !== "mod" && (p = x.div.neg()), {
            div: p,
            mod: x.mod
          }) : this.negative & I.negative ? (x = this.neg().divmod(I.neg(), g), g !== "div" && (v = x.mod.neg(), u && v.negative !== 0 && v.isub(I)), {
            div: x.div,
            mod: v
          }) : I.length > this.length || this.cmp(I) < 0 ? {
            div: new s(0),
            mod: this
          } : I.length === 1 ? g === "div" ? {
            div: this.divn(I.words[0]),
            mod: null
          } : g === "mod" ? {
            div: null,
            mod: new s(this.modn(I.words[0]))
          } : {
            div: this.divn(I.words[0]),
            mod: new s(this.modn(I.words[0]))
          } : this._wordDiv(I, g)
        }, s.prototype.div = function (I) {
          return this.divmod(I, "div", !1).div
        }, s.prototype.mod = function (I) {
          return this.divmod(I, "mod", !1).mod
        }, s.prototype.umod = function (I) {
          return this.divmod(I, "mod", !0).mod
        }, s.prototype.divRound = function (I) {
          var g = this.divmod(I);
          if (g.mod.isZero()) return g.div;
          var u = g.div.negative !== 0 ? g.mod.isub(I) : g.mod,
            p = I.ushrn(1),
            v = I.andln(1),
            x = u.cmp(p);
          return x < 0 || v === 1 && x === 0 ? g.div : g.div.negative !== 0 ? g.div.isubn(1) : g.div.iaddn(1)
        }, s.prototype.modn = function (I) {
          n(I <= 67108863);
          for (var g = (1 << 26) % I, u = 0, p = this.length - 1; p >= 0; p--) u = (g * u + (this.words[p] | 0)) % I;
          return u
        }, s.prototype.idivn = function (I) {
          n(I <= 67108863);
          for (var g = 0, u = this.length - 1; u >= 0; u--) {
            var p = (this.words[u] | 0) + g * 67108864;
            this.words[u] = p / I | 0, g = p % I
          }
          return this.strip()
        }, s.prototype.divn = function (I) {
          return this.clone().idivn(I)
        }, s.prototype.egcd = function (I) {
          n(I.negative === 0), n(!I.isZero());
          var g = this,
            u = I.clone();
          g.negative !== 0 ? g = g.umod(I) : g = g.clone();
          for (var p = new s(1), v = new s(0), x = new s(0), E = new s(1), S = 0; g.isEven() && u.isEven();) g.iushrn(1), u.iushrn(1), ++S;
          for (var _ = u.clone(), y = g.clone(); !g.isZero();) {
            for (var A = 0, G = 1; !(g.words[0] & G) && A < 26; ++A, G <<= 1);
            if (A > 0)
              for (g.iushrn(A); A-- > 0;)(p.isOdd() || v.isOdd()) && (p.iadd(_), v.isub(y)), p.iushrn(1), v.iushrn(1);
            for (var ce = 0, W = 1; !(u.words[0] & W) && ce < 26; ++ce, W <<= 1);
            if (ce > 0)
              for (u.iushrn(ce); ce-- > 0;)(x.isOdd() || E.isOdd()) && (x.iadd(_), E.isub(y)), x.iushrn(1), E.iushrn(1);
            g.cmp(u) >= 0 ? (g.isub(u), p.isub(x), v.isub(E)) : (u.isub(g), x.isub(p), E.isub(v))
          }
          return {
            a: x,
            b: E,
            gcd: u.iushln(S)
          }
        }, s.prototype._invmp = function (I) {
          n(I.negative === 0), n(!I.isZero());
          var g = this,
            u = I.clone();
          g.negative !== 0 ? g = g.umod(I) : g = g.clone();
          for (var p = new s(1), v = new s(0), x = u.clone(); g.cmpn(1) > 0 && u.cmpn(1) > 0;) {
            for (var E = 0, S = 1; !(g.words[0] & S) && E < 26; ++E, S <<= 1);
            if (E > 0)
              for (g.iushrn(E); E-- > 0;) p.isOdd() && p.iadd(x), p.iushrn(1);
            for (var _ = 0, y = 1; !(u.words[0] & y) && _ < 26; ++_, y <<= 1);
            if (_ > 0)
              for (u.iushrn(_); _-- > 0;) v.isOdd() && v.iadd(x), v.iushrn(1);
            g.cmp(u) >= 0 ? (g.isub(u), p.isub(v)) : (u.isub(g), v.isub(p))
          }
          var A;
          return g.cmpn(1) === 0 ? A = p : A = v, A.cmpn(0) < 0 && A.iadd(I), A
        }, s.prototype.gcd = function (I) {
          if (this.isZero()) return I.abs();
          if (I.isZero()) return this.abs();
          var g = this.clone(),
            u = I.clone();
          g.negative = 0, u.negative = 0;
          for (var p = 0; g.isEven() && u.isEven(); p++) g.iushrn(1), u.iushrn(1);
          do {
            for (; g.isEven();) g.iushrn(1);
            for (; u.isEven();) u.iushrn(1);
            var v = g.cmp(u);
            if (v < 0) {
              var x = g;
              g = u, u = x
            } else if (v === 0 || u.cmpn(1) === 0) break;
            g.isub(u)
          } while (!0);
          return u.iushln(p)
        }, s.prototype.invm = function (I) {
          return this.egcd(I).a.umod(I)
        }, s.prototype.isEven = function () {
          return (this.words[0] & 1) === 0
        }, s.prototype.isOdd = function () {
          return (this.words[0] & 1) === 1
        }, s.prototype.andln = function (I) {
          return this.words[0] & I
        }, s.prototype.bincn = function (I) {
          n(typeof I == "number");
          var g = I % 26,
            u = (I - g) / 26,
            p = 1 << g;
          if (this.length <= u) return this._expand(u + 1), this.words[u] |= p, this;
          for (var v = p, x = u; v !== 0 && x < this.length; x++) {
            var E = this.words[x] | 0;
            E += v, v = E >>> 26, E &= 67108863, this.words[x] = E
          }
          return v !== 0 && (this.words[x] = v, this.length++), this
        }, s.prototype.isZero = function () {
          return this.length === 1 && this.words[0] === 0
        }, s.prototype.cmpn = function (I) {
          var g = I < 0;
          if (this.negative !== 0 && !g) return -1;
          if (this.negative === 0 && g) return 1;
          this.strip();
          var u;
          if (this.length > 1) u = 1;
          else {
            g && (I = -I), n(I <= 67108863, "Number is too big");
            var p = this.words[0] | 0;
            u = p === I ? 0 : p < I ? -1 : 1
          }
          return this.negative !== 0 ? -u | 0 : u
        }, s.prototype.cmp = function (I) {
          if (this.negative !== 0 && I.negative === 0) return -1;
          if (this.negative === 0 && I.negative !== 0) return 1;
          var g = this.ucmp(I);
          return this.negative !== 0 ? -g | 0 : g
        }, s.prototype.ucmp = function (I) {
          if (this.length > I.length) return 1;
          if (this.length < I.length) return -1;
          for (var g = 0, u = this.length - 1; u >= 0; u--) {
            var p = this.words[u] | 0,
              v = I.words[u] | 0;
            if (p !== v) {
              p < v ? g = -1 : p > v && (g = 1);
              break
            }
          }
          return g
        }, s.prototype.gtn = function (I) {
          return this.cmpn(I) === 1
        }, s.prototype.gt = function (I) {
          return this.cmp(I) === 1
        }, s.prototype.gten = function (I) {
          return this.cmpn(I) >= 0
        }, s.prototype.gte = function (I) {
          return this.cmp(I) >= 0
        }, s.prototype.ltn = function (I) {
          return this.cmpn(I) === -1
        }, s.prototype.lt = function (I) {
          return this.cmp(I) === -1
        }, s.prototype.lten = function (I) {
          return this.cmpn(I) <= 0
        }, s.prototype.lte = function (I) {
          return this.cmp(I) <= 0
        }, s.prototype.eqn = function (I) {
          return this.cmpn(I) === 0
        }, s.prototype.eq = function (I) {
          return this.cmp(I) === 0
        }, s.red = function (I) {
          return new j(I)
        }, s.prototype.toRed = function (I) {
          return n(!this.red, "Already a number in reduction context"), n(this.negative === 0, "red works only with positives"), I.convertTo(this)._forceRed(I)
        }, s.prototype.fromRed = function () {
          return n(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this)
        }, s.prototype._forceRed = function (I) {
          return this.red = I, this
        }, s.prototype.forceRed = function (I) {
          return n(!this.red, "Already a number in reduction context"), this._forceRed(I)
        }, s.prototype.redAdd = function (I) {
          return n(this.red, "redAdd works only with red numbers"), this.red.add(this, I)
        }, s.prototype.redIAdd = function (I) {
          return n(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, I)
        }, s.prototype.redSub = function (I) {
          return n(this.red, "redSub works only with red numbers"), this.red.sub(this, I)
        }, s.prototype.redISub = function (I) {
          return n(this.red, "redISub works only with red numbers"), this.red.isub(this, I)
        }, s.prototype.redShl = function (I) {
          return n(this.red, "redShl works only with red numbers"), this.red.shl(this, I)
        }, s.prototype.redMul = function (I) {
          return n(this.red, "redMul works only with red numbers"), this.red._verify2(this, I), this.red.mul(this, I)
        }, s.prototype.redIMul = function (I) {
          return n(this.red, "redMul works only with red numbers"), this.red._verify2(this, I), this.red.imul(this, I)
        }, s.prototype.redSqr = function () {
          return n(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this)
        }, s.prototype.redISqr = function () {
          return n(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this)
        }, s.prototype.redSqrt = function () {
          return n(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this)
        }, s.prototype.redInvm = function () {
          return n(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this)
        }, s.prototype.redNeg = function () {
          return n(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this)
        }, s.prototype.redPow = function (I) {
          return n(this.red && !I.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, I)
        };
        var B = {
          k256: null,
          p224: null,
          p192: null,
          p25519: null
        };

        function F(U, I) {
          this.name = U, this.p = new s(I, 16), this.n = this.p.bitLength(), this.k = new s(1).iushln(this.n).isub(this.p), this.tmp = this._tmp()
        }
        F.prototype._tmp = function () {
          var I = new s(null);
          return I.words = new Array(Math.ceil(this.n / 13)), I
        }, F.prototype.ireduce = function (I) {
          var g = I,
            u;
          do this.split(g, this.tmp), g = this.imulK(g), g = g.iadd(this.tmp), u = g.bitLength(); while (u > this.n);
          var p = u < this.n ? -1 : g.ucmp(this.p);
          return p === 0 ? (g.words[0] = 0, g.length = 1) : p > 0 ? g.isub(this.p) : g.strip !== void 0 ? g.strip() : g._strip(), g
        }, F.prototype.split = function (I, g) {
          I.iushrn(this.n, 0, g)
        }, F.prototype.imulK = function (I) {
          return I.imul(this.k)
        };

        function D() {
          F.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")
        }
        i(D, F), D.prototype.split = function (I, g) {
          for (var u = 4194303, p = Math.min(I.length, 9), v = 0; v < p; v++) g.words[v] = I.words[v];
          if (g.length = p, I.length <= 9) {
            I.words[0] = 0, I.length = 1;
            return
          }
          var x = I.words[9];
          for (g.words[g.length++] = x & u, v = 10; v < I.length; v++) {
            var E = I.words[v] | 0;
            I.words[v - 10] = (E & u) << 4 | x >>> 22, x = E
          }
          x >>>= 22, I.words[v - 10] = x, x === 0 && I.length > 10 ? I.length -= 10 : I.length -= 9
        }, D.prototype.imulK = function (I) {
          I.words[I.length] = 0, I.words[I.length + 1] = 0, I.length += 2;
          for (var g = 0, u = 0; u < I.length; u++) {
            var p = I.words[u] | 0;
            g += p * 977, I.words[u] = g & 67108863, g = p * 64 + (g / 67108864 | 0)
          }
          return I.words[I.length - 1] === 0 && (I.length--, I.words[I.length - 1] === 0 && I.length--), I
        };

        function V() {
          F.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")
        }
        i(V, F);

        function R() {
          F.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")
        }
        i(R, F);

        function P() {
          F.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")
        }
        i(P, F), P.prototype.imulK = function (I) {
          for (var g = 0, u = 0; u < I.length; u++) {
            var p = (I.words[u] | 0) * 19 + g,
              v = p & 67108863;
            p >>>= 26, I.words[u] = v, g = p
          }
          return g !== 0 && (I.words[I.length++] = g), I
        }, s._prime = function (I) {
          if (B[I]) return B[I];
          var g;
          if (I === "k256") g = new D;
          else if (I === "p224") g = new V;
          else if (I === "p192") g = new R;
          else if (I === "p25519") g = new P;
          else throw new Error("Unknown prime " + I);
          return B[I] = g, g
        };

        function j(U) {
          if (typeof U == "string") {
            var I = s._prime(U);
            this.m = I.p, this.prime = I
          } else n(U.gtn(1), "modulus must be greater than 1"), this.m = U, this.prime = null
        }
        j.prototype._verify1 = function (I) {
          n(I.negative === 0, "red works only with positives"), n(I.red, "red works only with red numbers")
        }, j.prototype._verify2 = function (I, g) {
          n((I.negative | g.negative) === 0, "red works only with positives"), n(I.red && I.red === g.red, "red works only with red numbers")
        }, j.prototype.imod = function (I) {
          return this.prime ? this.prime.ireduce(I)._forceRed(this) : I.umod(this.m)._forceRed(this)
        }, j.prototype.neg = function (I) {
          return I.isZero() ? I.clone() : this.m.sub(I)._forceRed(this)
        }, j.prototype.add = function (I, g) {
          this._verify2(I, g);
          var u = I.add(g);
          return u.cmp(this.m) >= 0 && u.isub(this.m), u._forceRed(this)
        }, j.prototype.iadd = function (I, g) {
          this._verify2(I, g);
          var u = I.iadd(g);
          return u.cmp(this.m) >= 0 && u.isub(this.m), u
        }, j.prototype.sub = function (I, g) {
          this._verify2(I, g);
          var u = I.sub(g);
          return u.cmpn(0) < 0 && u.iadd(this.m), u._forceRed(this)
        }, j.prototype.isub = function (I, g) {
          this._verify2(I, g);
          var u = I.isub(g);
          return u.cmpn(0) < 0 && u.iadd(this.m), u
        }, j.prototype.shl = function (I, g) {
          return this._verify1(I), this.imod(I.ushln(g))
        }, j.prototype.imul = function (I, g) {
          return this._verify2(I, g), this.imod(I.imul(g))
        }, j.prototype.mul = function (I, g) {
          return this._verify2(I, g), this.imod(I.mul(g))
        }, j.prototype.isqr = function (I) {
          return this.imul(I, I.clone())
        }, j.prototype.sqr = function (I) {
          return this.mul(I, I)
        }, j.prototype.sqrt = function (I) {
          if (I.isZero()) return I.clone();
          var g = this.m.andln(3);
          if (n(g % 2 === 1), g === 3) {
            var u = this.m.add(new s(1)).iushrn(2);
            return this.pow(I, u)
          }
          for (var p = this.m.subn(1), v = 0; !p.isZero() && p.andln(1) === 0;) v++, p.iushrn(1);
          n(!p.isZero());
          var x = new s(1).toRed(this),
            E = x.redNeg(),
            S = this.m.subn(1).iushrn(1),
            _ = this.m.bitLength();
          for (_ = new s(2 * _ * _).toRed(this); this.pow(_, S).cmp(E) !== 0;) _.redIAdd(E);
          for (var y = this.pow(_, p), A = this.pow(I, p.addn(1).iushrn(1)), G = this.pow(I, p), ce = v; G.cmp(x) !== 0;) {
            for (var W = G, X = 0; W.cmp(x) !== 0; X++) W = W.redSqr();
            n(X < ce);
            var Z = this.pow(y, new s(1).iushln(ce - X - 1));
            A = A.redMul(Z), y = Z.redSqr(), G = G.redMul(y), ce = X
          }
          return A
        }, j.prototype.invm = function (I) {
          var g = I._invmp(this.m);
          return g.negative !== 0 ? (g.negative = 0, this.imod(g).redNeg()) : this.imod(g)
        }, j.prototype.pow = function (I, g) {
          if (g.isZero()) return new s(1).toRed(this);
          if (g.cmpn(1) === 0) return I.clone();
          var u = 4,
            p = new Array(1 << u);
          p[0] = new s(1).toRed(this), p[1] = I;
          for (var v = 2; v < p.length; v++) p[v] = this.mul(p[v - 1], I);
          var x = p[0],
            E = 0,
            S = 0,
            _ = g.bitLength() % 26;
          for (_ === 0 && (_ = 26), v = g.length - 1; v >= 0; v--) {
            for (var y = g.words[v], A = _ - 1; A >= 0; A--) {
              var G = y >> A & 1;
              if (x !== p[0] && (x = this.sqr(x)), G === 0 && E === 0) {
                S = 0;
                continue
              }
              E <<= 1, E |= G, S++, !(S !== u && (v !== 0 || A !== 0)) && (x = this.mul(x, p[E]), S = 0, E = 0)
            }
            _ = 26
          }
          return x
        }, j.prototype.convertTo = function (I) {
          var g = I.umod(this.m);
          return g === I ? g.clone() : g
        }, j.prototype.convertFrom = function (I) {
          var g = I.clone();
          return g.red = null, g
        }, s.mont = function (I) {
          return new Y(I)
        };

        function Y(U) {
          j.call(this, U), this.shift = this.m.bitLength(), this.shift % 26 !== 0 && (this.shift += 26 - this.shift % 26), this.r = new s(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)
        }
        i(Y, j), Y.prototype.convertTo = function (I) {
          return this.imod(I.ushln(this.shift))
        }, Y.prototype.convertFrom = function (I) {
          var g = this.imod(I.mul(this.rinv));
          return g.red = null, g
        }, Y.prototype.imul = function (I, g) {
          if (I.isZero() || g.isZero()) return I.words[0] = 0, I.length = 1, I;
          var u = I.imul(g),
            p = u.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),
            v = u.isub(p).iushrn(this.shift),
            x = v;
          return v.cmp(this.m) >= 0 ? x = v.isub(this.m) : v.cmpn(0) < 0 && (x = v.iadd(this.m)), x._forceRed(this)
        }, Y.prototype.mul = function (I, g) {
          if (I.isZero() || g.isZero()) return new s(0)._forceRed(this);
          var u = I.mul(g),
            p = u.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),
            v = u.isub(p).iushrn(this.shift),
            x = v;
          return v.cmp(this.m) >= 0 ? x = v.isub(this.m) : v.cmpn(0) < 0 && (x = v.iadd(this.m)), x._forceRed(this)
        }, Y.prototype.invm = function (I) {
          var g = this.imod(I._invmp(this.m).mul(this.r2));
          return g._forceRed(this)
        }
      })(t, ot)
    }(wC);
  var Wu = wC.exports,
    p0 = TO;

  function TO(t, e) {
    if (!t) throw new Error(e || "Assertion failed")
  }
  TO.equal = function (e, r, n) {
    if (e != r) throw new Error(n || "Assertion failed: " + e + " != " + r)
  };
  var vC = {};
  (function (t) {
    var e = t;

    function r(s, o) {
      if (Array.isArray(s)) return s.slice();
      if (!s) return [];
      var a = [];
      if (typeof s != "string") {
        for (var c = 0; c < s.length; c++) a[c] = s[c] | 0;
        return a
      }
      if (o === "hex") {
        s = s.replace(/[^a-z0-9]+/ig, ""), s.length % 2 !== 0 && (s = "0" + s);
        for (var c = 0; c < s.length; c += 2) a.push(parseInt(s[c] + s[c + 1], 16))
      } else
        for (var c = 0; c < s.length; c++) {
          var l = s.charCodeAt(c),
            h = l >> 8,
            f = l & 255;
          h ? a.push(h, f) : a.push(f)
        }
      return a
    }
    e.toArray = r;

    function n(s) {
      return s.length === 1 ? "0" + s : s
    }
    e.zero2 = n;

    function i(s) {
      for (var o = "", a = 0; a < s.length; a++) o += n(s[a].toString(16));
      return o
    }
    e.toHex = i, e.encode = function (o, a) {
      return a === "hex" ? i(o) : o
    }
  })(vC),
  function (t) {
    var e = t,
      r = Wu,
      n = p0,
      i = vC;
    e.assert = n, e.toArray = i.toArray, e.zero2 = i.zero2, e.toHex = i.toHex, e.encode = i.encode;

    function s(h, f, w) {
      var b = new Array(Math.max(h.bitLength(), w) + 1),
        C;
      for (C = 0; C < b.length; C += 1) b[C] = 0;
      var M = 1 << f + 1,
        N = h.clone();
      for (C = 0; C < b.length; C++) {
        var $, k = N.andln(M - 1);
        N.isOdd() ? (k > (M >> 1) - 1 ? $ = (M >> 1) - k : $ = k, N.isubn($)) : $ = 0, b[C] = $, N.iushrn(1)
      }
      return b
    }
    e.getNAF = s;

    function o(h, f) {
      var w = [
        [],
        []
      ];
      h = h.clone(), f = f.clone();
      for (var b = 0, C = 0, M; h.cmpn(-b) > 0 || f.cmpn(-C) > 0;) {
        var N = h.andln(3) + b & 3,
          $ = f.andln(3) + C & 3;
        N === 3 && (N = -1), $ === 3 && ($ = -1);
        var k;
        N & 1 ? (M = h.andln(7) + b & 7, (M === 3 || M === 5) && $ === 2 ? k = -N : k = N) : k = 0, w[0].push(k);
        var B;
        $ & 1 ? (M = f.andln(7) + C & 7, (M === 3 || M === 5) && N === 2 ? B = -$ : B = $) : B = 0, w[1].push(B), 2 * b === k + 1 && (b = 1 - b), 2 * C === B + 1 && (C = 1 - C), h.iushrn(1), f.iushrn(1)
      }
      return w
    }
    e.getJSF = o;

    function a(h, f, w) {
      var b = "_" + f;
      h.prototype[f] = function () {
        return this[b] !== void 0 ? this[b] : this[b] = w.call(this)
      }
    }
    e.cachedProperty = a;

    function c(h) {
      return typeof h == "string" ? e.toArray(h, "hex") : h
    }
    e.parseBytes = c;

    function l(h) {
      return new r(h, "hex", "le")
    }
    e.intFromLE = l
  }(Uo);
  var bC = {
      exports: {}
    },
    yC;
  bC.exports = function (e) {
    return yC || (yC = new yh(null)), yC.generate(e)
  };

  function yh(t) {
    this.rand = t
  }
  if (bC.exports.Rand = yh, yh.prototype.generate = function (e) {
      return this._rand(e)
    }, yh.prototype._rand = function (e) {
      if (this.rand.getBytes) return this.rand.getBytes(e);
      for (var r = new Uint8Array(e), n = 0; n < r.length; n++) r[n] = this.rand.getByte();
      return r
    }, typeof self == "object") self.crypto && self.crypto.getRandomValues ? yh.prototype._rand = function (e) {
    var r = new Uint8Array(e);
    return self.crypto.getRandomValues(r), r
  } : self.msCrypto && self.msCrypto.getRandomValues ? yh.prototype._rand = function (e) {
    var r = new Uint8Array(e);
    return self.msCrypto.getRandomValues(r), r
  } : typeof window == "object" && (yh.prototype._rand = function () {
    throw new Error("Not implemented yet")
  });
  else try {
    var kO = eg;
    if (typeof kO.randomBytes != "function") throw new Error("Not supported");
    yh.prototype._rand = function (e) {
      return kO.randomBytes(e)
    }
  } catch {}
  var RO = bC.exports,
    _C = {},
    g0 = Wu,
    G2 = Uo,
    B5 = G2.getNAF,
    ope = G2.getJSF,
    U5 = G2.assert;

  function _h(t, e) {
    this.type = t, this.p = new g0(e.p, 16), this.red = e.prime ? g0.red(e.prime) : g0.mont(this.p), this.zero = new g0(0).toRed(this.red), this.one = new g0(1).toRed(this.red), this.two = new g0(2).toRed(this.red), this.n = e.n && new g0(e.n, 16), this.g = e.g && this.pointFromJSON(e.g, e.gRed), this._wnafT1 = new Array(4), this._wnafT2 = new Array(4), this._wnafT3 = new Array(4), this._wnafT4 = new Array(4), this._bitLength = this.n ? this.n.bitLength() : 0;
    var r = this.n && this.p.div(this.n);
    !r || r.cmpn(100) > 0 ? this.redN = null : (this._maxwellTrick = !0, this.redN = this.n.toRed(this.red))
  }
  var j5 = _h;
  _h.prototype.point = function () {
    throw new Error("Not implemented")
  }, _h.prototype.validate = function () {
    throw new Error("Not implemented")
  }, _h.prototype._fixedNafMul = function (e, r) {
    U5(e.precomputed);
    var n = e._getDoubles(),
      i = B5(r, 1, this._bitLength),
      s = (1 << n.step + 1) - (n.step % 2 === 0 ? 2 : 1);
    s /= 3;
    var o = [],
      a, c;
    for (a = 0; a < i.length; a += n.step) {
      c = 0;
      for (var l = a + n.step - 1; l >= a; l--) c = (c << 1) + i[l];
      o.push(c)
    }
    for (var h = this.jpoint(null, null, null), f = this.jpoint(null, null, null), w = s; w > 0; w--) {
      for (a = 0; a < o.length; a++) c = o[a], c === w ? f = f.mixedAdd(n.points[a]) : c === -w && (f = f.mixedAdd(n.points[a].neg()));
      h = h.add(f)
    }
    return h.toP()
  }, _h.prototype._wnafMul = function (e, r) {
    var n = 4,
      i = e._getNAFPoints(n);
    n = i.wnd;
    for (var s = i.points, o = B5(r, n, this._bitLength), a = this.jpoint(null, null, null), c = o.length - 1; c >= 0; c--) {
      for (var l = 0; c >= 0 && o[c] === 0; c--) l++;
      if (c >= 0 && l++, a = a.dblp(l), c < 0) break;
      var h = o[c];
      U5(h !== 0), e.type === "affine" ? h > 0 ? a = a.mixedAdd(s[h - 1 >> 1]) : a = a.mixedAdd(s[-h - 1 >> 1].neg()) : h > 0 ? a = a.add(s[h - 1 >> 1]) : a = a.add(s[-h - 1 >> 1].neg())
    }
    return e.type === "affine" ? a.toP() : a
  }, _h.prototype._wnafMulAdd = function (e, r, n, i, s) {
    var o = this._wnafT1,
      a = this._wnafT2,
      c = this._wnafT3,
      l = 0,
      h, f, w;
    for (h = 0; h < i; h++) {
      w = r[h];
      var b = w._getNAFPoints(e);
      o[h] = b.wnd, a[h] = b.points
    }
    for (h = i - 1; h >= 1; h -= 2) {
      var C = h - 1,
        M = h;
      if (o[C] !== 1 || o[M] !== 1) {
        c[C] = B5(n[C], o[C], this._bitLength), c[M] = B5(n[M], o[M], this._bitLength), l = Math.max(c[C].length, l), l = Math.max(c[M].length, l);
        continue
      }
      var N = [r[C], null, null, r[M]];
      r[C].y.cmp(r[M].y) === 0 ? (N[1] = r[C].add(r[M]), N[2] = r[C].toJ().mixedAdd(r[M].neg())) : r[C].y.cmp(r[M].y.redNeg()) === 0 ? (N[1] = r[C].toJ().mixedAdd(r[M]), N[2] = r[C].add(r[M].neg())) : (N[1] = r[C].toJ().mixedAdd(r[M]), N[2] = r[C].toJ().mixedAdd(r[M].neg()));
      var $ = [-3, -1, -5, -7, 0, 7, 5, 1, 3],
        k = ope(n[C], n[M]);
      for (l = Math.max(k[0].length, l), c[C] = new Array(l), c[M] = new Array(l), f = 0; f < l; f++) {
        var B = k[0][f] | 0,
          F = k[1][f] | 0;
        c[C][f] = $[(B + 1) * 3 + (F + 1)], c[M][f] = 0, a[C] = N
      }
    }
    var D = this.jpoint(null, null, null),
      V = this._wnafT4;
    for (h = l; h >= 0; h--) {
      for (var R = 0; h >= 0;) {
        var P = !0;
        for (f = 0; f < i; f++) V[f] = c[f][h] | 0, V[f] !== 0 && (P = !1);
        if (!P) break;
        R++, h--
      }
      if (h >= 0 && R++, D = D.dblp(R), h < 0) break;
      for (f = 0; f < i; f++) {
        var j = V[f];
        j !== 0 && (j > 0 ? w = a[f][j - 1 >> 1] : j < 0 && (w = a[f][-j - 1 >> 1].neg()), w.type === "affine" ? D = D.mixedAdd(w) : D = D.add(w))
      }
    }
    for (h = 0; h < i; h++) a[h] = null;
    return s ? D : D.toP()
  };

  function va(t, e) {
    this.curve = t, this.type = e, this.precomputed = null
  }
  _h.BasePoint = va, va.prototype.eq = function () {
    throw new Error("Not implemented")
  }, va.prototype.validate = function () {
    return this.curve.validate(this)
  }, _h.prototype.decodePoint = function (e, r) {
    e = G2.toArray(e, r);
    var n = this.p.byteLength();
    if ((e[0] === 4 || e[0] === 6 || e[0] === 7) && e.length - 1 === 2 * n) {
      e[0] === 6 ? U5(e[e.length - 1] % 2 === 0) : e[0] === 7 && U5(e[e.length - 1] % 2 === 1);
      var i = this.point(e.slice(1, 1 + n), e.slice(1 + n, 1 + 2 * n));
      return i
    } else if ((e[0] === 2 || e[0] === 3) && e.length - 1 === n) return this.pointFromX(e.slice(1, 1 + n), e[0] === 3);
    throw new Error("Unknown point format")
  }, va.prototype.encodeCompressed = function (e) {
    return this.encode(e, !0)
  }, va.prototype._encode = function (e) {
    var r = this.curve.p.byteLength(),
      n = this.getX().toArray("be", r);
    return e ? [this.getY().isEven() ? 2 : 3].concat(n) : [4].concat(n, this.getY().toArray("be", r))
  }, va.prototype.encode = function (e, r) {
    return G2.encode(this._encode(r), e)
  }, va.prototype.precompute = function (e) {
    if (this.precomputed) return this;
    var r = {
      doubles: null,
      naf: null,
      beta: null
    };
    return r.naf = this._getNAFPoints(8), r.doubles = this._getDoubles(4, e), r.beta = this._getBeta(), this.precomputed = r, this
  }, va.prototype._hasDoubles = function (e) {
    if (!this.precomputed) return !1;
    var r = this.precomputed.doubles;
    return r ? r.points.length >= Math.ceil((e.bitLength() + 1) / r.step) : !1
  }, va.prototype._getDoubles = function (e, r) {
    if (this.precomputed && this.precomputed.doubles) return this.precomputed.doubles;
    for (var n = [this], i = this, s = 0; s < r; s += e) {
      for (var o = 0; o < e; o++) i = i.dbl();
      n.push(i)
    }
    return {
      step: e,
      points: n
    }
  }, va.prototype._getNAFPoints = function (e) {
    if (this.precomputed && this.precomputed.naf) return this.precomputed.naf;
    for (var r = [this], n = (1 << e) - 1, i = n === 1 ? null : this.dbl(), s = 1; s < n; s++) r[s] = r[s - 1].add(i);
    return {
      wnd: e,
      points: r
    }
  }, va.prototype._getBeta = function () {
    return null
  }, va.prototype.dblp = function (e) {
    for (var r = this, n = 0; n < e; n++) r = r.dbl();
    return r
  };
  var xC = {
    exports: {}
  };
  typeof Object.create == "function" ? xC.exports = function (e, r) {
    r && (e.super_ = r, e.prototype = Object.create(r.prototype, {
      constructor: {
        value: e,
        enumerable: !1,
        writable: !0,
        configurable: !0
      }
    }))
  } : xC.exports = function (e, r) {
    if (r) {
      e.super_ = r;
      var n = function () {};
      n.prototype = r.prototype, e.prototype = new n, e.prototype.constructor = e
    }
  };
  var $s = xC.exports,
    ape = Uo,
    Kn = Wu,
    CC = $s,
    ng = j5,
    cpe = ape.assert;

  function ba(t) {
    ng.call(this, "short", t), this.a = new Kn(t.a, 16).toRed(this.red), this.b = new Kn(t.b, 16).toRed(this.red), this.tinv = this.two.redInvm(), this.zeroA = this.a.fromRed().cmpn(0) === 0, this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0, this.endo = this._getEndomorphism(t), this._endoWnafT1 = new Array(4), this._endoWnafT2 = new Array(4)
  }
  CC(ba, ng);
  var lpe = ba;
  ba.prototype._getEndomorphism = function (e) {
    if (!(!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)) {
      var r, n;
      if (e.beta) r = new Kn(e.beta, 16).toRed(this.red);
      else {
        var i = this._getEndoRoots(this.p);
        r = i[0].cmp(i[1]) < 0 ? i[0] : i[1], r = r.toRed(this.red)
      }
      if (e.lambda) n = new Kn(e.lambda, 16);
      else {
        var s = this._getEndoRoots(this.n);
        this.g.mul(s[0]).x.cmp(this.g.x.redMul(r)) === 0 ? n = s[0] : (n = s[1], cpe(this.g.mul(n).x.cmp(this.g.x.redMul(r)) === 0))
      }
      var o;
      return e.basis ? o = e.basis.map(function (a) {
        return {
          a: new Kn(a.a, 16),
          b: new Kn(a.b, 16)
        }
      }) : o = this._getEndoBasis(n), {
        beta: r,
        lambda: n,
        basis: o
      }
    }
  }, ba.prototype._getEndoRoots = function (e) {
    var r = e === this.p ? this.red : Kn.mont(e),
      n = new Kn(2).toRed(r).redInvm(),
      i = n.redNeg(),
      s = new Kn(3).toRed(r).redNeg().redSqrt().redMul(n),
      o = i.redAdd(s).fromRed(),
      a = i.redSub(s).fromRed();
    return [o, a]
  }, ba.prototype._getEndoBasis = function (e) {
    for (var r = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), n = e, i = this.n.clone(), s = new Kn(1), o = new Kn(0), a = new Kn(0), c = new Kn(1), l, h, f, w, b, C, M, N = 0, $, k; n.cmpn(0) !== 0;) {
      var B = i.div(n);
      $ = i.sub(B.mul(n)), k = a.sub(B.mul(s));
      var F = c.sub(B.mul(o));
      if (!f && $.cmp(r) < 0) l = M.neg(), h = s, f = $.neg(), w = k;
      else if (f && ++N === 2) break;
      M = $, i = n, n = $, a = s, s = k, c = o, o = F
    }
    b = $.neg(), C = k;
    var D = f.sqr().add(w.sqr()),
      V = b.sqr().add(C.sqr());
    return V.cmp(D) >= 0 && (b = l, C = h), f.negative && (f = f.neg(), w = w.neg()), b.negative && (b = b.neg(), C = C.neg()), [{
      a: f,
      b: w
    }, {
      a: b,
      b: C
    }]
  }, ba.prototype._endoSplit = function (e) {
    var r = this.endo.basis,
      n = r[0],
      i = r[1],
      s = i.b.mul(e).divRound(this.n),
      o = n.b.neg().mul(e).divRound(this.n),
      a = s.mul(n.a),
      c = o.mul(i.a),
      l = s.mul(n.b),
      h = o.mul(i.b),
      f = e.sub(a).sub(c),
      w = l.add(h).neg();
    return {
      k1: f,
      k2: w
    }
  }, ba.prototype.pointFromX = function (e, r) {
    e = new Kn(e, 16), e.red || (e = e.toRed(this.red));
    var n = e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),
      i = n.redSqrt();
    if (i.redSqr().redSub(n).cmp(this.zero) !== 0) throw new Error("invalid point");
    var s = i.fromRed().isOdd();
    return (r && !s || !r && s) && (i = i.redNeg()), this.point(e, i)
  }, ba.prototype.validate = function (e) {
    if (e.inf) return !0;
    var r = e.x,
      n = e.y,
      i = this.a.redMul(r),
      s = r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);
    return n.redSqr().redISub(s).cmpn(0) === 0
  }, ba.prototype._endoWnafMulAdd = function (e, r, n) {
    for (var i = this._endoWnafT1, s = this._endoWnafT2, o = 0; o < e.length; o++) {
      var a = this._endoSplit(r[o]),
        c = e[o],
        l = c._getBeta();
      a.k1.negative && (a.k1.ineg(), c = c.neg(!0)), a.k2.negative && (a.k2.ineg(), l = l.neg(!0)), i[o * 2] = c, i[o * 2 + 1] = l, s[o * 2] = a.k1, s[o * 2 + 1] = a.k2
    }
    for (var h = this._wnafMulAdd(1, i, s, o * 2, n), f = 0; f < o * 2; f++) i[f] = null, s[f] = null;
    return h
  };

  function zi(t, e, r, n) {
    ng.BasePoint.call(this, t, "affine"), e === null && r === null ? (this.x = null, this.y = null, this.inf = !0) : (this.x = new Kn(e, 16), this.y = new Kn(r, 16), n && (this.x.forceRed(this.curve.red), this.y.forceRed(this.curve.red)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.inf = !1)
  }
  CC(zi, ng.BasePoint), ba.prototype.point = function (e, r, n) {
    return new zi(this, e, r, n)
  }, ba.prototype.pointFromJSON = function (e, r) {
    return zi.fromJSON(this, e, r)
  }, zi.prototype._getBeta = function () {
    if (this.curve.endo) {
      var e = this.precomputed;
      if (e && e.beta) return e.beta;
      var r = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);
      if (e) {
        var n = this.curve,
          i = function (s) {
            return n.point(s.x.redMul(n.endo.beta), s.y)
          };
        e.beta = r, r.precomputed = {
          beta: null,
          naf: e.naf && {
            wnd: e.naf.wnd,
            points: e.naf.points.map(i)
          },
          doubles: e.doubles && {
            step: e.doubles.step,
            points: e.doubles.points.map(i)
          }
        }
      }
      return r
    }
  }, zi.prototype.toJSON = function () {
    return this.precomputed ? [this.x, this.y, this.precomputed && {
      doubles: this.precomputed.doubles && {
        step: this.precomputed.doubles.step,
        points: this.precomputed.doubles.points.slice(1)
      },
      naf: this.precomputed.naf && {
        wnd: this.precomputed.naf.wnd,
        points: this.precomputed.naf.points.slice(1)
      }
    }] : [this.x, this.y]
  }, zi.fromJSON = function (e, r, n) {
    typeof r == "string" && (r = JSON.parse(r));
    var i = e.point(r[0], r[1], n);
    if (!r[2]) return i;

    function s(a) {
      return e.point(a[0], a[1], n)
    }
    var o = r[2];
    return i.precomputed = {
      beta: null,
      doubles: o.doubles && {
        step: o.doubles.step,
        points: [i].concat(o.doubles.points.map(s))
      },
      naf: o.naf && {
        wnd: o.naf.wnd,
        points: [i].concat(o.naf.points.map(s))
      }
    }, i
  }, zi.prototype.inspect = function () {
    return this.isInfinity() ? "<EC Point Infinity>" : "<EC Point x: " + this.x.fromRed().toString(16, 2) + " y: " + this.y.fromRed().toString(16, 2) + ">"
  }, zi.prototype.isInfinity = function () {
    return this.inf
  }, zi.prototype.add = function (e) {
    if (this.inf) return e;
    if (e.inf) return this;
    if (this.eq(e)) return this.dbl();
    if (this.neg().eq(e)) return this.curve.point(null, null);
    if (this.x.cmp(e.x) === 0) return this.curve.point(null, null);
    var r = this.y.redSub(e.y);
    r.cmpn(0) !== 0 && (r = r.redMul(this.x.redSub(e.x).redInvm()));
    var n = r.redSqr().redISub(this.x).redISub(e.x),
      i = r.redMul(this.x.redSub(n)).redISub(this.y);
    return this.curve.point(n, i)
  }, zi.prototype.dbl = function () {
    if (this.inf) return this;
    var e = this.y.redAdd(this.y);
    if (e.cmpn(0) === 0) return this.curve.point(null, null);
    var r = this.curve.a,
      n = this.x.redSqr(),
      i = e.redInvm(),
      s = n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i),
      o = s.redSqr().redISub(this.x.redAdd(this.x)),
      a = s.redMul(this.x.redSub(o)).redISub(this.y);
    return this.curve.point(o, a)
  }, zi.prototype.getX = function () {
    return this.x.fromRed()
  }, zi.prototype.getY = function () {
    return this.y.fromRed()
  }, zi.prototype.mul = function (e) {
    return e = new Kn(e, 16), this.isInfinity() ? this : this._hasDoubles(e) ? this.curve._fixedNafMul(this, e) : this.curve.endo ? this.curve._endoWnafMulAdd([this], [e]) : this.curve._wnafMul(this, e)
  }, zi.prototype.mulAdd = function (e, r, n) {
    var i = [this, r],
      s = [e, n];
    return this.curve.endo ? this.curve._endoWnafMulAdd(i, s) : this.curve._wnafMulAdd(1, i, s, 2)
  }, zi.prototype.jmulAdd = function (e, r, n) {
    var i = [this, r],
      s = [e, n];
    return this.curve.endo ? this.curve._endoWnafMulAdd(i, s, !0) : this.curve._wnafMulAdd(1, i, s, 2, !0)
  }, zi.prototype.eq = function (e) {
    return this === e || this.inf === e.inf && (this.inf || this.x.cmp(e.x) === 0 && this.y.cmp(e.y) === 0)
  }, zi.prototype.neg = function (e) {
    if (this.inf) return this;
    var r = this.curve.point(this.x, this.y.redNeg());
    if (e && this.precomputed) {
      var n = this.precomputed,
        i = function (s) {
          return s.neg()
        };
      r.precomputed = {
        naf: n.naf && {
          wnd: n.naf.wnd,
          points: n.naf.points.map(i)
        },
        doubles: n.doubles && {
          step: n.doubles.step,
          points: n.doubles.points.map(i)
        }
      }
    }
    return r
  }, zi.prototype.toJ = function () {
    if (this.inf) return this.curve.jpoint(null, null, null);
    var e = this.curve.jpoint(this.x, this.y, this.curve.one);
    return e
  };

  function ns(t, e, r, n) {
    ng.BasePoint.call(this, t, "jacobian"), e === null && r === null && n === null ? (this.x = this.curve.one, this.y = this.curve.one, this.z = new Kn(0)) : (this.x = new Kn(e, 16), this.y = new Kn(r, 16), this.z = new Kn(n, 16)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.zOne = this.z === this.curve.one
  }
  CC(ns, ng.BasePoint), ba.prototype.jpoint = function (e, r, n) {
    return new ns(this, e, r, n)
  }, ns.prototype.toP = function () {
    if (this.isInfinity()) return this.curve.point(null, null);
    var e = this.z.redInvm(),
      r = e.redSqr(),
      n = this.x.redMul(r),
      i = this.y.redMul(r).redMul(e);
    return this.curve.point(n, i)
  }, ns.prototype.neg = function () {
    return this.curve.jpoint(this.x, this.y.redNeg(), this.z)
  }, ns.prototype.add = function (e) {
    if (this.isInfinity()) return e;
    if (e.isInfinity()) return this;
    var r = e.z.redSqr(),
      n = this.z.redSqr(),
      i = this.x.redMul(r),
      s = e.x.redMul(n),
      o = this.y.redMul(r.redMul(e.z)),
      a = e.y.redMul(n.redMul(this.z)),
      c = i.redSub(s),
      l = o.redSub(a);
    if (c.cmpn(0) === 0) return l.cmpn(0) !== 0 ? this.curve.jpoint(null, null, null) : this.dbl();
    var h = c.redSqr(),
      f = h.redMul(c),
      w = i.redMul(h),
      b = l.redSqr().redIAdd(f).redISub(w).redISub(w),
      C = l.redMul(w.redISub(b)).redISub(o.redMul(f)),
      M = this.z.redMul(e.z).redMul(c);
    return this.curve.jpoint(b, C, M)
  }, ns.prototype.mixedAdd = function (e) {
    if (this.isInfinity()) return e.toJ();
    if (e.isInfinity()) return this;
    var r = this.z.redSqr(),
      n = this.x,
      i = e.x.redMul(r),
      s = this.y,
      o = e.y.redMul(r).redMul(this.z),
      a = n.redSub(i),
      c = s.redSub(o);
    if (a.cmpn(0) === 0) return c.cmpn(0) !== 0 ? this.curve.jpoint(null, null, null) : this.dbl();
    var l = a.redSqr(),
      h = l.redMul(a),
      f = n.redMul(l),
      w = c.redSqr().redIAdd(h).redISub(f).redISub(f),
      b = c.redMul(f.redISub(w)).redISub(s.redMul(h)),
      C = this.z.redMul(a);
    return this.curve.jpoint(w, b, C)
  }, ns.prototype.dblp = function (e) {
    if (e === 0) return this;
    if (this.isInfinity()) return this;
    if (!e) return this.dbl();
    var r;
    if (this.curve.zeroA || this.curve.threeA) {
      var n = this;
      for (r = 0; r < e; r++) n = n.dbl();
      return n
    }
    var i = this.curve.a,
      s = this.curve.tinv,
      o = this.x,
      a = this.y,
      c = this.z,
      l = c.redSqr().redSqr(),
      h = a.redAdd(a);
    for (r = 0; r < e; r++) {
      var f = o.redSqr(),
        w = h.redSqr(),
        b = w.redSqr(),
        C = f.redAdd(f).redIAdd(f).redIAdd(i.redMul(l)),
        M = o.redMul(w),
        N = C.redSqr().redISub(M.redAdd(M)),
        $ = M.redISub(N),
        k = C.redMul($);
      k = k.redIAdd(k).redISub(b);
      var B = h.redMul(c);
      r + 1 < e && (l = l.redMul(b)), o = N, c = B, h = k
    }
    return this.curve.jpoint(o, h.redMul(s), c)
  }, ns.prototype.dbl = function () {
    return this.isInfinity() ? this : this.curve.zeroA ? this._zeroDbl() : this.curve.threeA ? this._threeDbl() : this._dbl()
  }, ns.prototype._zeroDbl = function () {
    var e, r, n;
    if (this.zOne) {
      var i = this.x.redSqr(),
        s = this.y.redSqr(),
        o = s.redSqr(),
        a = this.x.redAdd(s).redSqr().redISub(i).redISub(o);
      a = a.redIAdd(a);
      var c = i.redAdd(i).redIAdd(i),
        l = c.redSqr().redISub(a).redISub(a),
        h = o.redIAdd(o);
      h = h.redIAdd(h), h = h.redIAdd(h), e = l, r = c.redMul(a.redISub(l)).redISub(h), n = this.y.redAdd(this.y)
    } else {
      var f = this.x.redSqr(),
        w = this.y.redSqr(),
        b = w.redSqr(),
        C = this.x.redAdd(w).redSqr().redISub(f).redISub(b);
      C = C.redIAdd(C);
      var M = f.redAdd(f).redIAdd(f),
        N = M.redSqr(),
        $ = b.redIAdd(b);
      $ = $.redIAdd($), $ = $.redIAdd($), e = N.redISub(C).redISub(C), r = M.redMul(C.redISub(e)).redISub($), n = this.y.redMul(this.z), n = n.redIAdd(n)
    }
    return this.curve.jpoint(e, r, n)
  }, ns.prototype._threeDbl = function () {
    var e, r, n;
    if (this.zOne) {
      var i = this.x.redSqr(),
        s = this.y.redSqr(),
        o = s.redSqr(),
        a = this.x.redAdd(s).redSqr().redISub(i).redISub(o);
      a = a.redIAdd(a);
      var c = i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),
        l = c.redSqr().redISub(a).redISub(a);
      e = l;
      var h = o.redIAdd(o);
      h = h.redIAdd(h), h = h.redIAdd(h), r = c.redMul(a.redISub(l)).redISub(h), n = this.y.redAdd(this.y)
    } else {
      var f = this.z.redSqr(),
        w = this.y.redSqr(),
        b = this.x.redMul(w),
        C = this.x.redSub(f).redMul(this.x.redAdd(f));
      C = C.redAdd(C).redIAdd(C);
      var M = b.redIAdd(b);
      M = M.redIAdd(M);
      var N = M.redAdd(M);
      e = C.redSqr().redISub(N), n = this.y.redAdd(this.z).redSqr().redISub(w).redISub(f);
      var $ = w.redSqr();
      $ = $.redIAdd($), $ = $.redIAdd($), $ = $.redIAdd($), r = C.redMul(M.redISub(e)).redISub($)
    }
    return this.curve.jpoint(e, r, n)
  }, ns.prototype._dbl = function () {
    var e = this.curve.a,
      r = this.x,
      n = this.y,
      i = this.z,
      s = i.redSqr().redSqr(),
      o = r.redSqr(),
      a = n.redSqr(),
      c = o.redAdd(o).redIAdd(o).redIAdd(e.redMul(s)),
      l = r.redAdd(r);
    l = l.redIAdd(l);
    var h = l.redMul(a),
      f = c.redSqr().redISub(h.redAdd(h)),
      w = h.redISub(f),
      b = a.redSqr();
    b = b.redIAdd(b), b = b.redIAdd(b), b = b.redIAdd(b);
    var C = c.redMul(w).redISub(b),
      M = n.redAdd(n).redMul(i);
    return this.curve.jpoint(f, C, M)
  }, ns.prototype.trpl = function () {
    if (!this.curve.zeroA) return this.dbl().add(this);
    var e = this.x.redSqr(),
      r = this.y.redSqr(),
      n = this.z.redSqr(),
      i = r.redSqr(),
      s = e.redAdd(e).redIAdd(e),
      o = s.redSqr(),
      a = this.x.redAdd(r).redSqr().redISub(e).redISub(i);
    a = a.redIAdd(a), a = a.redAdd(a).redIAdd(a), a = a.redISub(o);
    var c = a.redSqr(),
      l = i.redIAdd(i);
    l = l.redIAdd(l), l = l.redIAdd(l), l = l.redIAdd(l);
    var h = s.redIAdd(a).redSqr().redISub(o).redISub(c).redISub(l),
      f = r.redMul(h);
    f = f.redIAdd(f), f = f.redIAdd(f);
    var w = this.x.redMul(c).redISub(f);
    w = w.redIAdd(w), w = w.redIAdd(w);
    var b = this.y.redMul(h.redMul(l.redISub(h)).redISub(a.redMul(c)));
    b = b.redIAdd(b), b = b.redIAdd(b), b = b.redIAdd(b);
    var C = this.z.redAdd(a).redSqr().redISub(n).redISub(c);
    return this.curve.jpoint(w, b, C)
  }, ns.prototype.mul = function (e, r) {
    return e = new Kn(e, r), this.curve._wnafMul(this, e)
  }, ns.prototype.eq = function (e) {
    if (e.type === "affine") return this.eq(e.toJ());
    if (this === e) return !0;
    var r = this.z.redSqr(),
      n = e.z.redSqr();
    if (this.x.redMul(n).redISub(e.x.redMul(r)).cmpn(0) !== 0) return !1;
    var i = r.redMul(this.z),
      s = n.redMul(e.z);
    return this.y.redMul(s).redISub(e.y.redMul(i)).cmpn(0) === 0
  }, ns.prototype.eqXToP = function (e) {
    var r = this.z.redSqr(),
      n = e.toRed(this.curve.red).redMul(r);
    if (this.x.cmp(n) === 0) return !0;
    for (var i = e.clone(), s = this.curve.redN.redMul(r);;) {
      if (i.iadd(this.curve.n), i.cmp(this.curve.p) >= 0) return !1;
      if (n.redIAdd(s), this.x.cmp(n) === 0) return !0
    }
  }, ns.prototype.inspect = function () {
    return this.isInfinity() ? "<EC JPoint Infinity>" : "<EC JPoint x: " + this.x.toString(16, 2) + " y: " + this.y.toString(16, 2) + " z: " + this.z.toString(16, 2) + ">"
  }, ns.prototype.isInfinity = function () {
    return this.z.cmpn(0) === 0
  };
  var ig = Wu,
    NO = $s,
    F5 = j5,
    upe = Uo;

  function sg(t) {
    F5.call(this, "mont", t), this.a = new ig(t.a, 16).toRed(this.red), this.b = new ig(t.b, 16).toRed(this.red), this.i4 = new ig(4).toRed(this.red).redInvm(), this.two = new ig(2).toRed(this.red), this.a24 = this.i4.redMul(this.a.redAdd(this.two))
  }
  NO(sg, F5);
  var dpe = sg;
  sg.prototype.validate = function (e) {
    var r = e.normalize().x,
      n = r.redSqr(),
      i = n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r),
      s = i.redSqrt();
    return s.redSqr().cmp(i) === 0
  };

  function Hi(t, e, r) {
    F5.BasePoint.call(this, t, "projective"), e === null && r === null ? (this.x = this.curve.one, this.z = this.curve.zero) : (this.x = new ig(e, 16), this.z = new ig(r, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)))
  }
  NO(Hi, F5.BasePoint), sg.prototype.decodePoint = function (e, r) {
    return this.point(upe.toArray(e, r), 1)
  }, sg.prototype.point = function (e, r) {
    return new Hi(this, e, r)
  }, sg.prototype.pointFromJSON = function (e) {
    return Hi.fromJSON(this, e)
  }, Hi.prototype.precompute = function () {}, Hi.prototype._encode = function () {
    return this.getX().toArray("be", this.curve.p.byteLength())
  }, Hi.fromJSON = function (e, r) {
    return new Hi(e, r[0], r[1] || e.one)
  }, Hi.prototype.inspect = function () {
    return this.isInfinity() ? "<EC Point Infinity>" : "<EC Point x: " + this.x.fromRed().toString(16, 2) + " z: " + this.z.fromRed().toString(16, 2) + ">"
  }, Hi.prototype.isInfinity = function () {
    return this.z.cmpn(0) === 0
  }, Hi.prototype.dbl = function () {
    var e = this.x.redAdd(this.z),
      r = e.redSqr(),
      n = this.x.redSub(this.z),
      i = n.redSqr(),
      s = r.redSub(i),
      o = r.redMul(i),
      a = s.redMul(i.redAdd(this.curve.a24.redMul(s)));
    return this.curve.point(o, a)
  }, Hi.prototype.add = function () {
    throw new Error("Not supported on Montgomery curve")
  }, Hi.prototype.diffAdd = function (e, r) {
    var n = this.x.redAdd(this.z),
      i = this.x.redSub(this.z),
      s = e.x.redAdd(e.z),
      o = e.x.redSub(e.z),
      a = o.redMul(n),
      c = s.redMul(i),
      l = r.z.redMul(a.redAdd(c).redSqr()),
      h = r.x.redMul(a.redISub(c).redSqr());
    return this.curve.point(l, h)
  }, Hi.prototype.mul = function (e) {
    for (var r = e.clone(), n = this, i = this.curve.point(null, null), s = this, o = []; r.cmpn(0) !== 0; r.iushrn(1)) o.push(r.andln(1));
    for (var a = o.length - 1; a >= 0; a--) o[a] === 0 ? (n = n.diffAdd(i, s), i = i.dbl()) : (i = n.diffAdd(i, s), n = n.dbl());
    return i
  }, Hi.prototype.mulAdd = function () {
    throw new Error("Not supported on Montgomery curve")
  }, Hi.prototype.jumlAdd = function () {
    throw new Error("Not supported on Montgomery curve")
  }, Hi.prototype.eq = function (e) {
    return this.getX().cmp(e.getX()) === 0
  }, Hi.prototype.normalize = function () {
    return this.x = this.x.redMul(this.z.redInvm()), this.z = this.curve.one, this
  }, Hi.prototype.getX = function () {
    return this.normalize(), this.x.fromRed()
  };
  var hpe = Uo,
    zu = Wu,
    MO = $s,
    W5 = j5,
    fpe = hpe.assert;

  function vl(t) {
    this.twisted = (t.a | 0) !== 1, this.mOneA = this.twisted && (t.a | 0) === -1, this.extended = this.mOneA, W5.call(this, "edwards", t), this.a = new zu(t.a, 16).umod(this.red.m), this.a = this.a.toRed(this.red), this.c = new zu(t.c, 16).toRed(this.red), this.c2 = this.c.redSqr(), this.d = new zu(t.d, 16).toRed(this.red), this.dd = this.d.redAdd(this.d), fpe(!this.twisted || this.c.fromRed().cmpn(1) === 0), this.oneC = (t.c | 0) === 1
  }
  MO(vl, W5);
  var ppe = vl;
  vl.prototype._mulA = function (e) {
    return this.mOneA ? e.redNeg() : this.a.redMul(e)
  }, vl.prototype._mulC = function (e) {
    return this.oneC ? e : this.c.redMul(e)
  }, vl.prototype.jpoint = function (e, r, n, i) {
    return this.point(e, r, n, i)
  }, vl.prototype.pointFromX = function (e, r) {
    e = new zu(e, 16), e.red || (e = e.toRed(this.red));
    var n = e.redSqr(),
      i = this.c2.redSub(this.a.redMul(n)),
      s = this.one.redSub(this.c2.redMul(this.d).redMul(n)),
      o = i.redMul(s.redInvm()),
      a = o.redSqrt();
    if (a.redSqr().redSub(o).cmp(this.zero) !== 0) throw new Error("invalid point");
    var c = a.fromRed().isOdd();
    return (r && !c || !r && c) && (a = a.redNeg()), this.point(e, a)
  }, vl.prototype.pointFromY = function (e, r) {
    e = new zu(e, 16), e.red || (e = e.toRed(this.red));
    var n = e.redSqr(),
      i = n.redSub(this.c2),
      s = n.redMul(this.d).redMul(this.c2).redSub(this.a),
      o = i.redMul(s.redInvm());
    if (o.cmp(this.zero) === 0) {
      if (r) throw new Error("invalid point");
      return this.point(this.zero, e)
    }
    var a = o.redSqrt();
    if (a.redSqr().redSub(o).cmp(this.zero) !== 0) throw new Error("invalid point");
    return a.fromRed().isOdd() !== r && (a = a.redNeg()), this.point(a, e)
  }, vl.prototype.validate = function (e) {
    if (e.isInfinity()) return !0;
    e.normalize();
    var r = e.x.redSqr(),
      n = e.y.redSqr(),
      i = r.redMul(this.a).redAdd(n),
      s = this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n)));
    return i.cmp(s) === 0
  };

  function Cn(t, e, r, n, i) {
    W5.BasePoint.call(this, t, "projective"), e === null && r === null && n === null ? (this.x = this.curve.zero, this.y = this.curve.one, this.z = this.curve.one, this.t = this.curve.zero, this.zOne = !0) : (this.x = new zu(e, 16), this.y = new zu(r, 16), this.z = n ? new zu(n, 16) : this.curve.one, this.t = i && new zu(i, 16), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.t && !this.t.red && (this.t = this.t.toRed(this.curve.red)), this.zOne = this.z === this.curve.one, this.curve.extended && !this.t && (this.t = this.x.redMul(this.y), this.zOne || (this.t = this.t.redMul(this.z.redInvm()))))
  }
  MO(Cn, W5.BasePoint), vl.prototype.pointFromJSON = function (e) {
      return Cn.fromJSON(this, e)
    }, vl.prototype.point = function (e, r, n, i) {
      return new Cn(this, e, r, n, i)
    }, Cn.fromJSON = function (e, r) {
      return new Cn(e, r[0], r[1], r[2])
    }, Cn.prototype.inspect = function () {
      return this.isInfinity() ? "<EC Point Infinity>" : "<EC Point x: " + this.x.fromRed().toString(16, 2) + " y: " + this.y.fromRed().toString(16, 2) + " z: " + this.z.fromRed().toString(16, 2) + ">"
    }, Cn.prototype.isInfinity = function () {
      return this.x.cmpn(0) === 0 && (this.y.cmp(this.z) === 0 || this.zOne && this.y.cmp(this.curve.c) === 0)
    }, Cn.prototype._extDbl = function () {
      var e = this.x.redSqr(),
        r = this.y.redSqr(),
        n = this.z.redSqr();
      n = n.redIAdd(n);
      var i = this.curve._mulA(e),
        s = this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),
        o = i.redAdd(r),
        a = o.redSub(n),
        c = i.redSub(r),
        l = s.redMul(a),
        h = o.redMul(c),
        f = s.redMul(c),
        w = a.redMul(o);
      return this.curve.point(l, h, w, f)
    }, Cn.prototype._projDbl = function () {
      var e = this.x.redAdd(this.y).redSqr(),
        r = this.x.redSqr(),
        n = this.y.redSqr(),
        i, s, o, a, c, l;
      if (this.curve.twisted) {
        a = this.curve._mulA(r);
        var h = a.redAdd(n);
        this.zOne ? (i = e.redSub(r).redSub(n).redMul(h.redSub(this.curve.two)), s = h.redMul(a.redSub(n)), o = h.redSqr().redSub(h).redSub(h)) : (c = this.z.redSqr(), l = h.redSub(c).redISub(c), i = e.redSub(r).redISub(n).redMul(l), s = h.redMul(a.redSub(n)), o = h.redMul(l))
      } else a = r.redAdd(n), c = this.curve._mulC(this.z).redSqr(), l = a.redSub(c).redSub(c), i = this.curve._mulC(e.redISub(a)).redMul(l), s = this.curve._mulC(a).redMul(r.redISub(n)), o = a.redMul(l);
      return this.curve.point(i, s, o)
    }, Cn.prototype.dbl = function () {
      return this.isInfinity() ? this : this.curve.extended ? this._extDbl() : this._projDbl()
    }, Cn.prototype._extAdd = function (e) {
      var r = this.y.redSub(this.x).redMul(e.y.redSub(e.x)),
        n = this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),
        i = this.t.redMul(this.curve.dd).redMul(e.t),
        s = this.z.redMul(e.z.redAdd(e.z)),
        o = n.redSub(r),
        a = s.redSub(i),
        c = s.redAdd(i),
        l = n.redAdd(r),
        h = o.redMul(a),
        f = c.redMul(l),
        w = o.redMul(l),
        b = a.redMul(c);
      return this.curve.point(h, f, b, w)
    }, Cn.prototype._projAdd = function (e) {
      var r = this.z.redMul(e.z),
        n = r.redSqr(),
        i = this.x.redMul(e.x),
        s = this.y.redMul(e.y),
        o = this.curve.d.redMul(i).redMul(s),
        a = n.redSub(o),
        c = n.redAdd(o),
        l = this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(s),
        h = r.redMul(a).redMul(l),
        f, w;
      return this.curve.twisted ? (f = r.redMul(c).redMul(s.redSub(this.curve._mulA(i))), w = a.redMul(c)) : (f = r.redMul(c).redMul(s.redSub(i)), w = this.curve._mulC(a).redMul(c)), this.curve.point(h, f, w)
    }, Cn.prototype.add = function (e) {
      return this.isInfinity() ? e : e.isInfinity() ? this : this.curve.extended ? this._extAdd(e) : this._projAdd(e)
    }, Cn.prototype.mul = function (e) {
      return this._hasDoubles(e) ? this.curve._fixedNafMul(this, e) : this.curve._wnafMul(this, e)
    }, Cn.prototype.mulAdd = function (e, r, n) {
      return this.curve._wnafMulAdd(1, [this, r], [e, n], 2, !1)
    }, Cn.prototype.jmulAdd = function (e, r, n) {
      return this.curve._wnafMulAdd(1, [this, r], [e, n], 2, !0)
    }, Cn.prototype.normalize = function () {
      if (this.zOne) return this;
      var e = this.z.redInvm();
      return this.x = this.x.redMul(e), this.y = this.y.redMul(e), this.t && (this.t = this.t.redMul(e)), this.z = this.curve.one, this.zOne = !0, this
    }, Cn.prototype.neg = function () {
      return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg())
    }, Cn.prototype.getX = function () {
      return this.normalize(), this.x.fromRed()
    }, Cn.prototype.getY = function () {
      return this.normalize(), this.y.fromRed()
    }, Cn.prototype.eq = function (e) {
      return this === e || this.getX().cmp(e.getX()) === 0 && this.getY().cmp(e.getY()) === 0
    }, Cn.prototype.eqXToP = function (e) {
      var r = e.toRed(this.curve.red).redMul(this.z);
      if (this.x.cmp(r) === 0) return !0;
      for (var n = e.clone(), i = this.curve.redN.redMul(this.z);;) {
        if (n.iadd(this.curve.n), n.cmp(this.curve.p) >= 0) return !1;
        if (r.redIAdd(i), this.x.cmp(r) === 0) return !0
      }
    }, Cn.prototype.toP = Cn.prototype.normalize, Cn.prototype.mixedAdd = Cn.prototype.add,
    function (t) {
      var e = t;
      e.base = j5, e.short = lpe, e.mont = dpe, e.edwards = ppe
    }(_C);
  var z5 = {},
    H5 = {},
    Nr = {},
    gpe = p0,
    mpe = $s;
  Nr.inherits = mpe;

  function wpe(t, e) {
    return (t.charCodeAt(e) & 64512) !== 55296 || e < 0 || e + 1 >= t.length ? !1 : (t.charCodeAt(e + 1) & 64512) === 56320
  }

  function vpe(t, e) {
    if (Array.isArray(t)) return t.slice();
    if (!t) return [];
    var r = [];
    if (typeof t == "string")
      if (e) {
        if (e === "hex")
          for (t = t.replace(/[^a-z0-9]+/ig, ""), t.length % 2 !== 0 && (t = "0" + t), i = 0; i < t.length; i += 2) r.push(parseInt(t[i] + t[i + 1], 16))
      } else
        for (var n = 0, i = 0; i < t.length; i++) {
          var s = t.charCodeAt(i);
          s < 128 ? r[n++] = s : s < 2048 ? (r[n++] = s >> 6 | 192, r[n++] = s & 63 | 128) : wpe(t, i) ? (s = 65536 + ((s & 1023) << 10) + (t.charCodeAt(++i) & 1023), r[n++] = s >> 18 | 240, r[n++] = s >> 12 & 63 | 128, r[n++] = s >> 6 & 63 | 128, r[n++] = s & 63 | 128) : (r[n++] = s >> 12 | 224, r[n++] = s >> 6 & 63 | 128, r[n++] = s & 63 | 128)
        } else
          for (i = 0; i < t.length; i++) r[i] = t[i] | 0;
    return r
  }
  Nr.toArray = vpe;

  function bpe(t) {
    for (var e = "", r = 0; r < t.length; r++) e += $O(t[r].toString(16));
    return e
  }
  Nr.toHex = bpe;

  function PO(t) {
    var e = t >>> 24 | t >>> 8 & 65280 | t << 8 & 16711680 | (t & 255) << 24;
    return e >>> 0
  }
  Nr.htonl = PO;

  function ype(t, e) {
    for (var r = "", n = 0; n < t.length; n++) {
      var i = t[n];
      e === "little" && (i = PO(i)), r += OO(i.toString(16))
    }
    return r
  }
  Nr.toHex32 = ype;

  function $O(t) {
    return t.length === 1 ? "0" + t : t
  }
  Nr.zero2 = $O;

  function OO(t) {
    return t.length === 7 ? "0" + t : t.length === 6 ? "00" + t : t.length === 5 ? "000" + t : t.length === 4 ? "0000" + t : t.length === 3 ? "00000" + t : t.length === 2 ? "000000" + t : t.length === 1 ? "0000000" + t : t
  }
  Nr.zero8 = OO;

  function _pe(t, e, r, n) {
    var i = r - e;
    gpe(i % 4 === 0);
    for (var s = new Array(i / 4), o = 0, a = e; o < s.length; o++, a += 4) {
      var c;
      n === "big" ? c = t[a] << 24 | t[a + 1] << 16 | t[a + 2] << 8 | t[a + 3] : c = t[a + 3] << 24 | t[a + 2] << 16 | t[a + 1] << 8 | t[a], s[o] = c >>> 0
    }
    return s
  }
  Nr.join32 = _pe;

  function xpe(t, e) {
    for (var r = new Array(t.length * 4), n = 0, i = 0; n < t.length; n++, i += 4) {
      var s = t[n];
      e === "big" ? (r[i] = s >>> 24, r[i + 1] = s >>> 16 & 255, r[i + 2] = s >>> 8 & 255, r[i + 3] = s & 255) : (r[i + 3] = s >>> 24, r[i + 2] = s >>> 16 & 255, r[i + 1] = s >>> 8 & 255, r[i] = s & 255)
    }
    return r
  }
  Nr.split32 = xpe;

  function Cpe(t, e) {
    return t >>> e | t << 32 - e
  }
  Nr.rotr32 = Cpe;

  function Epe(t, e) {
    return t << e | t >>> 32 - e
  }
  Nr.rotl32 = Epe;

  function Ape(t, e) {
    return t + e >>> 0
  }
  Nr.sum32 = Ape;

  function Spe(t, e, r) {
    return t + e + r >>> 0
  }
  Nr.sum32_3 = Spe;

  function Ipe(t, e, r, n) {
    return t + e + r + n >>> 0
  }
  Nr.sum32_4 = Ipe;

  function Tpe(t, e, r, n, i) {
    return t + e + r + n + i >>> 0
  }
  Nr.sum32_5 = Tpe;

  function kpe(t, e, r, n) {
    var i = t[e],
      s = t[e + 1],
      o = n + s >>> 0,
      a = (o < n ? 1 : 0) + r + i;
    t[e] = a >>> 0, t[e + 1] = o
  }
  Nr.sum64 = kpe;

  function Rpe(t, e, r, n) {
    var i = e + n >>> 0,
      s = (i < e ? 1 : 0) + t + r;
    return s >>> 0
  }
  Nr.sum64_hi = Rpe;

  function Npe(t, e, r, n) {
    var i = e + n;
    return i >>> 0
  }
  Nr.sum64_lo = Npe;

  function Mpe(t, e, r, n, i, s, o, a) {
    var c = 0,
      l = e;
    l = l + n >>> 0, c += l < e ? 1 : 0, l = l + s >>> 0, c += l < s ? 1 : 0, l = l + a >>> 0, c += l < a ? 1 : 0;
    var h = t + r + i + o + c;
    return h >>> 0
  }
  Nr.sum64_4_hi = Mpe;

  function Ppe(t, e, r, n, i, s, o, a) {
    var c = e + n + s + a;
    return c >>> 0
  }
  Nr.sum64_4_lo = Ppe;

  function $pe(t, e, r, n, i, s, o, a, c, l) {
    var h = 0,
      f = e;
    f = f + n >>> 0, h += f < e ? 1 : 0, f = f + s >>> 0, h += f < s ? 1 : 0, f = f + a >>> 0, h += f < a ? 1 : 0, f = f + l >>> 0, h += f < l ? 1 : 0;
    var w = t + r + i + o + c + h;
    return w >>> 0
  }
  Nr.sum64_5_hi = $pe;

  function Ope(t, e, r, n, i, s, o, a, c, l) {
    var h = e + n + s + a + l;
    return h >>> 0
  }
  Nr.sum64_5_lo = Ope;

  function Dpe(t, e, r) {
    var n = e << 32 - r | t >>> r;
    return n >>> 0
  }
  Nr.rotr64_hi = Dpe;

  function Lpe(t, e, r) {
    var n = t << 32 - r | e >>> r;
    return n >>> 0
  }
  Nr.rotr64_lo = Lpe;

  function Bpe(t, e, r) {
    return t >>> r
  }
  Nr.shr64_hi = Bpe;

  function Upe(t, e, r) {
    var n = t << 32 - r | e >>> r;
    return n >>> 0
  }
  Nr.shr64_lo = Upe;
  var og = {},
    DO = Nr,
    jpe = p0;

  function q5() {
    this.pending = null, this.pendingTotal = 0, this.blockSize = this.constructor.blockSize, this.outSize = this.constructor.outSize, this.hmacStrength = this.constructor.hmacStrength, this.padLength = this.constructor.padLength / 8, this.endian = "big", this._delta8 = this.blockSize / 8, this._delta32 = this.blockSize / 32
  }
  og.BlockHash = q5, q5.prototype.update = function (e, r) {
    if (e = DO.toArray(e, r), this.pending ? this.pending = this.pending.concat(e) : this.pending = e, this.pendingTotal += e.length, this.pending.length >= this._delta8) {
      e = this.pending;
      var n = e.length % this._delta8;
      this.pending = e.slice(e.length - n, e.length), this.pending.length === 0 && (this.pending = null), e = DO.join32(e, 0, e.length - n, this.endian);
      for (var i = 0; i < e.length; i += this._delta32) this._update(e, i, i + this._delta32)
    }
    return this
  }, q5.prototype.digest = function (e) {
    return this.update(this._pad()), jpe(this.pending === null), this._digest(e)
  }, q5.prototype._pad = function () {
    var e = this.pendingTotal,
      r = this._delta8,
      n = r - (e + this.padLength) % r,
      i = new Array(n + this.padLength);
    i[0] = 128;
    for (var s = 1; s < n; s++) i[s] = 0;
    if (e <<= 3, this.endian === "big") {
      for (var o = 8; o < this.padLength; o++) i[s++] = 0;
      i[s++] = 0, i[s++] = 0, i[s++] = 0, i[s++] = 0, i[s++] = e >>> 24 & 255, i[s++] = e >>> 16 & 255, i[s++] = e >>> 8 & 255, i[s++] = e & 255
    } else
      for (i[s++] = e & 255, i[s++] = e >>> 8 & 255, i[s++] = e >>> 16 & 255, i[s++] = e >>> 24 & 255, i[s++] = 0, i[s++] = 0, i[s++] = 0, i[s++] = 0, o = 8; o < this.padLength; o++) i[s++] = 0;
    return i
  };
  var ag = {},
    bl = {},
    Fpe = Nr,
    yl = Fpe.rotr32;

  function Wpe(t, e, r, n) {
    if (t === 0) return LO(e, r, n);
    if (t === 1 || t === 3) return UO(e, r, n);
    if (t === 2) return BO(e, r, n)
  }
  bl.ft_1 = Wpe;

  function LO(t, e, r) {
    return t & e ^ ~t & r
  }
  bl.ch32 = LO;

  function BO(t, e, r) {
    return t & e ^ t & r ^ e & r
  }
  bl.maj32 = BO;

  function UO(t, e, r) {
    return t ^ e ^ r
  }
  bl.p32 = UO;

  function zpe(t) {
    return yl(t, 2) ^ yl(t, 13) ^ yl(t, 22)
  }
  bl.s0_256 = zpe;

  function Hpe(t) {
    return yl(t, 6) ^ yl(t, 11) ^ yl(t, 25)
  }
  bl.s1_256 = Hpe;

  function qpe(t) {
    return yl(t, 7) ^ yl(t, 18) ^ t >>> 3
  }
  bl.g0_256 = qpe;

  function Vpe(t) {
    return yl(t, 17) ^ yl(t, 19) ^ t >>> 10
  }
  bl.g1_256 = Vpe;
  var cg = Nr,
    Kpe = og,
    Gpe = bl,
    EC = cg.rotl32,
    Z2 = cg.sum32,
    Zpe = cg.sum32_5,
    Ype = Gpe.ft_1,
    jO = Kpe.BlockHash,
    Qpe = [1518500249, 1859775393, 2400959708, 3395469782];

  function _l() {
    if (!(this instanceof _l)) return new _l;
    jO.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.W = new Array(80)
  }
  cg.inherits(_l, jO);
  var Jpe = _l;
  _l.blockSize = 512, _l.outSize = 160, _l.hmacStrength = 80, _l.padLength = 64, _l.prototype._update = function (e, r) {
    for (var n = this.W, i = 0; i < 16; i++) n[i] = e[r + i];
    for (; i < n.length; i++) n[i] = EC(n[i - 3] ^ n[i - 8] ^ n[i - 14] ^ n[i - 16], 1);
    var s = this.h[0],
      o = this.h[1],
      a = this.h[2],
      c = this.h[3],
      l = this.h[4];
    for (i = 0; i < n.length; i++) {
      var h = ~~(i / 20),
        f = Zpe(EC(s, 5), Ype(h, o, a, c), l, n[i], Qpe[h]);
      l = c, c = a, a = EC(o, 30), o = s, s = f
    }
    this.h[0] = Z2(this.h[0], s), this.h[1] = Z2(this.h[1], o), this.h[2] = Z2(this.h[2], a), this.h[3] = Z2(this.h[3], c), this.h[4] = Z2(this.h[4], l)
  }, _l.prototype._digest = function (e) {
    return e === "hex" ? cg.toHex32(this.h, "big") : cg.split32(this.h, "big")
  };
  var lg = Nr,
    Xpe = og,
    ug = bl,
    e1e = p0,
    mc = lg.sum32,
    t1e = lg.sum32_4,
    r1e = lg.sum32_5,
    n1e = ug.ch32,
    i1e = ug.maj32,
    s1e = ug.s0_256,
    o1e = ug.s1_256,
    a1e = ug.g0_256,
    c1e = ug.g1_256,
    FO = Xpe.BlockHash,
    l1e = [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];

  function xl() {
    if (!(this instanceof xl)) return new xl;
    FO.call(this), this.h = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225], this.k = l1e, this.W = new Array(64)
  }
  lg.inherits(xl, FO);
  var WO = xl;
  xl.blockSize = 512, xl.outSize = 256, xl.hmacStrength = 192, xl.padLength = 64, xl.prototype._update = function (e, r) {
    for (var n = this.W, i = 0; i < 16; i++) n[i] = e[r + i];
    for (; i < n.length; i++) n[i] = t1e(c1e(n[i - 2]), n[i - 7], a1e(n[i - 15]), n[i - 16]);
    var s = this.h[0],
      o = this.h[1],
      a = this.h[2],
      c = this.h[3],
      l = this.h[4],
      h = this.h[5],
      f = this.h[6],
      w = this.h[7];
    for (e1e(this.k.length === n.length), i = 0; i < n.length; i++) {
      var b = r1e(w, o1e(l), n1e(l, h, f), this.k[i], n[i]),
        C = mc(s1e(s), i1e(s, o, a));
      w = f, f = h, h = l, l = mc(c, b), c = a, a = o, o = s, s = mc(b, C)
    }
    this.h[0] = mc(this.h[0], s), this.h[1] = mc(this.h[1], o), this.h[2] = mc(this.h[2], a), this.h[3] = mc(this.h[3], c), this.h[4] = mc(this.h[4], l), this.h[5] = mc(this.h[5], h), this.h[6] = mc(this.h[6], f), this.h[7] = mc(this.h[7], w)
  }, xl.prototype._digest = function (e) {
    return e === "hex" ? lg.toHex32(this.h, "big") : lg.split32(this.h, "big")
  };
  var AC = Nr,
    zO = WO;

  function Hu() {
    if (!(this instanceof Hu)) return new Hu;
    zO.call(this), this.h = [3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]
  }
  AC.inherits(Hu, zO);
  var u1e = Hu;
  Hu.blockSize = 512, Hu.outSize = 224, Hu.hmacStrength = 192, Hu.padLength = 64, Hu.prototype._digest = function (e) {
    return e === "hex" ? AC.toHex32(this.h.slice(0, 7), "big") : AC.split32(this.h.slice(0, 7), "big")
  };
  var ho = Nr,
    d1e = og,
    h1e = p0,
    Cl = ho.rotr64_hi,
    El = ho.rotr64_lo,
    HO = ho.shr64_hi,
    qO = ho.shr64_lo,
    xh = ho.sum64,
    SC = ho.sum64_hi,
    IC = ho.sum64_lo,
    f1e = ho.sum64_4_hi,
    p1e = ho.sum64_4_lo,
    g1e = ho.sum64_5_hi,
    m1e = ho.sum64_5_lo,
    VO = d1e.BlockHash,
    w1e = [1116352408, 3609767458, 1899447441, 602891725, 3049323471, 3964484399, 3921009573, 2173295548, 961987163, 4081628472, 1508970993, 3053834265, 2453635748, 2937671579, 2870763221, 3664609560, 3624381080, 2734883394, 310598401, 1164996542, 607225278, 1323610764, 1426881987, 3590304994, 1925078388, 4068182383, 2162078206, 991336113, 2614888103, 633803317, 3248222580, 3479774868, 3835390401, 2666613458, 4022224774, 944711139, 264347078, 2341262773, 604807628, 2007800933, 770255983, 1495990901, 1249150122, 1856431235, 1555081692, 3175218132, 1996064986, 2198950837, 2554220882, 3999719339, 2821834349, 766784016, 2952996808, 2566594879, 3210313671, 3203337956, 3336571891, 1034457026, 3584528711, 2466948901, 113926993, 3758326383, 338241895, 168717936, 666307205, 1188179964, 773529912, 1546045734, 1294757372, 1522805485, 1396182291, 2643833823, 1695183700, 2343527390, 1986661051, 1014477480, 2177026350, 1206759142, 2456956037, 344077627, 2730485921, 1290863460, 2820302411, 3158454273, 3259730800, 3505952657, 3345764771, 106217008, 3516065817, 3606008344, 3600352804, 1432725776, 4094571909, 1467031594, 275423344, 851169720, 430227734, 3100823752, 506948616, 1363258195, 659060556, 3750685593, 883997877, 3785050280, 958139571, 3318307427, 1322822218, 3812723403, 1537002063, 2003034995, 1747873779, 3602036899, 1955562222, 1575990012, 2024104815, 1125592928, 2227730452, 2716904306, 2361852424, 442776044, 2428436474, 593698344, 2756734187, 3733110249, 3204031479, 2999351573, 3329325298, 3815920427, 3391569614, 3928383900, 3515267271, 566280711, 3940187606, 3454069534, 4118630271, 4000239992, 116418474, 1914138554, 174292421, 2731055270, 289380356, 3203993006, 460393269, 320620315, 685471733, 587496836, 852142971, 1086792851, 1017036298, 365543100, 1126000580, 2618297676, 1288033470, 3409855158, 1501505948, 4234509866, 1607167915, 987167468, 1816402316, 1246189591];

  function wc() {
    if (!(this instanceof wc)) return new wc;
    VO.call(this), this.h = [1779033703, 4089235720, 3144134277, 2227873595, 1013904242, 4271175723, 2773480762, 1595750129, 1359893119, 2917565137, 2600822924, 725511199, 528734635, 4215389547, 1541459225, 327033209], this.k = w1e, this.W = new Array(160)
  }
  ho.inherits(wc, VO);
  var KO = wc;
  wc.blockSize = 1024, wc.outSize = 512, wc.hmacStrength = 192, wc.padLength = 128, wc.prototype._prepareBlock = function (e, r) {
    for (var n = this.W, i = 0; i < 32; i++) n[i] = e[r + i];
    for (; i < n.length; i += 2) {
      var s = T1e(n[i - 4], n[i - 3]),
        o = k1e(n[i - 4], n[i - 3]),
        a = n[i - 14],
        c = n[i - 13],
        l = S1e(n[i - 30], n[i - 29]),
        h = I1e(n[i - 30], n[i - 29]),
        f = n[i - 32],
        w = n[i - 31];
      n[i] = f1e(s, o, a, c, l, h, f, w), n[i + 1] = p1e(s, o, a, c, l, h, f, w)
    }
  }, wc.prototype._update = function (e, r) {
    this._prepareBlock(e, r);
    var n = this.W,
      i = this.h[0],
      s = this.h[1],
      o = this.h[2],
      a = this.h[3],
      c = this.h[4],
      l = this.h[5],
      h = this.h[6],
      f = this.h[7],
      w = this.h[8],
      b = this.h[9],
      C = this.h[10],
      M = this.h[11],
      N = this.h[12],
      $ = this.h[13],
      k = this.h[14],
      B = this.h[15];
    h1e(this.k.length === n.length);
    for (var F = 0; F < n.length; F += 2) {
      var D = k,
        V = B,
        R = E1e(w, b),
        P = A1e(w, b),
        j = v1e(w, b, C, M, N),
        Y = b1e(w, b, C, M, N, $),
        U = this.k[F],
        I = this.k[F + 1],
        g = n[F],
        u = n[F + 1],
        p = g1e(D, V, R, P, j, Y, U, I, g, u),
        v = m1e(D, V, R, P, j, Y, U, I, g, u);
      D = x1e(i, s), V = C1e(i, s), R = y1e(i, s, o, a, c), P = _1e(i, s, o, a, c, l);
      var x = SC(D, V, R, P),
        E = IC(D, V, R, P);
      k = N, B = $, N = C, $ = M, C = w, M = b, w = SC(h, f, p, v), b = IC(f, f, p, v), h = c, f = l, c = o, l = a, o = i, a = s, i = SC(p, v, x, E), s = IC(p, v, x, E)
    }
    xh(this.h, 0, i, s), xh(this.h, 2, o, a), xh(this.h, 4, c, l), xh(this.h, 6, h, f), xh(this.h, 8, w, b), xh(this.h, 10, C, M), xh(this.h, 12, N, $), xh(this.h, 14, k, B)
  }, wc.prototype._digest = function (e) {
    return e === "hex" ? ho.toHex32(this.h, "big") : ho.split32(this.h, "big")
  };

  function v1e(t, e, r, n, i) {
    var s = t & r ^ ~t & i;
    return s < 0 && (s += 4294967296), s
  }

  function b1e(t, e, r, n, i, s) {
    var o = e & n ^ ~e & s;
    return o < 0 && (o += 4294967296), o
  }

  function y1e(t, e, r, n, i) {
    var s = t & r ^ t & i ^ r & i;
    return s < 0 && (s += 4294967296), s
  }

  function _1e(t, e, r, n, i, s) {
    var o = e & n ^ e & s ^ n & s;
    return o < 0 && (o += 4294967296), o
  }

  function x1e(t, e) {
    var r = Cl(t, e, 28),
      n = Cl(e, t, 2),
      i = Cl(e, t, 7),
      s = r ^ n ^ i;
    return s < 0 && (s += 4294967296), s
  }

  function C1e(t, e) {
    var r = El(t, e, 28),
      n = El(e, t, 2),
      i = El(e, t, 7),
      s = r ^ n ^ i;
    return s < 0 && (s += 4294967296), s
  }

  function E1e(t, e) {
    var r = Cl(t, e, 14),
      n = Cl(t, e, 18),
      i = Cl(e, t, 9),
      s = r ^ n ^ i;
    return s < 0 && (s += 4294967296), s
  }

  function A1e(t, e) {
    var r = El(t, e, 14),
      n = El(t, e, 18),
      i = El(e, t, 9),
      s = r ^ n ^ i;
    return s < 0 && (s += 4294967296), s
  }

  function S1e(t, e) {
    var r = Cl(t, e, 1),
      n = Cl(t, e, 8),
      i = HO(t, e, 7),
      s = r ^ n ^ i;
    return s < 0 && (s += 4294967296), s
  }

  function I1e(t, e) {
    var r = El(t, e, 1),
      n = El(t, e, 8),
      i = qO(t, e, 7),
      s = r ^ n ^ i;
    return s < 0 && (s += 4294967296), s
  }

  function T1e(t, e) {
    var r = Cl(t, e, 19),
      n = Cl(e, t, 29),
      i = HO(t, e, 6),
      s = r ^ n ^ i;
    return s < 0 && (s += 4294967296), s
  }

  function k1e(t, e) {
    var r = El(t, e, 19),
      n = El(e, t, 29),
      i = qO(t, e, 6),
      s = r ^ n ^ i;
    return s < 0 && (s += 4294967296), s
  }
  var TC = Nr,
    GO = KO;

  function qu() {
    if (!(this instanceof qu)) return new qu;
    GO.call(this), this.h = [3418070365, 3238371032, 1654270250, 914150663, 2438529370, 812702999, 355462360, 4144912697, 1731405415, 4290775857, 2394180231, 1750603025, 3675008525, 1694076839, 1203062813, 3204075428]
  }
  TC.inherits(qu, GO);
  var R1e = qu;
  qu.blockSize = 1024, qu.outSize = 384, qu.hmacStrength = 192, qu.padLength = 128, qu.prototype._digest = function (e) {
    return e === "hex" ? TC.toHex32(this.h.slice(0, 12), "big") : TC.split32(this.h.slice(0, 12), "big")
  }, ag.sha1 = Jpe, ag.sha224 = u1e, ag.sha256 = WO, ag.sha384 = R1e, ag.sha512 = KO;
  var ZO = {},
    m0 = Nr,
    N1e = og,
    V5 = m0.rotl32,
    YO = m0.sum32,
    Y2 = m0.sum32_3,
    QO = m0.sum32_4,
    JO = N1e.BlockHash;

  function Al() {
    if (!(this instanceof Al)) return new Al;
    JO.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.endian = "little"
  }
  m0.inherits(Al, JO), ZO.ripemd160 = Al, Al.blockSize = 512, Al.outSize = 160, Al.hmacStrength = 192, Al.padLength = 64, Al.prototype._update = function (e, r) {
    for (var n = this.h[0], i = this.h[1], s = this.h[2], o = this.h[3], a = this.h[4], c = n, l = i, h = s, f = o, w = a, b = 0; b < 80; b++) {
      var C = YO(V5(QO(n, XO(b, i, s, o), e[$1e[b] + r], M1e(b)), D1e[b]), a);
      n = a, a = o, o = V5(s, 10), s = i, i = C, C = YO(V5(QO(c, XO(79 - b, l, h, f), e[O1e[b] + r], P1e(b)), L1e[b]), w), c = w, w = f, f = V5(h, 10), h = l, l = C
    }
    C = Y2(this.h[1], s, f), this.h[1] = Y2(this.h[2], o, w), this.h[2] = Y2(this.h[3], a, c), this.h[3] = Y2(this.h[4], n, l), this.h[4] = Y2(this.h[0], i, h), this.h[0] = C
  }, Al.prototype._digest = function (e) {
    return e === "hex" ? m0.toHex32(this.h, "little") : m0.split32(this.h, "little")
  };

  function XO(t, e, r, n) {
    return t <= 15 ? e ^ r ^ n : t <= 31 ? e & r | ~e & n : t <= 47 ? (e | ~r) ^ n : t <= 63 ? e & n | r & ~n : e ^ (r | ~n)
  }

  function M1e(t) {
    return t <= 15 ? 0 : t <= 31 ? 1518500249 : t <= 47 ? 1859775393 : t <= 63 ? 2400959708 : 2840853838
  }

  function P1e(t) {
    return t <= 15 ? 1352829926 : t <= 31 ? 1548603684 : t <= 47 ? 1836072691 : t <= 63 ? 2053994217 : 0
  }
  var $1e = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13],
    O1e = [5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11],
    D1e = [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6],
    L1e = [8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11],
    B1e = Nr,
    U1e = p0;

  function dg(t, e, r) {
    if (!(this instanceof dg)) return new dg(t, e, r);
    this.Hash = t, this.blockSize = t.blockSize / 8, this.outSize = t.outSize / 8, this.inner = null, this.outer = null, this._init(B1e.toArray(e, r))
  }
  var j1e = dg;
  dg.prototype._init = function (e) {
      e.length > this.blockSize && (e = new this.Hash().update(e).digest()), U1e(e.length <= this.blockSize);
      for (var r = e.length; r < this.blockSize; r++) e.push(0);
      for (r = 0; r < e.length; r++) e[r] ^= 54;
      for (this.inner = new this.Hash().update(e), r = 0; r < e.length; r++) e[r] ^= 106;
      this.outer = new this.Hash().update(e)
    }, dg.prototype.update = function (e, r) {
      return this.inner.update(e, r), this
    }, dg.prototype.digest = function (e) {
      return this.outer.update(this.inner.digest()), this.outer.digest(e)
    },
    function (t) {
      var e = t;
      e.utils = Nr, e.common = og, e.sha = ag, e.ripemd = ZO, e.hmac = j1e, e.sha1 = e.sha.sha1, e.sha256 = e.sha.sha256, e.sha224 = e.sha.sha224, e.sha384 = e.sha.sha384, e.sha512 = e.sha.sha512, e.ripemd160 = e.ripemd.ripemd160
    }(H5);
  var kC, eD;

  function F1e() {
    return eD || (eD = 1, kC = {
      doubles: {
        step: 4,
        points: [
          ["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a", "f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],
          ["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508", "11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],
          ["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739", "d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],
          ["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640", "4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],
          ["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c", "4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],
          ["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda", "96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],
          ["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa", "5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],
          ["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0", "cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],
          ["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d", "9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],
          ["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d", "e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],
          ["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1", "9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],
          ["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0", "5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],
          ["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047", "10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],
          ["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862", "283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],
          ["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7", "7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],
          ["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd", "56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],
          ["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83", "7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],
          ["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a", "53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],
          ["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8", "bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],
          ["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d", "4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],
          ["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725", "7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],
          ["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754", "4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],
          ["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c", "17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],
          ["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6", "6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],
          ["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39", "c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],
          ["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891", "893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],
          ["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b", "febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],
          ["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03", "2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],
          ["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d", "eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],
          ["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070", "7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],
          ["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4", "e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],
          ["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da", "662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],
          ["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11", "1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],
          ["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e", "efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],
          ["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41", "2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],
          ["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef", "67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],
          ["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8", "db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],
          ["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d", "648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],
          ["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96", "35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],
          ["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd", "ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],
          ["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5", "9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],
          ["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266", "40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],
          ["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71", "34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],
          ["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac", "c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],
          ["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751", "1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],
          ["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e", "493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],
          ["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241", "c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],
          ["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3", "be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],
          ["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f", "4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],
          ["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19", "aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],
          ["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be", "b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],
          ["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9", "6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],
          ["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2", "8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],
          ["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13", "7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],
          ["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c", "ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],
          ["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba", "2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],
          ["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151", "e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],
          ["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073", "d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],
          ["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458", "38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],
          ["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b", "69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],
          ["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366", "d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],
          ["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa", "40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],
          ["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0", "620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],
          ["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787", "7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],
          ["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e", "ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]
        ]
      },
      naf: {
        wnd: 7,
        points: [
          ["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9", "388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],
          ["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4", "d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],
          ["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc", "6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],
          ["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe", "cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],
          ["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb", "d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],
          ["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8", "ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],
          ["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e", "581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],
          ["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34", "4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],
          ["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c", "85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],
          ["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5", "321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],
          ["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f", "2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],
          ["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714", "73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],
          ["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729", "a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],
          ["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db", "2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],
          ["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4", "e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],
          ["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5", "b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],
          ["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479", "2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],
          ["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d", "80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],
          ["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f", "1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],
          ["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb", "d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],
          ["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9", "eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],
          ["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963", "758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],
          ["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74", "958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],
          ["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530", "e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],
          ["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b", "5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],
          ["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247", "cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],
          ["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1", "cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],
          ["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120", "4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],
          ["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435", "91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],
          ["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18", "673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],
          ["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8", "59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],
          ["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb", "3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],
          ["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f", "55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],
          ["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143", "efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],
          ["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba", "e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],
          ["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45", "f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],
          ["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a", "744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],
          ["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e", "c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],
          ["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8", "e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],
          ["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c", "30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],
          ["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519", "e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],
          ["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab", "100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],
          ["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca", "ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],
          ["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf", "8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],
          ["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610", "68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],
          ["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4", "f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],
          ["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c", "d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],
          ["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940", "edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],
          ["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980", "a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],
          ["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3", "66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],
          ["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf", "9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],
          ["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63", "4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],
          ["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448", "fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],
          ["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf", "5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],
          ["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5", "8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],
          ["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6", "8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],
          ["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5", "5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],
          ["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99", "f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],
          ["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51", "f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],
          ["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5", "42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],
          ["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5", "204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],
          ["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997", "4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],
          ["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881", "73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],
          ["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5", "39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],
          ["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66", "d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],
          ["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726", "ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],
          ["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede", "6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],
          ["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94", "60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],
          ["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31", "3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],
          ["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51", "b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],
          ["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252", "ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],
          ["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5", "cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],
          ["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b", "6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],
          ["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4", "322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],
          ["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f", "6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],
          ["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889", "2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],
          ["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246", "b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],
          ["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984", "998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],
          ["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a", "b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],
          ["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030", "bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],
          ["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197", "6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],
          ["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593", "c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],
          ["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef", "21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],
          ["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38", "60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],
          ["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a", "49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],
          ["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111", "5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],
          ["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502", "7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],
          ["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea", "be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],
          ["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26", "8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],
          ["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986", "39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],
          ["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e", "62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],
          ["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4", "25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],
          ["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda", "ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],
          ["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859", "cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],
          ["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f", "f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],
          ["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c", "6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],
          ["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942", "fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],
          ["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a", "1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],
          ["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80", "5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],
          ["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d", "438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],
          ["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1", "cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],
          ["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63", "c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],
          ["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352", "6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],
          ["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193", "ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],
          ["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00", "9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],
          ["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58", "ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],
          ["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7", "d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],
          ["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8", "c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],
          ["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e", "67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],
          ["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d", "cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],
          ["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b", "299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],
          ["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f", "f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],
          ["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6", "462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],
          ["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297", "62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],
          ["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a", "7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],
          ["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c", "ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],
          ["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52", "4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],
          ["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb", "bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],
          ["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065", "bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],
          ["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917", "603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],
          ["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9", "cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],
          ["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3", "553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],
          ["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57", "712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],
          ["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66", "ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],
          ["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8", "9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],
          ["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721", "9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],
          ["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180", "4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]
        ]
      }
    }), kC
  }(function (t) {
    var e = t,
      r = H5,
      n = _C,
      i = Uo,
      s = i.assert;

    function o(l) {
      l.type === "short" ? this.curve = new n.short(l) : l.type === "edwards" ? this.curve = new n.edwards(l) : this.curve = new n.mont(l), this.g = this.curve.g, this.n = this.curve.n, this.hash = l.hash, s(this.g.validate(), "Invalid curve"), s(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O")
    }
    e.PresetCurve = o;

    function a(l, h) {
      Object.defineProperty(e, l, {
        configurable: !0,
        enumerable: !0,
        get: function () {
          var f = new o(h);
          return Object.defineProperty(e, l, {
            configurable: !0,
            enumerable: !0,
            value: f
          }), f
        }
      })
    }
    a("p192", {
      type: "short",
      prime: "p192",
      p: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",
      a: "ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",
      b: "64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",
      n: "ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",
      hash: r.sha256,
      gRed: !1,
      g: ["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012", "07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]
    }), a("p224", {
      type: "short",
      prime: "p224",
      p: "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",
      a: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",
      b: "b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",
      n: "ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",
      hash: r.sha256,
      gRed: !1,
      g: ["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21", "bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]
    }), a("p256", {
      type: "short",
      prime: null,
      p: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",
      a: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",
      b: "5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",
      n: "ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",
      hash: r.sha256,
      gRed: !1,
      g: ["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296", "4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]
    }), a("p384", {
      type: "short",
      prime: null,
      p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",
      a: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",
      b: "b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",
      n: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",
      hash: r.sha384,
      gRed: !1,
      g: ["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7", "3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]
    }), a("p521", {
      type: "short",
      prime: null,
      p: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",
      a: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",
      b: "00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",
      n: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",
      hash: r.sha512,
      gRed: !1,
      g: ["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66", "00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]
    }), a("curve25519", {
      type: "mont",
      prime: "p25519",
      p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",
      a: "76d06",
      b: "1",
      n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",
      hash: r.sha256,
      gRed: !1,
      g: ["9"]
    }), a("ed25519", {
      type: "edwards",
      prime: "p25519",
      p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",
      a: "-1",
      c: "1",
      d: "52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",
      n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",
      hash: r.sha256,
      gRed: !1,
      g: ["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a", "6666666666666666666666666666666666666666666666666666666666666658"]
    });
    var c;
    try {
      c = F1e()
    } catch {
      c = void 0
    }
    a("secp256k1", {
      type: "short",
      prime: "k256",
      p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",
      a: "0",
      b: "7",
      n: "ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",
      h: "1",
      hash: r.sha256,
      beta: "7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",
      lambda: "5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",
      basis: [{
        a: "3086d221a7d46bcde86c90e49284eb15",
        b: "-e4437ed6010e88286f547fa90abfe4c3"
      }, {
        a: "114ca50f7a8e2f3f657c1108d9d44cfd8",
        b: "3086d221a7d46bcde86c90e49284eb15"
      }],
      gRed: !1,
      g: ["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", c]
    })
  })(z5);
  var W1e = H5,
    w0 = vC,
    tD = p0;

  function Ch(t) {
    if (!(this instanceof Ch)) return new Ch(t);
    this.hash = t.hash, this.predResist = !!t.predResist, this.outLen = this.hash.outSize, this.minEntropy = t.minEntropy || this.hash.hmacStrength, this._reseed = null, this.reseedInterval = null, this.K = null, this.V = null;
    var e = w0.toArray(t.entropy, t.entropyEnc || "hex"),
      r = w0.toArray(t.nonce, t.nonceEnc || "hex"),
      n = w0.toArray(t.pers, t.persEnc || "hex");
    tD(e.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._init(e, r, n)
  }
  var z1e = Ch;
  Ch.prototype._init = function (e, r, n) {
    var i = e.concat(r).concat(n);
    this.K = new Array(this.outLen / 8), this.V = new Array(this.outLen / 8);
    for (var s = 0; s < this.V.length; s++) this.K[s] = 0, this.V[s] = 1;
    this._update(i), this._reseed = 1, this.reseedInterval = 281474976710656
  }, Ch.prototype._hmac = function () {
    return new W1e.hmac(this.hash, this.K)
  }, Ch.prototype._update = function (e) {
    var r = this._hmac().update(this.V).update([0]);
    e && (r = r.update(e)), this.K = r.digest(), this.V = this._hmac().update(this.V).digest(), e && (this.K = this._hmac().update(this.V).update([1]).update(e).digest(), this.V = this._hmac().update(this.V).digest())
  }, Ch.prototype.reseed = function (e, r, n, i) {
    typeof r != "string" && (i = n, n = r, r = null), e = w0.toArray(e, r), n = w0.toArray(n, i), tD(e.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._update(e.concat(n || [])), this._reseed = 1
  }, Ch.prototype.generate = function (e, r, n, i) {
    if (this._reseed > this.reseedInterval) throw new Error("Reseed is required");
    typeof r != "string" && (i = n, n = r, r = null), n && (n = w0.toArray(n, i || "hex"), this._update(n));
    for (var s = []; s.length < e;) this.V = this._hmac().update(this.V).digest(), s = s.concat(this.V);
    var o = s.slice(0, e);
    return this._update(n), this._reseed++, w0.encode(o, r)
  };
  var H1e = Wu,
    q1e = Uo,
    RC = q1e.assert;

  function Cs(t, e) {
    this.ec = t, this.priv = null, this.pub = null, e.priv && this._importPrivate(e.priv, e.privEnc), e.pub && this._importPublic(e.pub, e.pubEnc)
  }
  var V1e = Cs;
  Cs.fromPublic = function (e, r, n) {
    return r instanceof Cs ? r : new Cs(e, {
      pub: r,
      pubEnc: n
    })
  }, Cs.fromPrivate = function (e, r, n) {
    return r instanceof Cs ? r : new Cs(e, {
      priv: r,
      privEnc: n
    })
  }, Cs.prototype.validate = function () {
    var e = this.getPublic();
    return e.isInfinity() ? {
      result: !1,
      reason: "Invalid public key"
    } : e.validate() ? e.mul(this.ec.curve.n).isInfinity() ? {
      result: !0,
      reason: null
    } : {
      result: !1,
      reason: "Public key * N != O"
    } : {
      result: !1,
      reason: "Public key is not a point"
    }
  }, Cs.prototype.getPublic = function (e, r) {
    return typeof e == "string" && (r = e, e = null), this.pub || (this.pub = this.ec.g.mul(this.priv)), r ? this.pub.encode(r, e) : this.pub
  }, Cs.prototype.getPrivate = function (e) {
    return e === "hex" ? this.priv.toString(16, 2) : this.priv
  }, Cs.prototype._importPrivate = function (e, r) {
    this.priv = new H1e(e, r || 16), this.priv = this.priv.umod(this.ec.curve.n)
  }, Cs.prototype._importPublic = function (e, r) {
    if (e.x || e.y) {
      this.ec.curve.type === "mont" ? RC(e.x, "Need x coordinate") : (this.ec.curve.type === "short" || this.ec.curve.type === "edwards") && RC(e.x && e.y, "Need both x and y coordinate"), this.pub = this.ec.curve.point(e.x, e.y);
      return
    }
    this.pub = this.ec.curve.decodePoint(e, r)
  }, Cs.prototype.derive = function (e) {
    return e.validate() || RC(e.validate(), "public point not validated"), e.mul(this.priv).getX()
  }, Cs.prototype.sign = function (e, r, n) {
    return this.ec.sign(e, this, r, n)
  }, Cs.prototype.verify = function (e, r, n) {
    return this.ec.verify(e, r, this, void 0, n)
  }, Cs.prototype.inspect = function () {
    return "<Key priv: " + (this.priv && this.priv.toString(16, 2)) + " pub: " + (this.pub && this.pub.inspect()) + " >"
  };
  var K5 = Wu,
    NC = Uo,
    K1e = NC.assert;

  function G5(t, e) {
    if (t instanceof G5) return t;
    this._importDER(t, e) || (K1e(t.r && t.s, "Signature without r or s"), this.r = new K5(t.r, 16), this.s = new K5(t.s, 16), t.recoveryParam === void 0 ? this.recoveryParam = null : this.recoveryParam = t.recoveryParam)
  }
  var G1e = G5;

  function Z1e() {
    this.place = 0
  }

  function MC(t, e) {
    var r = t[e.place++];
    if (!(r & 128)) return r;
    var n = r & 15;
    if (n === 0 || n > 4 || t[e.place] === 0) return !1;
    for (var i = 0, s = 0, o = e.place; s < n; s++, o++) i <<= 8, i |= t[o], i >>>= 0;
    return i <= 127 ? !1 : (e.place = o, i)
  }

  function rD(t) {
    for (var e = 0, r = t.length - 1; !t[e] && !(t[e + 1] & 128) && e < r;) e++;
    return e === 0 ? t : t.slice(e)
  }
  G5.prototype._importDER = function (e, r) {
    e = NC.toArray(e, r);
    var n = new Z1e;
    if (e[n.place++] !== 48) return !1;
    var i = MC(e, n);
    if (i === !1 || i + n.place !== e.length || e[n.place++] !== 2) return !1;
    var s = MC(e, n);
    if (s === !1 || e[n.place] & 128) return !1;
    var o = e.slice(n.place, s + n.place);
    if (n.place += s, e[n.place++] !== 2) return !1;
    var a = MC(e, n);
    if (a === !1 || e.length !== a + n.place || e[n.place] & 128) return !1;
    var c = e.slice(n.place, a + n.place);
    if (o[0] === 0)
      if (o[1] & 128) o = o.slice(1);
      else return !1;
    if (c[0] === 0)
      if (c[1] & 128) c = c.slice(1);
      else return !1;
    return this.r = new K5(o), this.s = new K5(c), this.recoveryParam = null, !0
  };

  function PC(t, e) {
    if (e < 128) {
      t.push(e);
      return
    }
    var r = 1 + (Math.log(e) / Math.LN2 >>> 3);
    for (t.push(r | 128); --r;) t.push(e >>> (r << 3) & 255);
    t.push(e)
  }
  G5.prototype.toDER = function (e) {
    var r = this.r.toArray(),
      n = this.s.toArray();
    for (r[0] & 128 && (r = [0].concat(r)), n[0] & 128 && (n = [0].concat(n)), r = rD(r), n = rD(n); !n[0] && !(n[1] & 128);) n = n.slice(1);
    var i = [2];
    PC(i, r.length), i = i.concat(r), i.push(2), PC(i, n.length);
    var s = i.concat(n),
      o = [48];
    return PC(o, s.length), o = o.concat(s), NC.encode(o, e)
  };
  var Vu = Wu,
    nD = z1e,
    Y1e = Uo,
    $C = z5,
    Q1e = RO,
    iD = Y1e.assert,
    OC = V1e,
    Z5 = G1e;

  function ya(t) {
    if (!(this instanceof ya)) return new ya(t);
    typeof t == "string" && (iD(Object.prototype.hasOwnProperty.call($C, t), "Unknown curve " + t), t = $C[t]), t instanceof $C.PresetCurve && (t = {
      curve: t
    }), this.curve = t.curve.curve, this.n = this.curve.n, this.nh = this.n.ushrn(1), this.g = this.curve.g, this.g = t.curve.g, this.g.precompute(t.curve.n.bitLength() + 1), this.hash = t.hash || t.curve.hash
  }
  var J1e = ya;
  ya.prototype.keyPair = function (e) {
    return new OC(this, e)
  }, ya.prototype.keyFromPrivate = function (e, r) {
    return OC.fromPrivate(this, e, r)
  }, ya.prototype.keyFromPublic = function (e, r) {
    return OC.fromPublic(this, e, r)
  }, ya.prototype.genKeyPair = function (e) {
    e || (e = {});
    for (var r = new nD({
        hash: this.hash,
        pers: e.pers,
        persEnc: e.persEnc || "utf8",
        entropy: e.entropy || Q1e(this.hash.hmacStrength),
        entropyEnc: e.entropy && e.entropyEnc || "utf8",
        nonce: this.n.toArray()
      }), n = this.n.byteLength(), i = this.n.sub(new Vu(2));;) {
      var s = new Vu(r.generate(n));
      if (!(s.cmp(i) > 0)) return s.iaddn(1), this.keyFromPrivate(s)
    }
  }, ya.prototype._truncateToN = function (e, r, n) {
    var i;
    if (Vu.isBN(e) || typeof e == "number") e = new Vu(e, 16), i = e.byteLength();
    else if (typeof e == "object") i = e.length, e = new Vu(e, 16);
    else {
      var s = e.toString();
      i = s.length + 1 >>> 1, e = new Vu(s, 16)
    }
    typeof n != "number" && (n = i * 8);
    var o = n - this.n.bitLength();
    return o > 0 && (e = e.ushrn(o)), !r && e.cmp(this.n) >= 0 ? e.sub(this.n) : e
  }, ya.prototype.sign = function (e, r, n, i) {
    typeof n == "object" && (i = n, n = null), i || (i = {}), r = this.keyFromPrivate(r, n), e = this._truncateToN(e, !1, i.msgBitLength);
    for (var s = this.n.byteLength(), o = r.getPrivate().toArray("be", s), a = e.toArray("be", s), c = new nD({
        hash: this.hash,
        entropy: o,
        nonce: a,
        pers: i.pers,
        persEnc: i.persEnc || "utf8"
      }), l = this.n.sub(new Vu(1)), h = 0;; h++) {
      var f = i.k ? i.k(h) : new Vu(c.generate(this.n.byteLength()));
      if (f = this._truncateToN(f, !0), !(f.cmpn(1) <= 0 || f.cmp(l) >= 0)) {
        var w = this.g.mul(f);
        if (!w.isInfinity()) {
          var b = w.getX(),
            C = b.umod(this.n);
          if (C.cmpn(0) !== 0) {
            var M = f.invm(this.n).mul(C.mul(r.getPrivate()).iadd(e));
            if (M = M.umod(this.n), M.cmpn(0) !== 0) {
              var N = (w.getY().isOdd() ? 1 : 0) | (b.cmp(C) !== 0 ? 2 : 0);
              return i.canonical && M.cmp(this.nh) > 0 && (M = this.n.sub(M), N ^= 1), new Z5({
                r: C,
                s: M,
                recoveryParam: N
              })
            }
          }
        }
      }
    }
  }, ya.prototype.verify = function (e, r, n, i, s) {
    s || (s = {}), e = this._truncateToN(e, !1, s.msgBitLength), n = this.keyFromPublic(n, i), r = new Z5(r, "hex");
    var o = r.r,
      a = r.s;
    if (o.cmpn(1) < 0 || o.cmp(this.n) >= 0 || a.cmpn(1) < 0 || a.cmp(this.n) >= 0) return !1;
    var c = a.invm(this.n),
      l = c.mul(e).umod(this.n),
      h = c.mul(o).umod(this.n),
      f;
    return this.curve._maxwellTrick ? (f = this.g.jmulAdd(l, n.getPublic(), h), f.isInfinity() ? !1 : f.eqXToP(o)) : (f = this.g.mulAdd(l, n.getPublic(), h), f.isInfinity() ? !1 : f.getX().umod(this.n).cmp(o) === 0)
  }, ya.prototype.recoverPubKey = function (t, e, r, n) {
    iD((3 & r) === r, "The recovery param is more than two bits"), e = new Z5(e, n);
    var i = this.n,
      s = new Vu(t),
      o = e.r,
      a = e.s,
      c = r & 1,
      l = r >> 1;
    if (o.cmp(this.curve.p.umod(this.curve.n)) >= 0 && l) throw new Error("Unable to find sencond key candinate");
    l ? o = this.curve.pointFromX(o.add(this.curve.n), c) : o = this.curve.pointFromX(o, c);
    var h = e.r.invm(i),
      f = i.sub(s).mul(h).umod(i),
      w = a.mul(h).umod(i);
    return this.g.mulAdd(f, o, w)
  }, ya.prototype.getKeyRecoveryParam = function (t, e, r, n) {
    if (e = new Z5(e, n), e.recoveryParam !== null) return e.recoveryParam;
    for (var i = 0; i < 4; i++) {
      var s;
      try {
        s = this.recoverPubKey(t, e, i)
      } catch {
        continue
      }
      if (s.eq(r)) return i
    }
    throw new Error("Unable to find valid recovery factor")
  };
  var Q2 = Uo,
    sD = Q2.assert,
    oD = Q2.parseBytes,
    hg = Q2.cachedProperty;

  function qi(t, e) {
    this.eddsa = t, this._secret = oD(e.secret), t.isPoint(e.pub) ? this._pub = e.pub : this._pubBytes = oD(e.pub)
  }
  qi.fromPublic = function (e, r) {
    return r instanceof qi ? r : new qi(e, {
      pub: r
    })
  }, qi.fromSecret = function (e, r) {
    return r instanceof qi ? r : new qi(e, {
      secret: r
    })
  }, qi.prototype.secret = function () {
    return this._secret
  }, hg(qi, "pubBytes", function () {
    return this.eddsa.encodePoint(this.pub())
  }), hg(qi, "pub", function () {
    return this._pubBytes ? this.eddsa.decodePoint(this._pubBytes) : this.eddsa.g.mul(this.priv())
  }), hg(qi, "privBytes", function () {
    var e = this.eddsa,
      r = this.hash(),
      n = e.encodingLength - 1,
      i = r.slice(0, e.encodingLength);
    return i[0] &= 248, i[n] &= 127, i[n] |= 64, i
  }), hg(qi, "priv", function () {
    return this.eddsa.decodeInt(this.privBytes())
  }), hg(qi, "hash", function () {
    return this.eddsa.hash().update(this.secret()).digest()
  }), hg(qi, "messagePrefix", function () {
    return this.hash().slice(this.eddsa.encodingLength)
  }), qi.prototype.sign = function (e) {
    return sD(this._secret, "KeyPair can only verify"), this.eddsa.sign(e, this)
  }, qi.prototype.verify = function (e, r) {
    return this.eddsa.verify(e, r, this)
  }, qi.prototype.getSecret = function (e) {
    return sD(this._secret, "KeyPair is public only"), Q2.encode(this.secret(), e)
  }, qi.prototype.getPublic = function (e) {
    return Q2.encode(this.pubBytes(), e)
  };
  var X1e = qi,
    ege = Wu,
    Y5 = Uo,
    aD = Y5.assert,
    Q5 = Y5.cachedProperty,
    tge = Y5.parseBytes;

  function v0(t, e) {
    this.eddsa = t, typeof e != "object" && (e = tge(e)), Array.isArray(e) && (aD(e.length === t.encodingLength * 2, "Signature has invalid size"), e = {
      R: e.slice(0, t.encodingLength),
      S: e.slice(t.encodingLength)
    }), aD(e.R && e.S, "Signature without R or S"), t.isPoint(e.R) && (this._R = e.R), e.S instanceof ege && (this._S = e.S), this._Rencoded = Array.isArray(e.R) ? e.R : e.Rencoded, this._Sencoded = Array.isArray(e.S) ? e.S : e.Sencoded
  }
  Q5(v0, "S", function () {
    return this.eddsa.decodeInt(this.Sencoded())
  }), Q5(v0, "R", function () {
    return this.eddsa.decodePoint(this.Rencoded())
  }), Q5(v0, "Rencoded", function () {
    return this.eddsa.encodePoint(this.R())
  }), Q5(v0, "Sencoded", function () {
    return this.eddsa.encodeInt(this.S())
  }), v0.prototype.toBytes = function () {
    return this.Rencoded().concat(this.Sencoded())
  }, v0.prototype.toHex = function () {
    return Y5.encode(this.toBytes(), "hex").toUpperCase()
  };
  var rge = v0,
    nge = H5,
    ige = z5,
    fg = Uo,
    sge = fg.assert,
    cD = fg.parseBytes,
    lD = X1e,
    uD = rge;

  function fo(t) {
    if (sge(t === "ed25519", "only tested with ed25519 so far"), !(this instanceof fo)) return new fo(t);
    t = ige[t].curve, this.curve = t, this.g = t.g, this.g.precompute(t.n.bitLength() + 1), this.pointClass = t.point().constructor, this.encodingLength = Math.ceil(t.n.bitLength() / 8), this.hash = nge.sha512
  }
  var oge = fo;
  fo.prototype.sign = function (e, r) {
      e = cD(e);
      var n = this.keyFromSecret(r),
        i = this.hashInt(n.messagePrefix(), e),
        s = this.g.mul(i),
        o = this.encodePoint(s),
        a = this.hashInt(o, n.pubBytes(), e).mul(n.priv()),
        c = i.add(a).umod(this.curve.n);
      return this.makeSignature({
        R: s,
        S: c,
        Rencoded: o
      })
    }, fo.prototype.verify = function (e, r, n) {
      if (e = cD(e), r = this.makeSignature(r), r.S().gte(r.eddsa.curve.n) || r.S().isNeg()) return !1;
      var i = this.keyFromPublic(n),
        s = this.hashInt(r.Rencoded(), i.pubBytes(), e),
        o = this.g.mul(r.S()),
        a = r.R().add(i.pub().mul(s));
      return a.eq(o)
    }, fo.prototype.hashInt = function () {
      for (var e = this.hash(), r = 0; r < arguments.length; r++) e.update(arguments[r]);
      return fg.intFromLE(e.digest()).umod(this.curve.n)
    }, fo.prototype.keyFromPublic = function (e) {
      return lD.fromPublic(this, e)
    }, fo.prototype.keyFromSecret = function (e) {
      return lD.fromSecret(this, e)
    }, fo.prototype.makeSignature = function (e) {
      return e instanceof uD ? e : new uD(this, e)
    }, fo.prototype.encodePoint = function (e) {
      var r = e.getY().toArray("le", this.encodingLength);
      return r[this.encodingLength - 1] |= e.getX().isOdd() ? 128 : 0, r
    }, fo.prototype.decodePoint = function (e) {
      e = fg.parseBytes(e);
      var r = e.length - 1,
        n = e.slice(0, r).concat(e[r] & -129),
        i = (e[r] & 128) !== 0,
        s = fg.intFromLE(n);
      return this.curve.pointFromY(s, i)
    }, fo.prototype.encodeInt = function (e) {
      return e.toArray("le", this.encodingLength)
    }, fo.prototype.decodeInt = function (e) {
      return fg.intFromLE(e)
    }, fo.prototype.isPoint = function (e) {
      return e instanceof this.pointClass
    },
    function (t) {
      var e = t;
      e.version = spe.version, e.utils = Uo, e.rand = RO, e.curve = _C, e.curves = z5, e.ec = J1e, e.eddsa = oge
    }(IO);
  const age = {
    waku: {
      publish: "waku_publish",
      batchPublish: "waku_batchPublish",
      subscribe: "waku_subscribe",
      batchSubscribe: "waku_batchSubscribe",
      subscription: "waku_subscription",
      unsubscribe: "waku_unsubscribe",
      batchUnsubscribe: "waku_batchUnsubscribe",
      batchFetchMessages: "waku_batchFetchMessages"
    },
    irn: {
      publish: "irn_publish",
      batchPublish: "irn_batchPublish",
      subscribe: "irn_subscribe",
      batchSubscribe: "irn_batchSubscribe",
      subscription: "irn_subscription",
      unsubscribe: "irn_unsubscribe",
      batchUnsubscribe: "irn_batchUnsubscribe",
      batchFetchMessages: "irn_batchFetchMessages"
    },
    iridium: {
      publish: "iridium_publish",
      batchPublish: "iridium_batchPublish",
      subscribe: "iridium_subscribe",
      batchSubscribe: "iridium_batchSubscribe",
      subscription: "iridium_subscription",
      unsubscribe: "iridium_unsubscribe",
      batchUnsubscribe: "iridium_batchUnsubscribe",
      batchFetchMessages: "iridium_batchFetchMessages"
    }
  };
  var cge = {};
  const lge = ":";

  function J2(t) {
    const [e, r] = t.split(lge);
    return {
      namespace: e,
      reference: r
    }
  }

  function dD(t, e = []) {
    const r = [];
    return Object.keys(t).forEach(n => {
      if (e.length && !e.includes(n)) return;
      const i = t[n];
      r.push(...i.accounts)
    }), r
  }

  function hD(t, e) {
    return t.includes(":") ? [t] : e.chains || []
  }
  var uge = Object.defineProperty,
    fD = Object.getOwnPropertySymbols,
    dge = Object.prototype.hasOwnProperty,
    hge = Object.prototype.propertyIsEnumerable,
    pD = (t, e, r) => e in t ? uge(t, e, {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: r
    }) : t[e] = r,
    gD = (t, e) => {
      for (var r in e || (e = {})) dge.call(e, r) && pD(t, r, e[r]);
      if (fD)
        for (var r of fD(e)) hge.call(e, r) && pD(t, r, e[r]);
      return t
    };
  const fge = "ReactNative",
    jo = {
      reactNative: "react-native",
      node: "node",
      browser: "browser",
      unknown: "unknown"
    },
    pge = "js";

  function J5() {
    return typeof process < "u" && typeof process.versions < "u" && typeof process.versions.node < "u"
  }

  function pg() {
    return !D5() && !!cC() && navigator.product === fge
  }

  function X2() {
    return !J5() && !!cC() && !!D5()
  }

  function ev() {
    return pg() ? jo.reactNative : J5() ? jo.node : X2() ? jo.browser : jo.unknown
  }

  function gge() {
    var t;
    try {
      return pg() && typeof global < "u" && typeof (global == null ? void 0 : global.Application) < "u" ? (t = global.Application) == null ? void 0 : t.applicationId : void 0
    } catch {
      return
    }
  }

  function mge(t, e) {
    let r = q2.parse(t);
    return r = gD(gD({}, r), e), t = q2.stringify(r), t
  }

  function mD() {
    return dO() || {
      name: "",
      description: "",
      url: "",
      icons: [""]
    }
  }

  function wge() {
    if (ev() === jo.reactNative && typeof global < "u" && typeof (global == null ? void 0 : global.Platform) < "u") {
      const {
        OS: r,
        Version: n
      } = global.Platform;
      return [r, n].join("-")
    }
    const t = C0e();
    if (t === null) return "unknown";
    const e = t.os ? t.os.replace(" ", "").toLowerCase() : "unknown";
    return t.type === "browser" ? [e, t.name, t.version].join("-") : [e, t.version].join("-")
  }

  function vge() {
    var t;
    const e = ev();
    return e === jo.browser ? [e, ((t = uO()) == null ? void 0 : t.host) || "unknown"].join(":") : e
  }

  function wD(t, e, r) {
    const n = wge(),
      i = vge();
    return [
      [t, e].join("-"), [pge, r].join("-"), n, i
    ].join("/")
  }

  function bge({
    protocol: t,
    version: e,
    relayUrl: r,
    sdkVersion: n,
    auth: i,
    projectId: s,
    useOnCloseEvent: o,
    bundleId: a
  }) {
    const c = r.split("?"),
      l = wD(t, e, n),
      h = {
        auth: i,
        ua: l,
        projectId: s,
        useOnCloseEvent: o || void 0,
        origin: a || void 0
      },
      f = mge(c[1] || "", h);
    return c[0] + "?" + f
  }

  function b0(t, e) {
    return t.filter(r => e.includes(r)).length === t.length
  }

  function vD(t) {
    return Object.fromEntries(t.entries())
  }

  function bD(t) {
    return new Map(Object.entries(t))
  }

  function y0(t = at.FIVE_MINUTES, e) {
    const r = at.toMiliseconds(t || at.FIVE_MINUTES);
    let n, i, s;
    return {
      resolve: o => {
        s && n && (clearTimeout(s), n(o))
      },
      reject: o => {
        s && i && (clearTimeout(s), i(o))
      },
      done: () => new Promise((o, a) => {
        s = setTimeout(() => {
          a(new Error(e))
        }, r), n = o, i = a
      })
    }
  }

  function gg(t, e, r) {
    return new Promise(async (n, i) => {
      const s = setTimeout(() => i(new Error(r)), e);
      try {
        const o = await t;
        n(o)
      } catch (o) {
        i(o)
      }
      clearTimeout(s)
    })
  }

  function yD(t, e) {
    if (typeof e == "string" && e.startsWith(`${t}:`)) return e;
    if (t.toLowerCase() === "topic") {
      if (typeof e != "string") throw new Error('Value must be "string" for expirer target type: topic');
      return `topic:${e}`
    } else if (t.toLowerCase() === "id") {
      if (typeof e != "number") throw new Error('Value must be "number" for expirer target type: id');
      return `id:${e}`
    }
    throw new Error(`Unknown expirer target type: ${t}`)
  }

  function yge(t) {
    return yD("topic", t)
  }

  function _ge(t) {
    return yD("id", t)
  }

  function _D(t) {
    const [e, r] = t.split(":"), n = {
      id: void 0,
      topic: void 0
    };
    if (e === "topic" && typeof r == "string") n.topic = r;
    else if (e === "id" && Number.isInteger(Number(r))) n.id = Number(r);
    else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);
    return n
  }

  function _i(t, e) {
    return at.fromMiliseconds(Date.now() + at.toMiliseconds(t))
  }

  function Eh(t) {
    return Date.now() >= at.toMiliseconds(t)
  }

  function Tr(t, e) {
    return `${t}${e?`:${e}`:""}`
  }

  function X5(t = [], e = []) {
    return [...new Set([...t, ...e])]
  }
  async function xge({
    id: t,
    topic: e,
    wcDeepLink: r
  }) {
    var n;
    try {
      if (!r) return;
      const i = typeof r == "string" ? JSON.parse(r) : r,
        s = i?.href;
      if (typeof s != "string") return;
      const o = Cge(s, t, e),
        a = ev();
      if (a === jo.browser) {
        if (!((n = D5()) != null && n.hasFocus())) {
          console.warn("Document does not have focus, skipping deeplink.");
          return
        }
        o.startsWith("https://") || o.startsWith("http://") ? window.open(o, "_blank", "noreferrer noopener") : window.open(o, Age() ? "_blank" : "_self", "noreferrer noopener")
      } else a === jo.reactNative && typeof (global == null ? void 0 : global.Linking) < "u" && await global.Linking.openURL(o)
    } catch (i) {
      console.error(i)
    }
  }

  function Cge(t, e, r) {
    const n = `requestId=${e}&sessionTopic=${r}`;
    t.endsWith("/") && (t = t.slice(0, -1));
    let i = `${t}`;
    if (t.startsWith("https://t.me")) {
      const s = t.includes("?") ? "&startapp=" : "?startapp=";
      i = `${i}${s}${Sge(n,!0)}`
    } else i = `${i}/wc?${n}`;
    return i
  }
  async function Ege(t, e) {
    let r = "";
    try {
      if (X2() && (r = localStorage.getItem(e), r)) return r;
      r = await t.getItem(e)
    } catch (n) {
      console.error(n)
    }
    return r
  }

  function xD(t, e) {
    if (!t.includes(e)) return null;
    const r = t.split(/([&,?,=])/),
      n = r.indexOf(e);
    return r[n + 2]
  }

  function CD() {
    return typeof crypto < "u" && crypto != null && crypto.randomUUID ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu, t => {
      const e = Math.random() * 16 | 0;
      return (t === "x" ? e : e & 3 | 8).toString(16)
    })
  }

  function DC() {
    return typeof process < "u" && cge.IS_VITEST === "true"
  }

  function Age() {
    return typeof window < "u" && (!!window.TelegramWebviewProxy || !!window.Telegram || !!window.TelegramWebviewProxyProto)
  }

  function Sge(t, e = !1) {
    const r = Buffer.from(t).toString("base64");
    return e ? r.replace(/[=]/g, "") : r
  }

  function ED(t) {
    return Buffer.from(t, "base64").toString("utf-8")
  }
  var AD = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};

  function Ige(t) {
    var e = t.default;
    if (typeof e == "function") {
      var r = function () {
        return e.apply(this, arguments)
      };
      r.prototype = e.prototype
    } else r = {};
    return Object.defineProperty(r, "__esModule", {
      value: !0
    }), Object.keys(t).forEach(function (n) {
      var i = Object.getOwnPropertyDescriptor(t, n);
      Object.defineProperty(r, n, i.get ? i : {
        enumerable: !0,
        get: function () {
          return t[n]
        }
      })
    }), r
  }
  var SD = {
    exports: {}
  };
  /**
   * [js-sha3]{@link https://github.com/emn178/js-sha3}
   *
   * @version 0.8.0
   * @author Chen, Yi-Cyuan [emn178@gmail.com]
   * @copyright Chen, Yi-Cyuan 2015-2018
   * @license MIT
   */
  (function (t) {
    (function () {
      var e = "input is invalid type",
        r = "finalize already called",
        n = typeof window == "object",
        i = n ? window : {};
      i.JS_SHA3_NO_WINDOW && (n = !1);
      var s = !n && typeof self == "object",
        o = !i.JS_SHA3_NO_NODE_JS && typeof process == "object" && process.versions && process.versions.node;
      o ? i = AD : s && (i = self);
      var a = !i.JS_SHA3_NO_COMMON_JS && !0 && t.exports,
        c = !i.JS_SHA3_NO_ARRAY_BUFFER && typeof ArrayBuffer < "u",
        l = "0123456789abcdef".split(""),
        h = [31, 7936, 2031616, 520093696],
        f = [4, 1024, 262144, 67108864],
        w = [1, 256, 65536, 16777216],
        b = [6, 1536, 393216, 100663296],
        C = [0, 8, 16, 24],
        M = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648],
        N = [224, 256, 384, 512],
        $ = [128, 256],
        k = ["hex", "buffer", "arrayBuffer", "array", "digest"],
        B = {
          128: 168,
          256: 136
        };
      (i.JS_SHA3_NO_NODE_JS || !Array.isArray) && (Array.isArray = function (W) {
        return Object.prototype.toString.call(W) === "[object Array]"
      }), c && (i.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView) && (ArrayBuffer.isView = function (W) {
        return typeof W == "object" && W.buffer && W.buffer.constructor === ArrayBuffer
      });
      for (var F = function (W, X, Z) {
          return function (ee) {
            return new A(W, X, W).update(ee)[Z]()
          }
        }, D = function (W, X, Z) {
          return function (ee, ne) {
            return new A(W, X, ne).update(ee)[Z]()
          }
        }, V = function (W, X, Z) {
          return function (ee, ne, O, H) {
            return u["cshake" + W].update(ee, ne, O, H)[Z]()
          }
        }, R = function (W, X, Z) {
          return function (ee, ne, O, H) {
            return u["kmac" + W].update(ee, ne, O, H)[Z]()
          }
        }, P = function (W, X, Z, ee) {
          for (var ne = 0; ne < k.length; ++ne) {
            var O = k[ne];
            W[O] = X(Z, ee, O)
          }
          return W
        }, j = function (W, X) {
          var Z = F(W, X, "hex");
          return Z.create = function () {
            return new A(W, X, W)
          }, Z.update = function (ee) {
            return Z.create().update(ee)
          }, P(Z, F, W, X)
        }, Y = function (W, X) {
          var Z = D(W, X, "hex");
          return Z.create = function (ee) {
            return new A(W, X, ee)
          }, Z.update = function (ee, ne) {
            return Z.create(ne).update(ee)
          }, P(Z, D, W, X)
        }, U = function (W, X) {
          var Z = B[W],
            ee = V(W, X, "hex");
          return ee.create = function (ne, O, H) {
            return !O && !H ? u["shake" + W].create(ne) : new A(W, X, ne).bytepad([O, H], Z)
          }, ee.update = function (ne, O, H, Q) {
            return ee.create(O, H, Q).update(ne)
          }, P(ee, V, W, X)
        }, I = function (W, X) {
          var Z = B[W],
            ee = R(W, X, "hex");
          return ee.create = function (ne, O, H) {
            return new G(W, X, O).bytepad(["KMAC", H], Z).bytepad([ne], Z)
          }, ee.update = function (ne, O, H, Q) {
            return ee.create(ne, H, Q).update(O)
          }, P(ee, R, W, X)
        }, g = [{
          name: "keccak",
          padding: w,
          bits: N,
          createMethod: j
        }, {
          name: "sha3",
          padding: b,
          bits: N,
          createMethod: j
        }, {
          name: "shake",
          padding: h,
          bits: $,
          createMethod: Y
        }, {
          name: "cshake",
          padding: f,
          bits: $,
          createMethod: U
        }, {
          name: "kmac",
          padding: f,
          bits: $,
          createMethod: I
        }], u = {}, p = [], v = 0; v < g.length; ++v)
        for (var x = g[v], E = x.bits, S = 0; S < E.length; ++S) {
          var _ = x.name + "_" + E[S];
          if (p.push(_), u[_] = x.createMethod(E[S], x.padding), x.name !== "sha3") {
            var y = x.name + E[S];
            p.push(y), u[y] = u[_]
          }
        }

      function A(W, X, Z) {
        this.blocks = [], this.s = [], this.padding = X, this.outputBits = Z, this.reset = !0, this.finalized = !1, this.block = 0, this.start = 0, this.blockCount = 1600 - (W << 1) >> 5, this.byteCount = this.blockCount << 2, this.outputBlocks = Z >> 5, this.extraBytes = (Z & 31) >> 3;
        for (var ee = 0; ee < 50; ++ee) this.s[ee] = 0
      }
      A.prototype.update = function (W) {
        if (this.finalized) throw new Error(r);
        var X, Z = typeof W;
        if (Z !== "string") {
          if (Z === "object") {
            if (W === null) throw new Error(e);
            if (c && W.constructor === ArrayBuffer) W = new Uint8Array(W);
            else if (!Array.isArray(W) && (!c || !ArrayBuffer.isView(W))) throw new Error(e)
          } else throw new Error(e);
          X = !0
        }
        for (var ee = this.blocks, ne = this.byteCount, O = W.length, H = this.blockCount, Q = 0, de = this.s, ge, Te; Q < O;) {
          if (this.reset)
            for (this.reset = !1, ee[0] = this.block, ge = 1; ge < H + 1; ++ge) ee[ge] = 0;
          if (X)
            for (ge = this.start; Q < O && ge < ne; ++Q) ee[ge >> 2] |= W[Q] << C[ge++ & 3];
          else
            for (ge = this.start; Q < O && ge < ne; ++Q) Te = W.charCodeAt(Q), Te < 128 ? ee[ge >> 2] |= Te << C[ge++ & 3] : Te < 2048 ? (ee[ge >> 2] |= (192 | Te >> 6) << C[ge++ & 3], ee[ge >> 2] |= (128 | Te & 63) << C[ge++ & 3]) : Te < 55296 || Te >= 57344 ? (ee[ge >> 2] |= (224 | Te >> 12) << C[ge++ & 3], ee[ge >> 2] |= (128 | Te >> 6 & 63) << C[ge++ & 3], ee[ge >> 2] |= (128 | Te & 63) << C[ge++ & 3]) : (Te = 65536 + ((Te & 1023) << 10 | W.charCodeAt(++Q) & 1023), ee[ge >> 2] |= (240 | Te >> 18) << C[ge++ & 3], ee[ge >> 2] |= (128 | Te >> 12 & 63) << C[ge++ & 3], ee[ge >> 2] |= (128 | Te >> 6 & 63) << C[ge++ & 3], ee[ge >> 2] |= (128 | Te & 63) << C[ge++ & 3]);
          if (this.lastByteIndex = ge, ge >= ne) {
            for (this.start = ge - ne, this.block = ee[H], ge = 0; ge < H; ++ge) de[ge] ^= ee[ge];
            ce(de), this.reset = !0
          } else this.start = ge
        }
        return this
      }, A.prototype.encode = function (W, X) {
        var Z = W & 255,
          ee = 1,
          ne = [Z];
        for (W = W >> 8, Z = W & 255; Z > 0;) ne.unshift(Z), W = W >> 8, Z = W & 255, ++ee;
        return X ? ne.push(ee) : ne.unshift(ee), this.update(ne), ne.length
      }, A.prototype.encodeString = function (W) {
        var X, Z = typeof W;
        if (Z !== "string") {
          if (Z === "object") {
            if (W === null) throw new Error(e);
            if (c && W.constructor === ArrayBuffer) W = new Uint8Array(W);
            else if (!Array.isArray(W) && (!c || !ArrayBuffer.isView(W))) throw new Error(e)
          } else throw new Error(e);
          X = !0
        }
        var ee = 0,
          ne = W.length;
        if (X) ee = ne;
        else
          for (var O = 0; O < W.length; ++O) {
            var H = W.charCodeAt(O);
            H < 128 ? ee += 1 : H < 2048 ? ee += 2 : H < 55296 || H >= 57344 ? ee += 3 : (H = 65536 + ((H & 1023) << 10 | W.charCodeAt(++O) & 1023), ee += 4)
          }
        return ee += this.encode(ee * 8), this.update(W), ee
      }, A.prototype.bytepad = function (W, X) {
        for (var Z = this.encode(X), ee = 0; ee < W.length; ++ee) Z += this.encodeString(W[ee]);
        var ne = X - Z % X,
          O = [];
        return O.length = ne, this.update(O), this
      }, A.prototype.finalize = function () {
        if (!this.finalized) {
          this.finalized = !0;
          var W = this.blocks,
            X = this.lastByteIndex,
            Z = this.blockCount,
            ee = this.s;
          if (W[X >> 2] |= this.padding[X & 3], this.lastByteIndex === this.byteCount)
            for (W[0] = W[Z], X = 1; X < Z + 1; ++X) W[X] = 0;
          for (W[Z - 1] |= 2147483648, X = 0; X < Z; ++X) ee[X] ^= W[X];
          ce(ee)
        }
      }, A.prototype.toString = A.prototype.hex = function () {
        this.finalize();
        for (var W = this.blockCount, X = this.s, Z = this.outputBlocks, ee = this.extraBytes, ne = 0, O = 0, H = "", Q; O < Z;) {
          for (ne = 0; ne < W && O < Z; ++ne, ++O) Q = X[ne], H += l[Q >> 4 & 15] + l[Q & 15] + l[Q >> 12 & 15] + l[Q >> 8 & 15] + l[Q >> 20 & 15] + l[Q >> 16 & 15] + l[Q >> 28 & 15] + l[Q >> 24 & 15];
          O % W === 0 && (ce(X), ne = 0)
        }
        return ee && (Q = X[ne], H += l[Q >> 4 & 15] + l[Q & 15], ee > 1 && (H += l[Q >> 12 & 15] + l[Q >> 8 & 15]), ee > 2 && (H += l[Q >> 20 & 15] + l[Q >> 16 & 15])), H
      }, A.prototype.arrayBuffer = function () {
        this.finalize();
        var W = this.blockCount,
          X = this.s,
          Z = this.outputBlocks,
          ee = this.extraBytes,
          ne = 0,
          O = 0,
          H = this.outputBits >> 3,
          Q;
        ee ? Q = new ArrayBuffer(Z + 1 << 2) : Q = new ArrayBuffer(H);
        for (var de = new Uint32Array(Q); O < Z;) {
          for (ne = 0; ne < W && O < Z; ++ne, ++O) de[O] = X[ne];
          O % W === 0 && ce(X)
        }
        return ee && (de[ne] = X[ne], Q = Q.slice(0, H)), Q
      }, A.prototype.buffer = A.prototype.arrayBuffer, A.prototype.digest = A.prototype.array = function () {
        this.finalize();
        for (var W = this.blockCount, X = this.s, Z = this.outputBlocks, ee = this.extraBytes, ne = 0, O = 0, H = [], Q, de; O < Z;) {
          for (ne = 0; ne < W && O < Z; ++ne, ++O) Q = O << 2, de = X[ne], H[Q] = de & 255, H[Q + 1] = de >> 8 & 255, H[Q + 2] = de >> 16 & 255, H[Q + 3] = de >> 24 & 255;
          O % W === 0 && ce(X)
        }
        return ee && (Q = O << 2, de = X[ne], H[Q] = de & 255, ee > 1 && (H[Q + 1] = de >> 8 & 255), ee > 2 && (H[Q + 2] = de >> 16 & 255)), H
      };

      function G(W, X, Z) {
        A.call(this, W, X, Z)
      }
      G.prototype = new A, G.prototype.finalize = function () {
        return this.encode(this.outputBits, !0), A.prototype.finalize.call(this)
      };
      var ce = function (W) {
        var X, Z, ee, ne, O, H, Q, de, ge, Te, Oe, De, et, rt, Ze, qe, He, we, xe, Ie, Pe, J, L, z, ie, ue, me, be, Le, ze, Qe, Xe, Je, kt, Ut, Ft, Wt, pt, ct, gt, mt, ht, lt, xt, Ct, wt, Et, vt, yt, bt, st, At, St, Gt, Zt, Yt, Pt, br, Nn, Mn, Pn, $n, tn;
        for (ee = 0; ee < 48; ee += 2) ne = W[0] ^ W[10] ^ W[20] ^ W[30] ^ W[40], O = W[1] ^ W[11] ^ W[21] ^ W[31] ^ W[41], H = W[2] ^ W[12] ^ W[22] ^ W[32] ^ W[42], Q = W[3] ^ W[13] ^ W[23] ^ W[33] ^ W[43], de = W[4] ^ W[14] ^ W[24] ^ W[34] ^ W[44], ge = W[5] ^ W[15] ^ W[25] ^ W[35] ^ W[45], Te = W[6] ^ W[16] ^ W[26] ^ W[36] ^ W[46], Oe = W[7] ^ W[17] ^ W[27] ^ W[37] ^ W[47], De = W[8] ^ W[18] ^ W[28] ^ W[38] ^ W[48], et = W[9] ^ W[19] ^ W[29] ^ W[39] ^ W[49], X = De ^ (H << 1 | Q >>> 31), Z = et ^ (Q << 1 | H >>> 31), W[0] ^= X, W[1] ^= Z, W[10] ^= X, W[11] ^= Z, W[20] ^= X, W[21] ^= Z, W[30] ^= X, W[31] ^= Z, W[40] ^= X, W[41] ^= Z, X = ne ^ (de << 1 | ge >>> 31), Z = O ^ (ge << 1 | de >>> 31), W[2] ^= X, W[3] ^= Z, W[12] ^= X, W[13] ^= Z, W[22] ^= X, W[23] ^= Z, W[32] ^= X, W[33] ^= Z, W[42] ^= X, W[43] ^= Z, X = H ^ (Te << 1 | Oe >>> 31), Z = Q ^ (Oe << 1 | Te >>> 31), W[4] ^= X, W[5] ^= Z, W[14] ^= X, W[15] ^= Z, W[24] ^= X, W[25] ^= Z, W[34] ^= X, W[35] ^= Z, W[44] ^= X, W[45] ^= Z, X = de ^ (De << 1 | et >>> 31), Z = ge ^ (et << 1 | De >>> 31), W[6] ^= X, W[7] ^= Z, W[16] ^= X, W[17] ^= Z, W[26] ^= X, W[27] ^= Z, W[36] ^= X, W[37] ^= Z, W[46] ^= X, W[47] ^= Z, X = Te ^ (ne << 1 | O >>> 31), Z = Oe ^ (O << 1 | ne >>> 31), W[8] ^= X, W[9] ^= Z, W[18] ^= X, W[19] ^= Z, W[28] ^= X, W[29] ^= Z, W[38] ^= X, W[39] ^= Z, W[48] ^= X, W[49] ^= Z, rt = W[0], Ze = W[1], wt = W[11] << 4 | W[10] >>> 28, Et = W[10] << 4 | W[11] >>> 28, be = W[20] << 3 | W[21] >>> 29, Le = W[21] << 3 | W[20] >>> 29, Mn = W[31] << 9 | W[30] >>> 23, Pn = W[30] << 9 | W[31] >>> 23, ht = W[40] << 18 | W[41] >>> 14, lt = W[41] << 18 | W[40] >>> 14, kt = W[2] << 1 | W[3] >>> 31, Ut = W[3] << 1 | W[2] >>> 31, qe = W[13] << 12 | W[12] >>> 20, He = W[12] << 12 | W[13] >>> 20, vt = W[22] << 10 | W[23] >>> 22, yt = W[23] << 10 | W[22] >>> 22, ze = W[33] << 13 | W[32] >>> 19, Qe = W[32] << 13 | W[33] >>> 19, $n = W[42] << 2 | W[43] >>> 30, tn = W[43] << 2 | W[42] >>> 30, Gt = W[5] << 30 | W[4] >>> 2, Zt = W[4] << 30 | W[5] >>> 2, Ft = W[14] << 6 | W[15] >>> 26, Wt = W[15] << 6 | W[14] >>> 26, we = W[25] << 11 | W[24] >>> 21, xe = W[24] << 11 | W[25] >>> 21, bt = W[34] << 15 | W[35] >>> 17, st = W[35] << 15 | W[34] >>> 17, Xe = W[45] << 29 | W[44] >>> 3, Je = W[44] << 29 | W[45] >>> 3, z = W[6] << 28 | W[7] >>> 4, ie = W[7] << 28 | W[6] >>> 4, Yt = W[17] << 23 | W[16] >>> 9, Pt = W[16] << 23 | W[17] >>> 9, pt = W[26] << 25 | W[27] >>> 7, ct = W[27] << 25 | W[26] >>> 7, Ie = W[36] << 21 | W[37] >>> 11, Pe = W[37] << 21 | W[36] >>> 11, At = W[47] << 24 | W[46] >>> 8, St = W[46] << 24 | W[47] >>> 8, xt = W[8] << 27 | W[9] >>> 5, Ct = W[9] << 27 | W[8] >>> 5, ue = W[18] << 20 | W[19] >>> 12, me = W[19] << 20 | W[18] >>> 12, br = W[29] << 7 | W[28] >>> 25, Nn = W[28] << 7 | W[29] >>> 25, gt = W[38] << 8 | W[39] >>> 24, mt = W[39] << 8 | W[38] >>> 24, J = W[48] << 14 | W[49] >>> 18, L = W[49] << 14 | W[48] >>> 18, W[0] = rt ^ ~qe & we, W[1] = Ze ^ ~He & xe, W[10] = z ^ ~ue & be, W[11] = ie ^ ~me & Le, W[20] = kt ^ ~Ft & pt, W[21] = Ut ^ ~Wt & ct, W[30] = xt ^ ~wt & vt, W[31] = Ct ^ ~Et & yt, W[40] = Gt ^ ~Yt & br, W[41] = Zt ^ ~Pt & Nn, W[2] = qe ^ ~we & Ie, W[3] = He ^ ~xe & Pe, W[12] = ue ^ ~be & ze, W[13] = me ^ ~Le & Qe, W[22] = Ft ^ ~pt & gt, W[23] = Wt ^ ~ct & mt, W[32] = wt ^ ~vt & bt, W[33] = Et ^ ~yt & st, W[42] = Yt ^ ~br & Mn, W[43] = Pt ^ ~Nn & Pn, W[4] = we ^ ~Ie & J, W[5] = xe ^ ~Pe & L, W[14] = be ^ ~ze & Xe, W[15] = Le ^ ~Qe & Je, W[24] = pt ^ ~gt & ht, W[25] = ct ^ ~mt & lt, W[34] = vt ^ ~bt & At, W[35] = yt ^ ~st & St, W[44] = br ^ ~Mn & $n, W[45] = Nn ^ ~Pn & tn, W[6] = Ie ^ ~J & rt, W[7] = Pe ^ ~L & Ze, W[16] = ze ^ ~Xe & z, W[17] = Qe ^ ~Je & ie, W[26] = gt ^ ~ht & kt, W[27] = mt ^ ~lt & Ut, W[36] = bt ^ ~At & xt, W[37] = st ^ ~St & Ct, W[46] = Mn ^ ~$n & Gt, W[47] = Pn ^ ~tn & Zt, W[8] = J ^ ~rt & qe, W[9] = L ^ ~Ze & He, W[18] = Xe ^ ~z & ue, W[19] = Je ^ ~ie & me, W[28] = ht ^ ~kt & Ft, W[29] = lt ^ ~Ut & Wt, W[38] = At ^ ~xt & wt, W[39] = St ^ ~Ct & Et, W[48] = $n ^ ~Gt & Yt, W[49] = tn ^ ~Zt & Pt, W[0] ^= M[ee], W[1] ^= M[ee + 1]
      };
      if (a) t.exports = u;
      else
        for (v = 0; v < p.length; ++v) i[p[v]] = u[p[v]]
    })()
  })(SD);
  var Tge = SD.exports;
  const kge = "logger/5.7.0";
  let ID = !1,
    TD = !1;
  const e4 = {
    debug: 1,
    default: 2,
    info: 2,
    warning: 3,
    error: 4,
    off: 5
  };
  let kD = e4.default,
    LC = null;

  function Rge() {
    try {
      const t = [];
      if (["NFD", "NFC", "NFKD", "NFKC"].forEach(e => {
          try {
            if ("test".normalize(e) !== "test") throw new Error("bad normalize")
          } catch {
            t.push(e)
          }
        }), t.length) throw new Error("missing " + t.join(", "));
      if ("é".normalize("NFD") !== "é") throw new Error("broken implementation")
    } catch (t) {
      return t.message
    }
    return null
  }
  const RD = Rge();
  var BC;
  (function (t) {
    t.DEBUG = "DEBUG", t.INFO = "INFO", t.WARNING = "WARNING", t.ERROR = "ERROR", t.OFF = "OFF"
  })(BC || (BC = {}));
  var vc;
  (function (t) {
    t.UNKNOWN_ERROR = "UNKNOWN_ERROR", t.NOT_IMPLEMENTED = "NOT_IMPLEMENTED", t.UNSUPPORTED_OPERATION = "UNSUPPORTED_OPERATION", t.NETWORK_ERROR = "NETWORK_ERROR", t.SERVER_ERROR = "SERVER_ERROR", t.TIMEOUT = "TIMEOUT", t.BUFFER_OVERRUN = "BUFFER_OVERRUN", t.NUMERIC_FAULT = "NUMERIC_FAULT", t.MISSING_NEW = "MISSING_NEW", t.INVALID_ARGUMENT = "INVALID_ARGUMENT", t.MISSING_ARGUMENT = "MISSING_ARGUMENT", t.UNEXPECTED_ARGUMENT = "UNEXPECTED_ARGUMENT", t.CALL_EXCEPTION = "CALL_EXCEPTION", t.INSUFFICIENT_FUNDS = "INSUFFICIENT_FUNDS", t.NONCE_EXPIRED = "NONCE_EXPIRED", t.REPLACEMENT_UNDERPRICED = "REPLACEMENT_UNDERPRICED", t.UNPREDICTABLE_GAS_LIMIT = "UNPREDICTABLE_GAS_LIMIT", t.TRANSACTION_REPLACED = "TRANSACTION_REPLACED", t.ACTION_REJECTED = "ACTION_REJECTED"
  })(vc || (vc = {}));
  const ND = "0123456789abcdef";
  let is = class Mi {
    constructor(e) {
      Object.defineProperty(this, "version", {
        enumerable: !0,
        value: e,
        writable: !1
      })
    }
    _log(e, r) {
      const n = e.toLowerCase();
      e4[n] == null && this.throwArgumentError("invalid log level name", "logLevel", e), !(kD > e4[n]) && console.log.apply(console, r)
    }
    debug(...e) {
      this._log(Mi.levels.DEBUG, e)
    }
    info(...e) {
      this._log(Mi.levels.INFO, e)
    }
    warn(...e) {
      this._log(Mi.levels.WARNING, e)
    }
    makeError(e, r, n) {
      if (TD) return this.makeError("censored error", r, {});
      r || (r = Mi.errors.UNKNOWN_ERROR), n || (n = {});
      const i = [];
      Object.keys(n).forEach(c => {
        const l = n[c];
        try {
          if (l instanceof Uint8Array) {
            let h = "";
            for (let f = 0; f < l.length; f++) h += ND[l[f] >> 4], h += ND[l[f] & 15];
            i.push(c + "=Uint8Array(0x" + h + ")")
          } else i.push(c + "=" + JSON.stringify(l))
        } catch {
          i.push(c + "=" + JSON.stringify(n[c].toString()))
        }
      }), i.push(`code=${r}`), i.push(`version=${this.version}`);
      const s = e;
      let o = "";
      switch (r) {
        case vc.NUMERIC_FAULT: {
          o = "NUMERIC_FAULT";
          const c = e;
          switch (c) {
            case "overflow":
            case "underflow":
            case "division-by-zero":
              o += "-" + c;
              break;
            case "negative-power":
            case "negative-width":
              o += "-unsupported";
              break;
            case "unbound-bitwise-result":
              o += "-unbound-result";
              break
          }
          break
        }
        case vc.CALL_EXCEPTION:
        case vc.INSUFFICIENT_FUNDS:
        case vc.MISSING_NEW:
        case vc.NONCE_EXPIRED:
        case vc.REPLACEMENT_UNDERPRICED:
        case vc.TRANSACTION_REPLACED:
        case vc.UNPREDICTABLE_GAS_LIMIT:
          o = r;
          break
      }
      o && (e += " [ See: https://links.ethers.org/v5-errors-" + o + " ]"), i.length && (e += " (" + i.join(", ") + ")");
      const a = new Error(e);
      return a.reason = s, a.code = r, Object.keys(n).forEach(function (c) {
        a[c] = n[c]
      }), a
    }
    throwError(e, r, n) {
      throw this.makeError(e, r, n)
    }
    throwArgumentError(e, r, n) {
      return this.throwError(e, Mi.errors.INVALID_ARGUMENT, {
        argument: r,
        value: n
      })
    }
    assert(e, r, n, i) {
      e || this.throwError(r, n, i)
    }
    assertArgument(e, r, n, i) {
      e || this.throwArgumentError(r, n, i)
    }
    checkNormalize(e) {
      RD && this.throwError("platform missing String.prototype.normalize", Mi.errors.UNSUPPORTED_OPERATION, {
        operation: "String.prototype.normalize",
        form: RD
      })
    }
    checkSafeUint53(e, r) {
      typeof e == "number" && (r == null && (r = "value not safe"), (e < 0 || e >= 9007199254740991) && this.throwError(r, Mi.errors.NUMERIC_FAULT, {
        operation: "checkSafeInteger",
        fault: "out-of-safe-range",
        value: e
      }), e % 1 && this.throwError(r, Mi.errors.NUMERIC_FAULT, {
        operation: "checkSafeInteger",
        fault: "non-integer",
        value: e
      }))
    }
    checkArgumentCount(e, r, n) {
      n ? n = ": " + n : n = "", e < r && this.throwError("missing argument" + n, Mi.errors.MISSING_ARGUMENT, {
        count: e,
        expectedCount: r
      }), e > r && this.throwError("too many arguments" + n, Mi.errors.UNEXPECTED_ARGUMENT, {
        count: e,
        expectedCount: r
      })
    }
    checkNew(e, r) {
      (e === Object || e == null) && this.throwError("missing new", Mi.errors.MISSING_NEW, {
        name: r.name
      })
    }
    checkAbstract(e, r) {
      e === r ? this.throwError("cannot instantiate abstract class " + JSON.stringify(r.name) + " directly; use a sub-class", Mi.errors.UNSUPPORTED_OPERATION, {
        name: e.name,
        operation: "new"
      }) : (e === Object || e == null) && this.throwError("missing new", Mi.errors.MISSING_NEW, {
        name: r.name
      })
    }
    static globalLogger() {
      return LC || (LC = new Mi(kge)), LC
    }
    static setCensorship(e, r) {
      if (!e && r && this.globalLogger().throwError("cannot permanently disable censorship", Mi.errors.UNSUPPORTED_OPERATION, {
          operation: "setCensorship"
        }), ID) {
        if (!e) return;
        this.globalLogger().throwError("error censorship permanent", Mi.errors.UNSUPPORTED_OPERATION, {
          operation: "setCensorship"
        })
      }
      TD = !!e, ID = !!r
    }
    static setLogLevel(e) {
      const r = e4[e.toLowerCase()];
      if (r == null) {
        Mi.globalLogger().warn("invalid log level - " + e);
        return
      }
      kD = r
    }
    static from(e) {
      return new Mi(e)
    }
  };
  is.errors = vc, is.levels = BC;
  const Nge = "bytes/5.7.0",
    ii = new is(Nge);

  function MD(t) {
    return !!t.toHexString
  }

  function mg(t) {
    return t.slice || (t.slice = function () {
      const e = Array.prototype.slice.call(arguments);
      return mg(new Uint8Array(Array.prototype.slice.apply(t, e)))
    }), t
  }

  function Mge(t) {
    return Fo(t) && !(t.length % 2) || wg(t)
  }

  function PD(t) {
    return typeof t == "number" && t == t && t % 1 === 0
  }

  function wg(t) {
    if (t == null) return !1;
    if (t.constructor === Uint8Array) return !0;
    if (typeof t == "string" || !PD(t.length) || t.length < 0) return !1;
    for (let e = 0; e < t.length; e++) {
      const r = t[e];
      if (!PD(r) || r < 0 || r >= 256) return !1
    }
    return !0
  }

  function Gn(t, e) {
    if (e || (e = {}), typeof t == "number") {
      ii.checkSafeUint53(t, "invalid arrayify value");
      const r = [];
      for (; t;) r.unshift(t & 255), t = parseInt(String(t / 256));
      return r.length === 0 && r.push(0), mg(new Uint8Array(r))
    }
    if (e.allowMissingPrefix && typeof t == "string" && t.substring(0, 2) !== "0x" && (t = "0x" + t), MD(t) && (t = t.toHexString()), Fo(t)) {
      let r = t.substring(2);
      r.length % 2 && (e.hexPad === "left" ? r = "0" + r : e.hexPad === "right" ? r += "0" : ii.throwArgumentError("hex data is odd-length", "value", t));
      const n = [];
      for (let i = 0; i < r.length; i += 2) n.push(parseInt(r.substring(i, i + 2), 16));
      return mg(new Uint8Array(n))
    }
    return wg(t) ? mg(new Uint8Array(t)) : ii.throwArgumentError("invalid arrayify value", "value", t)
  }

  function Pge(t) {
    const e = t.map(i => Gn(i)),
      r = e.reduce((i, s) => i + s.length, 0),
      n = new Uint8Array(r);
    return e.reduce((i, s) => (n.set(s, i), i + s.length), 0), mg(n)
  }

  function $ge(t, e) {
    t = Gn(t), t.length > e && ii.throwArgumentError("value out of range", "value", arguments[0]);
    const r = new Uint8Array(e);
    return r.set(t, e - t.length), mg(r)
  }

  function Fo(t, e) {
    return !(typeof t != "string" || !t.match(/^0x[0-9A-Fa-f]*$/) || e && t.length !== 2 + 2 * e)
  }
  const UC = "0123456789abcdef";

  function po(t, e) {
    if (e || (e = {}), typeof t == "number") {
      ii.checkSafeUint53(t, "invalid hexlify value");
      let r = "";
      for (; t;) r = UC[t & 15] + r, t = Math.floor(t / 16);
      return r.length ? (r.length % 2 && (r = "0" + r), "0x" + r) : "0x00"
    }
    if (typeof t == "bigint") return t = t.toString(16), t.length % 2 ? "0x0" + t : "0x" + t;
    if (e.allowMissingPrefix && typeof t == "string" && t.substring(0, 2) !== "0x" && (t = "0x" + t), MD(t)) return t.toHexString();
    if (Fo(t)) return t.length % 2 && (e.hexPad === "left" ? t = "0x0" + t.substring(2) : e.hexPad === "right" ? t += "0" : ii.throwArgumentError("hex data is odd-length", "value", t)), t.toLowerCase();
    if (wg(t)) {
      let r = "0x";
      for (let n = 0; n < t.length; n++) {
        let i = t[n];
        r += UC[(i & 240) >> 4] + UC[i & 15]
      }
      return r
    }
    return ii.throwArgumentError("invalid hexlify value", "value", t)
  }

  function Oge(t) {
    if (typeof t != "string") t = po(t);
    else if (!Fo(t) || t.length % 2) return null;
    return (t.length - 2) / 2
  }

  function $D(t, e, r) {
    return typeof t != "string" ? t = po(t) : (!Fo(t) || t.length % 2) && ii.throwArgumentError("invalid hexData", "value", t), e = 2 + 2 * e, r != null ? "0x" + t.substring(e, 2 + 2 * r) : "0x" + t.substring(e)
  }

  function Sl(t, e) {
    for (typeof t != "string" ? t = po(t) : Fo(t) || ii.throwArgumentError("invalid hex string", "value", t), t.length > 2 * e + 2 && ii.throwArgumentError("value out of range", "value", arguments[1]); t.length < 2 * e + 2;) t = "0x0" + t.substring(2);
    return t
  }

  function OD(t) {
    const e = {
      r: "0x",
      s: "0x",
      _vs: "0x",
      recoveryParam: 0,
      v: 0,
      yParityAndS: "0x",
      compact: "0x"
    };
    if (Mge(t)) {
      let r = Gn(t);
      r.length === 64 ? (e.v = 27 + (r[32] >> 7), r[32] &= 127, e.r = po(r.slice(0, 32)), e.s = po(r.slice(32, 64))) : r.length === 65 ? (e.r = po(r.slice(0, 32)), e.s = po(r.slice(32, 64)), e.v = r[64]) : ii.throwArgumentError("invalid signature string", "signature", t), e.v < 27 && (e.v === 0 || e.v === 1 ? e.v += 27 : ii.throwArgumentError("signature invalid v byte", "signature", t)), e.recoveryParam = 1 - e.v % 2, e.recoveryParam && (r[32] |= 128), e._vs = po(r.slice(32, 64))
    } else {
      if (e.r = t.r, e.s = t.s, e.v = t.v, e.recoveryParam = t.recoveryParam, e._vs = t._vs, e._vs != null) {
        const i = $ge(Gn(e._vs), 32);
        e._vs = po(i);
        const s = i[0] >= 128 ? 1 : 0;
        e.recoveryParam == null ? e.recoveryParam = s : e.recoveryParam !== s && ii.throwArgumentError("signature recoveryParam mismatch _vs", "signature", t), i[0] &= 127;
        const o = po(i);
        e.s == null ? e.s = o : e.s !== o && ii.throwArgumentError("signature v mismatch _vs", "signature", t)
      }
      if (e.recoveryParam == null) e.v == null ? ii.throwArgumentError("signature missing v and recoveryParam", "signature", t) : e.v === 0 || e.v === 1 ? e.recoveryParam = e.v : e.recoveryParam = 1 - e.v % 2;
      else if (e.v == null) e.v = 27 + e.recoveryParam;
      else {
        const i = e.v === 0 || e.v === 1 ? e.v : 1 - e.v % 2;
        e.recoveryParam !== i && ii.throwArgumentError("signature recoveryParam mismatch v", "signature", t)
      }
      e.r == null || !Fo(e.r) ? ii.throwArgumentError("signature missing or invalid r", "signature", t) : e.r = Sl(e.r, 32), e.s == null || !Fo(e.s) ? ii.throwArgumentError("signature missing or invalid s", "signature", t) : e.s = Sl(e.s, 32);
      const r = Gn(e.s);
      r[0] >= 128 && ii.throwArgumentError("signature s out of range", "signature", t), e.recoveryParam && (r[0] |= 128);
      const n = po(r);
      e._vs && (Fo(e._vs) || ii.throwArgumentError("signature invalid _vs", "signature", t), e._vs = Sl(e._vs, 32)), e._vs == null ? e._vs = n : e._vs !== n && ii.throwArgumentError("signature _vs mismatch v and s", "signature", t)
    }
    return e.yParityAndS = e._vs, e.compact = e.r + e.yParityAndS.substring(2), e
  }

  function jC(t) {
    return "0x" + Tge.keccak_256(Gn(t))
  }
  var DD = {
      exports: {}
    },
    Dge = {},
    Lge = Object.freeze({
      __proto__: null,
      default: Dge
    }),
    Bge = Ige(Lge);
  (function (t) {
    (function (e, r) {
      function n(g, u) {
        if (!g) throw new Error(u || "Assertion failed")
      }

      function i(g, u) {
        g.super_ = u;
        var p = function () {};
        p.prototype = u.prototype, g.prototype = new p, g.prototype.constructor = g
      }

      function s(g, u, p) {
        if (s.isBN(g)) return g;
        this.negative = 0, this.words = null, this.length = 0, this.red = null, g !== null && ((u === "le" || u === "be") && (p = u, u = 10), this._init(g || 0, u || 10, p || "be"))
      }
      typeof e == "object" ? e.exports = s : r.BN = s, s.BN = s, s.wordSize = 26;
      var o;
      try {
        typeof window < "u" && typeof window.Buffer < "u" ? o = window.Buffer : o = Bge.Buffer
      } catch {}
      s.isBN = function (g) {
        return g instanceof s ? !0 : g !== null && typeof g == "object" && g.constructor.wordSize === s.wordSize && Array.isArray(g.words)
      }, s.max = function (g, u) {
        return g.cmp(u) > 0 ? g : u
      }, s.min = function (g, u) {
        return g.cmp(u) < 0 ? g : u
      }, s.prototype._init = function (g, u, p) {
        if (typeof g == "number") return this._initNumber(g, u, p);
        if (typeof g == "object") return this._initArray(g, u, p);
        u === "hex" && (u = 16), n(u === (u | 0) && u >= 2 && u <= 36), g = g.toString().replace(/\s+/g, "");
        var v = 0;
        g[0] === "-" && (v++, this.negative = 1), v < g.length && (u === 16 ? this._parseHex(g, v, p) : (this._parseBase(g, u, v), p === "le" && this._initArray(this.toArray(), u, p)))
      }, s.prototype._initNumber = function (g, u, p) {
        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) : (n(g < 9007199254740992), this.words = [g & 67108863, g / 67108864 & 67108863, 1], this.length = 3), p === "le" && this._initArray(this.toArray(), u, p)
      }, s.prototype._initArray = function (g, u, p) {
        if (n(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 v = 0; v < this.length; v++) this.words[v] = 0;
        var x, E, S = 0;
        if (p === "be")
          for (v = g.length - 1, x = 0; v >= 0; v -= 3) E = g[v] | g[v - 1] << 8 | g[v - 2] << 16, this.words[x] |= E << S & 67108863, this.words[x + 1] = E >>> 26 - S & 67108863, S += 24, S >= 26 && (S -= 26, x++);
        else if (p === "le")
          for (v = 0, x = 0; v < g.length; v += 3) E = g[v] | g[v + 1] << 8 | g[v + 2] << 16, this.words[x] |= E << S & 67108863, this.words[x + 1] = E >>> 26 - S & 67108863, S += 24, S >= 26 && (S -= 26, x++);
        return this._strip()
      };

      function a(g, u) {
        var p = g.charCodeAt(u);
        if (p >= 48 && p <= 57) return p - 48;
        if (p >= 65 && p <= 70) return p - 55;
        if (p >= 97 && p <= 102) return p - 87;
        n(!1, "Invalid character in " + g)
      }

      function c(g, u, p) {
        var v = a(g, p);
        return p - 1 >= u && (v |= a(g, p - 1) << 4), v
      }
      s.prototype._parseHex = function (g, u, p) {
        this.length = Math.ceil((g.length - u) / 6), this.words = new Array(this.length);
        for (var v = 0; v < this.length; v++) this.words[v] = 0;
        var x = 0,
          E = 0,
          S;
        if (p === "be")
          for (v = g.length - 1; v >= u; v -= 2) S = c(g, u, v) << x, this.words[E] |= S & 67108863, x >= 18 ? (x -= 18, E += 1, this.words[E] |= S >>> 26) : x += 8;
        else {
          var _ = g.length - u;
          for (v = _ % 2 === 0 ? u + 1 : u; v < g.length; v += 2) S = c(g, u, v) << x, this.words[E] |= S & 67108863, x >= 18 ? (x -= 18, E += 1, this.words[E] |= S >>> 26) : x += 8
        }
        this._strip()
      };

      function l(g, u, p, v) {
        for (var x = 0, E = 0, S = Math.min(g.length, p), _ = u; _ < S; _++) {
          var y = g.charCodeAt(_) - 48;
          x *= v, y >= 49 ? E = y - 49 + 10 : y >= 17 ? E = y - 17 + 10 : E = y, n(y >= 0 && E < v, "Invalid character"), x += E
        }
        return x
      }
      s.prototype._parseBase = function (g, u, p) {
        this.words = [0], this.length = 1;
        for (var v = 0, x = 1; x <= 67108863; x *= u) v++;
        v--, x = x / u | 0;
        for (var E = g.length - p, S = E % v, _ = Math.min(E, E - S) + p, y = 0, A = p; A < _; A += v) y = l(g, A, A + v, u), this.imuln(x), this.words[0] + y < 67108864 ? this.words[0] += y : this._iaddn(y);
        if (S !== 0) {
          var G = 1;
          for (y = l(g, A, g.length, u), A = 0; A < S; A++) G *= u;
          this.imuln(G), this.words[0] + y < 67108864 ? this.words[0] += y : this._iaddn(y)
        }
        this._strip()
      }, s.prototype.copy = function (g) {
        g.words = new Array(this.length);
        for (var u = 0; u < this.length; u++) g.words[u] = this.words[u];
        g.length = this.length, g.negative = this.negative, g.red = this.red
      };

      function h(g, u) {
        g.words = u.words, g.length = u.length, g.negative = u.negative, g.red = u.red
      }
      if (s.prototype._move = function (g) {
          h(g, this)
        }, s.prototype.clone = function () {
          var g = new s(null);
          return this.copy(g), g
        }, s.prototype._expand = function (g) {
          for (; this.length < g;) this.words[this.length++] = 0;
          return this
        }, s.prototype._strip = function () {
          for (; this.length > 1 && this.words[this.length - 1] === 0;) this.length--;
          return this._normSign()
        }, s.prototype._normSign = function () {
          return this.length === 1 && this.words[0] === 0 && (this.negative = 0), this
        }, typeof Symbol < "u" && typeof Symbol.for == "function") try {
        s.prototype[Symbol.for("nodejs.util.inspect.custom")] = f
      } catch {
        s.prototype.inspect = f
      } else s.prototype.inspect = f;

      function f() {
        return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">"
      }
      var w = ["", "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"],
        b = [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],
        C = [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];
      s.prototype.toString = function (g, u) {
        g = g || 10, u = u | 0 || 1;
        var p;
        if (g === 16 || g === "hex") {
          p = "";
          for (var v = 0, x = 0, E = 0; E < this.length; E++) {
            var S = this.words[E],
              _ = ((S << v | x) & 16777215).toString(16);
            x = S >>> 24 - v & 16777215, v += 2, v >= 26 && (v -= 26, E--), x !== 0 || E !== this.length - 1 ? p = w[6 - _.length] + _ + p : p = _ + p
          }
          for (x !== 0 && (p = x.toString(16) + p); p.length % u !== 0;) p = "0" + p;
          return this.negative !== 0 && (p = "-" + p), p
        }
        if (g === (g | 0) && g >= 2 && g <= 36) {
          var y = b[g],
            A = C[g];
          p = "";
          var G = this.clone();
          for (G.negative = 0; !G.isZero();) {
            var ce = G.modrn(A).toString(g);
            G = G.idivn(A), G.isZero() ? p = ce + p : p = w[y - ce.length] + ce + p
          }
          for (this.isZero() && (p = "0" + p); p.length % u !== 0;) p = "0" + p;
          return this.negative !== 0 && (p = "-" + p), p
        }
        n(!1, "Base should be between 2 and 36")
      }, s.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 && n(!1, "Number can only safely store up to 53 bits"), this.negative !== 0 ? -g : g
      }, s.prototype.toJSON = function () {
        return this.toString(16, 2)
      }, o && (s.prototype.toBuffer = function (g, u) {
        return this.toArrayLike(o, g, u)
      }), s.prototype.toArray = function (g, u) {
        return this.toArrayLike(Array, g, u)
      };
      var M = function (g, u) {
        return g.allocUnsafe ? g.allocUnsafe(u) : new g(u)
      };
      s.prototype.toArrayLike = function (g, u, p) {
        this._strip();
        var v = this.byteLength(),
          x = p || Math.max(1, v);
        n(v <= x, "byte array longer than desired length"), n(x > 0, "Requested array length <= 0");
        var E = M(g, x),
          S = u === "le" ? "LE" : "BE";
        return this["_toArrayLike" + S](E, v), E
      }, s.prototype._toArrayLikeLE = function (g, u) {
        for (var p = 0, v = 0, x = 0, E = 0; x < this.length; x++) {
          var S = this.words[x] << E | v;
          g[p++] = S & 255, p < g.length && (g[p++] = S >> 8 & 255), p < g.length && (g[p++] = S >> 16 & 255), E === 6 ? (p < g.length && (g[p++] = S >> 24 & 255), v = 0, E = 0) : (v = S >>> 24, E += 2)
        }
        if (p < g.length)
          for (g[p++] = v; p < g.length;) g[p++] = 0
      }, s.prototype._toArrayLikeBE = function (g, u) {
        for (var p = g.length - 1, v = 0, x = 0, E = 0; x < this.length; x++) {
          var S = this.words[x] << E | v;
          g[p--] = S & 255, p >= 0 && (g[p--] = S >> 8 & 255), p >= 0 && (g[p--] = S >> 16 & 255), E === 6 ? (p >= 0 && (g[p--] = S >> 24 & 255), v = 0, E = 0) : (v = S >>> 24, E += 2)
        }
        if (p >= 0)
          for (g[p--] = v; p >= 0;) g[p--] = 0
      }, Math.clz32 ? s.prototype._countBits = function (g) {
        return 32 - Math.clz32(g)
      } : s.prototype._countBits = function (g) {
        var u = g,
          p = 0;
        return u >= 4096 && (p += 13, u >>>= 13), u >= 64 && (p += 7, u >>>= 7), u >= 8 && (p += 4, u >>>= 4), u >= 2 && (p += 2, u >>>= 2), p + u
      }, s.prototype._zeroBits = function (g) {
        if (g === 0) return 26;
        var u = g,
          p = 0;
        return u & 8191 || (p += 13, u >>>= 13), u & 127 || (p += 7, u >>>= 7), u & 15 || (p += 4, u >>>= 4), u & 3 || (p += 2, u >>>= 2), u & 1 || p++, p
      }, s.prototype.bitLength = function () {
        var g = this.words[this.length - 1],
          u = this._countBits(g);
        return (this.length - 1) * 26 + u
      };

      function N(g) {
        for (var u = new Array(g.bitLength()), p = 0; p < u.length; p++) {
          var v = p / 26 | 0,
            x = p % 26;
          u[p] = g.words[v] >>> x & 1
        }
        return u
      }
      s.prototype.zeroBits = function () {
        if (this.isZero()) return 0;
        for (var g = 0, u = 0; u < this.length; u++) {
          var p = this._zeroBits(this.words[u]);
          if (g += p, p !== 26) break
        }
        return g
      }, s.prototype.byteLength = function () {
        return Math.ceil(this.bitLength() / 8)
      }, s.prototype.toTwos = function (g) {
        return this.negative !== 0 ? this.abs().inotn(g).iaddn(1) : this.clone()
      }, s.prototype.fromTwos = function (g) {
        return this.testn(g - 1) ? this.notn(g).iaddn(1).ineg() : this.clone()
      }, s.prototype.isNeg = function () {
        return this.negative !== 0
      }, s.prototype.neg = function () {
        return this.clone().ineg()
      }, s.prototype.ineg = function () {
        return this.isZero() || (this.negative ^= 1), this
      }, s.prototype.iuor = function (g) {
        for (; this.length < g.length;) this.words[this.length++] = 0;
        for (var u = 0; u < g.length; u++) this.words[u] = this.words[u] | g.words[u];
        return this._strip()
      }, s.prototype.ior = function (g) {
        return n((this.negative | g.negative) === 0), this.iuor(g)
      }, s.prototype.or = function (g) {
        return this.length > g.length ? this.clone().ior(g) : g.clone().ior(this)
      }, s.prototype.uor = function (g) {
        return this.length > g.length ? this.clone().iuor(g) : g.clone().iuor(this)
      }, s.prototype.iuand = function (g) {
        var u;
        this.length > g.length ? u = g : u = this;
        for (var p = 0; p < u.length; p++) this.words[p] = this.words[p] & g.words[p];
        return this.length = u.length, this._strip()
      }, s.prototype.iand = function (g) {
        return n((this.negative | g.negative) === 0), this.iuand(g)
      }, s.prototype.and = function (g) {
        return this.length > g.length ? this.clone().iand(g) : g.clone().iand(this)
      }, s.prototype.uand = function (g) {
        return this.length > g.length ? this.clone().iuand(g) : g.clone().iuand(this)
      }, s.prototype.iuxor = function (g) {
        var u, p;
        this.length > g.length ? (u = this, p = g) : (u = g, p = this);
        for (var v = 0; v < p.length; v++) this.words[v] = u.words[v] ^ p.words[v];
        if (this !== u)
          for (; v < u.length; v++) this.words[v] = u.words[v];
        return this.length = u.length, this._strip()
      }, s.prototype.ixor = function (g) {
        return n((this.negative | g.negative) === 0), this.iuxor(g)
      }, s.prototype.xor = function (g) {
        return this.length > g.length ? this.clone().ixor(g) : g.clone().ixor(this)
      }, s.prototype.uxor = function (g) {
        return this.length > g.length ? this.clone().iuxor(g) : g.clone().iuxor(this)
      }, s.prototype.inotn = function (g) {
        n(typeof g == "number" && g >= 0);
        var u = Math.ceil(g / 26) | 0,
          p = g % 26;
        this._expand(u), p > 0 && u--;
        for (var v = 0; v < u; v++) this.words[v] = ~this.words[v] & 67108863;
        return p > 0 && (this.words[v] = ~this.words[v] & 67108863 >> 26 - p), this._strip()
      }, s.prototype.notn = function (g) {
        return this.clone().inotn(g)
      }, s.prototype.setn = function (g, u) {
        n(typeof g == "number" && g >= 0);
        var p = g / 26 | 0,
          v = g % 26;
        return this._expand(p + 1), u ? this.words[p] = this.words[p] | 1 << v : this.words[p] = this.words[p] & ~(1 << v), this._strip()
      }, s.prototype.iadd = function (g) {
        var u;
        if (this.negative !== 0 && g.negative === 0) return this.negative = 0, u = this.isub(g), this.negative ^= 1, this._normSign();
        if (this.negative === 0 && g.negative !== 0) return g.negative = 0, u = this.isub(g), g.negative = 1, u._normSign();
        var p, v;
        this.length > g.length ? (p = this, v = g) : (p = g, v = this);
        for (var x = 0, E = 0; E < v.length; E++) u = (p.words[E] | 0) + (v.words[E] | 0) + x, this.words[E] = u & 67108863, x = u >>> 26;
        for (; x !== 0 && E < p.length; E++) u = (p.words[E] | 0) + x, this.words[E] = u & 67108863, x = u >>> 26;
        if (this.length = p.length, x !== 0) this.words[this.length] = x, this.length++;
        else if (p !== this)
          for (; E < p.length; E++) this.words[E] = p.words[E];
        return this
      }, s.prototype.add = function (g) {
        var u;
        return g.negative !== 0 && this.negative === 0 ? (g.negative = 0, u = this.sub(g), g.negative ^= 1, u) : g.negative === 0 && this.negative !== 0 ? (this.negative = 0, u = g.sub(this), this.negative = 1, u) : this.length > g.length ? this.clone().iadd(g) : g.clone().iadd(this)
      }, s.prototype.isub = function (g) {
        if (g.negative !== 0) {
          g.negative = 0;
          var u = this.iadd(g);
          return g.negative = 1, u._normSign()
        } else if (this.negative !== 0) return this.negative = 0, this.iadd(g), this.negative = 1, this._normSign();
        var p = this.cmp(g);
        if (p === 0) return this.negative = 0, this.length = 1, this.words[0] = 0, this;
        var v, x;
        p > 0 ? (v = this, x = g) : (v = g, x = this);
        for (var E = 0, S = 0; S < x.length; S++) u = (v.words[S] | 0) - (x.words[S] | 0) + E, E = u >> 26, this.words[S] = u & 67108863;
        for (; E !== 0 && S < v.length; S++) u = (v.words[S] | 0) + E, E = u >> 26, this.words[S] = u & 67108863;
        if (E === 0 && S < v.length && v !== this)
          for (; S < v.length; S++) this.words[S] = v.words[S];
        return this.length = Math.max(this.length, S), v !== this && (this.negative = 1), this._strip()
      }, s.prototype.sub = function (g) {
        return this.clone().isub(g)
      };

      function $(g, u, p) {
        p.negative = u.negative ^ g.negative;
        var v = g.length + u.length | 0;
        p.length = v, v = v - 1 | 0;
        var x = g.words[0] | 0,
          E = u.words[0] | 0,
          S = x * E,
          _ = S & 67108863,
          y = S / 67108864 | 0;
        p.words[0] = _;
        for (var A = 1; A < v; A++) {
          for (var G = y >>> 26, ce = y & 67108863, W = Math.min(A, u.length - 1), X = Math.max(0, A - g.length + 1); X <= W; X++) {
            var Z = A - X | 0;
            x = g.words[Z] | 0, E = u.words[X] | 0, S = x * E + ce, G += S / 67108864 | 0, ce = S & 67108863
          }
          p.words[A] = ce | 0, y = G | 0
        }
        return y !== 0 ? p.words[A] = y | 0 : p.length--, p._strip()
      }
      var k = function (g, u, p) {
        var v = g.words,
          x = u.words,
          E = p.words,
          S = 0,
          _, y, A, G = v[0] | 0,
          ce = G & 8191,
          W = G >>> 13,
          X = v[1] | 0,
          Z = X & 8191,
          ee = X >>> 13,
          ne = v[2] | 0,
          O = ne & 8191,
          H = ne >>> 13,
          Q = v[3] | 0,
          de = Q & 8191,
          ge = Q >>> 13,
          Te = v[4] | 0,
          Oe = Te & 8191,
          De = Te >>> 13,
          et = v[5] | 0,
          rt = et & 8191,
          Ze = et >>> 13,
          qe = v[6] | 0,
          He = qe & 8191,
          we = qe >>> 13,
          xe = v[7] | 0,
          Ie = xe & 8191,
          Pe = xe >>> 13,
          J = v[8] | 0,
          L = J & 8191,
          z = J >>> 13,
          ie = v[9] | 0,
          ue = ie & 8191,
          me = ie >>> 13,
          be = x[0] | 0,
          Le = be & 8191,
          ze = be >>> 13,
          Qe = x[1] | 0,
          Xe = Qe & 8191,
          Je = Qe >>> 13,
          kt = x[2] | 0,
          Ut = kt & 8191,
          Ft = kt >>> 13,
          Wt = x[3] | 0,
          pt = Wt & 8191,
          ct = Wt >>> 13,
          gt = x[4] | 0,
          mt = gt & 8191,
          ht = gt >>> 13,
          lt = x[5] | 0,
          xt = lt & 8191,
          Ct = lt >>> 13,
          wt = x[6] | 0,
          Et = wt & 8191,
          vt = wt >>> 13,
          yt = x[7] | 0,
          bt = yt & 8191,
          st = yt >>> 13,
          At = x[8] | 0,
          St = At & 8191,
          Gt = At >>> 13,
          Zt = x[9] | 0,
          Yt = Zt & 8191,
          Pt = Zt >>> 13;
        p.negative = g.negative ^ u.negative, p.length = 19, _ = Math.imul(ce, Le), y = Math.imul(ce, ze), y = y + Math.imul(W, Le) | 0, A = Math.imul(W, ze);
        var br = (S + _ | 0) + ((y & 8191) << 13) | 0;
        S = (A + (y >>> 13) | 0) + (br >>> 26) | 0, br &= 67108863, _ = Math.imul(Z, Le), y = Math.imul(Z, ze), y = y + Math.imul(ee, Le) | 0, A = Math.imul(ee, ze), _ = _ + Math.imul(ce, Xe) | 0, y = y + Math.imul(ce, Je) | 0, y = y + Math.imul(W, Xe) | 0, A = A + Math.imul(W, Je) | 0;
        var Nn = (S + _ | 0) + ((y & 8191) << 13) | 0;
        S = (A + (y >>> 13) | 0) + (Nn >>> 26) | 0, Nn &= 67108863, _ = Math.imul(O, Le), y = Math.imul(O, ze), y = y + Math.imul(H, Le) | 0, A = Math.imul(H, ze), _ = _ + Math.imul(Z, Xe) | 0, y = y + Math.imul(Z, Je) | 0, y = y + Math.imul(ee, Xe) | 0, A = A + Math.imul(ee, Je) | 0, _ = _ + Math.imul(ce, Ut) | 0, y = y + Math.imul(ce, Ft) | 0, y = y + Math.imul(W, Ut) | 0, A = A + Math.imul(W, Ft) | 0;
        var Mn = (S + _ | 0) + ((y & 8191) << 13) | 0;
        S = (A + (y >>> 13) | 0) + (Mn >>> 26) | 0, Mn &= 67108863, _ = Math.imul(de, Le), y = Math.imul(de, ze), y = y + Math.imul(ge, Le) | 0, A = Math.imul(ge, ze), _ = _ + Math.imul(O, Xe) | 0, y = y + Math.imul(O, Je) | 0, y = y + Math.imul(H, Xe) | 0, A = A + Math.imul(H, Je) | 0, _ = _ + Math.imul(Z, Ut) | 0, y = y + Math.imul(Z, Ft) | 0, y = y + Math.imul(ee, Ut) | 0, A = A + Math.imul(ee, Ft) | 0, _ = _ + Math.imul(ce, pt) | 0, y = y + Math.imul(ce, ct) | 0, y = y + Math.imul(W, pt) | 0, A = A + Math.imul(W, ct) | 0;
        var Pn = (S + _ | 0) + ((y & 8191) << 13) | 0;
        S = (A + (y >>> 13) | 0) + (Pn >>> 26) | 0, Pn &= 67108863, _ = Math.imul(Oe, Le), y = Math.imul(Oe, ze), y = y + Math.imul(De, Le) | 0, A = Math.imul(De, ze), _ = _ + Math.imul(de, Xe) | 0, y = y + Math.imul(de, Je) | 0, y = y + Math.imul(ge, Xe) | 0, A = A + Math.imul(ge, Je) | 0, _ = _ + Math.imul(O, Ut) | 0, y = y + Math.imul(O, Ft) | 0, y = y + Math.imul(H, Ut) | 0, A = A + Math.imul(H, Ft) | 0, _ = _ + Math.imul(Z, pt) | 0, y = y + Math.imul(Z, ct) | 0, y = y + Math.imul(ee, pt) | 0, A = A + Math.imul(ee, ct) | 0, _ = _ + Math.imul(ce, mt) | 0, y = y + Math.imul(ce, ht) | 0, y = y + Math.imul(W, mt) | 0, A = A + Math.imul(W, ht) | 0;
        var $n = (S + _ | 0) + ((y & 8191) << 13) | 0;
        S = (A + (y >>> 13) | 0) + ($n >>> 26) | 0, $n &= 67108863, _ = Math.imul(rt, Le), y = Math.imul(rt, ze), y = y + Math.imul(Ze, Le) | 0, A = Math.imul(Ze, ze), _ = _ + Math.imul(Oe, Xe) | 0, y = y + Math.imul(Oe, Je) | 0, y = y + Math.imul(De, Xe) | 0, A = A + Math.imul(De, Je) | 0, _ = _ + Math.imul(de, Ut) | 0, y = y + Math.imul(de, Ft) | 0, y = y + Math.imul(ge, Ut) | 0, A = A + Math.imul(ge, Ft) | 0, _ = _ + Math.imul(O, pt) | 0, y = y + Math.imul(O, ct) | 0, y = y + Math.imul(H, pt) | 0, A = A + Math.imul(H, ct) | 0, _ = _ + Math.imul(Z, mt) | 0, y = y + Math.imul(Z, ht) | 0, y = y + Math.imul(ee, mt) | 0, A = A + Math.imul(ee, ht) | 0, _ = _ + Math.imul(ce, xt) | 0, y = y + Math.imul(ce, Ct) | 0, y = y + Math.imul(W, xt) | 0, A = A + Math.imul(W, Ct) | 0;
        var tn = (S + _ | 0) + ((y & 8191) << 13) | 0;
        S = (A + (y >>> 13) | 0) + (tn >>> 26) | 0, tn &= 67108863, _ = Math.imul(He, Le), y = Math.imul(He, ze), y = y + Math.imul(we, Le) | 0, A = Math.imul(we, ze), _ = _ + Math.imul(rt, Xe) | 0, y = y + Math.imul(rt, Je) | 0, y = y + Math.imul(Ze, Xe) | 0, A = A + Math.imul(Ze, Je) | 0, _ = _ + Math.imul(Oe, Ut) | 0, y = y + Math.imul(Oe, Ft) | 0, y = y + Math.imul(De, Ut) | 0, A = A + Math.imul(De, Ft) | 0, _ = _ + Math.imul(de, pt) | 0, y = y + Math.imul(de, ct) | 0, y = y + Math.imul(ge, pt) | 0, A = A + Math.imul(ge, ct) | 0, _ = _ + Math.imul(O, mt) | 0, y = y + Math.imul(O, ht) | 0, y = y + Math.imul(H, mt) | 0, A = A + Math.imul(H, ht) | 0, _ = _ + Math.imul(Z, xt) | 0, y = y + Math.imul(Z, Ct) | 0, y = y + Math.imul(ee, xt) | 0, A = A + Math.imul(ee, Ct) | 0, _ = _ + Math.imul(ce, Et) | 0, y = y + Math.imul(ce, vt) | 0, y = y + Math.imul(W, Et) | 0, A = A + Math.imul(W, vt) | 0;
        var Qn = (S + _ | 0) + ((y & 8191) << 13) | 0;
        S = (A + (y >>> 13) | 0) + (Qn >>> 26) | 0, Qn &= 67108863, _ = Math.imul(Ie, Le), y = Math.imul(Ie, ze), y = y + Math.imul(Pe, Le) | 0, A = Math.imul(Pe, ze), _ = _ + Math.imul(He, Xe) | 0, y = y + Math.imul(He, Je) | 0, y = y + Math.imul(we, Xe) | 0, A = A + Math.imul(we, Je) | 0, _ = _ + Math.imul(rt, Ut) | 0, y = y + Math.imul(rt, Ft) | 0, y = y + Math.imul(Ze, Ut) | 0, A = A + Math.imul(Ze, Ft) | 0, _ = _ + Math.imul(Oe, pt) | 0, y = y + Math.imul(Oe, ct) | 0, y = y + Math.imul(De, pt) | 0, A = A + Math.imul(De, ct) | 0, _ = _ + Math.imul(de, mt) | 0, y = y + Math.imul(de, ht) | 0, y = y + Math.imul(ge, mt) | 0, A = A + Math.imul(ge, ht) | 0, _ = _ + Math.imul(O, xt) | 0, y = y + Math.imul(O, Ct) | 0, y = y + Math.imul(H, xt) | 0, A = A + Math.imul(H, Ct) | 0, _ = _ + Math.imul(Z, Et) | 0, y = y + Math.imul(Z, vt) | 0, y = y + Math.imul(ee, Et) | 0, A = A + Math.imul(ee, vt) | 0, _ = _ + Math.imul(ce, bt) | 0, y = y + Math.imul(ce, st) | 0, y = y + Math.imul(W, bt) | 0, A = A + Math.imul(W, st) | 0;
        var Ii = (S + _ | 0) + ((y & 8191) << 13) | 0;
        S = (A + (y >>> 13) | 0) + (Ii >>> 26) | 0, Ii &= 67108863, _ = Math.imul(L, Le), y = Math.imul(L, ze), y = y + Math.imul(z, Le) | 0, A = Math.imul(z, ze), _ = _ + Math.imul(Ie, Xe) | 0, y = y + Math.imul(Ie, Je) | 0, y = y + Math.imul(Pe, Xe) | 0, A = A + Math.imul(Pe, Je) | 0, _ = _ + Math.imul(He, Ut) | 0, y = y + Math.imul(He, Ft) | 0, y = y + Math.imul(we, Ut) | 0, A = A + Math.imul(we, Ft) | 0, _ = _ + Math.imul(rt, pt) | 0, y = y + Math.imul(rt, ct) | 0, y = y + Math.imul(Ze, pt) | 0, A = A + Math.imul(Ze, ct) | 0, _ = _ + Math.imul(Oe, mt) | 0, y = y + Math.imul(Oe, ht) | 0, y = y + Math.imul(De, mt) | 0, A = A + Math.imul(De, ht) | 0, _ = _ + Math.imul(de, xt) | 0, y = y + Math.imul(de, Ct) | 0, y = y + Math.imul(ge, xt) | 0, A = A + Math.imul(ge, Ct) | 0, _ = _ + Math.imul(O, Et) | 0, y = y + Math.imul(O, vt) | 0, y = y + Math.imul(H, Et) | 0, A = A + Math.imul(H, vt) | 0, _ = _ + Math.imul(Z, bt) | 0, y = y + Math.imul(Z, st) | 0, y = y + Math.imul(ee, bt) | 0, A = A + Math.imul(ee, st) | 0, _ = _ + Math.imul(ce, St) | 0, y = y + Math.imul(ce, Gt) | 0, y = y + Math.imul(W, St) | 0, A = A + Math.imul(W, Gt) | 0;
        var Jn = (S + _ | 0) + ((y & 8191) << 13) | 0;
        S = (A + (y >>> 13) | 0) + (Jn >>> 26) | 0, Jn &= 67108863, _ = Math.imul(ue, Le), y = Math.imul(ue, ze), y = y + Math.imul(me, Le) | 0, A = Math.imul(me, ze), _ = _ + Math.imul(L, Xe) | 0, y = y + Math.imul(L, Je) | 0, y = y + Math.imul(z, Xe) | 0, A = A + Math.imul(z, Je) | 0, _ = _ + Math.imul(Ie, Ut) | 0, y = y + Math.imul(Ie, Ft) | 0, y = y + Math.imul(Pe, Ut) | 0, A = A + Math.imul(Pe, Ft) | 0, _ = _ + Math.imul(He, pt) | 0, y = y + Math.imul(He, ct) | 0, y = y + Math.imul(we, pt) | 0, A = A + Math.imul(we, ct) | 0, _ = _ + Math.imul(rt, mt) | 0, y = y + Math.imul(rt, ht) | 0, y = y + Math.imul(Ze, mt) | 0, A = A + Math.imul(Ze, ht) | 0, _ = _ + Math.imul(Oe, xt) | 0, y = y + Math.imul(Oe, Ct) | 0, y = y + Math.imul(De, xt) | 0, A = A + Math.imul(De, Ct) | 0, _ = _ + Math.imul(de, Et) | 0, y = y + Math.imul(de, vt) | 0, y = y + Math.imul(ge, Et) | 0, A = A + Math.imul(ge, vt) | 0, _ = _ + Math.imul(O, bt) | 0, y = y + Math.imul(O, st) | 0, y = y + Math.imul(H, bt) | 0, A = A + Math.imul(H, st) | 0, _ = _ + Math.imul(Z, St) | 0, y = y + Math.imul(Z, Gt) | 0, y = y + Math.imul(ee, St) | 0, A = A + Math.imul(ee, Gt) | 0, _ = _ + Math.imul(ce, Yt) | 0, y = y + Math.imul(ce, Pt) | 0, y = y + Math.imul(W, Yt) | 0, A = A + Math.imul(W, Pt) | 0;
        var Ti = (S + _ | 0) + ((y & 8191) << 13) | 0;
        S = (A + (y >>> 13) | 0) + (Ti >>> 26) | 0, Ti &= 67108863, _ = Math.imul(ue, Xe), y = Math.imul(ue, Je), y = y + Math.imul(me, Xe) | 0, A = Math.imul(me, Je), _ = _ + Math.imul(L, Ut) | 0, y = y + Math.imul(L, Ft) | 0, y = y + Math.imul(z, Ut) | 0, A = A + Math.imul(z, Ft) | 0, _ = _ + Math.imul(Ie, pt) | 0, y = y + Math.imul(Ie, ct) | 0, y = y + Math.imul(Pe, pt) | 0, A = A + Math.imul(Pe, ct) | 0, _ = _ + Math.imul(He, mt) | 0, y = y + Math.imul(He, ht) | 0, y = y + Math.imul(we, mt) | 0, A = A + Math.imul(we, ht) | 0, _ = _ + Math.imul(rt, xt) | 0, y = y + Math.imul(rt, Ct) | 0, y = y + Math.imul(Ze, xt) | 0, A = A + Math.imul(Ze, Ct) | 0, _ = _ + Math.imul(Oe, Et) | 0, y = y + Math.imul(Oe, vt) | 0, y = y + Math.imul(De, Et) | 0, A = A + Math.imul(De, vt) | 0, _ = _ + Math.imul(de, bt) | 0, y = y + Math.imul(de, st) | 0, y = y + Math.imul(ge, bt) | 0, A = A + Math.imul(ge, st) | 0, _ = _ + Math.imul(O, St) | 0, y = y + Math.imul(O, Gt) | 0, y = y + Math.imul(H, St) | 0, A = A + Math.imul(H, Gt) | 0, _ = _ + Math.imul(Z, Yt) | 0, y = y + Math.imul(Z, Pt) | 0, y = y + Math.imul(ee, Yt) | 0, A = A + Math.imul(ee, Pt) | 0;
        var ki = (S + _ | 0) + ((y & 8191) << 13) | 0;
        S = (A + (y >>> 13) | 0) + (ki >>> 26) | 0, ki &= 67108863, _ = Math.imul(ue, Ut), y = Math.imul(ue, Ft), y = y + Math.imul(me, Ut) | 0, A = Math.imul(me, Ft), _ = _ + Math.imul(L, pt) | 0, y = y + Math.imul(L, ct) | 0, y = y + Math.imul(z, pt) | 0, A = A + Math.imul(z, ct) | 0, _ = _ + Math.imul(Ie, mt) | 0, y = y + Math.imul(Ie, ht) | 0, y = y + Math.imul(Pe, mt) | 0, A = A + Math.imul(Pe, ht) | 0, _ = _ + Math.imul(He, xt) | 0, y = y + Math.imul(He, Ct) | 0, y = y + Math.imul(we, xt) | 0, A = A + Math.imul(we, Ct) | 0, _ = _ + Math.imul(rt, Et) | 0, y = y + Math.imul(rt, vt) | 0, y = y + Math.imul(Ze, Et) | 0, A = A + Math.imul(Ze, vt) | 0, _ = _ + Math.imul(Oe, bt) | 0, y = y + Math.imul(Oe, st) | 0, y = y + Math.imul(De, bt) | 0, A = A + Math.imul(De, st) | 0, _ = _ + Math.imul(de, St) | 0, y = y + Math.imul(de, Gt) | 0, y = y + Math.imul(ge, St) | 0, A = A + Math.imul(ge, Gt) | 0, _ = _ + Math.imul(O, Yt) | 0, y = y + Math.imul(O, Pt) | 0, y = y + Math.imul(H, Yt) | 0, A = A + Math.imul(H, Pt) | 0;
        var Xn = (S + _ | 0) + ((y & 8191) << 13) | 0;
        S = (A + (y >>> 13) | 0) + (Xn >>> 26) | 0, Xn &= 67108863, _ = Math.imul(ue, pt), y = Math.imul(ue, ct), y = y + Math.imul(me, pt) | 0, A = Math.imul(me, ct), _ = _ + Math.imul(L, mt) | 0, y = y + Math.imul(L, ht) | 0, y = y + Math.imul(z, mt) | 0, A = A + Math.imul(z, ht) | 0, _ = _ + Math.imul(Ie, xt) | 0, y = y + Math.imul(Ie, Ct) | 0, y = y + Math.imul(Pe, xt) | 0, A = A + Math.imul(Pe, Ct) | 0, _ = _ + Math.imul(He, Et) | 0, y = y + Math.imul(He, vt) | 0, y = y + Math.imul(we, Et) | 0, A = A + Math.imul(we, vt) | 0, _ = _ + Math.imul(rt, bt) | 0, y = y + Math.imul(rt, st) | 0, y = y + Math.imul(Ze, bt) | 0, A = A + Math.imul(Ze, st) | 0, _ = _ + Math.imul(Oe, St) | 0, y = y + Math.imul(Oe, Gt) | 0, y = y + Math.imul(De, St) | 0, A = A + Math.imul(De, Gt) | 0, _ = _ + Math.imul(de, Yt) | 0, y = y + Math.imul(de, Pt) | 0, y = y + Math.imul(ge, Yt) | 0, A = A + Math.imul(ge, Pt) | 0;
        var mi = (S + _ | 0) + ((y & 8191) << 13) | 0;
        S = (A + (y >>> 13) | 0) + (mi >>> 26) | 0, mi &= 67108863, _ = Math.imul(ue, mt), y = Math.imul(ue, ht), y = y + Math.imul(me, mt) | 0, A = Math.imul(me, ht), _ = _ + Math.imul(L, xt) | 0, y = y + Math.imul(L, Ct) | 0, y = y + Math.imul(z, xt) | 0, A = A + Math.imul(z, Ct) | 0, _ = _ + Math.imul(Ie, Et) | 0, y = y + Math.imul(Ie, vt) | 0, y = y + Math.imul(Pe, Et) | 0, A = A + Math.imul(Pe, vt) | 0, _ = _ + Math.imul(He, bt) | 0, y = y + Math.imul(He, st) | 0, y = y + Math.imul(we, bt) | 0, A = A + Math.imul(we, st) | 0, _ = _ + Math.imul(rt, St) | 0, y = y + Math.imul(rt, Gt) | 0, y = y + Math.imul(Ze, St) | 0, A = A + Math.imul(Ze, Gt) | 0, _ = _ + Math.imul(Oe, Yt) | 0, y = y + Math.imul(Oe, Pt) | 0, y = y + Math.imul(De, Yt) | 0, A = A + Math.imul(De, Pt) | 0;
        var wi = (S + _ | 0) + ((y & 8191) << 13) | 0;
        S = (A + (y >>> 13) | 0) + (wi >>> 26) | 0, wi &= 67108863, _ = Math.imul(ue, xt), y = Math.imul(ue, Ct), y = y + Math.imul(me, xt) | 0, A = Math.imul(me, Ct), _ = _ + Math.imul(L, Et) | 0, y = y + Math.imul(L, vt) | 0, y = y + Math.imul(z, Et) | 0, A = A + Math.imul(z, vt) | 0, _ = _ + Math.imul(Ie, bt) | 0, y = y + Math.imul(Ie, st) | 0, y = y + Math.imul(Pe, bt) | 0, A = A + Math.imul(Pe, st) | 0, _ = _ + Math.imul(He, St) | 0, y = y + Math.imul(He, Gt) | 0, y = y + Math.imul(we, St) | 0, A = A + Math.imul(we, Gt) | 0, _ = _ + Math.imul(rt, Yt) | 0, y = y + Math.imul(rt, Pt) | 0, y = y + Math.imul(Ze, Yt) | 0, A = A + Math.imul(Ze, Pt) | 0;
        var hn = (S + _ | 0) + ((y & 8191) << 13) | 0;
        S = (A + (y >>> 13) | 0) + (hn >>> 26) | 0, hn &= 67108863, _ = Math.imul(ue, Et), y = Math.imul(ue, vt), y = y + Math.imul(me, Et) | 0, A = Math.imul(me, vt), _ = _ + Math.imul(L, bt) | 0, y = y + Math.imul(L, st) | 0, y = y + Math.imul(z, bt) | 0, A = A + Math.imul(z, st) | 0, _ = _ + Math.imul(Ie, St) | 0, y = y + Math.imul(Ie, Gt) | 0, y = y + Math.imul(Pe, St) | 0, A = A + Math.imul(Pe, Gt) | 0, _ = _ + Math.imul(He, Yt) | 0, y = y + Math.imul(He, Pt) | 0, y = y + Math.imul(we, Yt) | 0, A = A + Math.imul(we, Pt) | 0;
        var Vs = (S + _ | 0) + ((y & 8191) << 13) | 0;
        S = (A + (y >>> 13) | 0) + (Vs >>> 26) | 0, Vs &= 67108863, _ = Math.imul(ue, bt), y = Math.imul(ue, st), y = y + Math.imul(me, bt) | 0, A = Math.imul(me, st), _ = _ + Math.imul(L, St) | 0, y = y + Math.imul(L, Gt) | 0, y = y + Math.imul(z, St) | 0, A = A + Math.imul(z, Gt) | 0, _ = _ + Math.imul(Ie, Yt) | 0, y = y + Math.imul(Ie, Pt) | 0, y = y + Math.imul(Pe, Yt) | 0, A = A + Math.imul(Pe, Pt) | 0;
        var Ks = (S + _ | 0) + ((y & 8191) << 13) | 0;
        S = (A + (y >>> 13) | 0) + (Ks >>> 26) | 0, Ks &= 67108863, _ = Math.imul(ue, St), y = Math.imul(ue, Gt), y = y + Math.imul(me, St) | 0, A = Math.imul(me, Gt), _ = _ + Math.imul(L, Yt) | 0, y = y + Math.imul(L, Pt) | 0, y = y + Math.imul(z, Yt) | 0, A = A + Math.imul(z, Pt) | 0;
        var Gs = (S + _ | 0) + ((y & 8191) << 13) | 0;
        S = (A + (y >>> 13) | 0) + (Gs >>> 26) | 0, Gs &= 67108863, _ = Math.imul(ue, Yt), y = Math.imul(ue, Pt), y = y + Math.imul(me, Yt) | 0, A = Math.imul(me, Pt);
        var jc = (S + _ | 0) + ((y & 8191) << 13) | 0;
        return S = (A + (y >>> 13) | 0) + (jc >>> 26) | 0, jc &= 67108863, E[0] = br, E[1] = Nn, E[2] = Mn, E[3] = Pn, E[4] = $n, E[5] = tn, E[6] = Qn, E[7] = Ii, E[8] = Jn, E[9] = Ti, E[10] = ki, E[11] = Xn, E[12] = mi, E[13] = wi, E[14] = hn, E[15] = Vs, E[16] = Ks, E[17] = Gs, E[18] = jc, S !== 0 && (E[19] = S, p.length++), p
      };
      Math.imul || (k = $);

      function B(g, u, p) {
        p.negative = u.negative ^ g.negative, p.length = g.length + u.length;
        for (var v = 0, x = 0, E = 0; E < p.length - 1; E++) {
          var S = x;
          x = 0;
          for (var _ = v & 67108863, y = Math.min(E, u.length - 1), A = Math.max(0, E - g.length + 1); A <= y; A++) {
            var G = E - A,
              ce = g.words[G] | 0,
              W = u.words[A] | 0,
              X = ce * W,
              Z = X & 67108863;
            S = S + (X / 67108864 | 0) | 0, Z = Z + _ | 0, _ = Z & 67108863, S = S + (Z >>> 26) | 0, x += S >>> 26, S &= 67108863
          }
          p.words[E] = _, v = S, S = x
        }
        return v !== 0 ? p.words[E] = v : p.length--, p._strip()
      }

      function F(g, u, p) {
        return B(g, u, p)
      }
      s.prototype.mulTo = function (g, u) {
        var p, v = this.length + g.length;
        return this.length === 10 && g.length === 10 ? p = k(this, g, u) : v < 63 ? p = $(this, g, u) : v < 1024 ? p = B(this, g, u) : p = F(this, g, u), p
      }, s.prototype.mul = function (g) {
        var u = new s(null);
        return u.words = new Array(this.length + g.length), this.mulTo(g, u)
      }, s.prototype.mulf = function (g) {
        var u = new s(null);
        return u.words = new Array(this.length + g.length), F(this, g, u)
      }, s.prototype.imul = function (g) {
        return this.clone().mulTo(g, this)
      }, s.prototype.imuln = function (g) {
        var u = g < 0;
        u && (g = -g), n(typeof g == "number"), n(g < 67108864);
        for (var p = 0, v = 0; v < this.length; v++) {
          var x = (this.words[v] | 0) * g,
            E = (x & 67108863) + (p & 67108863);
          p >>= 26, p += x / 67108864 | 0, p += E >>> 26, this.words[v] = E & 67108863
        }
        return p !== 0 && (this.words[v] = p, this.length++), u ? this.ineg() : this
      }, s.prototype.muln = function (g) {
        return this.clone().imuln(g)
      }, s.prototype.sqr = function () {
        return this.mul(this)
      }, s.prototype.isqr = function () {
        return this.imul(this.clone())
      }, s.prototype.pow = function (g) {
        var u = N(g);
        if (u.length === 0) return new s(1);
        for (var p = this, v = 0; v < u.length && u[v] === 0; v++, p = p.sqr());
        if (++v < u.length)
          for (var x = p.sqr(); v < u.length; v++, x = x.sqr()) u[v] !== 0 && (p = p.mul(x));
        return p
      }, s.prototype.iushln = function (g) {
        n(typeof g == "number" && g >= 0);
        var u = g % 26,
          p = (g - u) / 26,
          v = 67108863 >>> 26 - u << 26 - u,
          x;
        if (u !== 0) {
          var E = 0;
          for (x = 0; x < this.length; x++) {
            var S = this.words[x] & v,
              _ = (this.words[x] | 0) - S << u;
            this.words[x] = _ | E, E = S >>> 26 - u
          }
          E && (this.words[x] = E, this.length++)
        }
        if (p !== 0) {
          for (x = this.length - 1; x >= 0; x--) this.words[x + p] = this.words[x];
          for (x = 0; x < p; x++) this.words[x] = 0;
          this.length += p
        }
        return this._strip()
      }, s.prototype.ishln = function (g) {
        return n(this.negative === 0), this.iushln(g)
      }, s.prototype.iushrn = function (g, u, p) {
        n(typeof g == "number" && g >= 0);
        var v;
        u ? v = (u - u % 26) / 26 : v = 0;
        var x = g % 26,
          E = Math.min((g - x) / 26, this.length),
          S = 67108863 ^ 67108863 >>> x << x,
          _ = p;
        if (v -= E, v = Math.max(0, v), _) {
          for (var y = 0; y < E; y++) _.words[y] = this.words[y];
          _.length = E
        }
        if (E !== 0)
          if (this.length > E)
            for (this.length -= E, y = 0; y < this.length; y++) this.words[y] = this.words[y + E];
          else this.words[0] = 0, this.length = 1;
        var A = 0;
        for (y = this.length - 1; y >= 0 && (A !== 0 || y >= v); y--) {
          var G = this.words[y] | 0;
          this.words[y] = A << 26 - x | G >>> x, A = G & S
        }
        return _ && A !== 0 && (_.words[_.length++] = A), this.length === 0 && (this.words[0] = 0, this.length = 1), this._strip()
      }, s.prototype.ishrn = function (g, u, p) {
        return n(this.negative === 0), this.iushrn(g, u, p)
      }, s.prototype.shln = function (g) {
        return this.clone().ishln(g)
      }, s.prototype.ushln = function (g) {
        return this.clone().iushln(g)
      }, s.prototype.shrn = function (g) {
        return this.clone().ishrn(g)
      }, s.prototype.ushrn = function (g) {
        return this.clone().iushrn(g)
      }, s.prototype.testn = function (g) {
        n(typeof g == "number" && g >= 0);
        var u = g % 26,
          p = (g - u) / 26,
          v = 1 << u;
        if (this.length <= p) return !1;
        var x = this.words[p];
        return !!(x & v)
      }, s.prototype.imaskn = function (g) {
        n(typeof g == "number" && g >= 0);
        var u = g % 26,
          p = (g - u) / 26;
        if (n(this.negative === 0, "imaskn works only with positive numbers"), this.length <= p) return this;
        if (u !== 0 && p++, this.length = Math.min(p, this.length), u !== 0) {
          var v = 67108863 ^ 67108863 >>> u << u;
          this.words[this.length - 1] &= v
        }
        return this._strip()
      }, s.prototype.maskn = function (g) {
        return this.clone().imaskn(g)
      }, s.prototype.iaddn = function (g) {
        return n(typeof g == "number"), n(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)
      }, s.prototype._iaddn = function (g) {
        this.words[0] += g;
        for (var u = 0; u < this.length && this.words[u] >= 67108864; u++) this.words[u] -= 67108864, u === this.length - 1 ? this.words[u + 1] = 1 : this.words[u + 1]++;
        return this.length = Math.max(this.length, u + 1), this
      }, s.prototype.isubn = function (g) {
        if (n(typeof g == "number"), n(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 u = 0; u < this.length && this.words[u] < 0; u++) this.words[u] += 67108864, this.words[u + 1] -= 1;
        return this._strip()
      }, s.prototype.addn = function (g) {
        return this.clone().iaddn(g)
      }, s.prototype.subn = function (g) {
        return this.clone().isubn(g)
      }, s.prototype.iabs = function () {
        return this.negative = 0, this
      }, s.prototype.abs = function () {
        return this.clone().iabs()
      }, s.prototype._ishlnsubmul = function (g, u, p) {
        var v = g.length + p,
          x;
        this._expand(v);
        var E, S = 0;
        for (x = 0; x < g.length; x++) {
          E = (this.words[x + p] | 0) + S;
          var _ = (g.words[x] | 0) * u;
          E -= _ & 67108863, S = (E >> 26) - (_ / 67108864 | 0), this.words[x + p] = E & 67108863
        }
        for (; x < this.length - p; x++) E = (this.words[x + p] | 0) + S, S = E >> 26, this.words[x + p] = E & 67108863;
        if (S === 0) return this._strip();
        for (n(S === -1), S = 0, x = 0; x < this.length; x++) E = -(this.words[x] | 0) + S, S = E >> 26, this.words[x] = E & 67108863;
        return this.negative = 1, this._strip()
      }, s.prototype._wordDiv = function (g, u) {
        var p = this.length - g.length,
          v = this.clone(),
          x = g,
          E = x.words[x.length - 1] | 0,
          S = this._countBits(E);
        p = 26 - S, p !== 0 && (x = x.ushln(p), v.iushln(p), E = x.words[x.length - 1] | 0);
        var _ = v.length - x.length,
          y;
        if (u !== "mod") {
          y = new s(null), y.length = _ + 1, y.words = new Array(y.length);
          for (var A = 0; A < y.length; A++) y.words[A] = 0
        }
        var G = v.clone()._ishlnsubmul(x, 1, _);
        G.negative === 0 && (v = G, y && (y.words[_] = 1));
        for (var ce = _ - 1; ce >= 0; ce--) {
          var W = (v.words[x.length + ce] | 0) * 67108864 + (v.words[x.length + ce - 1] | 0);
          for (W = Math.min(W / E | 0, 67108863), v._ishlnsubmul(x, W, ce); v.negative !== 0;) W--, v.negative = 0, v._ishlnsubmul(x, 1, ce), v.isZero() || (v.negative ^= 1);
          y && (y.words[ce] = W)
        }
        return y && y._strip(), v._strip(), u !== "div" && p !== 0 && v.iushrn(p), {
          div: y || null,
          mod: v
        }
      }, s.prototype.divmod = function (g, u, p) {
        if (n(!g.isZero()), this.isZero()) return {
          div: new s(0),
          mod: new s(0)
        };
        var v, x, E;
        return this.negative !== 0 && g.negative === 0 ? (E = this.neg().divmod(g, u), u !== "mod" && (v = E.div.neg()), u !== "div" && (x = E.mod.neg(), p && x.negative !== 0 && x.iadd(g)), {
          div: v,
          mod: x
        }) : this.negative === 0 && g.negative !== 0 ? (E = this.divmod(g.neg(), u), u !== "mod" && (v = E.div.neg()), {
          div: v,
          mod: E.mod
        }) : this.negative & g.negative ? (E = this.neg().divmod(g.neg(), u), u !== "div" && (x = E.mod.neg(), p && x.negative !== 0 && x.isub(g)), {
          div: E.div,
          mod: x
        }) : g.length > this.length || this.cmp(g) < 0 ? {
          div: new s(0),
          mod: this
        } : g.length === 1 ? u === "div" ? {
          div: this.divn(g.words[0]),
          mod: null
        } : u === "mod" ? {
          div: null,
          mod: new s(this.modrn(g.words[0]))
        } : {
          div: this.divn(g.words[0]),
          mod: new s(this.modrn(g.words[0]))
        } : this._wordDiv(g, u)
      }, s.prototype.div = function (g) {
        return this.divmod(g, "div", !1).div
      }, s.prototype.mod = function (g) {
        return this.divmod(g, "mod", !1).mod
      }, s.prototype.umod = function (g) {
        return this.divmod(g, "mod", !0).mod
      }, s.prototype.divRound = function (g) {
        var u = this.divmod(g);
        if (u.mod.isZero()) return u.div;
        var p = u.div.negative !== 0 ? u.mod.isub(g) : u.mod,
          v = g.ushrn(1),
          x = g.andln(1),
          E = p.cmp(v);
        return E < 0 || x === 1 && E === 0 ? u.div : u.div.negative !== 0 ? u.div.isubn(1) : u.div.iaddn(1)
      }, s.prototype.modrn = function (g) {
        var u = g < 0;
        u && (g = -g), n(g <= 67108863);
        for (var p = (1 << 26) % g, v = 0, x = this.length - 1; x >= 0; x--) v = (p * v + (this.words[x] | 0)) % g;
        return u ? -v : v
      }, s.prototype.modn = function (g) {
        return this.modrn(g)
      }, s.prototype.idivn = function (g) {
        var u = g < 0;
        u && (g = -g), n(g <= 67108863);
        for (var p = 0, v = this.length - 1; v >= 0; v--) {
          var x = (this.words[v] | 0) + p * 67108864;
          this.words[v] = x / g | 0, p = x % g
        }
        return this._strip(), u ? this.ineg() : this
      }, s.prototype.divn = function (g) {
        return this.clone().idivn(g)
      }, s.prototype.egcd = function (g) {
        n(g.negative === 0), n(!g.isZero());
        var u = this,
          p = g.clone();
        u.negative !== 0 ? u = u.umod(g) : u = u.clone();
        for (var v = new s(1), x = new s(0), E = new s(0), S = new s(1), _ = 0; u.isEven() && p.isEven();) u.iushrn(1), p.iushrn(1), ++_;
        for (var y = p.clone(), A = u.clone(); !u.isZero();) {
          for (var G = 0, ce = 1; !(u.words[0] & ce) && G < 26; ++G, ce <<= 1);
          if (G > 0)
            for (u.iushrn(G); G-- > 0;)(v.isOdd() || x.isOdd()) && (v.iadd(y), x.isub(A)), v.iushrn(1), x.iushrn(1);
          for (var W = 0, X = 1; !(p.words[0] & X) && W < 26; ++W, X <<= 1);
          if (W > 0)
            for (p.iushrn(W); W-- > 0;)(E.isOdd() || S.isOdd()) && (E.iadd(y), S.isub(A)), E.iushrn(1), S.iushrn(1);
          u.cmp(p) >= 0 ? (u.isub(p), v.isub(E), x.isub(S)) : (p.isub(u), E.isub(v), S.isub(x))
        }
        return {
          a: E,
          b: S,
          gcd: p.iushln(_)
        }
      }, s.prototype._invmp = function (g) {
        n(g.negative === 0), n(!g.isZero());
        var u = this,
          p = g.clone();
        u.negative !== 0 ? u = u.umod(g) : u = u.clone();
        for (var v = new s(1), x = new s(0), E = p.clone(); u.cmpn(1) > 0 && p.cmpn(1) > 0;) {
          for (var S = 0, _ = 1; !(u.words[0] & _) && S < 26; ++S, _ <<= 1);
          if (S > 0)
            for (u.iushrn(S); S-- > 0;) v.isOdd() && v.iadd(E), v.iushrn(1);
          for (var y = 0, A = 1; !(p.words[0] & A) && y < 26; ++y, A <<= 1);
          if (y > 0)
            for (p.iushrn(y); y-- > 0;) x.isOdd() && x.iadd(E), x.iushrn(1);
          u.cmp(p) >= 0 ? (u.isub(p), v.isub(x)) : (p.isub(u), x.isub(v))
        }
        var G;
        return u.cmpn(1) === 0 ? G = v : G = x, G.cmpn(0) < 0 && G.iadd(g), G
      }, s.prototype.gcd = function (g) {
        if (this.isZero()) return g.abs();
        if (g.isZero()) return this.abs();
        var u = this.clone(),
          p = g.clone();
        u.negative = 0, p.negative = 0;
        for (var v = 0; u.isEven() && p.isEven(); v++) u.iushrn(1), p.iushrn(1);
        do {
          for (; u.isEven();) u.iushrn(1);
          for (; p.isEven();) p.iushrn(1);
          var x = u.cmp(p);
          if (x < 0) {
            var E = u;
            u = p, p = E
          } else if (x === 0 || p.cmpn(1) === 0) break;
          u.isub(p)
        } while (!0);
        return p.iushln(v)
      }, s.prototype.invm = function (g) {
        return this.egcd(g).a.umod(g)
      }, s.prototype.isEven = function () {
        return (this.words[0] & 1) === 0
      }, s.prototype.isOdd = function () {
        return (this.words[0] & 1) === 1
      }, s.prototype.andln = function (g) {
        return this.words[0] & g
      }, s.prototype.bincn = function (g) {
        n(typeof g == "number");
        var u = g % 26,
          p = (g - u) / 26,
          v = 1 << u;
        if (this.length <= p) return this._expand(p + 1), this.words[p] |= v, this;
        for (var x = v, E = p; x !== 0 && E < this.length; E++) {
          var S = this.words[E] | 0;
          S += x, x = S >>> 26, S &= 67108863, this.words[E] = S
        }
        return x !== 0 && (this.words[E] = x, this.length++), this
      }, s.prototype.isZero = function () {
        return this.length === 1 && this.words[0] === 0
      }, s.prototype.cmpn = function (g) {
        var u = g < 0;
        if (this.negative !== 0 && !u) return -1;
        if (this.negative === 0 && u) return 1;
        this._strip();
        var p;
        if (this.length > 1) p = 1;
        else {
          u && (g = -g), n(g <= 67108863, "Number is too big");
          var v = this.words[0] | 0;
          p = v === g ? 0 : v < g ? -1 : 1
        }
        return this.negative !== 0 ? -p | 0 : p
      }, s.prototype.cmp = function (g) {
        if (this.negative !== 0 && g.negative === 0) return -1;
        if (this.negative === 0 && g.negative !== 0) return 1;
        var u = this.ucmp(g);
        return this.negative !== 0 ? -u | 0 : u
      }, s.prototype.ucmp = function (g) {
        if (this.length > g.length) return 1;
        if (this.length < g.length) return -1;
        for (var u = 0, p = this.length - 1; p >= 0; p--) {
          var v = this.words[p] | 0,
            x = g.words[p] | 0;
          if (v !== x) {
            v < x ? u = -1 : v > x && (u = 1);
            break
          }
        }
        return u
      }, s.prototype.gtn = function (g) {
        return this.cmpn(g) === 1
      }, s.prototype.gt = function (g) {
        return this.cmp(g) === 1
      }, s.prototype.gten = function (g) {
        return this.cmpn(g) >= 0
      }, s.prototype.gte = function (g) {
        return this.cmp(g) >= 0
      }, s.prototype.ltn = function (g) {
        return this.cmpn(g) === -1
      }, s.prototype.lt = function (g) {
        return this.cmp(g) === -1
      }, s.prototype.lten = function (g) {
        return this.cmpn(g) <= 0
      }, s.prototype.lte = function (g) {
        return this.cmp(g) <= 0
      }, s.prototype.eqn = function (g) {
        return this.cmpn(g) === 0
      }, s.prototype.eq = function (g) {
        return this.cmp(g) === 0
      }, s.red = function (g) {
        return new U(g)
      }, s.prototype.toRed = function (g) {
        return n(!this.red, "Already a number in reduction context"), n(this.negative === 0, "red works only with positives"), g.convertTo(this)._forceRed(g)
      }, s.prototype.fromRed = function () {
        return n(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this)
      }, s.prototype._forceRed = function (g) {
        return this.red = g, this
      }, s.prototype.forceRed = function (g) {
        return n(!this.red, "Already a number in reduction context"), this._forceRed(g)
      }, s.prototype.redAdd = function (g) {
        return n(this.red, "redAdd works only with red numbers"), this.red.add(this, g)
      }, s.prototype.redIAdd = function (g) {
        return n(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, g)
      }, s.prototype.redSub = function (g) {
        return n(this.red, "redSub works only with red numbers"), this.red.sub(this, g)
      }, s.prototype.redISub = function (g) {
        return n(this.red, "redISub works only with red numbers"), this.red.isub(this, g)
      }, s.prototype.redShl = function (g) {
        return n(this.red, "redShl works only with red numbers"), this.red.shl(this, g)
      }, s.prototype.redMul = function (g) {
        return n(this.red, "redMul works only with red numbers"), this.red._verify2(this, g), this.red.mul(this, g)
      }, s.prototype.redIMul = function (g) {
        return n(this.red, "redMul works only with red numbers"), this.red._verify2(this, g), this.red.imul(this, g)
      }, s.prototype.redSqr = function () {
        return n(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this)
      }, s.prototype.redISqr = function () {
        return n(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this)
      }, s.prototype.redSqrt = function () {
        return n(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this)
      }, s.prototype.redInvm = function () {
        return n(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this)
      }, s.prototype.redNeg = function () {
        return n(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this)
      }, s.prototype.redPow = function (g) {
        return n(this.red && !g.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, g)
      };
      var D = {
        k256: null,
        p224: null,
        p192: null,
        p25519: null
      };

      function V(g, u) {
        this.name = g, this.p = new s(u, 16), this.n = this.p.bitLength(), this.k = new s(1).iushln(this.n).isub(this.p), this.tmp = this._tmp()
      }
      V.prototype._tmp = function () {
        var g = new s(null);
        return g.words = new Array(Math.ceil(this.n / 13)), g
      }, V.prototype.ireduce = function (g) {
        var u = g,
          p;
        do this.split(u, this.tmp), u = this.imulK(u), u = u.iadd(this.tmp), p = u.bitLength(); while (p > this.n);
        var v = p < this.n ? -1 : u.ucmp(this.p);
        return v === 0 ? (u.words[0] = 0, u.length = 1) : v > 0 ? u.isub(this.p) : u.strip !== void 0 ? u.strip() : u._strip(), u
      }, V.prototype.split = function (g, u) {
        g.iushrn(this.n, 0, u)
      }, V.prototype.imulK = function (g) {
        return g.imul(this.k)
      };

      function R() {
        V.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")
      }
      i(R, V), R.prototype.split = function (g, u) {
        for (var p = 4194303, v = Math.min(g.length, 9), x = 0; x < v; x++) u.words[x] = g.words[x];
        if (u.length = v, g.length <= 9) {
          g.words[0] = 0, g.length = 1;
          return
        }
        var E = g.words[9];
        for (u.words[u.length++] = E & p, x = 10; x < g.length; x++) {
          var S = g.words[x] | 0;
          g.words[x - 10] = (S & p) << 4 | E >>> 22, E = S
        }
        E >>>= 22, g.words[x - 10] = E, E === 0 && g.length > 10 ? g.length -= 10 : g.length -= 9
      }, R.prototype.imulK = function (g) {
        g.words[g.length] = 0, g.words[g.length + 1] = 0, g.length += 2;
        for (var u = 0, p = 0; p < g.length; p++) {
          var v = g.words[p] | 0;
          u += v * 977, g.words[p] = u & 67108863, u = v * 64 + (u / 67108864 | 0)
        }
        return g.words[g.length - 1] === 0 && (g.length--, g.words[g.length - 1] === 0 && g.length--), g
      };

      function P() {
        V.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")
      }
      i(P, V);

      function j() {
        V.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")
      }
      i(j, V);

      function Y() {
        V.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")
      }
      i(Y, V), Y.prototype.imulK = function (g) {
        for (var u = 0, p = 0; p < g.length; p++) {
          var v = (g.words[p] | 0) * 19 + u,
            x = v & 67108863;
          v >>>= 26, g.words[p] = x, u = v
        }
        return u !== 0 && (g.words[g.length++] = u), g
      }, s._prime = function (g) {
        if (D[g]) return D[g];
        var u;
        if (g === "k256") u = new R;
        else if (g === "p224") u = new P;
        else if (g === "p192") u = new j;
        else if (g === "p25519") u = new Y;
        else throw new Error("Unknown prime " + g);
        return D[g] = u, u
      };

      function U(g) {
        if (typeof g == "string") {
          var u = s._prime(g);
          this.m = u.p, this.prime = u
        } else n(g.gtn(1), "modulus must be greater than 1"), this.m = g, this.prime = null
      }
      U.prototype._verify1 = function (g) {
        n(g.negative === 0, "red works only with positives"), n(g.red, "red works only with red numbers")
      }, U.prototype._verify2 = function (g, u) {
        n((g.negative | u.negative) === 0, "red works only with positives"), n(g.red && g.red === u.red, "red works only with red numbers")
      }, U.prototype.imod = function (g) {
        return this.prime ? this.prime.ireduce(g)._forceRed(this) : (h(g, g.umod(this.m)._forceRed(this)), g)
      }, U.prototype.neg = function (g) {
        return g.isZero() ? g.clone() : this.m.sub(g)._forceRed(this)
      }, U.prototype.add = function (g, u) {
        this._verify2(g, u);
        var p = g.add(u);
        return p.cmp(this.m) >= 0 && p.isub(this.m), p._forceRed(this)
      }, U.prototype.iadd = function (g, u) {
        this._verify2(g, u);
        var p = g.iadd(u);
        return p.cmp(this.m) >= 0 && p.isub(this.m), p
      }, U.prototype.sub = function (g, u) {
        this._verify2(g, u);
        var p = g.sub(u);
        return p.cmpn(0) < 0 && p.iadd(this.m), p._forceRed(this)
      }, U.prototype.isub = function (g, u) {
        this._verify2(g, u);
        var p = g.isub(u);
        return p.cmpn(0) < 0 && p.iadd(this.m), p
      }, U.prototype.shl = function (g, u) {
        return this._verify1(g), this.imod(g.ushln(u))
      }, U.prototype.imul = function (g, u) {
        return this._verify2(g, u), this.imod(g.imul(u))
      }, U.prototype.mul = function (g, u) {
        return this._verify2(g, u), this.imod(g.mul(u))
      }, U.prototype.isqr = function (g) {
        return this.imul(g, g.clone())
      }, U.prototype.sqr = function (g) {
        return this.mul(g, g)
      }, U.prototype.sqrt = function (g) {
        if (g.isZero()) return g.clone();
        var u = this.m.andln(3);
        if (n(u % 2 === 1), u === 3) {
          var p = this.m.add(new s(1)).iushrn(2);
          return this.pow(g, p)
        }
        for (var v = this.m.subn(1), x = 0; !v.isZero() && v.andln(1) === 0;) x++, v.iushrn(1);
        n(!v.isZero());
        var E = new s(1).toRed(this),
          S = E.redNeg(),
          _ = this.m.subn(1).iushrn(1),
          y = this.m.bitLength();
        for (y = new s(2 * y * y).toRed(this); this.pow(y, _).cmp(S) !== 0;) y.redIAdd(S);
        for (var A = this.pow(y, v), G = this.pow(g, v.addn(1).iushrn(1)), ce = this.pow(g, v), W = x; ce.cmp(E) !== 0;) {
          for (var X = ce, Z = 0; X.cmp(E) !== 0; Z++) X = X.redSqr();
          n(Z < W);
          var ee = this.pow(A, new s(1).iushln(W - Z - 1));
          G = G.redMul(ee), A = ee.redSqr(), ce = ce.redMul(A), W = Z
        }
        return G
      }, U.prototype.invm = function (g) {
        var u = g._invmp(this.m);
        return u.negative !== 0 ? (u.negative = 0, this.imod(u).redNeg()) : this.imod(u)
      }, U.prototype.pow = function (g, u) {
        if (u.isZero()) return new s(1).toRed(this);
        if (u.cmpn(1) === 0) return g.clone();
        var p = 4,
          v = new Array(1 << p);
        v[0] = new s(1).toRed(this), v[1] = g;
        for (var x = 2; x < v.length; x++) v[x] = this.mul(v[x - 1], g);
        var E = v[0],
          S = 0,
          _ = 0,
          y = u.bitLength() % 26;
        for (y === 0 && (y = 26), x = u.length - 1; x >= 0; x--) {
          for (var A = u.words[x], G = y - 1; G >= 0; G--) {
            var ce = A >> G & 1;
            if (E !== v[0] && (E = this.sqr(E)), ce === 0 && S === 0) {
              _ = 0;
              continue
            }
            S <<= 1, S |= ce, _++, !(_ !== p && (x !== 0 || G !== 0)) && (E = this.mul(E, v[S]), _ = 0, S = 0)
          }
          y = 26
        }
        return E
      }, U.prototype.convertTo = function (g) {
        var u = g.umod(this.m);
        return u === g ? u.clone() : u
      }, U.prototype.convertFrom = function (g) {
        var u = g.clone();
        return u.red = null, u
      }, s.mont = function (g) {
        return new I(g)
      };

      function I(g) {
        U.call(this, g), this.shift = this.m.bitLength(), this.shift % 26 !== 0 && (this.shift += 26 - this.shift % 26), this.r = new s(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)
      }
      i(I, U), I.prototype.convertTo = function (g) {
        return this.imod(g.ushln(this.shift))
      }, I.prototype.convertFrom = function (g) {
        var u = this.imod(g.mul(this.rinv));
        return u.red = null, u
      }, I.prototype.imul = function (g, u) {
        if (g.isZero() || u.isZero()) return g.words[0] = 0, g.length = 1, g;
        var p = g.imul(u),
          v = p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),
          x = p.isub(v).iushrn(this.shift),
          E = x;
        return x.cmp(this.m) >= 0 ? E = x.isub(this.m) : x.cmpn(0) < 0 && (E = x.iadd(this.m)), E._forceRed(this)
      }, I.prototype.mul = function (g, u) {
        if (g.isZero() || u.isZero()) return new s(0)._forceRed(this);
        var p = g.mul(u),
          v = p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),
          x = p.isub(v).iushrn(this.shift),
          E = x;
        return x.cmp(this.m) >= 0 ? E = x.isub(this.m) : x.cmpn(0) < 0 && (E = x.iadd(this.m)), E._forceRed(this)
      }, I.prototype.invm = function (g) {
        var u = this.imod(g._invmp(this.m).mul(this.r2));
        return u._forceRed(this)
      }
    })(t, AD)
  })(DD);
  var dr = DD.exports;
  const LD = "bignumber/5.7.0";
  var t4 = dr.BN;
  const Ku = new is(LD),
    FC = {},
    BD = 9007199254740991;

  function Uge(t) {
    return t != null && (Os.isBigNumber(t) || typeof t == "number" && t % 1 === 0 || typeof t == "string" && !!t.match(/^-?[0-9]+$/) || Fo(t) || typeof t == "bigint" || wg(t))
  }
  let UD = !1,
    Os = class Vc {
      constructor(e, r) {
        e !== FC && Ku.throwError("cannot call constructor directly; use BigNumber.from", is.errors.UNSUPPORTED_OPERATION, {
          operation: "new (BigNumber)"
        }), this._hex = r, this._isBigNumber = !0, Object.freeze(this)
      }
      fromTwos(e) {
        return go(Mr(this).fromTwos(e))
      }
      toTwos(e) {
        return go(Mr(this).toTwos(e))
      }
      abs() {
        return this._hex[0] === "-" ? Vc.from(this._hex.substring(1)) : this
      }
      add(e) {
        return go(Mr(this).add(Mr(e)))
      }
      sub(e) {
        return go(Mr(this).sub(Mr(e)))
      }
      div(e) {
        return Vc.from(e).isZero() && _a("division-by-zero", "div"), go(Mr(this).div(Mr(e)))
      }
      mul(e) {
        return go(Mr(this).mul(Mr(e)))
      }
      mod(e) {
        const r = Mr(e);
        return r.isNeg() && _a("division-by-zero", "mod"), go(Mr(this).umod(r))
      }
      pow(e) {
        const r = Mr(e);
        return r.isNeg() && _a("negative-power", "pow"), go(Mr(this).pow(r))
      }
      and(e) {
        const r = Mr(e);
        return (this.isNegative() || r.isNeg()) && _a("unbound-bitwise-result", "and"), go(Mr(this).and(r))
      }
      or(e) {
        const r = Mr(e);
        return (this.isNegative() || r.isNeg()) && _a("unbound-bitwise-result", "or"), go(Mr(this).or(r))
      }
      xor(e) {
        const r = Mr(e);
        return (this.isNegative() || r.isNeg()) && _a("unbound-bitwise-result", "xor"), go(Mr(this).xor(r))
      }
      mask(e) {
        return (this.isNegative() || e < 0) && _a("negative-width", "mask"), go(Mr(this).maskn(e))
      }
      shl(e) {
        return (this.isNegative() || e < 0) && _a("negative-width", "shl"), go(Mr(this).shln(e))
      }
      shr(e) {
        return (this.isNegative() || e < 0) && _a("negative-width", "shr"), go(Mr(this).shrn(e))
      }
      eq(e) {
        return Mr(this).eq(Mr(e))
      }
      lt(e) {
        return Mr(this).lt(Mr(e))
      }
      lte(e) {
        return Mr(this).lte(Mr(e))
      }
      gt(e) {
        return Mr(this).gt(Mr(e))
      }
      gte(e) {
        return Mr(this).gte(Mr(e))
      }
      isNegative() {
        return this._hex[0] === "-"
      }
      isZero() {
        return Mr(this).isZero()
      }
      toNumber() {
        try {
          return Mr(this).toNumber()
        } catch {
          _a("overflow", "toNumber", this.toString())
        }
        return null
      }
      toBigInt() {
        try {
          return BigInt(this.toString())
        } catch {}
        return Ku.throwError("this platform does not support BigInt", is.errors.UNSUPPORTED_OPERATION, {
          value: this.toString()
        })
      }
      toString() {
        return arguments.length > 0 && (arguments[0] === 10 ? UD || (UD = !0, Ku.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")) : arguments[0] === 16 ? Ku.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()", is.errors.UNEXPECTED_ARGUMENT, {}) : Ku.throwError("BigNumber.toString does not accept parameters", is.errors.UNEXPECTED_ARGUMENT, {})), Mr(this).toString(10)
      }
      toHexString() {
        return this._hex
      }
      toJSON(e) {
        return {
          type: "BigNumber",
          hex: this.toHexString()
        }
      }
      static from(e) {
        if (e instanceof Vc) return e;
        if (typeof e == "string") return e.match(/^-?0x[0-9a-f]+$/i) ? new Vc(FC, tv(e)) : e.match(/^-?[0-9]+$/) ? new Vc(FC, tv(new t4(e))) : Ku.throwArgumentError("invalid BigNumber string", "value", e);
        if (typeof e == "number") return e % 1 && _a("underflow", "BigNumber.from", e), (e >= BD || e <= -BD) && _a("overflow", "BigNumber.from", e), Vc.from(String(e));
        const r = e;
        if (typeof r == "bigint") return Vc.from(r.toString());
        if (wg(r)) return Vc.from(po(r));
        if (r)
          if (r.toHexString) {
            const n = r.toHexString();
            if (typeof n == "string") return Vc.from(n)
          } else {
            let n = r._hex;
            if (n == null && r.type === "BigNumber" && (n = r.hex), typeof n == "string" && (Fo(n) || n[0] === "-" && Fo(n.substring(1)))) return Vc.from(n)
          } return Ku.throwArgumentError("invalid BigNumber value", "value", e)
      }
      static isBigNumber(e) {
        return !!(e && e._isBigNumber)
      }
    };

  function tv(t) {
    if (typeof t != "string") return tv(t.toString(16));
    if (t[0] === "-") return t = t.substring(1), t[0] === "-" && Ku.throwArgumentError("invalid hex", "value", t), t = tv(t), t === "0x00" ? t : "-" + t;
    if (t.substring(0, 2) !== "0x" && (t = "0x" + t), t === "0x") return "0x00";
    for (t.length % 2 && (t = "0x0" + t.substring(2)); t.length > 4 && t.substring(0, 4) === "0x00";) t = "0x" + t.substring(4);
    return t
  }

  function go(t) {
    return Os.from(tv(t))
  }

  function Mr(t) {
    const e = Os.from(t).toHexString();
    return e[0] === "-" ? new t4("-" + e.substring(3), 16) : new t4(e.substring(2), 16)
  }

  function _a(t, e, r) {
    const n = {
      fault: t,
      operation: e
    };
    return r != null && (n.value = r), Ku.throwError(t, is.errors.NUMERIC_FAULT, n)
  }

  function jge(t) {
    return new t4(t, 36).toString(16)
  }
  const Ds = new is(LD),
    rv = {},
    jD = Os.from(0),
    FD = Os.from(-1);

  function WD(t, e, r, n) {
    const i = {
      fault: e,
      operation: r
    };
    return n !== void 0 && (i.value = n), Ds.throwError(t, is.errors.NUMERIC_FAULT, i)
  }
  let nv = "0";
  for (; nv.length < 256;) nv += nv;

  function WC(t) {
    if (typeof t != "number") try {
      t = Os.from(t).toNumber()
    } catch {}
    return typeof t == "number" && t >= 0 && t <= 256 && !(t % 1) ? "1" + nv.substring(0, t) : Ds.throwArgumentError("invalid decimal size", "decimals", t)
  }

  function zC(t, e) {
    e == null && (e = 0);
    const r = WC(e);
    t = Os.from(t);
    const n = t.lt(jD);
    n && (t = t.mul(FD));
    let i = t.mod(r).toString();
    for (; i.length < r.length - 1;) i = "0" + i;
    i = i.match(/^([0-9]*[1-9]|0)(0*)/)[1];
    const s = t.div(r).toString();
    return r.length === 1 ? t = s : t = s + "." + i, n && (t = "-" + t), t
  }

  function Gu(t, e) {
    e == null && (e = 0);
    const r = WC(e);
    (typeof t != "string" || !t.match(/^-?[0-9.]+$/)) && Ds.throwArgumentError("invalid decimal value", "value", t);
    const n = t.substring(0, 1) === "-";
    n && (t = t.substring(1)), t === "." && Ds.throwArgumentError("missing value", "value", t);
    const i = t.split(".");
    i.length > 2 && Ds.throwArgumentError("too many decimal points", "value", t);
    let s = i[0],
      o = i[1];
    for (s || (s = "0"), o || (o = "0"); o[o.length - 1] === "0";) o = o.substring(0, o.length - 1);
    for (o.length > r.length - 1 && WD("fractional component exceeds decimals", "underflow", "parseFixed"), o === "" && (o = "0"); o.length < r.length - 1;) o += "0";
    const a = Os.from(s),
      c = Os.from(o);
    let l = a.mul(r).add(c);
    return n && (l = l.mul(FD)), l
  }
  let HC = class $k {
      constructor(e, r, n, i) {
        e !== rv && Ds.throwError("cannot use FixedFormat constructor; use FixedFormat.from", is.errors.UNSUPPORTED_OPERATION, {
          operation: "new FixedFormat"
        }), this.signed = r, this.width = n, this.decimals = i, this.name = (r ? "" : "u") + "fixed" + String(n) + "x" + String(i), this._multiplier = WC(i), Object.freeze(this)
      }
      static from(e) {
        if (e instanceof $k) return e;
        typeof e == "number" && (e = `fixed128x${e}`);
        let r = !0,
          n = 128,
          i = 18;
        if (typeof e == "string") {
          if (e !== "fixed")
            if (e === "ufixed") r = !1;
            else {
              const s = e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);
              s || Ds.throwArgumentError("invalid fixed format", "format", e), r = s[1] !== "u", n = parseInt(s[2]), i = parseInt(s[3])
            }
        } else if (e) {
          const s = (o, a, c) => e[o] == null ? c : (typeof e[o] !== a && Ds.throwArgumentError("invalid fixed format (" + o + " not " + a + ")", "format." + o, e[o]), e[o]);
          r = s("signed", "boolean", r), n = s("width", "number", n), i = s("decimals", "number", i)
        }
        return n % 8 && Ds.throwArgumentError("invalid fixed format width (not byte aligned)", "format.width", n), i > 80 && Ds.throwArgumentError("invalid fixed format (decimals too large)", "format.decimals", i), new $k(rv, r, n, i)
      }
    },
    zD = class Xs {
      constructor(e, r, n, i) {
        e !== rv && Ds.throwError("cannot use FixedNumber constructor; use FixedNumber.from", is.errors.UNSUPPORTED_OPERATION, {
          operation: "new FixedFormat"
        }), this.format = i, this._hex = r, this._value = n, this._isFixedNumber = !0, Object.freeze(this)
      }
      _checkFormat(e) {
        this.format.name !== e.format.name && Ds.throwArgumentError("incompatible format; use fixedNumber.toFormat", "other", e)
      }
      addUnsafe(e) {
        this._checkFormat(e);
        const r = Gu(this._value, this.format.decimals),
          n = Gu(e._value, e.format.decimals);
        return Xs.fromValue(r.add(n), this.format.decimals, this.format)
      }
      subUnsafe(e) {
        this._checkFormat(e);
        const r = Gu(this._value, this.format.decimals),
          n = Gu(e._value, e.format.decimals);
        return Xs.fromValue(r.sub(n), this.format.decimals, this.format)
      }
      mulUnsafe(e) {
        this._checkFormat(e);
        const r = Gu(this._value, this.format.decimals),
          n = Gu(e._value, e.format.decimals);
        return Xs.fromValue(r.mul(n).div(this.format._multiplier), this.format.decimals, this.format)
      }
      divUnsafe(e) {
        this._checkFormat(e);
        const r = Gu(this._value, this.format.decimals),
          n = Gu(e._value, e.format.decimals);
        return Xs.fromValue(r.mul(this.format._multiplier).div(n), this.format.decimals, this.format)
      }
      floor() {
        const e = this.toString().split(".");
        e.length === 1 && e.push("0");
        let r = Xs.from(e[0], this.format);
        const n = !e[1].match(/^(0*)$/);
        return this.isNegative() && n && (r = r.subUnsafe(HD.toFormat(r.format))), r
      }
      ceiling() {
        const e = this.toString().split(".");
        e.length === 1 && e.push("0");
        let r = Xs.from(e[0], this.format);
        const n = !e[1].match(/^(0*)$/);
        return !this.isNegative() && n && (r = r.addUnsafe(HD.toFormat(r.format))), r
      }
      round(e) {
        e == null && (e = 0);
        const r = this.toString().split(".");
        if (r.length === 1 && r.push("0"), (e < 0 || e > 80 || e % 1) && Ds.throwArgumentError("invalid decimal count", "decimals", e), r[1].length <= e) return this;
        const n = Xs.from("1" + nv.substring(0, e), this.format),
          i = Fge.toFormat(this.format);
        return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)
      }
      isZero() {
        return this._value === "0.0" || this._value === "0"
      }
      isNegative() {
        return this._value[0] === "-"
      }
      toString() {
        return this._value
      }
      toHexString(e) {
        if (e == null) return this._hex;
        e % 8 && Ds.throwArgumentError("invalid byte width", "width", e);
        const r = Os.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();
        return Sl(r, e / 8)
      }
      toUnsafeFloat() {
        return parseFloat(this.toString())
      }
      toFormat(e) {
        return Xs.fromString(this._value, e)
      }
      static fromValue(e, r, n) {
        return n == null && r != null && !Uge(r) && (n = r, r = null), r == null && (r = 0), n == null && (n = "fixed"), Xs.fromString(zC(e, r), HC.from(n))
      }
      static fromString(e, r) {
        r == null && (r = "fixed");
        const n = HC.from(r),
          i = Gu(e, n.decimals);
        !n.signed && i.lt(jD) && WD("unsigned value cannot be negative", "overflow", "value", e);
        let s = null;
        n.signed ? s = i.toTwos(n.width).toHexString() : (s = i.toHexString(), s = Sl(s, n.width / 8));
        const o = zC(i, n.decimals);
        return new Xs(rv, s, o, n)
      }
      static fromBytes(e, r) {
        r == null && (r = "fixed");
        const n = HC.from(r);
        if (Gn(e).length > n.width / 8) throw new Error("overflow");
        let i = Os.from(e);
        n.signed && (i = i.fromTwos(n.width));
        const s = i.toTwos((n.signed ? 0 : 1) + n.width).toHexString(),
          o = zC(i, n.decimals);
        return new Xs(rv, s, o, n)
      }
      static from(e, r) {
        if (typeof e == "string") return Xs.fromString(e, r);
        if (wg(e)) return Xs.fromBytes(e, r);
        try {
          return Xs.fromValue(e, 0, r)
        } catch (n) {
          if (n.code !== is.errors.INVALID_ARGUMENT) throw n
        }
        return Ds.throwArgumentError("invalid FixedNumber value", "value", e)
      }
      static isFixedNumber(e) {
        return !!(e && e._isFixedNumber)
      }
    };
  const HD = zD.from(1),
    Fge = zD.from("0.5"),
    Wge = "strings/5.7.0",
    zge = new is(Wge);
  var r4;
  (function (t) {
    t.current = "", t.NFC = "NFC", t.NFD = "NFD", t.NFKC = "NFKC", t.NFKD = "NFKD"
  })(r4 || (r4 = {}));
  var qD;
  (function (t) {
    t.UNEXPECTED_CONTINUE = "unexpected continuation byte", t.BAD_PREFIX = "bad codepoint prefix", t.OVERRUN = "string overrun", t.MISSING_CONTINUE = "missing continuation byte", t.OUT_OF_RANGE = "out of UTF-8 range", t.UTF16_SURROGATE = "UTF-16 surrogate", t.OVERLONG = "overlong representation"
  })(qD || (qD = {}));

  function qC(t, e = r4.current) {
    e != r4.current && (zge.checkNormalize(), t = t.normalize(e));
    let r = [];
    for (let n = 0; n < t.length; n++) {
      const i = t.charCodeAt(n);
      if (i < 128) r.push(i);
      else if (i < 2048) r.push(i >> 6 | 192), r.push(i & 63 | 128);
      else if ((i & 64512) == 55296) {
        n++;
        const s = t.charCodeAt(n);
        if (n >= t.length || (s & 64512) !== 56320) throw new Error("invalid utf-8 string");
        const o = 65536 + ((i & 1023) << 10) + (s & 1023);
        r.push(o >> 18 | 240), r.push(o >> 12 & 63 | 128), r.push(o >> 6 & 63 | 128), r.push(o & 63 | 128)
      } else r.push(i >> 12 | 224), r.push(i >> 6 & 63 | 128), r.push(i & 63 | 128)
    }
    return Gn(r)
  }

  function Hge(t) {
    if (t.length % 4 !== 0) throw new Error("bad data");
    let e = [];
    for (let r = 0; r < t.length; r += 4) e.push(parseInt(t.substring(r, r + 4), 16));
    return e
  }

  function VC(t, e) {
    e || (e = function (i) {
      return [parseInt(i, 16)]
    });
    let r = 0,
      n = {};
    return t.split(",").forEach(i => {
      let s = i.split(":");
      r += parseInt(s[0], 16), n[r] = e(s[1])
    }), n
  }

  function VD(t) {
    let e = 0;
    return t.split(",").map(r => {
      let n = r.split("-");
      n.length === 1 ? n[1] = "0" : n[1] === "" && (n[1] = "1");
      let i = e + parseInt(n[0], 16);
      return e = parseInt(n[1], 16), {
        l: i,
        h: e
      }
    })
  }
  VD("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"), "ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t => parseInt(t, 16)), VC("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"), VC("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"), VC("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D", Hge), VD("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");

  function qge(t) {
    t = atob(t);
    const e = [];
    for (let r = 0; r < t.length; r++) e.push(t.charCodeAt(r));
    return Gn(e)
  }

  function KD(t, e) {
    e == null && (e = 1);
    const r = [],
      n = r.forEach,
      i = function (s, o) {
        n.call(s, function (a) {
          o > 0 && Array.isArray(a) ? i(a, o - 1) : r.push(a)
        })
      };
    return i(t, e), r
  }

  function Vge(t) {
    const e = {};
    for (let r = 0; r < t.length; r++) {
      const n = t[r];
      e[n[0]] = n[1]
    }
    return e
  }

  function Kge(t) {
    let e = 0;

    function r() {
      return t[e++] << 8 | t[e++]
    }
    let n = r(),
      i = 1,
      s = [0, 1];
    for (let D = 1; D < n; D++) s.push(i += r());
    let o = r(),
      a = e;
    e += o;
    let c = 0,
      l = 0;

    function h() {
      return c == 0 && (l = l << 8 | t[e++], c = 8), l >> --c & 1
    }
    const f = 31,
      w = Math.pow(2, f),
      b = w >>> 1,
      C = b >> 1,
      M = w - 1;
    let N = 0;
    for (let D = 0; D < f; D++) N = N << 1 | h();
    let $ = [],
      k = 0,
      B = w;
    for (;;) {
      let D = Math.floor(((N - k + 1) * i - 1) / B),
        V = 0,
        R = n;
      for (; R - V > 1;) {
        let Y = V + R >>> 1;
        D < s[Y] ? R = Y : V = Y
      }
      if (V == 0) break;
      $.push(V);
      let P = k + Math.floor(B * s[V] / i),
        j = k + Math.floor(B * s[V + 1] / i) - 1;
      for (; !((P ^ j) & b);) N = N << 1 & M | h(), P = P << 1 & M, j = j << 1 & M | 1;
      for (; P & ~j & C;) N = N & b | N << 1 & M >>> 1 | h(), P = P << 1 ^ b, j = (j ^ b) << 1 | b | 1;
      k = P, B = 1 + j - P
    }
    let F = n - 4;
    return $.map(D => {
      switch (D - F) {
        case 3:
          return F + 65792 + (t[a++] << 16 | t[a++] << 8 | t[a++]);
        case 2:
          return F + 256 + (t[a++] << 8 | t[a++]);
        case 1:
          return F + t[a++];
        default:
          return D - 1
      }
    })
  }

  function Gge(t) {
    let e = 0;
    return () => t[e++]
  }

  function Zge(t) {
    return Gge(Kge(t))
  }

  function Yge(t) {
    return t & 1 ? ~t >> 1 : t >> 1
  }

  function Qge(t, e) {
    let r = Array(t);
    for (let n = 0; n < t; n++) r[n] = 1 + e();
    return r
  }

  function GD(t, e) {
    let r = Array(t);
    for (let n = 0, i = -1; n < t; n++) r[n] = i += 1 + e();
    return r
  }

  function Jge(t, e) {
    let r = Array(t);
    for (let n = 0, i = 0; n < t; n++) r[n] = i += Yge(e());
    return r
  }

  function n4(t, e) {
    let r = GD(t(), t),
      n = t(),
      i = GD(n, t),
      s = Qge(n, t);
    for (let o = 0; o < n; o++)
      for (let a = 0; a < s[o]; a++) r.push(i[o] + a);
    return e ? r.map(o => e[o]) : r
  }

  function Xge(t) {
    let e = [];
    for (;;) {
      let r = t();
      if (r == 0) break;
      e.push(tme(r, t))
    }
    for (;;) {
      let r = t() - 1;
      if (r < 0) break;
      e.push(rme(r, t))
    }
    return Vge(KD(e))
  }

  function eme(t) {
    let e = [];
    for (;;) {
      let r = t();
      if (r == 0) break;
      e.push(r)
    }
    return e
  }

  function ZD(t, e, r) {
    let n = Array(t).fill(void 0).map(() => []);
    for (let i = 0; i < e; i++) Jge(t, r).forEach((s, o) => n[o].push(s));
    return n
  }

  function tme(t, e) {
    let r = 1 + e(),
      n = e(),
      i = eme(e),
      s = ZD(i.length, 1 + t, e);
    return KD(s.map((o, a) => {
      const c = o[0],
        l = o.slice(1);
      return Array(i[a]).fill(void 0).map((h, f) => {
        let w = f * n;
        return [c + f * r, l.map(b => b + w)]
      })
    }))
  }

  function rme(t, e) {
    let r = 1 + e();
    return ZD(r, 1 + t, e).map(n => [n[0], n.slice(1)])
  }

  function nme(t) {
    let e = n4(t).sort((n, i) => n - i);
    return r();

    function r() {
      let n = [];
      for (;;) {
        let l = n4(t, e);
        if (l.length == 0) break;
        n.push({
          set: new Set(l),
          node: r()
        })
      }
      n.sort((l, h) => h.set.size - l.set.size);
      let i = t(),
        s = i % 3;
      i = i / 3 | 0;
      let o = !!(i & 1);
      i >>= 1;
      let a = i == 1,
        c = i == 2;
      return {
        branches: n,
        valid: s,
        fe0f: o,
        save: a,
        check: c
      }
    }
  }

  function ime() {
    return Zge(qge(" "))
  }
  const i4 = ime();
  new Set(n4(i4)), new Set(n4(i4)), Xge(i4), nme(i4), new Uint8Array(32).fill(0);
  const sme = `Ethereum Signed Message:
  `;

  function YD(t) {
    return typeof t == "string" && (t = qC(t)), jC(Pge([qC(sme), qC(String(t.length)), t]))
  }
  const ome = "address/5.7.0",
    iv = new is(ome);

  function QD(t) {
    Fo(t, 20) || iv.throwArgumentError("invalid address", "address", t), t = t.toLowerCase();
    const e = t.substring(2).split(""),
      r = new Uint8Array(40);
    for (let i = 0; i < 40; i++) r[i] = e[i].charCodeAt(0);
    const n = Gn(jC(r));
    for (let i = 0; i < 40; i += 2) n[i >> 1] >> 4 >= 8 && (e[i] = e[i].toUpperCase()), (n[i >> 1] & 15) >= 8 && (e[i + 1] = e[i + 1].toUpperCase());
    return "0x" + e.join("")
  }
  const ame = 9007199254740991;

  function cme(t) {
    return Math.log10 ? Math.log10(t) : Math.log(t) / Math.LN10
  }
  const KC = {};
  for (let t = 0; t < 10; t++) KC[String(t)] = String(t);
  for (let t = 0; t < 26; t++) KC[String.fromCharCode(65 + t)] = String(10 + t);
  const JD = Math.floor(cme(ame));

  function lme(t) {
    t = t.toUpperCase(), t = t.substring(4) + t.substring(0, 2) + "00";
    let e = t.split("").map(n => KC[n]).join("");
    for (; e.length >= JD;) {
      let n = e.substring(0, JD);
      e = parseInt(n, 10) % 97 + e.substring(n.length)
    }
    let r = String(98 - parseInt(e, 10) % 97);
    for (; r.length < 2;) r = "0" + r;
    return r
  }

  function ume(t) {
    let e = null;
    if (typeof t != "string" && iv.throwArgumentError("invalid address", "address", t), t.match(/^(0x)?[0-9a-fA-F]{40}$/)) t.substring(0, 2) !== "0x" && (t = "0x" + t), e = QD(t), t.match(/([A-F].*[a-f])|([a-f].*[A-F])/) && e !== t && iv.throwArgumentError("bad address checksum", "address", t);
    else if (t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
      for (t.substring(2, 4) !== lme(t) && iv.throwArgumentError("bad icap checksum", "address", t), e = jge(t.substring(4)); e.length < 40;) e = "0" + e;
      e = QD("0x" + e)
    } else iv.throwArgumentError("invalid address", "address", t);
    return e
  }

  function sv(t, e, r) {
    Object.defineProperty(t, e, {
      enumerable: !0,
      value: r,
      writable: !1
    })
  }
  new Uint8Array(32).fill(0), Os.from(-1);
  const dme = Os.from(0),
    hme = Os.from(1);
  Os.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), Sl(hme.toHexString(), 32), Sl(dme.toHexString(), 32);
  var Il = {},
    Pr = {},
    ov = XD;

  function XD(t, e) {
    if (!t) throw new Error(e || "Assertion failed")
  }
  XD.equal = function (t, e, r) {
    if (t != e) throw new Error(r || "Assertion failed: " + t + " != " + e)
  };
  var GC = {
    exports: {}
  };
  typeof Object.create == "function" ? GC.exports = function (t, e) {
    e && (t.super_ = e, t.prototype = Object.create(e.prototype, {
      constructor: {
        value: t,
        enumerable: !1,
        writable: !0,
        configurable: !0
      }
    }))
  } : GC.exports = function (t, e) {
    if (e) {
      t.super_ = e;
      var r = function () {};
      r.prototype = e.prototype, t.prototype = new r, t.prototype.constructor = t
    }
  };
  var fme = ov,
    pme = GC.exports;
  Pr.inherits = pme;

  function gme(t, e) {
    return (t.charCodeAt(e) & 64512) !== 55296 || e < 0 || e + 1 >= t.length ? !1 : (t.charCodeAt(e + 1) & 64512) === 56320
  }

  function mme(t, e) {
    if (Array.isArray(t)) return t.slice();
    if (!t) return [];
    var r = [];
    if (typeof t == "string")
      if (e) {
        if (e === "hex")
          for (t = t.replace(/[^a-z0-9]+/ig, ""), t.length % 2 !== 0 && (t = "0" + t), i = 0; i < t.length; i += 2) r.push(parseInt(t[i] + t[i + 1], 16))
      } else
        for (var n = 0, i = 0; i < t.length; i++) {
          var s = t.charCodeAt(i);
          s < 128 ? r[n++] = s : s < 2048 ? (r[n++] = s >> 6 | 192, r[n++] = s & 63 | 128) : gme(t, i) ? (s = 65536 + ((s & 1023) << 10) + (t.charCodeAt(++i) & 1023), r[n++] = s >> 18 | 240, r[n++] = s >> 12 & 63 | 128, r[n++] = s >> 6 & 63 | 128, r[n++] = s & 63 | 128) : (r[n++] = s >> 12 | 224, r[n++] = s >> 6 & 63 | 128, r[n++] = s & 63 | 128)
        } else
          for (i = 0; i < t.length; i++) r[i] = t[i] | 0;
    return r
  }
  Pr.toArray = mme;

  function wme(t) {
    for (var e = "", r = 0; r < t.length; r++) e += tL(t[r].toString(16));
    return e
  }
  Pr.toHex = wme;

  function eL(t) {
    var e = t >>> 24 | t >>> 8 & 65280 | t << 8 & 16711680 | (t & 255) << 24;
    return e >>> 0
  }
  Pr.htonl = eL;

  function vme(t, e) {
    for (var r = "", n = 0; n < t.length; n++) {
      var i = t[n];
      e === "little" && (i = eL(i)), r += rL(i.toString(16))
    }
    return r
  }
  Pr.toHex32 = vme;

  function tL(t) {
    return t.length === 1 ? "0" + t : t
  }
  Pr.zero2 = tL;

  function rL(t) {
    return t.length === 7 ? "0" + t : t.length === 6 ? "00" + t : t.length === 5 ? "000" + t : t.length === 4 ? "0000" + t : t.length === 3 ? "00000" + t : t.length === 2 ? "000000" + t : t.length === 1 ? "0000000" + t : t
  }
  Pr.zero8 = rL;

  function bme(t, e, r, n) {
    var i = r - e;
    fme(i % 4 === 0);
    for (var s = new Array(i / 4), o = 0, a = e; o < s.length; o++, a += 4) {
      var c;
      n === "big" ? c = t[a] << 24 | t[a + 1] << 16 | t[a + 2] << 8 | t[a + 3] : c = t[a + 3] << 24 | t[a + 2] << 16 | t[a + 1] << 8 | t[a], s[o] = c >>> 0
    }
    return s
  }
  Pr.join32 = bme;

  function yme(t, e) {
    for (var r = new Array(t.length * 4), n = 0, i = 0; n < t.length; n++, i += 4) {
      var s = t[n];
      e === "big" ? (r[i] = s >>> 24, r[i + 1] = s >>> 16 & 255, r[i + 2] = s >>> 8 & 255, r[i + 3] = s & 255) : (r[i + 3] = s >>> 24, r[i + 2] = s >>> 16 & 255, r[i + 1] = s >>> 8 & 255, r[i] = s & 255)
    }
    return r
  }
  Pr.split32 = yme;

  function _me(t, e) {
    return t >>> e | t << 32 - e
  }
  Pr.rotr32 = _me;

  function xme(t, e) {
    return t << e | t >>> 32 - e
  }
  Pr.rotl32 = xme;

  function Cme(t, e) {
    return t + e >>> 0
  }
  Pr.sum32 = Cme;

  function Eme(t, e, r) {
    return t + e + r >>> 0
  }
  Pr.sum32_3 = Eme;

  function Ame(t, e, r, n) {
    return t + e + r + n >>> 0
  }
  Pr.sum32_4 = Ame;

  function Sme(t, e, r, n, i) {
    return t + e + r + n + i >>> 0
  }
  Pr.sum32_5 = Sme;

  function Ime(t, e, r, n) {
    var i = t[e],
      s = t[e + 1],
      o = n + s >>> 0,
      a = (o < n ? 1 : 0) + r + i;
    t[e] = a >>> 0, t[e + 1] = o
  }
  Pr.sum64 = Ime;

  function Tme(t, e, r, n) {
    var i = e + n >>> 0,
      s = (i < e ? 1 : 0) + t + r;
    return s >>> 0
  }
  Pr.sum64_hi = Tme;

  function kme(t, e, r, n) {
    var i = e + n;
    return i >>> 0
  }
  Pr.sum64_lo = kme;

  function Rme(t, e, r, n, i, s, o, a) {
    var c = 0,
      l = e;
    l = l + n >>> 0, c += l < e ? 1 : 0, l = l + s >>> 0, c += l < s ? 1 : 0, l = l + a >>> 0, c += l < a ? 1 : 0;
    var h = t + r + i + o + c;
    return h >>> 0
  }
  Pr.sum64_4_hi = Rme;

  function Nme(t, e, r, n, i, s, o, a) {
    var c = e + n + s + a;
    return c >>> 0
  }
  Pr.sum64_4_lo = Nme;

  function Mme(t, e, r, n, i, s, o, a, c, l) {
    var h = 0,
      f = e;
    f = f + n >>> 0, h += f < e ? 1 : 0, f = f + s >>> 0, h += f < s ? 1 : 0, f = f + a >>> 0, h += f < a ? 1 : 0, f = f + l >>> 0, h += f < l ? 1 : 0;
    var w = t + r + i + o + c + h;
    return w >>> 0
  }
  Pr.sum64_5_hi = Mme;

  function Pme(t, e, r, n, i, s, o, a, c, l) {
    var h = e + n + s + a + l;
    return h >>> 0
  }
  Pr.sum64_5_lo = Pme;

  function $me(t, e, r) {
    var n = e << 32 - r | t >>> r;
    return n >>> 0
  }
  Pr.rotr64_hi = $me;

  function Ome(t, e, r) {
    var n = t << 32 - r | e >>> r;
    return n >>> 0
  }
  Pr.rotr64_lo = Ome;

  function Dme(t, e, r) {
    return t >>> r
  }
  Pr.shr64_hi = Dme;

  function Lme(t, e, r) {
    var n = t << 32 - r | e >>> r;
    return n >>> 0
  }
  Pr.shr64_lo = Lme;
  var vg = {},
    nL = Pr,
    Bme = ov;

  function s4() {
    this.pending = null, this.pendingTotal = 0, this.blockSize = this.constructor.blockSize, this.outSize = this.constructor.outSize, this.hmacStrength = this.constructor.hmacStrength, this.padLength = this.constructor.padLength / 8, this.endian = "big", this._delta8 = this.blockSize / 8, this._delta32 = this.blockSize / 32
  }
  vg.BlockHash = s4, s4.prototype.update = function (t, e) {
    if (t = nL.toArray(t, e), this.pending ? this.pending = this.pending.concat(t) : this.pending = t, this.pendingTotal += t.length, this.pending.length >= this._delta8) {
      t = this.pending;
      var r = t.length % this._delta8;
      this.pending = t.slice(t.length - r, t.length), this.pending.length === 0 && (this.pending = null), t = nL.join32(t, 0, t.length - r, this.endian);
      for (var n = 0; n < t.length; n += this._delta32) this._update(t, n, n + this._delta32)
    }
    return this
  }, s4.prototype.digest = function (t) {
    return this.update(this._pad()), Bme(this.pending === null), this._digest(t)
  }, s4.prototype._pad = function () {
    var t = this.pendingTotal,
      e = this._delta8,
      r = e - (t + this.padLength) % e,
      n = new Array(r + this.padLength);
    n[0] = 128;
    for (var i = 1; i < r; i++) n[i] = 0;
    if (t <<= 3, this.endian === "big") {
      for (var s = 8; s < this.padLength; s++) n[i++] = 0;
      n[i++] = 0, n[i++] = 0, n[i++] = 0, n[i++] = 0, n[i++] = t >>> 24 & 255, n[i++] = t >>> 16 & 255, n[i++] = t >>> 8 & 255, n[i++] = t & 255
    } else
      for (n[i++] = t & 255, n[i++] = t >>> 8 & 255, n[i++] = t >>> 16 & 255, n[i++] = t >>> 24 & 255, n[i++] = 0, n[i++] = 0, n[i++] = 0, n[i++] = 0, s = 8; s < this.padLength; s++) n[i++] = 0;
    return n
  };
  var bg = {},
    Tl = {},
    Ume = Pr,
    kl = Ume.rotr32;

  function jme(t, e, r, n) {
    if (t === 0) return iL(e, r, n);
    if (t === 1 || t === 3) return oL(e, r, n);
    if (t === 2) return sL(e, r, n)
  }
  Tl.ft_1 = jme;

  function iL(t, e, r) {
    return t & e ^ ~t & r
  }
  Tl.ch32 = iL;

  function sL(t, e, r) {
    return t & e ^ t & r ^ e & r
  }
  Tl.maj32 = sL;

  function oL(t, e, r) {
    return t ^ e ^ r
  }
  Tl.p32 = oL;

  function Fme(t) {
    return kl(t, 2) ^ kl(t, 13) ^ kl(t, 22)
  }
  Tl.s0_256 = Fme;

  function Wme(t) {
    return kl(t, 6) ^ kl(t, 11) ^ kl(t, 25)
  }
  Tl.s1_256 = Wme;

  function zme(t) {
    return kl(t, 7) ^ kl(t, 18) ^ t >>> 3
  }
  Tl.g0_256 = zme;

  function Hme(t) {
    return kl(t, 17) ^ kl(t, 19) ^ t >>> 10
  }
  Tl.g1_256 = Hme;
  var yg = Pr,
    qme = vg,
    Vme = Tl,
    ZC = yg.rotl32,
    av = yg.sum32,
    Kme = yg.sum32_5,
    Gme = Vme.ft_1,
    aL = qme.BlockHash,
    Zme = [1518500249, 1859775393, 2400959708, 3395469782];

  function Rl() {
    if (!(this instanceof Rl)) return new Rl;
    aL.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.W = new Array(80)
  }
  yg.inherits(Rl, aL);
  var Yme = Rl;
  Rl.blockSize = 512, Rl.outSize = 160, Rl.hmacStrength = 80, Rl.padLength = 64, Rl.prototype._update = function (t, e) {
    for (var r = this.W, n = 0; n < 16; n++) r[n] = t[e + n];
    for (; n < r.length; n++) r[n] = ZC(r[n - 3] ^ r[n - 8] ^ r[n - 14] ^ r[n - 16], 1);
    var i = this.h[0],
      s = this.h[1],
      o = this.h[2],
      a = this.h[3],
      c = this.h[4];
    for (n = 0; n < r.length; n++) {
      var l = ~~(n / 20),
        h = Kme(ZC(i, 5), Gme(l, s, o, a), c, r[n], Zme[l]);
      c = a, a = o, o = ZC(s, 30), s = i, i = h
    }
    this.h[0] = av(this.h[0], i), this.h[1] = av(this.h[1], s), this.h[2] = av(this.h[2], o), this.h[3] = av(this.h[3], a), this.h[4] = av(this.h[4], c)
  }, Rl.prototype._digest = function (t) {
    return t === "hex" ? yg.toHex32(this.h, "big") : yg.split32(this.h, "big")
  };
  var _g = Pr,
    Qme = vg,
    xg = Tl,
    Jme = ov,
    bc = _g.sum32,
    Xme = _g.sum32_4,
    ewe = _g.sum32_5,
    twe = xg.ch32,
    rwe = xg.maj32,
    nwe = xg.s0_256,
    iwe = xg.s1_256,
    swe = xg.g0_256,
    owe = xg.g1_256,
    cL = Qme.BlockHash,
    awe = [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];

  function Nl() {
    if (!(this instanceof Nl)) return new Nl;
    cL.call(this), this.h = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225], this.k = awe, this.W = new Array(64)
  }
  _g.inherits(Nl, cL);
  var lL = Nl;
  Nl.blockSize = 512, Nl.outSize = 256, Nl.hmacStrength = 192, Nl.padLength = 64, Nl.prototype._update = function (t, e) {
    for (var r = this.W, n = 0; n < 16; n++) r[n] = t[e + n];
    for (; n < r.length; n++) r[n] = Xme(owe(r[n - 2]), r[n - 7], swe(r[n - 15]), r[n - 16]);
    var i = this.h[0],
      s = this.h[1],
      o = this.h[2],
      a = this.h[3],
      c = this.h[4],
      l = this.h[5],
      h = this.h[6],
      f = this.h[7];
    for (Jme(this.k.length === r.length), n = 0; n < r.length; n++) {
      var w = ewe(f, iwe(c), twe(c, l, h), this.k[n], r[n]),
        b = bc(nwe(i), rwe(i, s, o));
      f = h, h = l, l = c, c = bc(a, w), a = o, o = s, s = i, i = bc(w, b)
    }
    this.h[0] = bc(this.h[0], i), this.h[1] = bc(this.h[1], s), this.h[2] = bc(this.h[2], o), this.h[3] = bc(this.h[3], a), this.h[4] = bc(this.h[4], c), this.h[5] = bc(this.h[5], l), this.h[6] = bc(this.h[6], h), this.h[7] = bc(this.h[7], f)
  }, Nl.prototype._digest = function (t) {
    return t === "hex" ? _g.toHex32(this.h, "big") : _g.split32(this.h, "big")
  };
  var YC = Pr,
    uL = lL;

  function Zu() {
    if (!(this instanceof Zu)) return new Zu;
    uL.call(this), this.h = [3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]
  }
  YC.inherits(Zu, uL);
  var cwe = Zu;
  Zu.blockSize = 512, Zu.outSize = 224, Zu.hmacStrength = 192, Zu.padLength = 64, Zu.prototype._digest = function (t) {
    return t === "hex" ? YC.toHex32(this.h.slice(0, 7), "big") : YC.split32(this.h.slice(0, 7), "big")
  };
  var mo = Pr,
    lwe = vg,
    uwe = ov,
    Ml = mo.rotr64_hi,
    Pl = mo.rotr64_lo,
    dL = mo.shr64_hi,
    hL = mo.shr64_lo,
    Ah = mo.sum64,
    QC = mo.sum64_hi,
    JC = mo.sum64_lo,
    dwe = mo.sum64_4_hi,
    hwe = mo.sum64_4_lo,
    fwe = mo.sum64_5_hi,
    pwe = mo.sum64_5_lo,
    fL = lwe.BlockHash,
    gwe = [1116352408, 3609767458, 1899447441, 602891725, 3049323471, 3964484399, 3921009573, 2173295548, 961987163, 4081628472, 1508970993, 3053834265, 2453635748, 2937671579, 2870763221, 3664609560, 3624381080, 2734883394, 310598401, 1164996542, 607225278, 1323610764, 1426881987, 3590304994, 1925078388, 4068182383, 2162078206, 991336113, 2614888103, 633803317, 3248222580, 3479774868, 3835390401, 2666613458, 4022224774, 944711139, 264347078, 2341262773, 604807628, 2007800933, 770255983, 1495990901, 1249150122, 1856431235, 1555081692, 3175218132, 1996064986, 2198950837, 2554220882, 3999719339, 2821834349, 766784016, 2952996808, 2566594879, 3210313671, 3203337956, 3336571891, 1034457026, 3584528711, 2466948901, 113926993, 3758326383, 338241895, 168717936, 666307205, 1188179964, 773529912, 1546045734, 1294757372, 1522805485, 1396182291, 2643833823, 1695183700, 2343527390, 1986661051, 1014477480, 2177026350, 1206759142, 2456956037, 344077627, 2730485921, 1290863460, 2820302411, 3158454273, 3259730800, 3505952657, 3345764771, 106217008, 3516065817, 3606008344, 3600352804, 1432725776, 4094571909, 1467031594, 275423344, 851169720, 430227734, 3100823752, 506948616, 1363258195, 659060556, 3750685593, 883997877, 3785050280, 958139571, 3318307427, 1322822218, 3812723403, 1537002063, 2003034995, 1747873779, 3602036899, 1955562222, 1575990012, 2024104815, 1125592928, 2227730452, 2716904306, 2361852424, 442776044, 2428436474, 593698344, 2756734187, 3733110249, 3204031479, 2999351573, 3329325298, 3815920427, 3391569614, 3928383900, 3515267271, 566280711, 3940187606, 3454069534, 4118630271, 4000239992, 116418474, 1914138554, 174292421, 2731055270, 289380356, 3203993006, 460393269, 320620315, 685471733, 587496836, 852142971, 1086792851, 1017036298, 365543100, 1126000580, 2618297676, 1288033470, 3409855158, 1501505948, 4234509866, 1607167915, 987167468, 1816402316, 1246189591];

  function yc() {
    if (!(this instanceof yc)) return new yc;
    fL.call(this), this.h = [1779033703, 4089235720, 3144134277, 2227873595, 1013904242, 4271175723, 2773480762, 1595750129, 1359893119, 2917565137, 2600822924, 725511199, 528734635, 4215389547, 1541459225, 327033209], this.k = gwe, this.W = new Array(160)
  }
  mo.inherits(yc, fL);
  var pL = yc;
  yc.blockSize = 1024, yc.outSize = 512, yc.hmacStrength = 192, yc.padLength = 128, yc.prototype._prepareBlock = function (t, e) {
    for (var r = this.W, n = 0; n < 32; n++) r[n] = t[e + n];
    for (; n < r.length; n += 2) {
      var i = Swe(r[n - 4], r[n - 3]),
        s = Iwe(r[n - 4], r[n - 3]),
        o = r[n - 14],
        a = r[n - 13],
        c = Ewe(r[n - 30], r[n - 29]),
        l = Awe(r[n - 30], r[n - 29]),
        h = r[n - 32],
        f = r[n - 31];
      r[n] = dwe(i, s, o, a, c, l, h, f), r[n + 1] = hwe(i, s, o, a, c, l, h, f)
    }
  }, yc.prototype._update = function (t, e) {
    this._prepareBlock(t, e);
    var r = this.W,
      n = this.h[0],
      i = this.h[1],
      s = this.h[2],
      o = this.h[3],
      a = this.h[4],
      c = this.h[5],
      l = this.h[6],
      h = this.h[7],
      f = this.h[8],
      w = this.h[9],
      b = this.h[10],
      C = this.h[11],
      M = this.h[12],
      N = this.h[13],
      $ = this.h[14],
      k = this.h[15];
    uwe(this.k.length === r.length);
    for (var B = 0; B < r.length; B += 2) {
      var F = $,
        D = k,
        V = xwe(f, w),
        R = Cwe(f, w),
        P = mwe(f, w, b, C, M),
        j = wwe(f, w, b, C, M, N),
        Y = this.k[B],
        U = this.k[B + 1],
        I = r[B],
        g = r[B + 1],
        u = fwe(F, D, V, R, P, j, Y, U, I, g),
        p = pwe(F, D, V, R, P, j, Y, U, I, g);
      F = ywe(n, i), D = _we(n, i), V = vwe(n, i, s, o, a), R = bwe(n, i, s, o, a, c);
      var v = QC(F, D, V, R),
        x = JC(F, D, V, R);
      $ = M, k = N, M = b, N = C, b = f, C = w, f = QC(l, h, u, p), w = JC(h, h, u, p), l = a, h = c, a = s, c = o, s = n, o = i, n = QC(u, p, v, x), i = JC(u, p, v, x)
    }
    Ah(this.h, 0, n, i), Ah(this.h, 2, s, o), Ah(this.h, 4, a, c), Ah(this.h, 6, l, h), Ah(this.h, 8, f, w), Ah(this.h, 10, b, C), Ah(this.h, 12, M, N), Ah(this.h, 14, $, k)
  }, yc.prototype._digest = function (t) {
    return t === "hex" ? mo.toHex32(this.h, "big") : mo.split32(this.h, "big")
  };

  function mwe(t, e, r, n, i) {
    var s = t & r ^ ~t & i;
    return s < 0 && (s += 4294967296), s
  }

  function wwe(t, e, r, n, i, s) {
    var o = e & n ^ ~e & s;
    return o < 0 && (o += 4294967296), o
  }

  function vwe(t, e, r, n, i) {
    var s = t & r ^ t & i ^ r & i;
    return s < 0 && (s += 4294967296), s
  }

  function bwe(t, e, r, n, i, s) {
    var o = e & n ^ e & s ^ n & s;
    return o < 0 && (o += 4294967296), o
  }

  function ywe(t, e) {
    var r = Ml(t, e, 28),
      n = Ml(e, t, 2),
      i = Ml(e, t, 7),
      s = r ^ n ^ i;
    return s < 0 && (s += 4294967296), s
  }

  function _we(t, e) {
    var r = Pl(t, e, 28),
      n = Pl(e, t, 2),
      i = Pl(e, t, 7),
      s = r ^ n ^ i;
    return s < 0 && (s += 4294967296), s
  }

  function xwe(t, e) {
    var r = Ml(t, e, 14),
      n = Ml(t, e, 18),
      i = Ml(e, t, 9),
      s = r ^ n ^ i;
    return s < 0 && (s += 4294967296), s
  }

  function Cwe(t, e) {
    var r = Pl(t, e, 14),
      n = Pl(t, e, 18),
      i = Pl(e, t, 9),
      s = r ^ n ^ i;
    return s < 0 && (s += 4294967296), s
  }

  function Ewe(t, e) {
    var r = Ml(t, e, 1),
      n = Ml(t, e, 8),
      i = dL(t, e, 7),
      s = r ^ n ^ i;
    return s < 0 && (s += 4294967296), s
  }

  function Awe(t, e) {
    var r = Pl(t, e, 1),
      n = Pl(t, e, 8),
      i = hL(t, e, 7),
      s = r ^ n ^ i;
    return s < 0 && (s += 4294967296), s
  }

  function Swe(t, e) {
    var r = Ml(t, e, 19),
      n = Ml(e, t, 29),
      i = dL(t, e, 6),
      s = r ^ n ^ i;
    return s < 0 && (s += 4294967296), s
  }

  function Iwe(t, e) {
    var r = Pl(t, e, 19),
      n = Pl(e, t, 29),
      i = hL(t, e, 6),
      s = r ^ n ^ i;
    return s < 0 && (s += 4294967296), s
  }
  var XC = Pr,
    gL = pL;

  function Yu() {
    if (!(this instanceof Yu)) return new Yu;
    gL.call(this), this.h = [3418070365, 3238371032, 1654270250, 914150663, 2438529370, 812702999, 355462360, 4144912697, 1731405415, 4290775857, 2394180231, 1750603025, 3675008525, 1694076839, 1203062813, 3204075428]
  }
  XC.inherits(Yu, gL);
  var Twe = Yu;
  Yu.blockSize = 1024, Yu.outSize = 384, Yu.hmacStrength = 192, Yu.padLength = 128, Yu.prototype._digest = function (t) {
    return t === "hex" ? XC.toHex32(this.h.slice(0, 12), "big") : XC.split32(this.h.slice(0, 12), "big")
  }, bg.sha1 = Yme, bg.sha224 = cwe, bg.sha256 = lL, bg.sha384 = Twe, bg.sha512 = pL;
  var mL = {},
    _0 = Pr,
    kwe = vg,
    o4 = _0.rotl32,
    wL = _0.sum32,
    cv = _0.sum32_3,
    vL = _0.sum32_4,
    bL = kwe.BlockHash;

  function $l() {
    if (!(this instanceof $l)) return new $l;
    bL.call(this), this.h = [1732584193, 4023233417, 2562383102, 271733878, 3285377520], this.endian = "little"
  }
  _0.inherits($l, bL), mL.ripemd160 = $l, $l.blockSize = 512, $l.outSize = 160, $l.hmacStrength = 192, $l.padLength = 64, $l.prototype._update = function (t, e) {
    for (var r = this.h[0], n = this.h[1], i = this.h[2], s = this.h[3], o = this.h[4], a = r, c = n, l = i, h = s, f = o, w = 0; w < 80; w++) {
      var b = wL(o4(vL(r, yL(w, n, i, s), t[Mwe[w] + e], Rwe(w)), $we[w]), o);
      r = o, o = s, s = o4(i, 10), i = n, n = b, b = wL(o4(vL(a, yL(79 - w, c, l, h), t[Pwe[w] + e], Nwe(w)), Owe[w]), f), a = f, f = h, h = o4(l, 10), l = c, c = b
    }
    b = cv(this.h[1], i, h), this.h[1] = cv(this.h[2], s, f), this.h[2] = cv(this.h[3], o, a), this.h[3] = cv(this.h[4], r, c), this.h[4] = cv(this.h[0], n, l), this.h[0] = b
  }, $l.prototype._digest = function (t) {
    return t === "hex" ? _0.toHex32(this.h, "little") : _0.split32(this.h, "little")
  };

  function yL(t, e, r, n) {
    return t <= 15 ? e ^ r ^ n : t <= 31 ? e & r | ~e & n : t <= 47 ? (e | ~r) ^ n : t <= 63 ? e & n | r & ~n : e ^ (r | ~n)
  }

  function Rwe(t) {
    return t <= 15 ? 0 : t <= 31 ? 1518500249 : t <= 47 ? 1859775393 : t <= 63 ? 2400959708 : 2840853838
  }

  function Nwe(t) {
    return t <= 15 ? 1352829926 : t <= 31 ? 1548603684 : t <= 47 ? 1836072691 : t <= 63 ? 2053994217 : 0
  }
  var Mwe = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13],
    Pwe = [5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11],
    $we = [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6],
    Owe = [8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11],
    Dwe = Pr,
    Lwe = ov;

  function Cg(t, e, r) {
    if (!(this instanceof Cg)) return new Cg(t, e, r);
    this.Hash = t, this.blockSize = t.blockSize / 8, this.outSize = t.outSize / 8, this.inner = null, this.outer = null, this._init(Dwe.toArray(e, r))
  }
  var Bwe = Cg;
  Cg.prototype._init = function (t) {
      t.length > this.blockSize && (t = new this.Hash().update(t).digest()), Lwe(t.length <= this.blockSize);
      for (var e = t.length; e < this.blockSize; e++) t.push(0);
      for (e = 0; e < t.length; e++) t[e] ^= 54;
      for (this.inner = new this.Hash().update(t), e = 0; e < t.length; e++) t[e] ^= 106;
      this.outer = new this.Hash().update(t)
    }, Cg.prototype.update = function (t, e) {
      return this.inner.update(t, e), this
    }, Cg.prototype.digest = function (t) {
      return this.outer.update(this.inner.digest()), this.outer.digest(t)
    },
    function (t) {
      var e = t;
      e.utils = Pr, e.common = vg, e.sha = bg, e.ripemd = mL, e.hmac = Bwe, e.sha1 = e.sha.sha1, e.sha256 = e.sha.sha256, e.sha224 = e.sha.sha224, e.sha384 = e.sha.sha384, e.sha512 = e.sha.sha512, e.ripemd160 = e.ripemd.ripemd160
    }(Il);

  function Eg(t, e, r) {
    return r = {
      path: e,
      exports: {},
      require: function (n, i) {
        return Uwe(n, i ?? r.path)
      }
    }, t(r, r.exports), r.exports
  }

  function Uwe() {
    throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")
  }
  var eE = _L;

  function _L(t, e) {
    if (!t) throw new Error(e || "Assertion failed")
  }
  _L.equal = function (t, e, r) {
    if (t != e) throw new Error(r || "Assertion failed: " + t + " != " + e)
  };
  var _c = Eg(function (t, e) {
      var r = e;

      function n(o, a) {
        if (Array.isArray(o)) return o.slice();
        if (!o) return [];
        var c = [];
        if (typeof o != "string") {
          for (var l = 0; l < o.length; l++) c[l] = o[l] | 0;
          return c
        }
        if (a === "hex") {
          o = o.replace(/[^a-z0-9]+/ig, ""), o.length % 2 !== 0 && (o = "0" + o);
          for (var l = 0; l < o.length; l += 2) c.push(parseInt(o[l] + o[l + 1], 16))
        } else
          for (var l = 0; l < o.length; l++) {
            var h = o.charCodeAt(l),
              f = h >> 8,
              w = h & 255;
            f ? c.push(f, w) : c.push(w)
          }
        return c
      }
      r.toArray = n;

      function i(o) {
        return o.length === 1 ? "0" + o : o
      }
      r.zero2 = i;

      function s(o) {
        for (var a = "", c = 0; c < o.length; c++) a += i(o[c].toString(16));
        return a
      }
      r.toHex = s, r.encode = function (o, a) {
        return a === "hex" ? s(o) : o
      }
    }),
    Wo = Eg(function (t, e) {
      var r = e;
      r.assert = eE, r.toArray = _c.toArray, r.zero2 = _c.zero2, r.toHex = _c.toHex, r.encode = _c.encode;

      function n(c, l, h) {
        var f = new Array(Math.max(c.bitLength(), h) + 1);
        f.fill(0);
        for (var w = 1 << l + 1, b = c.clone(), C = 0; C < f.length; C++) {
          var M, N = b.andln(w - 1);
          b.isOdd() ? (N > (w >> 1) - 1 ? M = (w >> 1) - N : M = N, b.isubn(M)) : M = 0, f[C] = M, b.iushrn(1)
        }
        return f
      }
      r.getNAF = n;

      function i(c, l) {
        var h = [
          [],
          []
        ];
        c = c.clone(), l = l.clone();
        for (var f = 0, w = 0, b; c.cmpn(-f) > 0 || l.cmpn(-w) > 0;) {
          var C = c.andln(3) + f & 3,
            M = l.andln(3) + w & 3;
          C === 3 && (C = -1), M === 3 && (M = -1);
          var N;
          C & 1 ? (b = c.andln(7) + f & 7, (b === 3 || b === 5) && M === 2 ? N = -C : N = C) : N = 0, h[0].push(N);
          var $;
          M & 1 ? (b = l.andln(7) + w & 7, (b === 3 || b === 5) && C === 2 ? $ = -M : $ = M) : $ = 0, h[1].push($), 2 * f === N + 1 && (f = 1 - f), 2 * w === $ + 1 && (w = 1 - w), c.iushrn(1), l.iushrn(1)
        }
        return h
      }
      r.getJSF = i;

      function s(c, l, h) {
        var f = "_" + l;
        c.prototype[l] = function () {
          return this[f] !== void 0 ? this[f] : this[f] = h.call(this)
        }
      }
      r.cachedProperty = s;

      function o(c) {
        return typeof c == "string" ? r.toArray(c, "hex") : c
      }
      r.parseBytes = o;

      function a(c) {
        return new dr(c, "hex", "le")
      }
      r.intFromLE = a
    }),
    a4 = Wo.getNAF,
    jwe = Wo.getJSF,
    c4 = Wo.assert;

  function Sh(t, e) {
    this.type = t, this.p = new dr(e.p, 16), this.red = e.prime ? dr.red(e.prime) : dr.mont(this.p), this.zero = new dr(0).toRed(this.red), this.one = new dr(1).toRed(this.red), this.two = new dr(2).toRed(this.red), this.n = e.n && new dr(e.n, 16), this.g = e.g && this.pointFromJSON(e.g, e.gRed), this._wnafT1 = new Array(4), this._wnafT2 = new Array(4), this._wnafT3 = new Array(4), this._wnafT4 = new Array(4), this._bitLength = this.n ? this.n.bitLength() : 0;
    var r = this.n && this.p.div(this.n);
    !r || r.cmpn(100) > 0 ? this.redN = null : (this._maxwellTrick = !0, this.redN = this.n.toRed(this.red))
  }
  var x0 = Sh;
  Sh.prototype.point = function () {
    throw new Error("Not implemented")
  }, Sh.prototype.validate = function () {
    throw new Error("Not implemented")
  }, Sh.prototype._fixedNafMul = function (t, e) {
    c4(t.precomputed);
    var r = t._getDoubles(),
      n = a4(e, 1, this._bitLength),
      i = (1 << r.step + 1) - (r.step % 2 === 0 ? 2 : 1);
    i /= 3;
    var s = [],
      o, a;
    for (o = 0; o < n.length; o += r.step) {
      a = 0;
      for (var c = o + r.step - 1; c >= o; c--) a = (a << 1) + n[c];
      s.push(a)
    }
    for (var l = this.jpoint(null, null, null), h = this.jpoint(null, null, null), f = i; f > 0; f--) {
      for (o = 0; o < s.length; o++) a = s[o], a === f ? h = h.mixedAdd(r.points[o]) : a === -f && (h = h.mixedAdd(r.points[o].neg()));
      l = l.add(h)
    }
    return l.toP()
  }, Sh.prototype._wnafMul = function (t, e) {
    var r = 4,
      n = t._getNAFPoints(r);
    r = n.wnd;
    for (var i = n.points, s = a4(e, r, this._bitLength), o = this.jpoint(null, null, null), a = s.length - 1; a >= 0; a--) {
      for (var c = 0; a >= 0 && s[a] === 0; a--) c++;
      if (a >= 0 && c++, o = o.dblp(c), a < 0) break;
      var l = s[a];
      c4(l !== 0), t.type === "affine" ? l > 0 ? o = o.mixedAdd(i[l - 1 >> 1]) : o = o.mixedAdd(i[-l - 1 >> 1].neg()) : l > 0 ? o = o.add(i[l - 1 >> 1]) : o = o.add(i[-l - 1 >> 1].neg())
    }
    return t.type === "affine" ? o.toP() : o
  }, Sh.prototype._wnafMulAdd = function (t, e, r, n, i) {
    var s = this._wnafT1,
      o = this._wnafT2,
      a = this._wnafT3,
      c = 0,
      l, h, f;
    for (l = 0; l < n; l++) {
      f = e[l];
      var w = f._getNAFPoints(t);
      s[l] = w.wnd, o[l] = w.points
    }
    for (l = n - 1; l >= 1; l -= 2) {
      var b = l - 1,
        C = l;
      if (s[b] !== 1 || s[C] !== 1) {
        a[b] = a4(r[b], s[b], this._bitLength), a[C] = a4(r[C], s[C], this._bitLength), c = Math.max(a[b].length, c), c = Math.max(a[C].length, c);
        continue
      }
      var M = [e[b], null, null, e[C]];
      e[b].y.cmp(e[C].y) === 0 ? (M[1] = e[b].add(e[C]), M[2] = e[b].toJ().mixedAdd(e[C].neg())) : e[b].y.cmp(e[C].y.redNeg()) === 0 ? (M[1] = e[b].toJ().mixedAdd(e[C]), M[2] = e[b].add(e[C].neg())) : (M[1] = e[b].toJ().mixedAdd(e[C]), M[2] = e[b].toJ().mixedAdd(e[C].neg()));
      var N = [-3, -1, -5, -7, 0, 7, 5, 1, 3],
        $ = jwe(r[b], r[C]);
      for (c = Math.max($[0].length, c), a[b] = new Array(c), a[C] = new Array(c), h = 0; h < c; h++) {
        var k = $[0][h] | 0,
          B = $[1][h] | 0;
        a[b][h] = N[(k + 1) * 3 + (B + 1)], a[C][h] = 0, o[b] = M
      }
    }
    var F = this.jpoint(null, null, null),
      D = this._wnafT4;
    for (l = c; l >= 0; l--) {
      for (var V = 0; l >= 0;) {
        var R = !0;
        for (h = 0; h < n; h++) D[h] = a[h][l] | 0, D[h] !== 0 && (R = !1);
        if (!R) break;
        V++, l--
      }
      if (l >= 0 && V++, F = F.dblp(V), l < 0) break;
      for (h = 0; h < n; h++) {
        var P = D[h];
        P !== 0 && (P > 0 ? f = o[h][P - 1 >> 1] : P < 0 && (f = o[h][-P - 1 >> 1].neg()), f.type === "affine" ? F = F.mixedAdd(f) : F = F.add(f))
      }
    }
    for (l = 0; l < n; l++) o[l] = null;
    return i ? F : F.toP()
  };

  function xa(t, e) {
    this.curve = t, this.type = e, this.precomputed = null
  }
  Sh.BasePoint = xa, xa.prototype.eq = function () {
    throw new Error("Not implemented")
  }, xa.prototype.validate = function () {
    return this.curve.validate(this)
  }, Sh.prototype.decodePoint = function (t, e) {
    t = Wo.toArray(t, e);
    var r = this.p.byteLength();
    if ((t[0] === 4 || t[0] === 6 || t[0] === 7) && t.length - 1 === 2 * r) {
      t[0] === 6 ? c4(t[t.length - 1] % 2 === 0) : t[0] === 7 && c4(t[t.length - 1] % 2 === 1);
      var n = this.point(t.slice(1, 1 + r), t.slice(1 + r, 1 + 2 * r));
      return n
    } else if ((t[0] === 2 || t[0] === 3) && t.length - 1 === r) return this.pointFromX(t.slice(1, 1 + r), t[0] === 3);
    throw new Error("Unknown point format")
  }, xa.prototype.encodeCompressed = function (t) {
    return this.encode(t, !0)
  }, xa.prototype._encode = function (t) {
    var e = this.curve.p.byteLength(),
      r = this.getX().toArray("be", e);
    return t ? [this.getY().isEven() ? 2 : 3].concat(r) : [4].concat(r, this.getY().toArray("be", e))
  }, xa.prototype.encode = function (t, e) {
    return Wo.encode(this._encode(e), t)
  }, xa.prototype.precompute = function (t) {
    if (this.precomputed) return this;
    var e = {
      doubles: null,
      naf: null,
      beta: null
    };
    return e.naf = this._getNAFPoints(8), e.doubles = this._getDoubles(4, t), e.beta = this._getBeta(), this.precomputed = e, this
  }, xa.prototype._hasDoubles = function (t) {
    if (!this.precomputed) return !1;
    var e = this.precomputed.doubles;
    return e ? e.points.length >= Math.ceil((t.bitLength() + 1) / e.step) : !1
  }, xa.prototype._getDoubles = function (t, e) {
    if (this.precomputed && this.precomputed.doubles) return this.precomputed.doubles;
    for (var r = [this], n = this, i = 0; i < e; i += t) {
      for (var s = 0; s < t; s++) n = n.dbl();
      r.push(n)
    }
    return {
      step: t,
      points: r
    }
  }, xa.prototype._getNAFPoints = function (t) {
    if (this.precomputed && this.precomputed.naf) return this.precomputed.naf;
    for (var e = [this], r = (1 << t) - 1, n = r === 1 ? null : this.dbl(), i = 1; i < r; i++) e[i] = e[i - 1].add(n);
    return {
      wnd: t,
      points: e
    }
  }, xa.prototype._getBeta = function () {
    return null
  }, xa.prototype.dblp = function (t) {
    for (var e = this, r = 0; r < t; r++) e = e.dbl();
    return e
  };
  var tE = Eg(function (t) {
      typeof Object.create == "function" ? t.exports = function (e, r) {
        r && (e.super_ = r, e.prototype = Object.create(r.prototype, {
          constructor: {
            value: e,
            enumerable: !1,
            writable: !0,
            configurable: !0
          }
        }))
      } : t.exports = function (e, r) {
        if (r) {
          e.super_ = r;
          var n = function () {};
          n.prototype = r.prototype, e.prototype = new n, e.prototype.constructor = e
        }
      }
    }),
    Fwe = Wo.assert;

  function Ca(t) {
    x0.call(this, "short", t), this.a = new dr(t.a, 16).toRed(this.red), this.b = new dr(t.b, 16).toRed(this.red), this.tinv = this.two.redInvm(), this.zeroA = this.a.fromRed().cmpn(0) === 0, this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0, this.endo = this._getEndomorphism(t), this._endoWnafT1 = new Array(4), this._endoWnafT2 = new Array(4)
  }
  tE(Ca, x0);
  var Wwe = Ca;
  Ca.prototype._getEndomorphism = function (t) {
    if (!(!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1)) {
      var e, r;
      if (t.beta) e = new dr(t.beta, 16).toRed(this.red);
      else {
        var n = this._getEndoRoots(this.p);
        e = n[0].cmp(n[1]) < 0 ? n[0] : n[1], e = e.toRed(this.red)
      }
      if (t.lambda) r = new dr(t.lambda, 16);
      else {
        var i = this._getEndoRoots(this.n);
        this.g.mul(i[0]).x.cmp(this.g.x.redMul(e)) === 0 ? r = i[0] : (r = i[1], Fwe(this.g.mul(r).x.cmp(this.g.x.redMul(e)) === 0))
      }
      var s;
      return t.basis ? s = t.basis.map(function (o) {
        return {
          a: new dr(o.a, 16),
          b: new dr(o.b, 16)
        }
      }) : s = this._getEndoBasis(r), {
        beta: e,
        lambda: r,
        basis: s
      }
    }
  }, Ca.prototype._getEndoRoots = function (t) {
    var e = t === this.p ? this.red : dr.mont(t),
      r = new dr(2).toRed(e).redInvm(),
      n = r.redNeg(),
      i = new dr(3).toRed(e).redNeg().redSqrt().redMul(r),
      s = n.redAdd(i).fromRed(),
      o = n.redSub(i).fromRed();
    return [s, o]
  }, Ca.prototype._getEndoBasis = function (t) {
    for (var e = this.n.ushrn(Math.floor(this.n.bitLength() / 2)), r = t, n = this.n.clone(), i = new dr(1), s = new dr(0), o = new dr(0), a = new dr(1), c, l, h, f, w, b, C, M = 0, N, $; r.cmpn(0) !== 0;) {
      var k = n.div(r);
      N = n.sub(k.mul(r)), $ = o.sub(k.mul(i));
      var B = a.sub(k.mul(s));
      if (!h && N.cmp(e) < 0) c = C.neg(), l = i, h = N.neg(), f = $;
      else if (h && ++M === 2) break;
      C = N, n = r, r = N, o = i, i = $, a = s, s = B
    }
    w = N.neg(), b = $;
    var F = h.sqr().add(f.sqr()),
      D = w.sqr().add(b.sqr());
    return D.cmp(F) >= 0 && (w = c, b = l), h.negative && (h = h.neg(), f = f.neg()), w.negative && (w = w.neg(), b = b.neg()), [{
      a: h,
      b: f
    }, {
      a: w,
      b
    }]
  }, Ca.prototype._endoSplit = function (t) {
    var e = this.endo.basis,
      r = e[0],
      n = e[1],
      i = n.b.mul(t).divRound(this.n),
      s = r.b.neg().mul(t).divRound(this.n),
      o = i.mul(r.a),
      a = s.mul(n.a),
      c = i.mul(r.b),
      l = s.mul(n.b),
      h = t.sub(o).sub(a),
      f = c.add(l).neg();
    return {
      k1: h,
      k2: f
    }
  }, Ca.prototype.pointFromX = function (t, e) {
    t = new dr(t, 16), t.red || (t = t.toRed(this.red));
    var r = t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),
      n = r.redSqrt();
    if (n.redSqr().redSub(r).cmp(this.zero) !== 0) throw new Error("invalid point");
    var i = n.fromRed().isOdd();
    return (e && !i || !e && i) && (n = n.redNeg()), this.point(t, n)
  }, Ca.prototype.validate = function (t) {
    if (t.inf) return !0;
    var e = t.x,
      r = t.y,
      n = this.a.redMul(e),
      i = e.redSqr().redMul(e).redIAdd(n).redIAdd(this.b);
    return r.redSqr().redISub(i).cmpn(0) === 0
  }, Ca.prototype._endoWnafMulAdd = function (t, e, r) {
    for (var n = this._endoWnafT1, i = this._endoWnafT2, s = 0; s < t.length; s++) {
      var o = this._endoSplit(e[s]),
        a = t[s],
        c = a._getBeta();
      o.k1.negative && (o.k1.ineg(), a = a.neg(!0)), o.k2.negative && (o.k2.ineg(), c = c.neg(!0)), n[s * 2] = a, n[s * 2 + 1] = c, i[s * 2] = o.k1, i[s * 2 + 1] = o.k2
    }
    for (var l = this._wnafMulAdd(1, n, i, s * 2, r), h = 0; h < s * 2; h++) n[h] = null, i[h] = null;
    return l
  };

  function Vi(t, e, r, n) {
    x0.BasePoint.call(this, t, "affine"), e === null && r === null ? (this.x = null, this.y = null, this.inf = !0) : (this.x = new dr(e, 16), this.y = new dr(r, 16), n && (this.x.forceRed(this.curve.red), this.y.forceRed(this.curve.red)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.inf = !1)
  }
  tE(Vi, x0.BasePoint), Ca.prototype.point = function (t, e, r) {
    return new Vi(this, t, e, r)
  }, Ca.prototype.pointFromJSON = function (t, e) {
    return Vi.fromJSON(this, t, e)
  }, Vi.prototype._getBeta = function () {
    if (this.curve.endo) {
      var t = this.precomputed;
      if (t && t.beta) return t.beta;
      var e = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y);
      if (t) {
        var r = this.curve,
          n = function (i) {
            return r.point(i.x.redMul(r.endo.beta), i.y)
          };
        t.beta = e, e.precomputed = {
          beta: null,
          naf: t.naf && {
            wnd: t.naf.wnd,
            points: t.naf.points.map(n)
          },
          doubles: t.doubles && {
            step: t.doubles.step,
            points: t.doubles.points.map(n)
          }
        }
      }
      return e
    }
  }, Vi.prototype.toJSON = function () {
    return this.precomputed ? [this.x, this.y, this.precomputed && {
      doubles: this.precomputed.doubles && {
        step: this.precomputed.doubles.step,
        points: this.precomputed.doubles.points.slice(1)
      },
      naf: this.precomputed.naf && {
        wnd: this.precomputed.naf.wnd,
        points: this.precomputed.naf.points.slice(1)
      }
    }] : [this.x, this.y]
  }, Vi.fromJSON = function (t, e, r) {
    typeof e == "string" && (e = JSON.parse(e));
    var n = t.point(e[0], e[1], r);
    if (!e[2]) return n;

    function i(o) {
      return t.point(o[0], o[1], r)
    }
    var s = e[2];
    return n.precomputed = {
      beta: null,
      doubles: s.doubles && {
        step: s.doubles.step,
        points: [n].concat(s.doubles.points.map(i))
      },
      naf: s.naf && {
        wnd: s.naf.wnd,
        points: [n].concat(s.naf.points.map(i))
      }
    }, n
  }, Vi.prototype.inspect = function () {
    return this.isInfinity() ? "<EC Point Infinity>" : "<EC Point x: " + this.x.fromRed().toString(16, 2) + " y: " + this.y.fromRed().toString(16, 2) + ">"
  }, Vi.prototype.isInfinity = function () {
    return this.inf
  }, Vi.prototype.add = function (t) {
    if (this.inf) return t;
    if (t.inf) return this;
    if (this.eq(t)) return this.dbl();
    if (this.neg().eq(t)) return this.curve.point(null, null);
    if (this.x.cmp(t.x) === 0) return this.curve.point(null, null);
    var e = this.y.redSub(t.y);
    e.cmpn(0) !== 0 && (e = e.redMul(this.x.redSub(t.x).redInvm()));
    var r = e.redSqr().redISub(this.x).redISub(t.x),
      n = e.redMul(this.x.redSub(r)).redISub(this.y);
    return this.curve.point(r, n)
  }, Vi.prototype.dbl = function () {
    if (this.inf) return this;
    var t = this.y.redAdd(this.y);
    if (t.cmpn(0) === 0) return this.curve.point(null, null);
    var e = this.curve.a,
      r = this.x.redSqr(),
      n = t.redInvm(),
      i = r.redAdd(r).redIAdd(r).redIAdd(e).redMul(n),
      s = i.redSqr().redISub(this.x.redAdd(this.x)),
      o = i.redMul(this.x.redSub(s)).redISub(this.y);
    return this.curve.point(s, o)
  }, Vi.prototype.getX = function () {
    return this.x.fromRed()
  }, Vi.prototype.getY = function () {
    return this.y.fromRed()
  }, Vi.prototype.mul = function (t) {
    return t = new dr(t, 16), this.isInfinity() ? this : this._hasDoubles(t) ? this.curve._fixedNafMul(this, t) : this.curve.endo ? this.curve._endoWnafMulAdd([this], [t]) : this.curve._wnafMul(this, t)
  }, Vi.prototype.mulAdd = function (t, e, r) {
    var n = [this, e],
      i = [t, r];
    return this.curve.endo ? this.curve._endoWnafMulAdd(n, i) : this.curve._wnafMulAdd(1, n, i, 2)
  }, Vi.prototype.jmulAdd = function (t, e, r) {
    var n = [this, e],
      i = [t, r];
    return this.curve.endo ? this.curve._endoWnafMulAdd(n, i, !0) : this.curve._wnafMulAdd(1, n, i, 2, !0)
  }, Vi.prototype.eq = function (t) {
    return this === t || this.inf === t.inf && (this.inf || this.x.cmp(t.x) === 0 && this.y.cmp(t.y) === 0)
  }, Vi.prototype.neg = function (t) {
    if (this.inf) return this;
    var e = this.curve.point(this.x, this.y.redNeg());
    if (t && this.precomputed) {
      var r = this.precomputed,
        n = function (i) {
          return i.neg()
        };
      e.precomputed = {
        naf: r.naf && {
          wnd: r.naf.wnd,
          points: r.naf.points.map(n)
        },
        doubles: r.doubles && {
          step: r.doubles.step,
          points: r.doubles.points.map(n)
        }
      }
    }
    return e
  }, Vi.prototype.toJ = function () {
    if (this.inf) return this.curve.jpoint(null, null, null);
    var t = this.curve.jpoint(this.x, this.y, this.curve.one);
    return t
  };

  function ss(t, e, r, n) {
    x0.BasePoint.call(this, t, "jacobian"), e === null && r === null && n === null ? (this.x = this.curve.one, this.y = this.curve.one, this.z = new dr(0)) : (this.x = new dr(e, 16), this.y = new dr(r, 16), this.z = new dr(n, 16)), this.x.red || (this.x = this.x.toRed(this.curve.red)), this.y.red || (this.y = this.y.toRed(this.curve.red)), this.z.red || (this.z = this.z.toRed(this.curve.red)), this.zOne = this.z === this.curve.one
  }
  tE(ss, x0.BasePoint), Ca.prototype.jpoint = function (t, e, r) {
    return new ss(this, t, e, r)
  }, ss.prototype.toP = function () {
    if (this.isInfinity()) return this.curve.point(null, null);
    var t = this.z.redInvm(),
      e = t.redSqr(),
      r = this.x.redMul(e),
      n = this.y.redMul(e).redMul(t);
    return this.curve.point(r, n)
  }, ss.prototype.neg = function () {
    return this.curve.jpoint(this.x, this.y.redNeg(), this.z)
  }, ss.prototype.add = function (t) {
    if (this.isInfinity()) return t;
    if (t.isInfinity()) return this;
    var e = t.z.redSqr(),
      r = this.z.redSqr(),
      n = this.x.redMul(e),
      i = t.x.redMul(r),
      s = this.y.redMul(e.redMul(t.z)),
      o = t.y.redMul(r.redMul(this.z)),
      a = n.redSub(i),
      c = s.redSub(o);
    if (a.cmpn(0) === 0) return c.cmpn(0) !== 0 ? this.curve.jpoint(null, null, null) : this.dbl();
    var l = a.redSqr(),
      h = l.redMul(a),
      f = n.redMul(l),
      w = c.redSqr().redIAdd(h).redISub(f).redISub(f),
      b = c.redMul(f.redISub(w)).redISub(s.redMul(h)),
      C = this.z.redMul(t.z).redMul(a);
    return this.curve.jpoint(w, b, C)
  }, ss.prototype.mixedAdd = function (t) {
    if (this.isInfinity()) return t.toJ();
    if (t.isInfinity()) return this;
    var e = this.z.redSqr(),
      r = this.x,
      n = t.x.redMul(e),
      i = this.y,
      s = t.y.redMul(e).redMul(this.z),
      o = r.redSub(n),
      a = i.redSub(s);
    if (o.cmpn(0) === 0) return a.cmpn(0) !== 0 ? this.curve.jpoint(null, null, null) : this.dbl();
    var c = o.redSqr(),
      l = c.redMul(o),
      h = r.redMul(c),
      f = a.redSqr().redIAdd(l).redISub(h).redISub(h),
      w = a.redMul(h.redISub(f)).redISub(i.redMul(l)),
      b = this.z.redMul(o);
    return this.curve.jpoint(f, w, b)
  }, ss.prototype.dblp = function (t) {
    if (t === 0) return this;
    if (this.isInfinity()) return this;
    if (!t) return this.dbl();
    var e;
    if (this.curve.zeroA || this.curve.threeA) {
      var r = this;
      for (e = 0; e < t; e++) r = r.dbl();
      return r
    }
    var n = this.curve.a,
      i = this.curve.tinv,
      s = this.x,
      o = this.y,
      a = this.z,
      c = a.redSqr().redSqr(),
      l = o.redAdd(o);
    for (e = 0; e < t; e++) {
      var h = s.redSqr(),
        f = l.redSqr(),
        w = f.redSqr(),
        b = h.redAdd(h).redIAdd(h).redIAdd(n.redMul(c)),
        C = s.redMul(f),
        M = b.redSqr().redISub(C.redAdd(C)),
        N = C.redISub(M),
        $ = b.redMul(N);
      $ = $.redIAdd($).redISub(w);
      var k = l.redMul(a);
      e + 1 < t && (c = c.redMul(w)), s = M, a = k, l = $
    }
    return this.curve.jpoint(s, l.redMul(i), a)
  }, ss.prototype.dbl = function () {
    return this.isInfinity() ? this : this.curve.zeroA ? this._zeroDbl() : this.curve.threeA ? this._threeDbl() : this._dbl()
  }, ss.prototype._zeroDbl = function () {
    var t, e, r;
    if (this.zOne) {
      var n = this.x.redSqr(),
        i = this.y.redSqr(),
        s = i.redSqr(),
        o = this.x.redAdd(i).redSqr().redISub(n).redISub(s);
      o = o.redIAdd(o);
      var a = n.redAdd(n).redIAdd(n),
        c = a.redSqr().redISub(o).redISub(o),
        l = s.redIAdd(s);
      l = l.redIAdd(l), l = l.redIAdd(l), t = c, e = a.redMul(o.redISub(c)).redISub(l), r = this.y.redAdd(this.y)
    } else {
      var h = this.x.redSqr(),
        f = this.y.redSqr(),
        w = f.redSqr(),
        b = this.x.redAdd(f).redSqr().redISub(h).redISub(w);
      b = b.redIAdd(b);
      var C = h.redAdd(h).redIAdd(h),
        M = C.redSqr(),
        N = w.redIAdd(w);
      N = N.redIAdd(N), N = N.redIAdd(N), t = M.redISub(b).redISub(b), e = C.redMul(b.redISub(t)).redISub(N), r = this.y.redMul(this.z), r = r.redIAdd(r)
    }
    return this.curve.jpoint(t, e, r)
  }, ss.prototype._threeDbl = function () {
    var t, e, r;
    if (this.zOne) {
      var n = this.x.redSqr(),
        i = this.y.redSqr(),
        s = i.redSqr(),
        o = this.x.redAdd(i).redSqr().redISub(n).redISub(s);
      o = o.redIAdd(o);
      var a = n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),
        c = a.redSqr().redISub(o).redISub(o);
      t = c;
      var l = s.redIAdd(s);
      l = l.redIAdd(l), l = l.redIAdd(l), e = a.redMul(o.redISub(c)).redISub(l), r = this.y.redAdd(this.y)
    } else {
      var h = this.z.redSqr(),
        f = this.y.redSqr(),
        w = this.x.redMul(f),
        b = this.x.redSub(h).redMul(this.x.redAdd(h));
      b = b.redAdd(b).redIAdd(b);
      var C = w.redIAdd(w);
      C = C.redIAdd(C);
      var M = C.redAdd(C);
      t = b.redSqr().redISub(M), r = this.y.redAdd(this.z).redSqr().redISub(f).redISub(h);
      var N = f.redSqr();
      N = N.redIAdd(N), N = N.redIAdd(N), N = N.redIAdd(N), e = b.redMul(C.redISub(t)).redISub(N)
    }
    return this.curve.jpoint(t, e, r)
  }, ss.prototype._dbl = function () {
    var t = this.curve.a,
      e = this.x,
      r = this.y,
      n = this.z,
      i = n.redSqr().redSqr(),
      s = e.redSqr(),
      o = r.redSqr(),
      a = s.redAdd(s).redIAdd(s).redIAdd(t.redMul(i)),
      c = e.redAdd(e);
    c = c.redIAdd(c);
    var l = c.redMul(o),
      h = a.redSqr().redISub(l.redAdd(l)),
      f = l.redISub(h),
      w = o.redSqr();
    w = w.redIAdd(w), w = w.redIAdd(w), w = w.redIAdd(w);
    var b = a.redMul(f).redISub(w),
      C = r.redAdd(r).redMul(n);
    return this.curve.jpoint(h, b, C)
  }, ss.prototype.trpl = function () {
    if (!this.curve.zeroA) return this.dbl().add(this);
    var t = this.x.redSqr(),
      e = this.y.redSqr(),
      r = this.z.redSqr(),
      n = e.redSqr(),
      i = t.redAdd(t).redIAdd(t),
      s = i.redSqr(),
      o = this.x.redAdd(e).redSqr().redISub(t).redISub(n);
    o = o.redIAdd(o), o = o.redAdd(o).redIAdd(o), o = o.redISub(s);
    var a = o.redSqr(),
      c = n.redIAdd(n);
    c = c.redIAdd(c), c = c.redIAdd(c), c = c.redIAdd(c);
    var l = i.redIAdd(o).redSqr().redISub(s).redISub(a).redISub(c),
      h = e.redMul(l);
    h = h.redIAdd(h), h = h.redIAdd(h);
    var f = this.x.redMul(a).redISub(h);
    f = f.redIAdd(f), f = f.redIAdd(f);
    var w = this.y.redMul(l.redMul(c.redISub(l)).redISub(o.redMul(a)));
    w = w.redIAdd(w), w = w.redIAdd(w), w = w.redIAdd(w);
    var b = this.z.redAdd(o).redSqr().redISub(r).redISub(a);
    return this.curve.jpoint(f, w, b)
  }, ss.prototype.mul = function (t, e) {
    return t = new dr(t, e), this.curve._wnafMul(this, t)
  }, ss.prototype.eq = function (t) {
    if (t.type === "affine") return this.eq(t.toJ());
    if (this === t) return !0;
    var e = this.z.redSqr(),
      r = t.z.redSqr();
    if (this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0) !== 0) return !1;
    var n = e.redMul(this.z),
      i = r.redMul(t.z);
    return this.y.redMul(i).redISub(t.y.redMul(n)).cmpn(0) === 0
  }, ss.prototype.eqXToP = function (t) {
    var e = this.z.redSqr(),
      r = t.toRed(this.curve.red).redMul(e);
    if (this.x.cmp(r) === 0) return !0;
    for (var n = t.clone(), i = this.curve.redN.redMul(e);;) {
      if (n.iadd(this.curve.n), n.cmp(this.curve.p) >= 0) return !1;
      if (r.redIAdd(i), this.x.cmp(r) === 0) return !0
    }
  }, ss.prototype.inspect = function () {
    return this.isInfinity() ? "<EC JPoint Infinity>" : "<EC JPoint x: " + this.x.toString(16, 2) + " y: " + this.y.toString(16, 2) + " z: " + this.z.toString(16, 2) + ">"
  }, ss.prototype.isInfinity = function () {
    return this.z.cmpn(0) === 0
  };
  var l4 = Eg(function (t, e) {
      var r = e;
      r.base = x0, r.short = Wwe, r.mont = null, r.edwards = null
    }),
    u4 = Eg(function (t, e) {
      var r = e,
        n = Wo.assert;

      function i(a) {
        a.type === "short" ? this.curve = new l4.short(a) : a.type === "edwards" ? this.curve = new l4.edwards(a) : this.curve = new l4.mont(a), this.g = this.curve.g, this.n = this.curve.n, this.hash = a.hash, n(this.g.validate(), "Invalid curve"), n(this.g.mul(this.n).isInfinity(), "Invalid curve, G*N != O")
      }
      r.PresetCurve = i;

      function s(a, c) {
        Object.defineProperty(r, a, {
          configurable: !0,
          enumerable: !0,
          get: function () {
            var l = new i(c);
            return Object.defineProperty(r, a, {
              configurable: !0,
              enumerable: !0,
              value: l
            }), l
          }
        })
      }
      s("p192", {
        type: "short",
        prime: "p192",
        p: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",
        a: "ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",
        b: "64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",
        n: "ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",
        hash: Il.sha256,
        gRed: !1,
        g: ["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012", "07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]
      }), s("p224", {
        type: "short",
        prime: "p224",
        p: "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",
        a: "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",
        b: "b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",
        n: "ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",
        hash: Il.sha256,
        gRed: !1,
        g: ["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21", "bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]
      }), s("p256", {
        type: "short",
        prime: null,
        p: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",
        a: "ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",
        b: "5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",
        n: "ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",
        hash: Il.sha256,
        gRed: !1,
        g: ["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296", "4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]
      }), s("p384", {
        type: "short",
        prime: null,
        p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",
        a: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",
        b: "b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",
        n: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",
        hash: Il.sha384,
        gRed: !1,
        g: ["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7", "3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]
      }), s("p521", {
        type: "short",
        prime: null,
        p: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",
        a: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",
        b: "00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",
        n: "000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",
        hash: Il.sha512,
        gRed: !1,
        g: ["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66", "00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]
      }), s("curve25519", {
        type: "mont",
        prime: "p25519",
        p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",
        a: "76d06",
        b: "1",
        n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",
        hash: Il.sha256,
        gRed: !1,
        g: ["9"]
      }), s("ed25519", {
        type: "edwards",
        prime: "p25519",
        p: "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",
        a: "-1",
        c: "1",
        d: "52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",
        n: "1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",
        hash: Il.sha256,
        gRed: !1,
        g: ["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a", "6666666666666666666666666666666666666666666666666666666666666658"]
      });
      var o;
      try {
        o = null.crash()
      } catch {
        o = void 0
      }
      s("secp256k1", {
        type: "short",
        prime: "k256",
        p: "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",
        a: "0",
        b: "7",
        n: "ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",
        h: "1",
        hash: Il.sha256,
        beta: "7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",
        lambda: "5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",
        basis: [{
          a: "3086d221a7d46bcde86c90e49284eb15",
          b: "-e4437ed6010e88286f547fa90abfe4c3"
        }, {
          a: "114ca50f7a8e2f3f657c1108d9d44cfd8",
          b: "3086d221a7d46bcde86c90e49284eb15"
        }],
        gRed: !1,
        g: ["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8", o]
      })
    });

  function Ih(t) {
    if (!(this instanceof Ih)) return new Ih(t);
    this.hash = t.hash, this.predResist = !!t.predResist, this.outLen = this.hash.outSize, this.minEntropy = t.minEntropy || this.hash.hmacStrength, this._reseed = null, this.reseedInterval = null, this.K = null, this.V = null;
    var e = _c.toArray(t.entropy, t.entropyEnc || "hex"),
      r = _c.toArray(t.nonce, t.nonceEnc || "hex"),
      n = _c.toArray(t.pers, t.persEnc || "hex");
    eE(e.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._init(e, r, n)
  }
  var xL = Ih;
  Ih.prototype._init = function (t, e, r) {
    var n = t.concat(e).concat(r);
    this.K = new Array(this.outLen / 8), this.V = new Array(this.outLen / 8);
    for (var i = 0; i < this.V.length; i++) this.K[i] = 0, this.V[i] = 1;
    this._update(n), this._reseed = 1, this.reseedInterval = 281474976710656
  }, Ih.prototype._hmac = function () {
    return new Il.hmac(this.hash, this.K)
  }, Ih.prototype._update = function (t) {
    var e = this._hmac().update(this.V).update([0]);
    t && (e = e.update(t)), this.K = e.digest(), this.V = this._hmac().update(this.V).digest(), t && (this.K = this._hmac().update(this.V).update([1]).update(t).digest(), this.V = this._hmac().update(this.V).digest())
  }, Ih.prototype.reseed = function (t, e, r, n) {
    typeof e != "string" && (n = r, r = e, e = null), t = _c.toArray(t, e), r = _c.toArray(r, n), eE(t.length >= this.minEntropy / 8, "Not enough entropy. Minimum is: " + this.minEntropy + " bits"), this._update(t.concat(r || [])), this._reseed = 1
  }, Ih.prototype.generate = function (t, e, r, n) {
    if (this._reseed > this.reseedInterval) throw new Error("Reseed is required");
    typeof e != "string" && (n = r, r = e, e = null), r && (r = _c.toArray(r, n || "hex"), this._update(r));
    for (var i = []; i.length < t;) this.V = this._hmac().update(this.V).digest(), i = i.concat(this.V);
    var s = i.slice(0, t);
    return this._update(r), this._reseed++, _c.encode(s, e)
  };
  var rE = Wo.assert;

  function Es(t, e) {
    this.ec = t, this.priv = null, this.pub = null, e.priv && this._importPrivate(e.priv, e.privEnc), e.pub && this._importPublic(e.pub, e.pubEnc)
  }
  var nE = Es;
  Es.fromPublic = function (t, e, r) {
    return e instanceof Es ? e : new Es(t, {
      pub: e,
      pubEnc: r
    })
  }, Es.fromPrivate = function (t, e, r) {
    return e instanceof Es ? e : new Es(t, {
      priv: e,
      privEnc: r
    })
  }, Es.prototype.validate = function () {
    var t = this.getPublic();
    return t.isInfinity() ? {
      result: !1,
      reason: "Invalid public key"
    } : t.validate() ? t.mul(this.ec.curve.n).isInfinity() ? {
      result: !0,
      reason: null
    } : {
      result: !1,
      reason: "Public key * N != O"
    } : {
      result: !1,
      reason: "Public key is not a point"
    }
  }, Es.prototype.getPublic = function (t, e) {
    return typeof t == "string" && (e = t, t = null), this.pub || (this.pub = this.ec.g.mul(this.priv)), e ? this.pub.encode(e, t) : this.pub
  }, Es.prototype.getPrivate = function (t) {
    return t === "hex" ? this.priv.toString(16, 2) : this.priv
  }, Es.prototype._importPrivate = function (t, e) {
    this.priv = new dr(t, e || 16), this.priv = this.priv.umod(this.ec.curve.n)
  }, Es.prototype._importPublic = function (t, e) {
    if (t.x || t.y) {
      this.ec.curve.type === "mont" ? rE(t.x, "Need x coordinate") : (this.ec.curve.type === "short" || this.ec.curve.type === "edwards") && rE(t.x && t.y, "Need both x and y coordinate"), this.pub = this.ec.curve.point(t.x, t.y);
      return
    }
    this.pub = this.ec.curve.decodePoint(t, e)
  }, Es.prototype.derive = function (t) {
    return t.validate() || rE(t.validate(), "public point not validated"), t.mul(this.priv).getX()
  }, Es.prototype.sign = function (t, e, r) {
    return this.ec.sign(t, this, e, r)
  }, Es.prototype.verify = function (t, e) {
    return this.ec.verify(t, e, this)
  }, Es.prototype.inspect = function () {
    return "<Key priv: " + (this.priv && this.priv.toString(16, 2)) + " pub: " + (this.pub && this.pub.inspect()) + " >"
  };
  var zwe = Wo.assert;

  function d4(t, e) {
    if (t instanceof d4) return t;
    this._importDER(t, e) || (zwe(t.r && t.s, "Signature without r or s"), this.r = new dr(t.r, 16), this.s = new dr(t.s, 16), t.recoveryParam === void 0 ? this.recoveryParam = null : this.recoveryParam = t.recoveryParam)
  }
  var h4 = d4;

  function Hwe() {
    this.place = 0
  }

  function iE(t, e) {
    var r = t[e.place++];
    if (!(r & 128)) return r;
    var n = r & 15;
    if (n === 0 || n > 4) return !1;
    for (var i = 0, s = 0, o = e.place; s < n; s++, o++) i <<= 8, i |= t[o], i >>>= 0;
    return i <= 127 ? !1 : (e.place = o, i)
  }

  function CL(t) {
    for (var e = 0, r = t.length - 1; !t[e] && !(t[e + 1] & 128) && e < r;) e++;
    return e === 0 ? t : t.slice(e)
  }
  d4.prototype._importDER = function (t, e) {
    t = Wo.toArray(t, e);
    var r = new Hwe;
    if (t[r.place++] !== 48) return !1;
    var n = iE(t, r);
    if (n === !1 || n + r.place !== t.length || t[r.place++] !== 2) return !1;
    var i = iE(t, r);
    if (i === !1) return !1;
    var s = t.slice(r.place, i + r.place);
    if (r.place += i, t[r.place++] !== 2) return !1;
    var o = iE(t, r);
    if (o === !1 || t.length !== o + r.place) return !1;
    var a = t.slice(r.place, o + r.place);
    if (s[0] === 0)
      if (s[1] & 128) s = s.slice(1);
      else return !1;
    if (a[0] === 0)
      if (a[1] & 128) a = a.slice(1);
      else return !1;
    return this.r = new dr(s), this.s = new dr(a), this.recoveryParam = null, !0
  };

  function sE(t, e) {
    if (e < 128) {
      t.push(e);
      return
    }
    var r = 1 + (Math.log(e) / Math.LN2 >>> 3);
    for (t.push(r | 128); --r;) t.push(e >>> (r << 3) & 255);
    t.push(e)
  }
  d4.prototype.toDER = function (t) {
    var e = this.r.toArray(),
      r = this.s.toArray();
    for (e[0] & 128 && (e = [0].concat(e)), r[0] & 128 && (r = [0].concat(r)), e = CL(e), r = CL(r); !r[0] && !(r[1] & 128);) r = r.slice(1);
    var n = [2];
    sE(n, e.length), n = n.concat(e), n.push(2), sE(n, r.length);
    var i = n.concat(r),
      s = [48];
    return sE(s, i.length), s = s.concat(i), Wo.encode(s, t)
  };
  var qwe = function () {
      throw new Error("unsupported")
    },
    EL = Wo.assert;

  function Ea(t) {
    if (!(this instanceof Ea)) return new Ea(t);
    typeof t == "string" && (EL(Object.prototype.hasOwnProperty.call(u4, t), "Unknown curve " + t), t = u4[t]), t instanceof u4.PresetCurve && (t = {
      curve: t
    }), this.curve = t.curve.curve, this.n = this.curve.n, this.nh = this.n.ushrn(1), this.g = this.curve.g, this.g = t.curve.g, this.g.precompute(t.curve.n.bitLength() + 1), this.hash = t.hash || t.curve.hash
  }
  var Vwe = Ea;
  Ea.prototype.keyPair = function (t) {
    return new nE(this, t)
  }, Ea.prototype.keyFromPrivate = function (t, e) {
    return nE.fromPrivate(this, t, e)
  }, Ea.prototype.keyFromPublic = function (t, e) {
    return nE.fromPublic(this, t, e)
  }, Ea.prototype.genKeyPair = function (t) {
    t || (t = {});
    for (var e = new xL({
        hash: this.hash,
        pers: t.pers,
        persEnc: t.persEnc || "utf8",
        entropy: t.entropy || qwe(this.hash.hmacStrength),
        entropyEnc: t.entropy && t.entropyEnc || "utf8",
        nonce: this.n.toArray()
      }), r = this.n.byteLength(), n = this.n.sub(new dr(2));;) {
      var i = new dr(e.generate(r));
      if (!(i.cmp(n) > 0)) return i.iaddn(1), this.keyFromPrivate(i)
    }
  }, Ea.prototype._truncateToN = function (t, e) {
    var r = t.byteLength() * 8 - this.n.bitLength();
    return r > 0 && (t = t.ushrn(r)), !e && t.cmp(this.n) >= 0 ? t.sub(this.n) : t
  }, Ea.prototype.sign = function (t, e, r, n) {
    typeof r == "object" && (n = r, r = null), n || (n = {}), e = this.keyFromPrivate(e, r), t = this._truncateToN(new dr(t, 16));
    for (var i = this.n.byteLength(), s = e.getPrivate().toArray("be", i), o = t.toArray("be", i), a = new xL({
        hash: this.hash,
        entropy: s,
        nonce: o,
        pers: n.pers,
        persEnc: n.persEnc || "utf8"
      }), c = this.n.sub(new dr(1)), l = 0;; l++) {
      var h = n.k ? n.k(l) : new dr(a.generate(this.n.byteLength()));
      if (h = this._truncateToN(h, !0), !(h.cmpn(1) <= 0 || h.cmp(c) >= 0)) {
        var f = this.g.mul(h);
        if (!f.isInfinity()) {
          var w = f.getX(),
            b = w.umod(this.n);
          if (b.cmpn(0) !== 0) {
            var C = h.invm(this.n).mul(b.mul(e.getPrivate()).iadd(t));
            if (C = C.umod(this.n), C.cmpn(0) !== 0) {
              var M = (f.getY().isOdd() ? 1 : 0) | (w.cmp(b) !== 0 ? 2 : 0);
              return n.canonical && C.cmp(this.nh) > 0 && (C = this.n.sub(C), M ^= 1), new h4({
                r: b,
                s: C,
                recoveryParam: M
              })
            }
          }
        }
      }
    }
  }, Ea.prototype.verify = function (t, e, r, n) {
    t = this._truncateToN(new dr(t, 16)), r = this.keyFromPublic(r, n), e = new h4(e, "hex");
    var i = e.r,
      s = e.s;
    if (i.cmpn(1) < 0 || i.cmp(this.n) >= 0 || s.cmpn(1) < 0 || s.cmp(this.n) >= 0) return !1;
    var o = s.invm(this.n),
      a = o.mul(t).umod(this.n),
      c = o.mul(i).umod(this.n),
      l;
    return this.curve._maxwellTrick ? (l = this.g.jmulAdd(a, r.getPublic(), c), l.isInfinity() ? !1 : l.eqXToP(i)) : (l = this.g.mulAdd(a, r.getPublic(), c), l.isInfinity() ? !1 : l.getX().umod(this.n).cmp(i) === 0)
  }, Ea.prototype.recoverPubKey = function (t, e, r, n) {
    EL((3 & r) === r, "The recovery param is more than two bits"), e = new h4(e, n);
    var i = this.n,
      s = new dr(t),
      o = e.r,
      a = e.s,
      c = r & 1,
      l = r >> 1;
    if (o.cmp(this.curve.p.umod(this.curve.n)) >= 0 && l) throw new Error("Unable to find sencond key candinate");
    l ? o = this.curve.pointFromX(o.add(this.curve.n), c) : o = this.curve.pointFromX(o, c);
    var h = e.r.invm(i),
      f = i.sub(s).mul(h).umod(i),
      w = a.mul(h).umod(i);
    return this.g.mulAdd(f, o, w)
  }, Ea.prototype.getKeyRecoveryParam = function (t, e, r, n) {
    if (e = new h4(e, n), e.recoveryParam !== null) return e.recoveryParam;
    for (var i = 0; i < 4; i++) {
      var s;
      try {
        s = this.recoverPubKey(t, e, i)
      } catch {
        continue
      }
      if (s.eq(r)) return i
    }
    throw new Error("Unable to find valid recovery factor")
  };
  var Kwe = Eg(function (t, e) {
      var r = e;
      r.version = "6.5.4", r.utils = Wo, r.rand = function () {
        throw new Error("unsupported")
      }, r.curve = l4, r.curves = u4, r.ec = Vwe, r.eddsa = null
    }),
    Gwe = Kwe.ec;
  const Zwe = "signing-key/5.7.0",
    oE = new is(Zwe);
  let aE = null;

  function Th() {
    return aE || (aE = new Gwe("secp256k1")), aE
  }
  class Ywe {
    constructor(e) {
      sv(this, "curve", "secp256k1"), sv(this, "privateKey", po(e)), Oge(this.privateKey) !== 32 && oE.throwArgumentError("invalid private key", "privateKey", "[[ REDACTED ]]");
      const r = Th().keyFromPrivate(Gn(this.privateKey));
      sv(this, "publicKey", "0x" + r.getPublic(!1, "hex")), sv(this, "compressedPublicKey", "0x" + r.getPublic(!0, "hex")), sv(this, "_isSigningKey", !0)
    }
    _addPoint(e) {
      const r = Th().keyFromPublic(Gn(this.publicKey)),
        n = Th().keyFromPublic(Gn(e));
      return "0x" + r.pub.add(n.pub).encodeCompressed("hex")
    }
    signDigest(e) {
      const r = Th().keyFromPrivate(Gn(this.privateKey)),
        n = Gn(e);
      n.length !== 32 && oE.throwArgumentError("bad digest length", "digest", e);
      const i = r.sign(n, {
        canonical: !0
      });
      return OD({
        recoveryParam: i.recoveryParam,
        r: Sl("0x" + i.r.toString(16), 32),
        s: Sl("0x" + i.s.toString(16), 32)
      })
    }
    computeSharedSecret(e) {
      const r = Th().keyFromPrivate(Gn(this.privateKey)),
        n = Th().keyFromPublic(Gn(AL(e)));
      return Sl("0x" + r.derive(n.getPublic()).toString(16), 32)
    }
    static isSigningKey(e) {
      return !!(e && e._isSigningKey)
    }
  }

  function Qwe(t, e) {
    const r = OD(e),
      n = {
        r: Gn(r.r),
        s: Gn(r.s)
      };
    return "0x" + Th().recoverPubKey(Gn(t), n, r.recoveryParam).encode("hex", !1)
  }

  function AL(t, e) {
    const r = Gn(t);
    return r.length === 32 ? new Ywe(r).publicKey : r.length === 33 ? "0x" + Th().keyFromPublic(r).getPublic(!1, "hex") : r.length === 65 ? po(r) : oE.throwArgumentError("invalid public or private key", "key", "[REDACTED]")
  }
  var SL;
  (function (t) {
    t[t.legacy = 0] = "legacy", t[t.eip2930 = 1] = "eip2930", t[t.eip1559 = 2] = "eip1559"
  })(SL || (SL = {}));

  function Jwe(t) {
    const e = AL(t);
    return ume($D(jC($D(e, 1)), 12))
  }

  function Xwe(t, e) {
    return Jwe(Qwe(Gn(t), e))
  }
  const e2e = "https://rpc.walletconnect.org/v1";
  async function t2e(t, e, r, n, i, s) {
    switch (r.t) {
      case "eip191":
        return r2e(t, e, r.s);
      case "eip1271":
        return await n2e(t, e, r.s, n, i, s);
      default:
        throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)
    }
  }

  function r2e(t, e, r) {
    return Xwe(YD(e), r).toLowerCase() === t.toLowerCase()
  }
  async function n2e(t, e, r, n, i, s) {
    try {
      const o = "0x1626ba7e",
        a = "0000000000000000000000000000000000000000000000000000000000000040",
        c = "0000000000000000000000000000000000000000000000000000000000000041",
        l = r.substring(2),
        h = YD(e).substring(2),
        f = o + h + a + c + l,
        w = await fetch(`${s||e2e}/?chainId=${n}&projectId=${i}`, {
          method: "POST",
          body: JSON.stringify({
            id: i2e(),
            jsonrpc: "2.0",
            method: "eth_call",
            params: [{
              to: t,
              data: f
            }, "latest"]
          })
        }),
        {
          result: b
        } = await w.json();
      return b ? b.slice(0, o.length).toLowerCase() === o.toLowerCase() : !1
    } catch (o) {
      return console.error("isValidEip1271Signature: ", o), !1
    }
  }

  function i2e() {
    return Date.now() + Math.floor(Math.random() * 1e3)
  }
  var s2e = Object.defineProperty,
    o2e = Object.defineProperties,
    a2e = Object.getOwnPropertyDescriptors,
    IL = Object.getOwnPropertySymbols,
    c2e = Object.prototype.hasOwnProperty,
    l2e = Object.prototype.propertyIsEnumerable,
    TL = (t, e, r) => e in t ? s2e(t, e, {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: r
    }) : t[e] = r,
    u2e = (t, e) => {
      for (var r in e || (e = {})) c2e.call(e, r) && TL(t, r, e[r]);
      if (IL)
        for (var r of IL(e)) l2e.call(e, r) && TL(t, r, e[r]);
      return t
    },
    d2e = (t, e) => o2e(t, a2e(e));
  const h2e = "did:pkh:",
    cE = t => t?.split(":"),
    lE = t => {
      const e = t && cE(t);
      if (e) return t.includes(h2e) ? e[3] : e[1]
    },
    kL = t => {
      const e = t && cE(t);
      if (e) return e[2] + ":" + e[3]
    },
    lv = t => {
      const e = t && cE(t);
      if (e) return e.pop()
    };
  async function RL(t) {
    const {
      cacao: e,
      projectId: r
    } = t, {
      s: n,
      p: i
    } = e, s = uE(i, i.iss), o = lv(i.iss);
    return await t2e(o, s, n, lE(i.iss), r)
  }
  const uE = (t, e) => {
    const r = `${t.domain} wants you to sign in with your Ethereum account:`,
      n = lv(e);
    if (!t.aud && !t.uri) throw new Error("Either `aud` or `uri` is required to construct the message");
    let i = t.statement || void 0;
    const s = `URI: ${t.aud||t.uri}`,
      o = `Version: ${t.version}`,
      a = `Chain ID: ${lE(e)}`,
      c = `Nonce: ${t.nonce}`,
      l = `Issued At: ${t.iat}`,
      h = t.exp ? `Expiration Time: ${t.exp}` : void 0,
      f = t.nbf ? `Not Before: ${t.nbf}` : void 0,
      w = t.requestId ? `Request ID: ${t.requestId}` : void 0,
      b = t.resources ? `Resources:${t.resources.map(M=>`
  - ${M}`).join("")}` : void 0,
      C = f4(t.resources);
    if (C) {
      const M = uv(C);
      i = _2e(i, M)
    }
    return [r, n, "", i, "", s, o, a, c, l, h, f, w, b].filter(M => M != null).join(`
  `)
  };

  function f2e(t) {
    return Buffer.from(JSON.stringify(t)).toString("base64")
  }

  function p2e(t) {
    return JSON.parse(Buffer.from(t, "base64").toString("utf-8"))
  }

  function C0(t) {
    if (!t) throw new Error("No recap provided, value is undefined");
    if (!t.att) throw new Error("No `att` property found");
    const e = Object.keys(t.att);
    if (!(e != null && e.length)) throw new Error("No resources found in `att` property");
    e.forEach(r => {
      const n = t.att[r];
      if (Array.isArray(n)) throw new Error(`Resource must be an object: ${r}`);
      if (typeof n != "object") throw new Error(`Resource must be an object: ${r}`);
      if (!Object.keys(n).length) throw new Error(`Resource object is empty: ${r}`);
      Object.keys(n).forEach(i => {
        const s = n[i];
        if (!Array.isArray(s)) throw new Error(`Ability limits ${i} must be an array of objects, found: ${s}`);
        if (!s.length) throw new Error(`Value of ${i} is empty array, must be an array with objects`);
        s.forEach(o => {
          if (typeof o != "object") throw new Error(`Ability limits (${i}) must be an array of objects, found: ${o}`)
        })
      })
    })
  }

  function g2e(t, e, r, n = {}) {
    return r?.sort((i, s) => i.localeCompare(s)), {
      att: {
        [t]: m2e(e, r, n)
      }
    }
  }

  function m2e(t, e, r = {}) {
    e = e?.sort((i, s) => i.localeCompare(s));
    const n = e.map(i => ({
      [`${t}/${i}`]: [r]
    }));
    return Object.assign({}, ...n)
  }

  function NL(t) {
    return C0(t), `urn:recap:${f2e(t).replace(/=/g,"")}`
  }

  function uv(t) {
    const e = p2e(t.replace("urn:recap:", ""));
    return C0(e), e
  }

  function w2e(t, e, r) {
    const n = g2e(t, e, r);
    return NL(n)
  }

  function v2e(t) {
    return t && t.includes("urn:recap:")
  }

  function b2e(t, e) {
    const r = uv(t),
      n = uv(e),
      i = y2e(r, n);
    return NL(i)
  }

  function y2e(t, e) {
    C0(t), C0(e);
    const r = Object.keys(t.att).concat(Object.keys(e.att)).sort((i, s) => i.localeCompare(s)),
      n = {
        att: {}
      };
    return r.forEach(i => {
      var s, o;
      Object.keys(((s = t.att) == null ? void 0 : s[i]) || {}).concat(Object.keys(((o = e.att) == null ? void 0 : o[i]) || {})).sort((a, c) => a.localeCompare(c)).forEach(a => {
        var c, l;
        n.att[i] = d2e(u2e({}, n.att[i]), {
          [a]: ((c = t.att[i]) == null ? void 0 : c[a]) || ((l = e.att[i]) == null ? void 0 : l[a])
        })
      })
    }), n
  }

  function _2e(t = "", e) {
    C0(e);
    const r = "I further authorize the stated URI to perform the following actions on my behalf: ";
    if (t.includes(r)) return t;
    const n = [];
    let i = 0;
    Object.keys(e.att).forEach(a => {
      const c = Object.keys(e.att[a]).map(f => ({
        ability: f.split("/")[0],
        action: f.split("/")[1]
      }));
      c.sort((f, w) => f.action.localeCompare(w.action));
      const l = {};
      c.forEach(f => {
        l[f.ability] || (l[f.ability] = []), l[f.ability].push(f.action)
      });
      const h = Object.keys(l).map(f => (i++, `(${i}) '${f}': '${l[f].join("', '")}' for '${a}'.`));
      n.push(h.join(", ").replace(".,", "."))
    });
    const s = n.join(" "),
      o = `${r}${s}`;
    return `${t?t+" ":""}${o}`
  }

  function ML(t) {
    var e;
    const r = uv(t);
    C0(r);
    const n = (e = r.att) == null ? void 0 : e.eip155;
    return n ? Object.keys(n).map(i => i.split("/")[1]) : []
  }

  function PL(t) {
    const e = uv(t);
    C0(e);
    const r = [];
    return Object.values(e.att).forEach(n => {
      Object.values(n).forEach(i => {
        var s;
        (s = i?.[0]) != null && s.chains && r.push(i[0].chains)
      })
    }), [...new Set(r.flat())]
  }

  function f4(t) {
    if (!t) return;
    const e = t?.[t.length - 1];
    return v2e(e) ? e : void 0
  }
  const $L = "base10",
    Ls = "base16",
    kh = "base64pad",
    dv = "base64url",
    hv = "utf8",
    OL = 0,
    Qu = 1,
    fv = 2,
    x2e = 0,
    DL = 1,
    pv = 12,
    dE = 32;

  function C2e() {
    const t = pC.generateKeyPair();
    return {
      privateKey: uo(t.secretKey, Ls),
      publicKey: uo(t.publicKey, Ls)
    }
  }

  function hE() {
    const t = vh.randomBytes(dE);
    return uo(t, Ls)
  }

  function E2e(t, e) {
    const r = pC.sharedKey(wa(t, Ls), wa(e, Ls), !0),
      n = new ipe(K2.SHA256, r).expand(dE);
    return uo(n, Ls)
  }

  function p4(t) {
    const e = K2.hash(wa(t, Ls));
    return uo(e, Ls)
  }

  function Ju(t) {
    const e = K2.hash(wa(t, hv));
    return uo(e, Ls)
  }

  function LL(t) {
    return wa(`${t}`, $L)
  }

  function E0(t) {
    return Number(uo(t, $L))
  }

  function A2e(t) {
    const e = LL(typeof t.type < "u" ? t.type : OL);
    if (E0(e) === Qu && typeof t.senderPublicKey > "u") throw new Error("Missing sender public key for type 1 envelope");
    const r = typeof t.senderPublicKey < "u" ? wa(t.senderPublicKey, Ls) : void 0,
      n = typeof t.iv < "u" ? wa(t.iv, Ls) : vh.randomBytes(pv),
      i = new dC.ChaCha20Poly1305(wa(t.symKey, Ls)).seal(n, wa(t.message, hv));
    return BL({
      type: e,
      sealed: i,
      iv: n,
      senderPublicKey: r,
      encoding: t.encoding
    })
  }

  function S2e(t, e) {
    const r = LL(fv),
      n = vh.randomBytes(pv),
      i = wa(t, hv);
    return BL({
      type: r,
      sealed: i,
      iv: n,
      encoding: e
    })
  }

  function I2e(t) {
    const e = new dC.ChaCha20Poly1305(wa(t.symKey, Ls)),
      {
        sealed: r,
        iv: n
      } = gv({
        encoded: t.encoded,
        encoding: t?.encoding
      }),
      i = e.open(n, r);
    if (i === null) throw new Error("Failed to decrypt");
    return uo(i, hv)
  }

  function T2e(t, e) {
    const {
      sealed: r
    } = gv({
      encoded: t,
      encoding: e
    });
    return uo(r, hv)
  }

  function BL(t) {
    const {
      encoding: e = kh
    } = t;
    if (E0(t.type) === fv) return uo(gC([t.type, t.sealed]), e);
    if (E0(t.type) === Qu) {
      if (typeof t.senderPublicKey > "u") throw new Error("Missing sender public key for type 1 envelope");
      return uo(gC([t.type, t.senderPublicKey, t.iv, t.sealed]), e)
    }
    return uo(gC([t.type, t.iv, t.sealed]), e)
  }

  function gv(t) {
    const {
      encoded: e,
      encoding: r = kh
    } = t, n = wa(e, r), i = n.slice(x2e, DL), s = DL;
    if (E0(i) === Qu) {
      const l = s + dE,
        h = l + pv,
        f = n.slice(s, l),
        w = n.slice(l, h),
        b = n.slice(h);
      return {
        type: i,
        sealed: b,
        iv: w,
        senderPublicKey: f
      }
    }
    if (E0(i) === fv) {
      const l = n.slice(s),
        h = vh.randomBytes(pv);
      return {
        type: i,
        sealed: l,
        iv: h
      }
    }
    const o = s + pv,
      a = n.slice(s, o),
      c = n.slice(o);
    return {
      type: i,
      sealed: c,
      iv: a
    }
  }

  function k2e(t, e) {
    const r = gv({
      encoded: t,
      encoding: e?.encoding
    });
    return UL({
      type: E0(r.type),
      senderPublicKey: typeof r.senderPublicKey < "u" ? uo(r.senderPublicKey, Ls) : void 0,
      receiverPublicKey: e?.receiverPublicKey
    })
  }

  function UL(t) {
    const e = t?.type || OL;
    if (e === Qu) {
      if (typeof t?.senderPublicKey > "u") throw new Error("missing sender public key");
      if (typeof t?.receiverPublicKey > "u") throw new Error("missing receiver public key")
    }
    return {
      type: e,
      senderPublicKey: t?.senderPublicKey,
      receiverPublicKey: t?.receiverPublicKey
    }
  }

  function jL(t) {
    return t.type === Qu && typeof t.senderPublicKey == "string" && typeof t.receiverPublicKey == "string"
  }

  function FL(t) {
    return t.type === fv
  }

  function R2e(t) {
    return new IO.ec("p256").keyFromPublic({
      x: Buffer.from(t.x, "base64").toString("hex"),
      y: Buffer.from(t.y, "base64").toString("hex")
    }, "hex")
  }

  function N2e(t) {
    let e = t.replace(/-/g, "+").replace(/_/g, "/");
    const r = e.length % 4;
    return r > 0 && (e += "=".repeat(4 - r)), e
  }

  function M2e(t) {
    return Buffer.from(N2e(t), "base64")
  }

  function P2e(t, e) {
    const [r, n, i] = t.split("."), s = M2e(i);
    if (s.length !== 64) throw new Error("Invalid signature length");
    const o = s.slice(0, 32).toString("hex"),
      a = s.slice(32, 64).toString("hex"),
      c = `${r}.${n}`,
      l = new K2.SHA256().update(Buffer.from(c)).digest(),
      h = R2e(e),
      f = Buffer.from(l).toString("hex");
    if (!h.verify(f, {
        r: o,
        s: a
      })) throw new Error("Invalid signature");
    return aC(t).payload
  }
  const $2e = "irn";

  function fE(t) {
    return t?.relay || {
      protocol: $2e
    }
  }

  function mv(t) {
    const e = age[t];
    if (typeof e > "u") throw new Error(`Relay Protocol not supported: ${t}`);
    return e
  }
  var O2e = Object.defineProperty,
    D2e = Object.defineProperties,
    L2e = Object.getOwnPropertyDescriptors,
    WL = Object.getOwnPropertySymbols,
    B2e = Object.prototype.hasOwnProperty,
    U2e = Object.prototype.propertyIsEnumerable,
    zL = (t, e, r) => e in t ? O2e(t, e, {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: r
    }) : t[e] = r,
    HL = (t, e) => {
      for (var r in e || (e = {})) B2e.call(e, r) && zL(t, r, e[r]);
      if (WL)
        for (var r of WL(e)) U2e.call(e, r) && zL(t, r, e[r]);
      return t
    },
    j2e = (t, e) => D2e(t, L2e(e));

  function F2e(t, e = "-") {
    const r = {},
      n = "relay" + e;
    return Object.keys(t).forEach(i => {
      if (i.startsWith(n)) {
        const s = i.replace(n, ""),
          o = t[i];
        r[s] = o
      }
    }), r
  }

  function qL(t) {
    if (!t.includes("wc:")) {
      const c = ED(t);
      c != null && c.includes("wc:") && (t = c)
    }
    t = t.includes("wc://") ? t.replace("wc://", "") : t, t = t.includes("wc:") ? t.replace("wc:", "") : t;
    const e = t.indexOf(":"),
      r = t.indexOf("?") !== -1 ? t.indexOf("?") : void 0,
      n = t.substring(0, e),
      i = t.substring(e + 1, r).split("@"),
      s = typeof r < "u" ? t.substring(r) : "",
      o = q2.parse(s),
      a = typeof o.methods == "string" ? o.methods.split(",") : void 0;
    return {
      protocol: n,
      topic: W2e(i[0]),
      version: parseInt(i[1], 10),
      symKey: o.symKey,
      relay: F2e(o),
      methods: a,
      expiryTimestamp: o.expiryTimestamp ? parseInt(o.expiryTimestamp, 10) : void 0
    }
  }

  function W2e(t) {
    return t.startsWith("//") ? t.substring(2) : t
  }

  function z2e(t, e = "-") {
    const r = "relay",
      n = {};
    return Object.keys(t).forEach(i => {
      const s = r + e + i;
      t[i] && (n[s] = t[i])
    }), n
  }

  function VL(t) {
    return `${t.protocol}:${t.topic}@${t.version}?` + q2.stringify(HL(j2e(HL({
      symKey: t.symKey
    }, z2e(t.relay)), {
      expiryTimestamp: t.expiryTimestamp
    }), t.methods ? {
      methods: t.methods.join(",")
    } : {}))
  }

  function g4(t, e, r) {
    return `${t}?wc_ev=${r}&topic=${e}`
  }

  function Ag(t) {
    const e = [];
    return t.forEach(r => {
      const [n, i] = r.split(":");
      e.push(`${n}:${i}`)
    }), e
  }

  function H2e(t) {
    const e = [];
    return Object.values(t).forEach(r => {
      e.push(...Ag(r.accounts))
    }), e
  }

  function q2e(t, e) {
    const r = [];
    return Object.values(t).forEach(n => {
      Ag(n.accounts).includes(e) && r.push(...n.methods)
    }), r
  }

  function V2e(t, e) {
    const r = [];
    return Object.values(t).forEach(n => {
      Ag(n.accounts).includes(e) && r.push(...n.events)
    }), r
  }

  function pE(t) {
    return t.includes(":")
  }

  function wv(t) {
    return pE(t) ? t.split(":")[0] : t
  }

  function K2e(t) {
    const e = {};
    return t?.forEach(r => {
      const [n, i] = r.split(":");
      e[n] || (e[n] = {
        accounts: [],
        chains: [],
        events: []
      }), e[n].accounts.push(r), e[n].chains.push(`${n}:${i}`)
    }), e
  }

  function KL(t, e) {
    e = e.map(n => n.replace("did:pkh:", ""));
    const r = K2e(e);
    for (const [n, i] of Object.entries(r)) i.methods ? i.methods = X5(i.methods, t) : i.methods = t, i.events = ["chainChanged", "accountsChanged"];
    return r
  }
  const G2e = {
      INVALID_METHOD: {
        message: "Invalid method.",
        code: 1001
      },
      INVALID_EVENT: {
        message: "Invalid event.",
        code: 1002
      },
      INVALID_UPDATE_REQUEST: {
        message: "Invalid update request.",
        code: 1003
      },
      INVALID_EXTEND_REQUEST: {
        message: "Invalid extend request.",
        code: 1004
      },
      INVALID_SESSION_SETTLE_REQUEST: {
        message: "Invalid session settle request.",
        code: 1005
      },
      UNAUTHORIZED_METHOD: {
        message: "Unauthorized method.",
        code: 3001
      },
      UNAUTHORIZED_EVENT: {
        message: "Unauthorized event.",
        code: 3002
      },
      UNAUTHORIZED_UPDATE_REQUEST: {
        message: "Unauthorized update request.",
        code: 3003
      },
      UNAUTHORIZED_EXTEND_REQUEST: {
        message: "Unauthorized extend request.",
        code: 3004
      },
      USER_REJECTED: {
        message: "User rejected.",
        code: 5e3
      },
      USER_REJECTED_CHAINS: {
        message: "User rejected chains.",
        code: 5001
      },
      USER_REJECTED_METHODS: {
        message: "User rejected methods.",
        code: 5002
      },
      USER_REJECTED_EVENTS: {
        message: "User rejected events.",
        code: 5003
      },
      UNSUPPORTED_CHAINS: {
        message: "Unsupported chains.",
        code: 5100
      },
      UNSUPPORTED_METHODS: {
        message: "Unsupported methods.",
        code: 5101
      },
      UNSUPPORTED_EVENTS: {
        message: "Unsupported events.",
        code: 5102
      },
      UNSUPPORTED_ACCOUNTS: {
        message: "Unsupported accounts.",
        code: 5103
      },
      UNSUPPORTED_NAMESPACE_KEY: {
        message: "Unsupported namespace key.",
        code: 5104
      },
      USER_DISCONNECTED: {
        message: "User disconnected.",
        code: 6e3
      },
      SESSION_SETTLEMENT_FAILED: {
        message: "Session settlement failed.",
        code: 7e3
      },
      WC_METHOD_UNSUPPORTED: {
        message: "Unsupported wc_ method.",
        code: 10001
      }
    },
    Z2e = {
      NOT_INITIALIZED: {
        message: "Not initialized.",
        code: 1
      },
      NO_MATCHING_KEY: {
        message: "No matching key.",
        code: 2
      },
      RESTORE_WILL_OVERRIDE: {
        message: "Restore will override.",
        code: 3
      },
      RESUBSCRIBED: {
        message: "Resubscribed.",
        code: 4
      },
      MISSING_OR_INVALID: {
        message: "Missing or invalid.",
        code: 5
      },
      EXPIRED: {
        message: "Expired.",
        code: 6
      },
      UNKNOWN_TYPE: {
        message: "Unknown type.",
        code: 7
      },
      MISMATCHED_TOPIC: {
        message: "Mismatched topic.",
        code: 8
      },
      NON_CONFORMING_NAMESPACES: {
        message: "Non conforming namespaces.",
        code: 9
      }
    };

  function it(t, e) {
    const {
      message: r,
      code: n
    } = Z2e[t];
    return {
      message: e ? `${r} ${e}` : r,
      code: n
    }
  }

  function nn(t, e) {
    const {
      message: r,
      code: n
    } = G2e[t];
    return {
      message: e ? `${r} ${e}` : r,
      code: n
    }
  }

  function Ol(t, e) {
    return !!Array.isArray(t)
  }

  function vv(t) {
    return Object.getPrototypeOf(t) === Object.prototype && Object.keys(t).length
  }

  function wo(t) {
    return typeof t > "u"
  }

  function si(t, e) {
    return e && wo(t) ? !0 : typeof t == "string" && !!t.trim().length
  }

  function gE(t, e) {
    return typeof t == "number" && !isNaN(t)
  }

  function Y2e(t, e) {
    const {
      requiredNamespaces: r
    } = e, n = Object.keys(t.namespaces), i = Object.keys(r);
    let s = !0;
    return b0(i, n) ? (n.forEach(o => {
      const {
        accounts: a,
        methods: c,
        events: l
      } = t.namespaces[o], h = Ag(a), f = r[o];
      (!b0(hD(o, f), h) || !b0(f.methods, c) || !b0(f.events, l)) && (s = !1)
    }), s) : !1
  }

  function m4(t) {
    return si(t, !1) && t.includes(":") ? t.split(":").length === 2 : !1
  }

  function Q2e(t) {
    if (si(t, !1) && t.includes(":")) {
      const e = t.split(":");
      if (e.length === 3) {
        const r = e[0] + ":" + e[1];
        return !!e[2] && m4(r)
      }
    }
    return !1
  }

  function J2e(t) {
    function e(r) {
      try {
        return typeof new URL(r) < "u"
      } catch {
        return !1
      }
    }
    try {
      if (si(t, !1)) {
        if (e(t)) return !0;
        const r = ED(t);
        return e(r)
      }
    } catch {}
    return !1
  }

  function X2e(t) {
    var e;
    return (e = t?.proposer) == null ? void 0 : e.publicKey
  }

  function eve(t) {
    return t?.topic
  }

  function tve(t, e) {
    let r = null;
    return si(t?.publicKey, !1) || (r = it("MISSING_OR_INVALID", `${e} controller public key should be a string`)), r
  }

  function GL(t) {
    let e = !0;
    return Ol(t) ? t.length && (e = t.every(r => si(r, !1))) : e = !1, e
  }

  function rve(t, e, r) {
    let n = null;
    return Ol(e) && e.length ? e.forEach(i => {
      n || m4(i) || (n = nn("UNSUPPORTED_CHAINS", `${r}, chain ${i} should be a string and conform to "namespace:chainId" format`))
    }) : m4(t) || (n = nn("UNSUPPORTED_CHAINS", `${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)), n
  }

  function nve(t, e, r) {
    let n = null;
    return Object.entries(t).forEach(([i, s]) => {
      if (n) return;
      const o = rve(i, hD(i, s), `${e} ${r}`);
      o && (n = o)
    }), n
  }

  function ive(t, e) {
    let r = null;
    return Ol(t) ? t.forEach(n => {
      r || Q2e(n) || (r = nn("UNSUPPORTED_ACCOUNTS", `${e}, account ${n} should be a string and conform to "namespace:chainId:address" format`))
    }) : r = nn("UNSUPPORTED_ACCOUNTS", `${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`), r
  }

  function sve(t, e) {
    let r = null;
    return Object.values(t).forEach(n => {
      if (r) return;
      const i = ive(n?.accounts, `${e} namespace`);
      i && (r = i)
    }), r
  }

  function ove(t, e) {
    let r = null;
    return GL(t?.methods) ? GL(t?.events) || (r = nn("UNSUPPORTED_EVENTS", `${e}, events should be an array of strings or empty array for no events`)) : r = nn("UNSUPPORTED_METHODS", `${e}, methods should be an array of strings or empty array for no methods`), r
  }

  function ZL(t, e) {
    let r = null;
    return Object.values(t).forEach(n => {
      if (r) return;
      const i = ove(n, `${e}, namespace`);
      i && (r = i)
    }), r
  }

  function ave(t, e, r) {
    let n = null;
    if (t && vv(t)) {
      const i = ZL(t, e);
      i && (n = i);
      const s = nve(t, e, r);
      s && (n = s)
    } else n = it("MISSING_OR_INVALID", `${e}, ${r} should be an object with data`);
    return n
  }

  function mE(t, e) {
    let r = null;
    if (t && vv(t)) {
      const n = ZL(t, e);
      n && (r = n);
      const i = sve(t, e);
      i && (r = i)
    } else r = it("MISSING_OR_INVALID", `${e}, namespaces should be an object with data`);
    return r
  }

  function YL(t) {
    return si(t.protocol, !0)
  }

  function cve(t, e) {
    let r = !1;
    return t ? t && Ol(t) && t.length && t.forEach(n => {
      r = YL(n)
    }) : r = !0, r
  }

  function lve(t) {
    return typeof t == "number"
  }

  function vo(t) {
    return typeof t < "u" && typeof t !== null
  }

  function uve(t) {
    return !(!t || typeof t != "object" || !t.code || !gE(t.code) || !t.message || !si(t.message, !1))
  }

  function dve(t) {
    return !(wo(t) || !si(t.method, !1))
  }

  function hve(t) {
    return !(wo(t) || wo(t.result) && wo(t.error) || !gE(t.id) || !si(t.jsonrpc, !1))
  }

  function fve(t) {
    return !(wo(t) || !si(t.name, !1))
  }

  function QL(t, e) {
    return !(!m4(e) || !H2e(t).includes(e))
  }

  function pve(t, e, r) {
    return si(r, !1) ? q2e(t, e).includes(r) : !1
  }

  function gve(t, e, r) {
    return si(r, !1) ? V2e(t, e).includes(r) : !1
  }

  function JL(t, e, r) {
    let n = null;
    const i = mve(t),
      s = wve(e),
      o = Object.keys(i),
      a = Object.keys(s),
      c = XL(Object.keys(t)),
      l = XL(Object.keys(e)),
      h = c.filter(f => !l.includes(f));
    return h.length && (n = it("NON_CONFORMING_NAMESPACES", `${r} namespaces keys don't satisfy requiredNamespaces.
        Required: ${h.toString()}
        Received: ${Object.keys(e).toString()}`)), b0(o, a) || (n = it("NON_CONFORMING_NAMESPACES", `${r} namespaces chains don't satisfy required namespaces.
        Required: ${o.toString()}
        Approved: ${a.toString()}`)), Object.keys(e).forEach(f => {
      if (!f.includes(":") || n) return;
      const w = Ag(e[f].accounts);
      w.includes(f) || (n = it("NON_CONFORMING_NAMESPACES", `${r} namespaces accounts don't satisfy namespace accounts for ${f}
          Required: ${f}
          Approved: ${w.toString()}`))
    }), o.forEach(f => {
      n || (b0(i[f].methods, s[f].methods) ? b0(i[f].events, s[f].events) || (n = it("NON_CONFORMING_NAMESPACES", `${r} namespaces events don't satisfy namespace events for ${f}`)) : n = it("NON_CONFORMING_NAMESPACES", `${r} namespaces methods don't satisfy namespace methods for ${f}`))
    }), n
  }

  function mve(t) {
    const e = {};
    return Object.keys(t).forEach(r => {
      var n;
      r.includes(":") ? e[r] = t[r] : (n = t[r].chains) == null || n.forEach(i => {
        e[i] = {
          methods: t[r].methods,
          events: t[r].events
        }
      })
    }), e
  }

  function XL(t) {
    return [...new Set(t.map(e => e.includes(":") ? e.split(":")[0] : e))]
  }

  function wve(t) {
    const e = {};
    return Object.keys(t).forEach(r => {
      r.includes(":") ? e[r] = t[r] : Ag(t[r].accounts)?.forEach(i => {
        e[i] = {
          accounts: t[r].accounts.filter(s => s.includes(`${i}:`)),
          methods: t[r].methods,
          events: t[r].events
        }
      })
    }), e
  }

  function vve(t, e) {
    return gE(t) && t <= e.max && t >= e.min
  }

  function eB() {
    const t = ev();
    return new Promise(e => {
      switch (t) {
        case jo.browser:
          e(bve());
          break;
        case jo.reactNative:
          e(yve());
          break;
        case jo.node:
          e(_ve());
          break;
        default:
          e(!0)
      }
    })
  }

  function bve() {
    return X2() && navigator?.onLine
  }
  async function yve() {
    return pg() && typeof global < "u" && global != null && global.NetInfo ? (await (global == null ? void 0 : global.NetInfo.fetch()))?.isConnected : !0
  }

  function _ve() {
    return !0
  }

  function xve(t) {
    switch (ev()) {
      case jo.browser:
        Cve(t);
        break;
      case jo.reactNative:
        Eve(t);
        break
    }
  }

  function Cve(t) {
    !pg() && X2() && (window.addEventListener("online", () => t(!0)), window.addEventListener("offline", () => t(!1)))
  }

  function Eve(t) {
    pg() && typeof global < "u" && global != null && global.NetInfo && global?.NetInfo.addEventListener(e => t(e?.isConnected))
  }
  const wE = {};
  class bv {
    static get(e) {
      return wE[e]
    }
    static set(e, r) {
      wE[e] = r
    }
    static delete(e) {
      delete wE[e]
    }
  }
  const Ave = "PARSE_ERROR",
    Sve = "INVALID_REQUEST",
    Ive = "METHOD_NOT_FOUND",
    Tve = "INVALID_PARAMS",
    tB = "INTERNAL_ERROR",
    vE = "SERVER_ERROR",
    kve = [-32700, -32600, -32601, -32602, -32603],
    yv = {
      [Ave]: {
        code: -32700,
        message: "Parse error"
      },
      [Sve]: {
        code: -32600,
        message: "Invalid Request"
      },
      [Ive]: {
        code: -32601,
        message: "Method not found"
      },
      [Tve]: {
        code: -32602,
        message: "Invalid params"
      },
      [tB]: {
        code: -32603,
        message: "Internal error"
      },
      [vE]: {
        code: -32e3,
        message: "Server error"
      }
    },
    rB = vE;

  function Rve(t) {
    return kve.includes(t)
  }

  function nB(t) {
    return Object.keys(yv).includes(t) ? yv[t] : yv[rB]
  }

  function Nve(t) {
    const e = Object.values(yv).find(r => r.code === t);
    return e || yv[rB]
  }

  function iB(t, e, r) {
    return t.message.includes("getaddrinfo ENOTFOUND") || t.message.includes("connect ECONNREFUSED") ? new Error(`Unavailable ${r} RPC url at ${e}`) : t
  }
  var sB = {},
    Xu = {},
    oB;

  function Mve() {
    if (oB) return Xu;
    oB = 1, Object.defineProperty(Xu, "__esModule", {
      value: !0
    }), Xu.isBrowserCryptoAvailable = Xu.getSubtleCrypto = Xu.getBrowerCrypto = void 0;

    function t() {
      return ot?.crypto || ot?.msCrypto || {}
    }
    Xu.getBrowerCrypto = t;

    function e() {
      const n = t();
      return n.subtle || n.webkitSubtle
    }
    Xu.getSubtleCrypto = e;

    function r() {
      return !!t() && !!e()
    }
    return Xu.isBrowserCryptoAvailable = r, Xu
  }
  var ed = {},
    aB;

  function Pve() {
    if (aB) return ed;
    aB = 1, Object.defineProperty(ed, "__esModule", {
      value: !0
    }), ed.isBrowser = ed.isNode = ed.isReactNative = void 0;

    function t() {
      return typeof document > "u" && typeof navigator < "u" && navigator.product === "ReactNative"
    }
    ed.isReactNative = t;

    function e() {
      return typeof process < "u" && typeof process.versions < "u" && typeof process.versions.node < "u"
    }
    ed.isNode = e;

    function r() {
      return !t() && !e()
    }
    return ed.isBrowser = r, ed
  }(function (t) {
    Object.defineProperty(t, "__esModule", {
      value: !0
    });
    const e = j2;
    e.__exportStar(Mve(), t), e.__exportStar(Pve(), t)
  })(sB);

  function Rh(t = 3) {
    const e = Date.now() * Math.pow(10, t),
      r = Math.floor(Math.random() * Math.pow(10, t));
    return e + r
  }

  function A0(t = 6) {
    return BigInt(Rh(t))
  }

  function Nh(t, e, r) {
    return {
      id: r || Rh(),
      jsonrpc: "2.0",
      method: t,
      params: e
    }
  }

  function w4(t, e) {
    return {
      id: t,
      jsonrpc: "2.0",
      result: e
    }
  }

  function v4(t, e, r) {
    return {
      id: t,
      jsonrpc: "2.0",
      error: $ve(e)
    }
  }

  function $ve(t, e) {
    return typeof t > "u" ? nB(tB) : (typeof t == "string" && (t = Object.assign(Object.assign({}, nB(vE)), {
      message: t
    })), Rve(t.code) && (t = Nve(t.code)), t)
  }
  let Ove = class {},
    Dve = class extends Ove {
      constructor() {
        super()
      }
    },
    Lve = class extends Dve {
      constructor(e) {
        super()
      }
    };
  const Bve = "^https?:",
    Uve = "^wss?:";

  function jve(t) {
    const e = t.match(new RegExp(/^\w+:/, "gi"));
    if (!(!e || !e.length)) return e[0]
  }

  function cB(t, e) {
    const r = jve(t);
    return typeof r > "u" ? !1 : new RegExp(e).test(r)
  }

  function lB(t) {
    return cB(t, Bve)
  }

  function uB(t) {
    return cB(t, Uve)
  }

  function Fve(t) {
    return new RegExp("wss?://localhost(:d{2,5})?").test(t)
  }

  function dB(t) {
    return typeof t == "object" && "id" in t && "jsonrpc" in t && t.jsonrpc === "2.0"
  }

  function bE(t) {
    return dB(t) && "method" in t
  }

  function b4(t) {
    return dB(t) && (Dl(t) || Aa(t))
  }

  function Dl(t) {
    return "result" in t
  }

  function Aa(t) {
    return "error" in t
  }
  let xc = class extends Lve {
    constructor(e) {
      super(e), this.events = new Fi.EventEmitter, this.hasRegisteredEventListeners = !1, this.connection = this.setConnection(e), this.connection.connected && this.registerEventListeners()
    }
    async connect(e = this.connection) {
      await this.open(e)
    }
    async disconnect() {
      await this.close()
    }
    on(e, r) {
      this.events.on(e, r)
    }
    once(e, r) {
      this.events.once(e, r)
    }
    off(e, r) {
      this.events.off(e, r)
    }
    removeListener(e, r) {
      this.events.removeListener(e, r)
    }
    async request(e, r) {
      return this.requestStrict(Nh(e.method, e.params || [], e.id || A0().toString()), r)
    }
    async requestStrict(e, r) {
      return new Promise(async (n, i) => {
        if (!this.connection.connected) try {
          await this.open()
        } catch (s) {
          i(s)
        }
        this.events.on(`${e.id}`, s => {
          Aa(s) ? i(s.error) : n(s.result)
        });
        try {
          await this.connection.send(e, r)
        } catch (s) {
          i(s)
        }
      })
    }
    setConnection(e = this.connection) {
      return e
    }
    onPayload(e) {
      this.events.emit("payload", e), b4(e) ? this.events.emit(`${e.id}`, e) : this.events.emit("message", {
        type: e.method,
        data: e.params
      })
    }
    onClose(e) {
      e && e.code === 3e3 && this.events.emit("error", new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)), this.events.emit("disconnect")
    }
    async open(e = this.connection) {
      console.log("2 open", e);
      this.connection === e && this.connection.connected || (this.connection.connected && this.close(), typeof e == "string" && (await this.connection.open(e), e = this.connection), this.connection = this.setConnection(e), await this.connection.open(), this.registerEventListeners(), this.events.emit("connect"))
    }
    async close() {
      await this.connection.close()
    }
    registerEventListeners() {
      this.hasRegisteredEventListeners || (this.connection.on("payload", e => this.onPayload(e)), this.connection.on("close", e => this.onClose(e)), this.connection.on("error", e => this.events.emit("error", e)), this.connection.on("register_error", e => this.onClose()), this.hasRegisteredEventListeners = !0)
    }
  };
  const Wve = () => typeof WebSocket < "u" ? WebSocket : typeof global < "u" && typeof global.WebSocket < "u" ? global.WebSocket : typeof window < "u" && typeof window.WebSocket < "u" ? window.WebSocket : typeof self < "u" && typeof self.WebSocket < "u" ? self.WebSocket : require("ws"),
    zve = () => typeof WebSocket < "u" || typeof global < "u" && typeof global.WebSocket < "u" || typeof window < "u" && typeof window.WebSocket < "u" || typeof self < "u" && typeof self.WebSocket < "u",
    hB = t => t.split("?")[0],
    fB = 10,
    Hve = Wve();
  let qve = class {
    constructor(e) {
      if (this.url = e, this.events = new Fi.EventEmitter, this.registering = !1, !uB(e)) throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);
      this.url = e
    }
    get connected() {
      return typeof this.socket < "u"
    }
    get connecting() {
      return this.registering
    }
    on(e, r) {
      this.events.on(e, r)
    }
    once(e, r) {
      this.events.once(e, r)
    }
    off(e, r) {
      this.events.off(e, r)
    }
    removeListener(e, r) {
      this.events.removeListener(e, r)
    }
    async open(e = this.url) {
      console.log("3 open", e)
      await this.register(e)
    }
    async close() {
      return new Promise((e, r) => {
        if (typeof this.socket > "u") {
          r(new Error("Connection already closed"));
          return
        }
        this.socket.onclose = n => {
          this.onClose(n), e()
        }, this.socket.close()
      })
    }
    async send(e) {
      typeof this.socket > "u" && (this.socket = await this.register());
      try {
        this.socket.send(Nu(e))
      } catch (r) {
        this.onError(e.id, r)
      }
    }
    register(e = this.url) {
      if (!uB(e)) throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);
      if (this.registering) {
        const r = this.events.getMaxListeners();
        return (this.events.listenerCount("register_error") >= r || this.events.listenerCount("open") >= r) && this.events.setMaxListeners(r + 1), new Promise((n, i) => {
          this.events.once("register_error", s => {
            this.resetMaxListeners(), i(s)
          }), this.events.once("open", () => {
            if (this.resetMaxListeners(), typeof this.socket > "u") return i(new Error("WebSocket connection is missing or invalid"));
            n(this.socket)
          })
        })
      }
      return this.url = e, this.registering = !0, new Promise((r, n) => {
        const i = new URLSearchParams(e).get("origin"),
          s = sB.isReactNative() ? {
            headers: {
              origin: i
            }
          } : {
            rejectUnauthorized: !Fve(e)
          },
          o = new Hve(e, [], s);
        zve() ? o.onerror = a => {
          const c = a;
          n(this.emitError(c.error))
        } : o.on("error", a => {
          n(this.emitError(a))
        }), o.onopen = () => {
          this.onOpen(o), r(o)
        }
      })
    }
    onOpen(e) {
      e.onmessage = r => this.onPayload(r), e.onclose = r => this.onClose(r), this.socket = e, this.registering = !1, this.events.emit("open")
    }
    onClose(e) {
      this.socket = void 0, this.registering = !1, this.events.emit("close", e)
    }
    onPayload(e) {
      if (typeof e.data > "u") return;
      const r = typeof e.data == "string" ? Pf(e.data) : e.data;
      this.events.emit("payload", r)
    }
    onError(e, r) {
      const n = this.parseError(r),
        i = n.message || n.toString(),
        s = v4(e, i);
      this.events.emit("payload", s)
    }
    parseError(e, r = this.url) {
      return iB(e, hB(r), "WS")
    }
    resetMaxListeners() {
      this.events.getMaxListeners() > fB && this.events.setMaxListeners(fB)
    }
    emitError(e) {
      const r = this.parseError(new Error(e?.message || `WebSocket connection failed for host: ${hB(this.url)}`));
      return this.events.emit("register_error", r), r
    }
  };
  var y4 = {
    exports: {}
  };
  y4.exports,
    function (t, e) {
      var r = 200,
        n = "__lodash_hash_undefined__",
        i = 1,
        s = 2,
        o = 9007199254740991,
        a = "[object Arguments]",
        c = "[object Array]",
        l = "[object AsyncFunction]",
        h = "[object Boolean]",
        f = "[object Date]",
        w = "[object Error]",
        b = "[object Function]",
        C = "[object GeneratorFunction]",
        M = "[object Map]",
        N = "[object Number]",
        $ = "[object Null]",
        k = "[object Object]",
        B = "[object Promise]",
        F = "[object Proxy]",
        D = "[object RegExp]",
        V = "[object Set]",
        R = "[object String]",
        P = "[object Symbol]",
        j = "[object Undefined]",
        Y = "[object WeakMap]",
        U = "[object ArrayBuffer]",
        I = "[object DataView]",
        g = "[object Float32Array]",
        u = "[object Float64Array]",
        p = "[object Int8Array]",
        v = "[object Int16Array]",
        x = "[object Int32Array]",
        E = "[object Uint8Array]",
        S = "[object Uint8ClampedArray]",
        _ = "[object Uint16Array]",
        y = "[object Uint32Array]",
        A = /[\\^$.*+?()[\]{}|]/g,
        G = /^\[object .+?Constructor\]$/,
        ce = /^(?:0|[1-9]\d*)$/,
        W = {};
      W[g] = W[u] = W[p] = W[v] = W[x] = W[E] = W[S] = W[_] = W[y] = !0, W[a] = W[c] = W[U] = W[h] = W[I] = W[f] = W[w] = W[b] = W[M] = W[N] = W[k] = W[D] = W[V] = W[R] = W[Y] = !1;
      var X = typeof ot == "object" && ot && ot.Object === Object && ot,
        Z = typeof self == "object" && self && self.Object === Object && self,
        ee = X || Z || Function("return this")(),
        ne = e && !e.nodeType && e,
        O = ne && !0 && t && !t.nodeType && t,
        H = O && O.exports === ne,
        Q = H && X.process,
        de = function () {
          try {
            return Q && Q.binding && Q.binding("util")
          } catch {}
        }(),
        ge = de && de.isTypedArray;

      function Te(he, Ce) {
        for (var Ve = -1, Nt = he == null ? 0 : he.length, pn = 0, hr = []; ++Ve < Nt;) {
          var Tn = he[Ve];
          Ce(Tn, Ve, he) && (hr[pn++] = Tn)
        }
        return hr
      }

      function Oe(he, Ce) {
        for (var Ve = -1, Nt = Ce.length, pn = he.length; ++Ve < Nt;) he[pn + Ve] = Ce[Ve];
        return he
      }

      function De(he, Ce) {
        for (var Ve = -1, Nt = he == null ? 0 : he.length; ++Ve < Nt;)
          if (Ce(he[Ve], Ve, he)) return !0;
        return !1
      }

      function et(he, Ce) {
        for (var Ve = -1, Nt = Array(he); ++Ve < he;) Nt[Ve] = Ce(Ve);
        return Nt
      }

      function rt(he) {
        return function (Ce) {
          return he(Ce)
        }
      }

      function Ze(he, Ce) {
        return he.has(Ce)
      }

      function qe(he, Ce) {
        return he?.[Ce]
      }

      function He(he) {
        var Ce = -1,
          Ve = Array(he.size);
        return he.forEach(function (Nt, pn) {
          Ve[++Ce] = [pn, Nt]
        }), Ve
      }

      function we(he, Ce) {
        return function (Ve) {
          return he(Ce(Ve))
        }
      }

      function xe(he) {
        var Ce = -1,
          Ve = Array(he.size);
        return he.forEach(function (Nt) {
          Ve[++Ce] = Nt
        }), Ve
      }
      var Ie = Array.prototype,
        Pe = Function.prototype,
        J = Object.prototype,
        L = ee["__core-js_shared__"],
        z = Pe.toString,
        ie = J.hasOwnProperty,
        ue = function () {
          var he = /[^.]+$/.exec(L && L.keys && L.keys.IE_PROTO || "");
          return he ? "Symbol(src)_1." + he : ""
        }(),
        me = J.toString,
        be = RegExp("^" + z.call(ie).replace(A, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"),
        Le = H ? ee.Buffer : void 0,
        ze = ee.Symbol,
        Qe = ee.Uint8Array,
        Xe = J.propertyIsEnumerable,
        Je = Ie.splice,
        kt = ze ? ze.toStringTag : void 0,
        Ut = Object.getOwnPropertySymbols,
        Ft = Le ? Le.isBuffer : void 0,
        Wt = we(Object.keys, Object),
        pt = Jo(ee, "DataView"),
        ct = Jo(ee, "Map"),
        gt = Jo(ee, "Promise"),
        mt = Jo(ee, "Set"),
        ht = Jo(ee, "WeakMap"),
        lt = Jo(Object, "create"),
        xt = Cd(pt),
        Ct = Cd(ct),
        wt = Cd(gt),
        Et = Cd(mt),
        vt = Cd(ht),
        yt = ze ? ze.prototype : void 0,
        bt = yt ? yt.valueOf : void 0;

      function st(he) {
        var Ce = -1,
          Ve = he == null ? 0 : he.length;
        for (this.clear(); ++Ce < Ve;) {
          var Nt = he[Ce];
          this.set(Nt[0], Nt[1])
        }
      }

      function At() {
        this.__data__ = lt ? lt(null) : {}, this.size = 0
      }

      function St(he) {
        var Ce = this.has(he) && delete this.__data__[he];
        return this.size -= Ce ? 1 : 0, Ce
      }

      function Gt(he) {
        var Ce = this.__data__;
        if (lt) {
          var Ve = Ce[he];
          return Ve === n ? void 0 : Ve
        }
        return ie.call(Ce, he) ? Ce[he] : void 0
      }

      function Zt(he) {
        var Ce = this.__data__;
        return lt ? Ce[he] !== void 0 : ie.call(Ce, he)
      }

      function Yt(he, Ce) {
        var Ve = this.__data__;
        return this.size += this.has(he) ? 0 : 1, Ve[he] = lt && Ce === void 0 ? n : Ce, this
      }
      st.prototype.clear = At, st.prototype.delete = St, st.prototype.get = Gt, st.prototype.has = Zt, st.prototype.set = Yt;

      function Pt(he) {
        var Ce = -1,
          Ve = he == null ? 0 : he.length;
        for (this.clear(); ++Ce < Ve;) {
          var Nt = he[Ce];
          this.set(Nt[0], Nt[1])
        }
      }

      function br() {
        this.__data__ = [], this.size = 0
      }

      function Nn(he) {
        var Ce = this.__data__,
          Ve = kp(Ce, he);
        if (Ve < 0) return !1;
        var Nt = Ce.length - 1;
        return Ve == Nt ? Ce.pop() : Je.call(Ce, Ve, 1), --this.size, !0
      }

      function Mn(he) {
        var Ce = this.__data__,
          Ve = kp(Ce, he);
        return Ve < 0 ? void 0 : Ce[Ve][1]
      }

      function Pn(he) {
        return kp(this.__data__, he) > -1
      }

      function $n(he, Ce) {
        var Ve = this.__data__,
          Nt = kp(Ve, he);
        return Nt < 0 ? (++this.size, Ve.push([he, Ce])) : Ve[Nt][1] = Ce, this
      }
      Pt.prototype.clear = br, Pt.prototype.delete = Nn, Pt.prototype.get = Mn, Pt.prototype.has = Pn, Pt.prototype.set = $n;

      function tn(he) {
        var Ce = -1,
          Ve = he == null ? 0 : he.length;
        for (this.clear(); ++Ce < Ve;) {
          var Nt = he[Ce];
          this.set(Nt[0], Nt[1])
        }
      }

      function Qn() {
        this.size = 0, this.__data__ = {
          hash: new st,
          map: new(ct || Pt),
          string: new st
        }
      }

      function Ii(he) {
        var Ce = cf(this, he).delete(he);
        return this.size -= Ce ? 1 : 0, Ce
      }

      function Jn(he) {
        return cf(this, he).get(he)
      }

      function Ti(he) {
        return cf(this, he).has(he)
      }

      function ki(he, Ce) {
        var Ve = cf(this, he),
          Nt = Ve.size;
        return Ve.set(he, Ce), this.size += Ve.size == Nt ? 0 : 1, this
      }
      tn.prototype.clear = Qn, tn.prototype.delete = Ii, tn.prototype.get = Jn, tn.prototype.has = Ti, tn.prototype.set = ki;

      function Xn(he) {
        var Ce = -1,
          Ve = he == null ? 0 : he.length;
        for (this.__data__ = new tn; ++Ce < Ve;) this.add(he[Ce])
      }

      function mi(he) {
        return this.__data__.set(he, n), this
      }

      function wi(he) {
        return this.__data__.has(he)
      }
      Xn.prototype.add = Xn.prototype.push = mi, Xn.prototype.has = wi;

      function hn(he) {
        var Ce = this.__data__ = new Pt(he);
        this.size = Ce.size
      }

      function Vs() {
        this.__data__ = new Pt, this.size = 0
      }

      function Ks(he) {
        var Ce = this.__data__,
          Ve = Ce.delete(he);
        return this.size = Ce.size, Ve
      }

      function Gs(he) {
        return this.__data__.get(he)
      }

      function jc(he) {
        return this.__data__.has(he)
      }

      function af(he, Ce) {
        var Ve = this.__data__;
        if (Ve instanceof Pt) {
          var Nt = Ve.__data__;
          if (!ct || Nt.length < r - 1) return Nt.push([he, Ce]), this.size = ++Ve.size, this;
          Ve = this.__data__ = new tn(Nt)
        }
        return Ve.set(he, Ce), this.size = Ve.size, this
      }
      hn.prototype.clear = Vs, hn.prototype.delete = Ks, hn.prototype.get = Gs, hn.prototype.has = jc, hn.prototype.set = af;

      function h_(he, Ce) {
        var Ve = jm(he),
          Nt = !Ve && E_(he),
          pn = !Ve && !Nt && m3(he),
          hr = !Ve && !Nt && !pn && I_(he),
          Tn = Ve || Nt || pn || hr,
          vi = Tn ? et(he.length, String) : [],
          Lr = vi.length;
        for (var gn in he) ie.call(he, gn) && !(Tn && (gn == "length" || pn && (gn == "offset" || gn == "parent") || hr && (gn == "buffer" || gn == "byteLength" || gn == "byteOffset") || b_(gn, Lr))) && vi.push(gn);
        return vi
      }

      function kp(he, Ce) {
        for (var Ve = he.length; Ve--;)
          if (C_(he[Ve][0], Ce)) return Ve;
        return -1
      }

      function p3(he, Ce, Ve) {
        var Nt = Ce(he);
        return jm(he) ? Nt : Oe(Nt, Ve(he))
      }

      function Rp(he) {
        return he == null ? he === void 0 ? j : $ : kt && kt in Object(he) ? w_(he) : AT(he)
      }

      function g3(he) {
        return Mp(he) && Rp(he) == a
      }

      function Np(he, Ce, Ve, Nt, pn) {
        return he === Ce ? !0 : he == null || Ce == null || !Mp(he) && !Mp(Ce) ? he !== he && Ce !== Ce : f_(he, Ce, Ve, Nt, Np, pn)
      }

      function f_(he, Ce, Ve, Nt, pn, hr) {
        var Tn = jm(he),
          vi = jm(Ce),
          Lr = Tn ? c : fu(he),
          gn = vi ? c : fu(Ce);
        Lr = Lr == a ? k : Lr, gn = gn == a ? k : gn;
        var ui = Lr == k,
          Ao = gn == k,
          bi = Lr == gn;
        if (bi && m3(he)) {
          if (!m3(Ce)) return !1;
          Tn = !0, ui = !1
        }
        if (bi && !ui) return hr || (hr = new hn), Tn || I_(he) ? Bm(he, Ce, Ve, Nt, pn, hr) : ET(he, Ce, Lr, Ve, Nt, pn, hr);
        if (!(Ve & i)) {
          var kn = ui && ie.call(he, "__wrapped__"),
            Zs = Ao && ie.call(Ce, "__wrapped__");
          if (kn || Zs) {
            var Fc = kn ? he.value() : he,
              Fa = Zs ? Ce.value() : Ce;
            return hr || (hr = new hn), pn(Fc, Fa, Ve, Nt, hr)
          }
        }
        return bi ? (hr || (hr = new hn), m_(he, Ce, Ve, Nt, pn, hr)) : !1
      }

      function CT(he) {
        if (!S_(he) || __(he)) return !1;
        var Ce = Fm(he) ? be : G;
        return Ce.test(Cd(he))
      }

      function p_(he) {
        return Mp(he) && A_(he.length) && !!W[Rp(he)]
      }

      function g_(he) {
        if (!x_(he)) return Wt(he);
        var Ce = [];
        for (var Ve in Object(he)) ie.call(he, Ve) && Ve != "constructor" && Ce.push(Ve);
        return Ce
      }

      function Bm(he, Ce, Ve, Nt, pn, hr) {
        var Tn = Ve & i,
          vi = he.length,
          Lr = Ce.length;
        if (vi != Lr && !(Tn && Lr > vi)) return !1;
        var gn = hr.get(he);
        if (gn && hr.get(Ce)) return gn == Ce;
        var ui = -1,
          Ao = !0,
          bi = Ve & s ? new Xn : void 0;
        for (hr.set(he, Ce), hr.set(Ce, he); ++ui < vi;) {
          var kn = he[ui],
            Zs = Ce[ui];
          if (Nt) var Fc = Tn ? Nt(Zs, kn, ui, Ce, he, hr) : Nt(kn, Zs, ui, he, Ce, hr);
          if (Fc !== void 0) {
            if (Fc) continue;
            Ao = !1;
            break
          }
          if (bi) {
            if (!De(Ce, function (Fa, pu) {
                if (!Ze(bi, pu) && (kn === Fa || pn(kn, Fa, Ve, Nt, hr))) return bi.push(pu)
              })) {
              Ao = !1;
              break
            }
          } else if (!(kn === Zs || pn(kn, Zs, Ve, Nt, hr))) {
            Ao = !1;
            break
          }
        }
        return hr.delete(he), hr.delete(Ce), Ao
      }

      function ET(he, Ce, Ve, Nt, pn, hr, Tn) {
        switch (Ve) {
          case I:
            if (he.byteLength != Ce.byteLength || he.byteOffset != Ce.byteOffset) return !1;
            he = he.buffer, Ce = Ce.buffer;
          case U:
            return !(he.byteLength != Ce.byteLength || !hr(new Qe(he), new Qe(Ce)));
          case h:
          case f:
          case N:
            return C_(+he, +Ce);
          case w:
            return he.name == Ce.name && he.message == Ce.message;
          case D:
          case R:
            return he == Ce + "";
          case M:
            var vi = He;
          case V:
            var Lr = Nt & i;
            if (vi || (vi = xe), he.size != Ce.size && !Lr) return !1;
            var gn = Tn.get(he);
            if (gn) return gn == Ce;
            Nt |= s, Tn.set(he, Ce);
            var ui = Bm(vi(he), vi(Ce), Nt, pn, hr, Tn);
            return Tn.delete(he), ui;
          case P:
            if (bt) return bt.call(he) == bt.call(Ce)
        }
        return !1
      }

      function m_(he, Ce, Ve, Nt, pn, hr) {
        var Tn = Ve & i,
          vi = Um(he),
          Lr = vi.length,
          gn = Um(Ce),
          ui = gn.length;
        if (Lr != ui && !Tn) return !1;
        for (var Ao = Lr; Ao--;) {
          var bi = vi[Ao];
          if (!(Tn ? bi in Ce : ie.call(Ce, bi))) return !1
        }
        var kn = hr.get(he);
        if (kn && hr.get(Ce)) return kn == Ce;
        var Zs = !0;
        hr.set(he, Ce), hr.set(Ce, he);
        for (var Fc = Tn; ++Ao < Lr;) {
          bi = vi[Ao];
          var Fa = he[bi],
            pu = Ce[bi];
          if (Nt) var w3 = Tn ? Nt(pu, Fa, bi, Ce, he, hr) : Nt(Fa, pu, bi, he, Ce, hr);
          if (!(w3 === void 0 ? Fa === pu || pn(Fa, pu, Ve, Nt, hr) : w3)) {
            Zs = !1;
            break
          }
          Fc || (Fc = bi == "constructor")
        }
        if (Zs && !Fc) {
          var Pp = he.constructor,
            Xi = Ce.constructor;
          Pp != Xi && "constructor" in he && "constructor" in Ce && !(typeof Pp == "function" && Pp instanceof Pp && typeof Xi == "function" && Xi instanceof Xi) && (Zs = !1)
        }
        return hr.delete(he), hr.delete(Ce), Zs
      }

      function Um(he) {
        return p3(he, TT, v_)
      }

      function cf(he, Ce) {
        var Ve = he.__data__;
        return y_(Ce) ? Ve[typeof Ce == "string" ? "string" : "hash"] : Ve.map
      }

      function Jo(he, Ce) {
        var Ve = qe(he, Ce);
        return CT(Ve) ? Ve : void 0
      }

      function w_(he) {
        var Ce = ie.call(he, kt),
          Ve = he[kt];
        try {
          he[kt] = void 0;
          var Nt = !0
        } catch {}
        var pn = me.call(he);
        return Nt && (Ce ? he[kt] = Ve : delete he[kt]), pn
      }
      var v_ = Ut ? function (he) {
          return he == null ? [] : (he = Object(he), Te(Ut(he), function (Ce) {
            return Xe.call(he, Ce)
          }))
        } : fn,
        fu = Rp;
      (pt && fu(new pt(new ArrayBuffer(1))) != I || ct && fu(new ct) != M || gt && fu(gt.resolve()) != B || mt && fu(new mt) != V || ht && fu(new ht) != Y) && (fu = function (he) {
        var Ce = Rp(he),
          Ve = Ce == k ? he.constructor : void 0,
          Nt = Ve ? Cd(Ve) : "";
        if (Nt) switch (Nt) {
          case xt:
            return I;
          case Ct:
            return M;
          case wt:
            return B;
          case Et:
            return V;
          case vt:
            return Y
        }
        return Ce
      });

      function b_(he, Ce) {
        return Ce = Ce ?? o, !!Ce && (typeof he == "number" || ce.test(he)) && he > -1 && he % 1 == 0 && he < Ce
      }

      function y_(he) {
        var Ce = typeof he;
        return Ce == "string" || Ce == "number" || Ce == "symbol" || Ce == "boolean" ? he !== "__proto__" : he === null
      }

      function __(he) {
        return !!ue && ue in he
      }

      function x_(he) {
        var Ce = he && he.constructor,
          Ve = typeof Ce == "function" && Ce.prototype || J;
        return he === Ve
      }

      function AT(he) {
        return me.call(he)
      }

      function Cd(he) {
        if (he != null) {
          try {
            return z.call(he)
          } catch {}
          try {
            return he + ""
          } catch {}
        }
        return ""
      }

      function C_(he, Ce) {
        return he === Ce || he !== he && Ce !== Ce
      }
      var E_ = g3(function () {
          return arguments
        }()) ? g3 : function (he) {
          return Mp(he) && ie.call(he, "callee") && !Xe.call(he, "callee")
        },
        jm = Array.isArray;

      function ST(he) {
        return he != null && A_(he.length) && !Fm(he)
      }
      var m3 = Ft || cn;

      function IT(he, Ce) {
        return Np(he, Ce)
      }

      function Fm(he) {
        if (!S_(he)) return !1;
        var Ce = Rp(he);
        return Ce == b || Ce == C || Ce == l || Ce == F
      }

      function A_(he) {
        return typeof he == "number" && he > -1 && he % 1 == 0 && he <= o
      }

      function S_(he) {
        var Ce = typeof he;
        return he != null && (Ce == "object" || Ce == "function")
      }

      function Mp(he) {
        return he != null && typeof he == "object"
      }
      var I_ = ge ? rt(ge) : p_;

      function TT(he) {
        return ST(he) ? h_(he) : g_(he)
      }

      function fn() {
        return []
      }

      function cn() {
        return !1
      }
      t.exports = IT
    }(y4, y4.exports);
  var Vve = y4.exports;
  const Kve = Za(Vve),
    pB = "wc",
    gB = 2,
    yE = "core",
    Ll = `${pB}@2:${yE}:`,
    Gve = {
      name: yE,
      logger: "error"
    },
    Zve = {
      database: ":memory:"
    },
    Yve = "crypto",
    mB = "client_ed25519_seed",
    Qve = at.ONE_DAY,
    Jve = "keychain",
    Xve = "0.3",
    ebe = "messages",
    tbe = "0.3",
    rbe = at.SIX_HOURS,
    nbe = "publisher",
    wB = "irn",
    ibe = "error",
    vB = "wss://relay.walletconnect.org",
    sbe = "relayer",
    Bs = {
      message: "relayer_message",
      message_ack: "relayer_message_ack",
      connect: "relayer_connect",
      disconnect: "relayer_disconnect",
      error: "relayer_error",
      connection_stalled: "relayer_connection_stalled",
      transport_closed: "relayer_transport_closed",
      publish: "relayer_publish"
    },
    obe = "_subscription",
    Sa = {
      payload: "payload",
      connect: "connect",
      disconnect: "disconnect",
      error: "error"
    },
    abe = .1,
    _E = "2.17.0",
    un = {
      link_mode: "link_mode",
      relay: "relay"
    },
    cbe = "0.3",
    lbe = "WALLETCONNECT_CLIENT_ID",
    bB = "WALLETCONNECT_LINK_MODE_APPS",
    Bl = {
      created: "subscription_created",
      deleted: "subscription_deleted",
      expired: "subscription_expired",
      disabled: "subscription_disabled",
      sync: "subscription_sync",
      resubscribed: "subscription_resubscribed"
    },
    ube = "subscription",
    dbe = "0.3",
    hbe = at.FIVE_SECONDS * 1e3,
    fbe = "pairing",
    pbe = "0.3",
    _v = {
      wc_pairingDelete: {
        req: {
          ttl: at.ONE_DAY,
          prompt: !1,
          tag: 1e3
        },
        res: {
          ttl: at.ONE_DAY,
          prompt: !1,
          tag: 1001
        }
      },
      wc_pairingPing: {
        req: {
          ttl: at.THIRTY_SECONDS,
          prompt: !1,
          tag: 1002
        },
        res: {
          ttl: at.THIRTY_SECONDS,
          prompt: !1,
          tag: 1003
        }
      },
      unregistered_method: {
        req: {
          ttl: at.ONE_DAY,
          prompt: !1,
          tag: 0
        },
        res: {
          ttl: at.ONE_DAY,
          prompt: !1,
          tag: 0
        }
      }
    },
    S0 = {
      create: "pairing_create",
      expire: "pairing_expire",
      delete: "pairing_delete",
      ping: "pairing_ping"
    },
    Cc = {
      created: "history_created",
      updated: "history_updated",
      deleted: "history_deleted",
      sync: "history_sync"
    },
    gbe = "history",
    mbe = "0.3",
    wbe = "expirer",
    Ia = {
      created: "expirer_created",
      deleted: "expirer_deleted",
      expired: "expirer_expired",
      sync: "expirer_sync"
    },
    vbe = "0.3",
    bbe = "verify-api",
    ybe = "https://verify.walletconnect.com",
    yB = "https://verify.walletconnect.org",
    xv = yB,
    _be = `${xv}/v3`,
    xbe = [ybe, yB],
    Cbe = "echo",
    Ebe = "https://echo.walletconnect.com",
    Ul = {
      pairing_started: "pairing_started",
      pairing_uri_validation_success: "pairing_uri_validation_success",
      pairing_uri_not_expired: "pairing_uri_not_expired",
      store_new_pairing: "store_new_pairing",
      subscribing_pairing_topic: "subscribing_pairing_topic",
      subscribe_pairing_topic_success: "subscribe_pairing_topic_success",
      existing_pairing: "existing_pairing",
      pairing_not_expired: "pairing_not_expired",
      emit_inactive_pairing: "emit_inactive_pairing",
      emit_session_proposal: "emit_session_proposal",
      subscribing_to_pairing_topic: "subscribing_to_pairing_topic"
    },
    td = {
      no_wss_connection: "no_wss_connection",
      no_internet_connection: "no_internet_connection",
      malformed_pairing_uri: "malformed_pairing_uri",
      active_pairing_already_exists: "active_pairing_already_exists",
      subscribe_pairing_topic_failure: "subscribe_pairing_topic_failure",
      pairing_expired: "pairing_expired",
      proposal_expired: "proposal_expired",
      proposal_listener_not_found: "proposal_listener_not_found"
    },
    Ec = {
      session_approve_started: "session_approve_started",
      proposal_not_expired: "proposal_not_expired",
      session_namespaces_validation_success: "session_namespaces_validation_success",
      create_session_topic: "create_session_topic",
      subscribing_session_topic: "subscribing_session_topic",
      subscribe_session_topic_success: "subscribe_session_topic_success",
      publishing_session_approve: "publishing_session_approve",
      session_approve_publish_success: "session_approve_publish_success",
      store_session: "store_session",
      publishing_session_settle: "publishing_session_settle",
      session_settle_publish_success: "session_settle_publish_success"
    },
    I0 = {
      no_internet_connection: "no_internet_connection",
      no_wss_connection: "no_wss_connection",
      proposal_expired: "proposal_expired",
      subscribe_session_topic_failure: "subscribe_session_topic_failure",
      session_approve_publish_failure: "session_approve_publish_failure",
      session_settle_publish_failure: "session_settle_publish_failure",
      session_approve_namespace_validation_failure: "session_approve_namespace_validation_failure",
      proposal_not_found: "proposal_not_found"
    },
    T0 = {
      authenticated_session_approve_started: "authenticated_session_approve_started",
      authenticated_session_not_expired: "authenticated_session_not_expired",
      chains_caip2_compliant: "chains_caip2_compliant",
      chains_evm_compliant: "chains_evm_compliant",
      create_authenticated_session_topic: "create_authenticated_session_topic",
      cacaos_verified: "cacaos_verified",
      store_authenticated_session: "store_authenticated_session",
      subscribing_authenticated_session_topic: "subscribing_authenticated_session_topic",
      subscribe_authenticated_session_topic_success: "subscribe_authenticated_session_topic_success",
      publishing_authenticated_session_approve: "publishing_authenticated_session_approve",
      authenticated_session_approve_publish_success: "authenticated_session_approve_publish_success"
    },
    Cv = {
      no_internet_connection: "no_internet_connection",
      no_wss_connection: "no_wss_connection",
      missing_session_authenticate_request: "missing_session_authenticate_request",
      session_authenticate_request_expired: "session_authenticate_request_expired",
      chains_caip2_compliant_failure: "chains_caip2_compliant_failure",
      chains_evm_compliant_failure: "chains_evm_compliant_failure",
      invalid_cacao: "invalid_cacao",
      subscribe_authenticated_session_topic_failure: "subscribe_authenticated_session_topic_failure",
      authenticated_session_approve_publish_failure: "authenticated_session_approve_publish_failure",
      authenticated_session_pending_request_not_found: "authenticated_session_pending_request_not_found"
    },
    Abe = .1,
    Sbe = "event-client",
    Ibe = 86400,
    Tbe = "https://pulse.walletconnect.org/batch";

  function kbe(t, e) {
    if (t.length >= 255) throw new TypeError("Alphabet too long");
    for (var r = new Uint8Array(256), n = 0; n < r.length; n++) r[n] = 255;
    for (var i = 0; i < t.length; i++) {
      var s = t.charAt(i),
        o = s.charCodeAt(0);
      if (r[o] !== 255) throw new TypeError(s + " is ambiguous");
      r[o] = i
    }
    var a = t.length,
      c = t.charAt(0),
      l = Math.log(a) / Math.log(256),
      h = Math.log(256) / Math.log(a);

    function f(C) {
      if (C instanceof Uint8Array || (ArrayBuffer.isView(C) ? C = new Uint8Array(C.buffer, C.byteOffset, C.byteLength) : Array.isArray(C) && (C = Uint8Array.from(C))), !(C instanceof Uint8Array)) throw new TypeError("Expected Uint8Array");
      if (C.length === 0) return "";
      for (var M = 0, N = 0, $ = 0, k = C.length; $ !== k && C[$] === 0;) $++, M++;
      for (var B = (k - $) * h + 1 >>> 0, F = new Uint8Array(B); $ !== k;) {
        for (var D = C[$], V = 0, R = B - 1;
          (D !== 0 || V < N) && R !== -1; R--, V++) D += 256 * F[R] >>> 0, F[R] = D % a >>> 0, D = D / a >>> 0;
        if (D !== 0) throw new Error("Non-zero carry");
        N = V, $++
      }
      for (var P = B - N; P !== B && F[P] === 0;) P++;
      for (var j = c.repeat(M); P < B; ++P) j += t.charAt(F[P]);
      return j
    }

    function w(C) {
      if (typeof C != "string") throw new TypeError("Expected String");
      if (C.length === 0) return new Uint8Array;
      var M = 0;
      if (C[M] !== " ") {
        for (var N = 0, $ = 0; C[M] === c;) N++, M++;
        for (var k = (C.length - M) * l + 1 >>> 0, B = new Uint8Array(k); C[M];) {
          var F = r[C.charCodeAt(M)];
          if (F === 255) return;
          for (var D = 0, V = k - 1;
            (F !== 0 || D < $) && V !== -1; V--, D++) F += a * B[V] >>> 0, B[V] = F % 256 >>> 0, F = F / 256 >>> 0;
          if (F !== 0) throw new Error("Non-zero carry");
          $ = D, M++
        }
        if (C[M] !== " ") {
          for (var R = k - $; R !== k && B[R] === 0;) R++;
          for (var P = new Uint8Array(N + (k - R)), j = N; R !== k;) P[j++] = B[R++];
          return P
        }
      }
    }

    function b(C) {
      var M = w(C);
      if (M) return M;
      throw new Error(`Non-${e} character`)
    }
    return {
      encode: f,
      decodeUnsafe: w,
      decode: b
    }
  }
  var Rbe = kbe,
    Nbe = Rbe;
  const _B = t => {
      if (t instanceof Uint8Array && t.constructor.name === "Uint8Array") return t;
      if (t instanceof ArrayBuffer) return new Uint8Array(t);
      if (ArrayBuffer.isView(t)) return new Uint8Array(t.buffer, t.byteOffset, t.byteLength);
      throw new Error("Unknown type, must be binary type")
    },
    Mbe = t => new TextEncoder().encode(t),
    Pbe = t => new TextDecoder().decode(t);
  class $be {
    constructor(e, r, n) {
      this.name = e, this.prefix = r, this.baseEncode = n
    }
    encode(e) {
      if (e instanceof Uint8Array) return `${this.prefix}${this.baseEncode(e)}`;
      throw Error("Unknown type, must be binary type")
    }
  }
  class Obe {
    constructor(e, r, n) {
      if (this.name = e, this.prefix = r, r.codePointAt(0) === void 0) throw new Error("Invalid prefix character");
      this.prefixCodePoint = r.codePointAt(0), this.baseDecode = n
    }
    decode(e) {
      if (typeof e == "string") {
        if (e.codePointAt(0) !== this.prefixCodePoint) throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);
        return this.baseDecode(e.slice(this.prefix.length))
      } else throw Error("Can only multibase decode strings")
    }
    or(e) {
      return xB(this, e)
    }
  }
  class Dbe {
    constructor(e) {
      this.decoders = e
    }
    or(e) {
      return xB(this, e)
    }
    decode(e) {
      const r = e[0],
        n = this.decoders[r];
      if (n) return n.decode(e);
      throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)
    }
  }
  const xB = (t, e) => new Dbe({
    ...t.decoders || {
      [t.prefix]: t
    },
    ...e.decoders || {
      [e.prefix]: e
    }
  });
  class Lbe {
    constructor(e, r, n, i) {
      this.name = e, this.prefix = r, this.baseEncode = n, this.baseDecode = i, this.encoder = new $be(e, r, n), this.decoder = new Obe(e, r, i)
    }
    encode(e) {
      return this.encoder.encode(e)
    }
    decode(e) {
      return this.decoder.decode(e)
    }
  }
  const _4 = ({
      name: t,
      prefix: e,
      encode: r,
      decode: n
    }) => new Lbe(t, e, r, n),
    Ev = ({
      prefix: t,
      name: e,
      alphabet: r
    }) => {
      const {
        encode: n,
        decode: i
      } = Nbe(r, e);
      return _4({
        prefix: t,
        name: e,
        encode: n,
        decode: s => _B(i(s))
      })
    },
    Bbe = (t, e, r, n) => {
      const i = {};
      for (let h = 0; h < e.length; ++h) i[e[h]] = h;
      let s = t.length;
      for (; t[s - 1] === "=";) --s;
      const o = new Uint8Array(s * r / 8 | 0);
      let a = 0,
        c = 0,
        l = 0;
      for (let h = 0; h < s; ++h) {
        const f = i[t[h]];
        if (f === void 0) throw new SyntaxError(`Non-${n} character`);
        c = c << r | f, a += r, a >= 8 && (a -= 8, o[l++] = 255 & c >> a)
      }
      if (a >= r || 255 & c << 8 - a) throw new SyntaxError("Unexpected end of data");
      return o
    },
    Ube = (t, e, r) => {
      const n = e[e.length - 1] === "=",
        i = (1 << r) - 1;
      let s = "",
        o = 0,
        a = 0;
      for (let c = 0; c < t.length; ++c)
        for (a = a << 8 | t[c], o += 8; o > r;) o -= r, s += e[i & a >> o];
      if (o && (s += e[i & a << r - o]), n)
        for (; s.length * r & 7;) s += "=";
      return s
    },
    os = ({
      name: t,
      prefix: e,
      bitsPerChar: r,
      alphabet: n
    }) => _4({
      prefix: e,
      name: t,
      encode(i) {
        return Ube(i, n, r)
      },
      decode(i) {
        return Bbe(i, n, r, t)
      }
    }),
    jbe = _4({
      prefix: "\0",
      name: "identity",
      encode: t => Pbe(t),
      decode: t => Mbe(t)
    });
  var Fbe = Object.freeze({
    __proto__: null,
    identity: jbe
  });
  const Wbe = os({
    prefix: "0",
    name: "base2",
    alphabet: "01",
    bitsPerChar: 1
  });
  var zbe = Object.freeze({
    __proto__: null,
    base2: Wbe
  });
  const Hbe = os({
    prefix: "7",
    name: "base8",
    alphabet: "01234567",
    bitsPerChar: 3
  });
  var qbe = Object.freeze({
    __proto__: null,
    base8: Hbe
  });
  const Vbe = Ev({
    prefix: "9",
    name: "base10",
    alphabet: "0123456789"
  });
  var Kbe = Object.freeze({
    __proto__: null,
    base10: Vbe
  });
  const Gbe = os({
      prefix: "f",
      name: "base16",
      alphabet: "0123456789abcdef",
      bitsPerChar: 4
    }),
    Zbe = os({
      prefix: "F",
      name: "base16upper",
      alphabet: "0123456789ABCDEF",
      bitsPerChar: 4
    });
  var Ybe = Object.freeze({
    __proto__: null,
    base16: Gbe,
    base16upper: Zbe
  });
  const Qbe = os({
      prefix: "b",
      name: "base32",
      alphabet: "abcdefghijklmnopqrstuvwxyz234567",
      bitsPerChar: 5
    }),
    Jbe = os({
      prefix: "B",
      name: "base32upper",
      alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",
      bitsPerChar: 5
    }),
    Xbe = os({
      prefix: "c",
      name: "base32pad",
      alphabet: "abcdefghijklmnopqrstuvwxyz234567=",
      bitsPerChar: 5
    }),
    e3e = os({
      prefix: "C",
      name: "base32padupper",
      alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",
      bitsPerChar: 5
    }),
    t3e = os({
      prefix: "v",
      name: "base32hex",
      alphabet: "0123456789abcdefghijklmnopqrstuv",
      bitsPerChar: 5
    }),
    r3e = os({
      prefix: "V",
      name: "base32hexupper",
      alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV",
      bitsPerChar: 5
    }),
    n3e = os({
      prefix: "t",
      name: "base32hexpad",
      alphabet: "0123456789abcdefghijklmnopqrstuv=",
      bitsPerChar: 5
    }),
    i3e = os({
      prefix: "T",
      name: "base32hexpadupper",
      alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUV=",
      bitsPerChar: 5
    }),
    s3e = os({
      prefix: "h",
      name: "base32z",
      alphabet: "ybndrfg8ejkmcpqxot1uwisza345h769",
      bitsPerChar: 5
    });
  var o3e = Object.freeze({
    __proto__: null,
    base32: Qbe,
    base32upper: Jbe,
    base32pad: Xbe,
    base32padupper: e3e,
    base32hex: t3e,
    base32hexupper: r3e,
    base32hexpad: n3e,
    base32hexpadupper: i3e,
    base32z: s3e
  });
  const a3e = Ev({
      prefix: "k",
      name: "base36",
      alphabet: "0123456789abcdefghijklmnopqrstuvwxyz"
    }),
    c3e = Ev({
      prefix: "K",
      name: "base36upper",
      alphabet: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
    });
  var l3e = Object.freeze({
    __proto__: null,
    base36: a3e,
    base36upper: c3e
  });
  const u3e = Ev({
      name: "base58btc",
      prefix: "z",
      alphabet: "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
    }),
    d3e = Ev({
      name: "base58flickr",
      prefix: "Z",
      alphabet: "123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"
    });
  var h3e = Object.freeze({
    __proto__: null,
    base58btc: u3e,
    base58flickr: d3e
  });
  const f3e = os({
      prefix: "m",
      name: "base64",
      alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
      bitsPerChar: 6
    }),
    p3e = os({
      prefix: "M",
      name: "base64pad",
      alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
      bitsPerChar: 6
    }),
    g3e = os({
      prefix: "u",
      name: "base64url",
      alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",
      bitsPerChar: 6
    }),
    m3e = os({
      prefix: "U",
      name: "base64urlpad",
      alphabet: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",
      bitsPerChar: 6
    });
  var w3e = Object.freeze({
    __proto__: null,
    base64: f3e,
    base64pad: p3e,
    base64url: g3e,
    base64urlpad: m3e
  });
  const CB = Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),
    v3e = CB.reduce((t, e, r) => (t[r] = e, t), []),
    b3e = CB.reduce((t, e, r) => (t[e.codePointAt(0)] = r, t), []);

  function y3e(t) {
    return t.reduce((e, r) => (e += v3e[r], e), "")
  }

  function _3e(t) {
    const e = [];
    for (const r of t) {
      const n = b3e[r.codePointAt(0)];
      if (n === void 0) throw new Error(`Non-base256emoji character: ${r}`);
      e.push(n)
    }
    return new Uint8Array(e)
  }
  const x3e = _4({
    prefix: "🚀",
    name: "base256emoji",
    encode: y3e,
    decode: _3e
  });
  var C3e = Object.freeze({
      __proto__: null,
      base256emoji: x3e
    }),
    E3e = AB,
    EB = 128,
    A3e = 127,
    S3e = ~A3e,
    I3e = Math.pow(2, 31);

  function AB(t, e, r) {
    e = e || [], r = r || 0;
    for (var n = r; t >= I3e;) e[r++] = t & 255 | EB, t /= 128;
    for (; t & S3e;) e[r++] = t & 255 | EB, t >>>= 7;
    return e[r] = t | 0, AB.bytes = r - n + 1, e
  }
  var T3e = xE,
    k3e = 128,
    SB = 127;

  function xE(t, n) {
    var r = 0,
      n = n || 0,
      i = 0,
      s = n,
      o, a = t.length;
    do {
      if (s >= a) throw xE.bytes = 0, new RangeError("Could not decode varint");
      o = t[s++], r += i < 28 ? (o & SB) << i : (o & SB) * Math.pow(2, i), i += 7
    } while (o >= k3e);
    return xE.bytes = s - n, r
  }
  var R3e = Math.pow(2, 7),
    N3e = Math.pow(2, 14),
    M3e = Math.pow(2, 21),
    P3e = Math.pow(2, 28),
    $3e = Math.pow(2, 35),
    O3e = Math.pow(2, 42),
    D3e = Math.pow(2, 49),
    L3e = Math.pow(2, 56),
    B3e = Math.pow(2, 63),
    U3e = function (t) {
      return t < R3e ? 1 : t < N3e ? 2 : t < M3e ? 3 : t < P3e ? 4 : t < $3e ? 5 : t < O3e ? 6 : t < D3e ? 7 : t < L3e ? 8 : t < B3e ? 9 : 10
    },
    j3e = {
      encode: E3e,
      decode: T3e,
      encodingLength: U3e
    },
    IB = j3e;
  const TB = (t, e, r = 0) => (IB.encode(t, e, r), e),
    kB = t => IB.encodingLength(t),
    CE = (t, e) => {
      const r = e.byteLength,
        n = kB(t),
        i = n + kB(r),
        s = new Uint8Array(i + r);
      return TB(t, s, 0), TB(r, s, n), s.set(e, i), new F3e(t, r, e, s)
    };
  class F3e {
    constructor(e, r, n, i) {
      this.code = e, this.size = r, this.digest = n, this.bytes = i
    }
  }
  const RB = ({
    name: t,
    code: e,
    encode: r
  }) => new W3e(t, e, r);
  class W3e {
    constructor(e, r, n) {
      this.name = e, this.code = r, this.encode = n
    }
    digest(e) {
      if (e instanceof Uint8Array) {
        const r = this.encode(e);
        return r instanceof Uint8Array ? CE(this.code, r) : r.then(n => CE(this.code, n))
      } else throw Error("Unknown type, must be binary type")
    }
  }
  const NB = t => async e => new Uint8Array(await crypto.subtle.digest(t, e)), z3e = RB({
    name: "sha2-256",
    code: 18,
    encode: NB("SHA-256")
  }), H3e = RB({
    name: "sha2-512",
    code: 19,
    encode: NB("SHA-512")
  });
  var q3e = Object.freeze({
    __proto__: null,
    sha256: z3e,
    sha512: H3e
  });
  const MB = 0,
    V3e = "identity",
    PB = _B;
  var K3e = Object.freeze({
    __proto__: null,
    identity: {
      code: MB,
      name: V3e,
      encode: PB,
      digest: t => CE(MB, PB(t))
    }
  });
  new TextEncoder, new TextDecoder;
  const $B = {
    ...Fbe,
    ...zbe,
    ...qbe,
    ...Kbe,
    ...Ybe,
    ...o3e,
    ...l3e,
    ...h3e,
    ...w3e,
    ...C3e
  };
  ({
    ...q3e,
    ...K3e
  });

  function G3e(t = 0) {
    return globalThis.Buffer != null && globalThis.Buffer.allocUnsafe != null ? globalThis.Buffer.allocUnsafe(t) : new Uint8Array(t)
  }

  function OB(t, e, r, n) {
    return {
      name: t,
      prefix: e,
      encoder: {
        name: t,
        prefix: e,
        encode: r
      },
      decoder: {
        decode: n
      }
    }
  }
  const DB = OB("utf8", "u", t => "u" + new TextDecoder("utf8").decode(t), t => new TextEncoder().encode(t.substring(1))),
    EE = OB("ascii", "a", t => {
      let e = "a";
      for (let r = 0; r < t.length; r++) e += String.fromCharCode(t[r]);
      return e
    }, t => {
      t = t.substring(1);
      const e = G3e(t.length);
      for (let r = 0; r < t.length; r++) e[r] = t.charCodeAt(r);
      return e
    }),
    Z3e = {
      utf8: DB,
      "utf-8": DB,
      hex: $B.base16,
      latin1: EE,
      ascii: EE,
      binary: EE,
      ...$B
    };

  function Y3e(t, e = "utf8") {
    const r = Z3e[e];
    if (!r) throw new Error(`Unsupported encoding "${e}"`);
    return (e === "utf8" || e === "utf-8") && globalThis.Buffer != null && globalThis.Buffer.from != null ? globalThis.Buffer.from(t, "utf8") : r.decoder.decode(`${r.prefix}${t}`)
  }
  class Q3e {
    constructor(e, r) {
      this.core = e, this.logger = r, this.keychain = new Map, this.name = Jve, this.version = Xve, this.initialized = !1, this.storagePrefix = Ll, this.init = async () => {
        if (!this.initialized) {
          const n = await this.getKeyChain();
          typeof n < "u" && (this.keychain = n), this.initialized = !0
        }
      }, this.has = n => (this.isInitialized(), this.keychain.has(n)), this.set = async (n, i) => {
        this.isInitialized(), this.keychain.set(n, i), await this.persist()
      }, this.get = n => {
        this.isInitialized();
        const i = this.keychain.get(n);
        if (typeof i > "u") {
          const {
            message: s
          } = it("NO_MATCHING_KEY", `${this.name}: ${n}`);
          throw new Error(s)
        }
        return i
      }, this.del = async n => {
        this.isInitialized(), this.keychain.delete(n), await this.persist()
      }, this.core = e, this.logger = bs(r, this.name)
    }
    get context() {
      return so(this.logger)
    }
    get storageKey() {
      return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name
    }
    async setKeyChain(e) {
      await this.core.storage.setItem(this.storageKey, vD(e))
    }
    async getKeyChain() {
      const e = await this.core.storage.getItem(this.storageKey);
      return typeof e < "u" ? bD(e) : void 0
    }
    async persist() {
      await this.setKeyChain(this.keychain)
    }
    isInitialized() {
      if (!this.initialized) {
        const {
          message: e
        } = it("NOT_INITIALIZED", this.name);
        throw new Error(e)
      }
    }
  }
  class J3e {
    constructor(e, r, n) {
      this.core = e, this.logger = r, this.name = Yve, this.randomSessionIdentifier = hE(), this.initialized = !1, this.init = async () => {
        this.initialized || (await this.keychain.init(), this.initialized = !0)
      }, this.hasKeys = i => (this.isInitialized(), this.keychain.has(i)), this.getClientId = async () => {
        this.isInitialized();
        const i = await this.getClientSeed(),
          s = oO(i);
        return sO(s.publicKey)
      }, this.generateKeyPair = () => {
        this.isInitialized();
        const i = C2e();
        return this.setPrivateKey(i.publicKey, i.privateKey)
      }, this.signJWT = async i => {
        this.isInitialized();
        const s = await this.getClientSeed(),
          o = oO(s),
          a = this.randomSessionIdentifier;
        return await p0e(a, i, Qve, o)
      }, this.generateSharedKey = (i, s, o) => {
        this.isInitialized();
        const a = this.getPrivateKey(i),
          c = E2e(a, s);
        return this.setSymKey(c, o)
      }, this.setSymKey = async (i, s) => {
        this.isInitialized();
        const o = s || p4(i);
        return await this.keychain.set(o, i), o
      }, this.deleteKeyPair = async i => {
        this.isInitialized(), await this.keychain.del(i)
      }, this.deleteSymKey = async i => {
        this.isInitialized(), await this.keychain.del(i)
      }, this.encode = async (i, s, o) => {
        this.isInitialized();
        const a = UL(o),
          c = Nu(s);
        if (FL(a)) return S2e(c, o?.encoding);
        if (jL(a)) {
          const w = a.senderPublicKey,
            b = a.receiverPublicKey;
          i = await this.generateSharedKey(w, b)
        }
        const l = this.getSymKey(i),
          {
            type: h,
            senderPublicKey: f
          } = a;
        return A2e({
          type: h,
          symKey: l,
          message: c,
          senderPublicKey: f,
          encoding: o?.encoding
        })
      }, this.decode = async (i, s, o) => {
        this.isInitialized();
        const a = k2e(s, o);
        if (FL(a)) {
          const c = T2e(s, o?.encoding);
          return Pf(c)
        }
        if (jL(a)) {
          const c = a.receiverPublicKey,
            l = a.senderPublicKey;
          i = await this.generateSharedKey(c, l)
        }
        try {
          const c = this.getSymKey(i),
            l = I2e({
              symKey: c,
              encoded: s,
              encoding: o?.encoding
            });
          return Pf(l)
        } catch (c) {
          this.logger.error(`Failed to decode message from topic: '${i}', clientId: '${await this.getClientId()}'`), this.logger.error(c)
        }
      }, this.getPayloadType = (i, s = kh) => {
        const o = gv({
          encoded: i,
          encoding: s
        });
        return E0(o.type)
      }, this.getPayloadSenderPublicKey = (i, s = kh) => {
        const o = gv({
          encoded: i,
          encoding: s
        });
        return o.senderPublicKey ? uo(o.senderPublicKey, Ls) : void 0
      }, this.core = e, this.logger = bs(r, this.name), this.keychain = n || new Q3e(this.core, this.logger)
    }
    get context() {
      return so(this.logger)
    }
    async setPrivateKey(e, r) {
      return await this.keychain.set(e, r), e
    }
    getPrivateKey(e) {
      return this.keychain.get(e)
    }
    async getClientSeed() {
      let e = "";
      try {
        e = this.keychain.get(mB)
      } catch {
        e = hE(), await this.keychain.set(mB, e)
      }
      return Y3e(e, "base16")
    }
    getSymKey(e) {
      return this.keychain.get(e)
    }
    isInitialized() {
      if (!this.initialized) {
        const {
          message: e
        } = it("NOT_INITIALIZED", this.name);
        throw new Error(e)
      }
    }
  }
  class X3e extends yhe {
    constructor(e, r) {
      super(e, r), this.logger = e, this.core = r, this.messages = new Map, this.name = ebe, this.version = tbe, this.initialized = !1, this.storagePrefix = Ll, this.init = async () => {
        if (!this.initialized) {
          this.logger.trace("Initialized");
          try {
            const n = await this.getRelayerMessages();
            typeof n < "u" && (this.messages = n), this.logger.debug(`Successfully Restored records for ${this.name}`), this.logger.trace({
              type: "method",
              method: "restore",
              size: this.messages.size
            })
          } catch (n) {
            this.logger.debug(`Failed to Restore records for ${this.name}`), this.logger.error(n)
          } finally {
            this.initialized = !0
          }
        }
      }, this.set = async (n, i) => {
        this.isInitialized();
        const s = Ju(i);
        let o = this.messages.get(n);
        return typeof o > "u" && (o = {}), typeof o[s] < "u" || (o[s] = i, this.messages.set(n, o), await this.persist()), s
      }, this.get = n => {
        this.isInitialized();
        let i = this.messages.get(n);
        return typeof i > "u" && (i = {}), i
      }, this.has = (n, i) => {
        this.isInitialized();
        const s = this.get(n),
          o = Ju(i);
        return typeof s[o] < "u"
      }, this.del = async n => {
        this.isInitialized(), this.messages.delete(n), await this.persist()
      }, this.logger = bs(e, this.name), this.core = r
    }
    get context() {
      return so(this.logger)
    }
    get storageKey() {
      return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name
    }
    async setRelayerMessages(e) {
      await this.core.storage.setItem(this.storageKey, vD(e))
    }
    async getRelayerMessages() {
      const e = await this.core.storage.getItem(this.storageKey);
      return typeof e < "u" ? bD(e) : void 0
    }
    async persist() {
      await this.setRelayerMessages(this.messages)
    }
    isInitialized() {
      if (!this.initialized) {
        const {
          message: e
        } = it("NOT_INITIALIZED", this.name);
        throw new Error(e)
      }
    }
  }
  class eye extends _he {
    constructor(e, r) {
      super(e, r), this.relayer = e, this.logger = r, this.events = new Fi.EventEmitter, this.name = nbe, this.queue = new Map, this.publishTimeout = at.toMiliseconds(at.ONE_MINUTE), this.failedPublishTimeout = at.toMiliseconds(at.ONE_SECOND), this.needsTransportRestart = !1, this.publish = async (n, i, s) => {
        var o;
        this.logger.debug("Publishing Payload"), this.logger.trace({
          type: "method",
          method: "publish",
          params: {
            topic: n,
            message: i,
            opts: s
          }
        });
        const a = s?.ttl || rbe,
          c = fE(s),
          l = s?.prompt || !1,
          h = s?.tag || 0,
          f = s?.id || A0().toString(),
          w = {
            topic: n,
            message: i,
            opts: {
              ttl: a,
              relay: c,
              prompt: l,
              tag: h,
              id: f,
              attestation: s?.attestation
            }
          },
          b = `Failed to publish payload, please try again. id:${f} tag:${h}`,
          C = Date.now();
        let M, N = 1;
        try {
          for (; M === void 0;) {
            if (Date.now() - C > this.publishTimeout) throw new Error(b);
            this.logger.trace({
              id: f,
              attempts: N
            }, `publisher.publish - attempt ${N}`), M = await await gg(this.rpcPublish(n, i, a, c, l, h, f, s?.attestation).catch($ => this.logger.warn($)), this.publishTimeout, b), N++, M || await new Promise($ => setTimeout($, this.failedPublishTimeout))
          }
          this.relayer.events.emit(Bs.publish, w), this.logger.debug("Successfully Published Payload"), this.logger.trace({
            type: "method",
            method: "publish",
            params: {
              id: f,
              topic: n,
              message: i,
              opts: s
            }
          })
        } catch ($) {
          if (this.logger.debug("Failed to Publish Payload"), this.logger.error($), (o = s?.internal) != null && o.throwOnFailedPublish) throw $;
          this.queue.set(f, w)
        }
      }, this.on = (n, i) => {
        this.events.on(n, i)
      }, this.once = (n, i) => {
        this.events.once(n, i)
      }, this.off = (n, i) => {
        this.events.off(n, i)
      }, this.removeListener = (n, i) => {
        this.events.removeListener(n, i)
      }, this.relayer = e, this.logger = bs(r, this.name), this.registerEventListeners()
    }
    get context() {
      return so(this.logger)
    }
    rpcPublish(e, r, n, i, s, o, a, c) {
      var l, h, f, w;
      const b = {
        method: mv(i.protocol).publish,
        params: {
          topic: e,
          message: r,
          ttl: n,
          prompt: s,
          tag: o,
          attestation: c
        },
        id: a
      };
      return wo((l = b.params) == null ? void 0 : l.prompt) && ((h = b.params) == null || delete h.prompt), wo((f = b.params) == null ? void 0 : f.tag) && ((w = b.params) == null || delete w.tag), this.logger.debug("Outgoing Relay Payload"), this.logger.trace({
        type: "message",
        direction: "outgoing",
        request: b
      }), this.relayer.request(b)
    }
    removeRequestFromQueue(e) {
      this.queue.delete(e)
    }
    checkQueue() {
      this.queue.forEach(async e => {
        const {
          topic: r,
          message: n,
          opts: i
        } = e;
        await this.publish(r, n, i)
      })
    }
    registerEventListeners() {
      this.relayer.core.heartbeat.on(X1.pulse, () => {
        if (this.needsTransportRestart) {
          this.needsTransportRestart = !1, this.relayer.events.emit(Bs.connection_stalled);
          return
        }
        this.checkQueue()
      }), this.relayer.on(Bs.message_ack, e => {
        this.removeRequestFromQueue(e.id.toString())
      })
    }
  }
  class tye {
    constructor() {
      this.map = new Map, this.set = (e, r) => {
        const n = this.get(e);
        this.exists(e, r) || this.map.set(e, [...n, r])
      }, this.get = e => this.map.get(e) || [], this.exists = (e, r) => this.get(e).includes(r), this.delete = (e, r) => {
        if (typeof r > "u") {
          this.map.delete(e);
          return
        }
        if (!this.map.has(e)) return;
        const n = this.get(e);
        if (!this.exists(e, r)) return;
        const i = n.filter(s => s !== r);
        if (!i.length) {
          this.map.delete(e);
          return
        }
        this.map.set(e, i)
      }, this.clear = () => {
        this.map.clear()
      }
    }
    get topics() {
      return Array.from(this.map.keys())
    }
  }
  var rye = Object.defineProperty,
    nye = Object.defineProperties,
    iye = Object.getOwnPropertyDescriptors,
    LB = Object.getOwnPropertySymbols,
    sye = Object.prototype.hasOwnProperty,
    oye = Object.prototype.propertyIsEnumerable,
    BB = (t, e, r) => e in t ? rye(t, e, {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: r
    }) : t[e] = r,
    Av = (t, e) => {
      for (var r in e || (e = {})) sye.call(e, r) && BB(t, r, e[r]);
      if (LB)
        for (var r of LB(e)) oye.call(e, r) && BB(t, r, e[r]);
      return t
    },
    AE = (t, e) => nye(t, iye(e));
  class aye extends Ehe {
    constructor(e, r) {
      super(e, r), this.relayer = e, this.logger = r, this.subscriptions = new Map, this.topicMap = new tye, this.events = new Fi.EventEmitter, this.name = ube, this.version = dbe, this.pending = new Map, this.cached = [], this.initialized = !1, this.pendingSubscriptionWatchLabel = "pending_sub_watch_label", this.pollingInterval = 20, this.storagePrefix = Ll, this.subscribeTimeout = at.toMiliseconds(at.ONE_MINUTE), this.restartInProgress = !1, this.batchSubscribeTopicsLimit = 500, this.pendingBatchMessages = [], this.init = async () => {
        this.initialized || (this.logger.trace("Initialized"), this.registerEventListeners(), this.clientId = await this.relayer.core.crypto.getClientId(), await this.restore()), this.initialized = !0
      }, this.subscribe = async (n, i) => {
        this.isInitialized(), this.logger.debug("Subscribing Topic"), this.logger.trace({
          type: "method",
          method: "subscribe",
          params: {
            topic: n,
            opts: i
          }
        });
        try {
          const s = fE(i),
            o = {
              topic: n,
              relay: s,
              transportType: i?.transportType
            };
          this.pending.set(n, o);
          const a = await this.rpcSubscribe(n, s, i?.transportType);
          return typeof a == "string" && (this.onSubscribe(a, o), this.logger.debug("Successfully Subscribed Topic"), this.logger.trace({
            type: "method",
            method: "subscribe",
            params: {
              topic: n,
              opts: i
            }
          })), a
        } catch (s) {
          throw this.logger.debug("Failed to Subscribe Topic"), this.logger.error(s), s
        }
      }, this.unsubscribe = async (n, i) => {
        await this.restartToComplete(), this.isInitialized(), typeof i?.id < "u" ? await this.unsubscribeById(n, i.id, i) : await this.unsubscribeByTopic(n, i)
      }, this.isSubscribed = async n => {
        if (this.topics.includes(n)) return !0;
        const i = `${this.pendingSubscriptionWatchLabel}_${n}`;
        return await new Promise((s, o) => {
          const a = new at.Watch;
          a.start(i);
          const c = setInterval(() => {
            !this.pending.has(n) && this.topics.includes(n) && (clearInterval(c), a.stop(i), s(!0)), a.elapsed(i) >= hbe && (clearInterval(c), a.stop(i), o(new Error("Subscription resolution timeout")))
          }, this.pollingInterval)
        }).catch(() => !1)
      }, this.on = (n, i) => {
        this.events.on(n, i)
      }, this.once = (n, i) => {
        this.events.once(n, i)
      }, this.off = (n, i) => {
        this.events.off(n, i)
      }, this.removeListener = (n, i) => {
        this.events.removeListener(n, i)
      }, this.start = async () => {
        await this.onConnect()
      }, this.stop = async () => {
        await this.onDisconnect()
      }, this.restart = async () => {
        this.restartInProgress = !0, await this.restore(), await this.reset(), this.restartInProgress = !1
      }, this.relayer = e, this.logger = bs(r, this.name), this.clientId = ""
    }
    get context() {
      return so(this.logger)
    }
    get storageKey() {
      return this.storagePrefix + this.version + this.relayer.core.customStoragePrefix + "//" + this.name
    }
    get length() {
      return this.subscriptions.size
    }
    get ids() {
      return Array.from(this.subscriptions.keys())
    }
    get values() {
      return Array.from(this.subscriptions.values())
    }
    get topics() {
      return this.topicMap.topics
    }
    hasSubscription(e, r) {
      let n = !1;
      try {
        n = this.getSubscription(e).topic === r
      } catch {}
      return n
    }
    onEnable() {
      this.cached = [], this.initialized = !0
    }
    onDisable() {
      this.cached = this.values, this.subscriptions.clear(), this.topicMap.clear()
    }
    async unsubscribeByTopic(e, r) {
      const n = this.topicMap.get(e);
      await Promise.all(n.map(async i => await this.unsubscribeById(e, i, r)))
    }
    async unsubscribeById(e, r, n) {
      this.logger.debug("Unsubscribing Topic"), this.logger.trace({
        type: "method",
        method: "unsubscribe",
        params: {
          topic: e,
          id: r,
          opts: n
        }
      });
      try {
        const i = fE(n);
        await this.rpcUnsubscribe(e, r, i);
        const s = nn("USER_DISCONNECTED", `${this.name}, ${e}`);
        await this.onUnsubscribe(e, r, s), this.logger.debug("Successfully Unsubscribed Topic"), this.logger.trace({
          type: "method",
          method: "unsubscribe",
          params: {
            topic: e,
            id: r,
            opts: n
          }
        })
      } catch (i) {
        throw this.logger.debug("Failed to Unsubscribe Topic"), this.logger.error(i), i
      }
    }
    async rpcSubscribe(e, r, n = un.relay) {
      n === un.relay && await this.restartToComplete();
      const i = {
        method: mv(r.protocol).subscribe,
        params: {
          topic: e
        }
      };
      this.logger.debug("Outgoing Relay Payload"), this.logger.trace({
        type: "payload",
        direction: "outgoing",
        request: i
      });
      try {
        const s = Ju(e + this.clientId);
        return n === un.link_mode ? (setTimeout(() => {
          (this.relayer.connected || this.relayer.connecting) && this.relayer.request(i).catch(o => this.logger.warn(o))
        }, at.toMiliseconds(at.ONE_SECOND)), s) : await await gg(this.relayer.request(i).catch(o => this.logger.warn(o)), this.subscribeTimeout) ? s : null
      } catch {
        this.logger.debug("Outgoing Relay Subscribe Payload stalled"), this.relayer.events.emit(Bs.connection_stalled)
      }
      return null
    }
    async rpcBatchSubscribe(e) {
      if (!e.length) return;
      const r = e[0].relay,
        n = {
          method: mv(r.protocol).batchSubscribe,
          params: {
            topics: e.map(i => i.topic)
          }
        };
      this.logger.debug("Outgoing Relay Payload"), this.logger.trace({
        type: "payload",
        direction: "outgoing",
        request: n
      });
      try {
        return await await gg(this.relayer.request(n).catch(i => this.logger.warn(i)), this.subscribeTimeout)
      } catch {
        this.relayer.events.emit(Bs.connection_stalled)
      }
    }
    async rpcBatchFetchMessages(e) {
      if (!e.length) return;
      const r = e[0].relay,
        n = {
          method: mv(r.protocol).batchFetchMessages,
          params: {
            topics: e.map(s => s.topic)
          }
        };
      this.logger.debug("Outgoing Relay Payload"), this.logger.trace({
        type: "payload",
        direction: "outgoing",
        request: n
      });
      let i;
      try {
        i = await await gg(this.relayer.request(n).catch(s => this.logger.warn(s)), this.subscribeTimeout)
      } catch {
        this.relayer.events.emit(Bs.connection_stalled)
      }
      return i
    }
    rpcUnsubscribe(e, r, n) {
      const i = {
        method: mv(n.protocol).unsubscribe,
        params: {
          topic: e,
          id: r
        }
      };
      return this.logger.debug("Outgoing Relay Payload"), this.logger.trace({
        type: "payload",
        direction: "outgoing",
        request: i
      }), this.relayer.request(i)
    }
    onSubscribe(e, r) {
      this.setSubscription(e, AE(Av({}, r), {
        id: e
      })), this.pending.delete(r.topic)
    }
    onBatchSubscribe(e) {
      e.length && e.forEach(r => {
        this.setSubscription(r.id, Av({}, r)), this.pending.delete(r.topic)
      })
    }
    async onUnsubscribe(e, r, n) {
      this.events.removeAllListeners(r), this.hasSubscription(r, e) && this.deleteSubscription(r, n), await this.relayer.messages.del(e)
    }
    async setRelayerSubscriptions(e) {
      await this.relayer.core.storage.setItem(this.storageKey, e)
    }
    async getRelayerSubscriptions() {
      return await this.relayer.core.storage.getItem(this.storageKey)
    }
    setSubscription(e, r) {
      this.logger.debug("Setting subscription"), this.logger.trace({
        type: "method",
        method: "setSubscription",
        id: e,
        subscription: r
      }), this.addSubscription(e, r)
    }
    addSubscription(e, r) {
      this.subscriptions.set(e, Av({}, r)), this.topicMap.set(r.topic, e), this.events.emit(Bl.created, r)
    }
    getSubscription(e) {
      this.logger.debug("Getting subscription"), this.logger.trace({
        type: "method",
        method: "getSubscription",
        id: e
      });
      const r = this.subscriptions.get(e);
      if (!r) {
        const {
          message: n
        } = it("NO_MATCHING_KEY", `${this.name}: ${e}`);
        throw new Error(n)
      }
      return r
    }
    deleteSubscription(e, r) {
      this.logger.debug("Deleting subscription"), this.logger.trace({
        type: "method",
        method: "deleteSubscription",
        id: e,
        reason: r
      });
      const n = this.getSubscription(e);
      this.subscriptions.delete(e), this.topicMap.delete(n.topic, e), this.events.emit(Bl.deleted, AE(Av({}, n), {
        reason: r
      }))
    }
    async persist() {
      await this.setRelayerSubscriptions(this.values), this.events.emit(Bl.sync)
    }
    async reset() {
      if (this.cached.length) {
        const e = Math.ceil(this.cached.length / this.batchSubscribeTopicsLimit);
        for (let r = 0; r < e; r++) {
          const n = this.cached.splice(0, this.batchSubscribeTopicsLimit);
          await this.batchFetchMessages(n), await this.batchSubscribe(n)
        }
      }
      this.events.emit(Bl.resubscribed)
    }
    async restore() {
      try {
        const e = await this.getRelayerSubscriptions();
        if (typeof e > "u" || !e.length) return;
        if (this.subscriptions.size) {
          const {
            message: r
          } = it("RESTORE_WILL_OVERRIDE", this.name);
          throw this.logger.error(r), this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`), new Error(r)
        }
        this.cached = e, this.logger.debug(`Successfully Restored subscriptions for ${this.name}`), this.logger.trace({
          type: "method",
          method: "restore",
          subscriptions: this.values
        })
      } catch (e) {
        this.logger.debug(`Failed to Restore subscriptions for ${this.name}`), this.logger.error(e)
      }
    }
    async batchSubscribe(e) {
      if (!e.length) return;
      const r = await this.rpcBatchSubscribe(e);
      Ol(r) && this.onBatchSubscribe(r.map((n, i) => AE(Av({}, e[i]), {
        id: n
      })))
    }
    async batchFetchMessages(e) {
      if (!e.length) return;
      this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);
      const r = await this.rpcBatchFetchMessages(e);
      r && r.messages && (this.pendingBatchMessages = this.pendingBatchMessages.concat(r.messages))
    }
    async onConnect() {
      await this.restart(), this.onEnable()
    }
    onDisconnect() {
      this.onDisable()
    }
    async checkPending() {
      if (!this.initialized || !this.relayer.connected) return;
      const e = [];
      this.pending.forEach(r => {
        e.push(r)
      }), await this.batchSubscribe(e), this.pendingBatchMessages.length && (await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages), this.pendingBatchMessages = [])
    }
    registerEventListeners() {
      this.relayer.core.heartbeat.on(X1.pulse, async () => {
        await this.checkPending()
      }), this.events.on(Bl.created, async e => {
        const r = Bl.created;
        this.logger.info(`Emitting ${r}`), this.logger.debug({
          type: "event",
          event: r,
          data: e
        }), await this.persist()
      }), this.events.on(Bl.deleted, async e => {
        const r = Bl.deleted;
        this.logger.info(`Emitting ${r}`), this.logger.debug({
          type: "event",
          event: r,
          data: e
        }), await this.persist()
      })
    }
    isInitialized() {
      if (!this.initialized) {
        const {
          message: e
        } = it("NOT_INITIALIZED", this.name);
        throw new Error(e)
      }
    }
    async restartToComplete() {
      !this.relayer.connected && !this.relayer.connecting && await this.relayer.transportOpen(), this.restartInProgress && await new Promise(e => {
        const r = setInterval(() => {
          this.restartInProgress || (clearInterval(r), e())
        }, this.pollingInterval)
      })
    }
  }
  var cye = Object.defineProperty,
    UB = Object.getOwnPropertySymbols,
    lye = Object.prototype.hasOwnProperty,
    uye = Object.prototype.propertyIsEnumerable,
    jB = (t, e, r) => e in t ? cye(t, e, {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: r
    }) : t[e] = r,
    dye = (t, e) => {
      for (var r in e || (e = {})) lye.call(e, r) && jB(t, r, e[r]);
      if (UB)
        for (var r of UB(e)) uye.call(e, r) && jB(t, r, e[r]);
      return t
    };
  class hye extends xhe {
    constructor(e) {
      super(e), this.protocol = "wc", this.version = 2, this.events = new Fi.EventEmitter, this.name = sbe, this.transportExplicitlyClosed = !1, this.initialized = !1, this.connectionAttemptInProgress = !1, this.connectionStatusPollingInterval = 20, this.staleConnectionErrors = ["socket hang up", "stalled", "interrupted"], this.hasExperiencedNetworkDisruption = !1, this.requestsInFlight = new Map, this.heartBeatTimeout = at.toMiliseconds(at.THIRTY_SECONDS + at.ONE_SECOND), this.request = async r => {
        var n, i;
        this.logger.debug("Publishing Request Payload");
        const s = r.id || A0().toString();
        await this.toEstablishConnection();
        try {
          const o = this.provider.request(r);
          this.requestsInFlight.set(s, {
            promise: o,
            request: r
          }), this.logger.trace({
            id: s,
            method: r.method,
            topic: (n = r.params) == null ? void 0 : n.topic
          }, "relayer.request - attempt to publish...");
          const a = await new Promise(async (c, l) => {
            const h = () => {
              l(new Error(`relayer.request - publish interrupted, id: ${s}`))
            };
            this.provider.on(Sa.disconnect, h);
            const f = await o;
            this.provider.off(Sa.disconnect, h), c(f)
          });
          return this.logger.trace({
            id: s,
            method: r.method,
            topic: (i = r.params) == null ? void 0 : i.topic
          }, "relayer.request - published"), a
        } catch (o) {
          throw this.logger.debug(`Failed to Publish Request: ${s}`), o
        } finally {
          this.requestsInFlight.delete(s)
        }
      }, this.resetPingTimeout = () => {
        if (J5()) try {
          clearTimeout(this.pingTimeout), this.pingTimeout = setTimeout(() => {
            var r, n, i;
            (i = (n = (r = this.provider) == null ? void 0 : r.connection) == null ? void 0 : n.socket) == null || i.terminate()
          }, this.heartBeatTimeout)
        } catch (r) {
          this.logger.warn(r)
        }
      }, this.onPayloadHandler = r => {
        this.onProviderPayload(r), this.resetPingTimeout()
      }, this.onConnectHandler = () => {
        this.logger.trace("relayer connected"), this.startPingTimeout(), this.events.emit(Bs.connect)
      }, this.onDisconnectHandler = () => {
        this.logger.trace("relayer disconnected"), this.onProviderDisconnect()
      }, this.onProviderErrorHandler = r => {
        this.logger.error(r), this.events.emit(Bs.error, r), this.logger.info("Fatal socket error received, closing transport"), this.transportClose()
      }, this.registerProviderListeners = () => {
        this.provider.on(Sa.payload, this.onPayloadHandler), this.provider.on(Sa.connect, this.onConnectHandler), this.provider.on(Sa.disconnect, this.onDisconnectHandler), this.provider.on(Sa.error, this.onProviderErrorHandler)
      }, this.core = e.core, this.logger = typeof e.logger < "u" && typeof e.logger != "string" ? bs(e.logger, this.name) : Zw(y1({
        level: e.logger || ibe
      })), this.messages = new X3e(this.logger, e.core), this.subscriber = new aye(this, this.logger), this.publisher = new eye(this, this.logger), this.relayUrl = e?.relayUrl || vB, this.projectId = e.projectId, this.bundleId = gge(), this.provider = {}
    }
    async init() {
      if (this.logger.trace("Initialized"), this.registerEventListeners(), await Promise.all([this.messages.init(), this.subscriber.init()]), this.initialized = !0, this.subscriber.cached.length > 0) try {
        await this.transportOpen()
      } catch (e) {
        this.logger.warn(e)
      }
    }
    get context() {
      return so(this.logger)
    }
    get connected() {
      var e, r, n;
      return ((n = (r = (e = this.provider) == null ? void 0 : e.connection) == null ? void 0 : r.socket) == null ? void 0 : n.readyState) === 1
    }
    get connecting() {
      var e, r, n;
      return ((n = (r = (e = this.provider) == null ? void 0 : e.connection) == null ? void 0 : r.socket) == null ? void 0 : n.readyState) === 0
    }
    async publish(e, r, n) {
      this.isInitialized(), await this.publisher.publish(e, r, n), await this.recordMessageEvent({
        topic: e,
        message: r,
        publishedAt: Date.now(),
        transportType: un.relay
      })
    }
    async subscribe(e, r) {
      var n;
      this.isInitialized(), r?.transportType === "relay" && await this.toEstablishConnection();
      let i = ((n = this.subscriber.topicMap.get(e)) == null ? void 0 : n[0]) || "",
        s;
      const o = a => {
        a.topic === e && (this.subscriber.off(Bl.created, o), s())
      };
      return await Promise.all([new Promise(a => {
        s = a, this.subscriber.on(Bl.created, o)
      }), new Promise(async a => {
        i = await this.subscriber.subscribe(e, r) || i, a()
      })]), i
    }
    async unsubscribe(e, r) {
      this.isInitialized(), await this.subscriber.unsubscribe(e, r)
    }
    on(e, r) {
      this.events.on(e, r)
    }
    once(e, r) {
      this.events.once(e, r)
    }
    off(e, r) {
      this.events.off(e, r)
    }
    removeListener(e, r) {
      this.events.removeListener(e, r)
    }
    async transportDisconnect() {
      if (!this.hasExperiencedNetworkDisruption && this.connected && this.requestsInFlight.size > 0) try {
        await Promise.all(Array.from(this.requestsInFlight.values()).map(e => e.promise))
      } catch (e) {
        this.logger.warn(e)
      }
      this.hasExperiencedNetworkDisruption || this.connected ? await gg(this.provider.disconnect(), 2e3, "provider.disconnect()").catch(() => this.onProviderDisconnect()) : this.onProviderDisconnect()
    }
    async transportClose() {
      this.transportExplicitlyClosed = !0, await this.transportDisconnect()
    }
    async transportOpen(e) {
      await this.confirmOnlineStateOrThrow(), e && e !== this.relayUrl && (this.relayUrl = e, await this.transportDisconnect()), await this.createProvider(), this.connectionAttemptInProgress = !0, this.transportExplicitlyClosed = !1;
      try {
        await new Promise(async (r, n) => {
          const i = () => {
            this.provider.off(Sa.disconnect, i), n(new Error("Connection interrupted while trying to subscribe"))
          };
          this.provider.on(Sa.disconnect, i), await gg(this.provider.connect(), at.toMiliseconds(at.ONE_MINUTE), `Socket stalled when trying to connect to ${this.relayUrl}`).catch(s => {
            n(s)
          }).finally(() => {
            clearTimeout(this.reconnectTimeout), this.reconnectTimeout = void 0
          }), this.subscriber.start().catch(s => {
            this.logger.error(s), this.onDisconnectHandler()
          }), this.hasExperiencedNetworkDisruption = !1, r()
        })
      } catch (r) {
        this.logger.error(r);
        const n = r;
        if (this.hasExperiencedNetworkDisruption = !0, !this.isConnectionStalled(n.message)) throw r
      } finally {
        this.connectionAttemptInProgress = !1
      }
    }
    async restartTransport(e) {
      this.connectionAttemptInProgress || (this.relayUrl = e || this.relayUrl, await this.confirmOnlineStateOrThrow(), await this.transportClose(), await this.transportOpen())
    }
    async confirmOnlineStateOrThrow() {
      if (!await eB()) throw new Error("No internet connection detected. Please restart your network and try again.")
    }
    async handleBatchMessageEvents(e) {
      if (e?.length === 0) {
        this.logger.trace("Batch message events is empty. Ignoring...");
        return
      }
      const r = e.sort((n, i) => n.publishedAt - i.publishedAt);
      this.logger.trace(`Batch of ${r.length} message events sorted`);
      for (const n of r) try {
        await this.onMessageEvent(n)
      } catch (i) {
        this.logger.warn(i)
      }
      this.logger.trace(`Batch of ${r.length} message events processed`)
    }
    async onLinkMessageEvent(e, r) {
      const {
        topic: n
      } = e;
      if (!r.sessionExists) {
        const i = _i(at.FIVE_MINUTES),
          s = {
            topic: n,
            expiry: i,
            relay: {
              protocol: "irn"
            },
            active: !1
          };
        await this.core.pairing.pairings.set(n, s)
      }
      this.events.emit(Bs.message, e), await this.recordMessageEvent(e)
    }
    startPingTimeout() {
      var e, r, n, i, s;
      if (J5()) try {
        (r = (e = this.provider) == null ? void 0 : e.connection) != null && r.socket && ((s = (i = (n = this.provider) == null ? void 0 : n.connection) == null ? void 0 : i.socket) == null || s.once("ping", () => {
          this.resetPingTimeout()
        })), this.resetPingTimeout()
      } catch (o) {
        this.logger.warn(o)
      }
    }
    isConnectionStalled(e) {
      return this.staleConnectionErrors.some(r => e.includes(r))
    }
    async createProvider() {
      this.provider.connection && this.unregisterProviderListeners();
      const e = await this.core.crypto.signJWT(this.relayUrl);
      this.provider = new xc(new qve(bge({
        sdkVersion: _E,
        protocol: this.protocol,
        version: this.version,
        relayUrl: this.relayUrl,
        projectId: this.projectId,
        auth: e,
        useOnCloseEvent: !0,
        bundleId: this.bundleId
      }))), this.registerProviderListeners()
    }
    async recordMessageEvent(e) {
      const {
        topic: r,
        message: n
      } = e;
      await this.messages.set(r, n)
    }
    async shouldIgnoreMessageEvent(e) {
      const {
        topic: r,
        message: n
      } = e;
      if (!n || n.length === 0) return this.logger.debug(`Ignoring invalid/empty message: ${n}`), !0;
      if (!await this.subscriber.isSubscribed(r)) return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`), !0;
      const i = this.messages.has(r, n);
      return i && this.logger.debug(`Ignoring duplicate message: ${n}`), i
    }
    async onProviderPayload(e) {
      if (this.logger.debug("Incoming Relay Payload"), this.logger.trace({
          type: "payload",
          direction: "incoming",
          payload: e
        }), bE(e)) {
        if (!e.method.endsWith(obe)) return;
        const r = e.params,
          {
            topic: n,
            message: i,
            publishedAt: s,
            attestation: o
          } = r.data,
          a = {
            topic: n,
            message: i,
            publishedAt: s,
            transportType: un.relay,
            attestation: o
          };
        this.logger.debug("Emitting Relayer Payload"), this.logger.trace(dye({
          type: "event",
          event: r.id
        }, a)), this.events.emit(r.id, a), await this.acknowledgePayload(e), await this.onMessageEvent(a)
      } else b4(e) && this.events.emit(Bs.message_ack, e)
    }
    async onMessageEvent(e) {
      await this.shouldIgnoreMessageEvent(e) || (this.events.emit(Bs.message, e), await this.recordMessageEvent(e))
    }
    async acknowledgePayload(e) {
      const r = w4(e.id, !0);
      await this.provider.connection.send(r)
    }
    unregisterProviderListeners() {
      this.provider.off(Sa.payload, this.onPayloadHandler), this.provider.off(Sa.connect, this.onConnectHandler), this.provider.off(Sa.disconnect, this.onDisconnectHandler), this.provider.off(Sa.error, this.onProviderErrorHandler), clearTimeout(this.pingTimeout)
    }
    async registerEventListeners() {
      let e = await eB();
      xve(async r => {
        e !== r && (e = r, r ? await this.restartTransport().catch(n => this.logger.error(n)) : (this.hasExperiencedNetworkDisruption = !0, await this.transportDisconnect(), this.transportExplicitlyClosed = !1))
      })
    }
    async onProviderDisconnect() {
      await this.subscriber.stop(), this.requestsInFlight.clear(), clearTimeout(this.pingTimeout), this.events.emit(Bs.disconnect), this.connectionAttemptInProgress = !1, !this.transportExplicitlyClosed && (this.reconnectTimeout || (this.reconnectTimeout = setTimeout(async () => {
        await this.transportOpen().catch(e => this.logger.error(e))
      }, at.toMiliseconds(abe))))
    }
    isInitialized() {
      if (!this.initialized) {
        const {
          message: e
        } = it("NOT_INITIALIZED", this.name);
        throw new Error(e)
      }
    }
    async toEstablishConnection() {
      await this.confirmOnlineStateOrThrow(), !this.connected && (this.connectionAttemptInProgress && await new Promise(e => {
        const r = setInterval(() => {
          this.connected && (clearInterval(r), e())
        }, this.connectionStatusPollingInterval)
      }), await this.transportOpen())
    }
  }
  var fye = Object.defineProperty,
    FB = Object.getOwnPropertySymbols,
    pye = Object.prototype.hasOwnProperty,
    gye = Object.prototype.propertyIsEnumerable,
    WB = (t, e, r) => e in t ? fye(t, e, {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: r
    }) : t[e] = r,
    zB = (t, e) => {
      for (var r in e || (e = {})) pye.call(e, r) && WB(t, r, e[r]);
      if (FB)
        for (var r of FB(e)) gye.call(e, r) && WB(t, r, e[r]);
      return t
    };
  class k0 extends Che {
    constructor(e, r, n, i = Ll, s = void 0) {
      super(e, r, n, i), this.core = e, this.logger = r, this.name = n, this.map = new Map, this.version = cbe, this.cached = [], this.initialized = !1, this.storagePrefix = Ll, this.recentlyDeleted = [], this.recentlyDeletedLimit = 200, this.init = async () => {
        this.initialized || (this.logger.trace("Initialized"), await this.restore(), this.cached.forEach(o => {
          this.getKey && o !== null && !wo(o) ? this.map.set(this.getKey(o), o) : X2e(o) ? this.map.set(o.id, o) : eve(o) && this.map.set(o.topic, o)
        }), this.cached = [], this.initialized = !0)
      }, this.set = async (o, a) => {
        this.isInitialized(), this.map.has(o) ? await this.update(o, a) : (this.logger.debug("Setting value"), this.logger.trace({
          type: "method",
          method: "set",
          key: o,
          value: a
        }), this.map.set(o, a), await this.persist())
      }, this.get = o => (this.isInitialized(), this.logger.debug("Getting value"), this.logger.trace({
        type: "method",
        method: "get",
        key: o
      }), this.getData(o)), this.getAll = o => (this.isInitialized(), o ? this.values.filter(a => Object.keys(o).every(c => Kve(a[c], o[c]))) : this.values), this.update = async (o, a) => {
        this.isInitialized(), this.logger.debug("Updating value"), this.logger.trace({
          type: "method",
          method: "update",
          key: o,
          update: a
        });
        const c = zB(zB({}, this.getData(o)), a);
        this.map.set(o, c), await this.persist()
      }, this.delete = async (o, a) => {
        this.isInitialized(), this.map.has(o) && (this.logger.debug("Deleting value"), this.logger.trace({
          type: "method",
          method: "delete",
          key: o,
          reason: a
        }), this.map.delete(o), this.addToRecentlyDeleted(o), await this.persist())
      }, this.logger = bs(r, this.name), this.storagePrefix = i, this.getKey = s
    }
    get context() {
      return so(this.logger)
    }
    get storageKey() {
      return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name
    }
    get length() {
      return this.map.size
    }
    get keys() {
      return Array.from(this.map.keys())
    }
    get values() {
      return Array.from(this.map.values())
    }
    addToRecentlyDeleted(e) {
      this.recentlyDeleted.push(e), this.recentlyDeleted.length >= this.recentlyDeletedLimit && this.recentlyDeleted.splice(0, this.recentlyDeletedLimit / 2)
    }
    async setDataStore(e) {
      await this.core.storage.setItem(this.storageKey, e)
    }
    async getDataStore() {
      return await this.core.storage.getItem(this.storageKey)
    }
    getData(e) {
      const r = this.map.get(e);
      if (!r) {
        if (this.recentlyDeleted.includes(e)) {
          const {
            message: i
          } = it("MISSING_OR_INVALID", `Record was recently deleted - ${this.name}: ${e}`);
          throw this.logger.error(i), new Error(i)
        }
        const {
          message: n
        } = it("NO_MATCHING_KEY", `${this.name}: ${e}`);
        throw this.logger.error(n), new Error(n)
      }
      return r
    }
    async persist() {
      await this.setDataStore(this.values)
    }
    async restore() {
      try {
        const e = await this.getDataStore();
        if (typeof e > "u" || !e.length) return;
        if (this.map.size) {
          const {
            message: r
          } = it("RESTORE_WILL_OVERRIDE", this.name);
          throw this.logger.error(r), new Error(r)
        }
        this.cached = e, this.logger.debug(`Successfully Restored value for ${this.name}`), this.logger.trace({
          type: "method",
          method: "restore",
          value: this.values
        })
      } catch (e) {
        this.logger.debug(`Failed to Restore value for ${this.name}`), this.logger.error(e)
      }
    }
    isInitialized() {
      if (!this.initialized) {
        const {
          message: e
        } = it("NOT_INITIALIZED", this.name);
        throw new Error(e)
      }
    }
  }
  class mye {
    constructor(e, r) {
      this.core = e, this.logger = r, this.name = fbe, this.version = pbe, this.events = new zx, this.initialized = !1, this.storagePrefix = Ll, this.ignoredPayloadTypes = [Qu], this.registeredMethods = [], this.init = async () => {
        this.initialized || (await this.pairings.init(), await this.cleanup(), this.registerRelayerEvents(), this.registerExpirerEvents(), this.initialized = !0, this.logger.trace("Initialized"))
      }, this.register = ({
        methods: n
      }) => {
        this.isInitialized(), this.registeredMethods = [...new Set([...this.registeredMethods, ...n])]
      }, this.create = async n => {
        this.isInitialized();
        const i = hE(),
          s = await this.core.crypto.setSymKey(i),
          o = _i(at.FIVE_MINUTES),
          a = {
            protocol: wB
          },
          c = {
            topic: s,
            expiry: o,
            relay: a,
            active: !1,
            methods: n?.methods
          },
          l = VL({
            protocol: this.core.protocol,
            version: this.core.version,
            topic: s,
            symKey: i,
            relay: a,
            expiryTimestamp: o,
            methods: n?.methods
          });
        return this.events.emit(S0.create, c), this.core.expirer.set(s, o), await this.pairings.set(s, c), await this.core.relayer.subscribe(s, {
          transportType: n?.transportType
        }), {
          topic: s,
          uri: l
        }
      }, this.pair = async n => {
        this.isInitialized();
        const i = this.core.eventClient.createEvent({
          properties: {
            topic: n?.uri,
            trace: [Ul.pairing_started]
          }
        });
        this.isValidPair(n, i);
        const {
          topic: s,
          symKey: o,
          relay: a,
          expiryTimestamp: c,
          methods: l
        } = qL(n.uri);
        i.props.properties.topic = s, i.addTrace(Ul.pairing_uri_validation_success), i.addTrace(Ul.pairing_uri_not_expired);
        let h;
        if (this.pairings.keys.includes(s)) {
          if (h = this.pairings.get(s), i.addTrace(Ul.existing_pairing), h.active) throw i.setError(td.active_pairing_already_exists), new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);
          i.addTrace(Ul.pairing_not_expired)
        }
        const f = c || _i(at.FIVE_MINUTES),
          w = {
            topic: s,
            relay: a,
            expiry: f,
            active: !1,
            methods: l
          };
        this.core.expirer.set(s, f), await this.pairings.set(s, w), i.addTrace(Ul.store_new_pairing), n.activatePairing && await this.activate({
          topic: s
        }), this.events.emit(S0.create, w), i.addTrace(Ul.emit_inactive_pairing), this.core.crypto.keychain.has(s) || await this.core.crypto.setSymKey(o, s), i.addTrace(Ul.subscribing_pairing_topic);
        try {
          await this.core.relayer.confirmOnlineStateOrThrow()
        } catch {
          i.setError(td.no_internet_connection)
        }
        try {
          await this.core.relayer.subscribe(s, {
            relay: a
          })
        } catch (b) {
          throw i.setError(td.subscribe_pairing_topic_failure), b
        }
        return i.addTrace(Ul.subscribe_pairing_topic_success), w
      }, this.activate = async ({
        topic: n
      }) => {
        this.isInitialized();
        const i = _i(at.THIRTY_DAYS);
        this.core.expirer.set(n, i), await this.pairings.update(n, {
          active: !0,
          expiry: i
        })
      }, this.ping = async n => {
        this.isInitialized(), await this.isValidPing(n);
        const {
          topic: i
        } = n;
        if (this.pairings.keys.includes(i)) {
          const s = await this.sendRequest(i, "wc_pairingPing", {}),
            {
              done: o,
              resolve: a,
              reject: c
            } = y0();
          this.events.once(Tr("pairing_ping", s), ({
            error: l
          }) => {
            l ? c(l) : a()
          }), await o()
        }
      }, this.updateExpiry = async ({
        topic: n,
        expiry: i
      }) => {
        this.isInitialized(), await this.pairings.update(n, {
          expiry: i
        })
      }, this.updateMetadata = async ({
        topic: n,
        metadata: i
      }) => {
        this.isInitialized(), await this.pairings.update(n, {
          peerMetadata: i
        })
      }, this.getPairings = () => (this.isInitialized(), this.pairings.values), this.disconnect = async n => {
        this.isInitialized(), await this.isValidDisconnect(n);
        const {
          topic: i
        } = n;
        this.pairings.keys.includes(i) && (await this.sendRequest(i, "wc_pairingDelete", nn("USER_DISCONNECTED")), await this.deletePairing(i))
      }, this.formatUriFromPairing = n => {
        this.isInitialized();
        const {
          topic: i,
          relay: s,
          expiry: o,
          methods: a
        } = n, c = this.core.crypto.keychain.get(i);
        return VL({
          protocol: this.core.protocol,
          version: this.core.version,
          topic: i,
          symKey: c,
          relay: s,
          expiryTimestamp: o,
          methods: a
        })
      }, this.sendRequest = async (n, i, s) => {
        const o = Nh(i, s),
          a = await this.core.crypto.encode(n, o),
          c = _v[i].req;
        return this.core.history.set(n, o), this.core.relayer.publish(n, a, c), o.id
      }, this.sendResult = async (n, i, s) => {
        const o = w4(n, s),
          a = await this.core.crypto.encode(i, o),
          c = await this.core.history.get(i, n),
          l = _v[c.request.method].res;
        await this.core.relayer.publish(i, a, l), await this.core.history.resolve(o)
      }, this.sendError = async (n, i, s) => {
        const o = v4(n, s),
          a = await this.core.crypto.encode(i, o),
          c = await this.core.history.get(i, n),
          l = _v[c.request.method] ? _v[c.request.method].res : _v.unregistered_method.res;
        await this.core.relayer.publish(i, a, l), await this.core.history.resolve(o)
      }, this.deletePairing = async (n, i) => {
        await this.core.relayer.unsubscribe(n), await Promise.all([this.pairings.delete(n, nn("USER_DISCONNECTED")), this.core.crypto.deleteSymKey(n), i ? Promise.resolve() : this.core.expirer.del(n)])
      }, this.cleanup = async () => {
        const n = this.pairings.getAll().filter(i => Eh(i.expiry));
        await Promise.all(n.map(i => this.deletePairing(i.topic)))
      }, this.onRelayEventRequest = n => {
        const {
          topic: i,
          payload: s
        } = n;
        switch (s.method) {
          case "wc_pairingPing":
            return this.onPairingPingRequest(i, s);
          case "wc_pairingDelete":
            return this.onPairingDeleteRequest(i, s);
          default:
            return this.onUnknownRpcMethodRequest(i, s)
        }
      }, this.onRelayEventResponse = async n => {
        const {
          topic: i,
          payload: s
        } = n, o = (await this.core.history.get(i, s.id)).request.method;
        switch (o) {
          case "wc_pairingPing":
            return this.onPairingPingResponse(i, s);
          default:
            return this.onUnknownRpcMethodResponse(o)
        }
      }, this.onPairingPingRequest = async (n, i) => {
        const {
          id: s
        } = i;
        try {
          this.isValidPing({
            topic: n
          }), await this.sendResult(s, n, !0), this.events.emit(S0.ping, {
            id: s,
            topic: n
          })
        } catch (o) {
          await this.sendError(s, n, o), this.logger.error(o)
        }
      }, this.onPairingPingResponse = (n, i) => {
        const {
          id: s
        } = i;
        setTimeout(() => {
          Dl(i) ? this.events.emit(Tr("pairing_ping", s), {}) : Aa(i) && this.events.emit(Tr("pairing_ping", s), {
            error: i.error
          })
        }, 500)
      }, this.onPairingDeleteRequest = async (n, i) => {
        const {
          id: s
        } = i;
        try {
          this.isValidDisconnect({
            topic: n
          }), await this.deletePairing(n), this.events.emit(S0.delete, {
            id: s,
            topic: n
          })
        } catch (o) {
          await this.sendError(s, n, o), this.logger.error(o)
        }
      }, this.onUnknownRpcMethodRequest = async (n, i) => {
        const {
          id: s,
          method: o
        } = i;
        try {
          if (this.registeredMethods.includes(o)) return;
          const a = nn("WC_METHOD_UNSUPPORTED", o);
          await this.sendError(s, n, a), this.logger.error(a)
        } catch (a) {
          await this.sendError(s, n, a), this.logger.error(a)
        }
      }, this.onUnknownRpcMethodResponse = n => {
        this.registeredMethods.includes(n) || this.logger.error(nn("WC_METHOD_UNSUPPORTED", n))
      }, this.isValidPair = (n, i) => {
        var s;
        if (!vo(n)) {
          const {
            message: a
          } = it("MISSING_OR_INVALID", `pair() params: ${n}`);
          throw i.setError(td.malformed_pairing_uri), new Error(a)
        }
        if (!J2e(n.uri)) {
          const {
            message: a
          } = it("MISSING_OR_INVALID", `pair() uri: ${n.uri}`);
          throw i.setError(td.malformed_pairing_uri), new Error(a)
        }
        const o = qL(n?.uri);
        if (!((s = o?.relay) != null && s.protocol)) {
          const {
            message: a
          } = it("MISSING_OR_INVALID", "pair() uri#relay-protocol");
          throw i.setError(td.malformed_pairing_uri), new Error(a)
        }
        if (!(o != null && o.symKey)) {
          const {
            message: a
          } = it("MISSING_OR_INVALID", "pair() uri#symKey");
          throw i.setError(td.malformed_pairing_uri), new Error(a)
        }
        if (o != null && o.expiryTimestamp && at.toMiliseconds(o?.expiryTimestamp) < Date.now()) {
          i.setError(td.pairing_expired);
          const {
            message: a
          } = it("EXPIRED", "pair() URI has expired. Please try again with a new connection URI.");
          throw new Error(a)
        }
      }, this.isValidPing = async n => {
        if (!vo(n)) {
          const {
            message: s
          } = it("MISSING_OR_INVALID", `ping() params: ${n}`);
          throw new Error(s)
        }
        const {
          topic: i
        } = n;
        await this.isValidPairingTopic(i)
      }, this.isValidDisconnect = async n => {
        if (!vo(n)) {
          const {
            message: s
          } = it("MISSING_OR_INVALID", `disconnect() params: ${n}`);
          throw new Error(s)
        }
        const {
          topic: i
        } = n;
        await this.isValidPairingTopic(i)
      }, this.isValidPairingTopic = async n => {
        if (!si(n, !1)) {
          const {
            message: i
          } = it("MISSING_OR_INVALID", `pairing topic should be a string: ${n}`);
          throw new Error(i)
        }
        if (!this.pairings.keys.includes(n)) {
          const {
            message: i
          } = it("NO_MATCHING_KEY", `pairing topic doesn't exist: ${n}`);
          throw new Error(i)
        }
        if (Eh(this.pairings.get(n).expiry)) {
          await this.deletePairing(n);
          const {
            message: i
          } = it("EXPIRED", `pairing topic: ${n}`);
          throw new Error(i)
        }
      }, this.core = e, this.logger = bs(r, this.name), this.pairings = new k0(this.core, this.logger, this.name, this.storagePrefix)
    }
    get context() {
      return so(this.logger)
    }
    isInitialized() {
      if (!this.initialized) {
        const {
          message: e
        } = it("NOT_INITIALIZED", this.name);
        throw new Error(e)
      }
    }
    registerRelayerEvents() {
      this.core.relayer.on(Bs.message, async e => {
        const {
          topic: r,
          message: n,
          transportType: i
        } = e;
        if (!this.pairings.keys.includes(r) || i === un.link_mode || this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(n))) return;
        const s = await this.core.crypto.decode(r, n);
        try {
          bE(s) ? (this.core.history.set(r, s), this.onRelayEventRequest({
            topic: r,
            payload: s
          })) : b4(s) && (await this.core.history.resolve(s), await this.onRelayEventResponse({
            topic: r,
            payload: s
          }), this.core.history.delete(r, s.id))
        } catch (o) {
          this.logger.error(o)
        }
      })
    }
    registerExpirerEvents() {
      this.core.expirer.on(Ia.expired, async e => {
        const {
          topic: r
        } = _D(e.target);
        r && this.pairings.keys.includes(r) && (await this.deletePairing(r, !0), this.events.emit(S0.expire, {
          topic: r
        }))
      })
    }
  }
  class wye extends bhe {
    constructor(e, r) {
      super(e, r), this.core = e, this.logger = r, this.records = new Map, this.events = new Fi.EventEmitter, this.name = gbe, this.version = mbe, this.cached = [], this.initialized = !1, this.storagePrefix = Ll, this.init = async () => {
        this.initialized || (this.logger.trace("Initialized"), await this.restore(), this.cached.forEach(n => this.records.set(n.id, n)), this.cached = [], this.registerEventListeners(), this.initialized = !0)
      }, this.set = (n, i, s) => {
        if (this.isInitialized(), this.logger.debug("Setting JSON-RPC request history record"), this.logger.trace({
            type: "method",
            method: "set",
            topic: n,
            request: i,
            chainId: s
          }), this.records.has(i.id)) return;
        const o = {
          id: i.id,
          topic: n,
          request: {
            method: i.method,
            params: i.params || null
          },
          chainId: s,
          expiry: _i(at.THIRTY_DAYS)
        };
        this.records.set(o.id, o), this.persist(), this.events.emit(Cc.created, o)
      }, this.resolve = async n => {
        if (this.isInitialized(), this.logger.debug("Updating JSON-RPC response history record"), this.logger.trace({
            type: "method",
            method: "update",
            response: n
          }), !this.records.has(n.id)) return;
        const i = await this.getRecord(n.id);
        typeof i.response > "u" && (i.response = Aa(n) ? {
          error: n.error
        } : {
          result: n.result
        }, this.records.set(i.id, i), this.persist(), this.events.emit(Cc.updated, i))
      }, this.get = async (n, i) => (this.isInitialized(), this.logger.debug("Getting record"), this.logger.trace({
        type: "method",
        method: "get",
        topic: n,
        id: i
      }), await this.getRecord(i)), this.delete = (n, i) => {
        this.isInitialized(), this.logger.debug("Deleting record"), this.logger.trace({
          type: "method",
          method: "delete",
          id: i
        }), this.values.forEach(s => {
          if (s.topic === n) {
            if (typeof i < "u" && s.id !== i) return;
            this.records.delete(s.id), this.events.emit(Cc.deleted, s)
          }
        }), this.persist()
      }, this.exists = async (n, i) => (this.isInitialized(), this.records.has(i) ? (await this.getRecord(i)).topic === n : !1), this.on = (n, i) => {
        this.events.on(n, i)
      }, this.once = (n, i) => {
        this.events.once(n, i)
      }, this.off = (n, i) => {
        this.events.off(n, i)
      }, this.removeListener = (n, i) => {
        this.events.removeListener(n, i)
      }, this.logger = bs(r, this.name)
    }
    get context() {
      return so(this.logger)
    }
    get storageKey() {
      return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name
    }
    get size() {
      return this.records.size
    }
    get keys() {
      return Array.from(this.records.keys())
    }
    get values() {
      return Array.from(this.records.values())
    }
    get pending() {
      const e = [];
      return this.values.forEach(r => {
        if (typeof r.response < "u") return;
        const n = {
          topic: r.topic,
          request: Nh(r.request.method, r.request.params, r.id),
          chainId: r.chainId
        };
        return e.push(n)
      }), e
    }
    async setJsonRpcRecords(e) {
      await this.core.storage.setItem(this.storageKey, e)
    }
    async getJsonRpcRecords() {
      return await this.core.storage.getItem(this.storageKey)
    }
    getRecord(e) {
      this.isInitialized();
      const r = this.records.get(e);
      if (!r) {
        const {
          message: n
        } = it("NO_MATCHING_KEY", `${this.name}: ${e}`);
        throw new Error(n)
      }
      return r
    }
    async persist() {
      await this.setJsonRpcRecords(this.values), this.events.emit(Cc.sync)
    }
    async restore() {
      try {
        const e = await this.getJsonRpcRecords();
        if (typeof e > "u" || !e.length) return;
        if (this.records.size) {
          const {
            message: r
          } = it("RESTORE_WILL_OVERRIDE", this.name);
          throw this.logger.error(r), new Error(r)
        }
        this.cached = e, this.logger.debug(`Successfully Restored records for ${this.name}`), this.logger.trace({
          type: "method",
          method: "restore",
          records: this.values
        })
      } catch (e) {
        this.logger.debug(`Failed to Restore records for ${this.name}`), this.logger.error(e)
      }
    }
    registerEventListeners() {
      this.events.on(Cc.created, e => {
        const r = Cc.created;
        this.logger.info(`Emitting ${r}`), this.logger.debug({
          type: "event",
          event: r,
          record: e
        })
      }), this.events.on(Cc.updated, e => {
        const r = Cc.updated;
        this.logger.info(`Emitting ${r}`), this.logger.debug({
          type: "event",
          event: r,
          record: e
        })
      }), this.events.on(Cc.deleted, e => {
        const r = Cc.deleted;
        this.logger.info(`Emitting ${r}`), this.logger.debug({
          type: "event",
          event: r,
          record: e
        })
      }), this.core.heartbeat.on(X1.pulse, () => {
        this.cleanup()
      })
    }
    cleanup() {
      try {
        this.isInitialized();
        let e = !1;
        this.records.forEach(r => {
          at.toMiliseconds(r.expiry || 0) - Date.now() <= 0 && (this.logger.info(`Deleting expired history log: ${r.id}`), this.records.delete(r.id), this.events.emit(Cc.deleted, r, !1), e = !0)
        }), e && this.persist()
      } catch (e) {
        this.logger.warn(e)
      }
    }
    isInitialized() {
      if (!this.initialized) {
        const {
          message: e
        } = it("NOT_INITIALIZED", this.name);
        throw new Error(e)
      }
    }
  }
  class vye extends Ahe {
    constructor(e, r) {
      super(e, r), this.core = e, this.logger = r, this.expirations = new Map, this.events = new Fi.EventEmitter, this.name = wbe, this.version = vbe, this.cached = [], this.initialized = !1, this.storagePrefix = Ll, this.init = async () => {
        this.initialized || (this.logger.trace("Initialized"), await this.restore(), this.cached.forEach(n => this.expirations.set(n.target, n)), this.cached = [], this.registerEventListeners(), this.initialized = !0)
      }, this.has = n => {
        try {
          const i = this.formatTarget(n);
          return typeof this.getExpiration(i) < "u"
        } catch {
          return !1
        }
      }, this.set = (n, i) => {
        this.isInitialized();
        const s = this.formatTarget(n),
          o = {
            target: s,
            expiry: i
          };
        this.expirations.set(s, o), this.checkExpiry(s, o), this.events.emit(Ia.created, {
          target: s,
          expiration: o
        })
      }, this.get = n => {
        this.isInitialized();
        const i = this.formatTarget(n);
        return this.getExpiration(i)
      }, this.del = n => {
        if (this.isInitialized(), this.has(n)) {
          const i = this.formatTarget(n),
            s = this.getExpiration(i);
          this.expirations.delete(i), this.events.emit(Ia.deleted, {
            target: i,
            expiration: s
          })
        }
      }, this.on = (n, i) => {
        this.events.on(n, i)
      }, this.once = (n, i) => {
        this.events.once(n, i)
      }, this.off = (n, i) => {
        this.events.off(n, i)
      }, this.removeListener = (n, i) => {
        this.events.removeListener(n, i)
      }, this.logger = bs(r, this.name)
    }
    get context() {
      return so(this.logger)
    }
    get storageKey() {
      return this.storagePrefix + this.version + this.core.customStoragePrefix + "//" + this.name
    }
    get length() {
      return this.expirations.size
    }
    get keys() {
      return Array.from(this.expirations.keys())
    }
    get values() {
      return Array.from(this.expirations.values())
    }
    formatTarget(e) {
      if (typeof e == "string") return yge(e);
      if (typeof e == "number") return _ge(e);
      const {
        message: r
      } = it("UNKNOWN_TYPE", `Target type: ${typeof e}`);
      throw new Error(r)
    }
    async setExpirations(e) {
      await this.core.storage.setItem(this.storageKey, e)
    }
    async getExpirations() {
      return await this.core.storage.getItem(this.storageKey)
    }
    async persist() {
      await this.setExpirations(this.values), this.events.emit(Ia.sync)
    }
    async restore() {
      try {
        const e = await this.getExpirations();
        if (typeof e > "u" || !e.length) return;
        if (this.expirations.size) {
          const {
            message: r
          } = it("RESTORE_WILL_OVERRIDE", this.name);
          throw this.logger.error(r), new Error(r)
        }
        this.cached = e, this.logger.debug(`Successfully Restored expirations for ${this.name}`), this.logger.trace({
          type: "method",
          method: "restore",
          expirations: this.values
        })
      } catch (e) {
        this.logger.debug(`Failed to Restore expirations for ${this.name}`), this.logger.error(e)
      }
    }
    getExpiration(e) {
      const r = this.expirations.get(e);
      if (!r) {
        const {
          message: n
        } = it("NO_MATCHING_KEY", `${this.name}: ${e}`);
        throw this.logger.warn(n), new Error(n)
      }
      return r
    }
    checkExpiry(e, r) {
      const {
        expiry: n
      } = r;
      at.toMiliseconds(n) - Date.now() <= 0 && this.expire(e, r)
    }
    expire(e, r) {
      this.expirations.delete(e), this.events.emit(Ia.expired, {
        target: e,
        expiration: r
      })
    }
    checkExpirations() {
      this.core.relayer.connected && this.expirations.forEach((e, r) => this.checkExpiry(r, e))
    }
    registerEventListeners() {
      this.core.heartbeat.on(X1.pulse, () => this.checkExpirations()), this.events.on(Ia.created, e => {
        const r = Ia.created;
        this.logger.info(`Emitting ${r}`), this.logger.debug({
          type: "event",
          event: r,
          data: e
        }), this.persist()
      }), this.events.on(Ia.expired, e => {
        const r = Ia.expired;
        this.logger.info(`Emitting ${r}`), this.logger.debug({
          type: "event",
          event: r,
          data: e
        }), this.persist()
      }), this.events.on(Ia.deleted, e => {
        const r = Ia.deleted;
        this.logger.info(`Emitting ${r}`), this.logger.debug({
          type: "event",
          event: r,
          data: e
        }), this.persist()
      })
    }
    isInitialized() {
      if (!this.initialized) {
        const {
          message: e
        } = it("NOT_INITIALIZED", this.name);
        throw new Error(e)
      }
    }
  }
  var In = {};
  Object.defineProperty(In, "__esModule", {
    value: !0
  }), In.getLocalStorage = In.getLocalStorageOrThrow = In.getCrypto = In.getCryptoOrThrow = In.getLocation = In.getLocationOrThrow = In.getNavigator = In.getNavigatorOrThrow = HB = In.getDocument = In.getDocumentOrThrow = In.getFromWindowOrThrow = In.getFromWindow = void 0;

  function R0(t) {
    let e;
    return typeof window < "u" && typeof window[t] < "u" && (e = window[t]), e
  }
  In.getFromWindow = R0;

  function Sg(t) {
    const e = R0(t);
    if (!e) throw new Error(`${t} is not defined in Window`);
    return e
  }
  In.getFromWindowOrThrow = Sg;

  function bye() {
    return Sg("document")
  }
  In.getDocumentOrThrow = bye;

  function yye() {
    return R0("document")
  }
  var HB = In.getDocument = yye;

  function _ye() {
    return Sg("navigator")
  }
  In.getNavigatorOrThrow = _ye;

  function xye() {
    return R0("navigator")
  }
  In.getNavigator = xye;

  function Cye() {
    return Sg("location")
  }
  In.getLocationOrThrow = Cye;

  function Eye() {
    return R0("location")
  }
  In.getLocation = Eye;

  function Aye() {
    return Sg("crypto")
  }
  In.getCryptoOrThrow = Aye;

  function Sye() {
    return R0("crypto")
  }
  In.getCrypto = Sye;

  function Iye() {
    return Sg("localStorage")
  }
  In.getLocalStorageOrThrow = Iye;

  function Tye() {
    return R0("localStorage")
  }
  In.getLocalStorage = Tye;
  class kye extends She {
    constructor(e, r, n) {
      super(e, r, n), this.core = e, this.logger = r, this.store = n, this.name = bbe, this.verifyUrlV3 = _be, this.storagePrefix = Ll, this.version = gB, this.init = async () => {
        var i;
        this.isDevEnv || (this.publicKey = await this.store.getItem(this.storeKey), this.publicKey && at.toMiliseconds((i = this.publicKey) == null ? void 0 : i.expiresAt) < Date.now() && (this.logger.debug("verify v2 public key expired"), await this.removePublicKey()))
      }, this.register = async i => {
        if (!X2() || this.isDevEnv) return;
        const s = window.location.origin,
          {
            id: o,
            decryptedId: a
          } = i,
          c = `${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${s}&id=${o}&decryptedId=${a}`;
        try {
          const l = HB(),
            h = this.startAbortTimer(at.ONE_SECOND * 5),
            f = await new Promise((w, b) => {
              const C = () => {
                window.removeEventListener("message", N), l.body.removeChild(M), b("attestation aborted")
              };
              this.abortController.signal.addEventListener("abort", C);
              const M = l.createElement("iframe");
              M.src = c, M.style.display = "none", M.addEventListener("error", C, {
                signal: this.abortController.signal
              });
              const N = $ => {
                if ($.data && typeof $.data == "string") try {
                  const k = JSON.parse($.data);
                  if (k.type === "verify_attestation") {
                    if (aC(k.attestation).payload.id !== o) return;
                    clearInterval(h), l.body.removeChild(M), this.abortController.signal.removeEventListener("abort", C), window.removeEventListener("message", N), w(k.attestation === null ? "" : k.attestation)
                  }
                } catch (k) {
                  this.logger.warn(k)
                }
              };
              l.body.appendChild(M), window.addEventListener("message", N, {
                signal: this.abortController.signal
              })
            });
          return this.logger.debug("jwt attestation", f), f
        } catch (l) {
          this.logger.warn(l)
        }
        return ""
      }, this.resolve = async i => {
        if (this.isDevEnv) return "";
        const {
          attestationId: s,
          hash: o,
          encryptedId: a
        } = i;
        if (s === "") {
          this.logger.debug("resolve: attestationId is empty, skipping");
          return
        }
        if (s) {
          if (aC(s).payload.id !== a) return;
          const l = await this.isValidJwtAttestation(s);
          if (l) {
            if (!l.isVerified) {
              this.logger.warn("resolve: jwt attestation: origin url not verified");
              return
            }
            return l
          }
        }
        if (!o) return;
        const c = this.getVerifyUrl(i?.verifyUrl);
        return this.fetchAttestation(o, c)
      }, this.fetchAttestation = async (i, s) => {
        this.logger.debug(`resolving attestation: ${i} from url: ${s}`);
        const o = this.startAbortTimer(at.ONE_SECOND * 5),
          a = await fetch(`${s}/attestation/${i}?v2Supported=true`, {
            signal: this.abortController.signal
          });
        return clearTimeout(o), a.status === 200 ? await a.json() : void 0
      }, this.getVerifyUrl = i => {
        let s = i || xv;
        return xbe.includes(s) || (this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${xv}`), s = xv), s
      }, this.fetchPublicKey = async () => {
        try {
          this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);
          const i = this.startAbortTimer(at.FIVE_SECONDS),
            s = await fetch(`${this.verifyUrlV3}/public-key`, {
              signal: this.abortController.signal
            });
          return clearTimeout(i), await s.json()
        } catch (i) {
          this.logger.warn(i)
        }
      }, this.persistPublicKey = async i => {
        this.logger.debug("persisting public key to local storage", i), await this.store.setItem(this.storeKey, i), this.publicKey = i
      }, this.removePublicKey = async () => {
        this.logger.debug("removing verify v2 public key from storage"), await this.store.removeItem(this.storeKey), this.publicKey = void 0
      }, this.isValidJwtAttestation = async i => {
        const s = await this.getPublicKey();
        try {
          if (s) return this.validateAttestation(i, s)
        } catch (a) {
          this.logger.error(a), this.logger.warn("error validating attestation")
        }
        const o = await this.fetchAndPersistPublicKey();
        try {
          if (o) return this.validateAttestation(i, o)
        } catch (a) {
          this.logger.error(a), this.logger.warn("error validating attestation")
        }
      }, this.getPublicKey = async () => this.publicKey ? this.publicKey : await this.fetchAndPersistPublicKey(), this.fetchAndPersistPublicKey = async () => {
        if (this.fetchPromise) return await this.fetchPromise, this.publicKey;
        this.fetchPromise = new Promise(async s => {
          const o = await this.fetchPublicKey();
          o && (await this.persistPublicKey(o), s(o))
        });
        const i = await this.fetchPromise;
        return this.fetchPromise = void 0, i
      }, this.validateAttestation = (i, s) => {
        const o = P2e(i, s.publicKey),
          a = {
            hasExpired: at.toMiliseconds(o.exp) < Date.now(),
            payload: o
          };
        if (a.hasExpired) throw this.logger.warn("resolve: jwt attestation expired"), new Error("JWT attestation expired");
        return {
          origin: a.payload.origin,
          isScam: a.payload.isScam,
          isVerified: a.payload.isVerified
        }
      }, this.logger = bs(r, this.name), this.abortController = new AbortController, this.isDevEnv = DC(), this.init()
    }
    get storeKey() {
      return this.storagePrefix + this.version + this.core.customStoragePrefix + "//verify:public:key"
    }
    get context() {
      return so(this.logger)
    }
    startAbortTimer(e) {
      return this.abortController = new AbortController, setTimeout(() => this.abortController.abort(), at.toMiliseconds(e))
    }
  }
  class Rye extends Ihe {
    constructor(e, r) {
      super(e, r), this.projectId = e, this.logger = r, this.context = Cbe, this.registerDeviceToken = async n => {
        const {
          clientId: i,
          token: s,
          notificationType: o,
          enableEncrypted: a = !1
        } = n, c = `${Ebe}/${this.projectId}/clients`;
        await fetch(c, {
          method: "POST",
          headers: {
            "Content-Type": "application/json"
          },
          body: JSON.stringify({
            client_id: i,
            type: o,
            token: s,
            always_raw: a
          })
        })
      }, this.logger = bs(r, this.context)
    }
  }
  var Nye = Object.defineProperty,
    qB = Object.getOwnPropertySymbols,
    Mye = Object.prototype.hasOwnProperty,
    Pye = Object.prototype.propertyIsEnumerable,
    VB = (t, e, r) => e in t ? Nye(t, e, {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: r
    }) : t[e] = r,
    Sv = (t, e) => {
      for (var r in e || (e = {})) Mye.call(e, r) && VB(t, r, e[r]);
      if (qB)
        for (var r of qB(e)) Pye.call(e, r) && VB(t, r, e[r]);
      return t
    };
  class $ye extends The {
    constructor(e, r, n = !0) {
      super(e, r, n), this.core = e, this.logger = r, this.context = Sbe, this.storagePrefix = Ll, this.storageVersion = Abe, this.events = new Map, this.shouldPersist = !1, this.init = async () => {
        if (!DC()) try {
          const i = {
            eventId: CD(),
            timestamp: Date.now(),
            domain: this.getAppDomain(),
            props: {
              event: "INIT",
              type: "",
              properties: {
                client_id: await this.core.crypto.getClientId(),
                user_agent: wD(this.core.relayer.protocol, this.core.relayer.version, _E)
              }
            }
          };
          await this.sendEvent([i])
        } catch (i) {
          this.logger.warn(i)
        }
      }, this.createEvent = i => {
        const {
          event: s = "ERROR",
          type: o = "",
          properties: {
            topic: a,
            trace: c
          }
        } = i, l = CD(), h = this.core.projectId || "", f = Date.now(), w = Sv({
          eventId: l,
          timestamp: f,
          props: {
            event: s,
            type: o,
            properties: {
              topic: a,
              trace: c
            }
          },
          bundleId: h,
          domain: this.getAppDomain()
        }, this.setMethods(l));
        return this.telemetryEnabled && (this.events.set(l, w), this.shouldPersist = !0), w
      }, this.getEvent = i => {
        const {
          eventId: s,
          topic: o
        } = i;
        if (s) return this.events.get(s);
        const a = Array.from(this.events.values()).find(c => c.props.properties.topic === o);
        if (a) return Sv(Sv({}, a), this.setMethods(a.eventId))
      }, this.deleteEvent = i => {
        const {
          eventId: s
        } = i;
        this.events.delete(s), this.shouldPersist = !0
      }, this.setEventListeners = () => {
        this.core.heartbeat.on(X1.pulse, async () => {
          this.shouldPersist && await this.persist(), this.events.forEach(i => {
            at.fromMiliseconds(Date.now()) - at.fromMiliseconds(i.timestamp) > Ibe && (this.events.delete(i.eventId), this.shouldPersist = !0)
          })
        })
      }, this.setMethods = i => ({
        addTrace: s => this.addTrace(i, s),
        setError: s => this.setError(i, s)
      }), this.addTrace = (i, s) => {
        const o = this.events.get(i);
        o && (o.props.properties.trace.push(s), this.events.set(i, o), this.shouldPersist = !0)
      }, this.setError = (i, s) => {
        const o = this.events.get(i);
        o && (o.props.type = s, o.timestamp = Date.now(), this.events.set(i, o), this.shouldPersist = !0)
      }, this.persist = async () => {
        await this.core.storage.setItem(this.storageKey, Array.from(this.events.values())), this.shouldPersist = !1
      }, this.restore = async () => {
        try {
          const i = await this.core.storage.getItem(this.storageKey) || [];
          if (!i.length) return;
          i.forEach(s => {
            this.events.set(s.eventId, Sv(Sv({}, s), this.setMethods(s.eventId)))
          })
        } catch (i) {
          this.logger.warn(i)
        }
      }, this.submit = async () => {
        if (!this.telemetryEnabled || this.events.size === 0) return;
        const i = [];
        for (const [s, o] of this.events) o.props.type && i.push(o);
        if (i.length !== 0) try {
          if ((await this.sendEvent(i)).ok)
            for (const s of i) this.events.delete(s.eventId), this.shouldPersist = !0
        } catch (s) {
          this.logger.warn(s)
        }
      }, this.sendEvent = async i => {
        const s = this.getAppDomain() ? "" : "&sp=desktop";
        return await fetch(`${Tbe}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${_E}${s}`, {
          method: "POST",
          body: JSON.stringify(i)
        })
      }, this.getAppDomain = () => mD().url, this.logger = bs(r, this.context), this.telemetryEnabled = n, n ? this.restore().then(async () => {
        await this.submit(), this.setEventListeners()
      }) : this.persist()
    }
    get storageKey() {
      return this.storagePrefix + this.storageVersion + this.core.customStoragePrefix + "//" + this.context
    }
  }
  var Oye = Object.defineProperty,
    KB = Object.getOwnPropertySymbols,
    Dye = Object.prototype.hasOwnProperty,
    Lye = Object.prototype.propertyIsEnumerable,
    GB = (t, e, r) => e in t ? Oye(t, e, {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: r
    }) : t[e] = r,
    ZB = (t, e) => {
      for (var r in e || (e = {})) Dye.call(e, r) && GB(t, r, e[r]);
      if (KB)
        for (var r of KB(e)) Lye.call(e, r) && GB(t, r, e[r]);
      return t
    };
  class SE extends vhe {
    constructor(e) {
      var r;
      super(e), this.protocol = pB, this.version = gB, this.name = yE, this.events = new Fi.EventEmitter, this.initialized = !1, this.on = (o, a) => this.events.on(o, a), this.once = (o, a) => this.events.once(o, a), this.off = (o, a) => this.events.off(o, a), this.removeListener = (o, a) => this.events.removeListener(o, a), this.dispatchEnvelope = ({
        topic: o,
        message: a,
        sessionExists: c
      }) => {
        if (!o || !a) return;
        const l = {
          topic: o,
          message: a,
          publishedAt: Date.now(),
          transportType: un.link_mode
        };
        this.relayer.onLinkMessageEvent(l, {
          sessionExists: c
        })
      }, this.projectId = e?.projectId, this.relayUrl = e?.relayUrl || vB, this.customStoragePrefix = e != null && e.customStoragePrefix ? `:${e.customStoragePrefix}` : "";
      const n = y1({
          level: typeof e?.logger == "string" && e.logger ? e.logger : Gve.logger
        }),
        {
          logger: i,
          chunkLoggerController: s
        } = Y9({
          opts: n,
          maxSizeInBytes: e?.maxLogBlobSizeInBytes,
          loggerOverride: e?.logger
        });
      this.logChunkController = s, (r = this.logChunkController) != null && r.downloadLogsBlobInBrowser && (window.downloadLogsBlobInBrowser = async () => {
        var o, a;
        (o = this.logChunkController) != null && o.downloadLogsBlobInBrowser && ((a = this.logChunkController) == null || a.downloadLogsBlobInBrowser({
          clientId: await this.crypto.getClientId()
        }))
      }), this.logger = bs(i, this.name), this.heartbeat = new Fde, this.crypto = new J3e(this, this.logger, e?.keychain), this.history = new wye(this, this.logger), this.expirer = new vye(this, this.logger), this.storage = e != null && e.storage ? e.storage : new whe(ZB(ZB({}, Zve), e?.storageOptions)), this.relayer = new hye({
        core: this,
        logger: this.logger,
        relayUrl: this.relayUrl,
        projectId: this.projectId
      }), this.pairing = new mye(this, this.logger), this.verify = new kye(this, this.logger, this.storage), this.echoClient = new Rye(this.projectId || "", this.logger), this.linkModeSupportedApps = [], this.eventClient = new $ye(this, this.logger, e?.telemetryEnabled)
    }
    static async init(e) {
      const r = new SE(e);
      await r.initialize();
      const n = await r.crypto.getClientId();
      return await r.storage.setItem(lbe, n), r
    }
    get context() {
      return so(this.logger)
    }
    async start() {
      this.initialized || await this.initialize()
    }
    async getLogsBlob() {
      var e;
      return (e = this.logChunkController) == null ? void 0 : e.logsToBlob({
        clientId: await this.crypto.getClientId()
      })
    }
    async addLinkModeSupportedApp(e) {
      this.linkModeSupportedApps.includes(e) || (this.linkModeSupportedApps.push(e), await this.storage.setItem(bB, this.linkModeSupportedApps))
    }
    async initialize() {
      this.logger.trace("Initialized");
      try {
        await this.crypto.init(), await this.history.init(), await this.expirer.init(), await this.relayer.init(), await this.heartbeat.init(), await this.pairing.init(), this.eventClient.init(), this.linkModeSupportedApps = await this.storage.getItem(bB) || [], this.initialized = !0, this.logger.info("Core Initialization Success")
      } catch (e) {
        throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`, e), this.logger.error(e.message), e
      }
    }
  }
  const Bye = SE,
    YB = "wc",
    QB = 2,
    JB = "client",
    IE = `${YB}@${QB}:${JB}:`,
    TE = {
      name: JB,
      logger: "error",
      controller: !1,
      relayUrl: "wss://relay.walletconnect.org"
    },
    XB = "WALLETCONNECT_DEEPLINK_CHOICE",
    Uye = "proposal",
    eU = "Proposal expired",
    jye = "session",
    Ig = at.SEVEN_DAYS,
    Fye = "engine",
    Ki = {
      wc_sessionPropose: {
        req: {
          ttl: at.FIVE_MINUTES,
          prompt: !0,
          tag: 1100
        },
        res: {
          ttl: at.FIVE_MINUTES,
          prompt: !1,
          tag: 1101
        },
        reject: {
          ttl: at.FIVE_MINUTES,
          prompt: !1,
          tag: 1120
        },
        autoReject: {
          ttl: at.FIVE_MINUTES,
          prompt: !1,
          tag: 1121
        }
      },
      wc_sessionSettle: {
        req: {
          ttl: at.FIVE_MINUTES,
          prompt: !1,
          tag: 1102
        },
        res: {
          ttl: at.FIVE_MINUTES,
          prompt: !1,
          tag: 1103
        }
      },
      wc_sessionUpdate: {
        req: {
          ttl: at.ONE_DAY,
          prompt: !1,
          tag: 1104
        },
        res: {
          ttl: at.ONE_DAY,
          prompt: !1,
          tag: 1105
        }
      },
      wc_sessionExtend: {
        req: {
          ttl: at.ONE_DAY,
          prompt: !1,
          tag: 1106
        },
        res: {
          ttl: at.ONE_DAY,
          prompt: !1,
          tag: 1107
        }
      },
      wc_sessionRequest: {
        req: {
          ttl: at.FIVE_MINUTES,
          prompt: !0,
          tag: 1108
        },
        res: {
          ttl: at.FIVE_MINUTES,
          prompt: !1,
          tag: 1109
        }
      },
      wc_sessionEvent: {
        req: {
          ttl: at.FIVE_MINUTES,
          prompt: !0,
          tag: 1110
        },
        res: {
          ttl: at.FIVE_MINUTES,
          prompt: !1,
          tag: 1111
        }
      },
      wc_sessionDelete: {
        req: {
          ttl: at.ONE_DAY,
          prompt: !1,
          tag: 1112
        },
        res: {
          ttl: at.ONE_DAY,
          prompt: !1,
          tag: 1113
        }
      },
      wc_sessionPing: {
        req: {
          ttl: at.ONE_DAY,
          prompt: !1,
          tag: 1114
        },
        res: {
          ttl: at.ONE_DAY,
          prompt: !1,
          tag: 1115
        }
      },
      wc_sessionAuthenticate: {
        req: {
          ttl: at.ONE_HOUR,
          prompt: !0,
          tag: 1116
        },
        res: {
          ttl: at.ONE_HOUR,
          prompt: !1,
          tag: 1117
        },
        reject: {
          ttl: at.FIVE_MINUTES,
          prompt: !1,
          tag: 1118
        },
        autoReject: {
          ttl: at.FIVE_MINUTES,
          prompt: !1,
          tag: 1119
        }
      }
    },
    kE = {
      min: at.FIVE_MINUTES,
      max: at.SEVEN_DAYS
    },
    jl = {
      idle: "IDLE",
      active: "ACTIVE"
    },
    Wye = "request",
    zye = ["wc_sessionPropose", "wc_sessionRequest", "wc_authRequest", "wc_sessionAuthenticate"],
    Hye = "wc",
    qye = "auth",
    Vye = "authKeys",
    Kye = "pairingTopics",
    Gye = "requests",
    x4 = `${Hye}@${1.5}:${qye}:`,
    C4 = `${x4}:PUB_KEY`;
  var Zye = Object.defineProperty,
    Yye = Object.defineProperties,
    Qye = Object.getOwnPropertyDescriptors,
    tU = Object.getOwnPropertySymbols,
    Jye = Object.prototype.hasOwnProperty,
    Xye = Object.prototype.propertyIsEnumerable,
    rU = (t, e, r) => e in t ? Zye(t, e, {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: r
    }) : t[e] = r,
    Zn = (t, e) => {
      for (var r in e || (e = {})) Jye.call(e, r) && rU(t, r, e[r]);
      if (tU)
        for (var r of tU(e)) Xye.call(e, r) && rU(t, r, e[r]);
      return t
    },
    Ac = (t, e) => Yye(t, Qye(e));
  class e5e extends Rhe {
    constructor(e) {
      super(e), this.name = Fye, this.events = new zx, this.initialized = !1, this.requestQueue = {
        state: jl.idle,
        queue: []
      }, this.sessionRequestQueue = {
        state: jl.idle,
        queue: []
      }, this.requestQueueDelay = at.ONE_SECOND, this.expectedPairingMethodMap = new Map, this.recentlyDeletedMap = new Map, this.recentlyDeletedLimit = 200, this.relayMessageCache = [], this.init = async () => {
        this.initialized || (await this.cleanup(), this.registerRelayerEvents(), this.registerExpirerEvents(), this.registerPairingEvents(), await this.registerLinkModeListeners(), this.client.core.pairing.register({
          methods: Object.keys(Ki)
        }), this.initialized = !0, setTimeout(() => {
          this.sessionRequestQueue.queue = this.getPendingSessionRequests(), this.processSessionRequestQueue()
        }, at.toMiliseconds(this.requestQueueDelay)))
      }, this.connect = async r => {
        this.isInitialized(), await this.confirmOnlineStateOrThrow();
        const n = Ac(Zn({}, r), {
          requiredNamespaces: r.requiredNamespaces || {},
          optionalNamespaces: r.optionalNamespaces || {}
        });
        await this.isValidConnect(n);
        const {
          pairingTopic: i,
          requiredNamespaces: s,
          optionalNamespaces: o,
          sessionProperties: a,
          relays: c
        } = n;
        let l = i,
          h, f = !1;
        try {
          l && (f = this.client.core.pairing.pairings.get(l).active)
        } catch (F) {
          throw this.client.logger.error(`connect() -> pairing.get(${l}) failed`), F
        }
        if (!l || !f) {
          const {
            topic: F,
            uri: D
          } = await this.client.core.pairing.create();
          l = F, h = D
        }
        if (!l) {
          const {
            message: F
          } = it("NO_MATCHING_KEY", `connect() pairing topic: ${l}`);
          throw new Error(F)
        }
        const w = await this.client.core.crypto.generateKeyPair(),
          b = Ki.wc_sessionPropose.req.ttl || at.FIVE_MINUTES,
          C = _i(b),
          M = Zn({
            requiredNamespaces: s,
            optionalNamespaces: o,
            relays: c ?? [{
              protocol: wB
            }],
            proposer: {
              publicKey: w,
              metadata: this.client.metadata
            },
            expiryTimestamp: C,
            pairingTopic: l
          }, a && {
            sessionProperties: a
          }),
          {
            reject: N,
            resolve: $,
            done: k
          } = y0(b, eU);
        this.events.once(Tr("session_connect"), async ({
          error: F,
          session: D
        }) => {
          if (F) N(F);
          else if (D) {
            D.self.publicKey = w;
            const V = Ac(Zn({}, D), {
              pairingTopic: M.pairingTopic,
              requiredNamespaces: M.requiredNamespaces,
              optionalNamespaces: M.optionalNamespaces,
              transportType: un.relay
            });
            await this.client.session.set(D.topic, V), await this.setExpiry(D.topic, D.expiry), l && await this.client.core.pairing.updateMetadata({
              topic: l,
              metadata: D.peer.metadata
            }), this.cleanupDuplicatePairings(V), $(V)
          }
        });
        const B = await this.sendRequest({
          topic: l,
          method: "wc_sessionPropose",
          params: M,
          throwOnFailedPublish: !0
        });
        return await this.setProposal(B, Zn({
          id: B
        }, M)), {
          uri: h,
          approval: k
        }
      }, this.pair = async r => {
        this.isInitialized(), await this.confirmOnlineStateOrThrow();
        try {
          return await this.client.core.pairing.pair(r)
        } catch (n) {
          throw this.client.logger.error("pair() failed"), n
        }
      }, this.approve = async r => {
        var n, i, s;
        const o = this.client.core.eventClient.createEvent({
          properties: {
            topic: (n = r?.id) == null ? void 0 : n.toString(),
            trace: [Ec.session_approve_started]
          }
        });
        try {
          this.isInitialized(), await this.confirmOnlineStateOrThrow()
        } catch (P) {
          throw o.setError(I0.no_internet_connection), P
        }
        try {
          await this.isValidProposalId(r?.id)
        } catch (P) {
          throw this.client.logger.error(`approve() -> proposal.get(${r?.id}) failed`), o.setError(I0.proposal_not_found), P
        }
        try {
          await this.isValidApprove(r)
        } catch (P) {
          throw this.client.logger.error("approve() -> isValidApprove() failed"), o.setError(I0.session_approve_namespace_validation_failure), P
        }
        const {
          id: a,
          relayProtocol: c,
          namespaces: l,
          sessionProperties: h,
          sessionConfig: f
        } = r, w = this.client.proposal.get(a);
        this.client.core.eventClient.deleteEvent({
          eventId: o.eventId
        });
        const {
          pairingTopic: b,
          proposer: C,
          requiredNamespaces: M,
          optionalNamespaces: N
        } = w;
        let $ = (i = this.client.core.eventClient) == null ? void 0 : i.getEvent({
          topic: b
        });
        $ || ($ = (s = this.client.core.eventClient) == null ? void 0 : s.createEvent({
          type: Ec.session_approve_started,
          properties: {
            topic: b,
            trace: [Ec.session_approve_started, Ec.session_namespaces_validation_success]
          }
        }));
        const k = await this.client.core.crypto.generateKeyPair(),
          B = C.publicKey,
          F = await this.client.core.crypto.generateSharedKey(k, B),
          D = Zn(Zn({
            relay: {
              protocol: c ?? "irn"
            },
            namespaces: l,
            controller: {
              publicKey: k,
              metadata: this.client.metadata
            },
            expiry: _i(Ig)
          }, h && {
            sessionProperties: h
          }), f && {
            sessionConfig: f
          }),
          V = un.relay;
        $.addTrace(Ec.subscribing_session_topic);
        try {
          await this.client.core.relayer.subscribe(F, {
            transportType: V
          })
        } catch (P) {
          throw $.setError(I0.subscribe_session_topic_failure), P
        }
        $.addTrace(Ec.subscribe_session_topic_success);
        const R = Ac(Zn({}, D), {
          topic: F,
          requiredNamespaces: M,
          optionalNamespaces: N,
          pairingTopic: b,
          acknowledged: !1,
          self: D.controller,
          peer: {
            publicKey: C.publicKey,
            metadata: C.metadata
          },
          controller: k,
          transportType: un.relay
        });
        await this.client.session.set(F, R), $.addTrace(Ec.store_session);
        try {
          $.addTrace(Ec.publishing_session_settle), await this.sendRequest({
            topic: F,
            method: "wc_sessionSettle",
            params: D,
            throwOnFailedPublish: !0
          }).catch(P => {
            throw $?.setError(I0.session_settle_publish_failure), P
          }), $.addTrace(Ec.session_settle_publish_success), $.addTrace(Ec.publishing_session_approve), await this.sendResult({
            id: a,
            topic: b,
            result: {
              relay: {
                protocol: c ?? "irn"
              },
              responderPublicKey: k
            },
            throwOnFailedPublish: !0
          }).catch(P => {
            throw $?.setError(I0.session_approve_publish_failure), P
          }), $.addTrace(Ec.session_approve_publish_success)
        } catch (P) {
          throw this.client.logger.error(P), this.client.session.delete(F, nn("USER_DISCONNECTED")), await this.client.core.relayer.unsubscribe(F), P
        }
        return this.client.core.eventClient.deleteEvent({
          eventId: $.eventId
        }), await this.client.core.pairing.updateMetadata({
          topic: b,
          metadata: C.metadata
        }), await this.client.proposal.delete(a, nn("USER_DISCONNECTED")), await this.client.core.pairing.activate({
          topic: b
        }), await this.setExpiry(F, _i(Ig)), {
          topic: F,
          acknowledged: () => Promise.resolve(this.client.session.get(F))
        }
      }, this.reject = async r => {
        this.isInitialized(), await this.confirmOnlineStateOrThrow();
        try {
          await this.isValidReject(r)
        } catch (o) {
          throw this.client.logger.error("reject() -> isValidReject() failed"), o
        }
        const {
          id: n,
          reason: i
        } = r;
        let s;
        try {
          s = this.client.proposal.get(n).pairingTopic
        } catch (o) {
          throw this.client.logger.error(`reject() -> proposal.get(${n}) failed`), o
        }
        s && (await this.sendError({
          id: n,
          topic: s,
          error: i,
          rpcOpts: Ki.wc_sessionPropose.reject
        }), await this.client.proposal.delete(n, nn("USER_DISCONNECTED")))
      }, this.update = async r => {
        this.isInitialized(), await this.confirmOnlineStateOrThrow();
        try {
          await this.isValidUpdate(r)
        } catch (f) {
          throw this.client.logger.error("update() -> isValidUpdate() failed"), f
        }
        const {
          topic: n,
          namespaces: i
        } = r, {
          done: s,
          resolve: o,
          reject: a
        } = y0(), c = Rh(), l = A0().toString(), h = this.client.session.get(n).namespaces;
        return this.events.once(Tr("session_update", c), ({
          error: f
        }) => {
          f ? a(f) : o()
        }), await this.client.session.update(n, {
          namespaces: i
        }), await this.sendRequest({
          topic: n,
          method: "wc_sessionUpdate",
          params: {
            namespaces: i
          },
          throwOnFailedPublish: !0,
          clientRpcId: c,
          relayRpcId: l
        }).catch(f => {
          this.client.logger.error(f), this.client.session.update(n, {
            namespaces: h
          }), a(f)
        }), {
          acknowledged: s
        }
      }, this.extend = async r => {
        this.isInitialized(), await this.confirmOnlineStateOrThrow();
        try {
          await this.isValidExtend(r)
        } catch (c) {
          throw this.client.logger.error("extend() -> isValidExtend() failed"), c
        }
        const {
          topic: n
        } = r, i = Rh(), {
          done: s,
          resolve: o,
          reject: a
        } = y0();
        return this.events.once(Tr("session_extend", i), ({
          error: c
        }) => {
          c ? a(c) : o()
        }), await this.setExpiry(n, _i(Ig)), this.sendRequest({
          topic: n,
          method: "wc_sessionExtend",
          params: {},
          clientRpcId: i,
          throwOnFailedPublish: !0
        }).catch(c => {
          a(c)
        }), {
          acknowledged: s
        }
      }, this.request = async r => {
        this.isInitialized();
        try {
          await this.isValidRequest(r)
        } catch (C) {
          throw this.client.logger.error("request() -> isValidRequest() failed"), C
        }
        const {
          chainId: n,
          request: i,
          topic: s,
          expiry: o = Ki.wc_sessionRequest.req.ttl
        } = r, a = this.client.session.get(s);
        a?.transportType === un.relay && await this.confirmOnlineStateOrThrow();
        const c = Rh(),
          l = A0().toString(),
          {
            done: h,
            resolve: f,
            reject: w
          } = y0(o, "Request expired. Please try again.");
        this.events.once(Tr("session_request", c), ({
          error: C,
          result: M
        }) => {
          C ? w(C) : f(M)
        });
        const b = this.getAppLinkIfEnabled(a.peer.metadata, a.transportType);
        return b ? (await this.sendRequest({
          clientRpcId: c,
          relayRpcId: l,
          topic: s,
          method: "wc_sessionRequest",
          params: {
            request: Ac(Zn({}, i), {
              expiryTimestamp: _i(o)
            }),
            chainId: n
          },
          expiry: o,
          throwOnFailedPublish: !0,
          appLink: b
        }).catch(C => w(C)), this.client.events.emit("session_request_sent", {
          topic: s,
          request: i,
          chainId: n,
          id: c
        }), await h()) : await Promise.all([new Promise(async C => {
          await this.sendRequest({
            clientRpcId: c,
            relayRpcId: l,
            topic: s,
            method: "wc_sessionRequest",
            params: {
              request: Ac(Zn({}, i), {
                expiryTimestamp: _i(o)
              }),
              chainId: n
            },
            expiry: o,
            throwOnFailedPublish: !0
          }).catch(M => w(M)), this.client.events.emit("session_request_sent", {
            topic: s,
            request: i,
            chainId: n,
            id: c
          }), C()
        }), new Promise(async C => {
          var M;
          if (!((M = a.sessionConfig) != null && M.disableDeepLink)) {
            const N = await Ege(this.client.core.storage, XB);
            await xge({
              id: c,
              topic: s,
              wcDeepLink: N
            })
          }
          C()
        }), h()]).then(C => C[2])
      }, this.respond = async r => {
        this.isInitialized(), await this.isValidRespond(r);
        const {
          topic: n,
          response: i
        } = r, {
          id: s
        } = i, o = this.client.session.get(n);
        o.transportType === un.relay && await this.confirmOnlineStateOrThrow();
        const a = this.getAppLinkIfEnabled(o.peer.metadata, o.transportType);
        Dl(i) ? await this.sendResult({
          id: s,
          topic: n,
          result: i.result,
          throwOnFailedPublish: !0,
          appLink: a
        }) : Aa(i) && await this.sendError({
          id: s,
          topic: n,
          error: i.error,
          appLink: a
        }), this.cleanupAfterResponse(r)
      }, this.ping = async r => {
        this.isInitialized(), await this.confirmOnlineStateOrThrow();
        try {
          await this.isValidPing(r)
        } catch (i) {
          throw this.client.logger.error("ping() -> isValidPing() failed"), i
        }
        const {
          topic: n
        } = r;
        if (this.client.session.keys.includes(n)) {
          const i = Rh(),
            s = A0().toString(),
            {
              done: o,
              resolve: a,
              reject: c
            } = y0();
          this.events.once(Tr("session_ping", i), ({
            error: l
          }) => {
            l ? c(l) : a()
          }), await Promise.all([this.sendRequest({
            topic: n,
            method: "wc_sessionPing",
            params: {},
            throwOnFailedPublish: !0,
            clientRpcId: i,
            relayRpcId: s
          }), o()])
        } else this.client.core.pairing.pairings.keys.includes(n) && await this.client.core.pairing.ping({
          topic: n
        })
      }, this.emit = async r => {
        this.isInitialized(), await this.confirmOnlineStateOrThrow(), await this.isValidEmit(r);
        const {
          topic: n,
          event: i,
          chainId: s
        } = r, o = A0().toString();
        await this.sendRequest({
          topic: n,
          method: "wc_sessionEvent",
          params: {
            event: i,
            chainId: s
          },
          throwOnFailedPublish: !0,
          relayRpcId: o
        })
      }, this.disconnect = async r => {
        this.isInitialized(), await this.confirmOnlineStateOrThrow(), await this.isValidDisconnect(r);
        const {
          topic: n
        } = r;
        if (this.client.session.keys.includes(n)) await this.sendRequest({
          topic: n,
          method: "wc_sessionDelete",
          params: nn("USER_DISCONNECTED"),
          throwOnFailedPublish: !0
        }), await this.deleteSession({
          topic: n,
          emitEvent: !1
        });
        else if (this.client.core.pairing.pairings.keys.includes(n)) await this.client.core.pairing.disconnect({
          topic: n
        });
        else {
          const {
            message: i
          } = it("MISMATCHED_TOPIC", `Session or pairing topic not found: ${n}`);
          throw new Error(i)
        }
      }, this.find = r => (this.isInitialized(), this.client.session.getAll().filter(n => Y2e(n, r))), this.getPendingSessionRequests = () => this.client.pendingRequest.getAll(), this.authenticate = async (r, n) => {
        var i;
        this.isInitialized(), this.isValidAuthenticate(r);
        const s = n && this.client.core.linkModeSupportedApps.includes(n) && ((i = this.client.metadata.redirect) == null ? void 0 : i.linkMode),
          o = s ? un.link_mode : un.relay;
        o === un.relay && await this.confirmOnlineStateOrThrow();
        const {
          chains: a,
          statement: c = "",
          uri: l,
          domain: h,
          nonce: f,
          type: w,
          exp: b,
          nbf: C,
          methods: M = [],
          expiry: N
        } = r, $ = [...r.resources || []], {
          topic: k,
          uri: B
        } = await this.client.core.pairing.create({
          methods: ["wc_sessionAuthenticate"],
          transportType: o
        });
        this.client.logger.info({
          message: "Generated new pairing",
          pairing: {
            topic: k,
            uri: B
          }
        });
        const F = await this.client.core.crypto.generateKeyPair(),
          D = p4(F);
        if (await Promise.all([this.client.auth.authKeys.set(C4, {
            responseTopic: D,
            publicKey: F
          }), this.client.auth.pairingTopics.set(D, {
            topic: D,
            pairingTopic: k
          })]), await this.client.core.relayer.subscribe(D, {
            transportType: o
          }), this.client.logger.info(`sending request to new pairing topic: ${k}`), M.length > 0) {
          const {
            namespace: E
          } = J2(a[0]);
          let S = w2e(E, "request", M);
          f4($) && (S = b2e(S, $.pop())), $.push(S)
        }
        const V = N && N > Ki.wc_sessionAuthenticate.req.ttl ? N : Ki.wc_sessionAuthenticate.req.ttl,
          R = {
            authPayload: {
              type: w ?? "caip122",
              chains: a,
              statement: c,
              aud: l,
              domain: h,
              version: "1",
              nonce: f,
              iat: new Date().toISOString(),
              exp: b,
              nbf: C,
              resources: $
            },
            requester: {
              publicKey: F,
              metadata: this.client.metadata
            },
            expiryTimestamp: _i(V)
          },
          P = {
            eip155: {
              chains: a,
              methods: [...new Set(["personal_sign", ...M])],
              events: ["chainChanged", "accountsChanged"]
            }
          },
          j = {
            requiredNamespaces: {},
            optionalNamespaces: P,
            relays: [{
              protocol: "irn"
            }],
            pairingTopic: k,
            proposer: {
              publicKey: F,
              metadata: this.client.metadata
            },
            expiryTimestamp: _i(Ki.wc_sessionPropose.req.ttl)
          },
          {
            done: Y,
            resolve: U,
            reject: I
          } = y0(V, "Request expired"),
          g = async ({
            error: E,
            session: S
          }) => {
            if (this.events.off(Tr("session_request", p), u), E) I(E);
            else if (S) {
              S.self.publicKey = F, await this.client.session.set(S.topic, S), await this.setExpiry(S.topic, S.expiry), k && await this.client.core.pairing.updateMetadata({
                topic: k,
                metadata: S.peer.metadata
              });
              const _ = this.client.session.get(S.topic);
              await this.deleteProposal(v), U({
                session: _
              })
            }
          }, u = async E => {
            var S, _, y;
            if (await this.deletePendingAuthRequest(p, {
                message: "fulfilled",
                code: 0
              }), E.error) {
              const ee = nn("WC_METHOD_UNSUPPORTED", "wc_sessionAuthenticate");
              return E.error.code === ee.code ? void 0 : (this.events.off(Tr("session_connect"), g), I(E.error.message))
            }
            await this.deleteProposal(v), this.events.off(Tr("session_connect"), g);
            const {
              cacaos: A,
              responder: G
            } = E.result, ce = [], W = [];
            for (const ee of A) {
              await RL({
                cacao: ee,
                projectId: this.client.core.projectId
              }) || (this.client.logger.error(ee, "Signature verification failed"), I(nn("SESSION_SETTLEMENT_FAILED", "Signature verification failed")));
              const {
                p: ne
              } = ee, O = f4(ne.resources), H = [kL(ne.iss)], Q = lv(ne.iss);
              if (O) {
                const de = ML(O),
                  ge = PL(O);
                ce.push(...de), H.push(...ge)
              }
              for (const de of H) W.push(`${de}:${Q}`)
            }
            const X = await this.client.core.crypto.generateSharedKey(F, G.publicKey);
            let Z;
            ce.length > 0 && (Z = {
              topic: X,
              acknowledged: !0,
              self: {
                publicKey: F,
                metadata: this.client.metadata
              },
              peer: G,
              controller: G.publicKey,
              expiry: _i(Ig),
              requiredNamespaces: {},
              optionalNamespaces: {},
              relay: {
                protocol: "irn"
              },
              pairingTopic: k,
              namespaces: KL([...new Set(ce)], [...new Set(W)]),
              transportType: o
            }, await this.client.core.relayer.subscribe(X, {
              transportType: o
            }), await this.client.session.set(X, Z), k && await this.client.core.pairing.updateMetadata({
              topic: k,
              metadata: G.metadata
            }), Z = this.client.session.get(X)), (S = this.client.metadata.redirect) != null && S.linkMode && (_ = G.metadata.redirect) != null && _.linkMode && (y = G.metadata.redirect) != null && y.universal && n && (this.client.core.addLinkModeSupportedApp(G.metadata.redirect.universal), this.client.session.update(X, {
              transportType: un.link_mode
            })), U({
              auths: A,
              session: Z
            })
          }, p = Rh(), v = Rh();
        this.events.once(Tr("session_connect"), g), this.events.once(Tr("session_request", p), u);
        let x;
        try {
          if (s) {
            const E = Nh("wc_sessionAuthenticate", R, p);
            this.client.core.history.set(k, E);
            const S = await this.client.core.crypto.encode("", E, {
              type: fv,
              encoding: dv
            });
            x = g4(n, k, S)
          } else await Promise.all([this.sendRequest({
            topic: k,
            method: "wc_sessionAuthenticate",
            params: R,
            expiry: r.expiry,
            throwOnFailedPublish: !0,
            clientRpcId: p
          }), this.sendRequest({
            topic: k,
            method: "wc_sessionPropose",
            params: j,
            expiry: Ki.wc_sessionPropose.req.ttl,
            throwOnFailedPublish: !0,
            clientRpcId: v
          })])
        } catch (E) {
          throw this.events.off(Tr("session_connect"), g), this.events.off(Tr("session_request", p), u), E
        }
        return await this.setProposal(v, Zn({
          id: v
        }, j)), await this.setAuthRequest(p, {
          request: Ac(Zn({}, R), {
            verifyContext: {}
          }),
          pairingTopic: k,
          transportType: o
        }), {
          uri: x ?? B,
          response: Y
        }
      }, this.approveSessionAuthenticate = async r => {
        const {
          id: n,
          auths: i
        } = r, s = this.client.core.eventClient.createEvent({
          properties: {
            topic: n.toString(),
            trace: [T0.authenticated_session_approve_started]
          }
        });
        try {
          this.isInitialized()
        } catch (N) {
          throw s.setError(Cv.no_internet_connection), N
        }
        const o = this.getPendingAuthRequest(n);
        if (!o) throw s.setError(Cv.authenticated_session_pending_request_not_found), new Error(`Could not find pending auth request with id ${n}`);
        const a = o.transportType || un.relay;
        a === un.relay && await this.confirmOnlineStateOrThrow();
        const c = o.requester.publicKey,
          l = await this.client.core.crypto.generateKeyPair(),
          h = p4(c),
          f = {
            type: Qu,
            receiverPublicKey: c,
            senderPublicKey: l
          },
          w = [],
          b = [];
        for (const N of i) {
          if (!await RL({
              cacao: N,
              projectId: this.client.core.projectId
            })) {
            s.setError(Cv.invalid_cacao);
            const D = nn("SESSION_SETTLEMENT_FAILED", "Signature verification failed");
            throw await this.sendError({
              id: n,
              topic: h,
              error: D,
              encodeOpts: f
            }), new Error(D.message)
          }
          s.addTrace(T0.cacaos_verified);
          const {
            p: $
          } = N, k = f4($.resources), B = [kL($.iss)], F = lv($.iss);
          if (k) {
            const D = ML(k),
              V = PL(k);
            w.push(...D), B.push(...V)
          }
          for (const D of B) b.push(`${D}:${F}`)
        }
        const C = await this.client.core.crypto.generateSharedKey(l, c);
        s.addTrace(T0.create_authenticated_session_topic);
        let M;
        if (w?.length > 0) {
          M = {
            topic: C,
            acknowledged: !0,
            self: {
              publicKey: l,
              metadata: this.client.metadata
            },
            peer: {
              publicKey: c,
              metadata: o.requester.metadata
            },
            controller: c,
            expiry: _i(Ig),
            authentication: i,
            requiredNamespaces: {},
            optionalNamespaces: {},
            relay: {
              protocol: "irn"
            },
            pairingTopic: o.pairingTopic,
            namespaces: KL([...new Set(w)], [...new Set(b)]),
            transportType: a
          }, s.addTrace(T0.subscribing_authenticated_session_topic);
          try {
            await this.client.core.relayer.subscribe(C, {
              transportType: a
            })
          } catch (N) {
            throw s.setError(Cv.subscribe_authenticated_session_topic_failure), N
          }
          s.addTrace(T0.subscribe_authenticated_session_topic_success), await this.client.session.set(C, M), s.addTrace(T0.store_authenticated_session), await this.client.core.pairing.updateMetadata({
            topic: o.pairingTopic,
            metadata: o.requester.metadata
          })
        }
        s.addTrace(T0.publishing_authenticated_session_approve);
        try {
          await this.sendResult({
            topic: h,
            id: n,
            result: {
              cacaos: i,
              responder: {
                publicKey: l,
                metadata: this.client.metadata
              }
            },
            encodeOpts: f,
            throwOnFailedPublish: !0,
            appLink: this.getAppLinkIfEnabled(o.requester.metadata, a)
          })
        } catch (N) {
          throw s.setError(Cv.authenticated_session_approve_publish_failure), N
        }
        return await this.client.auth.requests.delete(n, {
          message: "fulfilled",
          code: 0
        }), await this.client.core.pairing.activate({
          topic: o.pairingTopic
        }), this.client.core.eventClient.deleteEvent({
          eventId: s.eventId
        }), {
          session: M
        }
      }, this.rejectSessionAuthenticate = async r => {
        this.isInitialized();
        const {
          id: n,
          reason: i
        } = r, s = this.getPendingAuthRequest(n);
        if (!s) throw new Error(`Could not find pending auth request with id ${n}`);
        s.transportType === un.relay && await this.confirmOnlineStateOrThrow();
        const o = s.requester.publicKey,
          a = await this.client.core.crypto.generateKeyPair(),
          c = p4(o),
          l = {
            type: Qu,
            receiverPublicKey: o,
            senderPublicKey: a
          };
        await this.sendError({
          id: n,
          topic: c,
          error: i,
          encodeOpts: l,
          rpcOpts: Ki.wc_sessionAuthenticate.reject,
          appLink: this.getAppLinkIfEnabled(s.requester.metadata, s.transportType)
        }), await this.client.auth.requests.delete(n, {
          message: "rejected",
          code: 0
        }), await this.client.proposal.delete(n, nn("USER_DISCONNECTED"))
      }, this.formatAuthMessage = r => {
        this.isInitialized();
        const {
          request: n,
          iss: i
        } = r;
        return uE(n, i)
      }, this.processRelayMessageCache = () => {
        setTimeout(async () => {
          if (this.relayMessageCache.length !== 0)
            for (; this.relayMessageCache.length > 0;) try {
              const r = this.relayMessageCache.shift();
              r && await this.onRelayMessage(r)
            } catch (r) {
              this.client.logger.error(r)
            }
        }, 50)
      }, this.cleanupDuplicatePairings = async r => {
        if (r.pairingTopic) try {
          const n = this.client.core.pairing.pairings.get(r.pairingTopic),
            i = this.client.core.pairing.pairings.getAll().filter(s => {
              var o, a;
              return ((o = s.peerMetadata) == null ? void 0 : o.url) && ((a = s.peerMetadata) == null ? void 0 : a.url) === r.peer.metadata.url && s.topic && s.topic !== n.topic
            });
          if (i.length === 0) return;
          this.client.logger.info(`Cleaning up ${i.length} duplicate pairing(s)`), await Promise.all(i.map(s => this.client.core.pairing.disconnect({
            topic: s.topic
          }))), this.client.logger.info("Duplicate pairings clean up finished")
        } catch (n) {
          this.client.logger.error(n)
        }
      }, this.deleteSession = async r => {
        var n;
        const {
          topic: i,
          expirerHasDeleted: s = !1,
          emitEvent: o = !0,
          id: a = 0
        } = r, {
          self: c
        } = this.client.session.get(i);
        await this.client.core.relayer.unsubscribe(i), await this.client.session.delete(i, nn("USER_DISCONNECTED")), this.addToRecentlyDeleted(i, "session"), this.client.core.crypto.keychain.has(c.publicKey) && await this.client.core.crypto.deleteKeyPair(c.publicKey), this.client.core.crypto.keychain.has(i) && await this.client.core.crypto.deleteSymKey(i), s || this.client.core.expirer.del(i), this.client.core.storage.removeItem(XB).catch(l => this.client.logger.warn(l)), this.getPendingSessionRequests().forEach(l => {
          l.topic === i && this.deletePendingSessionRequest(l.id, nn("USER_DISCONNECTED"))
        }), i === ((n = this.sessionRequestQueue.queue[0]) == null ? void 0 : n.topic) && (this.sessionRequestQueue.state = jl.idle), o && this.client.events.emit("session_delete", {
          id: a,
          topic: i
        })
      }, this.deleteProposal = async (r, n) => {
        if (n) try {
          const i = this.client.proposal.get(r);
          this.client.core.eventClient.getEvent({
            topic: i.pairingTopic
          })?.setError(I0.proposal_expired)
        } catch {}
        await Promise.all([this.client.proposal.delete(r, nn("USER_DISCONNECTED")), n ? Promise.resolve() : this.client.core.expirer.del(r)]), this.addToRecentlyDeleted(r, "proposal")
      }, this.deletePendingSessionRequest = async (r, n, i = !1) => {
        await Promise.all([this.client.pendingRequest.delete(r, n), i ? Promise.resolve() : this.client.core.expirer.del(r)]), this.addToRecentlyDeleted(r, "request"), this.sessionRequestQueue.queue = this.sessionRequestQueue.queue.filter(s => s.id !== r), i && (this.sessionRequestQueue.state = jl.idle, this.client.events.emit("session_request_expire", {
          id: r
        }))
      }, this.deletePendingAuthRequest = async (r, n, i = !1) => {
        await Promise.all([this.client.auth.requests.delete(r, n), i ? Promise.resolve() : this.client.core.expirer.del(r)])
      }, this.setExpiry = async (r, n) => {
        this.client.session.keys.includes(r) && (this.client.core.expirer.set(r, n), await this.client.session.update(r, {
          expiry: n
        }))
      }, this.setProposal = async (r, n) => {
        this.client.core.expirer.set(r, _i(Ki.wc_sessionPropose.req.ttl)), await this.client.proposal.set(r, n)
      }, this.setAuthRequest = async (r, n) => {
        const {
          request: i,
          pairingTopic: s,
          transportType: o = un.relay
        } = n;
        this.client.core.expirer.set(r, i.expiryTimestamp), await this.client.auth.requests.set(r, {
          authPayload: i.authPayload,
          requester: i.requester,
          expiryTimestamp: i.expiryTimestamp,
          id: r,
          pairingTopic: s,
          verifyContext: i.verifyContext,
          transportType: o
        })
      }, this.setPendingSessionRequest = async r => {
        const {
          id: n,
          topic: i,
          params: s,
          verifyContext: o
        } = r, a = s.request.expiryTimestamp || _i(Ki.wc_sessionRequest.req.ttl);
        this.client.core.expirer.set(n, a), await this.client.pendingRequest.set(n, {
          id: n,
          topic: i,
          params: s,
          verifyContext: o
        })
      }, this.sendRequest = async r => {
        const {
          topic: n,
          method: i,
          params: s,
          expiry: o,
          relayRpcId: a,
          clientRpcId: c,
          throwOnFailedPublish: l,
          appLink: h
        } = r, f = Nh(i, s, c);
        let w;
        const b = !!h;
        try {
          const N = b ? dv : kh;
          w = await this.client.core.crypto.encode(n, f, {
            encoding: N
          })
        } catch (N) {
          throw await this.cleanup(), this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${n} failed`), N
        }
        let C;
        if (zye.includes(i)) {
          const N = Ju(JSON.stringify(f)),
            $ = Ju(w);
          C = await this.client.core.verify.register({
            id: $,
            decryptedId: N
          })
        }
        const M = Ki[i].req;
        if (M.attestation = C, o && (M.ttl = o), a && (M.id = a), this.client.core.history.set(n, f), b) {
          const N = g4(h, n, w);
          await global.Linking.openURL(N, this.client.name)
        } else {
          const N = Ki[i].req;
          o && (N.ttl = o), a && (N.id = a), l ? (N.internal = Ac(Zn({}, N.internal), {
            throwOnFailedPublish: !0
          }), await this.client.core.relayer.publish(n, w, N)) : this.client.core.relayer.publish(n, w, N).catch($ => this.client.logger.error($))
        }
        return f.id
      }, this.sendResult = async r => {
        const {
          id: n,
          topic: i,
          result: s,
          throwOnFailedPublish: o,
          encodeOpts: a,
          appLink: c
        } = r, l = w4(n, s);
        let h;
        const f = c && typeof (global == null ? void 0 : global.Linking) < "u";
        try {
          const b = f ? dv : kh;
          h = await this.client.core.crypto.encode(i, l, Ac(Zn({}, a || {}), {
            encoding: b
          }))
        } catch (b) {
          throw await this.cleanup(), this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`), b
        }
        let w;
        try {
          w = await this.client.core.history.get(i, n)
        } catch (b) {
          throw this.client.logger.error(`sendResult() -> history.get(${i}, ${n}) failed`), b
        }
        if (f) {
          const b = g4(c, i, h);
          await global.Linking.openURL(b, this.client.name)
        } else {
          const b = Ki[w.request.method].res;
          o ? (b.internal = Ac(Zn({}, b.internal), {
            throwOnFailedPublish: !0
          }), await this.client.core.relayer.publish(i, h, b)) : this.client.core.relayer.publish(i, h, b).catch(C => this.client.logger.error(C))
        }
        await this.client.core.history.resolve(l)
      }, this.sendError = async r => {
        const {
          id: n,
          topic: i,
          error: s,
          encodeOpts: o,
          rpcOpts: a,
          appLink: c
        } = r, l = v4(n, s);
        let h;
        const f = c && typeof (global == null ? void 0 : global.Linking) < "u";
        try {
          const b = f ? dv : kh;
          h = await this.client.core.crypto.encode(i, l, Ac(Zn({}, o || {}), {
            encoding: b
          }))
        } catch (b) {
          throw await this.cleanup(), this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`), b
        }
        let w;
        try {
          w = await this.client.core.history.get(i, n)
        } catch (b) {
          throw this.client.logger.error(`sendError() -> history.get(${i}, ${n}) failed`), b
        }
        if (f) {
          const b = g4(c, i, h);
          await global.Linking.openURL(b, this.client.name)
        } else {
          const b = a || Ki[w.request.method].res;
          this.client.core.relayer.publish(i, h, b)
        }
        await this.client.core.history.resolve(l)
      }, this.cleanup = async () => {
        const r = [],
          n = [];
        this.client.session.getAll().forEach(i => {
          let s = !1;
          Eh(i.expiry) && (s = !0), this.client.core.crypto.keychain.has(i.topic) || (s = !0), s && r.push(i.topic)
        }), this.client.proposal.getAll().forEach(i => {
          Eh(i.expiryTimestamp) && n.push(i.id)
        }), await Promise.all([...r.map(i => this.deleteSession({
          topic: i
        })), ...n.map(i => this.deleteProposal(i))])
      }, this.onRelayEventRequest = async r => {
        this.requestQueue.queue.push(r), await this.processRequestsQueue()
      }, this.processRequestsQueue = async () => {
        if (this.requestQueue.state === jl.active) {
          this.client.logger.info("Request queue already active, skipping...");
          return
        }
        for (this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`); this.requestQueue.queue.length > 0;) {
          this.requestQueue.state = jl.active;
          const r = this.requestQueue.queue.shift();
          if (r) try {
            await this.processRequest(r)
          } catch (n) {
            this.client.logger.warn(n)
          }
        }
        this.requestQueue.state = jl.idle
      }, this.processRequest = async r => {
        const {
          topic: n,
          payload: i,
          attestation: s,
          transportType: o,
          encryptedId: a
        } = r, c = i.method;
        if (!this.shouldIgnorePairingRequest({
            topic: n,
            requestMethod: c
          })) switch (c) {
          case "wc_sessionPropose":
            return await this.onSessionProposeRequest({
              topic: n,
              payload: i,
              attestation: s,
              encryptedId: a
            });
          case "wc_sessionSettle":
            return await this.onSessionSettleRequest(n, i);
          case "wc_sessionUpdate":
            return await this.onSessionUpdateRequest(n, i);
          case "wc_sessionExtend":
            return await this.onSessionExtendRequest(n, i);
          case "wc_sessionPing":
            return await this.onSessionPingRequest(n, i);
          case "wc_sessionDelete":
            return await this.onSessionDeleteRequest(n, i);
          case "wc_sessionRequest":
            return await this.onSessionRequest({
              topic: n,
              payload: i,
              attestation: s,
              encryptedId: a,
              transportType: o
            });
          case "wc_sessionEvent":
            return await this.onSessionEventRequest(n, i);
          case "wc_sessionAuthenticate":
            return await this.onSessionAuthenticateRequest({
              topic: n,
              payload: i,
              attestation: s,
              encryptedId: a,
              transportType: o
            });
          default:
            return this.client.logger.info(`Unsupported request method ${c}`)
        }
      }, this.onRelayEventResponse = async r => {
        const {
          topic: n,
          payload: i,
          transportType: s
        } = r, o = (await this.client.core.history.get(n, i.id)).request.method;
        switch (o) {
          case "wc_sessionPropose":
            return this.onSessionProposeResponse(n, i, s);
          case "wc_sessionSettle":
            return this.onSessionSettleResponse(n, i);
          case "wc_sessionUpdate":
            return this.onSessionUpdateResponse(n, i);
          case "wc_sessionExtend":
            return this.onSessionExtendResponse(n, i);
          case "wc_sessionPing":
            return this.onSessionPingResponse(n, i);
          case "wc_sessionRequest":
            return this.onSessionRequestResponse(n, i);
          case "wc_sessionAuthenticate":
            return this.onSessionAuthenticateResponse(n, i);
          default:
            return this.client.logger.info(`Unsupported response method ${o}`)
        }
      }, this.onRelayEventUnknownPayload = r => {
        const {
          topic: n
        } = r, {
          message: i
        } = it("MISSING_OR_INVALID", `Decoded payload on topic ${n} is not identifiable as a JSON-RPC request or a response.`);
        throw new Error(i)
      }, this.shouldIgnorePairingRequest = r => {
        const {
          topic: n,
          requestMethod: i
        } = r, s = this.expectedPairingMethodMap.get(n);
        return !s || s.includes(i) ? !1 : !!(s.includes("wc_sessionAuthenticate") && this.client.events.listenerCount("session_authenticate") > 0)
      }, this.onSessionProposeRequest = async r => {
        const {
          topic: n,
          payload: i,
          attestation: s,
          encryptedId: o
        } = r, {
          params: a,
          id: c
        } = i;
        try {
          const l = this.client.core.eventClient.getEvent({
            topic: n
          });
          this.isValidConnect(Zn({}, i.params));
          const h = a.expiryTimestamp || _i(Ki.wc_sessionPropose.req.ttl),
            f = Zn({
              id: c,
              pairingTopic: n,
              expiryTimestamp: h
            }, a);
          await this.setProposal(c, f);
          const w = await this.getVerifyContext({
            attestationId: s,
            hash: Ju(JSON.stringify(i)),
            encryptedId: o,
            metadata: f.proposer.metadata
          });
          this.client.events.listenerCount("session_proposal") === 0 && (console.warn("No listener for session_proposal event"), l?.setError(td.proposal_listener_not_found)), l?.addTrace(Ul.emit_session_proposal), this.client.events.emit("session_proposal", {
            id: c,
            params: f,
            verifyContext: w
          })
        } catch (l) {
          await this.sendError({
            id: c,
            topic: n,
            error: l,
            rpcOpts: Ki.wc_sessionPropose.autoReject
          }), this.client.logger.error(l)
        }
      }, this.onSessionProposeResponse = async (r, n, i) => {
        const {
          id: s
        } = n;
        if (Dl(n)) {
          const {
            result: o
          } = n;
          this.client.logger.trace({
            type: "method",
            method: "onSessionProposeResponse",
            result: o
          });
          const a = this.client.proposal.get(s);
          this.client.logger.trace({
            type: "method",
            method: "onSessionProposeResponse",
            proposal: a
          });
          const c = a.proposer.publicKey;
          this.client.logger.trace({
            type: "method",
            method: "onSessionProposeResponse",
            selfPublicKey: c
          });
          const l = o.responderPublicKey;
          this.client.logger.trace({
            type: "method",
            method: "onSessionProposeResponse",
            peerPublicKey: l
          });
          const h = await this.client.core.crypto.generateSharedKey(c, l);
          this.client.logger.trace({
            type: "method",
            method: "onSessionProposeResponse",
            sessionTopic: h
          });
          const f = await this.client.core.relayer.subscribe(h, {
            transportType: i
          });
          this.client.logger.trace({
            type: "method",
            method: "onSessionProposeResponse",
            subscriptionId: f
          }), await this.client.core.pairing.activate({
            topic: r
          })
        } else if (Aa(n)) {
          await this.client.proposal.delete(s, nn("USER_DISCONNECTED"));
          const o = Tr("session_connect");
          if (this.events.listenerCount(o) === 0) throw new Error(`emitting ${o} without any listeners, 954`);
          this.events.emit(Tr("session_connect"), {
            error: n.error
          })
        }
      }, this.onSessionSettleRequest = async (r, n) => {
        const {
          id: i,
          params: s
        } = n;
        try {
          this.isValidSessionSettleRequest(s);
          const {
            relay: o,
            controller: a,
            expiry: c,
            namespaces: l,
            sessionProperties: h,
            sessionConfig: f
          } = n.params, w = Ac(Zn(Zn({
            topic: r,
            relay: o,
            expiry: c,
            namespaces: l,
            acknowledged: !0,
            pairingTopic: "",
            requiredNamespaces: {},
            optionalNamespaces: {},
            controller: a.publicKey,
            self: {
              publicKey: "",
              metadata: this.client.metadata
            },
            peer: {
              publicKey: a.publicKey,
              metadata: a.metadata
            }
          }, h && {
            sessionProperties: h
          }), f && {
            sessionConfig: f
          }), {
            transportType: un.relay
          }), b = Tr("session_connect");
          if (this.events.listenerCount(b) === 0) throw new Error(`emitting ${b} without any listeners 997`);
          this.events.emit(Tr("session_connect"), {
            session: w
          }), await this.sendResult({
            id: n.id,
            topic: r,
            result: !0,
            throwOnFailedPublish: !0
          })
        } catch (o) {
          await this.sendError({
            id: i,
            topic: r,
            error: o
          }), this.client.logger.error(o)
        }
      }, this.onSessionSettleResponse = async (r, n) => {
        const {
          id: i
        } = n;
        Dl(n) ? (await this.client.session.update(r, {
          acknowledged: !0
        }), this.events.emit(Tr("session_approve", i), {})) : Aa(n) && (await this.client.session.delete(r, nn("USER_DISCONNECTED")), this.events.emit(Tr("session_approve", i), {
          error: n.error
        }))
      }, this.onSessionUpdateRequest = async (r, n) => {
        const {
          params: i,
          id: s
        } = n;
        try {
          const o = `${r}_session_update`,
            a = bv.get(o);
          if (a && this.isRequestOutOfSync(a, s)) {
            this.client.logger.info(`Discarding out of sync request - ${s}`), this.sendError({
              id: s,
              topic: r,
              error: nn("INVALID_UPDATE_REQUEST")
            });
            return
          }
          this.isValidUpdate(Zn({
            topic: r
          }, i));
          try {
            bv.set(o, s), await this.client.session.update(r, {
              namespaces: i.namespaces
            }), await this.sendResult({
              id: s,
              topic: r,
              result: !0,
              throwOnFailedPublish: !0
            })
          } catch (c) {
            throw bv.delete(o), c
          }
          this.client.events.emit("session_update", {
            id: s,
            topic: r,
            params: i
          })
        } catch (o) {
          await this.sendError({
            id: s,
            topic: r,
            error: o
          }), this.client.logger.error(o)
        }
      }, this.isRequestOutOfSync = (r, n) => parseInt(n.toString().slice(0, -3)) <= parseInt(r.toString().slice(0, -3)), this.onSessionUpdateResponse = (r, n) => {
        const {
          id: i
        } = n, s = Tr("session_update", i);
        if (this.events.listenerCount(s) === 0) throw new Error(`emitting ${s} without any listeners`);
        Dl(n) ? this.events.emit(Tr("session_update", i), {}) : Aa(n) && this.events.emit(Tr("session_update", i), {
          error: n.error
        })
      }, this.onSessionExtendRequest = async (r, n) => {
        const {
          id: i
        } = n;
        try {
          this.isValidExtend({
            topic: r
          }), await this.setExpiry(r, _i(Ig)), await this.sendResult({
            id: i,
            topic: r,
            result: !0,
            throwOnFailedPublish: !0
          }), this.client.events.emit("session_extend", {
            id: i,
            topic: r
          })
        } catch (s) {
          await this.sendError({
            id: i,
            topic: r,
            error: s
          }), this.client.logger.error(s)
        }
      }, this.onSessionExtendResponse = (r, n) => {
        const {
          id: i
        } = n, s = Tr("session_extend", i);
        if (this.events.listenerCount(s) === 0) throw new Error(`emitting ${s} without any listeners`);
        Dl(n) ? this.events.emit(Tr("session_extend", i), {}) : Aa(n) && this.events.emit(Tr("session_extend", i), {
          error: n.error
        })
      }, this.onSessionPingRequest = async (r, n) => {
        const {
          id: i
        } = n;
        try {
          this.isValidPing({
            topic: r
          }), await this.sendResult({
            id: i,
            topic: r,
            result: !0,
            throwOnFailedPublish: !0
          }), this.client.events.emit("session_ping", {
            id: i,
            topic: r
          })
        } catch (s) {
          await this.sendError({
            id: i,
            topic: r,
            error: s
          }), this.client.logger.error(s)
        }
      }, this.onSessionPingResponse = (r, n) => {
        const {
          id: i
        } = n, s = Tr("session_ping", i);
        if (this.events.listenerCount(s) === 0) throw new Error(`emitting ${s} without any listeners`);
        setTimeout(() => {
          Dl(n) ? this.events.emit(Tr("session_ping", i), {}) : Aa(n) && this.events.emit(Tr("session_ping", i), {
            error: n.error
          })
        }, 500)
      }, this.onSessionDeleteRequest = async (r, n) => {
        const {
          id: i
        } = n;
        try {
          this.isValidDisconnect({
            topic: r,
            reason: n.params
          }), Promise.all([new Promise(s => {
            this.client.core.relayer.once(Bs.publish, async () => {
              s(await this.deleteSession({
                topic: r,
                id: i
              }))
            })
          }), this.sendResult({
            id: i,
            topic: r,
            result: !0,
            throwOnFailedPublish: !0
          }), this.cleanupPendingSentRequestsForTopic({
            topic: r,
            error: nn("USER_DISCONNECTED")
          })]).catch(s => this.client.logger.error(s))
        } catch (s) {
          this.client.logger.error(s)
        }
      }, this.onSessionRequest = async r => {
        var n, i, s;
        const {
          topic: o,
          payload: a,
          attestation: c,
          encryptedId: l,
          transportType: h
        } = r, {
          id: f,
          params: w
        } = a;
        try {
          await this.isValidRequest(Zn({
            topic: o
          }, w));
          const b = this.client.session.get(o),
            C = await this.getVerifyContext({
              attestationId: c,
              hash: Ju(JSON.stringify(Nh("wc_sessionRequest", w, f))),
              encryptedId: l,
              metadata: b.peer.metadata,
              transportType: h
            }),
            M = {
              id: f,
              topic: o,
              params: w,
              verifyContext: C
            };
          await this.setPendingSessionRequest(M), h === un.link_mode && (n = b.peer.metadata.redirect) != null && n.universal && this.client.core.addLinkModeSupportedApp((i = b.peer.metadata.redirect) == null ? void 0 : i.universal), (s = this.client.signConfig) != null && s.disableRequestQueue ? this.emitSessionRequest(M) : (this.addSessionRequestToSessionRequestQueue(M), this.processSessionRequestQueue())
        } catch (b) {
          await this.sendError({
            id: f,
            topic: o,
            error: b
          }), this.client.logger.error(b)
        }
      }, this.onSessionRequestResponse = (r, n) => {
        const {
          id: i
        } = n, s = Tr("session_request", i);
        if (this.events.listenerCount(s) === 0) throw new Error(`emitting ${s} without any listeners`);
        Dl(n) ? this.events.emit(Tr("session_request", i), {
          result: n.result
        }) : Aa(n) && this.events.emit(Tr("session_request", i), {
          error: n.error
        })
      }, this.onSessionEventRequest = async (r, n) => {
        const {
          id: i,
          params: s
        } = n;
        try {
          const o = `${r}_session_event_${s.event.name}`,
            a = bv.get(o);
          if (a && this.isRequestOutOfSync(a, i)) {
            this.client.logger.info(`Discarding out of sync request - ${i}`);
            return
          }
          this.isValidEmit(Zn({
            topic: r
          }, s)), this.client.events.emit("session_event", {
            id: i,
            topic: r,
            params: s
          }), bv.set(o, i)
        } catch (o) {
          await this.sendError({
            id: i,
            topic: r,
            error: o
          }), this.client.logger.error(o)
        }
      }, this.onSessionAuthenticateResponse = (r, n) => {
        const {
          id: i
        } = n;
        this.client.logger.trace({
          type: "method",
          method: "onSessionAuthenticateResponse",
          topic: r,
          payload: n
        }), Dl(n) ? this.events.emit(Tr("session_request", i), {
          result: n.result
        }) : Aa(n) && this.events.emit(Tr("session_request", i), {
          error: n.error
        })
      }, this.onSessionAuthenticateRequest = async r => {
        var n;
        const {
          topic: i,
          payload: s,
          attestation: o,
          encryptedId: a,
          transportType: c
        } = r;
        try {
          const {
            requester: l,
            authPayload: h,
            expiryTimestamp: f
          } = s.params, w = await this.getVerifyContext({
            attestationId: o,
            hash: Ju(JSON.stringify(s)),
            encryptedId: a,
            metadata: l.metadata,
            transportType: c
          }), b = {
            requester: l,
            pairingTopic: i,
            id: s.id,
            authPayload: h,
            verifyContext: w,
            expiryTimestamp: f
          };
          await this.setAuthRequest(s.id, {
            request: b,
            pairingTopic: i,
            transportType: c
          }), c === un.link_mode && (n = l.metadata.redirect) != null && n.universal && this.client.core.addLinkModeSupportedApp(l.metadata.redirect.universal), this.client.events.emit("session_authenticate", {
            topic: i,
            params: s.params,
            id: s.id,
            verifyContext: w
          })
        } catch (l) {
          this.client.logger.error(l);
          const h = s.params.requester.publicKey,
            f = await this.client.core.crypto.generateKeyPair(),
            w = this.getAppLinkIfEnabled(s.params.requester.metadata, c),
            b = {
              type: Qu,
              receiverPublicKey: h,
              senderPublicKey: f
            };
          await this.sendError({
            id: s.id,
            topic: i,
            error: l,
            encodeOpts: b,
            rpcOpts: Ki.wc_sessionAuthenticate.autoReject,
            appLink: w
          })
        }
      }, this.addSessionRequestToSessionRequestQueue = r => {
        this.sessionRequestQueue.queue.push(r)
      }, this.cleanupAfterResponse = r => {
        this.deletePendingSessionRequest(r.response.id, {
          message: "fulfilled",
          code: 0
        }), setTimeout(() => {
          this.sessionRequestQueue.state = jl.idle, this.processSessionRequestQueue()
        }, at.toMiliseconds(this.requestQueueDelay))
      }, this.cleanupPendingSentRequestsForTopic = ({
        topic: r,
        error: n
      }) => {
        const i = this.client.core.history.pending;
        i.length > 0 && i.filter(s => s.topic === r && s.request.method === "wc_sessionRequest").forEach(s => {
          const o = s.request.id,
            a = Tr("session_request", o);
          if (this.events.listenerCount(a) === 0) throw new Error(`emitting ${a} without any listeners`);
          this.events.emit(Tr("session_request", s.request.id), {
            error: n
          })
        })
      }, this.processSessionRequestQueue = () => {
        if (this.sessionRequestQueue.state === jl.active) {
          this.client.logger.info("session request queue is already active.");
          return
        }
        const r = this.sessionRequestQueue.queue[0];
        if (!r) {
          this.client.logger.info("session request queue is empty.");
          return
        }
        try {
          this.sessionRequestQueue.state = jl.active, this.emitSessionRequest(r)
        } catch (n) {
          this.client.logger.error(n)
        }
      }, this.emitSessionRequest = r => {
        this.client.events.emit("session_request", r)
      }, this.onPairingCreated = r => {
        if (r.methods && this.expectedPairingMethodMap.set(r.topic, r.methods), r.active) return;
        const n = this.client.proposal.getAll().find(i => i.pairingTopic === r.topic);
        n && this.onSessionProposeRequest({
          topic: r.topic,
          payload: Nh("wc_sessionPropose", {
            requiredNamespaces: n.requiredNamespaces,
            optionalNamespaces: n.optionalNamespaces,
            relays: n.relays,
            proposer: n.proposer,
            sessionProperties: n.sessionProperties
          }, n.id)
        })
      }, this.isValidConnect = async r => {
        if (!vo(r)) {
          const {
            message: c
          } = it("MISSING_OR_INVALID", `connect() params: ${JSON.stringify(r)}`);
          throw new Error(c)
        }
        const {
          pairingTopic: n,
          requiredNamespaces: i,
          optionalNamespaces: s,
          sessionProperties: o,
          relays: a
        } = r;
        if (wo(n) || await this.isValidPairingTopic(n), !cve(a)) {
          const {
            message: c
          } = it("MISSING_OR_INVALID", `connect() relays: ${a}`);
          throw new Error(c)
        }!wo(i) && vv(i) !== 0 && this.validateNamespaces(i, "requiredNamespaces"), !wo(s) && vv(s) !== 0 && this.validateNamespaces(s, "optionalNamespaces"), wo(o) || this.validateSessionProps(o, "sessionProperties")
      }, this.validateNamespaces = (r, n) => {
        const i = ave(r, "connect()", n);
        if (i) throw new Error(i.message)
      }, this.isValidApprove = async r => {
        if (!vo(r)) throw new Error(it("MISSING_OR_INVALID", `approve() params: ${r}`).message);
        const {
          id: n,
          namespaces: i,
          relayProtocol: s,
          sessionProperties: o
        } = r;
        this.checkRecentlyDeleted(n), await this.isValidProposalId(n);
        const a = this.client.proposal.get(n),
          c = mE(i, "approve()");
        if (c) throw new Error(c.message);
        const l = JL(a.requiredNamespaces, i, "approve()");
        if (l) throw new Error(l.message);
        if (!si(s, !0)) {
          const {
            message: h
          } = it("MISSING_OR_INVALID", `approve() relayProtocol: ${s}`);
          throw new Error(h)
        }
        wo(o) || this.validateSessionProps(o, "sessionProperties")
      }, this.isValidReject = async r => {
        if (!vo(r)) {
          const {
            message: s
          } = it("MISSING_OR_INVALID", `reject() params: ${r}`);
          throw new Error(s)
        }
        const {
          id: n,
          reason: i
        } = r;
        if (this.checkRecentlyDeleted(n), await this.isValidProposalId(n), !uve(i)) {
          const {
            message: s
          } = it("MISSING_OR_INVALID", `reject() reason: ${JSON.stringify(i)}`);
          throw new Error(s)
        }
      }, this.isValidSessionSettleRequest = r => {
        if (!vo(r)) {
          const {
            message: l
          } = it("MISSING_OR_INVALID", `onSessionSettleRequest() params: ${r}`);
          throw new Error(l)
        }
        const {
          relay: n,
          controller: i,
          namespaces: s,
          expiry: o
        } = r;
        if (!YL(n)) {
          const {
            message: l
          } = it("MISSING_OR_INVALID", "onSessionSettleRequest() relay protocol should be a string");
          throw new Error(l)
        }
        const a = tve(i, "onSessionSettleRequest()");
        if (a) throw new Error(a.message);
        const c = mE(s, "onSessionSettleRequest()");
        if (c) throw new Error(c.message);
        if (Eh(o)) {
          const {
            message: l
          } = it("EXPIRED", "onSessionSettleRequest()");
          throw new Error(l)
        }
      }, this.isValidUpdate = async r => {
        if (!vo(r)) {
          const {
            message: c
          } = it("MISSING_OR_INVALID", `update() params: ${r}`);
          throw new Error(c)
        }
        const {
          topic: n,
          namespaces: i
        } = r;
        this.checkRecentlyDeleted(n), await this.isValidSessionTopic(n);
        const s = this.client.session.get(n),
          o = mE(i, "update()");
        if (o) throw new Error(o.message);
        const a = JL(s.requiredNamespaces, i, "update()");
        if (a) throw new Error(a.message)
      }, this.isValidExtend = async r => {
        if (!vo(r)) {
          const {
            message: i
          } = it("MISSING_OR_INVALID", `extend() params: ${r}`);
          throw new Error(i)
        }
        const {
          topic: n
        } = r;
        this.checkRecentlyDeleted(n), await this.isValidSessionTopic(n)
      }, this.isValidRequest = async r => {
        if (!vo(r)) {
          const {
            message: c
          } = it("MISSING_OR_INVALID", `request() params: ${r}`);
          throw new Error(c)
        }
        const {
          topic: n,
          request: i,
          chainId: s,
          expiry: o
        } = r;
        this.checkRecentlyDeleted(n), await this.isValidSessionTopic(n);
        const {
          namespaces: a
        } = this.client.session.get(n);
        if (!QL(a, s)) {
          const {
            message: c
          } = it("MISSING_OR_INVALID", `request() chainId: ${s}`);
          throw new Error(c)
        }
        if (!dve(i)) {
          const {
            message: c
          } = it("MISSING_OR_INVALID", `request() ${JSON.stringify(i)}`);
          throw new Error(c)
        }
        if (!pve(a, s, i.method)) {
          const {
            message: c
          } = it("MISSING_OR_INVALID", `request() method: ${i.method}`);
          throw new Error(c)
        }
        if (o && !vve(o, kE)) {
          const {
            message: c
          } = it("MISSING_OR_INVALID", `request() expiry: ${o}. Expiry must be a number (in seconds) between ${kE.min} and ${kE.max}`);
          throw new Error(c)
        }
      }, this.isValidRespond = async r => {
        var n;
        if (!vo(r)) {
          const {
            message: o
          } = it("MISSING_OR_INVALID", `respond() params: ${r}`);
          throw new Error(o)
        }
        const {
          topic: i,
          response: s
        } = r;
        try {
          await this.isValidSessionTopic(i)
        } catch (o) {
          throw (n = r?.response) != null && n.id && this.cleanupAfterResponse(r), o
        }
        if (!hve(s)) {
          const {
            message: o
          } = it("MISSING_OR_INVALID", `respond() response: ${JSON.stringify(s)}`);
          throw new Error(o)
        }
      }, this.isValidPing = async r => {
        if (!vo(r)) {
          const {
            message: i
          } = it("MISSING_OR_INVALID", `ping() params: ${r}`);
          throw new Error(i)
        }
        const {
          topic: n
        } = r;
        await this.isValidSessionOrPairingTopic(n)
      }, this.isValidEmit = async r => {
        if (!vo(r)) {
          const {
            message: a
          } = it("MISSING_OR_INVALID", `emit() params: ${r}`);
          throw new Error(a)
        }
        const {
          topic: n,
          event: i,
          chainId: s
        } = r;
        await this.isValidSessionTopic(n);
        const {
          namespaces: o
        } = this.client.session.get(n);
        if (!QL(o, s)) {
          const {
            message: a
          } = it("MISSING_OR_INVALID", `emit() chainId: ${s}`);
          throw new Error(a)
        }
        if (!fve(i)) {
          const {
            message: a
          } = it("MISSING_OR_INVALID", `emit() event: ${JSON.stringify(i)}`);
          throw new Error(a)
        }
        if (!gve(o, s, i.name)) {
          const {
            message: a
          } = it("MISSING_OR_INVALID", `emit() event: ${JSON.stringify(i)}`);
          throw new Error(a)
        }
      }, this.isValidDisconnect = async r => {
        if (!vo(r)) {
          const {
            message: i
          } = it("MISSING_OR_INVALID", `disconnect() params: ${r}`);
          throw new Error(i)
        }
        const {
          topic: n
        } = r;
        await this.isValidSessionOrPairingTopic(n)
      }, this.isValidAuthenticate = r => {
        const {
          chains: n,
          uri: i,
          domain: s,
          nonce: o
        } = r;
        if (!Array.isArray(n) || n.length === 0) throw new Error("chains is required and must be a non-empty array");
        if (!si(i, !1)) throw new Error("uri is required parameter");
        if (!si(s, !1)) throw new Error("domain is required parameter");
        if (!si(o, !1)) throw new Error("nonce is required parameter");
        if ([...new Set(n.map(c => J2(c).namespace))].length > 1) throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");
        const {
          namespace: a
        } = J2(n[0]);
        if (a !== "eip155") throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")
      }, this.getVerifyContext = async r => {
        const {
          attestationId: n,
          hash: i,
          encryptedId: s,
          metadata: o,
          transportType: a
        } = r, c = {
          verified: {
            verifyUrl: o.verifyUrl || xv,
            validation: "UNKNOWN",
            origin: o.url || ""
          }
        };
        try {
          if (a === un.link_mode) {
            const h = this.getAppLinkIfEnabled(o, a);
            return c.verified.validation = h && new URL(h).origin === new URL(o.url).origin ? "VALID" : "INVALID", c
          }
          const l = await this.client.core.verify.resolve({
            attestationId: n,
            hash: i,
            encryptedId: s,
            verifyUrl: o.verifyUrl
          });
          l && (c.verified.origin = l.origin, c.verified.isScam = l.isScam, c.verified.validation = l.origin === new URL(o.url).origin ? "VALID" : "INVALID")
        } catch (l) {
          this.client.logger.warn(l)
        }
        return this.client.logger.debug(`Verify context: ${JSON.stringify(c)}`), c
      }, this.validateSessionProps = (r, n) => {
        Object.values(r).forEach(i => {
          if (!si(i, !1)) {
            const {
              message: s
            } = it("MISSING_OR_INVALID", `${n} must be in Record<string, string> format. Received: ${JSON.stringify(i)}`);
            throw new Error(s)
          }
        })
      }, this.getPendingAuthRequest = r => {
        const n = this.client.auth.requests.get(r);
        return typeof n == "object" ? n : void 0
      }, this.addToRecentlyDeleted = (r, n) => {
        if (this.recentlyDeletedMap.set(r, n), this.recentlyDeletedMap.size >= this.recentlyDeletedLimit) {
          let i = 0;
          const s = this.recentlyDeletedLimit / 2;
          for (const o of this.recentlyDeletedMap.keys()) {
            if (i++ >= s) break;
            this.recentlyDeletedMap.delete(o)
          }
        }
      }, this.checkRecentlyDeleted = r => {
        const n = this.recentlyDeletedMap.get(r);
        if (n) {
          const {
            message: i
          } = it("MISSING_OR_INVALID", `Record was recently deleted - ${n}: ${r}`);
          throw new Error(i)
        }
      }, this.isLinkModeEnabled = (r, n) => {
        var i, s, o, a, c, l, h, f, w;
        return !r || n !== un.link_mode ? !1 : ((s = (i = this.client.metadata) == null ? void 0 : i.redirect) == null ? void 0 : s.linkMode) === !0 && ((a = (o = this.client.metadata) == null ? void 0 : o.redirect) == null ? void 0 : a.universal) !== void 0 && ((l = (c = this.client.metadata) == null ? void 0 : c.redirect) == null ? void 0 : l.universal) !== "" && ((h = r?.redirect) == null ? void 0 : h.universal) !== void 0 && ((f = r?.redirect) == null ? void 0 : f.universal) !== "" && ((w = r?.redirect) == null ? void 0 : w.linkMode) === !0 && this.client.core.linkModeSupportedApps.includes(r.redirect.universal) && typeof (global == null ? void 0 : global.Linking) < "u"
      }, this.getAppLinkIfEnabled = (r, n) => {
        var i;
        return this.isLinkModeEnabled(r, n) ? (i = r?.redirect) == null ? void 0 : i.universal : void 0
      }, this.handleLinkModeMessage = ({
        url: r
      }) => {
        if (!r || !r.includes("wc_ev") || !r.includes("topic")) return;
        const n = xD(r, "topic") || "",
          i = decodeURIComponent(xD(r, "wc_ev") || ""),
          s = this.client.session.keys.includes(n);
        s && this.client.session.update(n, {
          transportType: un.link_mode
        }), this.client.core.dispatchEnvelope({
          topic: n,
          message: i,
          sessionExists: s
        })
      }, this.registerLinkModeListeners = async () => {
        var r;
        if (DC() || pg() && (r = this.client.metadata.redirect) != null && r.linkMode) {
          const n = global == null ? void 0 : global.Linking;
          if (typeof n < "u") {
            n.addEventListener("url", this.handleLinkModeMessage, this.client.name);
            const i = await n.getInitialURL();
            i && setTimeout(() => {
              this.handleLinkModeMessage({
                url: i
              })
            }, 50)
          }
        }
      }
    }
    isInitialized() {
      if (!this.initialized) {
        const {
          message: e
        } = it("NOT_INITIALIZED", this.name);
        throw new Error(e)
      }
    }
    async confirmOnlineStateOrThrow() {
      await this.client.core.relayer.confirmOnlineStateOrThrow()
    }
    registerRelayerEvents() {
      this.client.core.relayer.on(Bs.message, e => {
        !this.initialized || this.relayMessageCache.length > 0 ? this.relayMessageCache.push(e) : this.onRelayMessage(e)
      })
    }
    async onRelayMessage(e) {
      const {
        topic: r,
        message: n,
        attestation: i,
        transportType: s
      } = e, {
        publicKey: o
      } = this.client.auth.authKeys.keys.includes(C4) ? this.client.auth.authKeys.get(C4) : {
        responseTopic: void 0,
        publicKey: void 0
      }, a = await this.client.core.crypto.decode(r, n, {
        receiverPublicKey: o,
        encoding: s === un.link_mode ? dv : kh
      });
      try {
        bE(a) ? (this.client.core.history.set(r, a), this.onRelayEventRequest({
          topic: r,
          payload: a,
          attestation: i,
          transportType: s,
          encryptedId: Ju(n)
        })) : b4(a) ? (await this.client.core.history.resolve(a), await this.onRelayEventResponse({
          topic: r,
          payload: a,
          transportType: s
        }), this.client.core.history.delete(r, a.id)) : this.onRelayEventUnknownPayload({
          topic: r,
          payload: a,
          transportType: s
        })
      } catch (c) {
        this.client.logger.error(c)
      }
    }
    registerExpirerEvents() {
      this.client.core.expirer.on(Ia.expired, async e => {
        const {
          topic: r,
          id: n
        } = _D(e.target);
        if (n && this.client.pendingRequest.keys.includes(n)) return await this.deletePendingSessionRequest(n, it("EXPIRED"), !0);
        if (n && this.client.auth.requests.keys.includes(n)) return await this.deletePendingAuthRequest(n, it("EXPIRED"), !0);
        r ? this.client.session.keys.includes(r) && (await this.deleteSession({
          topic: r,
          expirerHasDeleted: !0
        }), this.client.events.emit("session_expire", {
          topic: r
        })) : n && (await this.deleteProposal(n, !0), this.client.events.emit("proposal_expire", {
          id: n
        }))
      })
    }
    registerPairingEvents() {
      this.client.core.pairing.events.on(S0.create, e => this.onPairingCreated(e)), this.client.core.pairing.events.on(S0.delete, e => {
        this.addToRecentlyDeleted(e.topic, "pairing")
      })
    }
    isValidPairingTopic(e) {
      if (!si(e, !1)) {
        const {
          message: r
        } = it("MISSING_OR_INVALID", `pairing topic should be a string: ${e}`);
        throw new Error(r)
      }
      if (!this.client.core.pairing.pairings.keys.includes(e)) {
        const {
          message: r
        } = it("NO_MATCHING_KEY", `pairing topic doesn't exist: ${e}`);
        throw new Error(r)
      }
      if (Eh(this.client.core.pairing.pairings.get(e).expiry)) {
        const {
          message: r
        } = it("EXPIRED", `pairing topic: ${e}`);
        throw new Error(r)
      }
    }
    async isValidSessionTopic(e) {
      if (!si(e, !1)) {
        const {
          message: r
        } = it("MISSING_OR_INVALID", `session topic should be a string: ${e}`);
        throw new Error(r)
      }
      if (this.checkRecentlyDeleted(e), !this.client.session.keys.includes(e)) {
        const {
          message: r
        } = it("NO_MATCHING_KEY", `session topic doesn't exist: ${e}`);
        throw new Error(r)
      }
      if (Eh(this.client.session.get(e).expiry)) {
        await this.deleteSession({
          topic: e
        });
        const {
          message: r
        } = it("EXPIRED", `session topic: ${e}`);
        throw new Error(r)
      }
      if (!this.client.core.crypto.keychain.has(e)) {
        const {
          message: r
        } = it("MISSING_OR_INVALID", `session topic does not exist in keychain: ${e}`);
        throw await this.deleteSession({
          topic: e
        }), new Error(r)
      }
    }
    async isValidSessionOrPairingTopic(e) {
      if (this.checkRecentlyDeleted(e), this.client.session.keys.includes(e)) await this.isValidSessionTopic(e);
      else if (this.client.core.pairing.pairings.keys.includes(e)) this.isValidPairingTopic(e);
      else if (si(e, !1)) {
        const {
          message: r
        } = it("NO_MATCHING_KEY", `session or pairing topic doesn't exist: ${e}`);
        throw new Error(r)
      } else {
        const {
          message: r
        } = it("MISSING_OR_INVALID", `session or pairing topic should be a string: ${e}`);
        throw new Error(r)
      }
    }
    async isValidProposalId(e) {
      if (!lve(e)) {
        const {
          message: r
        } = it("MISSING_OR_INVALID", `proposal id should be a number: ${e}`);
        throw new Error(r)
      }
      if (!this.client.proposal.keys.includes(e)) {
        const {
          message: r
        } = it("NO_MATCHING_KEY", `proposal id doesn't exist: ${e}`);
        throw new Error(r)
      }
      if (Eh(this.client.proposal.get(e).expiryTimestamp)) {
        await this.deleteProposal(e);
        const {
          message: r
        } = it("EXPIRED", `proposal id: ${e}`);
        throw new Error(r)
      }
    }
  }
  class t5e extends k0 {
    constructor(e, r) {
      super(e, r, Uye, IE), this.core = e, this.logger = r
    }
  }
  class r5e extends k0 {
    constructor(e, r) {
      super(e, r, jye, IE), this.core = e, this.logger = r
    }
  }
  class n5e extends k0 {
    constructor(e, r) {
      super(e, r, Wye, IE, n => n.id), this.core = e, this.logger = r
    }
  }
  class i5e extends k0 {
    constructor(e, r) {
      super(e, r, Vye, x4, () => C4), this.core = e, this.logger = r
    }
  }
  class s5e extends k0 {
    constructor(e, r) {
      super(e, r, Kye, x4), this.core = e, this.logger = r
    }
  }
  class o5e extends k0 {
    constructor(e, r) {
      super(e, r, Gye, x4, n => n.id), this.core = e, this.logger = r
    }
  }
  class a5e {
    constructor(e, r) {
      this.core = e, this.logger = r, this.authKeys = new i5e(this.core, this.logger), this.pairingTopics = new s5e(this.core, this.logger), this.requests = new o5e(this.core, this.logger)
    }
    async init() {
      await this.authKeys.init(), await this.pairingTopics.init(), await this.requests.init()
    }
  }
  class RE extends khe {
    constructor(e) {
      super(e), this.protocol = YB, this.version = QB, this.name = TE.name, this.events = new Fi.EventEmitter, this.on = (n, i) => this.events.on(n, i), this.once = (n, i) => this.events.once(n, i), this.off = (n, i) => this.events.off(n, i), this.removeListener = (n, i) => this.events.removeListener(n, i), this.removeAllListeners = n => this.events.removeAllListeners(n), this.connect = async n => {
        try {
          return await this.engine.connect(n)
        } catch (i) {
          throw this.logger.error(i.message), i
        }
      }, this.pair = async n => {
        try {
          return await this.engine.pair(n)
        } catch (i) {
          throw this.logger.error(i.message), i
        }
      }, this.approve = async n => {
        try {
          return await this.engine.approve(n)
        } catch (i) {
          throw this.logger.error(i.message), i
        }
      }, this.reject = async n => {
        try {
          return await this.engine.reject(n)
        } catch (i) {
          throw this.logger.error(i.message), i
        }
      }, this.update = async n => {
        try {
          return await this.engine.update(n)
        } catch (i) {
          throw this.logger.error(i.message), i
        }
      }, this.extend = async n => {
        try {
          return await this.engine.extend(n)
        } catch (i) {
          throw this.logger.error(i.message), i
        }
      }, this.request = async n => {
        try {
          return await this.engine.request(n)
        } catch (i) {
          throw this.logger.error(i.message), i
        }
      }, this.respond = async n => {
        try {
          return await this.engine.respond(n)
        } catch (i) {
          throw this.logger.error(i.message), i
        }
      }, this.ping = async n => {
        try {
          return await this.engine.ping(n)
        } catch (i) {
          throw this.logger.error(i.message), i
        }
      }, this.emit = async n => {
        try {
          return await this.engine.emit(n)
        } catch (i) {
          throw this.logger.error(i.message), i
        }
      }, this.disconnect = async n => {
        try {
          return await this.engine.disconnect(n)
        } catch (i) {
          throw this.logger.error(i.message), i
        }
      }, this.find = n => {
        try {
          return this.engine.find(n)
        } catch (i) {
          throw this.logger.error(i.message), i
        }
      }, this.getPendingSessionRequests = () => {
        try {
          return this.engine.getPendingSessionRequests()
        } catch (n) {
          throw this.logger.error(n.message), n
        }
      }, this.authenticate = async (n, i) => {
        try {
          return await this.engine.authenticate(n, i)
        } catch (s) {
          throw this.logger.error(s.message), s
        }
      }, this.formatAuthMessage = n => {
        try {
          return this.engine.formatAuthMessage(n)
        } catch (i) {
          throw this.logger.error(i.message), i
        }
      }, this.approveSessionAuthenticate = async n => {
        try {
          return await this.engine.approveSessionAuthenticate(n)
        } catch (i) {
          throw this.logger.error(i.message), i
        }
      }, this.rejectSessionAuthenticate = async n => {
        try {
          return await this.engine.rejectSessionAuthenticate(n)
        } catch (i) {
          throw this.logger.error(i.message), i
        }
      }, this.name = e?.name || TE.name, this.metadata = e?.metadata || mD(), this.signConfig = e?.signConfig;
      const r = typeof e?.logger < "u" && typeof e?.logger != "string" ? e.logger : Zw(y1({
        level: e?.logger || TE.logger
      }));
      this.core = e?.core || new Bye(e), this.logger = bs(r, this.name), this.session = new r5e(this.core, this.logger), this.proposal = new t5e(this.core, this.logger), this.pendingRequest = new n5e(this.core, this.logger), this.engine = new e5e(this), this.auth = new a5e(this.core, this.logger)
    }
    static async init(e) {
      const r = new RE(e);
      return await r.initialize(), r
    }
    get context() {
      return so(this.logger)
    }
    get pairing() {
      return this.core.pairing.pairings
    }
    async initialize() {
      this.logger.trace("Initialized");
      try {
        await this.core.start(), await this.session.init(), await this.proposal.init(), await this.pendingRequest.init(), await this.auth.init(), await this.engine.init(), this.logger.info("SignClient Initialization Success"), this.engine.processRelayMessageCache()
      } catch (e) {
        throw this.logger.info("SignClient Initialization Failure"), this.logger.error(e.message), e
      }
    }
  }
  var NE = {
    exports: {}
  };
  (function (t, e) {
    var r = typeof self < "u" ? self : ot,
      n = function () {
        function s() {
          this.fetch = !1, this.DOMException = r.DOMException
        }
        return s.prototype = r, new s
      }();
    (function (s) {
      (function (o) {
        var a = {
          searchParams: "URLSearchParams" in s,
          iterable: "Symbol" in s && "iterator" in Symbol,
          blob: "FileReader" in s && "Blob" in s && function () {
            try {
              return new Blob, !0
            } catch {
              return !1
            }
          }(),
          formData: "FormData" in s,
          arrayBuffer: "ArrayBuffer" in s
        };

        function c(u) {
          return u && DataView.prototype.isPrototypeOf(u)
        }
        if (a.arrayBuffer) var l = ["[object Int8Array]", "[object Uint8Array]", "[object Uint8ClampedArray]", "[object Int16Array]", "[object Uint16Array]", "[object Int32Array]", "[object Uint32Array]", "[object Float32Array]", "[object Float64Array]"],
          h = ArrayBuffer.isView || function (u) {
            return u && l.indexOf(Object.prototype.toString.call(u)) > -1
          };

        function f(u) {
          if (typeof u != "string" && (u = String(u)), /[^a-z0-9\-#$%&'*+.^_`|~]/i.test(u)) throw new TypeError("Invalid character in header field name");
          return u.toLowerCase()
        }

        function w(u) {
          return typeof u != "string" && (u = String(u)), u
        }

        function b(u) {
          var p = {
            next: function () {
              var v = u.shift();
              return {
                done: v === void 0,
                value: v
              }
            }
          };
          return a.iterable && (p[Symbol.iterator] = function () {
            return p
          }), p
        }

        function C(u) {
          this.map = {}, u instanceof C ? u.forEach(function (p, v) {
            this.append(v, p)
          }, this) : Array.isArray(u) ? u.forEach(function (p) {
            this.append(p[0], p[1])
          }, this) : u && Object.getOwnPropertyNames(u).forEach(function (p) {
            this.append(p, u[p])
          }, this)
        }
        C.prototype.append = function (u, p) {
          u = f(u), p = w(p);
          var v = this.map[u];
          this.map[u] = v ? v + ", " + p : p
        }, C.prototype.delete = function (u) {
          delete this.map[f(u)]
        }, C.prototype.get = function (u) {
          return u = f(u), this.has(u) ? this.map[u] : null
        }, C.prototype.has = function (u) {
          return this.map.hasOwnProperty(f(u))
        }, C.prototype.set = function (u, p) {
          this.map[f(u)] = w(p)
        }, C.prototype.forEach = function (u, p) {
          for (var v in this.map) this.map.hasOwnProperty(v) && u.call(p, this.map[v], v, this)
        }, C.prototype.keys = function () {
          var u = [];
          return this.forEach(function (p, v) {
            u.push(v)
          }), b(u)
        }, C.prototype.values = function () {
          var u = [];
          return this.forEach(function (p) {
            u.push(p)
          }), b(u)
        }, C.prototype.entries = function () {
          var u = [];
          return this.forEach(function (p, v) {
            u.push([v, p])
          }), b(u)
        }, a.iterable && (C.prototype[Symbol.iterator] = C.prototype.entries);

        function M(u) {
          if (u.bodyUsed) return Promise.reject(new TypeError("Already read"));
          u.bodyUsed = !0
        }

        function N(u) {
          return new Promise(function (p, v) {
            u.onload = function () {
              p(u.result)
            }, u.onerror = function () {
              v(u.error)
            }
          })
        }

        function $(u) {
          var p = new FileReader,
            v = N(p);
          return p.readAsArrayBuffer(u), v
        }

        function k(u) {
          var p = new FileReader,
            v = N(p);
          return p.readAsText(u), v
        }

        function B(u) {
          for (var p = new Uint8Array(u), v = new Array(p.length), x = 0; x < p.length; x++) v[x] = String.fromCharCode(p[x]);
          return v.join("")
        }

        function F(u) {
          if (u.slice) return u.slice(0);
          var p = new Uint8Array(u.byteLength);
          return p.set(new Uint8Array(u)), p.buffer
        }

        function D() {
          return this.bodyUsed = !1, this._initBody = function (u) {
            this._bodyInit = u, u ? typeof u == "string" ? this._bodyText = u : a.blob && Blob.prototype.isPrototypeOf(u) ? this._bodyBlob = u : a.formData && FormData.prototype.isPrototypeOf(u) ? this._bodyFormData = u : a.searchParams && URLSearchParams.prototype.isPrototypeOf(u) ? this._bodyText = u.toString() : a.arrayBuffer && a.blob && c(u) ? (this._bodyArrayBuffer = F(u.buffer), this._bodyInit = new Blob([this._bodyArrayBuffer])) : a.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(u) || h(u)) ? this._bodyArrayBuffer = F(u) : this._bodyText = u = Object.prototype.toString.call(u) : this._bodyText = "", this.headers.get("content-type") || (typeof u == "string" ? this.headers.set("content-type", "text/plain;charset=UTF-8") : this._bodyBlob && this._bodyBlob.type ? this.headers.set("content-type", this._bodyBlob.type) : a.searchParams && URLSearchParams.prototype.isPrototypeOf(u) && this.headers.set("content-type", "application/x-www-form-urlencoded;charset=UTF-8"))
          }, a.blob && (this.blob = function () {
            var u = M(this);
            if (u) return u;
            if (this._bodyBlob) return Promise.resolve(this._bodyBlob);
            if (this._bodyArrayBuffer) return Promise.resolve(new Blob([this._bodyArrayBuffer]));
            if (this._bodyFormData) throw new Error("could not read FormData body as blob");
            return Promise.resolve(new Blob([this._bodyText]))
          }, this.arrayBuffer = function () {
            return this._bodyArrayBuffer ? M(this) || Promise.resolve(this._bodyArrayBuffer) : this.blob().then($)
          }), this.text = function () {
            var u = M(this);
            if (u) return u;
            if (this._bodyBlob) return k(this._bodyBlob);
            if (this._bodyArrayBuffer) return Promise.resolve(B(this._bodyArrayBuffer));
            if (this._bodyFormData) throw new Error("could not read FormData body as text");
            return Promise.resolve(this._bodyText)
          }, a.formData && (this.formData = function () {
            return this.text().then(j)
          }), this.json = function () {
            return this.text().then(JSON.parse)
          }, this
        }
        var V = ["DELETE", "GET", "HEAD", "OPTIONS", "POST", "PUT"];

        function R(u) {
          var p = u.toUpperCase();
          return V.indexOf(p) > -1 ? p : u
        }

        function P(u, p) {
          p = p || {};
          var v = p.body;
          if (u instanceof P) {
            if (u.bodyUsed) throw new TypeError("Already read");
            this.url = u.url, this.credentials = u.credentials, p.headers || (this.headers = new C(u.headers)), this.method = u.method, this.mode = u.mode, this.signal = u.signal, !v && u._bodyInit != null && (v = u._bodyInit, u.bodyUsed = !0)
          } else this.url = String(u);
          if (this.credentials = p.credentials || this.credentials || "same-origin", (p.headers || !this.headers) && (this.headers = new C(p.headers)), this.method = R(p.method || this.method || "GET"), this.mode = p.mode || this.mode || null, this.signal = p.signal || this.signal, this.referrer = null, (this.method === "GET" || this.method === "HEAD") && v) throw new TypeError("Body not allowed for GET or HEAD requests");
          this._initBody(v)
        }
        P.prototype.clone = function () {
          return new P(this, {
            body: this._bodyInit
          })
        };

        function j(u) {
          var p = new FormData;
          return u.trim().split("&").forEach(function (v) {
            if (v) {
              var x = v.split("="),
                E = x.shift().replace(/\+/g, " "),
                S = x.join("=").replace(/\+/g, " ");
              p.append(decodeURIComponent(E), decodeURIComponent(S))
            }
          }), p
        }

        function Y(u) {
          var p = new C,
            v = u.replace(/\r?\n[\t ]+/g, " ");
          return v.split(/\r?\n/).forEach(function (x) {
            var E = x.split(":"),
              S = E.shift().trim();
            if (S) {
              var _ = E.join(":").trim();
              p.append(S, _)
            }
          }), p
        }
        D.call(P.prototype);

        function U(u, p) {
          p || (p = {}), this.type = "default", this.status = p.status === void 0 ? 200 : p.status, this.ok = this.status >= 200 && this.status < 300, this.statusText = "statusText" in p ? p.statusText : "OK", this.headers = new C(p.headers), this.url = p.url || "", this._initBody(u)
        }
        D.call(U.prototype), U.prototype.clone = function () {
          return new U(this._bodyInit, {
            status: this.status,
            statusText: this.statusText,
            headers: new C(this.headers),
            url: this.url
          })
        }, U.error = function () {
          var u = new U(null, {
            status: 0,
            statusText: ""
          });
          return u.type = "error", u
        };
        var I = [301, 302, 303, 307, 308];
        U.redirect = function (u, p) {
          if (I.indexOf(p) === -1) throw new RangeError("Invalid status code");
          return new U(null, {
            status: p,
            headers: {
              location: u
            }
          })
        }, o.DOMException = s.DOMException;
        try {
          new o.DOMException
        } catch {
          o.DOMException = function (p, v) {
            this.message = p, this.name = v;
            var x = Error(p);
            this.stack = x.stack
          }, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException
        }

        function g(u, p) {
          return new Promise(function (v, x) {
            var E = new P(u, p);
            if (E.signal && E.signal.aborted) return x(new o.DOMException("Aborted", "AbortError"));
            var S = new XMLHttpRequest;

            function _() {
              S.abort()
            }
            S.onload = function () {
              var y = {
                status: S.status,
                statusText: S.statusText,
                headers: Y(S.getAllResponseHeaders() || "")
              };
              y.url = "responseURL" in S ? S.responseURL : y.headers.get("X-Request-URL");
              var A = "response" in S ? S.response : S.responseText;
              v(new U(A, y))
            }, S.onerror = function () {
              x(new TypeError("Network request failed"))
            }, S.ontimeout = function () {
              x(new TypeError("Network request failed"))
            }, S.onabort = function () {
              x(new o.DOMException("Aborted", "AbortError"))
            }, S.open(E.method, E.url, !0), E.credentials === "include" ? S.withCredentials = !0 : E.credentials === "omit" && (S.withCredentials = !1), "responseType" in S && a.blob && (S.responseType = "blob"), E.headers.forEach(function (y, A) {
              S.setRequestHeader(A, y)
            }), E.signal && (E.signal.addEventListener("abort", _), S.onreadystatechange = function () {
              S.readyState === 4 && E.signal.removeEventListener("abort", _)
            }), S.send(typeof E._bodyInit > "u" ? null : E._bodyInit)
          })
        }
        return g.polyfill = !0, s.fetch || (s.fetch = g, s.Headers = C, s.Request = P, s.Response = U), o.Headers = C, o.Request = P, o.Response = U, o.fetch = g, Object.defineProperty(o, "__esModule", {
          value: !0
        }), o
      })({})
    })(n), n.fetch.ponyfill = !0, delete n.fetch.polyfill;
    var i = n;
    e = i.fetch, e.default = i.fetch, e.fetch = i.fetch, e.Headers = i.Headers, e.Request = i.Request, e.Response = i.Response, t.exports = e
  })(NE, NE.exports);
  var c5e = NE.exports;
  const nU = Za(c5e);
  var l5e = Object.defineProperty,
    u5e = Object.defineProperties,
    d5e = Object.getOwnPropertyDescriptors,
    iU = Object.getOwnPropertySymbols,
    h5e = Object.prototype.hasOwnProperty,
    f5e = Object.prototype.propertyIsEnumerable,
    sU = (t, e, r) => e in t ? l5e(t, e, {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: r
    }) : t[e] = r,
    oU = (t, e) => {
      for (var r in e || (e = {})) h5e.call(e, r) && sU(t, r, e[r]);
      if (iU)
        for (var r of iU(e)) f5e.call(e, r) && sU(t, r, e[r]);
      return t
    },
    aU = (t, e) => u5e(t, d5e(e));
  const p5e = {
      Accept: "application/json",
      "Content-Type": "application/json"
    },
    g5e = "POST",
    cU = {
      headers: p5e,
      method: g5e
    },
    lU = 10;
  let Fl = class {
    constructor(e, r = !1) {
      if (this.url = e, this.disableProviderPing = r, this.events = new Fi.EventEmitter, this.isAvailable = !1, this.registering = !1, !lB(e)) throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);
      this.url = e, this.disableProviderPing = r
    }
    get connected() {
      return this.isAvailable
    }
    get connecting() {
      return this.registering
    }
    on(e, r) {
      this.events.on(e, r)
    }
    once(e, r) {
      this.events.once(e, r)
    }
    off(e, r) {
      this.events.off(e, r)
    }
    removeListener(e, r) {
      this.events.removeListener(e, r)
    }
    async open(e = this.url) {
      console.log("4 open", e);
      await this.register(e)
    }
    async close() {
      if (!this.isAvailable) throw new Error("Connection already closed");
      this.onClose()
    }
    async send(e) {
      this.isAvailable || await this.register();
      try {
        const r = Nu(e),
          n = await (await nU(this.url, aU(oU({}, cU), {
            body: r
          }))).json();
        this.onPayload({
          data: n
        })
      } catch (r) {
        this.onError(e.id, r)
      }
    }
    async register(e = this.url) {
      if (!lB(e)) throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);
      if (this.registering) {
        const r = this.events.getMaxListeners();
        return (this.events.listenerCount("register_error") >= r || this.events.listenerCount("open") >= r) && this.events.setMaxListeners(r + 1), new Promise((n, i) => {
          this.events.once("register_error", s => {
            this.resetMaxListeners(), i(s)
          }), this.events.once("open", () => {
            if (this.resetMaxListeners(), typeof this.isAvailable > "u") return i(new Error("HTTP connection is missing or invalid"));
            n()
          })
        })
      }
      this.url = e, this.registering = !0;
      try {
        if (!this.disableProviderPing) {
          const r = Nu({
            id: 1,
            jsonrpc: "2.0",
            method: "test",
            params: []
          });
          await nU(e, aU(oU({}, cU), {
            body: r
          }))
        }
        this.onOpen()
      } catch (r) {
        const n = this.parseError(r);
        throw this.events.emit("register_error", n), this.onClose(), n
      }
    }
    onOpen() {
      this.isAvailable = !0, this.registering = !1, this.events.emit("open")
    }
    onClose() {
      this.isAvailable = !1, this.registering = !1, this.events.emit("close")
    }
    onPayload(e) {
      if (typeof e.data > "u") return;
      const r = typeof e.data == "string" ? Pf(e.data) : e.data;
      this.events.emit("payload", r)
    }
    onError(e, r) {
      const n = this.parseError(r),
        i = n.message || n.toString(),
        s = v4(e, i);
      this.events.emit("payload", s)
    }
    parseError(e, r = this.url) {
      return iB(e, r, "HTTP")
    }
    resetMaxListeners() {
      this.events.getMaxListeners() > lU && this.events.setMaxListeners(lU)
    }
  };
  const uU = "error",
    m5e = "wss://relay.walletconnect.org",
    w5e = "wc",
    v5e = "universal_provider",
    dU = `${w5e}@2:${v5e}:`,
    hU = "https://rpc.walletconnect.org/v1/",
    Tg = "generic",
    b5e = `${hU}bundler`,
    Sc = {
      DEFAULT_CHAIN_CHANGED: "default_chain_changed"
    };
  var Iv = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {},
    ME = {
      exports: {}
    };
  /**
   * @license
   * Lodash <https://lodash.com/>
   * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
   * Released under MIT license <https://lodash.com/license>
   * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
   * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
   */
  (function (t, e) {
    (function () {
      var r, n = "4.17.21",
        i = 200,
        s = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",
        o = "Expected a function",
        a = "Invalid `variable` option passed into `_.template`",
        c = "__lodash_hash_undefined__",
        l = 500,
        h = "__lodash_placeholder__",
        f = 1,
        w = 2,
        b = 4,
        C = 1,
        M = 2,
        N = 1,
        $ = 2,
        k = 4,
        B = 8,
        F = 16,
        D = 32,
        V = 64,
        R = 128,
        P = 256,
        j = 512,
        Y = 30,
        U = "...",
        I = 800,
        g = 16,
        u = 1,
        p = 2,
        v = 3,
        x = 1 / 0,
        E = 9007199254740991,
        S = 17976931348623157e292,
        _ = NaN,
        y = 4294967295,
        A = y - 1,
        G = y >>> 1,
        ce = [
          ["ary", R],
          ["bind", N],
          ["bindKey", $],
          ["curry", B],
          ["curryRight", F],
          ["flip", j],
          ["partial", D],
          ["partialRight", V],
          ["rearg", P]
        ],
        W = "[object Arguments]",
        X = "[object Array]",
        Z = "[object AsyncFunction]",
        ee = "[object Boolean]",
        ne = "[object Date]",
        O = "[object DOMException]",
        H = "[object Error]",
        Q = "[object Function]",
        de = "[object GeneratorFunction]",
        ge = "[object Map]",
        Te = "[object Number]",
        Oe = "[object Null]",
        De = "[object Object]",
        et = "[object Promise]",
        rt = "[object Proxy]",
        Ze = "[object RegExp]",
        qe = "[object Set]",
        He = "[object String]",
        we = "[object Symbol]",
        xe = "[object Undefined]",
        Ie = "[object WeakMap]",
        Pe = "[object WeakSet]",
        J = "[object ArrayBuffer]",
        L = "[object DataView]",
        z = "[object Float32Array]",
        ie = "[object Float64Array]",
        ue = "[object Int8Array]",
        me = "[object Int16Array]",
        be = "[object Int32Array]",
        Le = "[object Uint8Array]",
        ze = "[object Uint8ClampedArray]",
        Qe = "[object Uint16Array]",
        Xe = "[object Uint32Array]",
        Je = /\b__p \+= '';/g,
        kt = /\b(__p \+=) '' \+/g,
        Ut = /(__e\(.*?\)|\b__t\)) \+\n'';/g,
        Ft = /&(?:amp|lt|gt|quot|#39);/g,
        Wt = /[&<>"']/g,
        pt = RegExp(Ft.source),
        ct = RegExp(Wt.source),
        gt = /<%-([\s\S]+?)%>/g,
        mt = /<%([\s\S]+?)%>/g,
        ht = /<%=([\s\S]+?)%>/g,
        lt = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
        xt = /^\w*$/,
        Ct = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,
        wt = /[\\^$.*+?()[\]{}|]/g,
        Et = RegExp(wt.source),
        vt = /^\s+/,
        yt = /\s/,
        bt = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
        st = /\{\n\/\* \[wrapped with (.+)\] \*/,
        At = /,? & /,
        St = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,
        Gt = /[()=,{}\[\]\/\s]/,
        Zt = /\\(\\)?/g,
        Yt = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,
        Pt = /\w*$/,
        br = /^[-+]0x[0-9a-f]+$/i,
        Nn = /^0b[01]+$/i,
        Mn = /^\[object .+?Constructor\]$/,
        Pn = /^0o[0-7]+$/i,
        $n = /^(?:0|[1-9]\d*)$/,
        tn = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,
        Qn = /($^)/,
        Ii = /['\n\r\u2028\u2029\\]/g,
        Jn = "\\ud800-\\udfff",
        Ti = "\\u0300-\\u036f",
        ki = "\\ufe20-\\ufe2f",
        Xn = "\\u20d0-\\u20ff",
        mi = Ti + ki + Xn,
        wi = "\\u2700-\\u27bf",
        hn = "a-z\\xdf-\\xf6\\xf8-\\xff",
        Vs = "\\xac\\xb1\\xd7\\xf7",
        Ks = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",
        Gs = "\\u2000-\\u206f",
        jc = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",
        af = "A-Z\\xc0-\\xd6\\xd8-\\xde",
        h_ = "\\ufe0e\\ufe0f",
        kp = Vs + Ks + Gs + jc,
        p3 = "['’]",
        Rp = "[" + Jn + "]",
        g3 = "[" + kp + "]",
        Np = "[" + mi + "]",
        f_ = "\\d+",
        CT = "[" + wi + "]",
        p_ = "[" + hn + "]",
        g_ = "[^" + Jn + kp + f_ + wi + hn + af + "]",
        Bm = "\\ud83c[\\udffb-\\udfff]",
        ET = "(?:" + Np + "|" + Bm + ")",
        m_ = "[^" + Jn + "]",
        Um = "(?:\\ud83c[\\udde6-\\uddff]){2}",
        cf = "[\\ud800-\\udbff][\\udc00-\\udfff]",
        Jo = "[" + af + "]",
        w_ = "\\u200d",
        v_ = "(?:" + p_ + "|" + g_ + ")",
        fu = "(?:" + Jo + "|" + g_ + ")",
        b_ = "(?:" + p3 + "(?:d|ll|m|re|s|t|ve))?",
        y_ = "(?:" + p3 + "(?:D|LL|M|RE|S|T|VE))?",
        __ = ET + "?",
        x_ = "[" + h_ + "]?",
        AT = "(?:" + w_ + "(?:" + [m_, Um, cf].join("|") + ")" + x_ + __ + ")*",
        Cd = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",
        C_ = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",
        E_ = x_ + __ + AT,
        jm = "(?:" + [CT, Um, cf].join("|") + ")" + E_,
        ST = "(?:" + [m_ + Np + "?", Np, Um, cf, Rp].join("|") + ")",
        m3 = RegExp(p3, "g"),
        IT = RegExp(Np, "g"),
        Fm = RegExp(Bm + "(?=" + Bm + ")|" + ST + E_, "g"),
        A_ = RegExp([Jo + "?" + p_ + "+" + b_ + "(?=" + [g3, Jo, "$"].join("|") + ")", fu + "+" + y_ + "(?=" + [g3, Jo + v_, "$"].join("|") + ")", Jo + "?" + v_ + "+" + b_, Jo + "+" + y_, C_, Cd, f_, jm].join("|"), "g"),
        S_ = RegExp("[" + w_ + Jn + mi + h_ + "]"),
        Mp = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,
        I_ = ["Array", "Buffer", "DataView", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Math", "Object", "Promise", "RegExp", "Set", "String", "Symbol", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap", "_", "clearTimeout", "isFinite", "parseInt", "setTimeout"],
        TT = -1,
        fn = {};
      fn[z] = fn[ie] = fn[ue] = fn[me] = fn[be] = fn[Le] = fn[ze] = fn[Qe] = fn[Xe] = !0, fn[W] = fn[X] = fn[J] = fn[ee] = fn[L] = fn[ne] = fn[H] = fn[Q] = fn[ge] = fn[Te] = fn[De] = fn[Ze] = fn[qe] = fn[He] = fn[Ie] = !1;
      var cn = {};
      cn[W] = cn[X] = cn[J] = cn[L] = cn[ee] = cn[ne] = cn[z] = cn[ie] = cn[ue] = cn[me] = cn[be] = cn[ge] = cn[Te] = cn[De] = cn[Ze] = cn[qe] = cn[He] = cn[we] = cn[Le] = cn[ze] = cn[Qe] = cn[Xe] = !0, cn[H] = cn[Q] = cn[Ie] = !1;
      var he = {
          À: "A",
          Á: "A",
          Â: "A",
          Ã: "A",
          Ä: "A",
          Å: "A",
          à: "a",
          á: "a",
          â: "a",
          ã: "a",
          ä: "a",
          å: "a",
          Ç: "C",
          ç: "c",
          Ð: "D",
          ð: "d",
          È: "E",
          É: "E",
          Ê: "E",
          Ë: "E",
          è: "e",
          é: "e",
          ê: "e",
          ë: "e",
          Ì: "I",
          Í: "I",
          Î: "I",
          Ï: "I",
          ì: "i",
          í: "i",
          î: "i",
          ï: "i",
          Ñ: "N",
          ñ: "n",
          Ò: "O",
          Ó: "O",
          Ô: "O",
          Õ: "O",
          Ö: "O",
          Ø: "O",
          ò: "o",
          ó: "o",
          ô: "o",
          õ: "o",
          ö: "o",
          ø: "o",
          Ù: "U",
          Ú: "U",
          Û: "U",
          Ü: "U",
          ù: "u",
          ú: "u",
          û: "u",
          ü: "u",
          Ý: "Y",
          ý: "y",
          ÿ: "y",
          Æ: "Ae",
          æ: "ae",
          Þ: "Th",
          þ: "th",
          ß: "ss",
          Ā: "A",
          Ă: "A",
          Ą: "A",
          ā: "a",
          ă: "a",
          ą: "a",
          Ć: "C",
          Ĉ: "C",
          Ċ: "C",
          Č: "C",
          ć: "c",
          ĉ: "c",
          ċ: "c",
          č: "c",
          Ď: "D",
          Đ: "D",
          ď: "d",
          đ: "d",
          Ē: "E",
          Ĕ: "E",
          Ė: "E",
          Ę: "E",
          Ě: "E",
          ē: "e",
          ĕ: "e",
          ė: "e",
          ę: "e",
          ě: "e",
          Ĝ: "G",
          Ğ: "G",
          Ġ: "G",
          Ģ: "G",
          ĝ: "g",
          ğ: "g",
          ġ: "g",
          ģ: "g",
          Ĥ: "H",
          Ħ: "H",
          ĥ: "h",
          ħ: "h",
          Ĩ: "I",
          Ī: "I",
          Ĭ: "I",
          Į: "I",
          İ: "I",
          ĩ: "i",
          ī: "i",
          ĭ: "i",
          į: "i",
          ı: "i",
          Ĵ: "J",
          ĵ: "j",
          Ķ: "K",
          ķ: "k",
          ĸ: "k",
          Ĺ: "L",
          Ļ: "L",
          Ľ: "L",
          Ŀ: "L",
          Ł: "L",
          ĺ: "l",
          ļ: "l",
          ľ: "l",
          ŀ: "l",
          ł: "l",
          Ń: "N",
          Ņ: "N",
          Ň: "N",
          Ŋ: "N",
          ń: "n",
          ņ: "n",
          ň: "n",
          ŋ: "n",
          Ō: "O",
          Ŏ: "O",
          Ő: "O",
          ō: "o",
          ŏ: "o",
          ő: "o",
          Ŕ: "R",
          Ŗ: "R",
          Ř: "R",
          ŕ: "r",
          ŗ: "r",
          ř: "r",
          Ś: "S",
          Ŝ: "S",
          Ş: "S",
          Š: "S",
          ś: "s",
          ŝ: "s",
          ş: "s",
          š: "s",
          Ţ: "T",
          Ť: "T",
          Ŧ: "T",
          ţ: "t",
          ť: "t",
          ŧ: "t",
          Ũ: "U",
          Ū: "U",
          Ŭ: "U",
          Ů: "U",
          Ű: "U",
          Ų: "U",
          ũ: "u",
          ū: "u",
          ŭ: "u",
          ů: "u",
          ű: "u",
          ų: "u",
          Ŵ: "W",
          ŵ: "w",
          Ŷ: "Y",
          ŷ: "y",
          Ÿ: "Y",
          Ź: "Z",
          Ż: "Z",
          Ž: "Z",
          ź: "z",
          ż: "z",
          ž: "z",
          Ĳ: "IJ",
          ĳ: "ij",
          Œ: "Oe",
          œ: "oe",
          ŉ: "'n",
          ſ: "s"
        },
        Ce = {
          "&": "&amp;",
          "<": "&lt;",
          ">": "&gt;",
          '"': "&quot;",
          "'": "&#39;"
        },
        Ve = {
          "&amp;": "&",
          "&lt;": "<",
          "&gt;": ">",
          "&quot;": '"',
          "&#39;": "'"
        },
        Nt = {
          "\\": "\\",
          "'": "'",
          "\n": "n",
          "\r": "r",
          "\u2028": "u2028",
          "\u2029": "u2029"
        },
        pn = parseFloat,
        hr = parseInt,
        Tn = typeof Iv == "object" && Iv && Iv.Object === Object && Iv,
        vi = typeof self == "object" && self && self.Object === Object && self,
        Lr = Tn || vi || Function("return this")(),
        gn = e && !e.nodeType && e,
        ui = gn && !0 && t && !t.nodeType && t,
        Ao = ui && ui.exports === gn,
        bi = Ao && Tn.process,
        kn = function () {
          try {
            var Ee = ui && ui.require && ui.require("util").types;
            return Ee || bi && bi.binding && bi.binding("util")
          } catch {}
        }(),
        Zs = kn && kn.isArrayBuffer,
        Fc = kn && kn.isDate,
        Fa = kn && kn.isMap,
        pu = kn && kn.isRegExp,
        w3 = kn && kn.isSet,
        Pp = kn && kn.isTypedArray;

      function Xi(Ee, Be, Me) {
        switch (Me.length) {
          case 0:
            return Ee.call(Be);
          case 1:
            return Ee.call(Be, Me[0]);
          case 2:
            return Ee.call(Be, Me[0], Me[1]);
          case 3:
            return Ee.call(Be, Me[0], Me[1], Me[2])
        }
        return Ee.apply(Be, Me)
      }

      function N$e(Ee, Be, Me, $t) {
        for (var cr = -1, Yr = Ee == null ? 0 : Ee.length; ++cr < Yr;) {
          var Ri = Ee[cr];
          Be($t, Ri, Me(Ri), Ee)
        }
        return $t
      }

      function Wa(Ee, Be) {
        for (var Me = -1, $t = Ee == null ? 0 : Ee.length; ++Me < $t && Be(Ee[Me], Me, Ee) !== !1;);
        return Ee
      }

      function M$e(Ee, Be) {
        for (var Me = Ee == null ? 0 : Ee.length; Me-- && Be(Ee[Me], Me, Ee) !== !1;);
        return Ee
      }

      function qK(Ee, Be) {
        for (var Me = -1, $t = Ee == null ? 0 : Ee.length; ++Me < $t;)
          if (!Be(Ee[Me], Me, Ee)) return !1;
        return !0
      }

      function lf(Ee, Be) {
        for (var Me = -1, $t = Ee == null ? 0 : Ee.length, cr = 0, Yr = []; ++Me < $t;) {
          var Ri = Ee[Me];
          Be(Ri, Me, Ee) && (Yr[cr++] = Ri)
        }
        return Yr
      }

      function T_(Ee, Be) {
        var Me = Ee == null ? 0 : Ee.length;
        return !!Me && Wm(Ee, Be, 0) > -1
      }

      function kT(Ee, Be, Me) {
        for (var $t = -1, cr = Ee == null ? 0 : Ee.length; ++$t < cr;)
          if (Me(Be, Ee[$t])) return !0;
        return !1
      }

      function On(Ee, Be) {
        for (var Me = -1, $t = Ee == null ? 0 : Ee.length, cr = Array($t); ++Me < $t;) cr[Me] = Be(Ee[Me], Me, Ee);
        return cr
      }

      function uf(Ee, Be) {
        for (var Me = -1, $t = Be.length, cr = Ee.length; ++Me < $t;) Ee[cr + Me] = Be[Me];
        return Ee
      }

      function RT(Ee, Be, Me, $t) {
        var cr = -1,
          Yr = Ee == null ? 0 : Ee.length;
        for ($t && Yr && (Me = Ee[++cr]); ++cr < Yr;) Me = Be(Me, Ee[cr], cr, Ee);
        return Me
      }

      function P$e(Ee, Be, Me, $t) {
        var cr = Ee == null ? 0 : Ee.length;
        for ($t && cr && (Me = Ee[--cr]); cr--;) Me = Be(Me, Ee[cr], cr, Ee);
        return Me
      }

      function NT(Ee, Be) {
        for (var Me = -1, $t = Ee == null ? 0 : Ee.length; ++Me < $t;)
          if (Be(Ee[Me], Me, Ee)) return !0;
        return !1
      }
      var $$e = MT("length");

      function O$e(Ee) {
        return Ee.split("")
      }

      function D$e(Ee) {
        return Ee.match(St) || []
      }

      function VK(Ee, Be, Me) {
        var $t;
        return Me(Ee, function (cr, Yr, Ri) {
          if (Be(cr, Yr, Ri)) return $t = Yr, !1
        }), $t
      }

      function k_(Ee, Be, Me, $t) {
        for (var cr = Ee.length, Yr = Me + ($t ? 1 : -1); $t ? Yr-- : ++Yr < cr;)
          if (Be(Ee[Yr], Yr, Ee)) return Yr;
        return -1
      }

      function Wm(Ee, Be, Me) {
        return Be === Be ? G$e(Ee, Be, Me) : k_(Ee, KK, Me)
      }

      function L$e(Ee, Be, Me, $t) {
        for (var cr = Me - 1, Yr = Ee.length; ++cr < Yr;)
          if ($t(Ee[cr], Be)) return cr;
        return -1
      }

      function KK(Ee) {
        return Ee !== Ee
      }

      function GK(Ee, Be) {
        var Me = Ee == null ? 0 : Ee.length;
        return Me ? $T(Ee, Be) / Me : _
      }

      function MT(Ee) {
        return function (Be) {
          return Be == null ? r : Be[Ee]
        }
      }

      function PT(Ee) {
        return function (Be) {
          return Ee == null ? r : Ee[Be]
        }
      }

      function ZK(Ee, Be, Me, $t, cr) {
        return cr(Ee, function (Yr, Ri, mn) {
          Me = $t ? ($t = !1, Yr) : Be(Me, Yr, Ri, mn)
        }), Me
      }

      function B$e(Ee, Be) {
        var Me = Ee.length;
        for (Ee.sort(Be); Me--;) Ee[Me] = Ee[Me].value;
        return Ee
      }

      function $T(Ee, Be) {
        for (var Me, $t = -1, cr = Ee.length; ++$t < cr;) {
          var Yr = Be(Ee[$t]);
          Yr !== r && (Me = Me === r ? Yr : Me + Yr)
        }
        return Me
      }

      function OT(Ee, Be) {
        for (var Me = -1, $t = Array(Ee); ++Me < Ee;) $t[Me] = Be(Me);
        return $t
      }

      function U$e(Ee, Be) {
        return On(Be, function (Me) {
          return [Me, Ee[Me]]
        })
      }

      function YK(Ee) {
        return Ee && Ee.slice(0, eG(Ee) + 1).replace(vt, "")
      }

      function Xo(Ee) {
        return function (Be) {
          return Ee(Be)
        }
      }

      function DT(Ee, Be) {
        return On(Be, function (Me) {
          return Ee[Me]
        })
      }

      function v3(Ee, Be) {
        return Ee.has(Be)
      }

      function QK(Ee, Be) {
        for (var Me = -1, $t = Ee.length; ++Me < $t && Wm(Be, Ee[Me], 0) > -1;);
        return Me
      }

      function JK(Ee, Be) {
        for (var Me = Ee.length; Me-- && Wm(Be, Ee[Me], 0) > -1;);
        return Me
      }

      function j$e(Ee, Be) {
        for (var Me = Ee.length, $t = 0; Me--;) Ee[Me] === Be && ++$t;
        return $t
      }
      var F$e = PT(he),
        W$e = PT(Ce);

      function z$e(Ee) {
        return "\\" + Nt[Ee]
      }

      function H$e(Ee, Be) {
        return Ee == null ? r : Ee[Be]
      }

      function zm(Ee) {
        return S_.test(Ee)
      }

      function q$e(Ee) {
        return Mp.test(Ee)
      }

      function V$e(Ee) {
        for (var Be, Me = []; !(Be = Ee.next()).done;) Me.push(Be.value);
        return Me
      }

      function LT(Ee) {
        var Be = -1,
          Me = Array(Ee.size);
        return Ee.forEach(function ($t, cr) {
          Me[++Be] = [cr, $t]
        }), Me
      }

      function XK(Ee, Be) {
        return function (Me) {
          return Ee(Be(Me))
        }
      }

      function df(Ee, Be) {
        for (var Me = -1, $t = Ee.length, cr = 0, Yr = []; ++Me < $t;) {
          var Ri = Ee[Me];
          (Ri === Be || Ri === h) && (Ee[Me] = h, Yr[cr++] = Me)
        }
        return Yr
      }

      function R_(Ee) {
        var Be = -1,
          Me = Array(Ee.size);
        return Ee.forEach(function ($t) {
          Me[++Be] = $t
        }), Me
      }

      function K$e(Ee) {
        var Be = -1,
          Me = Array(Ee.size);
        return Ee.forEach(function ($t) {
          Me[++Be] = [$t, $t]
        }), Me
      }

      function G$e(Ee, Be, Me) {
        for (var $t = Me - 1, cr = Ee.length; ++$t < cr;)
          if (Ee[$t] === Be) return $t;
        return -1
      }

      function Z$e(Ee, Be, Me) {
        for (var $t = Me + 1; $t--;)
          if (Ee[$t] === Be) return $t;
        return $t
      }

      function Hm(Ee) {
        return zm(Ee) ? Q$e(Ee) : $$e(Ee)
      }

      function Wc(Ee) {
        return zm(Ee) ? J$e(Ee) : O$e(Ee)
      }

      function eG(Ee) {
        for (var Be = Ee.length; Be-- && yt.test(Ee.charAt(Be)););
        return Be
      }
      var Y$e = PT(Ve);

      function Q$e(Ee) {
        for (var Be = Fm.lastIndex = 0; Fm.test(Ee);) ++Be;
        return Be
      }

      function J$e(Ee) {
        return Ee.match(Fm) || []
      }

      function X$e(Ee) {
        return Ee.match(A_) || []
      }
      var eOe = function Ee(Be) {
          Be = Be == null ? Lr : qm.defaults(Lr.Object(), Be, qm.pick(Lr, I_));
          var Me = Be.Array,
            $t = Be.Date,
            cr = Be.Error,
            Yr = Be.Function,
            Ri = Be.Math,
            mn = Be.Object,
            BT = Be.RegExp,
            tOe = Be.String,
            za = Be.TypeError,
            N_ = Me.prototype,
            rOe = Yr.prototype,
            Vm = mn.prototype,
            M_ = Be["__core-js_shared__"],
            P_ = rOe.toString,
            sn = Vm.hasOwnProperty,
            nOe = 0,
            tG = function () {
              var d = /[^.]+$/.exec(M_ && M_.keys && M_.keys.IE_PROTO || "");
              return d ? "Symbol(src)_1." + d : ""
            }(),
            $_ = Vm.toString,
            iOe = P_.call(mn),
            sOe = Lr._,
            oOe = BT("^" + P_.call(sn).replace(wt, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"),
            O_ = Ao ? Be.Buffer : r,
            hf = Be.Symbol,
            D_ = Be.Uint8Array,
            rG = O_ ? O_.allocUnsafe : r,
            L_ = XK(mn.getPrototypeOf, mn),
            nG = mn.create,
            iG = Vm.propertyIsEnumerable,
            B_ = N_.splice,
            sG = hf ? hf.isConcatSpreadable : r,
            b3 = hf ? hf.iterator : r,
            $p = hf ? hf.toStringTag : r,
            U_ = function () {
              try {
                var d = Up(mn, "defineProperty");
                return d({}, "", {}), d
              } catch {}
            }(),
            aOe = Be.clearTimeout !== Lr.clearTimeout && Be.clearTimeout,
            cOe = $t && $t.now !== Lr.Date.now && $t.now,
            lOe = Be.setTimeout !== Lr.setTimeout && Be.setTimeout,
            j_ = Ri.ceil,
            F_ = Ri.floor,
            UT = mn.getOwnPropertySymbols,
            uOe = O_ ? O_.isBuffer : r,
            oG = Be.isFinite,
            dOe = N_.join,
            hOe = XK(mn.keys, mn),
            Ni = Ri.max,
            Ts = Ri.min,
            fOe = $t.now,
            pOe = Be.parseInt,
            aG = Ri.random,
            gOe = N_.reverse,
            jT = Up(Be, "DataView"),
            y3 = Up(Be, "Map"),
            FT = Up(Be, "Promise"),
            Km = Up(Be, "Set"),
            _3 = Up(Be, "WeakMap"),
            x3 = Up(mn, "create"),
            W_ = _3 && new _3,
            Gm = {},
            mOe = jp(jT),
            wOe = jp(y3),
            vOe = jp(FT),
            bOe = jp(Km),
            yOe = jp(_3),
            z_ = hf ? hf.prototype : r,
            C3 = z_ ? z_.valueOf : r,
            cG = z_ ? z_.toString : r;

          function se(d) {
            if (ei(d) && !fr(d) && !(d instanceof $r)) {
              if (d instanceof Ha) return d;
              if (sn.call(d, "__wrapped__")) return lZ(d)
            }
            return new Ha(d)
          }
          var Zm = function () {
            function d() {}
            return function (m) {
              if (!Hn(m)) return {};
              if (nG) return nG(m);
              d.prototype = m;
              var T = new d;
              return d.prototype = r, T
            }
          }();

          function H_() {}

          function Ha(d, m) {
            this.__wrapped__ = d, this.__actions__ = [], this.__chain__ = !!m, this.__index__ = 0, this.__values__ = r
          }
          se.templateSettings = {
            escape: gt,
            evaluate: mt,
            interpolate: ht,
            variable: "",
            imports: {
              _: se
            }
          }, se.prototype = H_.prototype, se.prototype.constructor = se, Ha.prototype = Zm(H_.prototype), Ha.prototype.constructor = Ha;

          function $r(d) {
            this.__wrapped__ = d, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = !1, this.__iteratees__ = [], this.__takeCount__ = y, this.__views__ = []
          }

          function _Oe() {
            var d = new $r(this.__wrapped__);
            return d.__actions__ = So(this.__actions__), d.__dir__ = this.__dir__, d.__filtered__ = this.__filtered__, d.__iteratees__ = So(this.__iteratees__), d.__takeCount__ = this.__takeCount__, d.__views__ = So(this.__views__), d
          }

          function xOe() {
            if (this.__filtered__) {
              var d = new $r(this);
              d.__dir__ = -1, d.__filtered__ = !0
            } else d = this.clone(), d.__dir__ *= -1;
            return d
          }

          function COe() {
            var d = this.__wrapped__.value(),
              m = this.__dir__,
              T = fr(d),
              q = m < 0,
              te = T ? d.length : 0,
              oe = ODe(0, te, this.__views__),
              pe = oe.start,
              ve = oe.end,
              Se = ve - pe,
              Fe = q ? ve : pe - 1,
              We = this.__iteratees__,
              Ge = We.length,
              _t = 0,
              Ht = Ts(Se, this.__takeCount__);
            if (!T || !q && te == Se && Ht == Se) return MG(d, this.__actions__);
            var er = [];
            e: for (; Se-- && _t < Ht;) {
              Fe += m;
              for (var Cr = -1, tr = d[Fe]; ++Cr < Ge;) {
                var kr = We[Cr],
                  Br = kr.iteratee,
                  ra = kr.type,
                  Js = Br(tr);
                if (ra == p) tr = Js;
                else if (!Js) {
                  if (ra == u) continue e;
                  break e
                }
              }
              er[_t++] = tr
            }
            return er
          }
          $r.prototype = Zm(H_.prototype), $r.prototype.constructor = $r;

          function Op(d) {
            var m = -1,
              T = d == null ? 0 : d.length;
            for (this.clear(); ++m < T;) {
              var q = d[m];
              this.set(q[0], q[1])
            }
          }

          function EOe() {
            this.__data__ = x3 ? x3(null) : {}, this.size = 0
          }

          function AOe(d) {
            var m = this.has(d) && delete this.__data__[d];
            return this.size -= m ? 1 : 0, m
          }

          function SOe(d) {
            var m = this.__data__;
            if (x3) {
              var T = m[d];
              return T === c ? r : T
            }
            return sn.call(m, d) ? m[d] : r
          }

          function IOe(d) {
            var m = this.__data__;
            return x3 ? m[d] !== r : sn.call(m, d)
          }

          function TOe(d, m) {
            var T = this.__data__;
            return this.size += this.has(d) ? 0 : 1, T[d] = x3 && m === r ? c : m, this
          }
          Op.prototype.clear = EOe, Op.prototype.delete = AOe, Op.prototype.get = SOe, Op.prototype.has = IOe, Op.prototype.set = TOe;

          function Ed(d) {
            var m = -1,
              T = d == null ? 0 : d.length;
            for (this.clear(); ++m < T;) {
              var q = d[m];
              this.set(q[0], q[1])
            }
          }

          function kOe() {
            this.__data__ = [], this.size = 0
          }

          function ROe(d) {
            var m = this.__data__,
              T = q_(m, d);
            if (T < 0) return !1;
            var q = m.length - 1;
            return T == q ? m.pop() : B_.call(m, T, 1), --this.size, !0
          }

          function NOe(d) {
            var m = this.__data__,
              T = q_(m, d);
            return T < 0 ? r : m[T][1]
          }

          function MOe(d) {
            return q_(this.__data__, d) > -1
          }

          function POe(d, m) {
            var T = this.__data__,
              q = q_(T, d);
            return q < 0 ? (++this.size, T.push([d, m])) : T[q][1] = m, this
          }
          Ed.prototype.clear = kOe, Ed.prototype.delete = ROe, Ed.prototype.get = NOe, Ed.prototype.has = MOe, Ed.prototype.set = POe;

          function Ad(d) {
            var m = -1,
              T = d == null ? 0 : d.length;
            for (this.clear(); ++m < T;) {
              var q = d[m];
              this.set(q[0], q[1])
            }
          }

          function $Oe() {
            this.size = 0, this.__data__ = {
              hash: new Op,
              map: new(y3 || Ed),
              string: new Op
            }
          }

          function OOe(d) {
            var m = n7(this, d).delete(d);
            return this.size -= m ? 1 : 0, m
          }

          function DOe(d) {
            return n7(this, d).get(d)
          }

          function LOe(d) {
            return n7(this, d).has(d)
          }

          function BOe(d, m) {
            var T = n7(this, d),
              q = T.size;
            return T.set(d, m), this.size += T.size == q ? 0 : 1, this
          }
          Ad.prototype.clear = $Oe, Ad.prototype.delete = OOe, Ad.prototype.get = DOe, Ad.prototype.has = LOe, Ad.prototype.set = BOe;

          function Dp(d) {
            var m = -1,
              T = d == null ? 0 : d.length;
            for (this.__data__ = new Ad; ++m < T;) this.add(d[m])
          }

          function UOe(d) {
            return this.__data__.set(d, c), this
          }

          function jOe(d) {
            return this.__data__.has(d)
          }
          Dp.prototype.add = Dp.prototype.push = UOe, Dp.prototype.has = jOe;

          function zc(d) {
            var m = this.__data__ = new Ed(d);
            this.size = m.size
          }

          function FOe() {
            this.__data__ = new Ed, this.size = 0
          }

          function WOe(d) {
            var m = this.__data__,
              T = m.delete(d);
            return this.size = m.size, T
          }

          function zOe(d) {
            return this.__data__.get(d)
          }

          function HOe(d) {
            return this.__data__.has(d)
          }

          function qOe(d, m) {
            var T = this.__data__;
            if (T instanceof Ed) {
              var q = T.__data__;
              if (!y3 || q.length < i - 1) return q.push([d, m]), this.size = ++T.size, this;
              T = this.__data__ = new Ad(q)
            }
            return T.set(d, m), this.size = T.size, this
          }
          zc.prototype.clear = FOe, zc.prototype.delete = WOe, zc.prototype.get = zOe, zc.prototype.has = HOe, zc.prototype.set = qOe;

          function lG(d, m) {
            var T = fr(d),
              q = !T && Fp(d),
              te = !T && !q && wf(d),
              oe = !T && !q && !te && Xm(d),
              pe = T || q || te || oe,
              ve = pe ? OT(d.length, tOe) : [],
              Se = ve.length;
            for (var Fe in d)(m || sn.call(d, Fe)) && !(pe && (Fe == "length" || te && (Fe == "offset" || Fe == "parent") || oe && (Fe == "buffer" || Fe == "byteLength" || Fe == "byteOffset") || kd(Fe, Se))) && ve.push(Fe);
            return ve
          }

          function uG(d) {
            var m = d.length;
            return m ? d[JT(0, m - 1)] : r
          }

          function VOe(d, m) {
            return i7(So(d), Lp(m, 0, d.length))
          }

          function KOe(d) {
            return i7(So(d))
          }

          function WT(d, m, T) {
            (T !== r && !Hc(d[m], T) || T === r && !(m in d)) && Sd(d, m, T)
          }

          function E3(d, m, T) {
            var q = d[m];
            (!(sn.call(d, m) && Hc(q, T)) || T === r && !(m in d)) && Sd(d, m, T)
          }

          function q_(d, m) {
            for (var T = d.length; T--;)
              if (Hc(d[T][0], m)) return T;
            return -1
          }

          function GOe(d, m, T, q) {
            return ff(d, function (te, oe, pe) {
              m(q, te, T(te), pe)
            }), q
          }

          function dG(d, m) {
            return d && mu(m, es(m), d)
          }

          function ZOe(d, m) {
            return d && mu(m, To(m), d)
          }

          function Sd(d, m, T) {
            m == "__proto__" && U_ ? U_(d, m, {
              configurable: !0,
              enumerable: !0,
              value: T,
              writable: !0
            }) : d[m] = T
          }

          function zT(d, m) {
            for (var T = -1, q = m.length, te = Me(q), oe = d == null; ++T < q;) te[T] = oe ? r : Ck(d, m[T]);
            return te
          }

          function Lp(d, m, T) {
            return d === d && (T !== r && (d = d <= T ? d : T), m !== r && (d = d >= m ? d : m)), d
          }

          function qa(d, m, T, q, te, oe) {
            var pe, ve = m & f,
              Se = m & w,
              Fe = m & b;
            if (T && (pe = te ? T(d, q, te, oe) : T(d)), pe !== r) return pe;
            if (!Hn(d)) return d;
            var We = fr(d);
            if (We) {
              if (pe = LDe(d), !ve) return So(d, pe)
            } else {
              var Ge = ks(d),
                _t = Ge == Q || Ge == de;
              if (wf(d)) return OG(d, ve);
              if (Ge == De || Ge == W || _t && !te) {
                if (pe = Se || _t ? {} : eZ(d), !ve) return Se ? SDe(d, ZOe(pe, d)) : ADe(d, dG(pe, d))
              } else {
                if (!cn[Ge]) return te ? d : {};
                pe = BDe(d, Ge, ve)
              }
            }
            oe || (oe = new zc);
            var Ht = oe.get(d);
            if (Ht) return Ht;
            oe.set(d, pe), kZ(d) ? d.forEach(function (tr) {
              pe.add(qa(tr, m, T, tr, d, oe))
            }) : IZ(d) && d.forEach(function (tr, kr) {
              pe.set(kr, qa(tr, m, T, kr, d, oe))
            });
            var er = Fe ? Se ? lk : ck : Se ? To : es,
              Cr = We ? r : er(d);
            return Wa(Cr || d, function (tr, kr) {
              Cr && (kr = tr, tr = d[kr]), E3(pe, kr, qa(tr, m, T, kr, d, oe))
            }), pe
          }

          function YOe(d) {
            var m = es(d);
            return function (T) {
              return hG(T, d, m)
            }
          }

          function hG(d, m, T) {
            var q = T.length;
            if (d == null) return !q;
            for (d = mn(d); q--;) {
              var te = T[q],
                oe = m[te],
                pe = d[te];
              if (pe === r && !(te in d) || !oe(pe)) return !1
            }
            return !0
          }

          function fG(d, m, T) {
            if (typeof d != "function") throw new za(o);
            return N3(function () {
              d.apply(r, T)
            }, m)
          }

          function A3(d, m, T, q) {
            var te = -1,
              oe = T_,
              pe = !0,
              ve = d.length,
              Se = [],
              Fe = m.length;
            if (!ve) return Se;
            T && (m = On(m, Xo(T))), q ? (oe = kT, pe = !1) : m.length >= i && (oe = v3, pe = !1, m = new Dp(m));
            e: for (; ++te < ve;) {
              var We = d[te],
                Ge = T == null ? We : T(We);
              if (We = q || We !== 0 ? We : 0, pe && Ge === Ge) {
                for (var _t = Fe; _t--;)
                  if (m[_t] === Ge) continue e;
                Se.push(We)
              } else oe(m, Ge, q) || Se.push(We)
            }
            return Se
          }
          var ff = jG(gu),
            pG = jG(qT, !0);

          function QOe(d, m) {
            var T = !0;
            return ff(d, function (q, te, oe) {
              return T = !!m(q, te, oe), T
            }), T
          }

          function V_(d, m, T) {
            for (var q = -1, te = d.length; ++q < te;) {
              var oe = d[q],
                pe = m(oe);
              if (pe != null && (ve === r ? pe === pe && !ta(pe) : T(pe, ve))) var ve = pe,
                Se = oe
            }
            return Se
          }

          function JOe(d, m, T, q) {
            var te = d.length;
            for (T = yr(T), T < 0 && (T = -T > te ? 0 : te + T), q = q === r || q > te ? te : yr(q), q < 0 && (q += te), q = T > q ? 0 : NZ(q); T < q;) d[T++] = m;
            return d
          }

          function gG(d, m) {
            var T = [];
            return ff(d, function (q, te, oe) {
              m(q, te, oe) && T.push(q)
            }), T
          }

          function fs(d, m, T, q, te) {
            var oe = -1,
              pe = d.length;
            for (T || (T = jDe), te || (te = []); ++oe < pe;) {
              var ve = d[oe];
              m > 0 && T(ve) ? m > 1 ? fs(ve, m - 1, T, q, te) : uf(te, ve) : q || (te[te.length] = ve)
            }
            return te
          }
          var HT = FG(),
            mG = FG(!0);

          function gu(d, m) {
            return d && HT(d, m, es)
          }

          function qT(d, m) {
            return d && mG(d, m, es)
          }

          function K_(d, m) {
            return lf(m, function (T) {
              return Rd(d[T])
            })
          }

          function Bp(d, m) {
            m = gf(m, d);
            for (var T = 0, q = m.length; d != null && T < q;) d = d[wu(m[T++])];
            return T && T == q ? d : r
          }

          function wG(d, m, T) {
            var q = m(d);
            return fr(d) ? q : uf(q, T(d))
          }

          function Ys(d) {
            return d == null ? d === r ? xe : Oe : $p && $p in mn(d) ? $De(d) : KDe(d)
          }

          function VT(d, m) {
            return d > m
          }

          function XOe(d, m) {
            return d != null && sn.call(d, m)
          }

          function eDe(d, m) {
            return d != null && m in mn(d)
          }

          function tDe(d, m, T) {
            return d >= Ts(m, T) && d < Ni(m, T)
          }

          function KT(d, m, T) {
            for (var q = T ? kT : T_, te = d[0].length, oe = d.length, pe = oe, ve = Me(oe), Se = 1 / 0, Fe = []; pe--;) {
              var We = d[pe];
              pe && m && (We = On(We, Xo(m))), Se = Ts(We.length, Se), ve[pe] = !T && (m || te >= 120 && We.length >= 120) ? new Dp(pe && We) : r
            }
            We = d[0];
            var Ge = -1,
              _t = ve[0];
            e: for (; ++Ge < te && Fe.length < Se;) {
              var Ht = We[Ge],
                er = m ? m(Ht) : Ht;
              if (Ht = T || Ht !== 0 ? Ht : 0, !(_t ? v3(_t, er) : q(Fe, er, T))) {
                for (pe = oe; --pe;) {
                  var Cr = ve[pe];
                  if (!(Cr ? v3(Cr, er) : q(d[pe], er, T))) continue e
                }
                _t && _t.push(er), Fe.push(Ht)
              }
            }
            return Fe
          }

          function rDe(d, m, T, q) {
            return gu(d, function (te, oe, pe) {
              m(q, T(te), oe, pe)
            }), q
          }

          function S3(d, m, T) {
            m = gf(m, d), d = iZ(d, m);
            var q = d == null ? d : d[wu(Ka(m))];
            return q == null ? r : Xi(q, d, T)
          }

          function vG(d) {
            return ei(d) && Ys(d) == W
          }

          function nDe(d) {
            return ei(d) && Ys(d) == J
          }

          function iDe(d) {
            return ei(d) && Ys(d) == ne
          }

          function I3(d, m, T, q, te) {
            return d === m ? !0 : d == null || m == null || !ei(d) && !ei(m) ? d !== d && m !== m : sDe(d, m, T, q, I3, te)
          }

          function sDe(d, m, T, q, te, oe) {
            var pe = fr(d),
              ve = fr(m),
              Se = pe ? X : ks(d),
              Fe = ve ? X : ks(m);
            Se = Se == W ? De : Se, Fe = Fe == W ? De : Fe;
            var We = Se == De,
              Ge = Fe == De,
              _t = Se == Fe;
            if (_t && wf(d)) {
              if (!wf(m)) return !1;
              pe = !0, We = !1
            }
            if (_t && !We) return oe || (oe = new zc), pe || Xm(d) ? QG(d, m, T, q, te, oe) : MDe(d, m, Se, T, q, te, oe);
            if (!(T & C)) {
              var Ht = We && sn.call(d, "__wrapped__"),
                er = Ge && sn.call(m, "__wrapped__");
              if (Ht || er) {
                var Cr = Ht ? d.value() : d,
                  tr = er ? m.value() : m;
                return oe || (oe = new zc), te(Cr, tr, T, q, oe)
              }
            }
            return _t ? (oe || (oe = new zc), PDe(d, m, T, q, te, oe)) : !1
          }

          function oDe(d) {
            return ei(d) && ks(d) == ge
          }

          function GT(d, m, T, q) {
            var te = T.length,
              oe = te,
              pe = !q;
            if (d == null) return !oe;
            for (d = mn(d); te--;) {
              var ve = T[te];
              if (pe && ve[2] ? ve[1] !== d[ve[0]] : !(ve[0] in d)) return !1
            }
            for (; ++te < oe;) {
              ve = T[te];
              var Se = ve[0],
                Fe = d[Se],
                We = ve[1];
              if (pe && ve[2]) {
                if (Fe === r && !(Se in d)) return !1
              } else {
                var Ge = new zc;
                if (q) var _t = q(Fe, We, Se, d, m, Ge);
                if (!(_t === r ? I3(We, Fe, C | M, q, Ge) : _t)) return !1
              }
            }
            return !0
          }

          function bG(d) {
            if (!Hn(d) || WDe(d)) return !1;
            var m = Rd(d) ? oOe : Mn;
            return m.test(jp(d))
          }

          function aDe(d) {
            return ei(d) && Ys(d) == Ze
          }

          function cDe(d) {
            return ei(d) && ks(d) == qe
          }

          function lDe(d) {
            return ei(d) && u7(d.length) && !!fn[Ys(d)]
          }

          function yG(d) {
            return typeof d == "function" ? d : d == null ? ko : typeof d == "object" ? fr(d) ? CG(d[0], d[1]) : xG(d) : WZ(d)
          }

          function ZT(d) {
            if (!R3(d)) return hOe(d);
            var m = [];
            for (var T in mn(d)) sn.call(d, T) && T != "constructor" && m.push(T);
            return m
          }

          function uDe(d) {
            if (!Hn(d)) return VDe(d);
            var m = R3(d),
              T = [];
            for (var q in d) q == "constructor" && (m || !sn.call(d, q)) || T.push(q);
            return T
          }

          function YT(d, m) {
            return d < m
          }

          function _G(d, m) {
            var T = -1,
              q = Io(d) ? Me(d.length) : [];
            return ff(d, function (te, oe, pe) {
              q[++T] = m(te, oe, pe)
            }), q
          }

          function xG(d) {
            var m = dk(d);
            return m.length == 1 && m[0][2] ? rZ(m[0][0], m[0][1]) : function (T) {
              return T === d || GT(T, d, m)
            }
          }

          function CG(d, m) {
            return fk(d) && tZ(m) ? rZ(wu(d), m) : function (T) {
              var q = Ck(T, d);
              return q === r && q === m ? Ek(T, d) : I3(m, q, C | M)
            }
          }

          function G_(d, m, T, q, te) {
            d !== m && HT(m, function (oe, pe) {
              if (te || (te = new zc), Hn(oe)) dDe(d, m, pe, T, G_, q, te);
              else {
                var ve = q ? q(gk(d, pe), oe, pe + "", d, m, te) : r;
                ve === r && (ve = oe), WT(d, pe, ve)
              }
            }, To)
          }

          function dDe(d, m, T, q, te, oe, pe) {
            var ve = gk(d, T),
              Se = gk(m, T),
              Fe = pe.get(Se);
            if (Fe) {
              WT(d, T, Fe);
              return
            }
            var We = oe ? oe(ve, Se, T + "", d, m, pe) : r,
              Ge = We === r;
            if (Ge) {
              var _t = fr(Se),
                Ht = !_t && wf(Se),
                er = !_t && !Ht && Xm(Se);
              We = Se, _t || Ht || er ? fr(ve) ? We = ve : di(ve) ? We = So(ve) : Ht ? (Ge = !1, We = OG(Se, !0)) : er ? (Ge = !1, We = DG(Se, !0)) : We = [] : M3(Se) || Fp(Se) ? (We = ve, Fp(ve) ? We = MZ(ve) : (!Hn(ve) || Rd(ve)) && (We = eZ(Se))) : Ge = !1
            }
            Ge && (pe.set(Se, We), te(We, Se, q, oe, pe), pe.delete(Se)), WT(d, T, We)
          }

          function EG(d, m) {
            var T = d.length;
            if (T) return m += m < 0 ? T : 0, kd(m, T) ? d[m] : r
          }

          function AG(d, m, T) {
            m.length ? m = On(m, function (oe) {
              return fr(oe) ? function (pe) {
                return Bp(pe, oe.length === 1 ? oe[0] : oe)
              } : oe
            }) : m = [ko];
            var q = -1;
            m = On(m, Xo(Xt()));
            var te = _G(d, function (oe, pe, ve) {
              var Se = On(m, function (Fe) {
                return Fe(oe)
              });
              return {
                criteria: Se,
                index: ++q,
                value: oe
              }
            });
            return B$e(te, function (oe, pe) {
              return EDe(oe, pe, T)
            })
          }

          function hDe(d, m) {
            return SG(d, m, function (T, q) {
              return Ek(d, q)
            })
          }

          function SG(d, m, T) {
            for (var q = -1, te = m.length, oe = {}; ++q < te;) {
              var pe = m[q],
                ve = Bp(d, pe);
              T(ve, pe) && T3(oe, gf(pe, d), ve)
            }
            return oe
          }

          function fDe(d) {
            return function (m) {
              return Bp(m, d)
            }
          }

          function QT(d, m, T, q) {
            var te = q ? L$e : Wm,
              oe = -1,
              pe = m.length,
              ve = d;
            for (d === m && (m = So(m)), T && (ve = On(d, Xo(T))); ++oe < pe;)
              for (var Se = 0, Fe = m[oe], We = T ? T(Fe) : Fe;
                (Se = te(ve, We, Se, q)) > -1;) ve !== d && B_.call(ve, Se, 1), B_.call(d, Se, 1);
            return d
          }

          function IG(d, m) {
            for (var T = d ? m.length : 0, q = T - 1; T--;) {
              var te = m[T];
              if (T == q || te !== oe) {
                var oe = te;
                kd(te) ? B_.call(d, te, 1) : tk(d, te)
              }
            }
            return d
          }

          function JT(d, m) {
            return d + F_(aG() * (m - d + 1))
          }

          function pDe(d, m, T, q) {
            for (var te = -1, oe = Ni(j_((m - d) / (T || 1)), 0), pe = Me(oe); oe--;) pe[q ? oe : ++te] = d, d += T;
            return pe
          }

          function XT(d, m) {
            var T = "";
            if (!d || m < 1 || m > E) return T;
            do m % 2 && (T += d), m = F_(m / 2), m && (d += d); while (m);
            return T
          }

          function Er(d, m) {
            return mk(nZ(d, m, ko), d + "")
          }

          function gDe(d) {
            return uG(ew(d))
          }

          function mDe(d, m) {
            var T = ew(d);
            return i7(T, Lp(m, 0, T.length))
          }

          function T3(d, m, T, q) {
            if (!Hn(d)) return d;
            m = gf(m, d);
            for (var te = -1, oe = m.length, pe = oe - 1, ve = d; ve != null && ++te < oe;) {
              var Se = wu(m[te]),
                Fe = T;
              if (Se === "__proto__" || Se === "constructor" || Se === "prototype") return d;
              if (te != pe) {
                var We = ve[Se];
                Fe = q ? q(We, Se, ve) : r, Fe === r && (Fe = Hn(We) ? We : kd(m[te + 1]) ? [] : {})
              }
              E3(ve, Se, Fe), ve = ve[Se]
            }
            return d
          }
          var TG = W_ ? function (d, m) {
              return W_.set(d, m), d
            } : ko,
            wDe = U_ ? function (d, m) {
              return U_(d, "toString", {
                configurable: !0,
                enumerable: !1,
                value: Sk(m),
                writable: !0
              })
            } : ko;

          function vDe(d) {
            return i7(ew(d))
          }

          function Va(d, m, T) {
            var q = -1,
              te = d.length;
            m < 0 && (m = -m > te ? 0 : te + m), T = T > te ? te : T, T < 0 && (T += te), te = m > T ? 0 : T - m >>> 0, m >>>= 0;
            for (var oe = Me(te); ++q < te;) oe[q] = d[q + m];
            return oe
          }

          function bDe(d, m) {
            var T;
            return ff(d, function (q, te, oe) {
              return T = m(q, te, oe), !T
            }), !!T
          }

          function Z_(d, m, T) {
            var q = 0,
              te = d == null ? q : d.length;
            if (typeof m == "number" && m === m && te <= G) {
              for (; q < te;) {
                var oe = q + te >>> 1,
                  pe = d[oe];
                pe !== null && !ta(pe) && (T ? pe <= m : pe < m) ? q = oe + 1 : te = oe
              }
              return te
            }
            return ek(d, m, ko, T)
          }

          function ek(d, m, T, q) {
            var te = 0,
              oe = d == null ? 0 : d.length;
            if (oe === 0) return 0;
            m = T(m);
            for (var pe = m !== m, ve = m === null, Se = ta(m), Fe = m === r; te < oe;) {
              var We = F_((te + oe) / 2),
                Ge = T(d[We]),
                _t = Ge !== r,
                Ht = Ge === null,
                er = Ge === Ge,
                Cr = ta(Ge);
              if (pe) var tr = q || er;
              else Fe ? tr = er && (q || _t) : ve ? tr = er && _t && (q || !Ht) : Se ? tr = er && _t && !Ht && (q || !Cr) : Ht || Cr ? tr = !1 : tr = q ? Ge <= m : Ge < m;
              tr ? te = We + 1 : oe = We
            }
            return Ts(oe, A)
          }

          function kG(d, m) {
            for (var T = -1, q = d.length, te = 0, oe = []; ++T < q;) {
              var pe = d[T],
                ve = m ? m(pe) : pe;
              if (!T || !Hc(ve, Se)) {
                var Se = ve;
                oe[te++] = pe === 0 ? 0 : pe
              }
            }
            return oe
          }

          function RG(d) {
            return typeof d == "number" ? d : ta(d) ? _ : +d
          }

          function ea(d) {
            if (typeof d == "string") return d;
            if (fr(d)) return On(d, ea) + "";
            if (ta(d)) return cG ? cG.call(d) : "";
            var m = d + "";
            return m == "0" && 1 / d == -x ? "-0" : m
          }

          function pf(d, m, T) {
            var q = -1,
              te = T_,
              oe = d.length,
              pe = !0,
              ve = [],
              Se = ve;
            if (T) pe = !1, te = kT;
            else if (oe >= i) {
              var Fe = m ? null : RDe(d);
              if (Fe) return R_(Fe);
              pe = !1, te = v3, Se = new Dp
            } else Se = m ? [] : ve;
            e: for (; ++q < oe;) {
              var We = d[q],
                Ge = m ? m(We) : We;
              if (We = T || We !== 0 ? We : 0, pe && Ge === Ge) {
                for (var _t = Se.length; _t--;)
                  if (Se[_t] === Ge) continue e;
                m && Se.push(Ge), ve.push(We)
              } else te(Se, Ge, T) || (Se !== ve && Se.push(Ge), ve.push(We))
            }
            return ve
          }

          function tk(d, m) {
            return m = gf(m, d), d = iZ(d, m), d == null || delete d[wu(Ka(m))]
          }

          function NG(d, m, T, q) {
            return T3(d, m, T(Bp(d, m)), q)
          }

          function Y_(d, m, T, q) {
            for (var te = d.length, oe = q ? te : -1;
              (q ? oe-- : ++oe < te) && m(d[oe], oe, d););
            return T ? Va(d, q ? 0 : oe, q ? oe + 1 : te) : Va(d, q ? oe + 1 : 0, q ? te : oe)
          }

          function MG(d, m) {
            var T = d;
            return T instanceof $r && (T = T.value()), RT(m, function (q, te) {
              return te.func.apply(te.thisArg, uf([q], te.args))
            }, T)
          }

          function rk(d, m, T) {
            var q = d.length;
            if (q < 2) return q ? pf(d[0]) : [];
            for (var te = -1, oe = Me(q); ++te < q;)
              for (var pe = d[te], ve = -1; ++ve < q;) ve != te && (oe[te] = A3(oe[te] || pe, d[ve], m, T));
            return pf(fs(oe, 1), m, T)
          }

          function PG(d, m, T) {
            for (var q = -1, te = d.length, oe = m.length, pe = {}; ++q < te;) {
              var ve = q < oe ? m[q] : r;
              T(pe, d[q], ve)
            }
            return pe
          }

          function nk(d) {
            return di(d) ? d : []
          }

          function ik(d) {
            return typeof d == "function" ? d : ko
          }

          function gf(d, m) {
            return fr(d) ? d : fk(d, m) ? [d] : cZ(rn(d))
          }
          var yDe = Er;

          function mf(d, m, T) {
            var q = d.length;
            return T = T === r ? q : T, !m && T >= q ? d : Va(d, m, T)
          }
          var $G = aOe || function (d) {
            return Lr.clearTimeout(d)
          };

          function OG(d, m) {
            if (m) return d.slice();
            var T = d.length,
              q = rG ? rG(T) : new d.constructor(T);
            return d.copy(q), q
          }

          function sk(d) {
            var m = new d.constructor(d.byteLength);
            return new D_(m).set(new D_(d)), m
          }

          function _De(d, m) {
            var T = m ? sk(d.buffer) : d.buffer;
            return new d.constructor(T, d.byteOffset, d.byteLength)
          }

          function xDe(d) {
            var m = new d.constructor(d.source, Pt.exec(d));
            return m.lastIndex = d.lastIndex, m
          }

          function CDe(d) {
            return C3 ? mn(C3.call(d)) : {}
          }

          function DG(d, m) {
            var T = m ? sk(d.buffer) : d.buffer;
            return new d.constructor(T, d.byteOffset, d.length)
          }

          function LG(d, m) {
            if (d !== m) {
              var T = d !== r,
                q = d === null,
                te = d === d,
                oe = ta(d),
                pe = m !== r,
                ve = m === null,
                Se = m === m,
                Fe = ta(m);
              if (!ve && !Fe && !oe && d > m || oe && pe && Se && !ve && !Fe || q && pe && Se || !T && Se || !te) return 1;
              if (!q && !oe && !Fe && d < m || Fe && T && te && !q && !oe || ve && T && te || !pe && te || !Se) return -1
            }
            return 0
          }

          function EDe(d, m, T) {
            for (var q = -1, te = d.criteria, oe = m.criteria, pe = te.length, ve = T.length; ++q < pe;) {
              var Se = LG(te[q], oe[q]);
              if (Se) {
                if (q >= ve) return Se;
                var Fe = T[q];
                return Se * (Fe == "desc" ? -1 : 1)
              }
            }
            return d.index - m.index
          }

          function BG(d, m, T, q) {
            for (var te = -1, oe = d.length, pe = T.length, ve = -1, Se = m.length, Fe = Ni(oe - pe, 0), We = Me(Se + Fe), Ge = !q; ++ve < Se;) We[ve] = m[ve];
            for (; ++te < pe;)(Ge || te < oe) && (We[T[te]] = d[te]);
            for (; Fe--;) We[ve++] = d[te++];
            return We
          }

          function UG(d, m, T, q) {
            for (var te = -1, oe = d.length, pe = -1, ve = T.length, Se = -1, Fe = m.length, We = Ni(oe - ve, 0), Ge = Me(We + Fe), _t = !q; ++te < We;) Ge[te] = d[te];
            for (var Ht = te; ++Se < Fe;) Ge[Ht + Se] = m[Se];
            for (; ++pe < ve;)(_t || te < oe) && (Ge[Ht + T[pe]] = d[te++]);
            return Ge
          }

          function So(d, m) {
            var T = -1,
              q = d.length;
            for (m || (m = Me(q)); ++T < q;) m[T] = d[T];
            return m
          }

          function mu(d, m, T, q) {
            var te = !T;
            T || (T = {});
            for (var oe = -1, pe = m.length; ++oe < pe;) {
              var ve = m[oe],
                Se = q ? q(T[ve], d[ve], ve, T, d) : r;
              Se === r && (Se = d[ve]), te ? Sd(T, ve, Se) : E3(T, ve, Se)
            }
            return T
          }

          function ADe(d, m) {
            return mu(d, hk(d), m)
          }

          function SDe(d, m) {
            return mu(d, JG(d), m)
          }

          function Q_(d, m) {
            return function (T, q) {
              var te = fr(T) ? N$e : GOe,
                oe = m ? m() : {};
              return te(T, d, Xt(q, 2), oe)
            }
          }

          function Ym(d) {
            return Er(function (m, T) {
              var q = -1,
                te = T.length,
                oe = te > 1 ? T[te - 1] : r,
                pe = te > 2 ? T[2] : r;
              for (oe = d.length > 3 && typeof oe == "function" ? (te--, oe) : r, pe && Qs(T[0], T[1], pe) && (oe = te < 3 ? r : oe, te = 1), m = mn(m); ++q < te;) {
                var ve = T[q];
                ve && d(m, ve, q, oe)
              }
              return m
            })
          }

          function jG(d, m) {
            return function (T, q) {
              if (T == null) return T;
              if (!Io(T)) return d(T, q);
              for (var te = T.length, oe = m ? te : -1, pe = mn(T);
                (m ? oe-- : ++oe < te) && q(pe[oe], oe, pe) !== !1;);
              return T
            }
          }

          function FG(d) {
            return function (m, T, q) {
              for (var te = -1, oe = mn(m), pe = q(m), ve = pe.length; ve--;) {
                var Se = pe[d ? ve : ++te];
                if (T(oe[Se], Se, oe) === !1) break
              }
              return m
            }
          }

          function IDe(d, m, T) {
            var q = m & N,
              te = k3(d);

            function oe() {
              var pe = this && this !== Lr && this instanceof oe ? te : d;
              return pe.apply(q ? T : this, arguments)
            }
            return oe
          }

          function WG(d) {
            return function (m) {
              m = rn(m);
              var T = zm(m) ? Wc(m) : r,
                q = T ? T[0] : m.charAt(0),
                te = T ? mf(T, 1).join("") : m.slice(1);
              return q[d]() + te
            }
          }

          function Qm(d) {
            return function (m) {
              return RT(jZ(UZ(m).replace(m3, "")), d, "")
            }
          }

          function k3(d) {
            return function () {
              var m = arguments;
              switch (m.length) {
                case 0:
                  return new d;
                case 1:
                  return new d(m[0]);
                case 2:
                  return new d(m[0], m[1]);
                case 3:
                  return new d(m[0], m[1], m[2]);
                case 4:
                  return new d(m[0], m[1], m[2], m[3]);
                case 5:
                  return new d(m[0], m[1], m[2], m[3], m[4]);
                case 6:
                  return new d(m[0], m[1], m[2], m[3], m[4], m[5]);
                case 7:
                  return new d(m[0], m[1], m[2], m[3], m[4], m[5], m[6])
              }
              var T = Zm(d.prototype),
                q = d.apply(T, m);
              return Hn(q) ? q : T
            }
          }

          function TDe(d, m, T) {
            var q = k3(d);

            function te() {
              for (var oe = arguments.length, pe = Me(oe), ve = oe, Se = Jm(te); ve--;) pe[ve] = arguments[ve];
              var Fe = oe < 3 && pe[0] !== Se && pe[oe - 1] !== Se ? [] : df(pe, Se);
              if (oe -= Fe.length, oe < T) return KG(d, m, J_, te.placeholder, r, pe, Fe, r, r, T - oe);
              var We = this && this !== Lr && this instanceof te ? q : d;
              return Xi(We, this, pe)
            }
            return te
          }

          function zG(d) {
            return function (m, T, q) {
              var te = mn(m);
              if (!Io(m)) {
                var oe = Xt(T, 3);
                m = es(m), T = function (ve) {
                  return oe(te[ve], ve, te)
                }
              }
              var pe = d(m, T, q);
              return pe > -1 ? te[oe ? m[pe] : pe] : r
            }
          }

          function HG(d) {
            return Td(function (m) {
              var T = m.length,
                q = T,
                te = Ha.prototype.thru;
              for (d && m.reverse(); q--;) {
                var oe = m[q];
                if (typeof oe != "function") throw new za(o);
                if (te && !pe && r7(oe) == "wrapper") var pe = new Ha([], !0)
              }
              for (q = pe ? q : T; ++q < T;) {
                oe = m[q];
                var ve = r7(oe),
                  Se = ve == "wrapper" ? uk(oe) : r;
                Se && pk(Se[0]) && Se[1] == (R | B | D | P) && !Se[4].length && Se[9] == 1 ? pe = pe[r7(Se[0])].apply(pe, Se[3]) : pe = oe.length == 1 && pk(oe) ? pe[ve]() : pe.thru(oe)
              }
              return function () {
                var Fe = arguments,
                  We = Fe[0];
                if (pe && Fe.length == 1 && fr(We)) return pe.plant(We).value();
                for (var Ge = 0, _t = T ? m[Ge].apply(this, Fe) : We; ++Ge < T;) _t = m[Ge].call(this, _t);
                return _t
              }
            })
          }

          function J_(d, m, T, q, te, oe, pe, ve, Se, Fe) {
            var We = m & R,
              Ge = m & N,
              _t = m & $,
              Ht = m & (B | F),
              er = m & j,
              Cr = _t ? r : k3(d);

            function tr() {
              for (var kr = arguments.length, Br = Me(kr), ra = kr; ra--;) Br[ra] = arguments[ra];
              if (Ht) var Js = Jm(tr),
                na = j$e(Br, Js);
              if (q && (Br = BG(Br, q, te, Ht)), oe && (Br = UG(Br, oe, pe, Ht)), kr -= na, Ht && kr < Fe) {
                var hi = df(Br, Js);
                return KG(d, m, J_, tr.placeholder, T, Br, hi, ve, Se, Fe - kr)
              }
              var qc = Ge ? T : this,
                Md = _t ? qc[d] : d;
              return kr = Br.length, ve ? Br = GDe(Br, ve) : er && kr > 1 && Br.reverse(), We && Se < kr && (Br.length = Se), this && this !== Lr && this instanceof tr && (Md = Cr || k3(Md)), Md.apply(qc, Br)
            }
            return tr
          }

          function qG(d, m) {
            return function (T, q) {
              return rDe(T, d, m(q), {})
            }
          }

          function X_(d, m) {
            return function (T, q) {
              var te;
              if (T === r && q === r) return m;
              if (T !== r && (te = T), q !== r) {
                if (te === r) return q;
                typeof T == "string" || typeof q == "string" ? (T = ea(T), q = ea(q)) : (T = RG(T), q = RG(q)), te = d(T, q)
              }
              return te
            }
          }

          function ok(d) {
            return Td(function (m) {
              return m = On(m, Xo(Xt())), Er(function (T) {
                var q = this;
                return d(m, function (te) {
                  return Xi(te, q, T)
                })
              })
            })
          }

          function e7(d, m) {
            m = m === r ? " " : ea(m);
            var T = m.length;
            if (T < 2) return T ? XT(m, d) : m;
            var q = XT(m, j_(d / Hm(m)));
            return zm(m) ? mf(Wc(q), 0, d).join("") : q.slice(0, d)
          }

          function kDe(d, m, T, q) {
            var te = m & N,
              oe = k3(d);

            function pe() {
              for (var ve = -1, Se = arguments.length, Fe = -1, We = q.length, Ge = Me(We + Se), _t = this && this !== Lr && this instanceof pe ? oe : d; ++Fe < We;) Ge[Fe] = q[Fe];
              for (; Se--;) Ge[Fe++] = arguments[++ve];
              return Xi(_t, te ? T : this, Ge)
            }
            return pe
          }

          function VG(d) {
            return function (m, T, q) {
              return q && typeof q != "number" && Qs(m, T, q) && (T = q = r), m = Nd(m), T === r ? (T = m, m = 0) : T = Nd(T), q = q === r ? m < T ? 1 : -1 : Nd(q), pDe(m, T, q, d)
            }
          }

          function t7(d) {
            return function (m, T) {
              return typeof m == "string" && typeof T == "string" || (m = Ga(m), T = Ga(T)), d(m, T)
            }
          }

          function KG(d, m, T, q, te, oe, pe, ve, Se, Fe) {
            var We = m & B,
              Ge = We ? pe : r,
              _t = We ? r : pe,
              Ht = We ? oe : r,
              er = We ? r : oe;
            m |= We ? D : V, m &= ~(We ? V : D), m & k || (m &= ~(N | $));
            var Cr = [d, m, te, Ht, Ge, er, _t, ve, Se, Fe],
              tr = T.apply(r, Cr);
            return pk(d) && sZ(tr, Cr), tr.placeholder = q, oZ(tr, d, m)
          }

          function ak(d) {
            var m = Ri[d];
            return function (T, q) {
              if (T = Ga(T), q = q == null ? 0 : Ts(yr(q), 292), q && oG(T)) {
                var te = (rn(T) + "e").split("e"),
                  oe = m(te[0] + "e" + (+te[1] + q));
                return te = (rn(oe) + "e").split("e"), +(te[0] + "e" + (+te[1] - q))
              }
              return m(T)
            }
          }
          var RDe = Km && 1 / R_(new Km([, -0]))[1] == x ? function (d) {
            return new Km(d)
          } : kk;

          function GG(d) {
            return function (m) {
              var T = ks(m);
              return T == ge ? LT(m) : T == qe ? K$e(m) : U$e(m, d(m))
            }
          }

          function Id(d, m, T, q, te, oe, pe, ve) {
            var Se = m & $;
            if (!Se && typeof d != "function") throw new za(o);
            var Fe = q ? q.length : 0;
            if (Fe || (m &= ~(D | V), q = te = r), pe = pe === r ? pe : Ni(yr(pe), 0), ve = ve === r ? ve : yr(ve), Fe -= te ? te.length : 0, m & V) {
              var We = q,
                Ge = te;
              q = te = r
            }
            var _t = Se ? r : uk(d),
              Ht = [d, m, T, q, te, We, Ge, oe, pe, ve];
            if (_t && qDe(Ht, _t), d = Ht[0], m = Ht[1], T = Ht[2], q = Ht[3], te = Ht[4], ve = Ht[9] = Ht[9] === r ? Se ? 0 : d.length : Ni(Ht[9] - Fe, 0), !ve && m & (B | F) && (m &= ~(B | F)), !m || m == N) var er = IDe(d, m, T);
            else m == B || m == F ? er = TDe(d, m, ve) : (m == D || m == (N | D)) && !te.length ? er = kDe(d, m, T, q) : er = J_.apply(r, Ht);
            var Cr = _t ? TG : sZ;
            return oZ(Cr(er, Ht), d, m)
          }

          function ZG(d, m, T, q) {
            return d === r || Hc(d, Vm[T]) && !sn.call(q, T) ? m : d
          }

          function YG(d, m, T, q, te, oe) {
            return Hn(d) && Hn(m) && (oe.set(m, d), G_(d, m, r, YG, oe), oe.delete(m)), d
          }

          function NDe(d) {
            return M3(d) ? r : d
          }

          function QG(d, m, T, q, te, oe) {
            var pe = T & C,
              ve = d.length,
              Se = m.length;
            if (ve != Se && !(pe && Se > ve)) return !1;
            var Fe = oe.get(d),
              We = oe.get(m);
            if (Fe && We) return Fe == m && We == d;
            var Ge = -1,
              _t = !0,
              Ht = T & M ? new Dp : r;
            for (oe.set(d, m), oe.set(m, d); ++Ge < ve;) {
              var er = d[Ge],
                Cr = m[Ge];
              if (q) var tr = pe ? q(Cr, er, Ge, m, d, oe) : q(er, Cr, Ge, d, m, oe);
              if (tr !== r) {
                if (tr) continue;
                _t = !1;
                break
              }
              if (Ht) {
                if (!NT(m, function (kr, Br) {
                    if (!v3(Ht, Br) && (er === kr || te(er, kr, T, q, oe))) return Ht.push(Br)
                  })) {
                  _t = !1;
                  break
                }
              } else if (!(er === Cr || te(er, Cr, T, q, oe))) {
                _t = !1;
                break
              }
            }
            return oe.delete(d), oe.delete(m), _t
          }

          function MDe(d, m, T, q, te, oe, pe) {
            switch (T) {
              case L:
                if (d.byteLength != m.byteLength || d.byteOffset != m.byteOffset) return !1;
                d = d.buffer, m = m.buffer;
              case J:
                return !(d.byteLength != m.byteLength || !oe(new D_(d), new D_(m)));
              case ee:
              case ne:
              case Te:
                return Hc(+d, +m);
              case H:
                return d.name == m.name && d.message == m.message;
              case Ze:
              case He:
                return d == m + "";
              case ge:
                var ve = LT;
              case qe:
                var Se = q & C;
                if (ve || (ve = R_), d.size != m.size && !Se) return !1;
                var Fe = pe.get(d);
                if (Fe) return Fe == m;
                q |= M, pe.set(d, m);
                var We = QG(ve(d), ve(m), q, te, oe, pe);
                return pe.delete(d), We;
              case we:
                if (C3) return C3.call(d) == C3.call(m)
            }
            return !1
          }

          function PDe(d, m, T, q, te, oe) {
            var pe = T & C,
              ve = ck(d),
              Se = ve.length,
              Fe = ck(m),
              We = Fe.length;
            if (Se != We && !pe) return !1;
            for (var Ge = Se; Ge--;) {
              var _t = ve[Ge];
              if (!(pe ? _t in m : sn.call(m, _t))) return !1
            }
            var Ht = oe.get(d),
              er = oe.get(m);
            if (Ht && er) return Ht == m && er == d;
            var Cr = !0;
            oe.set(d, m), oe.set(m, d);
            for (var tr = pe; ++Ge < Se;) {
              _t = ve[Ge];
              var kr = d[_t],
                Br = m[_t];
              if (q) var ra = pe ? q(Br, kr, _t, m, d, oe) : q(kr, Br, _t, d, m, oe);
              if (!(ra === r ? kr === Br || te(kr, Br, T, q, oe) : ra)) {
                Cr = !1;
                break
              }
              tr || (tr = _t == "constructor")
            }
            if (Cr && !tr) {
              var Js = d.constructor,
                na = m.constructor;
              Js != na && "constructor" in d && "constructor" in m && !(typeof Js == "function" && Js instanceof Js && typeof na == "function" && na instanceof na) && (Cr = !1)
            }
            return oe.delete(d), oe.delete(m), Cr
          }

          function Td(d) {
            return mk(nZ(d, r, hZ), d + "")
          }

          function ck(d) {
            return wG(d, es, hk)
          }

          function lk(d) {
            return wG(d, To, JG)
          }
          var uk = W_ ? function (d) {
            return W_.get(d)
          } : kk;

          function r7(d) {
            for (var m = d.name + "", T = Gm[m], q = sn.call(Gm, m) ? T.length : 0; q--;) {
              var te = T[q],
                oe = te.func;
              if (oe == null || oe == d) return te.name
            }
            return m
          }

          function Jm(d) {
            var m = sn.call(se, "placeholder") ? se : d;
            return m.placeholder
          }

          function Xt() {
            var d = se.iteratee || Ik;
            return d = d === Ik ? yG : d, arguments.length ? d(arguments[0], arguments[1]) : d
          }

          function n7(d, m) {
            var T = d.__data__;
            return FDe(m) ? T[typeof m == "string" ? "string" : "hash"] : T.map
          }

          function dk(d) {
            for (var m = es(d), T = m.length; T--;) {
              var q = m[T],
                te = d[q];
              m[T] = [q, te, tZ(te)]
            }
            return m
          }

          function Up(d, m) {
            var T = H$e(d, m);
            return bG(T) ? T : r
          }

          function $De(d) {
            var m = sn.call(d, $p),
              T = d[$p];
            try {
              d[$p] = r;
              var q = !0
            } catch {}
            var te = $_.call(d);
            return q && (m ? d[$p] = T : delete d[$p]), te
          }
          var hk = UT ? function (d) {
              return d == null ? [] : (d = mn(d), lf(UT(d), function (m) {
                return iG.call(d, m)
              }))
            } : Rk,
            JG = UT ? function (d) {
              for (var m = []; d;) uf(m, hk(d)), d = L_(d);
              return m
            } : Rk,
            ks = Ys;
          (jT && ks(new jT(new ArrayBuffer(1))) != L || y3 && ks(new y3) != ge || FT && ks(FT.resolve()) != et || Km && ks(new Km) != qe || _3 && ks(new _3) != Ie) && (ks = function (d) {
            var m = Ys(d),
              T = m == De ? d.constructor : r,
              q = T ? jp(T) : "";
            if (q) switch (q) {
              case mOe:
                return L;
              case wOe:
                return ge;
              case vOe:
                return et;
              case bOe:
                return qe;
              case yOe:
                return Ie
            }
            return m
          });

          function ODe(d, m, T) {
            for (var q = -1, te = T.length; ++q < te;) {
              var oe = T[q],
                pe = oe.size;
              switch (oe.type) {
                case "drop":
                  d += pe;
                  break;
                case "dropRight":
                  m -= pe;
                  break;
                case "take":
                  m = Ts(m, d + pe);
                  break;
                case "takeRight":
                  d = Ni(d, m - pe);
                  break
              }
            }
            return {
              start: d,
              end: m
            }
          }

          function DDe(d) {
            var m = d.match(st);
            return m ? m[1].split(At) : []
          }

          function XG(d, m, T) {
            m = gf(m, d);
            for (var q = -1, te = m.length, oe = !1; ++q < te;) {
              var pe = wu(m[q]);
              if (!(oe = d != null && T(d, pe))) break;
              d = d[pe]
            }
            return oe || ++q != te ? oe : (te = d == null ? 0 : d.length, !!te && u7(te) && kd(pe, te) && (fr(d) || Fp(d)))
          }

          function LDe(d) {
            var m = d.length,
              T = new d.constructor(m);
            return m && typeof d[0] == "string" && sn.call(d, "index") && (T.index = d.index, T.input = d.input), T
          }

          function eZ(d) {
            return typeof d.constructor == "function" && !R3(d) ? Zm(L_(d)) : {}
          }

          function BDe(d, m, T) {
            var q = d.constructor;
            switch (m) {
              case J:
                return sk(d);
              case ee:
              case ne:
                return new q(+d);
              case L:
                return _De(d, T);
              case z:
              case ie:
              case ue:
              case me:
              case be:
              case Le:
              case ze:
              case Qe:
              case Xe:
                return DG(d, T);
              case ge:
                return new q;
              case Te:
              case He:
                return new q(d);
              case Ze:
                return xDe(d);
              case qe:
                return new q;
              case we:
                return CDe(d)
            }
          }

          function UDe(d, m) {
            var T = m.length;
            if (!T) return d;
            var q = T - 1;
            return m[q] = (T > 1 ? "& " : "") + m[q], m = m.join(T > 2 ? ", " : " "), d.replace(bt, `{
  /* [wrapped with ` + m + `] */
  `)
          }

          function jDe(d) {
            return fr(d) || Fp(d) || !!(sG && d && d[sG])
          }

          function kd(d, m) {
            var T = typeof d;
            return m = m ?? E, !!m && (T == "number" || T != "symbol" && $n.test(d)) && d > -1 && d % 1 == 0 && d < m
          }

          function Qs(d, m, T) {
            if (!Hn(T)) return !1;
            var q = typeof m;
            return (q == "number" ? Io(T) && kd(m, T.length) : q == "string" && m in T) ? Hc(T[m], d) : !1
          }

          function fk(d, m) {
            if (fr(d)) return !1;
            var T = typeof d;
            return T == "number" || T == "symbol" || T == "boolean" || d == null || ta(d) ? !0 : xt.test(d) || !lt.test(d) || m != null && d in mn(m)
          }

          function FDe(d) {
            var m = typeof d;
            return m == "string" || m == "number" || m == "symbol" || m == "boolean" ? d !== "__proto__" : d === null
          }

          function pk(d) {
            var m = r7(d),
              T = se[m];
            if (typeof T != "function" || !(m in $r.prototype)) return !1;
            if (d === T) return !0;
            var q = uk(T);
            return !!q && d === q[0]
          }

          function WDe(d) {
            return !!tG && tG in d
          }
          var zDe = M_ ? Rd : Nk;

          function R3(d) {
            var m = d && d.constructor,
              T = typeof m == "function" && m.prototype || Vm;
            return d === T
          }

          function tZ(d) {
            return d === d && !Hn(d)
          }

          function rZ(d, m) {
            return function (T) {
              return T == null ? !1 : T[d] === m && (m !== r || d in mn(T))
            }
          }

          function HDe(d) {
            var m = c7(d, function (q) {
                return T.size === l && T.clear(), q
              }),
              T = m.cache;
            return m
          }

          function qDe(d, m) {
            var T = d[1],
              q = m[1],
              te = T | q,
              oe = te < (N | $ | R),
              pe = q == R && T == B || q == R && T == P && d[7].length <= m[8] || q == (R | P) && m[7].length <= m[8] && T == B;
            if (!(oe || pe)) return d;
            q & N && (d[2] = m[2], te |= T & N ? 0 : k);
            var ve = m[3];
            if (ve) {
              var Se = d[3];
              d[3] = Se ? BG(Se, ve, m[4]) : ve, d[4] = Se ? df(d[3], h) : m[4]
            }
            return ve = m[5], ve && (Se = d[5], d[5] = Se ? UG(Se, ve, m[6]) : ve, d[6] = Se ? df(d[5], h) : m[6]), ve = m[7], ve && (d[7] = ve), q & R && (d[8] = d[8] == null ? m[8] : Ts(d[8], m[8])), d[9] == null && (d[9] = m[9]), d[0] = m[0], d[1] = te, d
          }

          function VDe(d) {
            var m = [];
            if (d != null)
              for (var T in mn(d)) m.push(T);
            return m
          }

          function KDe(d) {
            return $_.call(d)
          }

          function nZ(d, m, T) {
            return m = Ni(m === r ? d.length - 1 : m, 0),
              function () {
                for (var q = arguments, te = -1, oe = Ni(q.length - m, 0), pe = Me(oe); ++te < oe;) pe[te] = q[m + te];
                te = -1;
                for (var ve = Me(m + 1); ++te < m;) ve[te] = q[te];
                return ve[m] = T(pe), Xi(d, this, ve)
              }
          }

          function iZ(d, m) {
            return m.length < 2 ? d : Bp(d, Va(m, 0, -1))
          }

          function GDe(d, m) {
            for (var T = d.length, q = Ts(m.length, T), te = So(d); q--;) {
              var oe = m[q];
              d[q] = kd(oe, T) ? te[oe] : r
            }
            return d
          }

          function gk(d, m) {
            if (!(m === "constructor" && typeof d[m] == "function") && m != "__proto__") return d[m]
          }
          var sZ = aZ(TG),
            N3 = lOe || function (d, m) {
              return Lr.setTimeout(d, m)
            },
            mk = aZ(wDe);

          function oZ(d, m, T) {
            var q = m + "";
            return mk(d, UDe(q, ZDe(DDe(q), T)))
          }

          function aZ(d) {
            var m = 0,
              T = 0;
            return function () {
              var q = fOe(),
                te = g - (q - T);
              if (T = q, te > 0) {
                if (++m >= I) return arguments[0]
              } else m = 0;
              return d.apply(r, arguments)
            }
          }

          function i7(d, m) {
            var T = -1,
              q = d.length,
              te = q - 1;
            for (m = m === r ? q : m; ++T < m;) {
              var oe = JT(T, te),
                pe = d[oe];
              d[oe] = d[T], d[T] = pe
            }
            return d.length = m, d
          }
          var cZ = HDe(function (d) {
            var m = [];
            return d.charCodeAt(0) === 46 && m.push(""), d.replace(Ct, function (T, q, te, oe) {
              m.push(te ? oe.replace(Zt, "$1") : q || T)
            }), m
          });

          function wu(d) {
            if (typeof d == "string" || ta(d)) return d;
            var m = d + "";
            return m == "0" && 1 / d == -x ? "-0" : m
          }

          function jp(d) {
            if (d != null) {
              try {
                return P_.call(d)
              } catch {}
              try {
                return d + ""
              } catch {}
            }
            return ""
          }

          function ZDe(d, m) {
            return Wa(ce, function (T) {
              var q = "_." + T[0];
              m & T[1] && !T_(d, q) && d.push(q)
            }), d.sort()
          }

          function lZ(d) {
            if (d instanceof $r) return d.clone();
            var m = new Ha(d.__wrapped__, d.__chain__);
            return m.__actions__ = So(d.__actions__), m.__index__ = d.__index__, m.__values__ = d.__values__, m
          }

          function YDe(d, m, T) {
            (T ? Qs(d, m, T) : m === r) ? m = 1: m = Ni(yr(m), 0);
            var q = d == null ? 0 : d.length;
            if (!q || m < 1) return [];
            for (var te = 0, oe = 0, pe = Me(j_(q / m)); te < q;) pe[oe++] = Va(d, te, te += m);
            return pe
          }

          function QDe(d) {
            for (var m = -1, T = d == null ? 0 : d.length, q = 0, te = []; ++m < T;) {
              var oe = d[m];
              oe && (te[q++] = oe)
            }
            return te
          }

          function JDe() {
            var d = arguments.length;
            if (!d) return [];
            for (var m = Me(d - 1), T = arguments[0], q = d; q--;) m[q - 1] = arguments[q];
            return uf(fr(T) ? So(T) : [T], fs(m, 1))
          }
          var XDe = Er(function (d, m) {
              return di(d) ? A3(d, fs(m, 1, di, !0)) : []
            }),
            eLe = Er(function (d, m) {
              var T = Ka(m);
              return di(T) && (T = r), di(d) ? A3(d, fs(m, 1, di, !0), Xt(T, 2)) : []
            }),
            tLe = Er(function (d, m) {
              var T = Ka(m);
              return di(T) && (T = r), di(d) ? A3(d, fs(m, 1, di, !0), r, T) : []
            });

          function rLe(d, m, T) {
            var q = d == null ? 0 : d.length;
            return q ? (m = T || m === r ? 1 : yr(m), Va(d, m < 0 ? 0 : m, q)) : []
          }

          function nLe(d, m, T) {
            var q = d == null ? 0 : d.length;
            return q ? (m = T || m === r ? 1 : yr(m), m = q - m, Va(d, 0, m < 0 ? 0 : m)) : []
          }

          function iLe(d, m) {
            return d && d.length ? Y_(d, Xt(m, 3), !0, !0) : []
          }

          function sLe(d, m) {
            return d && d.length ? Y_(d, Xt(m, 3), !0) : []
          }

          function oLe(d, m, T, q) {
            var te = d == null ? 0 : d.length;
            return te ? (T && typeof T != "number" && Qs(d, m, T) && (T = 0, q = te), JOe(d, m, T, q)) : []
          }

          function uZ(d, m, T) {
            var q = d == null ? 0 : d.length;
            if (!q) return -1;
            var te = T == null ? 0 : yr(T);
            return te < 0 && (te = Ni(q + te, 0)), k_(d, Xt(m, 3), te)
          }

          function dZ(d, m, T) {
            var q = d == null ? 0 : d.length;
            if (!q) return -1;
            var te = q - 1;
            return T !== r && (te = yr(T), te = T < 0 ? Ni(q + te, 0) : Ts(te, q - 1)), k_(d, Xt(m, 3), te, !0)
          }

          function hZ(d) {
            var m = d == null ? 0 : d.length;
            return m ? fs(d, 1) : []
          }

          function aLe(d) {
            var m = d == null ? 0 : d.length;
            return m ? fs(d, x) : []
          }

          function cLe(d, m) {
            var T = d == null ? 0 : d.length;
            return T ? (m = m === r ? 1 : yr(m), fs(d, m)) : []
          }

          function lLe(d) {
            for (var m = -1, T = d == null ? 0 : d.length, q = {}; ++m < T;) {
              var te = d[m];
              q[te[0]] = te[1]
            }
            return q
          }

          function fZ(d) {
            return d && d.length ? d[0] : r
          }

          function uLe(d, m, T) {
            var q = d == null ? 0 : d.length;
            if (!q) return -1;
            var te = T == null ? 0 : yr(T);
            return te < 0 && (te = Ni(q + te, 0)), Wm(d, m, te)
          }

          function dLe(d) {
            var m = d == null ? 0 : d.length;
            return m ? Va(d, 0, -1) : []
          }
          var hLe = Er(function (d) {
              var m = On(d, nk);
              return m.length && m[0] === d[0] ? KT(m) : []
            }),
            fLe = Er(function (d) {
              var m = Ka(d),
                T = On(d, nk);
              return m === Ka(T) ? m = r : T.pop(), T.length && T[0] === d[0] ? KT(T, Xt(m, 2)) : []
            }),
            pLe = Er(function (d) {
              var m = Ka(d),
                T = On(d, nk);
              return m = typeof m == "function" ? m : r, m && T.pop(), T.length && T[0] === d[0] ? KT(T, r, m) : []
            });

          function gLe(d, m) {
            return d == null ? "" : dOe.call(d, m)
          }

          function Ka(d) {
            var m = d == null ? 0 : d.length;
            return m ? d[m - 1] : r
          }

          function mLe(d, m, T) {
            var q = d == null ? 0 : d.length;
            if (!q) return -1;
            var te = q;
            return T !== r && (te = yr(T), te = te < 0 ? Ni(q + te, 0) : Ts(te, q - 1)), m === m ? Z$e(d, m, te) : k_(d, KK, te, !0)
          }

          function wLe(d, m) {
            return d && d.length ? EG(d, yr(m)) : r
          }
          var vLe = Er(pZ);

          function pZ(d, m) {
            return d && d.length && m && m.length ? QT(d, m) : d
          }

          function bLe(d, m, T) {
            return d && d.length && m && m.length ? QT(d, m, Xt(T, 2)) : d
          }

          function yLe(d, m, T) {
            return d && d.length && m && m.length ? QT(d, m, r, T) : d
          }
          var _Le = Td(function (d, m) {
            var T = d == null ? 0 : d.length,
              q = zT(d, m);
            return IG(d, On(m, function (te) {
              return kd(te, T) ? +te : te
            }).sort(LG)), q
          });

          function xLe(d, m) {
            var T = [];
            if (!(d && d.length)) return T;
            var q = -1,
              te = [],
              oe = d.length;
            for (m = Xt(m, 3); ++q < oe;) {
              var pe = d[q];
              m(pe, q, d) && (T.push(pe), te.push(q))
            }
            return IG(d, te), T
          }

          function wk(d) {
            return d == null ? d : gOe.call(d)
          }

          function CLe(d, m, T) {
            var q = d == null ? 0 : d.length;
            return q ? (T && typeof T != "number" && Qs(d, m, T) ? (m = 0, T = q) : (m = m == null ? 0 : yr(m), T = T === r ? q : yr(T)), Va(d, m, T)) : []
          }

          function ELe(d, m) {
            return Z_(d, m)
          }

          function ALe(d, m, T) {
            return ek(d, m, Xt(T, 2))
          }

          function SLe(d, m) {
            var T = d == null ? 0 : d.length;
            if (T) {
              var q = Z_(d, m);
              if (q < T && Hc(d[q], m)) return q
            }
            return -1
          }

          function ILe(d, m) {
            return Z_(d, m, !0)
          }

          function TLe(d, m, T) {
            return ek(d, m, Xt(T, 2), !0)
          }

          function kLe(d, m) {
            var T = d == null ? 0 : d.length;
            if (T) {
              var q = Z_(d, m, !0) - 1;
              if (Hc(d[q], m)) return q
            }
            return -1
          }

          function RLe(d) {
            return d && d.length ? kG(d) : []
          }

          function NLe(d, m) {
            return d && d.length ? kG(d, Xt(m, 2)) : []
          }

          function MLe(d) {
            var m = d == null ? 0 : d.length;
            return m ? Va(d, 1, m) : []
          }

          function PLe(d, m, T) {
            return d && d.length ? (m = T || m === r ? 1 : yr(m), Va(d, 0, m < 0 ? 0 : m)) : []
          }

          function $Le(d, m, T) {
            var q = d == null ? 0 : d.length;
            return q ? (m = T || m === r ? 1 : yr(m), m = q - m, Va(d, m < 0 ? 0 : m, q)) : []
          }

          function OLe(d, m) {
            return d && d.length ? Y_(d, Xt(m, 3), !1, !0) : []
          }

          function DLe(d, m) {
            return d && d.length ? Y_(d, Xt(m, 3)) : []
          }
          var LLe = Er(function (d) {
              return pf(fs(d, 1, di, !0))
            }),
            BLe = Er(function (d) {
              var m = Ka(d);
              return di(m) && (m = r), pf(fs(d, 1, di, !0), Xt(m, 2))
            }),
            ULe = Er(function (d) {
              var m = Ka(d);
              return m = typeof m == "function" ? m : r, pf(fs(d, 1, di, !0), r, m)
            });

          function jLe(d) {
            return d && d.length ? pf(d) : []
          }

          function FLe(d, m) {
            return d && d.length ? pf(d, Xt(m, 2)) : []
          }

          function WLe(d, m) {
            return m = typeof m == "function" ? m : r, d && d.length ? pf(d, r, m) : []
          }

          function vk(d) {
            if (!(d && d.length)) return [];
            var m = 0;
            return d = lf(d, function (T) {
              if (di(T)) return m = Ni(T.length, m), !0
            }), OT(m, function (T) {
              return On(d, MT(T))
            })
          }

          function gZ(d, m) {
            if (!(d && d.length)) return [];
            var T = vk(d);
            return m == null ? T : On(T, function (q) {
              return Xi(m, r, q)
            })
          }
          var zLe = Er(function (d, m) {
              return di(d) ? A3(d, m) : []
            }),
            HLe = Er(function (d) {
              return rk(lf(d, di))
            }),
            qLe = Er(function (d) {
              var m = Ka(d);
              return di(m) && (m = r), rk(lf(d, di), Xt(m, 2))
            }),
            VLe = Er(function (d) {
              var m = Ka(d);
              return m = typeof m == "function" ? m : r, rk(lf(d, di), r, m)
            }),
            KLe = Er(vk);

          function GLe(d, m) {
            return PG(d || [], m || [], E3)
          }

          function ZLe(d, m) {
            return PG(d || [], m || [], T3)
          }
          var YLe = Er(function (d) {
            var m = d.length,
              T = m > 1 ? d[m - 1] : r;
            return T = typeof T == "function" ? (d.pop(), T) : r, gZ(d, T)
          });

          function mZ(d) {
            var m = se(d);
            return m.__chain__ = !0, m
          }

          function QLe(d, m) {
            return m(d), d
          }

          function s7(d, m) {
            return m(d)
          }
          var JLe = Td(function (d) {
            var m = d.length,
              T = m ? d[0] : 0,
              q = this.__wrapped__,
              te = function (oe) {
                return zT(oe, d)
              };
            return m > 1 || this.__actions__.length || !(q instanceof $r) || !kd(T) ? this.thru(te) : (q = q.slice(T, +T + (m ? 1 : 0)), q.__actions__.push({
              func: s7,
              args: [te],
              thisArg: r
            }), new Ha(q, this.__chain__).thru(function (oe) {
              return m && !oe.length && oe.push(r), oe
            }))
          });

          function XLe() {
            return mZ(this)
          }

          function eBe() {
            return new Ha(this.value(), this.__chain__)
          }

          function tBe() {
            this.__values__ === r && (this.__values__ = RZ(this.value()));
            var d = this.__index__ >= this.__values__.length,
              m = d ? r : this.__values__[this.__index__++];
            return {
              done: d,
              value: m
            }
          }

          function rBe() {
            return this
          }

          function nBe(d) {
            for (var m, T = this; T instanceof H_;) {
              var q = lZ(T);
              q.__index__ = 0, q.__values__ = r, m ? te.__wrapped__ = q : m = q;
              var te = q;
              T = T.__wrapped__
            }
            return te.__wrapped__ = d, m
          }

          function iBe() {
            var d = this.__wrapped__;
            if (d instanceof $r) {
              var m = d;
              return this.__actions__.length && (m = new $r(this)), m = m.reverse(), m.__actions__.push({
                func: s7,
                args: [wk],
                thisArg: r
              }), new Ha(m, this.__chain__)
            }
            return this.thru(wk)
          }

          function sBe() {
            return MG(this.__wrapped__, this.__actions__)
          }
          var oBe = Q_(function (d, m, T) {
            sn.call(d, T) ? ++d[T] : Sd(d, T, 1)
          });

          function aBe(d, m, T) {
            var q = fr(d) ? qK : QOe;
            return T && Qs(d, m, T) && (m = r), q(d, Xt(m, 3))
          }

          function cBe(d, m) {
            var T = fr(d) ? lf : gG;
            return T(d, Xt(m, 3))
          }
          var lBe = zG(uZ),
            uBe = zG(dZ);

          function dBe(d, m) {
            return fs(o7(d, m), 1)
          }

          function hBe(d, m) {
            return fs(o7(d, m), x)
          }

          function fBe(d, m, T) {
            return T = T === r ? 1 : yr(T), fs(o7(d, m), T)
          }

          function wZ(d, m) {
            var T = fr(d) ? Wa : ff;
            return T(d, Xt(m, 3))
          }

          function vZ(d, m) {
            var T = fr(d) ? M$e : pG;
            return T(d, Xt(m, 3))
          }
          var pBe = Q_(function (d, m, T) {
            sn.call(d, T) ? d[T].push(m) : Sd(d, T, [m])
          });

          function gBe(d, m, T, q) {
            d = Io(d) ? d : ew(d), T = T && !q ? yr(T) : 0;
            var te = d.length;
            return T < 0 && (T = Ni(te + T, 0)), d7(d) ? T <= te && d.indexOf(m, T) > -1 : !!te && Wm(d, m, T) > -1
          }
          var mBe = Er(function (d, m, T) {
              var q = -1,
                te = typeof m == "function",
                oe = Io(d) ? Me(d.length) : [];
              return ff(d, function (pe) {
                oe[++q] = te ? Xi(m, pe, T) : S3(pe, m, T)
              }), oe
            }),
            wBe = Q_(function (d, m, T) {
              Sd(d, T, m)
            });

          function o7(d, m) {
            var T = fr(d) ? On : _G;
            return T(d, Xt(m, 3))
          }

          function vBe(d, m, T, q) {
            return d == null ? [] : (fr(m) || (m = m == null ? [] : [m]), T = q ? r : T, fr(T) || (T = T == null ? [] : [T]), AG(d, m, T))
          }
          var bBe = Q_(function (d, m, T) {
            d[T ? 0 : 1].push(m)
          }, function () {
            return [
              [],
              []
            ]
          });

          function yBe(d, m, T) {
            var q = fr(d) ? RT : ZK,
              te = arguments.length < 3;
            return q(d, Xt(m, 4), T, te, ff)
          }

          function _Be(d, m, T) {
            var q = fr(d) ? P$e : ZK,
              te = arguments.length < 3;
            return q(d, Xt(m, 4), T, te, pG)
          }

          function xBe(d, m) {
            var T = fr(d) ? lf : gG;
            return T(d, l7(Xt(m, 3)))
          }

          function CBe(d) {
            var m = fr(d) ? uG : gDe;
            return m(d)
          }

          function EBe(d, m, T) {
            (T ? Qs(d, m, T) : m === r) ? m = 1: m = yr(m);
            var q = fr(d) ? VOe : mDe;
            return q(d, m)
          }

          function ABe(d) {
            var m = fr(d) ? KOe : vDe;
            return m(d)
          }

          function SBe(d) {
            if (d == null) return 0;
            if (Io(d)) return d7(d) ? Hm(d) : d.length;
            var m = ks(d);
            return m == ge || m == qe ? d.size : ZT(d).length
          }

          function IBe(d, m, T) {
            var q = fr(d) ? NT : bDe;
            return T && Qs(d, m, T) && (m = r), q(d, Xt(m, 3))
          }
          var TBe = Er(function (d, m) {
              if (d == null) return [];
              var T = m.length;
              return T > 1 && Qs(d, m[0], m[1]) ? m = [] : T > 2 && Qs(m[0], m[1], m[2]) && (m = [m[0]]), AG(d, fs(m, 1), [])
            }),
            a7 = cOe || function () {
              return Lr.Date.now()
            };

          function kBe(d, m) {
            if (typeof m != "function") throw new za(o);
            return d = yr(d),
              function () {
                if (--d < 1) return m.apply(this, arguments)
              }
          }

          function bZ(d, m, T) {
            return m = T ? r : m, m = d && m == null ? d.length : m, Id(d, R, r, r, r, r, m)
          }

          function yZ(d, m) {
            var T;
            if (typeof m != "function") throw new za(o);
            return d = yr(d),
              function () {
                return --d > 0 && (T = m.apply(this, arguments)), d <= 1 && (m = r), T
              }
          }
          var bk = Er(function (d, m, T) {
              var q = N;
              if (T.length) {
                var te = df(T, Jm(bk));
                q |= D
              }
              return Id(d, q, m, T, te)
            }),
            _Z = Er(function (d, m, T) {
              var q = N | $;
              if (T.length) {
                var te = df(T, Jm(_Z));
                q |= D
              }
              return Id(m, q, d, T, te)
            });

          function xZ(d, m, T) {
            m = T ? r : m;
            var q = Id(d, B, r, r, r, r, r, m);
            return q.placeholder = xZ.placeholder, q
          }

          function CZ(d, m, T) {
            m = T ? r : m;
            var q = Id(d, F, r, r, r, r, r, m);
            return q.placeholder = CZ.placeholder, q
          }

          function EZ(d, m, T) {
            var q, te, oe, pe, ve, Se, Fe = 0,
              We = !1,
              Ge = !1,
              _t = !0;
            if (typeof d != "function") throw new za(o);
            m = Ga(m) || 0, Hn(T) && (We = !!T.leading, Ge = "maxWait" in T, oe = Ge ? Ni(Ga(T.maxWait) || 0, m) : oe, _t = "trailing" in T ? !!T.trailing : _t);

            function Ht(hi) {
              var qc = q,
                Md = te;
              return q = te = r, Fe = hi, pe = d.apply(Md, qc), pe
            }

            function er(hi) {
              return Fe = hi, ve = N3(kr, m), We ? Ht(hi) : pe
            }

            function Cr(hi) {
              var qc = hi - Se,
                Md = hi - Fe,
                zZ = m - qc;
              return Ge ? Ts(zZ, oe - Md) : zZ
            }

            function tr(hi) {
              var qc = hi - Se,
                Md = hi - Fe;
              return Se === r || qc >= m || qc < 0 || Ge && Md >= oe
            }

            function kr() {
              var hi = a7();
              if (tr(hi)) return Br(hi);
              ve = N3(kr, Cr(hi))
            }

            function Br(hi) {
              return ve = r, _t && q ? Ht(hi) : (q = te = r, pe)
            }

            function ra() {
              ve !== r && $G(ve), Fe = 0, q = Se = te = ve = r
            }

            function Js() {
              return ve === r ? pe : Br(a7())
            }

            function na() {
              var hi = a7(),
                qc = tr(hi);
              if (q = arguments, te = this, Se = hi, qc) {
                if (ve === r) return er(Se);
                if (Ge) return $G(ve), ve = N3(kr, m), Ht(Se)
              }
              return ve === r && (ve = N3(kr, m)), pe
            }
            return na.cancel = ra, na.flush = Js, na
          }
          var RBe = Er(function (d, m) {
              return fG(d, 1, m)
            }),
            NBe = Er(function (d, m, T) {
              return fG(d, Ga(m) || 0, T)
            });

          function MBe(d) {
            return Id(d, j)
          }

          function c7(d, m) {
            if (typeof d != "function" || m != null && typeof m != "function") throw new za(o);
            var T = function () {
              var q = arguments,
                te = m ? m.apply(this, q) : q[0],
                oe = T.cache;
              if (oe.has(te)) return oe.get(te);
              var pe = d.apply(this, q);
              return T.cache = oe.set(te, pe) || oe, pe
            };
            return T.cache = new(c7.Cache || Ad), T
          }
          c7.Cache = Ad;

          function l7(d) {
            if (typeof d != "function") throw new za(o);
            return function () {
              var m = arguments;
              switch (m.length) {
                case 0:
                  return !d.call(this);
                case 1:
                  return !d.call(this, m[0]);
                case 2:
                  return !d.call(this, m[0], m[1]);
                case 3:
                  return !d.call(this, m[0], m[1], m[2])
              }
              return !d.apply(this, m)
            }
          }

          function PBe(d) {
            return yZ(2, d)
          }
          var $Be = yDe(function (d, m) {
              m = m.length == 1 && fr(m[0]) ? On(m[0], Xo(Xt())) : On(fs(m, 1), Xo(Xt()));
              var T = m.length;
              return Er(function (q) {
                for (var te = -1, oe = Ts(q.length, T); ++te < oe;) q[te] = m[te].call(this, q[te]);
                return Xi(d, this, q)
              })
            }),
            yk = Er(function (d, m) {
              var T = df(m, Jm(yk));
              return Id(d, D, r, m, T)
            }),
            AZ = Er(function (d, m) {
              var T = df(m, Jm(AZ));
              return Id(d, V, r, m, T)
            }),
            OBe = Td(function (d, m) {
              return Id(d, P, r, r, r, m)
            });

          function DBe(d, m) {
            if (typeof d != "function") throw new za(o);
            return m = m === r ? m : yr(m), Er(d, m)
          }

          function LBe(d, m) {
            if (typeof d != "function") throw new za(o);
            return m = m == null ? 0 : Ni(yr(m), 0), Er(function (T) {
              var q = T[m],
                te = mf(T, 0, m);
              return q && uf(te, q), Xi(d, this, te)
            })
          }

          function BBe(d, m, T) {
            var q = !0,
              te = !0;
            if (typeof d != "function") throw new za(o);
            return Hn(T) && (q = "leading" in T ? !!T.leading : q, te = "trailing" in T ? !!T.trailing : te), EZ(d, m, {
              leading: q,
              maxWait: m,
              trailing: te
            })
          }

          function UBe(d) {
            return bZ(d, 1)
          }

          function jBe(d, m) {
            return yk(ik(m), d)
          }

          function FBe() {
            if (!arguments.length) return [];
            var d = arguments[0];
            return fr(d) ? d : [d]
          }

          function WBe(d) {
            return qa(d, b)
          }

          function zBe(d, m) {
            return m = typeof m == "function" ? m : r, qa(d, b, m)
          }

          function HBe(d) {
            return qa(d, f | b)
          }

          function qBe(d, m) {
            return m = typeof m == "function" ? m : r, qa(d, f | b, m)
          }

          function VBe(d, m) {
            return m == null || hG(d, m, es(m))
          }

          function Hc(d, m) {
            return d === m || d !== d && m !== m
          }
          var KBe = t7(VT),
            GBe = t7(function (d, m) {
              return d >= m
            }),
            Fp = vG(function () {
              return arguments
            }()) ? vG : function (d) {
              return ei(d) && sn.call(d, "callee") && !iG.call(d, "callee")
            },
            fr = Me.isArray,
            ZBe = Zs ? Xo(Zs) : nDe;

          function Io(d) {
            return d != null && u7(d.length) && !Rd(d)
          }

          function di(d) {
            return ei(d) && Io(d)
          }

          function YBe(d) {
            return d === !0 || d === !1 || ei(d) && Ys(d) == ee
          }
          var wf = uOe || Nk,
            QBe = Fc ? Xo(Fc) : iDe;

          function JBe(d) {
            return ei(d) && d.nodeType === 1 && !M3(d)
          }

          function XBe(d) {
            if (d == null) return !0;
            if (Io(d) && (fr(d) || typeof d == "string" || typeof d.splice == "function" || wf(d) || Xm(d) || Fp(d))) return !d.length;
            var m = ks(d);
            if (m == ge || m == qe) return !d.size;
            if (R3(d)) return !ZT(d).length;
            for (var T in d)
              if (sn.call(d, T)) return !1;
            return !0
          }

          function eUe(d, m) {
            return I3(d, m)
          }

          function tUe(d, m, T) {
            T = typeof T == "function" ? T : r;
            var q = T ? T(d, m) : r;
            return q === r ? I3(d, m, r, T) : !!q
          }

          function _k(d) {
            if (!ei(d)) return !1;
            var m = Ys(d);
            return m == H || m == O || typeof d.message == "string" && typeof d.name == "string" && !M3(d)
          }

          function rUe(d) {
            return typeof d == "number" && oG(d)
          }

          function Rd(d) {
            if (!Hn(d)) return !1;
            var m = Ys(d);
            return m == Q || m == de || m == Z || m == rt
          }

          function SZ(d) {
            return typeof d == "number" && d == yr(d)
          }

          function u7(d) {
            return typeof d == "number" && d > -1 && d % 1 == 0 && d <= E
          }

          function Hn(d) {
            var m = typeof d;
            return d != null && (m == "object" || m == "function")
          }

          function ei(d) {
            return d != null && typeof d == "object"
          }
          var IZ = Fa ? Xo(Fa) : oDe;

          function nUe(d, m) {
            return d === m || GT(d, m, dk(m))
          }

          function iUe(d, m, T) {
            return T = typeof T == "function" ? T : r, GT(d, m, dk(m), T)
          }

          function sUe(d) {
            return TZ(d) && d != +d
          }

          function oUe(d) {
            if (zDe(d)) throw new cr(s);
            return bG(d)
          }

          function aUe(d) {
            return d === null
          }

          function cUe(d) {
            return d == null
          }

          function TZ(d) {
            return typeof d == "number" || ei(d) && Ys(d) == Te
          }

          function M3(d) {
            if (!ei(d) || Ys(d) != De) return !1;
            var m = L_(d);
            if (m === null) return !0;
            var T = sn.call(m, "constructor") && m.constructor;
            return typeof T == "function" && T instanceof T && P_.call(T) == iOe
          }
          var xk = pu ? Xo(pu) : aDe;

          function lUe(d) {
            return SZ(d) && d >= -E && d <= E
          }
          var kZ = w3 ? Xo(w3) : cDe;

          function d7(d) {
            return typeof d == "string" || !fr(d) && ei(d) && Ys(d) == He
          }

          function ta(d) {
            return typeof d == "symbol" || ei(d) && Ys(d) == we
          }
          var Xm = Pp ? Xo(Pp) : lDe;

          function uUe(d) {
            return d === r
          }

          function dUe(d) {
            return ei(d) && ks(d) == Ie
          }

          function hUe(d) {
            return ei(d) && Ys(d) == Pe
          }
          var fUe = t7(YT),
            pUe = t7(function (d, m) {
              return d <= m
            });

          function RZ(d) {
            if (!d) return [];
            if (Io(d)) return d7(d) ? Wc(d) : So(d);
            if (b3 && d[b3]) return V$e(d[b3]());
            var m = ks(d),
              T = m == ge ? LT : m == qe ? R_ : ew;
            return T(d)
          }

          function Nd(d) {
            if (!d) return d === 0 ? d : 0;
            if (d = Ga(d), d === x || d === -x) {
              var m = d < 0 ? -1 : 1;
              return m * S
            }
            return d === d ? d : 0
          }

          function yr(d) {
            var m = Nd(d),
              T = m % 1;
            return m === m ? T ? m - T : m : 0
          }

          function NZ(d) {
            return d ? Lp(yr(d), 0, y) : 0
          }

          function Ga(d) {
            if (typeof d == "number") return d;
            if (ta(d)) return _;
            if (Hn(d)) {
              var m = typeof d.valueOf == "function" ? d.valueOf() : d;
              d = Hn(m) ? m + "" : m
            }
            if (typeof d != "string") return d === 0 ? d : +d;
            d = YK(d);
            var T = Nn.test(d);
            return T || Pn.test(d) ? hr(d.slice(2), T ? 2 : 8) : br.test(d) ? _ : +d
          }

          function MZ(d) {
            return mu(d, To(d))
          }

          function gUe(d) {
            return d ? Lp(yr(d), -E, E) : d === 0 ? d : 0
          }

          function rn(d) {
            return d == null ? "" : ea(d)
          }
          var mUe = Ym(function (d, m) {
              if (R3(m) || Io(m)) {
                mu(m, es(m), d);
                return
              }
              for (var T in m) sn.call(m, T) && E3(d, T, m[T])
            }),
            PZ = Ym(function (d, m) {
              mu(m, To(m), d)
            }),
            h7 = Ym(function (d, m, T, q) {
              mu(m, To(m), d, q)
            }),
            wUe = Ym(function (d, m, T, q) {
              mu(m, es(m), d, q)
            }),
            vUe = Td(zT);

          function bUe(d, m) {
            var T = Zm(d);
            return m == null ? T : dG(T, m)
          }
          var yUe = Er(function (d, m) {
              d = mn(d);
              var T = -1,
                q = m.length,
                te = q > 2 ? m[2] : r;
              for (te && Qs(m[0], m[1], te) && (q = 1); ++T < q;)
                for (var oe = m[T], pe = To(oe), ve = -1, Se = pe.length; ++ve < Se;) {
                  var Fe = pe[ve],
                    We = d[Fe];
                  (We === r || Hc(We, Vm[Fe]) && !sn.call(d, Fe)) && (d[Fe] = oe[Fe])
                }
              return d
            }),
            _Ue = Er(function (d) {
              return d.push(r, YG), Xi($Z, r, d)
            });

          function xUe(d, m) {
            return VK(d, Xt(m, 3), gu)
          }

          function CUe(d, m) {
            return VK(d, Xt(m, 3), qT)
          }

          function EUe(d, m) {
            return d == null ? d : HT(d, Xt(m, 3), To)
          }

          function AUe(d, m) {
            return d == null ? d : mG(d, Xt(m, 3), To)
          }

          function SUe(d, m) {
            return d && gu(d, Xt(m, 3))
          }

          function IUe(d, m) {
            return d && qT(d, Xt(m, 3))
          }

          function TUe(d) {
            return d == null ? [] : K_(d, es(d))
          }

          function kUe(d) {
            return d == null ? [] : K_(d, To(d))
          }

          function Ck(d, m, T) {
            var q = d == null ? r : Bp(d, m);
            return q === r ? T : q
          }

          function RUe(d, m) {
            return d != null && XG(d, m, XOe)
          }

          function Ek(d, m) {
            return d != null && XG(d, m, eDe)
          }
          var NUe = qG(function (d, m, T) {
              m != null && typeof m.toString != "function" && (m = $_.call(m)), d[m] = T
            }, Sk(ko)),
            MUe = qG(function (d, m, T) {
              m != null && typeof m.toString != "function" && (m = $_.call(m)), sn.call(d, m) ? d[m].push(T) : d[m] = [T]
            }, Xt),
            PUe = Er(S3);

          function es(d) {
            return Io(d) ? lG(d) : ZT(d)
          }

          function To(d) {
            return Io(d) ? lG(d, !0) : uDe(d)
          }

          function $Ue(d, m) {
            var T = {};
            return m = Xt(m, 3), gu(d, function (q, te, oe) {
              Sd(T, m(q, te, oe), q)
            }), T
          }

          function OUe(d, m) {
            var T = {};
            return m = Xt(m, 3), gu(d, function (q, te, oe) {
              Sd(T, te, m(q, te, oe))
            }), T
          }
          var DUe = Ym(function (d, m, T) {
              G_(d, m, T)
            }),
            $Z = Ym(function (d, m, T, q) {
              G_(d, m, T, q)
            }),
            LUe = Td(function (d, m) {
              var T = {};
              if (d == null) return T;
              var q = !1;
              m = On(m, function (oe) {
                return oe = gf(oe, d), q || (q = oe.length > 1), oe
              }), mu(d, lk(d), T), q && (T = qa(T, f | w | b, NDe));
              for (var te = m.length; te--;) tk(T, m[te]);
              return T
            });

          function BUe(d, m) {
            return OZ(d, l7(Xt(m)))
          }
          var UUe = Td(function (d, m) {
            return d == null ? {} : hDe(d, m)
          });

          function OZ(d, m) {
            if (d == null) return {};
            var T = On(lk(d), function (q) {
              return [q]
            });
            return m = Xt(m), SG(d, T, function (q, te) {
              return m(q, te[0])
            })
          }

          function jUe(d, m, T) {
            m = gf(m, d);
            var q = -1,
              te = m.length;
            for (te || (te = 1, d = r); ++q < te;) {
              var oe = d == null ? r : d[wu(m[q])];
              oe === r && (q = te, oe = T), d = Rd(oe) ? oe.call(d) : oe
            }
            return d
          }

          function FUe(d, m, T) {
            return d == null ? d : T3(d, m, T)
          }

          function WUe(d, m, T, q) {
            return q = typeof q == "function" ? q : r, d == null ? d : T3(d, m, T, q)
          }
          var DZ = GG(es),
            LZ = GG(To);

          function zUe(d, m, T) {
            var q = fr(d),
              te = q || wf(d) || Xm(d);
            if (m = Xt(m, 4), T == null) {
              var oe = d && d.constructor;
              te ? T = q ? new oe : [] : Hn(d) ? T = Rd(oe) ? Zm(L_(d)) : {} : T = {}
            }
            return (te ? Wa : gu)(d, function (pe, ve, Se) {
              return m(T, pe, ve, Se)
            }), T
          }

          function HUe(d, m) {
            return d == null ? !0 : tk(d, m)
          }

          function qUe(d, m, T) {
            return d == null ? d : NG(d, m, ik(T))
          }

          function VUe(d, m, T, q) {
            return q = typeof q == "function" ? q : r, d == null ? d : NG(d, m, ik(T), q)
          }

          function ew(d) {
            return d == null ? [] : DT(d, es(d))
          }

          function KUe(d) {
            return d == null ? [] : DT(d, To(d))
          }

          function GUe(d, m, T) {
            return T === r && (T = m, m = r), T !== r && (T = Ga(T), T = T === T ? T : 0), m !== r && (m = Ga(m), m = m === m ? m : 0), Lp(Ga(d), m, T)
          }

          function ZUe(d, m, T) {
            return m = Nd(m), T === r ? (T = m, m = 0) : T = Nd(T), d = Ga(d), tDe(d, m, T)
          }

          function YUe(d, m, T) {
            if (T && typeof T != "boolean" && Qs(d, m, T) && (m = T = r), T === r && (typeof m == "boolean" ? (T = m, m = r) : typeof d == "boolean" && (T = d, d = r)), d === r && m === r ? (d = 0, m = 1) : (d = Nd(d), m === r ? (m = d, d = 0) : m = Nd(m)), d > m) {
              var q = d;
              d = m, m = q
            }
            if (T || d % 1 || m % 1) {
              var te = aG();
              return Ts(d + te * (m - d + pn("1e-" + ((te + "").length - 1))), m)
            }
            return JT(d, m)
          }
          var QUe = Qm(function (d, m, T) {
            return m = m.toLowerCase(), d + (T ? BZ(m) : m)
          });

          function BZ(d) {
            return Ak(rn(d).toLowerCase())
          }

          function UZ(d) {
            return d = rn(d), d && d.replace(tn, F$e).replace(IT, "")
          }

          function JUe(d, m, T) {
            d = rn(d), m = ea(m);
            var q = d.length;
            T = T === r ? q : Lp(yr(T), 0, q);
            var te = T;
            return T -= m.length, T >= 0 && d.slice(T, te) == m
          }

          function XUe(d) {
            return d = rn(d), d && ct.test(d) ? d.replace(Wt, W$e) : d
          }

          function eje(d) {
            return d = rn(d), d && Et.test(d) ? d.replace(wt, "\\$&") : d
          }
          var tje = Qm(function (d, m, T) {
              return d + (T ? "-" : "") + m.toLowerCase()
            }),
            rje = Qm(function (d, m, T) {
              return d + (T ? " " : "") + m.toLowerCase()
            }),
            nje = WG("toLowerCase");

          function ije(d, m, T) {
            d = rn(d), m = yr(m);
            var q = m ? Hm(d) : 0;
            if (!m || q >= m) return d;
            var te = (m - q) / 2;
            return e7(F_(te), T) + d + e7(j_(te), T)
          }

          function sje(d, m, T) {
            d = rn(d), m = yr(m);
            var q = m ? Hm(d) : 0;
            return m && q < m ? d + e7(m - q, T) : d
          }

          function oje(d, m, T) {
            d = rn(d), m = yr(m);
            var q = m ? Hm(d) : 0;
            return m && q < m ? e7(m - q, T) + d : d
          }

          function aje(d, m, T) {
            return T || m == null ? m = 0 : m && (m = +m), pOe(rn(d).replace(vt, ""), m || 0)
          }

          function cje(d, m, T) {
            return (T ? Qs(d, m, T) : m === r) ? m = 1 : m = yr(m), XT(rn(d), m)
          }

          function lje() {
            var d = arguments,
              m = rn(d[0]);
            return d.length < 3 ? m : m.replace(d[1], d[2])
          }
          var uje = Qm(function (d, m, T) {
            return d + (T ? "_" : "") + m.toLowerCase()
          });

          function dje(d, m, T) {
            return T && typeof T != "number" && Qs(d, m, T) && (m = T = r), T = T === r ? y : T >>> 0, T ? (d = rn(d), d && (typeof m == "string" || m != null && !xk(m)) && (m = ea(m), !m && zm(d)) ? mf(Wc(d), 0, T) : d.split(m, T)) : []
          }
          var hje = Qm(function (d, m, T) {
            return d + (T ? " " : "") + Ak(m)
          });

          function fje(d, m, T) {
            return d = rn(d), T = T == null ? 0 : Lp(yr(T), 0, d.length), m = ea(m), d.slice(T, T + m.length) == m
          }

          function pje(d, m, T) {
            var q = se.templateSettings;
            T && Qs(d, m, T) && (m = r), d = rn(d), m = h7({}, m, q, ZG);
            var te = h7({}, m.imports, q.imports, ZG),
              oe = es(te),
              pe = DT(te, oe),
              ve, Se, Fe = 0,
              We = m.interpolate || Qn,
              Ge = "__p += '",
              _t = BT((m.escape || Qn).source + "|" + We.source + "|" + (We === ht ? Yt : Qn).source + "|" + (m.evaluate || Qn).source + "|$", "g"),
              Ht = "//# sourceURL=" + (sn.call(m, "sourceURL") ? (m.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++TT + "]") + `
  `;
            d.replace(_t, function (tr, kr, Br, ra, Js, na) {
              return Br || (Br = ra), Ge += d.slice(Fe, na).replace(Ii, z$e), kr && (ve = !0, Ge += `' +
  __e(` + kr + `) +
  '`), Js && (Se = !0, Ge += `';
  ` + Js + `;
  __p += '`), Br && (Ge += `' +
  ((__t = (` + Br + `)) == null ? '' : __t) +
  '`), Fe = na + tr.length, tr
            }), Ge += `';
  `;
            var er = sn.call(m, "variable") && m.variable;
            if (!er) Ge = `with (obj) {
  ` + Ge + `
  }
  `;
            else if (Gt.test(er)) throw new cr(a);
            Ge = (Se ? Ge.replace(Je, "") : Ge).replace(kt, "$1").replace(Ut, "$1;"), Ge = "function(" + (er || "obj") + `) {
  ` + (er ? "" : `obj || (obj = {});
  `) + "var __t, __p = ''" + (ve ? ", __e = _.escape" : "") + (Se ? `, __j = Array.prototype.join;
  function print() { __p += __j.call(arguments, '') }
  ` : `;
  `) + Ge + `return __p
  }`;
            var Cr = FZ(function () {
              return Yr(oe, Ht + "return " + Ge).apply(r, pe)
            });
            if (Cr.source = Ge, _k(Cr)) throw Cr;
            return Cr
          }

          function gje(d) {
            return rn(d).toLowerCase()
          }

          function mje(d) {
            return rn(d).toUpperCase()
          }

          function wje(d, m, T) {
            if (d = rn(d), d && (T || m === r)) return YK(d);
            if (!d || !(m = ea(m))) return d;
            var q = Wc(d),
              te = Wc(m),
              oe = QK(q, te),
              pe = JK(q, te) + 1;
            return mf(q, oe, pe).join("")
          }

          function vje(d, m, T) {
            if (d = rn(d), d && (T || m === r)) return d.slice(0, eG(d) + 1);
            if (!d || !(m = ea(m))) return d;
            var q = Wc(d),
              te = JK(q, Wc(m)) + 1;
            return mf(q, 0, te).join("")
          }

          function bje(d, m, T) {
            if (d = rn(d), d && (T || m === r)) return d.replace(vt, "");
            if (!d || !(m = ea(m))) return d;
            var q = Wc(d),
              te = QK(q, Wc(m));
            return mf(q, te).join("")
          }

          function yje(d, m) {
            var T = Y,
              q = U;
            if (Hn(m)) {
              var te = "separator" in m ? m.separator : te;
              T = "length" in m ? yr(m.length) : T, q = "omission" in m ? ea(m.omission) : q
            }
            d = rn(d);
            var oe = d.length;
            if (zm(d)) {
              var pe = Wc(d);
              oe = pe.length
            }
            if (T >= oe) return d;
            var ve = T - Hm(q);
            if (ve < 1) return q;
            var Se = pe ? mf(pe, 0, ve).join("") : d.slice(0, ve);
            if (te === r) return Se + q;
            if (pe && (ve += Se.length - ve), xk(te)) {
              if (d.slice(ve).search(te)) {
                var Fe, We = Se;
                for (te.global || (te = BT(te.source, rn(Pt.exec(te)) + "g")), te.lastIndex = 0; Fe = te.exec(We);) var Ge = Fe.index;
                Se = Se.slice(0, Ge === r ? ve : Ge)
              }
            } else if (d.indexOf(ea(te), ve) != ve) {
              var _t = Se.lastIndexOf(te);
              _t > -1 && (Se = Se.slice(0, _t))
            }
            return Se + q
          }

          function _je(d) {
            return d = rn(d), d && pt.test(d) ? d.replace(Ft, Y$e) : d
          }
          var xje = Qm(function (d, m, T) {
              return d + (T ? " " : "") + m.toUpperCase()
            }),
            Ak = WG("toUpperCase");

          function jZ(d, m, T) {
            return d = rn(d), m = T ? r : m, m === r ? q$e(d) ? X$e(d) : D$e(d) : d.match(m) || []
          }
          var FZ = Er(function (d, m) {
              try {
                return Xi(d, r, m)
              } catch (T) {
                return _k(T) ? T : new cr(T)
              }
            }),
            Cje = Td(function (d, m) {
              return Wa(m, function (T) {
                T = wu(T), Sd(d, T, bk(d[T], d))
              }), d
            });

          function Eje(d) {
            var m = d == null ? 0 : d.length,
              T = Xt();
            return d = m ? On(d, function (q) {
              if (typeof q[1] != "function") throw new za(o);
              return [T(q[0]), q[1]]
            }) : [], Er(function (q) {
              for (var te = -1; ++te < m;) {
                var oe = d[te];
                if (Xi(oe[0], this, q)) return Xi(oe[1], this, q)
              }
            })
          }

          function Aje(d) {
            return YOe(qa(d, f))
          }

          function Sk(d) {
            return function () {
              return d
            }
          }

          function Sje(d, m) {
            return d == null || d !== d ? m : d
          }
          var Ije = HG(),
            Tje = HG(!0);

          function ko(d) {
            return d
          }

          function Ik(d) {
            return yG(typeof d == "function" ? d : qa(d, f))
          }

          function kje(d) {
            return xG(qa(d, f))
          }

          function Rje(d, m) {
            return CG(d, qa(m, f))
          }
          var Nje = Er(function (d, m) {
              return function (T) {
                return S3(T, d, m)
              }
            }),
            Mje = Er(function (d, m) {
              return function (T) {
                return S3(d, T, m)
              }
            });

          function Tk(d, m, T) {
            var q = es(m),
              te = K_(m, q);
            T == null && !(Hn(m) && (te.length || !q.length)) && (T = m, m = d, d = this, te = K_(m, es(m)));
            var oe = !(Hn(T) && "chain" in T) || !!T.chain,
              pe = Rd(d);
            return Wa(te, function (ve) {
              var Se = m[ve];
              d[ve] = Se, pe && (d.prototype[ve] = function () {
                var Fe = this.__chain__;
                if (oe || Fe) {
                  var We = d(this.__wrapped__),
                    Ge = We.__actions__ = So(this.__actions__);
                  return Ge.push({
                    func: Se,
                    args: arguments,
                    thisArg: d
                  }), We.__chain__ = Fe, We
                }
                return Se.apply(d, uf([this.value()], arguments))
              })
            }), d
          }

          function Pje() {
            return Lr._ === this && (Lr._ = sOe), this
          }

          function kk() {}

          function $je(d) {
            return d = yr(d), Er(function (m) {
              return EG(m, d)
            })
          }
          var Oje = ok(On),
            Dje = ok(qK),
            Lje = ok(NT);

          function WZ(d) {
            return fk(d) ? MT(wu(d)) : fDe(d)
          }

          function Bje(d) {
            return function (m) {
              return d == null ? r : Bp(d, m)
            }
          }
          var Uje = VG(),
            jje = VG(!0);

          function Rk() {
            return []
          }

          function Nk() {
            return !1
          }

          function Fje() {
            return {}
          }

          function Wje() {
            return ""
          }

          function zje() {
            return !0
          }

          function Hje(d, m) {
            if (d = yr(d), d < 1 || d > E) return [];
            var T = y,
              q = Ts(d, y);
            m = Xt(m), d -= y;
            for (var te = OT(q, m); ++T < d;) m(T);
            return te
          }

          function qje(d) {
            return fr(d) ? On(d, wu) : ta(d) ? [d] : So(cZ(rn(d)))
          }

          function Vje(d) {
            var m = ++nOe;
            return rn(d) + m
          }
          var Kje = X_(function (d, m) {
              return d + m
            }, 0),
            Gje = ak("ceil"),
            Zje = X_(function (d, m) {
              return d / m
            }, 1),
            Yje = ak("floor");

          function Qje(d) {
            return d && d.length ? V_(d, ko, VT) : r
          }

          function Jje(d, m) {
            return d && d.length ? V_(d, Xt(m, 2), VT) : r
          }

          function Xje(d) {
            return GK(d, ko)
          }

          function eFe(d, m) {
            return GK(d, Xt(m, 2))
          }

          function tFe(d) {
            return d && d.length ? V_(d, ko, YT) : r
          }

          function rFe(d, m) {
            return d && d.length ? V_(d, Xt(m, 2), YT) : r
          }
          var nFe = X_(function (d, m) {
              return d * m
            }, 1),
            iFe = ak("round"),
            sFe = X_(function (d, m) {
              return d - m
            }, 0);

          function oFe(d) {
            return d && d.length ? $T(d, ko) : 0
          }

          function aFe(d, m) {
            return d && d.length ? $T(d, Xt(m, 2)) : 0
          }
          return se.after = kBe, se.ary = bZ, se.assign = mUe, se.assignIn = PZ, se.assignInWith = h7, se.assignWith = wUe, se.at = vUe, se.before = yZ, se.bind = bk, se.bindAll = Cje, se.bindKey = _Z, se.castArray = FBe, se.chain = mZ, se.chunk = YDe, se.compact = QDe, se.concat = JDe, se.cond = Eje, se.conforms = Aje, se.constant = Sk, se.countBy = oBe, se.create = bUe, se.curry = xZ, se.curryRight = CZ, se.debounce = EZ, se.defaults = yUe, se.defaultsDeep = _Ue, se.defer = RBe, se.delay = NBe, se.difference = XDe, se.differenceBy = eLe, se.differenceWith = tLe, se.drop = rLe, se.dropRight = nLe, se.dropRightWhile = iLe, se.dropWhile = sLe, se.fill = oLe, se.filter = cBe, se.flatMap = dBe, se.flatMapDeep = hBe, se.flatMapDepth = fBe, se.flatten = hZ, se.flattenDeep = aLe, se.flattenDepth = cLe, se.flip = MBe, se.flow = Ije, se.flowRight = Tje, se.fromPairs = lLe, se.functions = TUe, se.functionsIn = kUe, se.groupBy = pBe, se.initial = dLe, se.intersection = hLe, se.intersectionBy = fLe, se.intersectionWith = pLe, se.invert = NUe, se.invertBy = MUe, se.invokeMap = mBe, se.iteratee = Ik, se.keyBy = wBe, se.keys = es, se.keysIn = To, se.map = o7, se.mapKeys = $Ue, se.mapValues = OUe, se.matches = kje, se.matchesProperty = Rje, se.memoize = c7, se.merge = DUe, se.mergeWith = $Z, se.method = Nje, se.methodOf = Mje, se.mixin = Tk, se.negate = l7, se.nthArg = $je, se.omit = LUe, se.omitBy = BUe, se.once = PBe, se.orderBy = vBe, se.over = Oje, se.overArgs = $Be, se.overEvery = Dje, se.overSome = Lje, se.partial = yk, se.partialRight = AZ, se.partition = bBe, se.pick = UUe, se.pickBy = OZ, se.property = WZ, se.propertyOf = Bje, se.pull = vLe, se.pullAll = pZ, se.pullAllBy = bLe, se.pullAllWith = yLe, se.pullAt = _Le, se.range = Uje, se.rangeRight = jje, se.rearg = OBe, se.reject = xBe, se.remove = xLe, se.rest = DBe, se.reverse = wk, se.sampleSize = EBe, se.set = FUe, se.setWith = WUe, se.shuffle = ABe, se.slice = CLe, se.sortBy = TBe, se.sortedUniq = RLe, se.sortedUniqBy = NLe, se.split = dje, se.spread = LBe, se.tail = MLe, se.take = PLe, se.takeRight = $Le, se.takeRightWhile = OLe, se.takeWhile = DLe, se.tap = QLe, se.throttle = BBe, se.thru = s7, se.toArray = RZ, se.toPairs = DZ, se.toPairsIn = LZ, se.toPath = qje, se.toPlainObject = MZ, se.transform = zUe, se.unary = UBe, se.union = LLe, se.unionBy = BLe, se.unionWith = ULe, se.uniq = jLe, se.uniqBy = FLe, se.uniqWith = WLe, se.unset = HUe, se.unzip = vk, se.unzipWith = gZ, se.update = qUe, se.updateWith = VUe, se.values = ew, se.valuesIn = KUe, se.without = zLe, se.words = jZ, se.wrap = jBe, se.xor = HLe, se.xorBy = qLe, se.xorWith = VLe, se.zip = KLe, se.zipObject = GLe, se.zipObjectDeep = ZLe, se.zipWith = YLe, se.entries = DZ, se.entriesIn = LZ, se.extend = PZ, se.extendWith = h7, Tk(se, se), se.add = Kje, se.attempt = FZ, se.camelCase = QUe, se.capitalize = BZ, se.ceil = Gje, se.clamp = GUe, se.clone = WBe, se.cloneDeep = HBe, se.cloneDeepWith = qBe, se.cloneWith = zBe, se.conformsTo = VBe, se.deburr = UZ, se.defaultTo = Sje, se.divide = Zje, se.endsWith = JUe, se.eq = Hc, se.escape = XUe, se.escapeRegExp = eje, se.every = aBe, se.find = lBe, se.findIndex = uZ, se.findKey = xUe, se.findLast = uBe, se.findLastIndex = dZ, se.findLastKey = CUe, se.floor = Yje, se.forEach = wZ, se.forEachRight = vZ, se.forIn = EUe, se.forInRight = AUe, se.forOwn = SUe, se.forOwnRight = IUe, se.get = Ck, se.gt = KBe, se.gte = GBe, se.has = RUe, se.hasIn = Ek, se.head = fZ, se.identity = ko, se.includes = gBe, se.indexOf = uLe, se.inRange = ZUe, se.invoke = PUe, se.isArguments = Fp, se.isArray = fr, se.isArrayBuffer = ZBe, se.isArrayLike = Io, se.isArrayLikeObject = di, se.isBoolean = YBe, se.isBuffer = wf, se.isDate = QBe, se.isElement = JBe, se.isEmpty = XBe, se.isEqual = eUe, se.isEqualWith = tUe, se.isError = _k, se.isFinite = rUe, se.isFunction = Rd, se.isInteger = SZ, se.isLength = u7, se.isMap = IZ, se.isMatch = nUe, se.isMatchWith = iUe, se.isNaN = sUe, se.isNative = oUe, se.isNil = cUe, se.isNull = aUe, se.isNumber = TZ, se.isObject = Hn, se.isObjectLike = ei, se.isPlainObject = M3, se.isRegExp = xk, se.isSafeInteger = lUe, se.isSet = kZ, se.isString = d7, se.isSymbol = ta, se.isTypedArray = Xm, se.isUndefined = uUe, se.isWeakMap = dUe, se.isWeakSet = hUe, se.join = gLe, se.kebabCase = tje, se.last = Ka, se.lastIndexOf = mLe, se.lowerCase = rje, se.lowerFirst = nje, se.lt = fUe, se.lte = pUe, se.max = Qje, se.maxBy = Jje, se.mean = Xje, se.meanBy = eFe, se.min = tFe, se.minBy = rFe, se.stubArray = Rk, se.stubFalse = Nk, se.stubObject = Fje, se.stubString = Wje, se.stubTrue = zje, se.multiply = nFe, se.nth = wLe, se.noConflict = Pje, se.noop = kk, se.now = a7, se.pad = ije, se.padEnd = sje, se.padStart = oje, se.parseInt = aje, se.random = YUe, se.reduce = yBe, se.reduceRight = _Be, se.repeat = cje, se.replace = lje, se.result = jUe, se.round = iFe, se.runInContext = Ee, se.sample = CBe, se.size = SBe, se.snakeCase = uje, se.some = IBe, se.sortedIndex = ELe, se.sortedIndexBy = ALe, se.sortedIndexOf = SLe, se.sortedLastIndex = ILe, se.sortedLastIndexBy = TLe, se.sortedLastIndexOf = kLe, se.startCase = hje, se.startsWith = fje, se.subtract = sFe, se.sum = oFe, se.sumBy = aFe, se.template = pje, se.times = Hje, se.toFinite = Nd, se.toInteger = yr, se.toLength = NZ, se.toLower = gje, se.toNumber = Ga, se.toSafeInteger = gUe, se.toString = rn, se.toUpper = mje, se.trim = wje, se.trimEnd = vje, se.trimStart = bje, se.truncate = yje, se.unescape = _je, se.uniqueId = Vje, se.upperCase = xje, se.upperFirst = Ak, se.each = wZ, se.eachRight = vZ, se.first = fZ, Tk(se, function () {
            var d = {};
            return gu(se, function (m, T) {
              sn.call(se.prototype, T) || (d[T] = m)
            }), d
          }(), {
            chain: !1
          }), se.VERSION = n, Wa(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function (d) {
            se[d].placeholder = se
          }), Wa(["drop", "take"], function (d, m) {
            $r.prototype[d] = function (T) {
              T = T === r ? 1 : Ni(yr(T), 0);
              var q = this.__filtered__ && !m ? new $r(this) : this.clone();
              return q.__filtered__ ? q.__takeCount__ = Ts(T, q.__takeCount__) : q.__views__.push({
                size: Ts(T, y),
                type: d + (q.__dir__ < 0 ? "Right" : "")
              }), q
            }, $r.prototype[d + "Right"] = function (T) {
              return this.reverse()[d](T).reverse()
            }
          }), Wa(["filter", "map", "takeWhile"], function (d, m) {
            var T = m + 1,
              q = T == u || T == v;
            $r.prototype[d] = function (te) {
              var oe = this.clone();
              return oe.__iteratees__.push({
                iteratee: Xt(te, 3),
                type: T
              }), oe.__filtered__ = oe.__filtered__ || q, oe
            }
          }), Wa(["head", "last"], function (d, m) {
            var T = "take" + (m ? "Right" : "");
            $r.prototype[d] = function () {
              return this[T](1).value()[0]
            }
          }), Wa(["initial", "tail"], function (d, m) {
            var T = "drop" + (m ? "" : "Right");
            $r.prototype[d] = function () {
              return this.__filtered__ ? new $r(this) : this[T](1)
            }
          }), $r.prototype.compact = function () {
            return this.filter(ko)
          }, $r.prototype.find = function (d) {
            return this.filter(d).head()
          }, $r.prototype.findLast = function (d) {
            return this.reverse().find(d)
          }, $r.prototype.invokeMap = Er(function (d, m) {
            return typeof d == "function" ? new $r(this) : this.map(function (T) {
              return S3(T, d, m)
            })
          }), $r.prototype.reject = function (d) {
            return this.filter(l7(Xt(d)))
          }, $r.prototype.slice = function (d, m) {
            d = yr(d);
            var T = this;
            return T.__filtered__ && (d > 0 || m < 0) ? new $r(T) : (d < 0 ? T = T.takeRight(-d) : d && (T = T.drop(d)), m !== r && (m = yr(m), T = m < 0 ? T.dropRight(-m) : T.take(m - d)), T)
          }, $r.prototype.takeRightWhile = function (d) {
            return this.reverse().takeWhile(d).reverse()
          }, $r.prototype.toArray = function () {
            return this.take(y)
          }, gu($r.prototype, function (d, m) {
            var T = /^(?:filter|find|map|reject)|While$/.test(m),
              q = /^(?:head|last)$/.test(m),
              te = se[q ? "take" + (m == "last" ? "Right" : "") : m],
              oe = q || /^find/.test(m);
            te && (se.prototype[m] = function () {
              var pe = this.__wrapped__,
                ve = q ? [1] : arguments,
                Se = pe instanceof $r,
                Fe = ve[0],
                We = Se || fr(pe),
                Ge = function (kr) {
                  var Br = te.apply(se, uf([kr], ve));
                  return q && _t ? Br[0] : Br
                };
              We && T && typeof Fe == "function" && Fe.length != 1 && (Se = We = !1);
              var _t = this.__chain__,
                Ht = !!this.__actions__.length,
                er = oe && !_t,
                Cr = Se && !Ht;
              if (!oe && We) {
                pe = Cr ? pe : new $r(this);
                var tr = d.apply(pe, ve);
                return tr.__actions__.push({
                  func: s7,
                  args: [Ge],
                  thisArg: r
                }), new Ha(tr, _t)
              }
              return er && Cr ? d.apply(this, ve) : (tr = this.thru(Ge), er ? q ? tr.value()[0] : tr.value() : tr)
            })
          }), Wa(["pop", "push", "shift", "sort", "splice", "unshift"], function (d) {
            var m = N_[d],
              T = /^(?:push|sort|unshift)$/.test(d) ? "tap" : "thru",
              q = /^(?:pop|shift)$/.test(d);
            se.prototype[d] = function () {
              var te = arguments;
              if (q && !this.__chain__) {
                var oe = this.value();
                return m.apply(fr(oe) ? oe : [], te)
              }
              return this[T](function (pe) {
                return m.apply(fr(pe) ? pe : [], te)
              })
            }
          }), gu($r.prototype, function (d, m) {
            var T = se[m];
            if (T) {
              var q = T.name + "";
              sn.call(Gm, q) || (Gm[q] = []), Gm[q].push({
                name: m,
                func: T
              })
            }
          }), Gm[J_(r, $).name] = [{
            name: "wrapper",
            func: r
          }], $r.prototype.clone = _Oe, $r.prototype.reverse = xOe, $r.prototype.value = COe, se.prototype.at = JLe, se.prototype.chain = XLe, se.prototype.commit = eBe, se.prototype.next = tBe, se.prototype.plant = nBe, se.prototype.reverse = iBe, se.prototype.toJSON = se.prototype.valueOf = se.prototype.value = sBe, se.prototype.first = se.prototype.head, b3 && (se.prototype[b3] = rBe), se
        },
        qm = eOe();
      ui ? ((ui.exports = qm)._ = qm, gn._ = qm) : Lr._ = qm
    }).call(Iv)
  })(ME, ME.exports);
  var y5e = Object.defineProperty,
    _5e = Object.defineProperties,
    x5e = Object.getOwnPropertyDescriptors,
    fU = Object.getOwnPropertySymbols,
    C5e = Object.prototype.hasOwnProperty,
    E5e = Object.prototype.propertyIsEnumerable,
    pU = (t, e, r) => e in t ? y5e(t, e, {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: r
    }) : t[e] = r,
    E4 = (t, e) => {
      for (var r in e || (e = {})) C5e.call(e, r) && pU(t, r, e[r]);
      if (fU)
        for (var r of fU(e)) E5e.call(e, r) && pU(t, r, e[r]);
      return t
    },
    A5e = (t, e) => _5e(t, x5e(e));

  function Ic(t, e, r) {
    var n;
    const i = J2(t);
    return ((n = e.rpcMap) == null ? void 0 : n[i.reference]) || `${hU}?chainId=${i.namespace}:${i.reference}&projectId=${r}`
  }

  function N0(t) {
    return t.includes(":") ? t.split(":")[1] : t
  }

  function gU(t) {
    return t.map(e => `${e.split(":")[0]}:${e.split(":")[1]}`)
  }

  function S5e(t, e) {
    const r = Object.keys(e.namespaces).filter(i => i.includes(t));
    if (!r.length) return [];
    const n = [];
    return r.forEach(i => {
      const s = e.namespaces[i].accounts;
      n.push(...s)
    }), n
  }

  function PE(t = {}, e = {}) {
    const r = mU(t),
      n = mU(e);
    return ME.exports.merge(r, n)
  }

  function mU(t) {
    var e, r, n, i;
    const s = {};
    if (!vv(t)) return s;
    for (const [o, a] of Object.entries(t)) {
      const c = pE(o) ? [o] : a.chains,
        l = a.methods || [],
        h = a.events || [],
        f = a.rpcMap || {},
        w = wv(o);
      s[w] = A5e(E4(E4({}, s[w]), a), {
        chains: X5(c, (e = s[w]) == null ? void 0 : e.chains),
        methods: X5(l, (r = s[w]) == null ? void 0 : r.methods),
        events: X5(h, (n = s[w]) == null ? void 0 : n.events),
        rpcMap: E4(E4({}, f), (i = s[w]) == null ? void 0 : i.rpcMap)
      })
    }
    return s
  }

  function I5e(t) {
    return t.includes(":") ? t.split(":")[2] : t
  }

  function wU(t) {
    const e = {};
    for (const [r, n] of Object.entries(t)) {
      const i = n.methods || [],
        s = n.events || [],
        o = n.accounts || [],
        a = pE(r) ? [r] : n.chains ? n.chains : gU(n.accounts);
      e[r] = {
        chains: a,
        methods: i,
        events: s,
        accounts: o
      }
    }
    return e
  }

  function $E(t) {
    return typeof t == "number" ? t : t.includes("0x") ? parseInt(t, 16) : (t = t.includes(":") ? t.split(":")[1] : t, isNaN(Number(t)) ? t : Number(t))
  }
  const vU = {},
    Jr = t => vU[t],
    OE = (t, e) => {
      vU[t] = e
    };
  class T5e {
    constructor(e) {
      this.name = "polkadot", this.namespace = e.namespace, this.events = Jr("events"), this.client = Jr("client"), this.chainId = this.getDefaultChain(), this.httpProviders = this.createHttpProviders()
    }
    updateNamespace(e) {
      this.namespace = Object.assign(this.namespace, e)
    }
    requestAccounts() {
      return this.getAccounts()
    }
    getDefaultChain() {
      if (this.chainId) return this.chainId;
      if (this.namespace.defaultChain) return this.namespace.defaultChain;
      const e = this.namespace.chains[0];
      if (!e) throw new Error("ChainId not found");
      return e.split(":")[1]
    }
    request(e) {
      return this.namespace.methods.includes(e.request.method) ? this.client.request(e) : this.getHttpProvider().request(e.request)
    }
    setDefaultChain(e, r) {
      this.httpProviders[e] || this.setHttpProvider(e, r), this.chainId = e, this.events.emit(Sc.DEFAULT_CHAIN_CHANGED, `${this.name}:${e}`)
    }
    getAccounts() {
      const e = this.namespace.accounts;
      return e ? e.filter(r => r.split(":")[1] === this.chainId.toString()).map(r => r.split(":")[2]) || [] : []
    }
    createHttpProviders() {
      const e = {};
      return this.namespace.chains.forEach(r => {
        var n;
        const i = N0(r);
        e[i] = this.createHttpProvider(i, (n = this.namespace.rpcMap) == null ? void 0 : n[r])
      }), e
    }
    getHttpProvider() {
      const e = `${this.name}:${this.chainId}`,
        r = this.httpProviders[e];
      if (typeof r > "u") throw new Error(`JSON-RPC provider for ${e} not found`);
      return r
    }
    setHttpProvider(e, r) {
      const n = this.createHttpProvider(e, r);
      n && (this.httpProviders[e] = n)
    }
    createHttpProvider(e, r) {
      const n = r || Ic(e, this.namespace, this.client.core.projectId);
      if (!n) throw new Error(`No RPC url provided for chainId: ${e}`);
      return new xc(new Fl(n, Jr("disableProviderPing")))
    }
  }
  var k5e = Object.defineProperty,
    R5e = Object.defineProperties,
    N5e = Object.getOwnPropertyDescriptors,
    bU = Object.getOwnPropertySymbols,
    M5e = Object.prototype.hasOwnProperty,
    P5e = Object.prototype.propertyIsEnumerable,
    yU = (t, e, r) => e in t ? k5e(t, e, {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: r
    }) : t[e] = r,
    _U = (t, e) => {
      for (var r in e || (e = {})) M5e.call(e, r) && yU(t, r, e[r]);
      if (bU)
        for (var r of bU(e)) P5e.call(e, r) && yU(t, r, e[r]);
      return t
    },
    xU = (t, e) => R5e(t, N5e(e));
  class $5e {
    constructor(e) {
      this.name = "eip155", this.namespace = e.namespace, this.events = Jr("events"), this.client = Jr("client"), this.httpProviders = this.createHttpProviders(), this.chainId = parseInt(this.getDefaultChain())
    }
    async request(e) {
      switch (e.request.method) {
        case "eth_requestAccounts":
          return this.getAccounts();
        case "eth_accounts":
          return this.getAccounts();
        case "wallet_switchEthereumChain":
          return await this.handleSwitchChain(e);
        case "eth_chainId":
          return parseInt(this.getDefaultChain());
        case "wallet_getCapabilities":
          return await this.getCapabilities(e);
        case "wallet_getCallsStatus":
          return await this.getCallStatus(e)
      }
      return this.namespace.methods.includes(e.request.method) ? await this.client.request(e) : this.getHttpProvider().request(e.request)
    }
    updateNamespace(e) {
      this.namespace = Object.assign(this.namespace, e)
    }
    setDefaultChain(e, r) {
      this.httpProviders[e] || this.setHttpProvider(parseInt(e), r), this.chainId = parseInt(e), this.events.emit(Sc.DEFAULT_CHAIN_CHANGED, `${this.name}:${e}`)
    }
    requestAccounts() {
      return this.getAccounts()
    }
    getDefaultChain() {
      if (this.chainId) return this.chainId.toString();
      if (this.namespace.defaultChain) return this.namespace.defaultChain;
      const e = this.namespace.chains[0];
      if (!e) throw new Error("ChainId not found");
      return e.split(":")[1]
    }
    createHttpProvider(e, r) {
      const n = r || Ic(`${this.name}:${e}`, this.namespace, this.client.core.projectId);
      if (!n) throw new Error(`No RPC url provided for chainId: ${e}`);
      return new xc(new Fl(n, Jr("disableProviderPing")))
    }
    setHttpProvider(e, r) {
      const n = this.createHttpProvider(e, r);
      n && (this.httpProviders[e] = n)
    }
    createHttpProviders() {
      const e = {};
      return this.namespace.chains.forEach(r => {
        var n;
        const i = parseInt(N0(r));
        e[i] = this.createHttpProvider(i, (n = this.namespace.rpcMap) == null ? void 0 : n[r])
      }), e
    }
    getAccounts() {
      const e = this.namespace.accounts;
      return e ? [...new Set(e.filter(r => r.split(":")[1] === this.chainId.toString()).map(r => r.split(":")[2]))] : []
    }
    getHttpProvider() {
      const e = this.chainId,
        r = this.httpProviders[e];
      if (typeof r > "u") throw new Error(`JSON-RPC provider for ${e} not found`);
      return r
    }
    async handleSwitchChain(e) {
      var r, n;
      let i = e.request.params ? (r = e.request.params[0]) == null ? void 0 : r.chainId : "0x0";
      i = i.startsWith("0x") ? i : `0x${i}`;
      const s = parseInt(i, 16);
      if (this.isChainApproved(s)) this.setDefaultChain(`${s}`);
      else if (this.namespace.methods.includes("wallet_switchEthereumChain")) await this.client.request({
        topic: e.topic,
        request: {
          method: e.request.method,
          params: [{
            chainId: i
          }]
        },
        chainId: (n = this.namespace.chains) == null ? void 0 : n[0]
      }), this.setDefaultChain(`${s}`);
      else throw new Error(`Failed to switch to chain 'eip155:${s}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);
      return null
    }
    isChainApproved(e) {
      return this.namespace.chains.includes(`${this.name}:${e}`)
    }
    async getCapabilities(e) {
      var r, n, i;
      const s = (n = (r = e.request) == null ? void 0 : r.params) == null ? void 0 : n[0];
      if (!s) throw new Error("Missing address parameter in `wallet_getCapabilities` request");
      const o = this.client.session.get(e.topic),
        a = ((i = o?.sessionProperties) == null ? void 0 : i.capabilities) || {};
      if (a != null && a[s]) return a?.[s];
      const c = await this.client.request(e);
      try {
        await this.client.session.update(e.topic, {
          sessionProperties: xU(_U({}, o.sessionProperties || {}), {
            capabilities: xU(_U({}, a || {}), {
              [s]: c
            })
          })
        })
      } catch (l) {
        console.warn("Failed to update session with capabilities", l)
      }
      return c
    }
    async getCallStatus(e) {
      var r, n;
      const i = this.client.session.get(e.topic),
        s = (r = i.sessionProperties) == null ? void 0 : r.bundler_name;
      if (s) {
        const a = this.getBundlerUrl(e.chainId, s);
        try {
          return await this.getUserOperationReceipt(a, e)
        } catch (c) {
          console.warn("Failed to fetch call status from bundler", c, a)
        }
      }
      const o = (n = i.sessionProperties) == null ? void 0 : n.bundler_url;
      if (o) try {
        return await this.getUserOperationReceipt(o, e)
      } catch (a) {
        console.warn("Failed to fetch call status from custom bundler", a, o)
      }
      if (this.namespace.methods.includes(e.request.method)) return await this.client.request(e);
      throw new Error("Fetching call status not approved by the wallet.")
    }
    async getUserOperationReceipt(e, r) {
      var n;
      const i = new URL(e),
        s = await fetch(i, {
          method: "POST",
          headers: {
            "Content-Type": "application/json"
          },
          body: JSON.stringify(Nh("eth_getUserOperationReceipt", [(n = r.request.params) == null ? void 0 : n[0]]))
        });
      if (!s.ok) throw new Error(`Failed to fetch user operation receipt - ${s.status}`);
      return await s.json()
    }
    getBundlerUrl(e, r) {
      return `${b5e}?projectId=${this.client.core.projectId}&chainId=${e}&bundler=${r}`
    }
  }
  class O5e {
    constructor(e) {
      this.name = "solana", this.namespace = e.namespace, this.events = Jr("events"), this.client = Jr("client"), this.chainId = this.getDefaultChain(), this.httpProviders = this.createHttpProviders()
    }
    updateNamespace(e) {
      this.namespace = Object.assign(this.namespace, e)
    }
    requestAccounts() {
      return this.getAccounts()
    }
    request(e) {
      return this.namespace.methods.includes(e.request.method) ? this.client.request(e) : this.getHttpProvider().request(e.request)
    }
    setDefaultChain(e, r) {
      this.httpProviders[e] || this.setHttpProvider(e, r), this.chainId = e, this.events.emit(Sc.DEFAULT_CHAIN_CHANGED, `${this.name}:${e}`)
    }
    getDefaultChain() {
      if (this.chainId) return this.chainId;
      if (this.namespace.defaultChain) return this.namespace.defaultChain;
      const e = this.namespace.chains[0];
      if (!e) throw new Error("ChainId not found");
      return e.split(":")[1]
    }
    getAccounts() {
      const e = this.namespace.accounts;
      return e ? [...new Set(e.filter(r => r.split(":")[1] === this.chainId.toString()).map(r => r.split(":")[2]))] : []
    }
    createHttpProviders() {
      const e = {};
      return this.namespace.chains.forEach(r => {
        var n;
        const i = N0(r);
        e[i] = this.createHttpProvider(i, (n = this.namespace.rpcMap) == null ? void 0 : n[r])
      }), e
    }
    getHttpProvider() {
      const e = `${this.name}:${this.chainId}`,
        r = this.httpProviders[e];
      if (typeof r > "u") throw new Error(`JSON-RPC provider for ${e} not found`);
      return r
    }
    setHttpProvider(e, r) {
      const n = this.createHttpProvider(e, r);
      n && (this.httpProviders[e] = n)
    }
    createHttpProvider(e, r) {
      const n = r || Ic(e, this.namespace, this.client.core.projectId);
      if (!n) throw new Error(`No RPC url provided for chainId: ${e}`);
      return new xc(new Fl(n, Jr("disableProviderPing")))
    }
  }
  class D5e {
    constructor(e) {
      this.name = "cosmos", this.namespace = e.namespace, this.events = Jr("events"), this.client = Jr("client"), this.chainId = this.getDefaultChain(), this.httpProviders = this.createHttpProviders()
    }
    updateNamespace(e) {
      this.namespace = Object.assign(this.namespace, e)
    }
    requestAccounts() {
      return this.getAccounts()
    }
    getDefaultChain() {
      if (this.chainId) return this.chainId;
      if (this.namespace.defaultChain) return this.namespace.defaultChain;
      const e = this.namespace.chains[0];
      if (!e) throw new Error("ChainId not found");
      return e.split(":")[1]
    }
    request(e) {
      return this.namespace.methods.includes(e.request.method) ? this.client.request(e) : this.getHttpProvider().request(e.request)
    }
    setDefaultChain(e, r) {
      this.httpProviders[e] || this.setHttpProvider(e, r), this.chainId = e, this.events.emit(Sc.DEFAULT_CHAIN_CHANGED, `${this.name}:${this.chainId}`)
    }
    getAccounts() {
      const e = this.namespace.accounts;
      return e ? [...new Set(e.filter(r => r.split(":")[1] === this.chainId.toString()).map(r => r.split(":")[2]))] : []
    }
    createHttpProviders() {
      const e = {};
      return this.namespace.chains.forEach(r => {
        var n;
        const i = N0(r);
        e[i] = this.createHttpProvider(i, (n = this.namespace.rpcMap) == null ? void 0 : n[r])
      }), e
    }
    getHttpProvider() {
      const e = `${this.name}:${this.chainId}`,
        r = this.httpProviders[e];
      if (typeof r > "u") throw new Error(`JSON-RPC provider for ${e} not found`);
      return r
    }
    setHttpProvider(e, r) {
      const n = this.createHttpProvider(e, r);
      n && (this.httpProviders[e] = n)
    }
    createHttpProvider(e, r) {
      const n = r || Ic(e, this.namespace, this.client.core.projectId);
      if (!n) throw new Error(`No RPC url provided for chainId: ${e}`);
      return new xc(new Fl(n, Jr("disableProviderPing")))
    }
  }
  class L5e {
    constructor(e) {
      this.name = "algorand", this.namespace = e.namespace, this.events = Jr("events"), this.client = Jr("client"), this.chainId = this.getDefaultChain(), this.httpProviders = this.createHttpProviders()
    }
    updateNamespace(e) {
      this.namespace = Object.assign(this.namespace, e)
    }
    requestAccounts() {
      return this.getAccounts()
    }
    request(e) {
      return this.namespace.methods.includes(e.request.method) ? this.client.request(e) : this.getHttpProvider().request(e.request)
    }
    setDefaultChain(e, r) {
      if (!this.httpProviders[e]) {
        const n = r || Ic(`${this.name}:${e}`, this.namespace, this.client.core.projectId);
        if (!n) throw new Error(`No RPC url provided for chainId: ${e}`);
        this.setHttpProvider(e, n)
      }
      this.chainId = e, this.events.emit(Sc.DEFAULT_CHAIN_CHANGED, `${this.name}:${this.chainId}`)
    }
    getDefaultChain() {
      if (this.chainId) return this.chainId;
      if (this.namespace.defaultChain) return this.namespace.defaultChain;
      const e = this.namespace.chains[0];
      if (!e) throw new Error("ChainId not found");
      return e.split(":")[1]
    }
    getAccounts() {
      const e = this.namespace.accounts;
      return e ? [...new Set(e.filter(r => r.split(":")[1] === this.chainId.toString()).map(r => r.split(":")[2]))] : []
    }
    createHttpProviders() {
      const e = {};
      return this.namespace.chains.forEach(r => {
        var n;
        e[r] = this.createHttpProvider(r, (n = this.namespace.rpcMap) == null ? void 0 : n[r])
      }), e
    }
    getHttpProvider() {
      const e = `${this.name}:${this.chainId}`,
        r = this.httpProviders[e];
      if (typeof r > "u") throw new Error(`JSON-RPC provider for ${e} not found`);
      return r
    }
    setHttpProvider(e, r) {
      const n = this.createHttpProvider(e, r);
      n && (this.httpProviders[e] = n)
    }
    createHttpProvider(e, r) {
      const n = r || Ic(e, this.namespace, this.client.core.projectId);
      return typeof n > "u" ? void 0 : new xc(new Fl(n, Jr("disableProviderPing")))
    }
  }
  class B5e {
    constructor(e) {
      this.name = "cip34", this.namespace = e.namespace, this.events = Jr("events"), this.client = Jr("client"), this.chainId = this.getDefaultChain(), this.httpProviders = this.createHttpProviders()
    }
    updateNamespace(e) {
      this.namespace = Object.assign(this.namespace, e)
    }
    requestAccounts() {
      return this.getAccounts()
    }
    getDefaultChain() {
      if (this.chainId) return this.chainId;
      if (this.namespace.defaultChain) return this.namespace.defaultChain;
      const e = this.namespace.chains[0];
      if (!e) throw new Error("ChainId not found");
      return e.split(":")[1]
    }
    request(e) {
      return this.namespace.methods.includes(e.request.method) ? this.client.request(e) : this.getHttpProvider().request(e.request)
    }
    setDefaultChain(e, r) {
      this.httpProviders[e] || this.setHttpProvider(e, r), this.chainId = e, this.events.emit(Sc.DEFAULT_CHAIN_CHANGED, `${this.name}:${this.chainId}`)
    }
    getAccounts() {
      const e = this.namespace.accounts;
      return e ? [...new Set(e.filter(r => r.split(":")[1] === this.chainId.toString()).map(r => r.split(":")[2]))] : []
    }
    createHttpProviders() {
      const e = {};
      return this.namespace.chains.forEach(r => {
        const n = this.getCardanoRPCUrl(r),
          i = N0(r);
        e[i] = this.createHttpProvider(i, n)
      }), e
    }
    getHttpProvider() {
      const e = `${this.name}:${this.chainId}`,
        r = this.httpProviders[e];
      if (typeof r > "u") throw new Error(`JSON-RPC provider for ${e} not found`);
      return r
    }
    getCardanoRPCUrl(e) {
      const r = this.namespace.rpcMap;
      if (r) return r[e]
    }
    setHttpProvider(e, r) {
      const n = this.createHttpProvider(e, r);
      n && (this.httpProviders[e] = n)
    }
    createHttpProvider(e, r) {
      const n = r || this.getCardanoRPCUrl(e);
      if (!n) throw new Error(`No RPC url provided for chainId: ${e}`);
      return new xc(new Fl(n, Jr("disableProviderPing")))
    }
  }
  class U5e {
    constructor(e) {
      this.name = "elrond", this.namespace = e.namespace, this.events = Jr("events"), this.client = Jr("client"), this.chainId = this.getDefaultChain(), this.httpProviders = this.createHttpProviders()
    }
    updateNamespace(e) {
      this.namespace = Object.assign(this.namespace, e)
    }
    requestAccounts() {
      return this.getAccounts()
    }
    request(e) {
      return this.namespace.methods.includes(e.request.method) ? this.client.request(e) : this.getHttpProvider().request(e.request)
    }
    setDefaultChain(e, r) {
      this.httpProviders[e] || this.setHttpProvider(e, r), this.chainId = e, this.events.emit(Sc.DEFAULT_CHAIN_CHANGED, `${this.name}:${e}`)
    }
    getDefaultChain() {
      if (this.chainId) return this.chainId;
      if (this.namespace.defaultChain) return this.namespace.defaultChain;
      const e = this.namespace.chains[0];
      if (!e) throw new Error("ChainId not found");
      return e.split(":")[1]
    }
    getAccounts() {
      const e = this.namespace.accounts;
      return e ? [...new Set(e.filter(r => r.split(":")[1] === this.chainId.toString()).map(r => r.split(":")[2]))] : []
    }
    createHttpProviders() {
      const e = {};
      return this.namespace.chains.forEach(r => {
        var n;
        const i = N0(r);
        e[i] = this.createHttpProvider(i, (n = this.namespace.rpcMap) == null ? void 0 : n[r])
      }), e
    }
    getHttpProvider() {
      const e = `${this.name}:${this.chainId}`,
        r = this.httpProviders[e];
      if (typeof r > "u") throw new Error(`JSON-RPC provider for ${e} not found`);
      return r
    }
    setHttpProvider(e, r) {
      const n = this.createHttpProvider(e, r);
      n && (this.httpProviders[e] = n)
    }
    createHttpProvider(e, r) {
      const n = r || Ic(e, this.namespace, this.client.core.projectId);
      if (!n) throw new Error(`No RPC url provided for chainId: ${e}`);
      return new xc(new Fl(n, Jr("disableProviderPing")))
    }
  }
  class j5e {
    constructor(e) {
      this.name = "multiversx", this.namespace = e.namespace, this.events = Jr("events"), this.client = Jr("client"), this.chainId = this.getDefaultChain(), this.httpProviders = this.createHttpProviders()
    }
    updateNamespace(e) {
      this.namespace = Object.assign(this.namespace, e)
    }
    requestAccounts() {
      return this.getAccounts()
    }
    request(e) {
      return this.namespace.methods.includes(e.request.method) ? this.client.request(e) : this.getHttpProvider().request(e.request)
    }
    setDefaultChain(e, r) {
      this.httpProviders[e] || this.setHttpProvider(e, r), this.chainId = e, this.events.emit(Sc.DEFAULT_CHAIN_CHANGED, `${this.name}:${e}`)
    }
    getDefaultChain() {
      if (this.chainId) return this.chainId;
      if (this.namespace.defaultChain) return this.namespace.defaultChain;
      const e = this.namespace.chains[0];
      if (!e) throw new Error("ChainId not found");
      return e.split(":")[1]
    }
    getAccounts() {
      const e = this.namespace.accounts;
      return e ? [...new Set(e.filter(r => r.split(":")[1] === this.chainId.toString()).map(r => r.split(":")[2]))] : []
    }
    createHttpProviders() {
      const e = {};
      return this.namespace.chains.forEach(r => {
        var n;
        const i = N0(r);
        e[i] = this.createHttpProvider(i, (n = this.namespace.rpcMap) == null ? void 0 : n[r])
      }), e
    }
    getHttpProvider() {
      const e = `${this.name}:${this.chainId}`,
        r = this.httpProviders[e];
      if (typeof r > "u") throw new Error(`JSON-RPC provider for ${e} not found`);
      return r
    }
    setHttpProvider(e, r) {
      const n = this.createHttpProvider(e, r);
      n && (this.httpProviders[e] = n)
    }
    createHttpProvider(e, r) {
      const n = r || Ic(e, this.namespace, this.client.core.projectId);
      if (!n) throw new Error(`No RPC url provided for chainId: ${e}`);
      return new xc(new Fl(n, Jr("disableProviderPing")))
    }
  }
  class F5e {
    constructor(e) {
      this.name = "near", this.namespace = e.namespace, this.events = Jr("events"), this.client = Jr("client"), this.chainId = this.getDefaultChain(), this.httpProviders = this.createHttpProviders()
    }
    updateNamespace(e) {
      this.namespace = Object.assign(this.namespace, e)
    }
    requestAccounts() {
      return this.getAccounts()
    }
    getDefaultChain() {
      if (this.chainId) return this.chainId;
      if (this.namespace.defaultChain) return this.namespace.defaultChain;
      const e = this.namespace.chains[0];
      if (!e) throw new Error("ChainId not found");
      return e.split(":")[1]
    }
    request(e) {
      return this.namespace.methods.includes(e.request.method) ? this.client.request(e) : this.getHttpProvider().request(e.request)
    }
    setDefaultChain(e, r) {
      if (this.chainId = e, !this.httpProviders[e]) {
        const n = r || Ic(`${this.name}:${e}`, this.namespace);
        if (!n) throw new Error(`No RPC url provided for chainId: ${e}`);
        this.setHttpProvider(e, n)
      }
      this.events.emit(Sc.DEFAULT_CHAIN_CHANGED, `${this.name}:${this.chainId}`)
    }
    getAccounts() {
      const e = this.namespace.accounts;
      return e ? e.filter(r => r.split(":")[1] === this.chainId.toString()).map(r => r.split(":")[2]) || [] : []
    }
    createHttpProviders() {
      const e = {};
      return this.namespace.chains.forEach(r => {
        var n;
        e[r] = this.createHttpProvider(r, (n = this.namespace.rpcMap) == null ? void 0 : n[r])
      }), e
    }
    getHttpProvider() {
      const e = `${this.name}:${this.chainId}`,
        r = this.httpProviders[e];
      if (typeof r > "u") throw new Error(`JSON-RPC provider for ${e} not found`);
      return r
    }
    setHttpProvider(e, r) {
      const n = this.createHttpProvider(e, r);
      n && (this.httpProviders[e] = n)
    }
    createHttpProvider(e, r) {
      const n = r || Ic(e, this.namespace);
      return typeof n > "u" ? void 0 : new xc(new Fl(n, Jr("disableProviderPing")))
    }
  }
  class W5e {
    constructor(e) {
      this.name = Tg, this.namespace = e.namespace, this.events = Jr("events"), this.client = Jr("client"), this.chainId = this.getDefaultChain(), this.httpProviders = this.createHttpProviders()
    }
    updateNamespace(e) {
      this.namespace.chains = [...new Set((this.namespace.chains || []).concat(e.chains || []))], this.namespace.accounts = [...new Set((this.namespace.accounts || []).concat(e.accounts || []))], this.namespace.methods = [...new Set((this.namespace.methods || []).concat(e.methods || []))], this.namespace.events = [...new Set((this.namespace.events || []).concat(e.events || []))], this.httpProviders = this.createHttpProviders()
    }
    requestAccounts() {
      return this.getAccounts()
    }
    request(e) {
      return this.namespace.methods.includes(e.request.method) ? this.client.request(e) : this.getHttpProvider(e.chainId).request(e.request)
    }
    setDefaultChain(e, r) {
      this.httpProviders[e] || this.setHttpProvider(e, r), this.chainId = e, this.events.emit(Sc.DEFAULT_CHAIN_CHANGED, `${this.name}:${e}`)
    }
    getDefaultChain() {
      if (this.chainId) return this.chainId;
      if (this.namespace.defaultChain) return this.namespace.defaultChain;
      const e = this.namespace.chains[0];
      if (!e) throw new Error("ChainId not found");
      return e.split(":")[1]
    }
    getAccounts() {
      const e = this.namespace.accounts;
      return e ? [...new Set(e.filter(r => r.split(":")[1] === this.chainId.toString()).map(r => r.split(":")[2]))] : []
    }
    createHttpProviders() {
      var e, r;
      const n = {};
      return (r = (e = this.namespace) == null ? void 0 : e.accounts) == null || r.forEach(i => {
        const s = J2(i);
        n[`${s.namespace}:${s.reference}`] = this.createHttpProvider(i)
      }), n
    }
    getHttpProvider(e) {
      const r = this.httpProviders[e];
      if (typeof r > "u") throw new Error(`JSON-RPC provider for ${e} not found`);
      return r
    }
    setHttpProvider(e, r) {
      const n = this.createHttpProvider(e, r);
      n && (this.httpProviders[e] = n)
    }
    createHttpProvider(e, r) {
      const n = r || Ic(e, this.namespace, this.client.core.projectId);
      if (!n) throw new Error(`No RPC url provided for chainId: ${e}`);
      return new xc(new Fl(n, Jr("disableProviderPing")))
    }
  }
  var z5e = Object.defineProperty,
    H5e = Object.defineProperties,
    q5e = Object.getOwnPropertyDescriptors,
    CU = Object.getOwnPropertySymbols,
    V5e = Object.prototype.hasOwnProperty,
    K5e = Object.prototype.propertyIsEnumerable,
    EU = (t, e, r) => e in t ? z5e(t, e, {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: r
    }) : t[e] = r,
    A4 = (t, e) => {
      for (var r in e || (e = {})) V5e.call(e, r) && EU(t, r, e[r]);
      if (CU)
        for (var r of CU(e)) K5e.call(e, r) && EU(t, r, e[r]);
      return t
    },
    DE = (t, e) => H5e(t, q5e(e));
  class S4 {
    constructor(e) {
      this.events = new zx, this.rpcProviders = {}, this.shouldAbortPairingAttempt = !1, this.maxPairingAttempts = 10, this.disableProviderPing = !1, this.providerOpts = e, this.logger = typeof e?.logger < "u" && typeof e?.logger != "string" ? e.logger : Zw(y1({
        level: e?.logger || uU
      })), this.disableProviderPing = e?.disableProviderPing || !1
    }
    static async init(e) {
      const r = new S4(e);
      return await r.initialize(), r
    }
    async request(e, r, n) {
      const [i, s] = this.validateChain(r);
      if (!this.session) throw new Error("Please call connect() before request()");
      return await this.getProvider(i).request({
        request: A4({}, e),
        chainId: `${i}:${s}`,
        topic: this.session.topic,
        expiry: n
      })
    }
    sendAsync(e, r, n, i) {
      const s = new Date().getTime();
      this.request(e, n, i).then(o => r(null, w4(s, o))).catch(o => r(o, void 0))
    }
    async enable() {
      if (!this.client) throw new Error("Sign Client not initialized");
      return this.session || await this.connect({
        namespaces: this.namespaces,
        optionalNamespaces: this.optionalNamespaces,
        sessionProperties: this.sessionProperties
      }), await this.requestAccounts()
    }
    async disconnect() {
      var e;
      if (!this.session) throw new Error("Please call connect() before enable()");
      await this.client.disconnect({
        topic: (e = this.session) == null ? void 0 : e.topic,
        reason: nn("USER_DISCONNECTED")
      }), await this.cleanup()
    }
    async connect(e) {
      if (!this.client) throw new Error("Sign Client not initialized");
      if (this.setNamespaces(e), await this.cleanupPendingPairings(), !e.skipPairing) return await this.pair(e.pairingTopic)
    }
    async authenticate(e, r) {
      if (!this.client) throw new Error("Sign Client not initialized");
      this.setNamespaces(e), await this.cleanupPendingPairings();
      const {
        uri: n,
        response: i
      } = await this.client.authenticate(e, r);
      n && (this.uri = n, this.events.emit("display_uri", n));
      const s = await i();
      if (this.session = s.session, this.session) {
        const o = wU(this.session.namespaces);
        this.namespaces = PE(this.namespaces, o), this.persist("namespaces", this.namespaces), this.onConnect()
      }
      return s
    }
    on(e, r) {
      this.events.on(e, r)
    }
    once(e, r) {
      this.events.once(e, r)
    }
    removeListener(e, r) {
      this.events.removeListener(e, r)
    }
    off(e, r) {
      this.events.off(e, r)
    }
    get isWalletConnect() {
      return !0
    }
    async pair(e) {
      this.shouldAbortPairingAttempt = !1;
      let r = 0;
      do {
        if (this.shouldAbortPairingAttempt) throw new Error("Pairing aborted");
        if (r >= this.maxPairingAttempts) throw new Error("Max auto pairing attempts reached");
        const {
          uri: n,
          approval: i
        } = await this.client.connect({
          pairingTopic: e,
          requiredNamespaces: this.namespaces,
          optionalNamespaces: this.optionalNamespaces,
          sessionProperties: this.sessionProperties
        });
        n && (this.uri = n, this.events.emit("display_uri", n)), await i().then(s => {
          this.session = s;
          const o = wU(s.namespaces);
          this.namespaces = PE(this.namespaces, o), this.persist("namespaces", this.namespaces)
        }).catch(s => {
          if (s.message !== eU) throw s;
          r++
        })
      } while (!this.session);
      return this.onConnect(), this.session
    }
    setDefaultChain(e, r) {
      try {
        if (!this.session) return;
        const [n, i] = this.validateChain(e), s = this.getProvider(n);
        s.name === Tg ? s.setDefaultChain(`${n}:${i}`, r) : s.setDefaultChain(i, r)
      } catch (n) {
        if (!/Please call connect/.test(n.message)) throw n
      }
    }
    async cleanupPendingPairings(e = {}) {
      this.logger.info("Cleaning up inactive pairings...");
      const r = this.client.pairing.getAll();
      if (Ol(r)) {
        for (const n of r) e.deletePairings ? this.client.core.expirer.set(n.topic, 0) : await this.client.core.relayer.subscriber.unsubscribe(n.topic);
        this.logger.info(`Inactive pairings cleared: ${r.length}`)
      }
    }
    abortPairingAttempt() {
      this.shouldAbortPairingAttempt = !0
    }
    async checkStorage() {
      if (this.namespaces = await this.getFromStore("namespaces"), this.optionalNamespaces = await this.getFromStore("optionalNamespaces") || {}, this.client.session.length) {
        const e = this.client.session.keys.length - 1;
        this.session = this.client.session.get(this.client.session.keys[e]), this.createProviders()
      }
    }
    async initialize() {
      this.logger.trace("Initialized"), await this.createClient(), await this.checkStorage(), this.registerEventListeners()
    }
    async createClient() {
      this.client = this.providerOpts.client || await RE.init({
        core: this.providerOpts.core,
        logger: this.providerOpts.logger || uU,
        relayUrl: this.providerOpts.relayUrl || m5e,
        projectId: this.providerOpts.projectId,
        metadata: this.providerOpts.metadata,
        storageOptions: this.providerOpts.storageOptions,
        storage: this.providerOpts.storage,
        name: this.providerOpts.name,
        customStoragePrefix: this.providerOpts.customStoragePrefix,
        telemetryEnabled: this.providerOpts.telemetryEnabled
      }), this.logger.trace("SignClient Initialized")
    }
    createProviders() {
      if (!this.client) throw new Error("Sign Client not initialized");
      if (!this.session) throw new Error("Session not initialized. Please call connect() before enable()");
      const e = [...new Set(Object.keys(this.session.namespaces).map(r => wv(r)))];
      OE("client", this.client), OE("events", this.events), OE("disableProviderPing", this.disableProviderPing), e.forEach(r => {
        if (!this.session) return;
        const n = S5e(r, this.session),
          i = gU(n),
          s = PE(this.namespaces, this.optionalNamespaces),
          o = DE(A4({}, s[r]), {
            accounts: n,
            chains: i
          });
        switch (r) {
          case "eip155":
            this.rpcProviders[r] = new $5e({
              namespace: o
            });
            break;
          case "algorand":
            this.rpcProviders[r] = new L5e({
              namespace: o
            });
            break;
          case "solana":
            this.rpcProviders[r] = new O5e({
              namespace: o
            });
            break;
          case "cosmos":
            this.rpcProviders[r] = new D5e({
              namespace: o
            });
            break;
          case "polkadot":
            this.rpcProviders[r] = new T5e({
              namespace: o
            });
            break;
          case "cip34":
            this.rpcProviders[r] = new B5e({
              namespace: o
            });
            break;
          case "elrond":
            this.rpcProviders[r] = new U5e({
              namespace: o
            });
            break;
          case "multiversx":
            this.rpcProviders[r] = new j5e({
              namespace: o
            });
            break;
          case "near":
            this.rpcProviders[r] = new F5e({
              namespace: o
            });
            break;
          default:
            this.rpcProviders[Tg] ? this.rpcProviders[Tg].updateNamespace(o) : this.rpcProviders[Tg] = new W5e({
              namespace: o
            })
        }
      })
    }
    registerEventListeners() {
      if (typeof this.client > "u") throw new Error("Sign Client is not initialized");
      this.client.on("session_ping", e => {
        this.events.emit("session_ping", e)
      }), this.client.on("session_event", e => {
        const {
          params: r
        } = e, {
          event: n
        } = r;
        if (n.name === "accountsChanged") {
          const i = n.data;
          i && Ol(i) && this.events.emit("accountsChanged", i.map(I5e))
        } else if (n.name === "chainChanged") {
          const i = r.chainId,
            s = r.event.data,
            o = wv(i),
            a = $E(i) !== $E(s) ? `${o}:${$E(s)}` : i;
          this.onChainChanged(a)
        } else this.events.emit(n.name, n.data);
        this.events.emit("session_event", e)
      }), this.client.on("session_update", ({
        topic: e,
        params: r
      }) => {
        var n;
        const {
          namespaces: i
        } = r, s = (n = this.client) == null ? void 0 : n.session.get(e);
        this.session = DE(A4({}, s), {
          namespaces: i
        }), this.onSessionUpdate(), this.events.emit("session_update", {
          topic: e,
          params: r
        })
      }), this.client.on("session_delete", async e => {
        await this.cleanup(), this.events.emit("session_delete", e), this.events.emit("disconnect", DE(A4({}, nn("USER_DISCONNECTED")), {
          data: e.topic
        }))
      }), this.on(Sc.DEFAULT_CHAIN_CHANGED, e => {
        this.onChainChanged(e, !0)
      })
    }
    getProvider(e) {
      return this.rpcProviders[e] || this.rpcProviders[Tg]
    }
    onSessionUpdate() {
      Object.keys(this.rpcProviders).forEach(e => {
        var r;
        this.getProvider(e).updateNamespace((r = this.session) == null ? void 0 : r.namespaces[e])
      })
    }
    setNamespaces(e) {
      const {
        namespaces: r,
        optionalNamespaces: n,
        sessionProperties: i
      } = e;
      r && Object.keys(r).length && (this.namespaces = r), n && Object.keys(n).length && (this.optionalNamespaces = n), this.sessionProperties = i, this.persist("namespaces", r), this.persist("optionalNamespaces", n)
    }
    validateChain(e) {
      const [r, n] = e?.split(":") || ["", ""];
      if (!this.namespaces || !Object.keys(this.namespaces).length) return [r, n];
      if (r && !Object.keys(this.namespaces || {}).map(o => wv(o)).includes(r)) throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);
      if (r && n) return [r, n];
      const i = wv(Object.keys(this.namespaces)[0]),
        s = this.rpcProviders[i].getDefaultChain();
      return [i, s]
    }
    async requestAccounts() {
      const [e] = this.validateChain();
      return await this.getProvider(e).requestAccounts()
    }
    onChainChanged(e, r = !1) {
      if (!this.namespaces) return;
      const [n, i] = this.validateChain(e);
      i && (r || this.getProvider(n).setDefaultChain(i), this.namespaces[n] ? this.namespaces[n].defaultChain = i : this.namespaces[`${n}:${i}`] ? this.namespaces[`${n}:${i}`].defaultChain = i : this.namespaces[`${n}:${i}`] = {
        defaultChain: i
      }, this.persist("namespaces", this.namespaces), this.events.emit("chainChanged", i))
    }
    onConnect() {
      this.createProviders(), this.events.emit("connect", {
        session: this.session
      })
    }
    async cleanup() {
      this.session = void 0, this.namespaces = void 0, this.optionalNamespaces = void 0, this.sessionProperties = void 0, this.persist("namespaces", void 0), this.persist("optionalNamespaces", void 0), this.persist("sessionProperties", void 0), await this.cleanupPendingPairings({
        deletePairings: !0
      })
    }
    persist(e, r) {
      this.client.core.storage.setItem(`${dU}/${e}`, r)
    }
    async getFromStore(e) {
      return await this.client.core.storage.getItem(`${dU}/${e}`)
    }
  }
  const G5e = S4,
    LE = fee({
      id: 1,
      name: "Ethereum",
      nativeCurrency: {
        name: "Ether",
        symbol: "ETH",
        decimals: 18
      },
      rpcUrls: {
        default: {
          http: ["https://cloudflare-eth.com"]
        }
      },
      blockExplorers: {
        default: {
          name: "Etherscan",
          url: "https://etherscan.io",
          apiUrl: "https://api.etherscan.io/api"
        }
      },
      contracts: {
        ensRegistry: {
          address: "0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"
        },
        ensUniversalResolver: {
          address: "0xce01f8eee7E479C928F8919abD53E553a36CeF67",
          blockCreated: 19258213
        },
        multicall3: {
          address: "0xca11bde05977b3631167028862be2a173976ca11",
          blockCreated: 14353601
        }
      }
    });

  function BE(t) {
    return {
      formatters: void 0,
      fees: void 0,
      serializers: void 0,
      ...t
    }
  }
  const AU = BE({
      id: "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      name: "Solana",
      network: "solana-mainnet",
      nativeCurrency: {
        name: "Solana",
        symbol: "SOL",
        decimals: 9
      },
      rpcUrls: {
        default: {
          http: ["https://rpc.walletconnect.org/v1"]
        }
      },
      blockExplorers: {
        default: {
          name: "Solscan",
          url: "https://solscan.io"
        }
      },
      testnet: !1,
      chainNamespace: "solana",
      caipNetworkId: "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp",
      deprecatedCaipNetworkId: "solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ"
    }),
    SU = BE({
      id: "EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
      name: "Solana Devnet",
      network: "solana-devnet",
      nativeCurrency: {
        name: "Solana",
        symbol: "SOL",
        decimals: 9
      },
      rpcUrls: {
        default: {
          http: ["https://rpc.walletconnect.org/v1"]
        }
      },
      blockExplorers: {
        default: {
          name: "Solscan",
          url: "https://solscan.io"
        }
      },
      testnet: !0,
      chainNamespace: "solana",
      caipNetworkId: "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1",
      deprecatedCaipNetworkId: "solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K"
    });
  BE({
    id: "4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z",
    name: "Solana Testnet",
    network: "solana-testnet",
    nativeCurrency: {
      name: "Solana",
      symbol: "SOL",
      decimals: 9
    },
    rpcUrls: {
      default: {
        http: ["https://rpc.walletconnect.org/v1"]
      }
    },
    blockExplorers: {
      default: {
        name: "Solscan",
        url: "https://solscan.io"
      }
    },
    testnet: !0,
    chainNamespace: "solana",
    caipNetworkId: "solana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z"
  });
  const I4 = {
      getMethodsByChainNamespace(t) {
        switch (t) {
          case "solana":
            return ["solana_signMessage", "solana_signTransaction", "solana_requestAccounts", "solana_getAccounts", "solana_signAllTransactions", "solana_signAndSendTransaction"];
          case "eip155":
            return ["personal_sign", "eth_sign", "eth_signTransaction", "eth_signTypedData", "eth_signTypedData_v3", "eth_signTypedData_v4", "eth_sendRawTransaction", "eth_sendTransaction", "wallet_getCapabilities", "wallet_sendCalls", "wallet_showCallsStatus", "wallet_getCallsStatus", "wallet_grantPermissions", "wallet_revokePermissions", "wallet_switchEthereumChain"];
          default:
            return []
        }
      },
      createNamespaces(t) {
        return t.reduce((e, r) => {
          const {
            id: n,
            chainNamespace: i,
            rpcUrls: s
          } = r, o = s.default.http[0], a = this.getMethodsByChainNamespace(i);
          e[i] || (e[i] = {
            methods: a,
            events: ["accountsChanged", "chainChanged"],
            chains: [],
            rpcMap: {}
          });
          const c = `${i}:${n}`,
            l = e[i];
          switch (l.chains.push(c), c) {
            case AU.caipNetworkId:
              l.chains.push(AU.deprecatedCaipNetworkId);
              break;
            case SU.deprecatedCaipNetworkId:
              l.chains.push(SU.deprecatedCaipNetworkId);
              break
          }
          return l?.rpcMap && o && (l.rpcMap[n] = o), e
        }, {})
      },
      getChainsFromNamespaces(t = {}) {
        return Object.values(t).flatMap(e => {
          const r = e.chains || [],
            n = e.accounts.map(i => {
              const [s, o] = i.split(":");
              return `${s}:${o}`
            });
          return Array.from(new Set([...r, ...n]))
        })
      }
    },
    Ta = jr({
      providers: {
        eip155: void 0,
        solana: void 0,
        polkadot: void 0
      },
      providerIds: {
        eip155: void 0,
        solana: void 0,
        polkadot: void 0
      }
    }),
    Mh = {
      state: Ta,
      subscribeKey(t, e) {
        return ts(Ta, t, e)
      },
      subscribeProviders(t) {
        return Rn(Ta.providers, () => t(Ta.providers))
      },
      setProvider(t, e) {
        e && (Ta.providers[t] = rc(e))
      },
      getProvider(t) {
        return Ta.providers[t]
      },
      setProviderId(t, e) {
        e && (Ta.providerIds[t] = e)
      },
      getProviderId(t) {
        return Ta.providerIds[t]
      },
      reset() {
        Ta.providers = {
          eip155: void 0,
          solana: void 0,
          polkadot: void 0
        }, Ta.providerIds = {
          eip155: void 0,
          solana: void 0,
          polkadot: void 0
        }
      },
      resetChain(t) {
        Ta.providers[t] = void 0, Ta.providerIds[t] = void 0
      }
    };

  function Z5e(t) {
    if (t.length >= 255) throw new TypeError("Alphabet too long");
    const e = new Uint8Array(256);
    for (let l = 0; l < e.length; l++) e[l] = 255;
    for (let l = 0; l < t.length; l++) {
      const h = t.charAt(l),
        f = h.charCodeAt(0);
      if (e[f] !== 255) throw new TypeError(h + " is ambiguous");
      e[f] = l
    }
    const r = t.length,
      n = t.charAt(0),
      i = Math.log(r) / Math.log(256),
      s = Math.log(256) / Math.log(r);

    function o(l) {
      if (l instanceof Uint8Array || (ArrayBuffer.isView(l) ? l = new Uint8Array(l.buffer, l.byteOffset, l.byteLength) : Array.isArray(l) && (l = Uint8Array.from(l))), !(l instanceof Uint8Array)) throw new TypeError("Expected Uint8Array");
      if (l.length === 0) return "";
      let h = 0,
        f = 0,
        w = 0;
      const b = l.length;
      for (; w !== b && l[w] === 0;) w++, h++;
      const C = (b - w) * s + 1 >>> 0,
        M = new Uint8Array(C);
      for (; w !== b;) {
        let k = l[w],
          B = 0;
        for (let F = C - 1;
          (k !== 0 || B < f) && F !== -1; F--, B++) k += 256 * M[F] >>> 0, M[F] = k % r >>> 0, k = k / r >>> 0;
        if (k !== 0) throw new Error("Non-zero carry");
        f = B, w++
      }
      let N = C - f;
      for (; N !== C && M[N] === 0;) N++;
      let $ = n.repeat(h);
      for (; N < C; ++N) $ += t.charAt(M[N]);
      return $
    }

    function a(l) {
      if (typeof l != "string") throw new TypeError("Expected String");
      if (l.length === 0) return new Uint8Array;
      let h = 0,
        f = 0,
        w = 0;
      for (; l[h] === n;) f++, h++;
      const b = (l.length - h) * i + 1 >>> 0,
        C = new Uint8Array(b);
      for (; l[h];) {
        let k = e[l.charCodeAt(h)];
        if (k === 255) return;
        let B = 0;
        for (let F = b - 1;
          (k !== 0 || B < w) && F !== -1; F--, B++) k += r * C[F] >>> 0, C[F] = k % 256 >>> 0, k = k / 256 >>> 0;
        if (k !== 0) throw new Error("Non-zero carry");
        w = B, h++
      }
      let M = b - w;
      for (; M !== b && C[M] === 0;) M++;
      const N = new Uint8Array(f + (b - M));
      let $ = f;
      for (; M !== b;) N[$++] = C[M++];
      return N
    }

    function c(l) {
      const h = a(l);
      if (h) return h;
      throw new Error("Non-base" + r + " character")
    }
    return {
      encode: o,
      decodeUnsafe: a,
      decode: c
    }
  }
  var Y5e = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
  const Q5e = Z5e(Y5e),
    J5e = ["eth_accounts", "eth_requestAccounts", "eth_sendRawTransaction", "eth_sign", "eth_signTransaction", "eth_signTypedData", "eth_signTypedData_v3", "eth_signTypedData_v4", "eth_sendTransaction", "personal_sign", "wallet_switchEthereumChain", "wallet_addEthereumChain", "wallet_getPermissions", "wallet_requestPermissions", "wallet_registerOnboarding", "wallet_watchAsset", "wallet_scanQRCode", "wallet_getCallsStatus", "wallet_sendCalls", "wallet_getCapabilities", "wallet_grantPermissions", "wallet_revokePermissions"];
  class X5e {
    constructor(e) {
      this.appKit = void 0, this.isUniversalAdapterClient = !0, this.options = void 0, this.adapterType = "universal", this.reportedAlertErrors = {};
      const {
        siweConfig: r,
        metadata: n
      } = e;
      this.caipNetworks = e.networks, this.chainNamespace = pr.CHAIN.EVM, this.metadata = n, this.networkControllerClient = {
        switchCaipNetwork: i => {
          i && this.switchNetwork(i)
        },
        getApprovedCaipNetworksData: async () => {
          const i = await this.getWalletConnectProvider();
          if (!i) return Promise.resolve({
            supportsAllNetworks: !1,
            approvedCaipNetworkIds: []
          });
          const s = I4.getChainsFromNamespaces(i.session?.namespaces);
          return Promise.resolve({
            supportsAllNetworks: !1,
            approvedCaipNetworkIds: s
          })
        }
      }, this.connectionControllerClient = {
        connectWalletConnect: async i => {
          const s = await this.getWalletConnectProvider();
          if (!s) throw new Error("connectionControllerClient:getWalletConnectUri - provider is undefined");
          if (s.on("display_uri", o => {
              i(o)
            }), fe.state.activeChain && fe.state?.chains?.get(fe.state.activeChain)?.adapterType === "wagmi") await fe.state.chains.get(fe.state.activeChain)?.connectionControllerClient?.connectWalletConnect?.(i), this.setWalletConnectProvider();
          else {
            const o = await r?.getMessageParams?.(),
              a = r?.options?.enabled,
              c = typeof s?.authenticate == "function",
              l = o && Object.keys(o || {}).length > 0,
              h = await s?.client?.core?.crypto?.getClientId();
            if (h && this.appKit?.setClientId(h), r && a && o && c && l && fe.state.activeChain === pr.CHAIN.EVM) {
              const {
                SIWEController: f,
                getDidChainId: w,
                getDidAddress: b
              } = await pi(async () => {
                const {
                  SIWEController: $,
                  getDidChainId: k,
                  getDidAddress: B
                } = await Promise.resolve().then(() => ld);
                return {
                  SIWEController: $,
                  getDidChainId: k,
                  getDidAddress: B
                }
              }, void 0), C = this.caipNetworks?.filter($ => $.chainNamespace === pr.CHAIN.EVM).map($ => $.caipNetworkId);
              o.chains = this.caipNetworks?.filter($ => $.chainNamespace === pr.CHAIN.EVM).map($ => $.id);
              const N = (await s.authenticate({
                nonce: await r?.getNonce?.(),
                methods: [...J5e],
                ...o,
                chains: C
              }))?.auths?.[0];
              if (N) {
                const {
                  p: $,
                  s: k
                } = N, B = w($.iss), F = b($.iss);
                F && B && f.setSession({
                  address: F,
                  chainId: parseInt(B, 10)
                });
                try {
                  const D = s.client.formatAuthMessage({
                    request: $,
                    iss: $.iss
                  });
                  await f.verifyMessage({
                    message: D,
                    signature: k.s,
                    cacao: N
                  })
                } catch (D) {
                  throw console.error("Error verifying message", D), await s.disconnect().catch(console.error), await f.signOut().catch(console.error), D
                }
              }
            } else {
              const f = I4.createNamespaces(this.caipNetworks);
              await s.connect({
                optionalNamespaces: f
              })
            }
            this.setWalletConnectProvider()
          }
        },
        disconnect: async () => {
          if (bn.removeItem(vn.WALLET_ID), r?.options?.signOutOnDisconnect) {
            const {
              SIWEController: i
            } = await pi(async () => {
              const {
                SIWEController: s
              } = await Promise.resolve().then(() => ld);
              return {
                SIWEController: s
              }
            }, void 0);
            await i.signOut()
          }
          await this.walletConnectProvider?.disconnect(), this.appKit?.resetAccount(pr.CHAIN.EVM), this.appKit?.resetAccount(pr.CHAIN.SOLANA)
        },
        signMessage: async i => {
          const s = await this.getWalletConnectProvider(),
            o = fe.state.activeCaipAddress,
            a = je.getPlainAddress(o);
          if (!s) throw new Error("connectionControllerClient:signMessage - provider is undefined");
          let c = "";
          return fe.state.activeCaipNetwork?.chainNamespace === pr.CHAIN.SOLANA ? c = (await s.request({
            method: "solana_signMessage",
            params: {
              message: Q5e.encode(new TextEncoder().encode(i)),
              pubkey: a
            }
          }, fe.state.activeCaipNetwork?.caipNetworkId)).signature : c = await s.request({
            method: "personal_sign",
            params: [i, a]
          }, fe.state.activeCaipNetwork?.caipNetworkId), c
        },
        estimateGas: async () => await Promise.resolve(BigInt(0)),
        getEnsAvatar: async i => await Promise.resolve(i),
        getEnsAddress: async i => await Promise.resolve(i),
        writeContract: async () => await Promise.resolve("0x"),
        getCapabilities: async i => {
          const s = await this.getWalletConnectProvider();
          if (!s) throw new Error("connectionControllerClient:getCapabilities - provider is undefined");
          const o = s.session?.sessionProperties?.capabilities;
          if (o) {
            const c = this.parseWalletCapabilities(o)[i];
            if (c) return c
          }
          return await s.request({
            method: "wallet_getCapabilities",
            params: [i]
          })
        },
        grantPermissions: async i => {
          const s = await this.getWalletConnectProvider();
          if (!s) throw new Error("connectionControllerClient:grantPermissions - provider is undefined");
          return s.request({
            method: "wallet_grantPermissions",
            params: i
          })
        },
        revokePermissions: async i => {
          const s = await this.getWalletConnectProvider();
          if (!s) throw new Error("connectionControllerClient:grantPermissions - provider is undefined");
          return s.request({
            method: "wallet_revokePermissions",
            params: [i]
          })
        },
        sendTransaction: async () => await Promise.resolve("0x"),
        parseUnits: () => BigInt(0),
        formatUnits: () => ""
      }, fe.subscribeKey("activeCaipNetwork", i => {
        const s = this.appKit?.getCaipAddress(this.chainNamespace);
        i && s && (this.syncBalance(je.getPlainAddress(s), i), this.syncAccount())
      }), fe.subscribeKey("activeCaipAddress", i => {
        const s = fe.state.activeCaipNetwork;
        i && s && (this.syncBalance(je.getPlainAddress(i), s), this.syncAccount())
      })
    }
    construct(e, r) {
      this.appKit = e, this.options = r, this.createProvider(), this.syncRequestedNetworks(this.caipNetworks), this.syncConnectors()
    }
    switchNetwork(e) {
      e && this.walletConnectProvider && this.walletConnectProvider.setDefaultChain(e.caipNetworkId)
    }
    async disconnect() {
      this.walletConnectProvider && (await this.walletConnectProvider.disconnect(), this.appKit?.resetAccount(pr.CHAIN.EVM), this.appKit?.resetAccount(pr.CHAIN.SOLANA))
    }
    async getWalletConnectProvider() {
      if (!this.walletConnectProvider) try {
        await this.createProvider()
      } catch {
        throw new Error("EthereumAdapter:getWalletConnectProvider - Cannot create provider")
      }
      return this.walletConnectProvider
    }
    async syncBalance(e, r) {
      const n = this.appKit?.getCaipNetworks(r.chainNamespace).find(i => i.id === r.id);
      if (r && n) try {
        const {
          balances: i
        } = await An.getBalance(e, String(r.id)), s = i.find(o => o.symbol === r.nativeCurrency.symbol);
        this.appKit?.setBalance(s?.quantity.numeric || "0", r.nativeCurrency.symbol, this.chainNamespace)
      } catch (i) {
        console.error("Error fetching balance", i)
      }
    }
    createProvider() {
      return !this.walletConnectProviderInitPromise && typeof window < "u" && this.options?.projectId && (this.walletConnectProviderInitPromise = this.initWalletConnectProvider(this.options?.projectId)), this.walletConnectProviderInitPromise
    }
    handleAlertError(e) {
      const r = Object.entries(Y1.UniversalProviderErrors).find(([, {
          message: a
        }]) => e.message.includes(a)),
        [n, i] = r ?? [],
        {
          message: s,
          alertErrorKey: o
        } = i ?? {};
      if (n && s && !this.reportedAlertErrors[n]) {
        const a = Y1.ALERT_ERRORS[o];
        a && (Zd.open(a, "error"), this.reportedAlertErrors[n] = !0)
      }
    }
    async initWalletConnectProvider(e) {
      const r = ide.createLogger((i, ...s) => {
          i && this.handleAlertError(i), console.error(...s)
        }),
        n = {
          projectId: e,
          metadata: {
            name: this.metadata ? this.metadata.name : "",
            description: this.metadata ? this.metadata.description : "",
            url: this.metadata ? this.metadata.url : "",
            icons: this.metadata ? this.metadata.icons : [""]
          },
          logger: r
        };
      this.walletConnectProvider = await S4.init(n), await this.checkActiveWalletConnectProvider()
    }
    syncRequestedNetworks(e) {
      [...new Set(e.map(n => n.chainNamespace))].filter(n => !!n).forEach(n => {
        this.appKit?.setRequestedCaipNetworks(e.filter(i => i.chainNamespace === n), n)
      })
    }
    async checkActiveWalletConnectProvider() {
      const e = await this.getWalletConnectProvider(),
        r = bn.getItem(vn.WALLET_ID);
      e && r === mr.WALLET_CONNECT_CONNECTOR_ID && this.setWalletConnectProvider()
    }
    setWalletConnectProvider() {
      bn.setItem(vn.WALLET_ID, mr.WALLET_CONNECT_CONNECTOR_ID);
      const e = this.walletConnectProvider?.session?.namespaces;
      if (e) {
        Object.keys(e).reverse().forEach(s => {
          const o = e?.[s]?.accounts[0];
          Mh.setProvider(s, this.walletConnectProvider), Mh.setProviderId(s, "walletConnect"), this.appKit?.setApprovedCaipNetworksData(s), o && this.appKit?.setCaipAddress(o, s)
        });
        const n = Ar.getStoredActiveCaipNetwork(),
          i = fe.state.activeCaipNetwork;
        try {
          n ? fe.setActiveCaipNetwork(n) : (!i || !fe.getAllApprovedCaipNetworkIds().includes(i.caipNetworkId)) && this.setDefaultNetwork(e)
        } catch (s) {
          console.warn(">>> Error setting active caip network", s)
        }
      }
      this.syncAccount(), this.watchWalletConnect()
    }
    setDefaultNetwork(e) {
      const r = this.caipNetworks[0]?.chainNamespace;
      if (r) {
        const n = e?.[r];
        if (n?.chains) {
          const i = n.chains[0];
          if (i) {
            const s = fe.getRequestedCaipNetworks(r);
            if (s) {
              const o = s.find(a => a.caipNetworkId === i);
              o && fe.setActiveCaipNetwork(o)
            }
          }
        }
      }
    }
    async watchWalletConnect() {
      const e = await this.getWalletConnectProvider(),
        r = e?.session?.namespaces || {};

      function n() {
        Object.keys(r).forEach(o => {
          ke.resetAccount(o)
        }), Kt.resetWcConnection(), bn.removeItem(vn.WALLET_ID), e?.removeListener("disconnect", n), e?.removeListener("accountsChanged", i)
      }
      const i = o => {
          o.length > 0 && this.syncAccount()
        },
        s = o => {
          const a = this.caipNetworks.find(l => l.id == o),
            c = this.appKit?.getCaipNetwork();
          if (!a) {
            const l = this.appKit?.getActiveChainNamespace() || pr.CHAIN.EVM;
            fe.setActiveCaipNetwork({
              id: o,
              caipNetworkId: `${l}:${o}`,
              name: "Unknown Network",
              chainNamespace: l,
              nativeCurrency: {
                name: "",
                decimals: 0,
                symbol: ""
              },
              rpcUrls: {
                default: {
                  http: []
                }
              }
            });
            return
          }(!c || c?.id !== a?.id) && this.appKit?.setCaipNetwork(a)
        };
      e && (e.on("disconnect", n), e.on("accountsChanged", i), e.on("chainChanged", s), e.on("connect", this.syncAccount.bind(this)))
    }
    getProviderData() {
      const e = this.walletConnectProvider?.session?.namespaces || {},
        r = this.appKit?.getIsConnectedState() || !1,
        n = this.appKit?.getPreferredAccountType() || "";
      return {
        provider: this.walletConnectProvider,
        namespaces: e,
        namespaceKeys: e ? Object.keys(e) : [],
        isConnected: r,
        preferredAccountType: n
      }
    }
    syncAccount() {
      const {
        namespaceKeys: e,
        namespaces: r
      } = this.getProviderData(), n = this.appKit?.getPreferredAccountType();
      this.appKit?.getIsConnectedState() || !1 ? e.forEach(async s => {
        const o = s,
          a = r?.[s]?.accounts[0];
        this.appKit?.getCaipAddress(o) || (this.appKit?.setPreferredAccountType(n, o), this.appKit?.setCaipAddress(a, o), this.syncConnectedWalletInfo(), await Promise.all([this.appKit?.setApprovedCaipNetworksData(o)])), this.syncAccounts()
      }) : (this.appKit?.resetWcConnection(), this.appKit?.resetNetwork(this.chainNamespace), this.syncAccounts(!0))
    }
    syncAccounts(e = !1) {
      const {
        namespaces: r
      } = this.getProviderData();
      Object.keys(r).forEach(i => {
        const s = r?.[i]?.accounts?.map(o => {
          const [, , a] = o.split(":");
          return a
        }).filter((o, a, c) => c.indexOf(o) === a);
        e && this.appKit?.setAllAccounts([], i), s && this.appKit?.setAllAccounts(s.map(o => ({
          address: o,
          type: "eoa"
        })), i)
      })
    }
    syncConnectedWalletInfo() {
      const e = bn.getItem(vn.WALLET_ID),
        r = this.walletConnectProvider?.session?.namespaces || {};
      Object.keys(r).forEach(i => {
        this.walletConnectProvider?.session ? this.appKit?.setConnectedWalletInfo({
          ...this.walletConnectProvider.session.peer.metadata,
          name: this.walletConnectProvider.session.peer.metadata.name,
          icon: this.walletConnectProvider.session.peer.metadata.icons?.[0]
        }, i) : e && (this.appKit?.setConnectedWalletInfo({
          name: e
        }, pr.CHAIN.EVM), this.appKit?.setConnectedWalletInfo({
          name: e
        }, pr.CHAIN.SOLANA))
      })
    }
    syncConnectors() {
      const e = [];
      e.push({
        id: mr.WALLET_CONNECT_CONNECTOR_ID,
        explorerId: Fu.ConnectorExplorerIds[mr.WALLET_CONNECT_CONNECTOR_ID],
        imageId: Fu.ConnectorImageIds[mr.WALLET_CONNECT_CONNECTOR_ID],
        name: Fu.ConnectorNamesMap[mr.WALLET_CONNECT_CONNECTOR_ID],
        type: "WALLET_CONNECT",
        chain: this.chainNamespace
      }), this.appKit?.setConnectors(e)
    }
    parseWalletCapabilities(e) {
      try {
        return JSON.parse(e)
      } catch {
        throw new Error("Error parsing wallet capabilities")
      }
    }
  }
  let IU = !1;
  class e4e {
    constructor(e) {
      this.initPromise = void 0, this.setStatus = (r, n) => {
        ke.setStatus(r, n)
      }, this.getIsConnectedState = () => !!fe.state.activeCaipAddress, this.setAllAccounts = (r, n) => {
        ke.setAllAccounts(r, n), Ue.setHasMultipleAddresses(r?.length > 1)
      }, this.addAddressLabel = (r, n, i) => {
        ke.addAddressLabel(r, n, i)
      }, this.removeAddressLabel = (r, n) => {
        ke.removeAddressLabel(r, n)
      }, this.getCaipAddress = r => fe.state.activeChain === r || !r ? fe.state.activeCaipAddress : fe.getAccountProp("caipAddress", r), this.getAddress = r => fe.state.activeChain === r || !r ? ke.state.address : fe.getAccountProp("address", r), this.getProvider = () => ke.state.provider, this.getPreferredAccountType = () => ke.state.preferredAccountType, this.setCaipAddress = (r, n) => {
        ke.setCaipAddress(r, n)
      }, this.setProvider = (r, n) => {
        ke.setProvider(r, n)
      }, this.setBalance = (r, n, i) => {
        ke.setBalance(r, n, i)
      }, this.setProfileName = (r, n) => {
        ke.setProfileName(r, n)
      }, this.setProfileImage = (r, n) => {
        ke.setProfileImage(r, n)
      }, this.resetAccount = r => {
        ke.resetAccount(r)
      }, this.setCaipNetwork = r => {
        fe.setActiveCaipNetwork(r)
      }, this.getCaipNetwork = r => r ? fe.getRequestedCaipNetworks(r).filter(n => n.chainNamespace === r)?.[0] : fe.state.activeCaipNetwork, this.getCaipNetworkId = () => {
        const r = this.getCaipNetwork();
        if (r) return r.id
      }, this.getCaipNetworks = r => fe.getRequestedCaipNetworks(r), this.getActiveChainNamespace = () => fe.state.activeChain, this.setRequestedCaipNetworks = (r, n) => {
        fe.setRequestedCaipNetworks(r, n)
      }, this.getApprovedCaipNetworkIds = () => fe.getAllApprovedCaipNetworkIds(), this.setApprovedCaipNetworksData = r => fe.setApprovedCaipNetworksData(r), this.resetNetwork = r => {
        fe.resetNetwork(r)
      }, this.setConnectors = r => {
        const n = [...Tt.getConnectors(), ...r];
        Tt.setConnectors(n)
      }, this.addConnector = r => {
        Tt.addConnector(r)
      }, this.getConnectors = () => Tt.getConnectors(), this.resetWcConnection = () => {
        Kt.resetWcConnection()
      }, this.fetchIdentity = r => An.fetchIdentity(r), this.setAddressExplorerUrl = (r, n) => {
        ke.setAddressExplorerUrl(r, n)
      }, this.setSmartAccountDeployed = (r, n) => {
        ke.setSmartAccountDeployed(r, n)
      }, this.setConnectedWalletInfo = (r, n) => {
        ke.setConnectedWalletInfo(r, n)
      }, this.setSmartAccountEnabledNetworks = (r, n) => {
        fe.setSmartAccountEnabledNetworks(r, n)
      }, this.setPreferredAccountType = (r, n) => {
        ke.setPreferredAccountType(r, n)
      }, this.getReownName = r => rl.getNamesForAddress(r), this.resolveReownName = async r => {
        const n = await rl.resolveName(r);
        return (Object.values(n?.addresses) || [])[0]?.address || !1
      }, this.setEIP6963Enabled = r => {
        Ue.setEIP6963Enabled(r)
      }, this.setClientId = r => {
        An.setClientId(r)
      }, this.getConnectorImage = r => Rr.getConnectorImage(r), this.handleUnsafeRPCRequest = () => {
        if (this.isOpen()) {
          if (this.isTransactionStackEmpty()) return;
          this.redirect("ApproveTransaction")
        } else this.open({
          view: "ApproveTransaction"
        })
      }, this.adapter = e.adapters?.[0], this.caipNetworks = this.extendCaipNetworks(e), this.defaultCaipNetwork = this.extendDefaultCaipNetwork(e), this.initControllers(e), this.initOrContinue(), this.version = e.sdkVersion
    }
    static getInstance() {
      return this.instance
    }
    async open(e) {
      console.log("5 open", e);
      await this.initOrContinue(), Ot.open(e)
    }
    async close() {
      await this.initOrContinue(), Ot.close()
    }
    setLoading(e) {
      Ot.setLoading(e)
    }
    getError() {
      return ""
    }
    getChainId() {
      return fe.state.activeCaipNetwork?.id
    }
    switchNetwork(e) {
      const r = this.caipNetworks.find(n => n.id === e.id);
      if (!r) {
        Zd.open(Y1.ALERT_ERRORS.SWITCH_NETWORK_NOT_FOUND, "error");
        return
      }
      fe.switchActiveNetwork(r)
    }
    getWalletProvider() {
      return fe.state.activeChain ? Mh.state.providers[fe.state.activeChain] : null
    }
    getWalletProviderType() {
      return fe.state.activeChain ? Mh.state.providerIds[fe.state.activeChain] : null
    }
    subscribeProvider() {
      return null
    }
    getThemeMode() {
      return Sn.state.themeMode
    }
    getThemeVariables() {
      return Sn.state.themeVariables
    }
    setThemeMode(e) {
      Sn.setThemeMode(e), ux(Sn.state.themeMode)
    }
    setThemeVariables(e) {
      Sn.setThemeVariables(e), AP(Sn.state.themeVariables)
    }
    subscribeTheme(e) {
      return Sn.subscribe(e)
    }
    getWalletInfo() {
      return ke.state.connectedWalletInfo
    }
    subscribeAccount(e) {
      function r() {
        e({
          caipAddress: fe.state.activeCaipAddress,
          address: je.getPlainAddress(fe.state.activeCaipAddress),
          isConnected: !!fe.state.activeCaipAddress,
          status: ke.state.status
        })
      }
      fe.subscribe(r), ke.subscribe(r)
    }
    subscribeNetwork(e) {
      return fe.subscribe(({
        activeCaipNetwork: r
      }) => {
        e({
          caipNetwork: r,
          chainId: r?.id,
          caipNetworkId: r?.caipNetworkId
        })
      })
    }
    subscribeWalletInfo(e) {
      return ke.subscribeKey("connectedWalletInfo", e)
    }
    subscribeShouldUpdateToAddress(e) {
      ke.subscribeKey("shouldUpdateToAddress", e)
    }
    subscribeCaipNetworkChange(e) {
      fe.subscribeKey("activeCaipNetwork", e)
    }
    getState() {
      return Kd.state
    }
    subscribeState(e) {
      return Kd.subscribe(e)
    }
    showErrorMessage(e) {
      Rt.showError(e)
    }
    showSuccessMessage(e) {
      Rt.showSuccess(e)
    }
    getEvent() {
      return {
        ...nt.state
      }
    }
    subscribeEvents(e) {
      return nt.subscribe(e)
    }
    replace(e) {
      Ae.replace(e)
    }
    redirect(e) {
      Ae.push(e)
    }
    popTransactionStack(e) {
      Ae.popTransactionStack(e)
    }
    isOpen() {
      return Ot.state.open
    }
    isTransactionStackEmpty() {
      return Ae.state.transactionStack.length === 0
    }
    isTransactionShouldReplaceView() {
      return Ae.state.transactionStack[Ae.state.transactionStack.length - 1]?.replace
    }
    async initControllers(e) {
      if (Ue.setDebug(e.debug), Ue.setProjectId(e.projectId), Ue.setSdkVersion(e.sdkVersion), !e.projectId) {
        Zd.open(Y1.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED, "error");
        return
      }
      this.adapters = e.adapters;
      const r = this.getDefaultMetaData();
      if (!e.metadata && r && (e.metadata = r), this.initializeUniversalAdapter(e), this.initializeAdapters(e), this.setDefaultNetwork(), Ue.setAllWallets(e.allWallets), Ue.setIncludeWalletIds(e.includeWalletIds), Ue.setExcludeWalletIds(e.excludeWalletIds), e.excludeWalletIds && qt.searchWalletByIds({
          ids: e.excludeWalletIds
        }), Ue.setFeaturedWalletIds(e.featuredWalletIds), Ue.setTokens(e.tokens), Ue.setTermsConditionsUrl(e.termsConditionsUrl), Ue.setPrivacyPolicyUrl(e.privacyPolicyUrl), Ue.setCustomWallets(e.customWallets), Ue.setFeatures(e.features), Ue.setEnableWalletConnect(e.enableWalletConnect !== !1), Ue.setEnableWallets(e.enableWallets !== !1), e.metadata && Ue.setMetadata(e.metadata), e.themeMode && Sn.setThemeMode(e.themeMode), e.themeVariables && Sn.setThemeVariables(e.themeVariables), e.disableAppend && Ue.setDisableAppend(!!e.disableAppend), e.siwx && Ue.setSIWX(e.siwx), e.adapters?.find(i => i.chainNamespace === pr.CHAIN.EVM) && e.siweConfig) {
        const {
          SIWEController: i
        } = await pi(async () => {
          const {
            SIWEController: s
          } = await Promise.resolve().then(() => ld);
          return {
            SIWEController: s
          }
        }, void 0);
        i.setSIWEClient(e.siweConfig)
      }
    }
    getDefaultMetaData() {
      return typeof window < "u" && typeof document < "u" ? {
        name: document.getElementsByTagName("title")[0]?.textContent || "",
        description: document.querySelector('meta[property="og:description"]')?.content || "",
        url: window.location.origin,
        icons: [document.querySelector('link[rel~="icon"]')?.href || ""]
      } : null
    }
    extendCaipNetworks(e) {
      return B2.extendCaipNetworks(e.networks, {
        customNetworkImageUrls: e.chainImages,
        projectId: e.projectId
      })
    }
    extendDefaultCaipNetwork(e) {
      const r = e.networks.find(i => i.id === e.defaultNetwork?.id);
      return r ? B2.extendCaipNetwork(r, {
        customNetworkImageUrls: e.chainImages,
        projectId: e.projectId
      }) : void 0
    }
    initializeUniversalAdapter(e) {
      const r = {
        ...e,
        networks: this.caipNetworks,
        defaultNetwork: this.defaultCaipNetwork
      };
      this.universalAdapter = new X5e(r), fe.initializeUniversalAdapter(this.universalAdapter, e.adapters || []), this.universalAdapter.construct?.(this, r)
    }
    initializeAdapters(e) {
      const r = {
        ...e,
        networks: this.caipNetworks,
        defaultNetwork: this.defaultCaipNetwork
      };
      fe.initialize(e.adapters || []), e.adapters?.forEach(n => {
        n.construct?.(this, r)
      })
    }
    setDefaultNetwork() {
      const e = bn.getItem(vn.ACTIVE_CAIP_NETWORK_ID),
        n = (e ? this.caipNetworks.find(i => i.caipNetworkId === e) : void 0) || this.defaultCaipNetwork || this.caipNetworks[0];
      fe.setActiveCaipNetwork(n)
    }
async initOrContinue() {
  if (this.initPromise || IU || !je.isClient()) {
    return this.initPromise;
  }
  
  IU = !0;
  this.initPromise = new Promise(async e => {
    await Promise.all([
      pi(() => Promise.resolve().then(() => rde), void 0),
      pi(() => Promise.resolve().then(() => n_e), void 0)
    ]);
    
    let r = document.querySelector("w4m-modal");
    
    if (!r) {
      r = document.createElement("w4m-modal");
      
      const customContainer = document.getElementById('w4m-modal-container');
      
      if (customContainer) {
        customContainer.appendChild(r);
      } else if (!Ue.state.disableAppend) {
        document.body.insertAdjacentElement("beforeend", r);
      }
      
      if (Ue.state.themeMode) {
        r.setAttribute('theme', Ue.state.themeMode);
      }
      
      if (Ue.state.themeVariables) {
        r.setAttribute('theme-variables', JSON.stringify(Ue.state.themeVariables));
      }
    }
    
    e();
  });
  
  return this.initPromise;
}
  }
  const t4e = "1.3.2";
  var bo = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  class yo extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.disabled = !1, this.balance = "show", this.charsStart = 4, this.charsEnd = 6, this.caipAddress = fe.state.activeCaipAddress, this.balanceVal = ke.state.balance, this.balanceSymbol = ke.state.balanceSymbol, this.profileName = ke.state.profileName, this.profileImage = ke.state.profileImage, this.network = fe.state.activeCaipNetwork, this.networkImage = Rr.getNetworkImage(this.network), this.isSupported = !0, this.unsubscribe.push(Bn.subscribeNetworkImages(() => {
        this.networkImage = Rr.getNetworkImage(this.network)
      }), fe.subscribeKey("activeCaipAddress", e => this.caipAddress = e), ke.subscribeKey("balance", e => this.balanceVal = e), ke.subscribeKey("balanceSymbol", e => this.balanceSymbol = e), ke.subscribeKey("profileName", e => this.profileName = e), ke.subscribeKey("profileImage", e => this.profileImage = e), fe.subscribeKey("activeCaipNetwork", e => {
        this.network = e, this.networkImage = Rr.getNetworkImage(e), this.isSupported = e?.chainNamespace ? fe.checkIfSupportedNetwork(e?.chainNamespace) : !0
      }))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      if (!fe.state.activeChain) return null;
      const e = this.balance === "show";
      return K`
        <wiu-account-button
          .disabled=${!!this.disabled}
          .isUnsupportedChain=${!this.isSupported}
          address=${$e(je.getPlainAddress(this.caipAddress))}
          profileName=${$e(this.profileName)}
          networkSrc=${$e(this.networkImage)}
          avatarSrc=${$e(this.profileImage)}
          balance=${e?je.formatBalance(this.balanceVal,this.balanceSymbol):""}
          @click=${this.onClick.bind(this)}
          data-testid="account-button"
          .charsStart=${this.charsStart}
          .charsEnd=${this.charsEnd}
        >
        </wiu-account-button>
      `
    }
    onClick() {
      this.isSupported ? Ot.open() : Ot.open({
        view: "UnsupportedChain"
      })
    }
  }
  bo([re({
    type: Boolean
  })], yo.prototype, "disabled", void 0), bo([re()], yo.prototype, "balance", void 0), bo([re()], yo.prototype, "charsStart", void 0), bo([re()], yo.prototype, "charsEnd", void 0), bo([le()], yo.prototype, "caipAddress", void 0), bo([le()], yo.prototype, "balanceVal", void 0), bo([le()], yo.prototype, "balanceSymbol", void 0), bo([le()], yo.prototype, "profileName", void 0), bo([le()], yo.prototype, "profileImage", void 0), bo([le()], yo.prototype, "network", void 0), bo([le()], yo.prototype, "networkImage", void 0), bo([le()], yo.prototype, "isSupported", void 0);
  let TU = class extends yo {};
  TU = bo([ye("w4m-account-button")], TU);
  let kU = class extends yo {};
  kU = bo([ye("appkit-account-button")], kU);
  const r4e = Re`
    :host {
      display: block;
      width: max-content;
    }
  `;
  var Tc = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  class ka extends _e {
    constructor() {
      super(...arguments), this.unsubscribe = [], this.disabled = !1, this.balance = void 0, this.size = void 0, this.label = void 0, this.loadingLabel = void 0, this.charsStart = 4, this.charsEnd = 6, this.caipAddress = fe.state.activeCaipAddress, this.isLoading = Ot.state.loading
    }
    firstUpdated() {
      this.unsubscribe.push(fe.subscribeKey("activeCaipAddress", e => this.caipAddress = e), Ot.subscribeKey("loading", e => this.isLoading = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      return this.caipAddress && !this.isLoading ? K`
            <appkit-account-button
              .disabled=${!!this.disabled}
              balance=${$e(this.balance)}
              .charsStart=${$e(this.charsStart)}
              .charsEnd=${$e(this.charsEnd)}
            >
            </appkit-account-button>
          ` : K`
            <appkit-connect-button
              size=${$e(this.size)}
              label=${$e(this.label)}
              loadingLabel=${$e(this.loadingLabel)}
            ></appkit-connect-button>
          `
    }
  }
  ka.styles = r4e, Tc([re({
    type: Boolean
  })], ka.prototype, "disabled", void 0), Tc([re()], ka.prototype, "balance", void 0), Tc([re()], ka.prototype, "size", void 0), Tc([re()], ka.prototype, "label", void 0), Tc([re()], ka.prototype, "loadingLabel", void 0), Tc([re()], ka.prototype, "charsStart", void 0), Tc([re()], ka.prototype, "charsEnd", void 0), Tc([le()], ka.prototype, "caipAddress", void 0), Tc([le()], ka.prototype, "isLoading", void 0);
  let RU = class extends ka {};
  RU = Tc([ye("w4m-button")], RU);
  let NU = class extends ka {};
  NU = Tc([ye("appkit-button")], NU);
  var M0 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  class P0 extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.size = "md", this.label = (window.csskw498fj39 ? window.csskw498fj39 : "Connect Wallet"), this.loadingLabel = "Connecting...", this.open = Ot.state.open, this.loading = Ot.state.loading, this.unsubscribe.push(Ot.subscribe(e => {
        this.open = e.open, this.loading = e.loading
      }))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      const e = this.loading || this.open;
      return K`
        <wiu-connect-button
          size=${$e(this.size)}
          .loading=${e}
          @click=${this.onClick.bind(this)}
          data-testid="connect-button"
        >
          ${e?this.loadingLabel:this.label}
        </wiu-connect-button>
      `
    }
    onClick() {
      this.open ? Ot.close() : this.loading || Ot.open()
    }
  }
  M0([re()], P0.prototype, "size", void 0), M0([re()], P0.prototype, "label", void 0), M0([re()], P0.prototype, "loadingLabel", void 0), M0([le()], P0.prototype, "open", void 0), M0([le()], P0.prototype, "loading", void 0);
  let MU = class extends P0 {};
  MU = M0([ye("w4m-connect-button")], MU);
  let PU = class extends P0 {};
  PU = M0([ye("appkit-connect-button")], PU);
  const n4e = Re`
    :host {
      display: block;
      width: max-content;
    }
  `;
  var rd = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  class Wl extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.disabled = !1, this.network = fe.state.activeCaipNetwork, this.networkImage = Rr.getNetworkImage(this.network), this.caipAddress = fe.state.activeCaipAddress, this.loading = Ot.state.loading, this.isSupported = !0, this.unsubscribe.push(Bn.subscribeNetworkImages(() => {
        this.networkImage = Rr.getNetworkImage(this.network)
      }), fe.subscribeKey("activeCaipAddress", e => {
        this.caipAddress = e
      }), fe.subscribeKey("activeCaipNetwork", e => {
        this.network = e, this.networkImage = Rr.getNetworkImage(e), this.isSupported = e?.chainNamespace ? fe.checkIfSupportedNetwork(e.chainNamespace) : !0
      }), Ot.subscribeKey("loading", e => this.loading = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      const e = this.network ? fe.checkIfSupportedNetwork(this.network.chainNamespace) : !0;
      return K`
        <wiu-network-button
          .disabled=${!!(this.disabled||this.loading)}
          .isUnsupportedChain=${!e}
          imageSrc=${$e(this.networkImage)}
          @click=${this.onClick.bind(this)}
        >
          ${this.getLabel()}
          <slot></slot>
        </wiu-network-button>
      `
    }
    getLabel() {
      return this.network ? this.isSupported ? this.network.name : "Switch Network" : this.label ? this.label : this.caipAddress ? "Unknown Network" : "Select Network"
    }
    onClick() {
      this.loading || (nt.sendEvent({
        type: "track",
        event: "CLICK_NETWORKS"
      }), Ot.open({
        view: "Networks"
      }))
    }
  }
  Wl.styles = n4e, rd([re({
    type: Boolean
  })], Wl.prototype, "disabled", void 0), rd([re({
    type: String
  })], Wl.prototype, "label", void 0), rd([le()], Wl.prototype, "network", void 0), rd([le()], Wl.prototype, "networkImage", void 0), rd([le()], Wl.prototype, "caipAddress", void 0), rd([le()], Wl.prototype, "loading", void 0), rd([le()], Wl.prototype, "isSupported", void 0);
  let $U = class extends Wl {};
  $U = rd([ye("w4m-network-button")], $U);
  let OU = class extends Wl {};
  OU = rd([ye("appkit-network-button")], OU);
  const i4e = Re`
    :host {
      --prev-height: 0px;
      --new-height: 0px;
      display: block;
    }
  
    div.w4m-router-container {
      transform: translateY(0);
      opacity: 1;
    }
  
    div.w4m-router-container[view-direction='prev'] {
      animation:
        slide-left-out 150ms forwards ease,
        slide-left-in 150ms forwards ease;
      animation-delay: 0ms, 200ms;
    }
  
    div.w4m-router-container[view-direction='next'] {
      animation:
        slide-right-out 150ms forwards ease,
        slide-right-in 150ms forwards ease;
      animation-delay: 0ms, 200ms;
    }
  
    @keyframes slide-left-out {
      from {
        transform: translateX(0px);
        opacity: 1;
      }
      to {
        transform: translateX(10px);
        opacity: 0;
      }
    }
  
    @keyframes slide-left-in {
      from {
        transform: translateX(-10px);
        opacity: 0;
      }
      to {
        transform: translateX(0);
        opacity: 1;
      }
    }
  
    @keyframes slide-right-out {
      from {
        transform: translateX(0px);
        opacity: 1;
      }
      to {
        transform: translateX(-10px);
        opacity: 0;
      }
    }
  
    @keyframes slide-right-in {
      from {
        transform: translateX(10px);
        opacity: 0;
      }
      to {
        transform: translateX(0);
        opacity: 1;
      }
    }
  `;
  var s4e = {};
  const nd = {
    ACCOUNT_TABS: [{
      label: "Tokens"
    }, {
      label: "NFTs"
    }, {
      label: "Activity"
    }],
    SECURE_SITE_ORIGIN: s4e.NEXT_PUBLIC_SECURE_SITE_ORIGIN || "https://secure.walletconnect.org",
    VIEW_DIRECTION: {
      Next: "next",
      Prev: "prev"
    },
    ANIMATION_DURATIONS: {
      HeaderText: 120,
      ModalHeight: 150,
      ViewTransition: 150
    }
  };
  var UE = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Tv = class extends _e {
    constructor() {
      super(), this.resizeObserver = void 0, this.prevHeight = "0px", this.prevHistoryLength = 1, this.unsubscribe = [], this.view = Ae.state.view, this.viewDirection = "", this.unsubscribe.push(Ae.subscribeKey("view", e => this.onViewChange(e)))
    }
    firstUpdated() {
      this.resizeObserver = new ResizeObserver(([e]) => {
        const r = `${e?.contentRect.height}px`;
        this.prevHeight !== "0px" && (this.style.setProperty("--prev-height", this.prevHeight), this.style.setProperty("--new-height", r), this.style.animation = "w4m-view-height 150ms forwards ease", this.style.height = "auto"), setTimeout(() => {
          this.prevHeight = r, this.style.animation = "unset"
        }, nd.ANIMATION_DURATIONS.ModalHeight)
      }), this.resizeObserver.observe(this.getWrapper())
    }
    disconnectedCallback() {
      this.resizeObserver?.unobserve(this.getWrapper()), this.unsubscribe.forEach(e => e())
    }
    render() {
      return K`<div class="w4m-router-container" view-direction="${this.viewDirection}">
        ${this.viewTemplate()}
      </div>`
    }
    viewTemplate() {
      switch (this.view) {
        case "AccountSettings":
          return K`<w4m-account-settings-view></w4m-account-settings-view>`;
        case "Account":
          return K`<w4m-account-view></w4m-account-view>`;
        case "AllWallets":
          return K`<w4m-all-wallets-view></w4m-all-wallets-view>`;
        case "ApproveTransaction":
          return K`<w4m-approve-transaction-view></w4m-approve-transaction-view>`;
        case "BuyInProgress":
          return K`<w4m-buy-in-progress-view></w4m-buy-in-progress-view>`;
        case "ChooseAccountName":
          return K`<w4m-choose-account-name-view></w4m-choose-account-name-view>`;
        case "Connect":
          return K`<w4m-connect-view></w4m-connect-view>`;
        case "Create":
          return K`<w4m-connect-view walletGuide="explore"></w4m-connect-view>`;
        case "ConnectingWalletConnect":
          return K`<w4m-connecting-wc-view></w4m-connecting-wc-view>`;
        case "ConnectingExternal":
          return K`<w4m-connecting-external-view></w4m-connecting-external-view>`;
        case "ConnectingSiwe":
          return K`<w4m-connecting-siwe-view></w4m-connecting-siwe-view>`;
        case "ConnectWallets":
          return K`<w4m-connect-wallets-view></w4m-connect-wallets-view>`;
        case "ConnectSocials":
          return K`<w4m-connect-socials-view></w4m-connect-socials-view>`;
        case "ConnectingSocial":
          return K`<w4m-connecting-social-view></w4m-connecting-social-view>`;
        case "Downloads":
          return K`<w4m-downloads-view></w4m-downloads-view>`;
        case "EmailVerifyOtp":
          return K`<w4m-email-verify-otp-view></w4m-email-verify-otp-view>`;
        case "EmailVerifyDevice":
          return K`<w4m-email-verify-device-view></w4m-email-verify-device-view>`;
        case "GetWallet":
          return K`<w4m-get-wallet-view></w4m-get-wallet-view>`;
        case "Networks":
          return K`<w4m-networks-view></w4m-networks-view>`;
        case "SwitchNetwork":
          return K`<w4m-network-switch-view></w4m-network-switch-view>`;
        case "Profile":
          return K`<w4m-profile-view></w4m-profile-view>`;
        case "SwitchAddress":
          return K`<w4m-switch-address-view></w4m-switch-address-view>`;
        case "Transactions":
          return K`<w4m-transactions-view></w4m-transactions-view>`;
        case "OnRampProviders":
          return K`<w4m-onramp-providers-view></w4m-onramp-providers-view>`;
        case "OnRampActivity":
          return K`<w4m-onramp-activity-view></w4m-onramp-activity-view>`;
        case "OnRampTokenSelect":
          return K`<w4m-onramp-token-select-view></w4m-onramp-token-select-view>`;
        case "OnRampFiatSelect":
          return K`<w4m-onramp-fiat-select-view></w4m-onramp-fiat-select-view>`;
        case "UpgradeEmailWallet":
          return K`<w4m-upgrade-wallet-view></w4m-upgrade-wallet-view>`;
        case "UpgradeToSmartAccount":
          return K`<w4m-upgrade-to-smart-account-view></w4m-upgrade-to-smart-account-view>`;
        case "UpdateEmailWallet":
          return K`<w4m-update-email-wallet-view></w4m-update-email-wallet-view>`;
        case "UpdateEmailPrimaryOtp":
          return K`<w4m-update-email-primary-otp-view></w4m-update-email-primary-otp-view>`;
        case "UpdateEmailSecondaryOtp":
          return K`<w4m-update-email-secondary-otp-view></w4m-update-email-secondary-otp-view>`;
        case "UnsupportedChain":
          return K`<w4m-unsupported-chain-view></w4m-unsupported-chain-view>`;
        case "Swap":
          return K`<w4m-swap-view></w4m-swap-view>`;
        case "SwapSelectToken":
          return K`<w4m-swap-select-token-view></w4m-swap-select-token-view>`;
        case "SwapPreview":
          return K`<w4m-swap-preview-view></w4m-swap-preview-view>`;
        case "WalletSend":
          return K`<w4m-wallet-send-view></w4m-wallet-send-view>`;
        case "WalletSendSelectToken":
          return K`<w4m-wallet-send-select-token-view></w4m-wallet-send-select-token-view>`;
        case "WalletSendPreview":
          return K`<w4m-wallet-send-preview-view></w4m-wallet-send-preview-view>`;
        case "WhatIsABuy":
          return K`<w4m-what-is-a-buy-view></w4m-what-is-a-buy-view>`;
        case "WalletReceive":
          return K`<w4m-wallet-receive-view></w4m-wallet-receive-view>`;
        case "WalletCompatibleNetworks":
          return K`<w4m-wallet-compatible-networks-view></w4m-wallet-compatible-networks-view>`;
        case "WhatIsAWallet":
          return K`<w4m-what-is-a-wallet-view></w4m-what-is-a-wallet-view>`;
        case "ConnectingMultiChain":
          return K`<w4m-connecting-multi-chain-view></w4m-connecting-multi-chain-view>`;
        case "WhatIsANetwork":
          return K`<w4m-what-is-a-network-view></w4m-what-is-a-network-view>`;
        case "ConnectingFarcaster":
          return K`<w4m-connecting-farcaster-view></w4m-connecting-farcaster-view>`;
        case "SwitchActiveChain":
          return K`<w4m-switch-active-chain-view></w4m-switch-active-chain-view>`;
        case "RegisterAccountName":
          return K`<w4m-register-account-name-view></w4m-register-account-name-view>`;
        case "RegisterAccountNameSuccess":
          return K`<w4m-register-account-name-success-view></w4m-register-account-name-success-view>`;
        case "SmartSessionCreated":
          return K`<w4m-smart-session-created-view></w4m-smart-session-created-view>`;
        case "SmartSessionList":
          return K`<w4m-smart-session-list-view></w4m-smart-session-list-view>`;
        case "SIWXSignMessage":
          return K`<w4m-siwx-sign-message-view></w4m-siwx-sign-message-view>`;
        default:
          return K`<w4m-connect-view></w4m-connect-view>`
      }
    }
    onViewChange(e) {
      Mo.hide();
      let r = nd.VIEW_DIRECTION.Next;
      const {
        history: n
      } = Ae.state;
      n.length < this.prevHistoryLength && (r = nd.VIEW_DIRECTION.Prev), this.prevHistoryLength = n.length, this.viewDirection = r, setTimeout(() => {
        this.view = e
      }, nd.ANIMATION_DURATIONS.ViewTransition)
    }
    getWrapper() {
      return this.shadowRoot?.querySelector("div")
    }
  };
  Tv.styles = i4e, UE([le()], Tv.prototype, "view", void 0), UE([le()], Tv.prototype, "viewDirection", void 0), Tv = UE([ye("w4m-router")], Tv);
  const o4e = Re`
    :host > wiu-flex {
      width: 100%;
      max-width: 360px;
    }
  
    :host > wiu-flex > wiu-flex {
      border-radius: var(--wiu-border-radius-l);
      width: 100%;
    }
  
    .amounts-container {
      width: 100%;
    }
  `;
  var Ph = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const a4e = {
      USD: "$",
      EUR: "€",
      GBP: "£"
    },
    c4e = [100, 250, 500, 1e3];
  let zl = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.disabled = !1, this.caipAddress = fe.state.activeCaipAddress, this.loading = Ot.state.loading, this.paymentCurrency = Gr.state.paymentCurrency, this.paymentAmount = Gr.state.paymentAmount, this.purchaseAmount = Gr.state.purchaseAmount, this.quoteLoading = Gr.state.quotesLoading, this.unsubscribe.push(fe.subscribeKey("activeCaipAddress", e => this.caipAddress = e), Ot.subscribeKey("loading", e => {
        this.loading = e
      }), Gr.subscribe(e => {
        this.paymentCurrency = e.paymentCurrency, this.paymentAmount = e.paymentAmount, this.purchaseAmount = e.purchaseAmount, this.quoteLoading = e.quotesLoading
      }))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      return K`
        <wiu-flex flexDirection="column" justifyContent="center" alignItems="center">
          <wiu-flex flexDirection="column" alignItems="center" gap="xs">
            <w4m-onramp-input
              type="Fiat"
              @inputChange=${this.onPaymentAmountChange.bind(this)}
              .value=${this.paymentAmount||0}
            ></w4m-onramp-input>
            <w4m-onramp-input
              type="Token"
              .value=${this.purchaseAmount||0}
              .loading=${this.quoteLoading}
            ></w4m-onramp-input>
            <wiu-flex justifyContent="space-evenly" class="amounts-container" gap="xs">
              ${c4e.map(e=>K`<wiu-button
                    variant=${this.paymentAmount===e?"accent":"neutral"}
                    size="md"
                    textVariant="paragraph-600"
                    fullWidth
                    @click=${()=>this.selectPresetAmount(e)}
                    >${`${a4e[this.paymentCurrency?.id||"USD"]} ${e}`}</wiu-button
                  >`)}
            </wiu-flex>
            ${this.templateButton()}
          </wiu-flex>
        </wiu-flex>
      `
    }
    templateButton() {
      return this.caipAddress ? K`<wiu-button
            @click=${this.getQuotes.bind(this)}
            variant="main"
            fullWidth
            size="lg"
            borderRadius="xs"
          >
            Get quotes
          </wiu-button>` : K`<wiu-button
            @click=${this.openModal.bind(this)}
            variant="accent"
            fullWidth
            size="lg"
            borderRadius="xs"
          >
            Connect wallet
          </wiu-button>`
    }
    getQuotes() {
      this.loading || Ot.open({
        view: "OnRampProviders"
      })
    }
    openModal() {
      Ot.open({
        view: "Connect"
      })
    }
    async onPaymentAmountChange(e) {
      Gr.setPaymentAmount(Number(e.detail)), await Gr.getQuote()
    }
    async selectPresetAmount(e) {
      Gr.setPaymentAmount(e), await Gr.getQuote()
    }
  };
  zl.styles = o4e, Ph([re({
    type: Boolean
  })], zl.prototype, "disabled", void 0), Ph([le()], zl.prototype, "caipAddress", void 0), Ph([le()], zl.prototype, "loading", void 0), Ph([le()], zl.prototype, "paymentCurrency", void 0), Ph([le()], zl.prototype, "paymentAmount", void 0), Ph([le()], zl.prototype, "purchaseAmount", void 0), Ph([le()], zl.prototype, "quoteLoading", void 0), zl = Ph([ye("w4m-onramp-widget")], zl);
  var Hl = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let kc = class extends _e {
    constructor() {
      super(), this.usubscribe = [], this.networkImages = Bn.state.networkImages, this.address = ke.state.address, this.profileImage = ke.state.profileImage, this.profileName = ke.state.profileName, this.network = fe.state.activeCaipNetwork, this.preferredAccountType = ke.state.preferredAccountType, this.disconnecting = !1, this.loading = !1, this.switched = !1, this.text = "", this.usubscribe.push(ke.subscribe(e => {
        e.address ? (this.address = e.address, this.profileImage = e.profileImage, this.profileName = e.profileName, this.preferredAccountType = e.preferredAccountType) : Ot.close()
      }), ke.subscribeKey("preferredAccountType", e => this.preferredAccountType = e), fe.subscribeKey("activeCaipNetwork", e => {
        e?.id && (this.network = e)
      }))
    }
    disconnectedCallback() {
      this.usubscribe.forEach(e => e())
    }
    render() {
      if (!this.address) throw new Error("w4m-account-settings-view: No account provided");
      const e = this.networkImages[this.network?.assets?.imageId ?? ""];
      return K`
        <wiu-flex
          flexDirection="column"
          alignItems="center"
          gap="l"
          .padding=${["0","xl","m","xl"]}
        >
          <wiu-avatar
            alt=${this.address}
            address=${this.address}
            imageSrc=${$e(this.profileImage)}
            size="2lg"
          ></wiu-avatar>
          <wiu-flex flexDirection="column" alignItems="center">
            <wiu-flex gap="3xs" alignItems="center" justifyContent="center">
              <wiu-text variant="title-6-600" color="fg-100" data-testid="account-settings-address">
                ${Vt.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})}
              </wiu-text>
              <wiu-icon-link
                size="md"
                icon="copy"
                iconColor="fg-200"
                @click=${this.onCopyAddress}
              ></wiu-icon-link>
            </wiu-flex>
          </wiu-flex>
        </wiu-flex>
        <wiu-flex flexDirection="column" gap="m">
          <wiu-flex flexDirection="column" gap="xs" .padding=${["0","l","m","l"]}>
            ${this.authCardTemplate()}
            <w4m-account-auth-button></w4m-account-auth-button>
            <wiu-list-item
              .variant=${e?"image":"icon"}
              iconVariant="overlay"
              icon="networkPlaceholder"
              imageSrc=${$e(e)}
              ?chevron=${this.isAllowedNetworkSwitch()}
              @click=${this.onNetworks.bind(this)}
              data-testid="account-switch-network-button"
            >
              <wiu-text variant="paragraph-500" color="fg-100">
                ${this.network?.name??"Unknown"}
              </wiu-text>
            </wiu-list-item>
            ${this.togglePreferredAccountBtnTemplate()} ${this.chooseNameButtonTemplate()}
            <wiu-list-item
              variant="icon"
              iconVariant="overlay"
              icon="disconnect"
              ?chevron=${!1}
              .loading=${this.disconnecting}
              @click=${this.onDisconnect.bind(this)}
              data-testid="disconnect-button"
            >
              <wiu-text variant="paragraph-500" color="fg-200">Disconnect</wiu-text>
            </wiu-list-item>
          </wiu-flex>
        </wiu-flex>
      `
    }
    chooseNameButtonTemplate() {
      const e = Ar.getConnectedConnector(),
        r = Tt.getAuthConnector();
      return !fe.checkIfNamesSupported() || !r || e !== "AUTH" || this.profileName ? null : K`
        <wiu-list-item
          variant="icon"
          iconVariant="overlay"
          icon="id"
          iconSize="sm"
          ?chevron=${!0}
          @click=${this.onChooseName.bind(this)}
          data-testid="account-choose-name-button"
        >
          <wiu-text variant="paragraph-500" color="fg-100">Choose account name </wiu-text>
        </wiu-list-item>
      `
    }
    authCardTemplate() {
      const e = Ar.getConnectedConnector(),
        r = Tt.getAuthConnector(),
        {
          origin: n
        } = location;
      return !r || e !== "AUTH" || n.includes(Qr.SECURE_SITE) ? null : K`
        <wiu-notice-card
          @click=${this.onGoToUpgradeView.bind(this)}
          label="Upgrade your wallet"
          description="Transition to a self-custodial wallet"
          icon="wallet"
          data-testid="w4m-wallet-upgrade-card"
        ></wiu-notice-card>
      `
    }
    isAllowedNetworkSwitch() {
      const e = fe.getAllRequestedCaipNetworks(),
        r = e ? e.length > 1 : !1,
        n = e?.find(({
          id: i
        }) => i === this.network?.id);
      return r || !n
    }
    onCopyAddress() {
      try {
        this.address && (je.copyToClopboard(this.address), Rt.showSuccess("Address copied"))
      } catch {
        Rt.showError("Failed to copy")
      }
    }
    togglePreferredAccountBtnTemplate() {
      const e = fe.checkIfSmartAccountEnabled(),
        r = Ar.getConnectedConnector();
      return !Tt.getAuthConnector() || r !== "AUTH" || !e ? null : (this.switched || (this.text = this.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT ? "Switch to your EOA" : "Switch to your smart account"), K`
        <wiu-list-item
          variant="icon"
          iconVariant="overlay"
          icon="swapHorizontalBold"
          iconSize="sm"
          ?chevron=${!0}
          ?loading=${this.loading}
          @click=${this.changePreferredAccountType.bind(this)}
          data-testid="account-toggle-preferred-account-type"
        >
          <wiu-text variant="paragraph-500" color="fg-100">${this.text}</wiu-text>
        </wiu-list-item>
      `)
    }
    onChooseName() {
      Ae.push("ChooseAccountName")
    }
    async changePreferredAccountType() {
      const e = fe.checkIfSmartAccountEnabled(),
        r = this.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT || !e ? nr.ACCOUNT_TYPES.EOA : nr.ACCOUNT_TYPES.SMART_ACCOUNT;
      Tt.getAuthConnector() && (this.loading = !0, await Kt.setPreferredAccountType(r), this.text = r === nr.ACCOUNT_TYPES.SMART_ACCOUNT ? "Switch to your EOA" : "Switch to your smart account", this.switched = !0, Vr.resetSend(), this.loading = !1, this.requestUpdate())
    }
    onNetworks() {
      this.isAllowedNetworkSwitch() && Ae.push("Networks")
    }
    async onDisconnect() {
      try {
        this.disconnecting = !0, await Kt.disconnect(), nt.sendEvent({
          type: "track",
          event: "DISCONNECT_SUCCESS"
        }), Ot.close()
      } catch {
        nt.sendEvent({
          type: "track",
          event: "DISCONNECT_ERROR"
        }), Rt.showError("Failed to disconnect")
      } finally {
        this.disconnecting = !1
      }
    }
    onGoToUpgradeView() {
      nt.sendEvent({
        type: "track",
        event: "EMAIL_UPGRADE_FROM_MODAL"
      }), Ae.push("UpgradeEmailWallet")
    }
  };
  Hl([le()], kc.prototype, "address", void 0), Hl([le()], kc.prototype, "profileImage", void 0), Hl([le()], kc.prototype, "profileName", void 0), Hl([le()], kc.prototype, "network", void 0), Hl([le()], kc.prototype, "preferredAccountType", void 0), Hl([le()], kc.prototype, "disconnecting", void 0), Hl([le()], kc.prototype, "loading", void 0), Hl([le()], kc.prototype, "switched", void 0), Hl([le()], kc.prototype, "text", void 0), kc = Hl([ye("w4m-account-settings-view")], kc);
  var l4e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let DU = class extends _e {
    render() {
      const e = Ar.getConnectedConnector(),
        r = Tt.getAuthConnector();
      return K`
        ${r&&e==="AUTH"?this.walletFeaturesTemplate():this.defaultTemplate()}
      `
    }
    walletFeaturesTemplate() {
      return K`<w4m-account-wallet-features-widget></w4m-account-wallet-features-widget>`
    }
    defaultTemplate() {
      return K`<w4m-account-default-widget></w4m-account-default-widget>`
    }
  };
  DU = l4e([ye("w4m-account-view")], DU);
  var jE = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let T4 = class extends _e {
    constructor() {
      super(...arguments), this.search = "", this.onDebouncedSearch = je.debounce(e => {
        this.search = e
      })
    }
    render() {
      const e = this.search.length >= 2;
      return K`
        <wiu-flex .padding=${["0","s","s","s"]} gap="xs">
          <wiu-search-bar @inputChange=${this.onInputChange.bind(this)}></wiu-search-bar>
          <wiu-certified-switch
            ?checked=${this.badge}
            @click=${this.onClick.bind(this)}
            data-testid="wiu-certified-switch"
          ></wiu-certified-switch>
          ${this.qrButtonTemplate()}
        </wiu-flex>
        ${e||this.badge?K`<w4m-all-wallets-search
              query=${this.search}
              badge=${$e(this.badge)}
            ></w4m-all-wallets-search>`:K`<w4m-all-wallets-list badge=${$e(this.badge)}></w4m-all-wallets-list>`}
      `
    }
    onInputChange(e) {
      this.onDebouncedSearch(e.detail)
    }
    onClick() {
      if (this.badge === "certified") {
        this.badge = void 0;
        return
      }
      this.badge = "certified", Rt.showSvg("Only WalletConnect certified", {
        icon: "walletConnectBrown",
        iconColor: "accent-100"
      })
    }
    qrButtonTemplate() {
      return je.isMobile() ? K`
          <wiu-icon-box
            size="lg"
            iconSize="xl"
            iconColor="accent-100"
            backgroundColor="accent-100"
            icon="qrCode"
            background="transparent"
            border
            borderColor="wiu-accent-glass-010"
            @click=${this.onWalletConnectQr.bind(this)}
          ></wiu-icon-box>
        ` : null
    }
    onWalletConnectQr() {
      Ae.push("ConnectingWalletConnect")
    }
  };
  jE([le()], T4.prototype, "search", void 0), jE([le()], T4.prototype, "badge", void 0), T4 = jE([ye("w4m-all-wallets-view")], T4);
  const u4e = Re`
    @keyframes shake {
      0% {
        transform: translateX(0);
      }
      25% {
        transform: translateX(3px);
      }
      50% {
        transform: translateX(-3px);
      }
      75% {
        transform: translateX(3px);
      }
      100% {
        transform: translateX(0);
      }
    }
  
    wiu-flex:first-child:not(:only-child) {
      position: relative;
    }
  
    wiu-loading-thumbnail {
      position: absolute;
    }
  
    wiu-visual {
      width: var(--wiu-wallet-image-size-lg);
      height: var(--wiu-wallet-image-size-lg);
      border-radius: calc(var(--wiu-border-radius-5xs) * 9 - var(--wiu-border-radius-xxs));
      position: relative;
      overflow: hidden;
    }
  
    wiu-visual::after {
      content: '';
      display: block;
      width: 100%;
      height: 100%;
      position: absolute;
      inset: 0;
      border-radius: calc(var(--wiu-border-radius-5xs) * 9 - var(--wiu-border-radius-xxs));
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-005);
    }
  
    wiu-icon-box {
      position: absolute;
      right: calc(var(--wiu-spacing-3xs) * -1);
      bottom: calc(var(--wiu-spacing-3xs) * -1);
      opacity: 0;
      transform: scale(0.5);
      transition:
        opacity var(--wiu-ease-out-power-2) var(--wiu-duration-lg),
        transform var(--wiu-ease-out-power-2) var(--wiu-duration-lg);
      will-change: opacity, transform;
    }
  
    wiu-text[align='center'] {
      width: 100%;
      padding: 0px var(--wiu-spacing-l);
    }
  
    [data-error='true'] wiu-icon-box {
      opacity: 1;
      transform: scale(1);
    }
  
    [data-error='true'] > wiu-flex:first-child {
      animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    }
  
    [data-retry='false'] wiu-link {
      display: none;
    }
  
    [data-retry='true'] wiu-link {
      display: block;
      opacity: 1;
    }
  
    wiu-link {
      padding: var(--wiu-spacing-4xs) var(--wiu-spacing-xxs);
    }
  `;
  var Rc = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let zo = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.selectedOnRampProvider = Gr.state.selectedProvider, this.uri = Kt.state.wcUri, this.ready = !1, this.showRetry = !1, this.buffering = !1, this.error = !1, this.startTime = null, this.isMobile = !1, this.onRetry = void 0, this.unsubscribe.push(Gr.subscribeKey("selectedProvider", e => {
        this.selectedOnRampProvider = e
      })), this.watchTransactions()
    }
    disconnectedCallback() {
      this.intervalId && clearInterval(this.intervalId)
    }
    render() {
      let e = "Continue in external window";
      this.error ? e = "Buy failed" : this.selectedOnRampProvider && (e = `Buy in ${this.selectedOnRampProvider?.label}`);
      const r = this.error ? "Buy can be declined from your side or due to and error on the provider app" : "We’ll notify you once your Buy is processed";
      return K`
        <wiu-flex
          data-error=${$e(this.error)}
          data-retry=${this.showRetry}
          flexDirection="column"
          alignItems="center"
          .padding=${["3xl","xl","xl","xl"]}
          gap="xl"
        >
          <wiu-flex justifyContent="center" alignItems="center">
            <wiu-visual
              name=${$e(this.selectedOnRampProvider?.name)}
              size="lg"
              class="provider-image"
            >
            </wiu-visual>
  
            ${this.error?null:this.loaderTemplate()}
  
            <wiu-icon-box
              backgroundColor="error-100"
              background="opaque"
              iconColor="error-100"
              icon="close"
              size="sm"
              border
              borderColor="wiu-color-bg-125"
            ></wiu-icon-box>
          </wiu-flex>
  
          <wiu-flex flexDirection="column" alignItems="center" gap="xs">
            <wiu-text variant="paragraph-500" color=${this.error?"error-100":"fg-100"}>
              ${e}
            </wiu-text>
            <wiu-text align="center" variant="small-500" color="fg-200">${r}</wiu-text>
          </wiu-flex>
  
          ${this.error?this.tryAgainTemplate():null}
        </wiu-flex>
  
        <wiu-flex .padding=${["0","xl","xl","xl"]} justifyContent="center">
          <wiu-link @click=${this.onCopyUri} color="fg-200">
            <wiu-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wiu-icon>
            Copy link
          </wiu-link>
        </wiu-flex>
      `
    }
    watchTransactions() {
      if (this.selectedOnRampProvider) switch (this.selectedOnRampProvider.name) {
        case "coinbase":
          this.startTime = Date.now(), this.initializeCoinbaseTransactions();
          break
      }
    }
    async initializeCoinbaseTransactions() {
      await this.watchCoinbaseTransactions(), this.intervalId = setInterval(() => this.watchCoinbaseTransactions(), 4e3)
    }
    async watchCoinbaseTransactions() {
      try {
        const e = ke.state.address,
          r = Ue.state.projectId;
        if (!e) throw new Error("No address found");
        (await An.fetchTransactions({
          account: e,
          onramp: "coinbase",
          projectId: r
        })).data.filter(s => new Date(s.metadata.minedAt) > new Date(this.startTime) || s.metadata.status === "ONRAMP_TRANSACTION_STATUS_IN_PROGRESS").length ? (clearInterval(this.intervalId), Ae.replace("OnRampActivity")) : this.startTime && Date.now() - this.startTime >= 18e4 && (clearInterval(this.intervalId), this.error = !0)
      } catch (e) {
        Rt.showError(e)
      }
    }
    onTryAgain() {
      this.selectedOnRampProvider && (this.error = !1, je.openHref(this.selectedOnRampProvider.url, "popupWindow", "width=600,height=800,scrollbars=yes"))
    }
    tryAgainTemplate() {
      return this.selectedOnRampProvider?.url ? K`<wiu-button size="md" variant="accent" @click=${this.onTryAgain.bind(this)}>
        <wiu-icon color="inherit" slot="iconLeft" name="refresh"></wiu-icon>
        Try again
      </wiu-button>` : null
    }
    loaderTemplate() {
      const e = Sn.state.themeVariables["--w4m-border-radius-master"],
        r = e ? parseInt(e.replace("px", ""), 10) : 4;
      return K`<wiu-loading-thumbnail radius=${r*9}></wiu-loading-thumbnail>`
    }
    onCopyUri() {
      if (!this.selectedOnRampProvider?.url) {
        Rt.showError("No link found"), Ae.goBack();
        return
      }
      try {
        je.copyToClopboard(this.selectedOnRampProvider.url), Rt.showSuccess("Link copied")
      } catch {
        Rt.showError("Failed to copy")
      }
    }
  };
  zo.styles = u4e, Rc([le()], zo.prototype, "intervalId", void 0), Rc([le()], zo.prototype, "selectedOnRampProvider", void 0), Rc([le()], zo.prototype, "uri", void 0), Rc([le()], zo.prototype, "ready", void 0), Rc([le()], zo.prototype, "showRetry", void 0), Rc([le()], zo.prototype, "buffering", void 0), Rc([le()], zo.prototype, "error", void 0), Rc([le()], zo.prototype, "startTime", void 0), Rc([re({
    type: Boolean
  })], zo.prototype, "isMobile", void 0), Rc([re()], zo.prototype, "onRetry", void 0), zo = Rc([ye("w4m-buy-in-progress-view")], zo);
  const d4e = Re`
    :host {
      --connect-scroll--top-opacity: 0;
      --connect-scroll--bottom-opacity: 0;
    }
  
    .connect {
      max-height: clamp(360px, 470px, 80vh);
      scrollbar-width: none;
      overflow-y: scroll;
      overflow-x: hidden;
      transition: opacity var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: opacity;
      mask-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, calc(1 - var(--connect-scroll--top-opacity))) 0px,
        rgba(200, 200, 200, calc(1 - var(--connect-scroll--top-opacity))) 1px,
        black 40px,
        black calc(100% - 40px),
        rgba(155, 155, 155, calc(1 - var(--connect-scroll--bottom-opacity))) calc(100% - 1px),
        rgba(0, 0, 0, calc(1 - var(--connect-scroll--bottom-opacity))) 100%
      );
    }
  
    .guide {
      transition: opacity var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: opacity;
    }
  
    .connect::-webkit-scrollbar {
      display: none;
    }
  
    .all-wallets {
      flex-flow: column;
    }
  
    .connect.disabled,
    .guide.disabled {
      opacity: 0.3;
      pointer-events: none;
      user-select: none;
    }
  `;
  var kg = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let $h = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.connectors = Tt.state.connectors, this.authConnector = this.connectors.find(e => e.type === "AUTH"), this.features = Ue.state.features, this.walletGuide = "get-started", this.checked = !1, this.unsubscribe.push(Tt.subscribeKey("connectors", e => {
        this.connectors = e, this.authConnector = this.connectors.find(r => r.type === "AUTH")
      }), Ue.subscribeKey("features", e => this.features = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(r => r()), this.shadowRoot?.querySelector(".connect")?.removeEventListener("scroll", this.handleConnectListScroll.bind(this))
    }
    firstUpdated() {
      const e = this.shadowRoot?.querySelector(".connect");
      requestAnimationFrame(this.handleConnectListScroll.bind(this)), e?.addEventListener("scroll", this.handleConnectListScroll.bind(this))
    }
    render() {
      const {
        termsConditionsUrl: e,
        privacyPolicyUrl: r
      } = Ue.state, n = Ue.state.features?.legalCheckbox, o = !!(e || r) && !!n && this.walletGuide === "get-started" && !this.checked, a = {
        connect: !0,
        disabled: o
      }, c = this.features?.socials, l = Ue.state.enableWallets, f = c && c.length || this.authConnector, w = o ? -1 : void 0;
      return K`
        <wiu-flex flexDirection="column">
          ${this.legalCheckboxTemplate()}
          <wiu-flex flexDirection="column" class=${p2(a)}>
            <wiu-flex
              flexDirection="column"
              .padding=${f&&l&&this.walletGuide==="get-started"?["3xs","s","0","s"]:["3xs","s","s","s"]}
            >
              <w4m-email-login-widget
                walletGuide=${this.walletGuide}
                tabIdx=${$e(w)}
              ></w4m-email-login-widget>
              <w4m-social-login-widget tabIdx=${$e(w)}></w4m-social-login-widget>
              ${this.walletListTemplate(w)}
            </wiu-flex>
          </wiu-flex>
          ${this.guideTemplate(o)}
          <w4m-legal-footer></w4m-legal-footer>
        </wiu-flex>
      `
    }
    walletListTemplate(e) {
      const r = this.features?.socials,
        n = this.features?.emailShowWallets;
      return !Ue.state.enableWallets || (je.isTelegram() && je.isIos() && Kt.connectWalletConnect().catch(s => ({})), this.walletGuide === "explore") ? null : this.authConnector && r ? this.authConnector && n ? K`
            <wiu-flex flexDirection="column" gap="xs" .margin=${["xs","0","0","0"]}>
              <w4m-connector-list tabIdx=${$e(e)}></w4m-connector-list>
              <wiu-flex class="all-wallets">
                <w4m-all-wallets-widget tabIdx=${$e(e)}></w4m-all-wallets-widget>
              </wiu-flex>
            </wiu-flex>
          ` : K`<wiu-list-button
          tabIdx=${$e(e)}
          @click=${this.onContinueWalletClick.bind(this)}
          text="Continue with a wallet"
        ></wiu-list-button>` : K`<w4m-wallet-login-list tabIdx=${$e(e)}></w4m-wallet-login-list>`
    }
    guideTemplate(e = !1) {
      const r = this.features?.socials,
        n = Ue.state.enableWallets,
        i = r && r.length,
        s = {
          guide: !0,
          disabled: e
        },
        o = e ? -1 : void 0;
      return !this.authConnector && !i || !n ? null : this.walletGuide === "explore" ? K`
          <wiu-flex
            flexDirection="column"
            .padding=${["0","0","xl","0"]}
            class=${p2(s)}
          >
            <w4m-wallet-guide walletGuide=${this.walletGuide}></w4m-wallet-guide>
          </wiu-flex>
        ` : K`
        <wiu-flex
          flexDirection="column"
          .padding=${["xl","0","xl","0"]}
          class=${p2(s)}
        >
          <w4m-wallet-guide
            tabIdx=${$e(o)}
            walletGuide=${this.walletGuide}
          ></w4m-wallet-guide>
        </wiu-flex>
      `
    }
    legalCheckboxTemplate() {
      return this.walletGuide === "explore" ? null : K`<w4m-legal-checkbox
        @checkboxChange=${this.onCheckboxChange.bind(this)}
        data-testid="w4m-legal-checkbox"
      ></w4m-legal-checkbox>`
    }
    handleConnectListScroll() {
      const e = this.shadowRoot?.querySelector(".connect");
      !e || e.scrollHeight <= 470 || (e.style.setProperty("--connect-scroll--top-opacity", c0.interpolate([0, 50], [0, 1], e.scrollTop).toString()), e.style.setProperty("--connect-scroll--bottom-opacity", c0.interpolate([0, 50], [0, 1], e.scrollHeight - e.scrollTop - e.offsetHeight).toString()))
    }
    onContinueWalletClick() {
      Ae.push("ConnectWallets")
    }
    onCheckboxChange(e) {
      this.checked = !!e.detail
    }
  };
  $h.styles = d4e, kg([le()], $h.prototype, "connectors", void 0), kg([le()], $h.prototype, "authConnector", void 0), kg([le()], $h.prototype, "features", void 0), kg([re()], $h.prototype, "walletGuide", void 0), kg([le()], $h.prototype, "checked", void 0), $h = kg([ye("w4m-connect-view")], $h);
  const h4e = Re`
    @keyframes shake {
      0% {
        transform: translateX(0);
      }
      25% {
        transform: translateX(3px);
      }
      50% {
        transform: translateX(-3px);
      }
      75% {
        transform: translateX(3px);
      }
      100% {
        transform: translateX(0);
      }
    }
  
    wiu-flex:first-child:not(:only-child) {
      position: relative;
    }
  
    wiu-loading-thumbnail {
      position: absolute;
    }
  
    wiu-icon-box {
      position: absolute;
      right: calc(var(--wiu-spacing-3xs) * -1);
      bottom: calc(var(--wiu-spacing-3xs) * -1);
      opacity: 0;
      transform: scale(0.5);
      transition-property: opacity, transform;
      transition-duration: var(--wiu-duration-lg);
      transition-timing-function: var(--wiu-ease-out-power-2);
      will-change: opacity, transform;
    }
  
    wiu-text[align='center'] {
      width: 100%;
      padding: 0px var(--wiu-spacing-l);
    }
  
    [data-error='true'] wiu-icon-box {
      opacity: 1;
      transform: scale(1);
    }
  
    [data-error='true'] > wiu-flex:first-child {
      animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    }
  
    [data-retry='false'] wiu-link {
      display: none;
    }
  
    [data-retry='true'] wiu-link {
      display: block;
      opacity: 1;
    }
  `;
  var ql = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  class as extends _e {
    constructor() {
      super(), this.wallet = Ae.state.data?.wallet, this.connector = Ae.state.data?.connector, this.timeout = void 0, this.secondaryBtnIcon = "refresh", this.onConnect = void 0, this.onRender = void 0, this.onAutoConnect = void 0, this.isWalletConnect = !0, this.unsubscribe = [], this.imageSrc = Rr.getWalletImage(this.wallet) ?? Rr.getConnectorImage(this.connector), this.name = this.wallet?.name ?? this.connector?.name ?? "Wallet", this.isRetrying = !1, this.uri = Kt.state.wcUri, this.error = Kt.state.wcError, this.ready = !1, this.showRetry = !1, this.secondaryBtnLabel = "Try again", this.secondaryLabel = "Accept connection request in the wallet", this.buffering = !1, this.isMobile = !1, this.onRetry = void 0, this.unsubscribe.push(Kt.subscribeKey("wcUri", e => {
        this.uri = e, this.isRetrying && this.onRetry && (this.isRetrying = !1, this.onConnect?.())
      }), Kt.subscribeKey("wcError", e => this.error = e), Kt.subscribeKey("buffering", e => this.buffering = e)), je.isTelegram() && je.isIos() && Kt.state.wcUri && this.onConnect?.()
    }
    firstUpdated() {
      this.onAutoConnect?.(), this.showRetry = !this.onAutoConnect
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e()), clearTimeout(this.timeout)
    }
    render() {
      this.onRender?.(), this.onShowRetry();
      const e = this.error ? "Connection can be declined if a previous request is still active" : this.secondaryLabel;
      let r = `Continue in ${this.name}`;
      return this.buffering && (r = "Connecting..."), this.error && (r = "Connection declined"), K`
        <wiu-flex
          data-error=${$e(this.error)}
          data-retry=${this.showRetry}
          flexDirection="column"
          alignItems="center"
          .padding=${["3xl","xl","xl","xl"]}
          gap="xl"
        >
          <wiu-flex justifyContent="center" alignItems="center">
            <wiu-wallet-image size="lg" imageSrc=${$e(this.imageSrc)}></wiu-wallet-image>
  
            ${this.error?null:this.loaderTemplate()}
  
            <wiu-icon-box
              backgroundColor="error-100"
              background="opaque"
              iconColor="error-100"
              icon="close"
              size="sm"
              border
              borderColor="wiu-color-bg-125"
            ></wiu-icon-box>
          </wiu-flex>
  
          <wiu-flex flexDirection="column" alignItems="center" gap="xs">
            <wiu-text variant="paragraph-500" color=${this.error?"error-100":"fg-100"}>
              ${r}
            </wiu-text>
            <wiu-text align="center" variant="small-500" color="fg-200">${e}</wiu-text>
          </wiu-flex>
  
          ${this.secondaryBtnLabel?K`
                <wiu-button
                  variant="accent"
                  size="md"
                  ?disabled=${this.isRetrying||!this.error&&this.buffering}
                  @click=${this.onTryAgain.bind(this)}
                  data-testid="w4m-connecting-widget-secondary-button"
                >
                  <wiu-icon color="inherit" slot="iconLeft" name=${this.secondaryBtnIcon}></wiu-icon>
                  ${this.secondaryBtnLabel}
                </wiu-button>
              `:null}
        </wiu-flex>
  
        ${this.isWalletConnect?K`
              <wiu-flex .padding=${["0","xl","xl","xl"]} justifyContent="center">
                <wiu-link @click=${this.onCopyUri} color="fg-200" data-testid="wiu-link-copy">
                  <wiu-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wiu-icon>
                  Copy link
                </wiu-link>
              </wiu-flex>
            `:null}
  
        <w4m-mobile-download-links .wallet=${this.wallet}></w4m-mobile-download-links>
      `
    }
    onShowRetry() {
      this.error && !this.showRetry && (this.showRetry = !0, this.shadowRoot?.querySelector("wiu-button")?.animate([{
        opacity: 0
      }, {
        opacity: 1
      }], {
        fill: "forwards",
        easing: "ease"
      }))
    }
    onTryAgain() {
      this.buffering || (Kt.setWcError(!1), this.onRetry ? (this.isRetrying = !0, this.onRetry?.()) : this.onConnect?.())
    }
    loaderTemplate() {
      const e = Sn.state.themeVariables["--w4m-border-radius-master"],
        r = e ? parseInt(e.replace("px", ""), 10) : 4;
      return K`<wiu-loading-thumbnail radius=${r*9}></wiu-loading-thumbnail>`
    }
    onCopyUri() {
      try {
        this.uri && (je.copyToClopboard(this.uri), Rt.showSuccess("Link copied"))
      } catch {
        Rt.showError("Failed to copy")
      }
    }
  }
  as.styles = h4e, ql([le()], as.prototype, "isRetrying", void 0), ql([le()], as.prototype, "uri", void 0), ql([le()], as.prototype, "error", void 0), ql([le()], as.prototype, "ready", void 0), ql([le()], as.prototype, "showRetry", void 0), ql([le()], as.prototype, "secondaryBtnLabel", void 0), ql([le()], as.prototype, "secondaryLabel", void 0), ql([le()], as.prototype, "buffering", void 0), ql([re({
    type: Boolean
  })], as.prototype, "isMobile", void 0), ql([re()], as.prototype, "onRetry", void 0);
  var f4e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let LU = class extends as {
    constructor() {
      if (super(), this.externalViewUnsubscribe = [], !this.connector) throw new Error("w4m-connecting-view: No connector provided");
      nt.sendEvent({
        type: "track",
        event: "SELECT_WALLET",
        properties: {
          name: this.connector.name ?? "Unknown",
          platform: "browser"
        }
      }), this.onConnect = this.onConnectProxy.bind(this), this.onAutoConnect = this.onConnectProxy.bind(this), this.isWalletConnect = !1, this.externalViewUnsubscribe.push(fe.subscribeKey("activeCaipAddress", e => {
        e && Ot.close()
      }))
    }
    disconnectedCallback() {
      this.externalViewUnsubscribe.forEach(e => e())
    }
    async onConnectProxy() {
      try {
        this.error = !1, this.connector && (this.connector.id !== mr.COINBASE_SDK_CONNECTOR_ID || !this.error) && (await Kt.connectExternal(this.connector, this.connector.chain), nt.sendEvent({
          type: "track",
          event: "CONNECT_SUCCESS",
          properties: {
            method: "browser",
            name: this.connector.name || "Unknown"
          }
        }))
      } catch (e) {
        nt.sendEvent({
          type: "track",
          event: "CONNECT_ERROR",
          properties: {
            message: e?.message ?? "Unknown"
          }
        }), this.error = !0
      }
    }
  };
  LU = f4e([ye("w4m-connecting-external-view")], LU);
  const p4e = Re`
    wiu-flex,
    wiu-list-wallet {
      width: 100%;
    }
  `;
  var BU = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let k4 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.activeConnector = fe.state.activeConnector, this.unsubscribe.push(fe.subscribeKey("activeConnector", e => this.activeConnector = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      return K`
        <wiu-flex
          flexDirection="column"
          alignItems="center"
          .padding=${["m","xl","xl","xl"]}
          gap="xl"
        >
          <wiu-flex justifyContent="center" alignItems="center">
            <wiu-wallet-image
              size="lg"
              imageSrc=${$e(Rr.getConnectorImage(this.activeConnector))}
            ></wiu-wallet-image>
          </wiu-flex>
          <wiu-flex
            flexDirection="column"
            alignItems="center"
            gap="xs"
            .padding=${["0","s","0","s"]}
          >
            <wiu-text variant="paragraph-500" color="fg-100">
              Select Chain for ${this.activeConnector?.name}
            </wiu-text>
            <wiu-text align="center" variant="small-500" color="fg-200"
              >Select which chain to connect to your multi chain wallet</wiu-text
            >
          </wiu-flex>
          <wiu-flex
            flexGrow="1"
            flexDirection="column"
            alignItems="center"
            gap="xs"
            .padding=${["xs","0","xs","0"]}
          >
            ${this.networksTemplate()}
          </wiu-flex>
        </wiu-flex>
      `
    }
    networksTemplate() {
      return this.activeConnector?.connectors?.map(e => e.name ? K`
              <wiu-list-wallet
                imageSrc=${$e(Rr.getChainImage(e.chain))}
                name=${pr.CHAIN_NAME_MAP[e.chain]}
                @click=${()=>this.onConnector(e)}
              ></wiu-list-wallet>
            ` : null)
    }
    onConnector(e) {
      const r = this.activeConnector?.connectors?.find(n => n.chain === e.chain);
      if (!r) {
        Rt.showError("Failed to find connector");
        return
      }
      r.id === "walletConnect" ? je.isMobile() ? Ae.push("AllWallets") : Ae.push("ConnectingWalletConnect") : Ae.push("ConnectingExternal", {
        connector: r
      })
    }
  };
  k4.styles = p4e, BU([le()], k4.prototype, "activeConnector", void 0), k4 = BU([ye("w4m-connecting-multi-chain-view")], k4);
  var R4 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let kv = class extends _e {
    constructor() {
      super(), 
      this.interval = void 0, this.lastRetry = Date.now(), this.wallet = Ae.state.data?.wallet, this.platform = void 0, this.platforms = [], this.isSiweEnabled = Ue.state.isSiweEnabled, this.determinePlatforms(), this.initializeConnection(), this.interval = setInterval(this.initializeConnection.bind(this), Qr.TEN_SEC_MS)
    }
    disconnectedCallback() {
      clearTimeout(this.interval)
    }
    render() {
      return this.wallet ? K`
        ${this.headerTemplate()}
        <div>${this.platformTemplate()}</div>
      ` : K`<w4m-connecting-wc-qrcode></w4m-connecting-wc-qrcode>`
    }
    async initializeConnection(e = !1) {
      if (this.platform !== "browser") try {
        const {
          wcPairingExpiry: r,
          status: n
        } = Kt.state;
        (e || je.isPairingExpired(r) || n === "connecting") && (await Kt.connectWalletConnect(), this.finalizeConnection(), this.isSiweEnabled || Ot.close())
      } catch (r) {
        nt.sendEvent({
          type: "track",
          event: "CONNECT_ERROR",
          properties: {
            message: r?.message ?? "Unknown"
          }
        }), Kt.setWcError(!0), je.isAllowedRetry(this.lastRetry) ? (Rt.showError(r.message ?? "Declined"), this.lastRetry = Date.now(), this.initializeConnection(!0)) : Rt.showError(r.message ?? "Connection error")
      }
    }
    finalizeConnection() {
      const {
        wcLinking: e,
        recentWallet: r
      } = Kt.state;
      e && Ar.setWalletConnectDeepLink(e), r && Ar.setAppKitRecent(r), nt.sendEvent({
        type: "track",
        event: "CONNECT_SUCCESS",
        properties: {
          method: e ? "mobile" : "qrcode",
          name: this.wallet?.name || "Unknown"
        }
      })
    }
    determinePlatforms() {
      if (!this.wallet) {
        this.platforms.push("qrcode"), this.platform = "qrcode";
        return
      }
      if (this.platform) return;
      const {
        mobile_link: e,
        desktop_link: r,
        webapp_link: n,
        injected: i,
        rdns: s,
        name: o
      } = this.wallet, a = i?.map(({
        injected_id: M
      }) => M).filter(Boolean), c = [...s ? [s] : a ?? [], o], l = Ue.state.isUniversalProvider ? !1 : c.length, h = e, f = n, w = Kt.checkInstalled(c), b = l && w, C = r && !je.isMobile();
      b && this.platforms.push("browser"), h && this.platforms.push(je.isMobile() ? "mobile" : "qrcode"), f && this.platforms.push("web"), C && this.platforms.push("desktop"), !b && l && this.platforms.push("unsupported"), this.platform = this.platforms[0]
    }
    platformTemplate() {
      switch (this.platform) {
        case "browser":
          return K`<w4m-connecting-wc-browser></w4m-connecting-wc-browser>`;
        case "web":
          return K`<w4m-connecting-wc-web></w4m-connecting-wc-web>`;
        case "desktop":
          return K`
            <w4m-connecting-wc-desktop .onRetry=${()=>this.initializeConnection(!0)}>
            </w4m-connecting-wc-desktop>
          `;
        case "mobile":
          return K`
            <w4m-connecting-wc-mobile isMobile .onRetry=${()=>this.initializeConnection(!0)}>
            </w4m-connecting-wc-mobile>
          `;
        case "qrcode":
          return K`<w4m-connecting-wc-qrcode></w4m-connecting-wc-qrcode>`;
        default:
          return K`<w4m-connecting-wc-unsupported></w4m-connecting-wc-unsupported>`
      }
    }
    headerTemplate() {
      return this.platforms.length > 1 ? K`
        <w4m-connecting-header
          .platforms=${this.platforms}
          .onSelectPlatfrom=${this.onSelectPlatform.bind(this)}
        >
        </w4m-connecting-header>
      ` : null
    }
    async onSelectPlatform(e) {
      const r = this.shadowRoot?.querySelector("div");
      r && (await r.animate([{
        opacity: 1
      }, {
        opacity: 0
      }], {
        duration: 200,
        fill: "forwards",
        easing: "ease"
      }).finished, this.platform = e, r.animate([{
        opacity: 0
      }, {
        opacity: 1
      }], {
        duration: 200,
        fill: "forwards",
        easing: "ease"
      }))
    }
  };
  R4([le()], kv.prototype, "platform", void 0), R4([le()], kv.prototype, "platforms", void 0), R4([le()], kv.prototype, "isSiweEnabled", void 0), kv = R4([ye("w4m-connecting-wc-view")], kv);
  const g4e = Re`
    .continue-button-container {
      width: 100%;
    }
  `;
  var UU = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let N4 = class extends _e {
    constructor() {
      super(...arguments), this.loading = !1
    }
    render() {
      return K`
        <wiu-flex
          flexDirection="column"
          alignItems="center"
          gap="xxl"
          .padding=${["0","0","l","0"]}
        >
          ${this.onboardingTemplate()} ${this.buttonsTemplate()}
          <wiu-link
            @click=${()=>{je.openHref(B9.URLS.FAQ,"_blank")}}
          >
            Learn more about names
            <wiu-icon color="inherit" slot="iconRight" name="externalLink"></wiu-icon>
          </wiu-link>
        </wiu-flex>
      `
    }
    onboardingTemplate() {
      return K` <wiu-flex
        flexDirection="column"
        gap="xxl"
        alignItems="center"
        .padding=${["0","xxl","0","xxl"]}
      >
        <wiu-flex gap="s" alignItems="center" justifyContent="center">
          <wiu-icon-box
            icon="id"
            size="xl"
            iconSize="xxl"
            iconColor="fg-200"
            backgroundColor="fg-200"
          ></wiu-icon-box>
        </wiu-flex>
        <wiu-flex flexDirection="column" alignItems="center" gap="s">
          <wiu-text align="center" variant="medium-600" color="fg-100">
            Choose your account name
          </wiu-text>
          <wiu-text align="center" variant="paragraph-400" color="fg-100">
            Finally say goodbye to 0x addresses, name your account to make it easier to exchange
            assets
          </wiu-text>
        </wiu-flex>
      </wiu-flex>`
    }
    buttonsTemplate() {
      return K`<wiu-flex
        .padding=${["0","2l","0","2l"]}
        gap="s"
        class="continue-button-container"
      >
        <wiu-button
          fullWidth
          .loading=${this.loading}
          size="lg"
          borderRadius="xs"
          @click=${this.handleContinue.bind(this)}
          >Choose name
        </wiu-button>
      </wiu-flex>`
    }
    handleContinue() {
      Ae.push("RegisterAccountName"), nt.sendEvent({
        type: "track",
        event: "OPEN_ENS_FLOW",
        properties: {
          isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT
        }
      })
    }
  };
  N4.styles = g4e, UU([le()], N4.prototype, "loading", void 0), N4 = UU([ye("w4m-choose-account-name-view")], N4);
  var m4e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let jU = class extends _e {
    constructor() {
      super(...arguments), this.wallet = Ae.state.data?.wallet
    }
    render() {
      if (!this.wallet) throw new Error("w4m-downloads-view");
      return K`
        <wiu-flex gap="xs" flexDirection="column" .padding=${["s","s","l","s"]}>
          ${this.chromeTemplate()} ${this.iosTemplate()} ${this.androidTemplate()}
          ${this.homepageTemplate()}
        </wiu-flex>
      `
    }
    chromeTemplate() {
      return this.wallet?.chrome_store ? K`<wiu-list-item
        variant="icon"
        icon="chromeStore"
        iconVariant="square"
        @click=${this.onChromeStore.bind(this)}
        chevron
      >
        <wiu-text variant="paragraph-500" color="fg-100">Chrome Extension</wiu-text>
      </wiu-list-item>` : null
    }
    iosTemplate() {
      return this.wallet?.app_store ? K`<wiu-list-item
        variant="icon"
        icon="appStore"
        iconVariant="square"
        @click=${this.onAppStore.bind(this)}
        chevron
      >
        <wiu-text variant="paragraph-500" color="fg-100">iOS App</wiu-text>
      </wiu-list-item>` : null
    }
    androidTemplate() {
      return this.wallet?.play_store ? K`<wiu-list-item
        variant="icon"
        icon="playStore"
        iconVariant="square"
        @click=${this.onPlayStore.bind(this)}
        chevron
      >
        <wiu-text variant="paragraph-500" color="fg-100">Android App</wiu-text>
      </wiu-list-item>` : null
    }
    homepageTemplate() {
      return this.wallet?.homepage ? K`
        <wiu-list-item
          variant="icon"
          icon="browser"
          iconVariant="square-blue"
          @click=${this.onHomePage.bind(this)}
          chevron
        >
          <wiu-text variant="paragraph-500" color="fg-100">Website</wiu-text>
        </wiu-list-item>
      ` : null
    }
    onChromeStore() {
      this.wallet?.chrome_store && je.openHref(this.wallet.chrome_store, "_blank")
    }
    onAppStore() {
      this.wallet?.app_store && je.openHref(this.wallet.app_store, "_blank")
    }
    onPlayStore() {
      this.wallet?.play_store && je.openHref(this.wallet.play_store, "_blank")
    }
    onHomePage() {
      this.wallet?.homepage && je.openHref(this.wallet.homepage, "_blank")
    }
  };
  jU = m4e([ye("w4m-downloads-view")], jU);
  var w4e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const v4e = "https://walletconnect.com/explorer";
  let FU = class extends _e {
    render() {
      return K`
        <wiu-flex flexDirection="column" .padding=${["0","s","s","s"]} gap="xs">
          ${this.recommendedWalletsTemplate()}
          <wiu-list-wallet
            name="Explore all"
            showAllWallets
            walletIcon="allWallets"
            icon="externalLink"
            @click=${()=>{je.openHref("https://walletconnect.com/explorer?type=wallet","_blank")}}
          ></wiu-list-wallet>
        </wiu-flex>
      `
    }
    recommendedWalletsTemplate() {
      const {
        recommended: e,
        featured: r
      } = qt.state, {
        customWallets: n
      } = Ue.state;
      return [...r, ...n ?? [], ...e].slice(0, 4).map(s => K`
          <wiu-list-wallet
            name=${s.name??"Unknown"}
            tagVariant="main"
            imageSrc=${$e(Rr.getWalletImage(s))}
            @click=${()=>{je.openHref(s.homepage??v4e,"_blank")}}
          ></wiu-list-wallet>
        `)
    }
  };
  FU = w4e([ye("w4m-get-wallet-view")], FU);
  const b4e = Re`
    wiu-flex {
      width: 100%;
    }
  
    .suggestion {
      background: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-xs);
    }
  
    .suggestion:hover {
      background-color: var(--wiu-color-gray-glass-005);
      cursor: pointer;
    }
  
    .suggested-name {
      max-width: 75%;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
  
    form {
      width: 100%;
    }
  
    wiu-icon-link {
      position: absolute;
      right: 20px;
      transform: translateY(11px);
    }
  `;
  var Oh = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Vl = class extends _e {
    constructor() {
      super(), this.formRef = cl(), this.usubscribe = [], this.name = "", this.error = "", this.loading = rl.state.loading, this.suggestions = rl.state.suggestions, this.registered = !1, this.profileName = ke.state.profileName, this.onDebouncedNameInputChange = je.debounce(e => {
        rl.validateName(e) ? (this.error = "", this.name = e, rl.getSuggestions(e), rl.isNameRegistered(e).then(r => {
          this.registered = r
        })) : e.length < 4 ? this.error = "Name must be at least 4 characters long" : this.error = "Can only contain letters, numbers and - characters"
      }), this.usubscribe.push(rl.subscribe(e => {
        this.suggestions = e.suggestions, this.loading = e.loading
      }), ke.subscribeKey("profileName", e => {
        this.profileName = e, e && (this.error = "You already own a name")
      }))
    }
    firstUpdated() {
      this.formRef.value?.addEventListener("keydown", this.onEnterKey.bind(this))
    }
    disconnectedCallback() {
      super.disconnectedCallback(), this.usubscribe.forEach(e => e()), this.formRef.value?.removeEventListener("keydown", this.onEnterKey.bind(this))
    }
    render() {
      return K`
        <wiu-flex
          flexDirection="column"
          alignItems="center"
          gap="m"
          .padding=${["0","s","m","s"]}
        >
          <form ${ll(this.formRef)} @submit=${this.onSubmitName.bind(this)}>
            <wiu-ens-input
              @inputChange=${this.onNameInputChange.bind(this)}
              .errorMessage=${this.error}
              .value=${this.name}
            >
            </wiu-ens-input>
            ${this.submitButtonTemplate()}
            <input type="submit" hidden />
          </form>
          ${this.templateSuggestions()}
        </wiu-flex>
      `
    }
    submitButtonTemplate() {
      return this.isAllowedToSubmit() ? K`
            <wiu-icon-link
              size="sm"
              icon="chevronRight"
              iconcolor="accent-100"
              @click=${this.onSubmitName.bind(this)}
            >
            </wiu-icon-link>
          ` : null
    }
    onSelectSuggestion(e) {
      return () => {
        this.name = e, this.registered = !1, this.requestUpdate()
      }
    }
    onNameInputChange(e) {
      this.onDebouncedNameInputChange(e.detail)
    }
    nameSuggestionTagTemplate() {
      return this.loading ? K`<wiu-loading-spinner size="lg" color="fg-100"></wiu-loading-spinner>` : this.registered ? K`<wiu-tag variant="shade" size="lg">Registered</wiu-tag>` : K`<wiu-tag variant="success" size="lg">Available</wiu-tag>`
    }
    templateSuggestions() {
      if (!this.name || this.name.length < 4 || this.error) return null;
      const e = this.registered ? this.suggestions.filter(r => r.name !== this.name) : [];
      return K`<wiu-flex flexDirection="column" gap="xxs" alignItems="center">
        <wiu-flex
          data-testid="account-name-suggestion"
          .padding=${["m","m","m","m"]}
          justifyContent="space-between"
          class="suggestion"
          @click=${this.onSubmitName.bind(this)}
        >
          <wiu-text color="fg-100" variant="paragraph-400" class="suggested-name">
            ${this.name}</wiu-text
          >${this.nameSuggestionTagTemplate()}
        </wiu-flex>
        ${e.map(r=>this.availableNameTemplate(r.name))}
      </wiu-flex>`
    }
    availableNameTemplate(e) {
      return K` <wiu-flex
        data-testid="account-name-suggestion"
        .padding=${["m","m","m","m"]}
        justifyContent="space-between"
        class="suggestion"
        @click=${this.onSelectSuggestion(e)}
      >
        <wiu-text color="fg-100" variant="paragraph-400" class="suggested-name">
          ${e}
        </wiu-text>
        <wiu-tag variant="success" size="lg">Available</wiu-tag>
      </wiu-flex>`
    }
    isAllowedToSubmit() {
      return !this.loading && !this.registered && !this.error && !this.profileName && rl.validateName(this.name)
    }
    async onSubmitName() {
      try {
        if (!this.isAllowedToSubmit()) return;
        const e = `${this.name}${pr.WC_NAME_SUFFIX}`;
        nt.sendEvent({
          type: "track",
          event: "REGISTER_NAME_INITIATED",
          properties: {
            isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT,
            ensName: e
          }
        }), await rl.registerName(e), nt.sendEvent({
          type: "track",
          event: "REGISTER_NAME_SUCCESS",
          properties: {
            isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT,
            ensName: e
          }
        })
      } catch (e) {
        Rt.showError(e.message), nt.sendEvent({
          type: "track",
          event: "REGISTER_NAME_ERROR",
          properties: {
            isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT,
            ensName: `${this.name}${pr.WC_NAME_SUFFIX}`,
            error: e?.message || "Unknown error"
          }
        })
      }
    }
    onEnterKey(e) {
      e.key === "Enter" && this.isAllowedToSubmit() && this.onSubmitName()
    }
  };
  Vl.styles = b4e, Oh([re()], Vl.prototype, "errorMessage", void 0), Oh([le()], Vl.prototype, "name", void 0), Oh([le()], Vl.prototype, "error", void 0), Oh([le()], Vl.prototype, "loading", void 0), Oh([le()], Vl.prototype, "suggestions", void 0), Oh([le()], Vl.prototype, "registered", void 0), Oh([le()], Vl.prototype, "profileName", void 0), Vl = Oh([ye("w4m-register-account-name-view")], Vl);
  const y4e = Re`
    .continue-button-container {
      width: 100%;
    }
  `;
  var _4e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let FE = class extends _e {
    render() {
      return K`
        <wiu-flex
          flexDirection="column"
          alignItems="center"
          gap="xxl"
          .padding=${["0","0","l","0"]}
        >
          ${this.onboardingTemplate()} ${this.buttonsTemplate()}
          <wiu-link
            @click=${()=>{je.openHref(B9.URLS.FAQ,"_blank")}}
          >
            Learn more
            <wiu-icon color="inherit" slot="iconRight" name="externalLink"></wiu-icon>
          </wiu-link>
        </wiu-flex>
      `
    }
    onboardingTemplate() {
      return K` <wiu-flex
        flexDirection="column"
        gap="xxl"
        alignItems="center"
        .padding=${["0","xxl","0","xxl"]}
      >
        <wiu-flex gap="s" alignItems="center" justifyContent="center">
          <wiu-icon-box
            size="xl"
            iconcolor="success-100"
            backgroundcolor="success-100"
            icon="checkmark"
            background="opaque"
          ></wiu-icon-box>
        </wiu-flex>
        <wiu-flex flexDirection="column" alignItems="center" gap="s">
          <wiu-text align="center" variant="medium-600" color="fg-100">
            Account name chosen successfully
          </wiu-text>
          <wiu-text align="center" variant="paragraph-400" color="fg-100">
            You can now fund your account and trade crypto
          </wiu-text>
        </wiu-flex>
      </wiu-flex>`
    }
    buttonsTemplate() {
      return K`<wiu-flex
        .padding=${["0","2l","0","2l"]}
        gap="s"
        class="continue-button-container"
      >
        <wiu-button fullWidth size="lg" borderRadius="xs" @click=${this.redirectToAccount.bind(this)}
          >Let's Go!
        </wiu-button>
      </wiu-flex>`
    }
    redirectToAccount() {
      Ae.replace("Account")
    }
  };
  FE.styles = y4e, FE = _4e([ye("w4m-register-account-name-success-view")], FE);
  const x4e = Re`
    @keyframes shake {
      0% {
        transform: translateX(0);
      }
      25% {
        transform: translateX(3px);
      }
      50% {
        transform: translateX(-3px);
      }
      75% {
        transform: translateX(3px);
      }
      100% {
        transform: translateX(0);
      }
    }
  
    wiu-flex:first-child:not(:only-child) {
      position: relative;
    }
  
    wiu-loading-hexagon {
      position: absolute;
    }
  
    wiu-icon-box {
      position: absolute;
      right: 4px;
      bottom: 0;
      opacity: 0;
      transform: scale(0.5);
      z-index: 1;
    }
  
    wiu-button {
      display: none;
    }
  
    [data-error='true'] wiu-icon-box {
      opacity: 1;
      transform: scale(1);
    }
  
    [data-error='true'] > wiu-flex:first-child {
      animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    }
  
    wiu-button[data-retry='true'] {
      display: block;
      opacity: 1;
    }
  `;
  var WE = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Rv = class extends _e {
    constructor() {
      super(), this.network = Ae.state.data?.network, this.unsubscribe = [], this.showRetry = !1, this.error = !1
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    firstUpdated() {
      this.onSwitchNetwork()
    }
    render() {
      if (!this.network) throw new Error("w4m-network-switch-view: No network provided");
      this.onShowRetry();
      const e = this.getLabel(),
        r = this.getSubLabel();
      return K`
        <wiu-flex
          data-error=${this.error}
          flexDirection="column"
          alignItems="center"
          .padding=${["3xl","xl","3xl","xl"]}
          gap="xl"
        >
          <wiu-flex justifyContent="center" alignItems="center">
            <wiu-network-image
              size="lg"
              imageSrc=${$e(Rr.getNetworkImage(this.network))}
            ></wiu-network-image>
  
            ${this.error?null:K`<wiu-loading-hexagon></wiu-loading-hexagon>`}
  
            <wiu-icon-box
              backgroundColor="error-100"
              background="opaque"
              iconColor="error-100"
              icon="close"
              size="sm"
              ?border=${!0}
              borderColor="wiu-color-bg-125"
            ></wiu-icon-box>
          </wiu-flex>
  
          <wiu-flex flexDirection="column" alignItems="center" gap="xs">
            <wiu-text align="center" variant="paragraph-500" color="fg-100">${e}</wiu-text>
            <wiu-text align="center" variant="small-500" color="fg-200">${r}</wiu-text>
          </wiu-flex>
  
          <wiu-button
            data-retry=${this.showRetry}
            variant="accent"
            size="md"
            .disabled=${!this.error}
            @click=${this.onSwitchNetwork.bind(this)}
          >
            <wiu-icon color="inherit" slot="iconLeft" name="refresh"></wiu-icon>
            Try again
          </wiu-button>
        </wiu-flex>
      `
    }
    getSubLabel() {
      const e = Ar.getConnectedConnector();
      return Tt.getAuthConnector() && e === "AUTH" ? "" : this.error ? "Switch can be declined if chain is not supported by a wallet or previous request is still active" : "Accept connection request in your wallet"
    }
    getLabel() {
      const e = Ar.getConnectedConnector();
      return Tt.getAuthConnector() && e === "AUTH" ? `Switching to ${this.network?.name??"Unknown"} network...` : this.error ? "Switch declined" : "Approve in wallet"
    }
    onShowRetry() {
      this.error && !this.showRetry && (this.showRetry = !0, this.shadowRoot?.querySelector("wiu-button")?.animate([{
        opacity: 0
      }, {
        opacity: 1
      }], {
        fill: "forwards",
        easing: "ease"
      }))
    }
    async onSwitchNetwork() {
      try {
        this.error = !1, this.network && await fe.switchActiveNetwork(this.network)
      } catch {
        this.error = !0
      }
    }
  };
  Rv.styles = x4e, WE([le()], Rv.prototype, "showRetry", void 0), WE([le()], Rv.prototype, "error", void 0), Rv = WE([ye("w4m-network-switch-view")], Rv);
  const C4e = Re`
    .container {
      max-height: 360px;
      overflow: auto;
    }
  
    .container::-webkit-scrollbar {
      display: none;
    }
  `;
  var Nv = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let $0 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.network = fe.state.activeCaipNetwork, this.requestedCaipNetworks = fe.getAllRequestedCaipNetworks(), this.search = "", this.onDebouncedSearch = je.debounce(e => {
        this.search = e
      }, 100), this.unsubscribe.push(fe.subscribeKey("activeCaipNetwork", e => this.network = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      return K`
        ${this.templateSearchInput()}
        <wiu-flex
          class="container"
          .padding=${["0","s","s","s"]}
          flexDirection="column"
          gap="xs"
        >
          ${this.networksTemplate()}
        </wiu-flex>
  
        <wiu-separator></wiu-separator>
  
        <wiu-flex padding="s" flexDirection="column" gap="m" alignItems="center">
          <wiu-text variant="small-400" color="fg-300" align="center">
            Your connected wallet may not support some of the networks available for this dApp
          </wiu-text>
          <wiu-link @click=${this.onNetworkHelp.bind(this)}>
            <wiu-icon size="xs" color="accent-100" slot="iconLeft" name="helpCircle"></wiu-icon>
            What is a network
          </wiu-link>
        </wiu-flex>
      `
    }
    templateSearchInput() {
      return K`
        <wiu-flex gap="xs" .padding=${["0","s","s","s"]}>
          <wiu-input-text
            @inputChange=${this.onInputChange.bind(this)}
            class="network-search-input"
            size="md"
            placeholder="Search network"
            icon="search"
          ></wiu-input-text>
        </wiu-flex>
      `
    }
    onInputChange(e) {
      this.onDebouncedSearch(e.detail)
    }
    onNetworkHelp() {
      nt.sendEvent({
        type: "track",
        event: "CLICK_NETWORK_HELP"
      }), Ae.push("WhatIsANetwork")
    }
    networksTemplate() {
      const e = fe.getAllRequestedCaipNetworks(),
        r = fe.getAllApprovedCaipNetworkIds(),
        n = je.sortRequestedNetworks(r, e);
      return this.search ? this.filteredNetworks = n?.filter(i => i?.name?.toLowerCase().includes(this.search.toLowerCase())) : this.filteredNetworks = n, this.filteredNetworks?.map(i => K`
          <wiu-list-network
            .selected=${this.network?.id===i.id}
            imageSrc=${$e(Rr.getNetworkImage(i))}
            type="network"
            name=${i.name??i.id}
            @click=${()=>this.onSwitchNetwork(i)}
            .disabled=${this.getNetworkDisabled(i)}
            data-testid=${`w4m-network-switch-${i.name??i.id}`}
          ></wiu-list-network>
        `)
    }
    getNetworkDisabled(e) {
      const r = e.chainNamespace,
        n = ke.getCaipAddress(r),
        i = fe.getAllApprovedCaipNetworkIds(),
        s = fe.getNetworkProp("supportsAllNetworks", r) !== !1,
        o = Ar.getConnectedConnector(),
        a = Tt.getAuthConnector();
      return !n || s || o === "AUTH" && a ? !1 : !i?.includes(e.caipNetworkId)
    }
    onSwitchNetwork(e) {
      const r = Ae.state.data;
      if (e.id === this.network?.id) return;
      const i = e.chainNamespace !== fe.state.activeChain,
        s = fe.getAccountProp("caipAddress", e.chainNamespace),
        o = ke.state.caipAddress,
        a = Ar.getConnectedConnector() === "AUTH";
      i && o && !s && !a ? Ae.push("SwitchActiveChain", {
        switchToChain: e.chainNamespace,
        navigateTo: "Connect",
        navigateWithReplace: !0,
        network: e
      }) : Ae.push("SwitchNetwork", {
        ...r,
        network: e
      })
    }
  };
  $0.styles = C4e, Nv([le()], $0.prototype, "network", void 0), Nv([le()], $0.prototype, "requestedCaipNetworks", void 0), Nv([le()], $0.prototype, "filteredNetworks", void 0), Nv([le()], $0.prototype, "search", void 0), $0 = Nv([ye("w4m-networks-view")], $0);
  const E4e = Re`
    :host > wiu-flex {
      height: 500px;
      overflow-y: auto;
      overflow-x: hidden;
      scrollbar-width: none;
      padding: var(--wiu-spacing-m);
      box-sizing: border-box;
      display: flex;
      align-items: center;
      justify-content: flex-start;
    }
  
    :host > wiu-flex::-webkit-scrollbar {
      display: none;
    }
  
    :host > wiu-flex > wiu-flex {
      width: 100%;
    }
  
    wiu-transaction-list-item-loader {
      width: 100%;
    }
  `;
  var Mv = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const A4e = 7;
  let O0 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.selectedOnRampProvider = Gr.state.selectedProvider, this.loading = !1, this.coinbaseTransactions = yi.state.coinbaseTransactions, this.tokenImages = Bn.state.tokenImages, this.unsubscribe.push(Gr.subscribeKey("selectedProvider", e => {
        this.selectedOnRampProvider = e
      }), Bn.subscribeKey("tokenImages", e => this.tokenImages = e), () => {
        clearTimeout(this.refetchTimeout)
      }, yi.subscribe(e => {
        this.coinbaseTransactions = {
          ...e.coinbaseTransactions
        }
      })), yi.clearCursor(), this.fetchTransactions()
    }
    render() {
      return K`
        <wiu-flex flexDirection="column" .padding=${["0","s","s","s"]} gap="xs">
          ${this.loading?this.templateLoading():this.templateTransactionsByYear()}
        </wiu-flex>
      `
    }
    templateTransactions(e) {
      return e?.map(r => {
        const n = P9.formatDate(r?.metadata?.minedAt),
          i = r.transfers[0],
          s = i?.fungible_info;
        if (!s) return null;
        const o = s?.icon?.url || this.tokenImages?.[s.symbol || ""];
        return K`
          <w4m-onramp-activity-item
            label="Bought"
            .completed=${r.metadata.status==="ONRAMP_TRANSACTION_STATUS_SUCCESS"}
            .inProgress=${r.metadata.status==="ONRAMP_TRANSACTION_STATUS_IN_PROGRESS"}
            .failed=${r.metadata.status==="ONRAMP_TRANSACTION_STATUS_FAILED"}
            purchaseCurrency=${$e(s.symbol)}
            purchaseValue=${i.quantity.numeric}
            date=${n}
            icon=${$e(o)}
            symbol=${$e(s.symbol)}
          ></w4m-onramp-activity-item>
        `
      })
    }
    templateTransactionsByYear() {
      return Object.keys(this.coinbaseTransactions).sort().reverse().map(r => {
        const n = parseInt(r, 10);
        return new Array(12).fill(null).map((s, o) => o).reverse().map(s => {
          const o = wh.getTransactionGroupTitle(n, s),
            a = this.coinbaseTransactions[n]?.[s];
          return a ? K`
            <wiu-flex flexDirection="column">
              <wiu-flex
                alignItems="center"
                flexDirection="row"
                .padding=${["xs","s","s","s"]}
              >
                <wiu-text variant="paragraph-500" color="fg-200">${o}</wiu-text>
              </wiu-flex>
              <wiu-flex flexDirection="column" gap="xs">
                ${this.templateTransactions(a)}
              </wiu-flex>
            </wiu-flex>
          ` : null
        })
      })
    }
    async fetchTransactions() {
      await this.fetchCoinbaseTransactions()
    }
    async fetchCoinbaseTransactions() {
      const e = ke.state.address,
        r = Ue.state.projectId;
      if (!e) throw new Error("No address found");
      if (!r) throw new Error("No projectId found");
      this.loading = !0, await yi.fetchTransactions(e, "coinbase"), this.loading = !1, this.refetchLoadingTransactions()
    }
    refetchLoadingTransactions() {
      const e = new Date;
      if ((this.coinbaseTransactions[e.getFullYear()]?.[e.getMonth()] || []).filter(i => i.metadata.status === "ONRAMP_TRANSACTION_STATUS_IN_PROGRESS").length === 0) {
        clearTimeout(this.refetchTimeout);
        return
      }
      this.refetchTimeout = setTimeout(async () => {
        const i = ke.state.address;
        await yi.fetchTransactions(i, "coinbase"), this.refetchLoadingTransactions()
      }, 3e3)
    }
    templateLoading() {
      return Array(A4e).fill(K` <wiu-transaction-list-item-loader></wiu-transaction-list-item-loader> `).map(e => e)
    }
  };
  O0.styles = E4e, Mv([le()], O0.prototype, "selectedOnRampProvider", void 0), Mv([le()], O0.prototype, "loading", void 0), Mv([le()], O0.prototype, "coinbaseTransactions", void 0), Mv([le()], O0.prototype, "tokenImages", void 0), O0 = Mv([ye("w4m-onramp-activity-view")], O0);
  const S4e = Re`
    :host > wiu-grid {
      max-height: 360px;
      overflow: auto;
    }
  
    wiu-flex {
      transition: opacity var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: opacity;
    }
  
    wiu-grid::-webkit-scrollbar {
      display: none;
    }
  
    wiu-flex.disabled {
      opacity: 0.3;
      pointer-events: none;
      user-select: none;
    }
  `;
  var Pv = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let D0 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.selectedCurrency = Gr.state.paymentCurrency, this.currencies = Gr.state.paymentCurrencies, this.currencyImages = Bn.state.currencyImages, this.checked = !1, this.unsubscribe.push(Gr.subscribe(e => {
        this.selectedCurrency = e.paymentCurrency, this.currencies = e.paymentCurrencies
      }), Bn.subscribeKey("currencyImages", e => this.currencyImages = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      const {
        termsConditionsUrl: e,
        privacyPolicyUrl: r
      } = Ue.state, n = Ue.state.features?.legalCheckbox, o = !!(e || r) && !!n && !this.checked;
      return K`
        <w4m-legal-checkbox @checkboxChange=${this.onCheckboxChange.bind(this)}></w4m-legal-checkbox>
        <wiu-flex
          flexDirection="column"
          .padding=${["0","s","s","s"]}
          gap="xs"
          class=${$e(o?"disabled":void 0)}
        >
          ${this.currenciesTemplate(o)}
        </wiu-flex>
        <w4m-legal-footer></w4m-legal-footer>
      `
    }
    currenciesTemplate(e = !1) {
      return this.currencies.map(r => K`
          <wiu-list-item
            imageSrc=${$e(this.currencyImages?.[r.id])}
            @click=${()=>this.selectCurrency(r)}
            variant="image"
            tabIdx=${$e(e?-1:void 0)}
          >
            <wiu-text variant="paragraph-500" color="fg-100">${r.id}</wiu-text>
          </wiu-list-item>
        `)
    }
    selectCurrency(e) {
      e && (Gr.setPaymentCurrency(e), Ot.close())
    }
    onCheckboxChange(e) {
      this.checked = !!e.detail
    }
  };
  D0.styles = S4e, Pv([le()], D0.prototype, "selectedCurrency", void 0), Pv([le()], D0.prototype, "currencies", void 0), Pv([le()], D0.prototype, "currencyImages", void 0), Pv([le()], D0.prototype, "checked", void 0), D0 = Pv([ye("w4m-onramp-fiat-select-view")], D0);
  var WU = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let zE = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.providers = Gr.state.providers, this.unsubscribe.push(Gr.subscribeKey("providers", e => {
        this.providers = e
      }))
    }
    firstUpdated() {
      const e = this.providers.map(async r => r.name === "coinbase" ? await this.getCoinbaseOnRampURL() : Promise.resolve(r?.url));
      Promise.all(e).then(r => {
        this.providers = this.providers.map((n, i) => ({
          ...n,
          url: r[i] || ""
        }))
      })
    }
    render() {
      return K`
        <wiu-flex flexDirection="column" .padding=${["0","s","s","s"]} gap="xs">
          ${this.onRampProvidersTemplate()}
        </wiu-flex>
        <w4m-onramp-providers-footer></w4m-onramp-providers-footer>
      `
    }
    onRampProvidersTemplate() {
      return this.providers.filter(e => e.supportedChains.includes(fe.state.activeChain ?? "eip155")).map(e => K`
            <w4m-onramp-provider-item
              label=${e.label}
              name=${e.name}
              feeRange=${e.feeRange}
              @click=${()=>{this.onClickProvider(e)}}
              ?disabled=${!e.url}
            ></w4m-onramp-provider-item>
          `)
    }
    onClickProvider(e) {
      Gr.setSelectedProvider(e), Ae.push("BuyInProgress"), je.openHref(e.url, "popupWindow", "width=600,height=800,scrollbars=yes"), nt.sendEvent({
        type: "track",
        event: "SELECT_BUY_PROVIDER",
        properties: {
          provider: e.name,
          isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT
        }
      })
    }
    async getCoinbaseOnRampURL() {
      const e = ke.state.address,
        r = fe.state.activeCaipNetwork;
      if (!e) throw new Error("No address found");
      if (!r?.name) throw new Error("No network found");
      const n = Qr.WC_COINBASE_PAY_SDK_CHAIN_NAME_MAP[r.name] ?? Qr.WC_COINBASE_PAY_SDK_FALLBACK_CHAIN,
        i = Gr.state.purchaseCurrency,
        s = i ? [i.symbol] : Gr.state.purchaseCurrencies.map(o => o.symbol);
      return await An.generateOnRampURL({
        defaultNetwork: n,
        destinationWallets: [{
          address: e,
          blockchains: Qr.WC_COINBASE_PAY_SDK_CHAINS,
          assets: s
        }],
        partnerUserId: e,
        purchaseAmount: Gr.state.purchaseAmount
      })
    }
  };
  WU([le()], zE.prototype, "providers", void 0), zE = WU([ye("w4m-onramp-providers-view")], zE);
  const I4e = Re`
    :host > wiu-grid {
      max-height: 360px;
      overflow: auto;
    }
  
    wiu-flex {
      transition: opacity var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: opacity;
    }
  
    wiu-grid::-webkit-scrollbar {
      display: none;
    }
  
    wiu-flex.disabled {
      opacity: 0.3;
      pointer-events: none;
      user-select: none;
    }
  `;
  var $v = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let L0 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.selectedCurrency = Gr.state.purchaseCurrencies, this.tokens = Gr.state.purchaseCurrencies, this.tokenImages = Bn.state.tokenImages, this.checked = !1, this.unsubscribe.push(Gr.subscribe(e => {
        this.selectedCurrency = e.purchaseCurrencies, this.tokens = e.purchaseCurrencies
      }), Bn.subscribeKey("tokenImages", e => this.tokenImages = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      const {
        termsConditionsUrl: e,
        privacyPolicyUrl: r
      } = Ue.state, n = Ue.state.features?.legalCheckbox, o = !!(e || r) && !!n && !this.checked;
      return K`
        <w4m-legal-checkbox @checkboxChange=${this.onCheckboxChange.bind(this)}></w4m-legal-checkbox>
        <wiu-flex
          flexDirection="column"
          .padding=${["0","s","s","s"]}
          gap="xs"
          class=${$e(o?"disabled":void 0)}
        >
          ${this.currenciesTemplate(o)}
        </wiu-flex>
        <w4m-legal-footer></w4m-legal-footer>
      `
    }
    currenciesTemplate(e = !1) {
      return this.tokens.map(r => K`
          <wiu-list-item
            imageSrc=${$e(this.tokenImages?.[r.symbol])}
            @click=${()=>this.selectToken(r)}
            variant="image"
            tabIdx=${$e(e?-1:void 0)}
          >
            <wiu-flex gap="3xs" alignItems="center">
              <wiu-text variant="paragraph-500" color="fg-100">${r.name}</wiu-text>
              <wiu-text variant="small-400" color="fg-200">${r.symbol}</wiu-text>
            </wiu-flex>
          </wiu-list-item>
        `)
    }
    selectToken(e) {
      e && (Gr.setPurchaseCurrency(e), Ot.close())
    }
    onCheckboxChange(e) {
      this.checked = !!e.detail
    }
  };
  L0.styles = I4e, $v([le()], L0.prototype, "selectedCurrency", void 0), $v([le()], L0.prototype, "tokens", void 0), $v([le()], L0.prototype, "tokenImages", void 0), $v([le()], L0.prototype, "checked", void 0), L0 = $v([ye("w4m-onramp-token-select-view")], L0);
  const T4e = Re`
    :host > wiu-flex:first-child {
      overflow-y: auto;
      overflow-x: hidden;
      scrollbar-width: none;
    }
  
    :host > wiu-flex:first-child::-webkit-scrollbar {
      display: none;
    }
  
    wiu-loading-hexagon {
      position: absolute;
    }
  
    .action-button {
      width: 100%;
      border-radius: var(--wiu-border-radius-xs);
    }
  
    .action-button:disabled {
      border-color: 1px solid var(--wiu-color-gray-glass-005);
    }
  
    .swap-inputs-container {
      position: relative;
    }
  
    .replace-tokens-button-container {
      display: flex;
      justify-content: center;
      align-items: center;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      gap: var(--wiu-spacing-1xs);
      border-radius: var(--wiu-border-radius-xs);
      background-color: var(--wiu-color-modal-bg-base);
      padding: var(--wiu-spacing-xxs);
    }
  
    .replace-tokens-button-container > button {
      display: flex;
      justify-content: center;
      align-items: center;
      height: 40px;
      width: 40px;
      padding: var(--wiu-spacing-xs);
      border: none;
      border-radius: var(--wiu-border-radius-xxs);
      background: var(--wiu-color-gray-glass-002);
      transition: background-color var(--wiu-duration-md) var(--wiu-ease-out-power-1);
      will-change: background-color;
      z-index: 20;
    }
  
    .replace-tokens-button-container > button:hover {
      background: var(--wiu-color-gray-glass-005);
    }
  
    .details-container > wiu-flex {
      background: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-xxs);
      width: 100%;
    }
  
    .details-container > wiu-flex > button {
      border: none;
      background: none;
      padding: var(--wiu-spacing-s);
      border-radius: var(--wiu-border-radius-xxs);
      transition: background 0.2s linear;
    }
  
    .details-container > wiu-flex > button:hover {
      background: var(--wiu-color-gray-glass-002);
    }
  
    .details-content-container {
      padding: var(--wiu-spacing-1xs);
      display: flex;
      align-items: center;
      justify-content: center;
    }
  
    .details-content-container > wiu-flex {
      width: 100%;
    }
  
    .details-row {
      width: 100%;
      padding: var(--wiu-spacing-s) var(--wiu-spacing-xl);
      border-radius: var(--wiu-border-radius-xxs);
      background: var(--wiu-color-gray-glass-002);
    }
  `;
  var cs = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let xi = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.detailsOpen = !1, this.caipNetworkId = fe.state.activeCaipNetwork?.caipNetworkId, this.initialized = ut.state.initialized, this.loadingQuote = ut.state.loadingQuote, this.loadingPrices = ut.state.loadingPrices, this.loadingTransaction = ut.state.loadingTransaction, this.sourceToken = ut.state.sourceToken, this.sourceTokenAmount = ut.state.sourceTokenAmount, this.sourceTokenPriceInUSD = ut.state.sourceTokenPriceInUSD, this.toToken = ut.state.toToken, this.toTokenAmount = ut.state.toTokenAmount, this.toTokenPriceInUSD = ut.state.toTokenPriceInUSD, this.inputError = ut.state.inputError, this.gasPriceInUSD = ut.state.gasPriceInUSD, this.fetchError = ut.state.fetchError, this.onDebouncedGetSwapCalldata = je.debounce(async () => {
        await ut.swapTokens()
      }, 200), fe.subscribeKey("activeCaipNetwork", e => {
        this.caipNetworkId !== e?.caipNetworkId && (this.caipNetworkId = e?.caipNetworkId, ut.resetState(), ut.initializeState())
      }), this.unsubscribe.push(Ot.subscribeKey("open", e => {
        e || ut.resetState()
      }), Ae.subscribeKey("view", e => {
        e.includes("Swap") || ut.resetValues()
      }), ut.subscribe(e => {
        this.initialized = e.initialized, this.loadingQuote = e.loadingQuote, this.loadingPrices = e.loadingPrices, this.loadingTransaction = e.loadingTransaction, this.sourceToken = e.sourceToken, this.sourceTokenAmount = e.sourceTokenAmount, this.sourceTokenPriceInUSD = e.sourceTokenPriceInUSD, this.toToken = e.toToken, this.toTokenAmount = e.toTokenAmount, this.toTokenPriceInUSD = e.toTokenPriceInUSD, this.inputError = e.inputError, this.gasPriceInUSD = e.gasPriceInUSD, this.fetchError = e.fetchError
      }))
    }
    firstUpdated() {
      ut.initializeState(), this.watchTokensAndValues()
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e?.()), clearInterval(this.interval)
    }
    render() {
      return K`
        <wiu-flex flexDirection="column" .padding=${["0","l","l","l"]} gap="s">
          ${this.initialized?this.templateSwap():this.templateLoading()}
        </wiu-flex>
      `
    }
    watchTokensAndValues() {
      this.interval = setInterval(() => {
        ut.getNetworkTokenPrice(), ut.getMyTokensWithBalance(), ut.swapTokens()
      }, 1e4)
    }
    templateSwap() {
      return K`
        <wiu-flex flexDirection="column" gap="s">
          <wiu-flex flexDirection="column" alignItems="center" gap="xs" class="swap-inputs-container">
            ${this.templateTokenInput("sourceToken",this.sourceToken)}
            ${this.templateTokenInput("toToken",this.toToken)} ${this.templateReplaceTokensButton()}
          </wiu-flex>
          ${this.templateDetails()} ${this.templateActionButton()}
        </wiu-flex>
      `
    }
    actionButtonLabel() {
      return this.fetchError ? "Swap" : !this.sourceToken || !this.toToken ? "Select token" : this.sourceTokenAmount ? this.inputError ? this.inputError : "Review swap" : "Enter amount"
    }
    templateReplaceTokensButton() {
      return K`
        <wiu-flex class="replace-tokens-button-container">
          <button @click=${this.onSwitchTokens.bind(this)}>
            <wiu-icon name="recycleHorizontal" color="fg-250" size="lg"></wiu-icon>
          </button>
        </wiu-flex>
      `
    }
    templateLoading() {
      return K`
        <wiu-flex flexDirection="column" gap="l">
          <wiu-flex flexDirection="column" alignItems="center" gap="xs" class="swap-inputs-container">
            <w4m-swap-input-skeleton target="sourceToken"></w4m-swap-input-skeleton>
            <w4m-swap-input-skeleton target="toToken"></w4m-swap-input-skeleton>
            ${this.templateReplaceTokensButton()}
          </wiu-flex>
          ${this.templateActionButton()}
        </wiu-flex>
      `
    }
    templateTokenInput(e, r) {
      const n = ut.state.myTokensWithBalance?.find(a => a?.address === r?.address),
        i = e === "toToken" ? this.toTokenAmount : this.sourceTokenAmount,
        s = e === "toToken" ? this.toTokenPriceInUSD : this.sourceTokenPriceInUSD;
      let o = parseFloat(i) * s;
      return e === "toToken" && (o -= this.gasPriceInUSD || 0), K`<w4m-swap-input
        .value=${e==="toToken"?this.toTokenAmount:this.sourceTokenAmount}
        ?disabled=${this.loadingQuote&&e==="toToken"}
        .onSetAmount=${this.handleChangeAmount.bind(this)}
        target=${e}
        .token=${r}
        .balance=${n?.quantity?.numeric}
        .price=${n?.price}
        .marketValue=${o}
        .onSetMaxValue=${this.onSetMaxValue.bind(this)}
      ></w4m-swap-input>`
    }
    onSetMaxValue(e, r) {
      const i = (e === "sourceToken" ? this.sourceToken : this.toToken)?.address === fe.getActiveNetworkTokenAddress();
      let s = "0";
      if (!r) {
        s = "0", this.handleChangeAmount(e, s);
        return
      }
      if (!this.gasPriceInUSD) {
        s = r, this.handleChangeAmount(e, s);
        return
      }
      const o = Or.bigNumber(this.gasPriceInUSD.toFixed(5)).dividedBy(this.sourceTokenPriceInUSD),
        a = i ? Or.bigNumber(r).minus(o) : Or.bigNumber(r);
      this.handleChangeAmount(e, a.isGreaterThan(0) ? a.toFixed(20) : "0")
    }
    templateDetails() {
      return !this.sourceToken || !this.toToken || this.inputError ? null : K`<w4m-swap-details .detailsOpen=${this.detailsOpen}></w4m-swap-details>`
    }
    handleChangeAmount(e, r) {
      ut.clearError(), e === "sourceToken" ? ut.setSourceTokenAmount(r) : ut.setToTokenAmount(r), this.onDebouncedGetSwapCalldata()
    }
    templateActionButton() {
      const e = !this.toToken || !this.sourceToken,
        r = !this.sourceTokenAmount,
        n = this.loadingQuote || this.loadingPrices || this.loadingTransaction,
        i = n || e || r || this.inputError;
      return K` <wiu-flex gap="xs">
        <wiu-button
          data-testid="swap-action-button"
          class="action-button"
          fullWidth
          size="lg"
          borderRadius="xs"
          variant=${e?"neutral":"main"}
          .loading=${n}
          .disabled=${i}
          @click=${this.onSwapPreview.bind(this)}
        >
          ${this.actionButtonLabel()}
        </wiu-button>
      </wiu-flex>`
    }
    onSwitchTokens() {
      ut.switchTokens()
    }
    onSwapPreview() {
      if (this.fetchError) {
        ut.swapTokens();
        return
      }
      nt.sendEvent({
        type: "track",
        event: "INITIATE_SWAP",
        properties: {
          network: this.caipNetworkId || "",
          swapFromToken: this.sourceToken?.symbol || "",
          swapToToken: this.toToken?.symbol || "",
          swapFromAmount: this.sourceTokenAmount || "",
          swapToAmount: this.toTokenAmount || "",
          isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT
        }
      }), Ae.push("SwapPreview")
    }
  };
  xi.styles = T4e, cs([le()], xi.prototype, "interval", void 0), cs([le()], xi.prototype, "detailsOpen", void 0), cs([le()], xi.prototype, "caipNetworkId", void 0), cs([le()], xi.prototype, "initialized", void 0), cs([le()], xi.prototype, "loadingQuote", void 0), cs([le()], xi.prototype, "loadingPrices", void 0), cs([le()], xi.prototype, "loadingTransaction", void 0), cs([le()], xi.prototype, "sourceToken", void 0), cs([le()], xi.prototype, "sourceTokenAmount", void 0), cs([le()], xi.prototype, "sourceTokenPriceInUSD", void 0), cs([le()], xi.prototype, "toToken", void 0), cs([le()], xi.prototype, "toTokenAmount", void 0), cs([le()], xi.prototype, "toTokenPriceInUSD", void 0), cs([le()], xi.prototype, "inputError", void 0), cs([le()], xi.prototype, "gasPriceInUSD", void 0), cs([le()], xi.prototype, "fetchError", void 0), xi = cs([ye("w4m-swap-view")], xi);
  const k4e = Re`
    @keyframes shake {
      0% {
        transform: translateX(0);
      }
      25% {
        transform: translateX(3px);
      }
      50% {
        transform: translateX(-3px);
      }
      75% {
        transform: translateX(3px);
      }
      100% {
        transform: translateX(0);
      }
    }
  
    wiu-flex:first-child:not(:only-child) {
      position: relative;
    }
  
    wiu-loading-thumbnail {
      position: absolute;
    }
  
    wiu-visual {
      width: var(--wiu-wallet-image-size-lg);
      height: var(--wiu-wallet-image-size-lg);
      border-radius: calc(var(--wiu-border-radius-5xs) * 9 - var(--wiu-border-radius-xxs));
      position: relative;
      overflow: hidden;
    }
  
    wiu-visual::after {
      content: '';
      display: block;
      width: 100%;
      height: 100%;
      position: absolute;
      inset: 0;
      border-radius: calc(var(--wiu-border-radius-5xs) * 9 - var(--wiu-border-radius-xxs));
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-005);
    }
  
    wiu-icon-box {
      position: absolute;
      right: calc(var(--wiu-spacing-3xs) * -1);
      bottom: calc(var(--wiu-spacing-3xs) * -1);
      opacity: 0;
      transform: scale(0.5);
      transition:
        opacity var(--wiu-ease-out-power-2) var(--wiu-duration-lg),
        transform var(--wiu-ease-out-power-2) var(--wiu-duration-lg);
      will-change: opacity, transform;
    }
  
    wiu-text[align='center'] {
      width: 100%;
      padding: 0px var(--wiu-spacing-l);
    }
  
    [data-error='true'] wiu-icon-box {
      opacity: 1;
      transform: scale(1);
    }
  
    [data-error='true'] > wiu-flex:first-child {
      animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    }
  
    [data-retry='false'] wiu-link {
      display: none;
    }
  
    [data-retry='true'] wiu-link {
      display: block;
      opacity: 1;
    }
  
    wiu-link {
      padding: var(--wiu-spacing-4xs) var(--wiu-spacing-xxs);
    }
  
    .capitalize {
      text-transform: capitalize;
    }
  `;
  var zU = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let M4 = class extends _e {
    constructor() {
      super(...arguments), this.unsubscribe = [], this.switchToChain = Ae.state.data?.switchToChain, this.navigateTo = Ae.state.data?.navigateTo, this.navigateWithReplace = Ae.state.data?.navigateWithReplace, this.caipNetwork = Ae.state.data?.network, this.activeChain = fe.state.activeChain
    }
    firstUpdated() {
      this.unsubscribe.push(fe.subscribeKey("activeChain", e => this.activeChain = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      const e = this.switchToChain ? pr.CHAIN_NAME_MAP[this.switchToChain] : "supported";
      if (!this.switchToChain) return null;
      const r = this.switchToChain === "eip155" ? "Ethereum" : this.switchToChain;
      return K`
        <wiu-flex
          flexDirection="column"
          alignItems="center"
          .padding=${["3xl","xl","xl","xl"]}
          gap="xl"
        >
          <wiu-flex justifyContent="center" flexDirection="column" alignItems="center" gap="xl">
            <wiu-visual
              name=${this.switchToChain==="eip155"?"eth":this.switchToChain}
            ></wiu-visual>
            <wiu-text
              data-testid=${`w4m-switch-active-chain-to-${r}`}
              variant="paragraph-500"
              color="fg-100"
              align="center"
              >Switch to <span class="capitalize">${r}</span></wiu-text
            >
            <wiu-text variant="small-400" color="fg-200" align="center">
              Connected wallet doesn't support connecting to ${e} chain. You
              need to connect with a different wallet.
            </wiu-text>
            <wiu-button size="md" @click=${this.switchActiveChain.bind(this)}>Switch</wiu-button>
          </wiu-flex>
        </wiu-flex>
      `
    }
    async switchActiveChain() {
      this.switchToChain && (this.caipNetwork ? await fe.switchActiveNetwork(this.caipNetwork) : fe.setActiveNamespace(this.switchToChain), Ot.close(), Ot.open({
        view: "Connect"
      }))
    }
  };
  M4.styles = k4e, zU([re()], M4.prototype, "activeChain", void 0), M4 = zU([ye("w4m-switch-active-chain-view")], M4);
  const R4e = Re`
    :host > wiu-flex:first-child {
      overflow-y: auto;
      overflow-x: hidden;
      scrollbar-width: none;
    }
  
    :host > wiu-flex:first-child::-webkit-scrollbar {
      display: none;
    }
  
    .preview-container,
    .details-container {
      width: 100%;
    }
  
    .token-image {
      width: 24px;
      height: 24px;
      box-shadow: 0 0 0 2px var(--wiu-color-gray-glass-005);
      border-radius: 12px;
    }
  
    wiu-loading-hexagon {
      position: absolute;
    }
  
    .token-item {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: var(--wiu-spacing-xxs);
      padding: var(--wiu-spacing-xs);
      height: 40px;
      border: none;
      border-radius: 80px;
      background: var(--wiu-color-gray-glass-002);
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-002);
      cursor: pointer;
      transition: background 0.2s linear;
    }
  
    .token-item:hover {
      background: var(--wiu-color-gray-glass-005);
    }
  
    .preview-token-details-container {
      width: 100%;
    }
  
    .details-row {
      width: 100%;
      padding: var(--wiu-spacing-s) var(--wiu-spacing-xl);
      border-radius: var(--wiu-border-radius-xxs);
      background: var(--wiu-color-gray-glass-002);
    }
  
    .action-buttons-container {
      width: 100%;
      gap: var(--wiu-spacing-xs);
    }
  
    .action-buttons-container > button {
      display: flex;
      align-items: center;
      justify-content: center;
      background: transparent;
      height: 48px;
      border-radius: var(--wiu-border-radius-xs);
      border: none;
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-010);
    }
  
    .action-buttons-container > button:disabled {
      opacity: 0.8;
      cursor: not-allowed;
    }
  
    .action-button > wiu-loading-spinner {
      display: inline-block;
    }
  
    .cancel-button:hover,
    .action-button:hover {
      cursor: pointer;
    }
  
    .action-buttons-container > wiu-button.cancel-button {
      flex: 2;
    }
  
    .action-buttons-container > wiu-button.action-button {
      flex: 4;
    }
  
    .action-buttons-container > button.action-button > wiu-text {
      color: white;
    }
  
    .details-container > wiu-flex {
      background: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-xxs);
      width: 100%;
    }
  
    .details-container > wiu-flex > button {
      border: none;
      background: none;
      padding: var(--wiu-spacing-s);
      border-radius: var(--wiu-border-radius-xxs);
      transition: background 0.2s linear;
    }
  
    .details-container > wiu-flex > button:hover {
      background: var(--wiu-color-gray-glass-002);
    }
  
    .details-content-container {
      padding: var(--wiu-spacing-1xs);
      display: flex;
      align-items: center;
      justify-content: center;
    }
  
    .details-content-container > wiu-flex {
      width: 100%;
    }
  
    .details-row {
      width: 100%;
      padding: var(--wiu-spacing-s) var(--wiu-spacing-xl);
      border-radius: var(--wiu-border-radius-xxs);
      background: var(--wiu-color-gray-glass-002);
    }
  `;
  var Ci = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let oi = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.detailsOpen = !0, this.approvalTransaction = ut.state.approvalTransaction, this.swapTransaction = ut.state.swapTransaction, this.sourceToken = ut.state.sourceToken, this.sourceTokenAmount = ut.state.sourceTokenAmount ?? "", this.sourceTokenPriceInUSD = ut.state.sourceTokenPriceInUSD, this.toToken = ut.state.toToken, this.toTokenAmount = ut.state.toTokenAmount ?? "", this.toTokenPriceInUSD = ut.state.toTokenPriceInUSD, this.caipNetwork = fe.state.activeCaipNetwork, this.balanceSymbol = ke.state.balanceSymbol, this.gasPriceInUSD = ut.state.gasPriceInUSD, this.inputError = ut.state.inputError, this.loadingQuote = ut.state.loadingQuote, this.loadingApprovalTransaction = ut.state.loadingApprovalTransaction, this.loadingBuildTransaction = ut.state.loadingBuildTransaction, this.loadingTransaction = ut.state.loadingTransaction, this.unsubscribe.push(ke.subscribeKey("balanceSymbol", e => {
        this.balanceSymbol !== e && Ae.goBack()
      }), fe.subscribeKey("activeCaipNetwork", e => {
        this.caipNetwork !== e && (this.caipNetwork = e)
      }), ut.subscribe(e => {
        this.approvalTransaction = e.approvalTransaction, this.swapTransaction = e.swapTransaction, this.sourceToken = e.sourceToken, this.gasPriceInUSD = e.gasPriceInUSD, this.toToken = e.toToken, this.gasPriceInUSD = e.gasPriceInUSD, this.toTokenPriceInUSD = e.toTokenPriceInUSD, this.sourceTokenAmount = e.sourceTokenAmount ?? "", this.toTokenAmount = e.toTokenAmount ?? "", this.inputError = e.inputError, e.inputError && Ae.goBack(), this.loadingQuote = e.loadingQuote, this.loadingApprovalTransaction = e.loadingApprovalTransaction, this.loadingBuildTransaction = e.loadingBuildTransaction, this.loadingTransaction = e.loadingTransaction
      }))
    }
    firstUpdated() {
      ut.getTransaction(), this.refreshTransaction()
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e?.()), clearInterval(this.interval)
    }
    render() {
      return K`
        <wiu-flex flexDirection="column" .padding=${["0","l","l","l"]} gap="s">
          ${this.templateSwap()}
        </wiu-flex>
      `
    }
    refreshTransaction() {
      this.interval = setInterval(() => {
        ut.getApprovalLoadingState() || ut.getTransaction()
      }, 1e4)
    }
    templateSwap() {
      const e = `${Vt.formatNumberToLocalString(parseFloat(this.sourceTokenAmount))} ${this.sourceToken?.symbol}`,
        r = `${Vt.formatNumberToLocalString(parseFloat(this.toTokenAmount))} ${this.toToken?.symbol}`,
        n = parseFloat(this.sourceTokenAmount) * this.sourceTokenPriceInUSD,
        i = parseFloat(this.toTokenAmount) * this.toTokenPriceInUSD - (this.gasPriceInUSD || 0),
        s = Vt.formatNumberToLocalString(n),
        o = Vt.formatNumberToLocalString(i),
        a = this.loadingQuote || this.loadingBuildTransaction || this.loadingTransaction || this.loadingApprovalTransaction;
      return K`
        <wiu-flex flexDirection="column" alignItems="center" gap="l">
          <wiu-flex class="preview-container" flexDirection="column" alignItems="flex-start" gap="l">
            <wiu-flex
              class="preview-token-details-container"
              alignItems="center"
              justifyContent="space-between"
              gap="l"
            >
              <wiu-flex flexDirection="column" alignItems="flex-start" gap="4xs">
                <wiu-text variant="small-400" color="fg-150">Send</wiu-text>
                <wiu-text variant="paragraph-400" color="fg-100">$${s}</wiu-text>
              </wiu-flex>
              <wiu-token-button
                flexDirection="row-reverse"
                text=${e}
                imageSrc=${this.sourceToken?.logoUri}
              >
              </wiu-token-button>
            </wiu-flex>
            <wiu-icon name="recycleHorizontal" color="fg-200" size="md"></wiu-icon>
            <wiu-flex
              class="preview-token-details-container"
              alignItems="center"
              justifyContent="space-between"
              gap="l"
            >
              <wiu-flex flexDirection="column" alignItems="flex-start" gap="4xs">
                <wiu-text variant="small-400" color="fg-150">Receive</wiu-text>
                <wiu-text variant="paragraph-400" color="fg-100">$${o}</wiu-text>
              </wiu-flex>
              <wiu-token-button
                flexDirection="row-reverse"
                text=${r}
                imageSrc=${this.toToken?.logoUri}
              >
              </wiu-token-button>
            </wiu-flex>
          </wiu-flex>
  
          ${this.templateDetails()}
  
          <wiu-flex flexDirection="row" alignItems="center" justifyContent="center" gap="xs">
            <wiu-icon size="sm" color="fg-200" name="infoCircle"></wiu-icon>
            <wiu-text variant="small-400" color="fg-200">Review transaction carefully</wiu-text>
          </wiu-flex>
  
          <wiu-flex
            class="action-buttons-container"
            flexDirection="row"
            alignItems="center"
            justifyContent="space-between"
            gap="xs"
          >
            <wiu-button
              class="cancel-button"
              fullWidth
              size="lg"
              borderRadius="xs"
              variant="neutral"
              @click=${this.onCancelTransaction.bind(this)}
            >
              <wiu-text variant="paragraph-600" color="fg-200">Cancel</wiu-text>
            </wiu-button>
            <wiu-button
              class="action-button"
              fullWidth
              size="lg"
              borderRadius="xs"
              variant="main"
              ?loading=${a}
              ?disabled=${a}
              @click=${this.onSendTransaction.bind(this)}
            >
              <wiu-text variant="paragraph-600" color="inverse-100">
                ${this.actionButtonLabel()}
              </wiu-text>
            </wiu-button>
          </wiu-flex>
        </wiu-flex>
      `
    }
    templateDetails() {
      return !this.sourceToken || !this.toToken || this.inputError ? null : K`<w4m-swap-details .detailsOpen=${this.detailsOpen}></w4m-swap-details>`
    }
    actionButtonLabel() {
      return this.loadingApprovalTransaction ? "Approving..." : this.approvalTransaction ? "Approve" : "Swap"
    }
    onCancelTransaction() {
      Ae.goBack()
    }
    onSendTransaction() {
      this.approvalTransaction ? ut.sendTransactionForApproval(this.approvalTransaction) : ut.sendTransactionForSwap(this.swapTransaction)
    }
  };
  oi.styles = R4e, Ci([le()], oi.prototype, "interval", void 0), Ci([le()], oi.prototype, "detailsOpen", void 0), Ci([le()], oi.prototype, "approvalTransaction", void 0), Ci([le()], oi.prototype, "swapTransaction", void 0), Ci([le()], oi.prototype, "sourceToken", void 0), Ci([le()], oi.prototype, "sourceTokenAmount", void 0), Ci([le()], oi.prototype, "sourceTokenPriceInUSD", void 0), Ci([le()], oi.prototype, "toToken", void 0), Ci([le()], oi.prototype, "toTokenAmount", void 0), Ci([le()], oi.prototype, "toTokenPriceInUSD", void 0), Ci([le()], oi.prototype, "caipNetwork", void 0), Ci([le()], oi.prototype, "balanceSymbol", void 0), Ci([le()], oi.prototype, "gasPriceInUSD", void 0), Ci([le()], oi.prototype, "inputError", void 0), Ci([le()], oi.prototype, "loadingQuote", void 0), Ci([le()], oi.prototype, "loadingApprovalTransaction", void 0), Ci([le()], oi.prototype, "loadingBuildTransaction", void 0), Ci([le()], oi.prototype, "loadingTransaction", void 0), oi = Ci([ye("w4m-swap-preview-view")], oi);
  const N4e = Re`
    :host {
      --tokens-scroll--top-opacity: 0;
      --tokens-scroll--bottom-opacity: 1;
      --suggested-tokens-scroll--left-opacity: 0;
      --suggested-tokens-scroll--right-opacity: 1;
    }
  
    :host > wiu-flex:first-child {
      overflow-y: hidden;
      overflow-x: hidden;
      scrollbar-width: none;
      scrollbar-height: none;
    }
  
    :host > wiu-flex:first-child::-webkit-scrollbar {
      display: none;
    }
  
    wiu-loading-hexagon {
      position: absolute;
    }
  
    .suggested-tokens-container {
      overflow-x: auto;
      mask-image: linear-gradient(
        to right,
        rgba(0, 0, 0, calc(1 - var(--suggested-tokens-scroll--left-opacity))) 0px,
        rgba(200, 200, 200, calc(1 - var(--suggested-tokens-scroll--left-opacity))) 1px,
        black 50px,
        black 90px,
        black calc(100% - 90px),
        black calc(100% - 50px),
        rgba(155, 155, 155, calc(1 - var(--suggested-tokens-scroll--right-opacity))) calc(100% - 1px),
        rgba(0, 0, 0, calc(1 - var(--suggested-tokens-scroll--right-opacity))) 100%
      );
    }
  
    .suggested-tokens-container::-webkit-scrollbar {
      display: none;
    }
  
    .tokens-container {
      border-top: 1px solid var(--wiu-color-gray-glass-005);
      height: 100%;
      max-height: 390px;
    }
  
    .tokens {
      width: 100%;
      overflow-y: auto;
      mask-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, calc(1 - var(--tokens-scroll--top-opacity))) 0px,
        rgba(200, 200, 200, calc(1 - var(--tokens-scroll--top-opacity))) 1px,
        black 50px,
        black 90px,
        black calc(100% - 90px),
        black calc(100% - 50px),
        rgba(155, 155, 155, calc(1 - var(--tokens-scroll--bottom-opacity))) calc(100% - 1px),
        rgba(0, 0, 0, calc(1 - var(--tokens-scroll--bottom-opacity))) 100%
      );
    }
  
    .network-search-input,
    .select-network-button {
      height: 40px;
    }
  
    .select-network-button {
      border: none;
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: center;
      gap: var(--wiu-spacing-xs);
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-005);
      background-color: transparent;
      border-radius: var(--wiu-border-radius-xxs);
      padding: var(--wiu-spacing-xs);
      align-items: center;
      transition: background-color 0.2s linear;
    }
  
    .select-network-button:hover {
      background-color: var(--wiu-color-gray-glass-002);
    }
  
    .select-network-button > wiu-image {
      width: 26px;
      height: 26px;
      border-radius: var(--wiu-border-radius-xs);
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-010);
    }
  `;
  var id = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Nc = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.targetToken = Ae.state.data?.target, this.sourceToken = ut.state.sourceToken, this.sourceTokenAmount = ut.state.sourceTokenAmount, this.toToken = ut.state.toToken, this.myTokensWithBalance = ut.state.myTokensWithBalance, this.popularTokens = ut.state.popularTokens, this.searchValue = "", this.unsubscribe.push(ut.subscribe(e => {
        this.sourceToken = e.sourceToken, this.toToken = e.toToken, this.myTokensWithBalance = e.myTokensWithBalance
      }))
    }
    updated() {
      this.renderRoot?.querySelector(".suggested-tokens-container")?.addEventListener("scroll", this.handleSuggestedTokensScroll.bind(this)), this.renderRoot?.querySelector(".tokens")?.addEventListener("scroll", this.handleTokenListScroll.bind(this))
    }
    disconnectedCallback() {
      super.disconnectedCallback();
      const e = this.renderRoot?.querySelector(".suggested-tokens-container"),
        r = this.renderRoot?.querySelector(".tokens");
      e?.removeEventListener("scroll", this.handleSuggestedTokensScroll.bind(this)), r?.removeEventListener("scroll", this.handleTokenListScroll.bind(this)), clearInterval(this.interval)
    }
    render() {
      return K`
        <wiu-flex flexDirection="column" gap="s">
          ${this.templateSearchInput()} ${this.templateSuggestedTokens()} ${this.templateTokens()}
        </wiu-flex>
      `
    }
    onSelectToken(e) {
      this.targetToken === "sourceToken" ? ut.setSourceToken(e) : (ut.setToToken(e), this.sourceToken && this.sourceTokenAmount && ut.swapTokens()), Ae.goBack()
    }
    templateSearchInput() {
      return K`
        <wiu-flex .padding=${["3xs","s","0","s"]} gap="xs">
          <wiu-input-text
            data-testid="swap-select-token-search-input"
            class="network-search-input"
            size="sm"
            placeholder="Search token"
            icon="search"
            .value=${this.searchValue}
            @inputChange=${this.onSearchInputChange.bind(this)}
          ></wiu-input-text>
        </wiu-flex>
      `
    }
    templateTokens() {
      const e = this.myTokensWithBalance ? Object.values(this.myTokensWithBalance) : [],
        r = this.popularTokens ? this.popularTokens : [],
        n = this.filterTokensWithText(e, this.searchValue),
        i = this.filterTokensWithText(r, this.searchValue);
      return K`
        <wiu-flex class="tokens-container">
          <wiu-flex class="tokens" .padding=${["0","s","s","s"]} flexDirection="column">
            ${n?.length>0?K`
                  <wiu-flex justifyContent="flex-start" padding="s">
                    <wiu-text variant="paragraph-500" color="fg-200">Your tokens</wiu-text>
                  </wiu-flex>
                  ${n.map(s=>{const o=s.symbol===this.sourceToken?.symbol||s.symbol===this.toToken?.symbol;return K`
                      <wiu-token-list-item
                        data-testid="swap-select-token-item-${s.symbol}"
                        name=${s.name}
                        ?disabled=${o}
                        symbol=${s.symbol}
                        price=${s?.price}
                        amount=${s?.quantity?.numeric}
                        imageSrc=${s.logoUri}
                        @click=${()=>{o||this.onSelectToken(s)}}
                      >
                      </wiu-token-list-item>
                    `})}
                `:null}
  
            <wiu-flex justifyContent="flex-start" padding="s">
              <wiu-text variant="paragraph-500" color="fg-200">Tokens</wiu-text>
            </wiu-flex>
            ${i?.length>0?i.map(s=>K`
                    <wiu-token-list-item
                      data-testid="swap-select-token-item-${s.symbol}"
                      name=${s.name}
                      symbol=${s.symbol}
                      imageSrc=${s.logoUri}
                      @click=${()=>this.onSelectToken(s)}
                    >
                    </wiu-token-list-item>
                  `):null}
          </wiu-flex>
        </wiu-flex>
      `
    }
    templateSuggestedTokens() {
      const e = ut.state.suggestedTokens ? ut.state.suggestedTokens.slice(0, 8) : null;
      return e ? K`
        <wiu-flex class="suggested-tokens-container" .padding=${["0","s","0","s"]} gap="xs">
          ${e.map(r=>K`
              <wiu-token-button
                text=${r.symbol}
                imageSrc=${r.logoUri}
                @click=${()=>this.onSelectToken(r)}
              >
              </wiu-token-button>
            `)}
        </wiu-flex>
      ` : null
    }
    onSearchInputChange(e) {
      this.searchValue = e.detail
    }
    handleSuggestedTokensScroll() {
      const e = this.renderRoot?.querySelector(".suggested-tokens-container");
      e && (e.style.setProperty("--suggested-tokens-scroll--left-opacity", c0.interpolate([0, 100], [0, 1], e.scrollLeft).toString()), e.style.setProperty("--suggested-tokens-scroll--right-opacity", c0.interpolate([0, 100], [0, 1], e.scrollWidth - e.scrollLeft - e.offsetWidth).toString()))
    }
    handleTokenListScroll() {
      const e = this.renderRoot?.querySelector(".tokens");
      e && (e.style.setProperty("--tokens-scroll--top-opacity", c0.interpolate([0, 100], [0, 1], e.scrollTop).toString()), e.style.setProperty("--tokens-scroll--bottom-opacity", c0.interpolate([0, 100], [0, 1], e.scrollHeight - e.scrollTop - e.offsetHeight).toString()))
    }
    filterTokensWithText(e, r) {
      return e.filter(n => `${n.symbol} ${n.name} ${n.address}`.toLowerCase().includes(r.toLowerCase()))
    }
  };
  Nc.styles = N4e, id([le()], Nc.prototype, "interval", void 0), id([le()], Nc.prototype, "targetToken", void 0), id([le()], Nc.prototype, "sourceToken", void 0), id([le()], Nc.prototype, "sourceTokenAmount", void 0), id([le()], Nc.prototype, "toToken", void 0), id([le()], Nc.prototype, "myTokensWithBalance", void 0), id([le()], Nc.prototype, "popularTokens", void 0), id([le()], Nc.prototype, "searchValue", void 0), Nc = id([ye("w4m-swap-select-token-view")], Nc);
  const M4e = Re`
    :host > wiu-flex:first-child {
      height: 500px;
      overflow-y: auto;
      overflow-x: hidden;
      scrollbar-width: none;
    }
  
    :host > wiu-flex:first-child::-webkit-scrollbar {
      display: none;
    }
  `;
  var P4e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let HE = class extends _e {
    render() {
      return K`
        <wiu-flex flexDirection="column" .padding=${["0","m","m","m"]} gap="s">
          <w4m-activity-list page="activity"></w4m-activity-list>
        </wiu-flex>
      `
    }
  };
  HE.styles = M4e, HE = P4e([ye("w4m-transactions-view")], HE);
  var $4e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const O4e = [{
    images: ["network", "layers", "system"],
    title: "The system’s nuts and bolts",
    text: "A network is what brings the blockchain to life, as this technical infrastructure allows apps to access the ledger and smart contract services."
  }, {
    images: ["noun", "defiAlt", "dao"],
    title: "Designed for different uses",
    text: "Each network is designed differently, and may therefore suit certain apps and experiences."
  }];
  let HU = class extends _e {
    render() {
      return K`
        <wiu-flex
          flexDirection="column"
          .padding=${["xxl","xl","xl","xl"]}
          alignItems="center"
          gap="xl"
        >
          <w4m-help-widget .data=${O4e}></w4m-help-widget>
          <wiu-button
            variant="main"
            size="md"
            @click=${()=>{je.openHref("https://ethereum.org/en/developers/docs/networks/","_blank")}}
          >
            Learn more
            <wiu-icon color="inherit" slot="iconRight" name="externalLink"></wiu-icon>
          </wiu-button>
        </wiu-flex>
      `
    }
  };
  HU = $4e([ye("w4m-what-is-a-network-view")], HU);
  var D4e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const L4e = [{
    images: ["login", "profile", "lock"],
    title: "One login for all of web3",
    text: "Log in to any app by connecting your wallet. Say goodbye to countless passwords!"
  }, {
    images: ["defi", "nft", "eth"],
    title: "A home for your digital assets",
    text: "A wallet lets you store, send and receive digital assets like cryptocurrencies and NFTs."
  }, {
    images: ["browser", "noun", "dao"],
    title: "Your gateway to a new web",
    text: "With your wallet, you can explore and interact with DeFi, NFTs, DAOs, and much more."
  }];
  let qU = class extends _e {
    render() {
      return K`
        <wiu-flex
          flexDirection="column"
          .padding=${["xxl","xl","xl","xl"]}
          alignItems="center"
          gap="xl"
        >
          <w4m-help-widget .data=${L4e}></w4m-help-widget>
          <wiu-button variant="main" size="md" @click=${this.onGetWallet.bind(this)}>
            <wiu-icon color="inherit" slot="iconLeft" name="wallet"></wiu-icon>
            Get a wallet
          </wiu-button>
        </wiu-flex>
      `
    }
    onGetWallet() {
      nt.sendEvent({
        type: "track",
        event: "CLICK_GET_WALLET"
      }), Ae.push("GetWallet")
    }
  };
  qU = D4e([ye("w4m-what-is-a-wallet-view")], qU);
  var B4e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let VU = class extends _e {
    render() {
      return K`
        <wiu-flex
          flexDirection="column"
          .padding=${["xxl","3xl","xl","3xl"]}
          alignItems="center"
          gap="xl"
        >
          <wiu-visual name="onrampCard"></wiu-visual>
          <wiu-flex flexDirection="column" gap="xs" alignItems="center">
            <wiu-text align="center" variant="paragraph-500" color="fg-100">
              Quickly and easily buy digital assets!
            </wiu-text>
            <wiu-text align="center" variant="small-400" color="fg-200">
              Simply select your preferred onramp provider and add digital assets to your account
              using your credit card or bank transfer
            </wiu-text>
          </wiu-flex>
          <wiu-button @click=${Ae.goBack}>
            <wiu-icon size="sm" color="inherit" name="add" slot="iconLeft"></wiu-icon>
            Buy
          </wiu-button>
        </wiu-flex>
      `
    }
  };
  VU = B4e([ye("w4m-what-is-a-buy-view")], VU);
  const U4e = Re`
    wiu-loading-spinner {
      margin: 9px auto;
    }
  
    .email-display,
    .email-display wiu-text {
      max-width: 100%;
    }
  `;
  var P4 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const j4e = 6;
  let sd = class extends _e {
    firstUpdated() {
      this.startOTPTimeout()
    }
    disconnectedCallback() {
      clearTimeout(this.OTPTimeout)
    }
    constructor() {
      super(), this.loading = !1, this.timeoutTimeLeft = vs.getTimeToNextEmailLogin(), this.error = "", this.otp = "", this.email = Ae.state.data?.email, this.authConnector = Tt.getAuthConnector()
    }
    render() {
      if (!this.email) throw new Error("w4m-email-otp-widget: No email provided");
      const e = !!this.timeoutTimeLeft,
        r = this.getFooterLabels(e);
      return K`
        <wiu-flex
          flexDirection="column"
          alignItems="center"
          .padding=${["l","0","l","0"]}
          gap="l"
        >
          <wiu-flex
            class="email-display"
            flexDirection="column"
            alignItems="center"
            .padding=${["0","xl","0","xl"]}
          >
            <wiu-text variant="paragraph-400" color="fg-100" align="center">
              Enter the code we sent to
            </wiu-text>
            <wiu-text variant="paragraph-500" color="fg-100" lineClamp="1" align="center">
              ${this.email}
            </wiu-text>
          </wiu-flex>
  
          <wiu-text variant="small-400" color="fg-200">The code expires in 20 minutes</wiu-text>
  
          ${this.loading?K`<wiu-loading-spinner size="xl" color="accent-100"></wiu-loading-spinner>`:K` <wiu-flex flexDirection="column" alignItems="center" gap="xs">
                <wiu-otp
                  dissabled
                  length="6"
                  @inputChange=${this.onOtpInputChange.bind(this)}
                  .otp=${this.otp}
                ></wiu-otp>
                ${this.error?K`
                      <wiu-text variant="small-400" align="center" color="error-100">
                        ${this.error}. Try Again
                      </wiu-text>
                    `:null}
              </wiu-flex>`}
  
          <wiu-flex alignItems="center" gap="xs">
            <wiu-text variant="small-400" color="fg-200">${r.title}</wiu-text>
            <wiu-link @click=${this.onResendCode.bind(this)} .disabled=${e}>
              ${r.action}
            </wiu-link>
          </wiu-flex>
        </wiu-flex>
      `
    }
    startOTPTimeout() {
      this.timeoutTimeLeft = vs.getTimeToNextEmailLogin(), this.OTPTimeout = setInterval(() => {
        this.timeoutTimeLeft > 0 ? this.timeoutTimeLeft = vs.getTimeToNextEmailLogin() : clearInterval(this.OTPTimeout)
      }, 1e3)
    }
    async onOtpInputChange(e) {
      try {
        this.loading || (this.otp = e.detail, this.authConnector && this.otp.length === j4e && (this.loading = !0, await this.onOtpSubmit?.(this.otp)))
      } catch (r) {
        this.error = je.parseError(r), this.loading = !1
      }
    }
    async onResendCode() {
      try {
        if (this.onOtpResend) {
          if (!this.loading && !this.timeoutTimeLeft) {
            if (this.error = "", this.otp = "", !Tt.getAuthConnector() || !this.email) throw new Error("w4m-email-otp-widget: Unable to resend email");
            this.loading = !0, await this.onOtpResend(this.email), this.startOTPTimeout(), Rt.showSuccess("Code email resent")
          }
        } else this.onStartOver && this.onStartOver()
      } catch (e) {
        Rt.showError(e)
      } finally {
        this.loading = !1
      }
    }
    getFooterLabels(e) {
      return this.onStartOver ? {
        title: "Something wrong?",
        action: `Try again ${e?`in ${this.timeoutTimeLeft}s`:""}`
      } : {
        title: "Didn't receive it?",
        action: `Resend ${e?`in ${this.timeoutTimeLeft}s`:"Code"}`
      }
    }
  };
  sd.styles = U4e, P4([le()], sd.prototype, "loading", void 0), P4([le()], sd.prototype, "timeoutTimeLeft", void 0), P4([le()], sd.prototype, "error", void 0), sd = P4([ye("w4m-email-otp-widget")], sd);
  var F4e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let KU = class extends sd {
    constructor() {
      super(...arguments), this.onOtpSubmit = async e => {
        try {
          if (this.authConnector) {
            if (await this.authConnector.provider.connectOtp({
                otp: e
              }), nt.sendEvent({
                type: "track",
                event: "EMAIL_VERIFICATION_CODE_PASS"
              }), fe.state.activeChain) await Kt.connectExternal(this.authConnector, fe.state.activeChain);
            else throw new Error("Active chain is not set on ChainControll");
            nt.sendEvent({
              type: "track",
              event: "CONNECT_SUCCESS",
              properties: {
                method: "email",
                name: this.authConnector.name || "Unknown"
              }
            }), Ue.state.isSiweEnabled || Ot.close()
          }
        } catch (r) {
          throw nt.sendEvent({
            type: "track",
            event: "EMAIL_VERIFICATION_CODE_FAIL"
          }), r
        }
      }, this.onOtpResend = async e => {
        this.authConnector && (await this.authConnector.provider.connectEmail({
          email: e
        }), nt.sendEvent({
          type: "track",
          event: "EMAIL_VERIFICATION_CODE_SENT"
        }))
      }
    }
  };
  KU = F4e([ye("w4m-email-verify-otp-view")], KU);
  const W4e = Re`
    wiu-icon-box {
      height: var(--wiu-icon-box-size-xl);
      width: var(--wiu-icon-box-size-xl);
    }
  `;
  var GU = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let $4 = class extends _e {
    constructor() {
      super(), this.email = Ae.state.data?.email, this.authConnector = Tt.getAuthConnector(), this.loading = !1, this.listenForDeviceApproval()
    }
    render() {
      if (!this.email) throw new Error("w4m-email-verify-device-view: No email provided");
      if (!this.authConnector) throw new Error("w4m-email-verify-device-view: No auth connector provided");
      return K`
        <wiu-flex
          flexDirection="column"
          alignItems="center"
          .padding=${["xxl","s","xxl","s"]}
          gap="l"
        >
          <wiu-icon-box
            size="xl"
            iconcolor="accent-100"
            backgroundcolor="accent-100"
            icon="verify"
            background="opaque"
          ></wiu-icon-box>
  
          <wiu-flex flexDirection="column" alignItems="center" gap="s">
            <wiu-flex flexDirection="column" alignItems="center">
              <wiu-text variant="paragraph-400" color="fg-100">
                Approve the login link we sent to
              </wiu-text>
              <wiu-text variant="paragraph-400" color="fg-100"><b>${this.email}</b></wiu-text>
            </wiu-flex>
  
            <wiu-text variant="small-400" color="fg-200" align="center">
              The code expires in 20 minutes
            </wiu-text>
  
            <wiu-flex alignItems="center" id="w4m-resend-section" gap="xs">
              <wiu-text variant="small-400" color="fg-100" align="center">
                Didn't receive it?
              </wiu-text>
              <wiu-link @click=${this.onResendCode.bind(this)} .disabled=${this.loading}>
                Resend email
              </wiu-link>
            </wiu-flex>
          </wiu-flex>
        </wiu-flex>
      `
    }
    async listenForDeviceApproval() {
      if (this.authConnector) try {
        await this.authConnector.provider.connectDevice(), nt.sendEvent({
          type: "track",
          event: "DEVICE_REGISTERED_FOR_EMAIL"
        }), nt.sendEvent({
          type: "track",
          event: "EMAIL_VERIFICATION_CODE_SENT"
        }), Ae.replace("EmailVerifyOtp", {
          email: this.email
        })
      } catch {
        Ae.goBack()
      }
    }
    async onResendCode() {
      try {
        if (!this.loading) {
          if (!this.authConnector || !this.email) throw new Error("w4m-email-login-widget: Unable to resend email");
          this.loading = !0, await this.authConnector.provider.connectEmail({
            email: this.email
          }), this.listenForDeviceApproval(), Rt.showSuccess("Code email resent")
        }
      } catch (e) {
        Rt.showError(e)
      } finally {
        this.loading = !1
      }
    }
  };
  $4.styles = W4e, GU([le()], $4.prototype, "loading", void 0), $4 = GU([ye("w4m-email-verify-device-view")], $4);
  const z4e = Re`
    div {
      width: 100%;
    }
  
    [data-ready='false'] {
      transform: scale(1.05);
    }
  
    @media (max-width: 430px) {
      [data-ready='false'] {
        transform: translateY(-50px);
      }
    }
  `;
  var ZU = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const qE = 600,
    YU = 360,
    H4e = 64;
  let O4 = class extends _e {
    constructor() {
      super(), this.bodyObserver = void 0, this.unsubscribe = [], this.iframe = document.getElementById("w4m-iframe"), this.ready = !1, this.unsubscribe.push(Ot.subscribeKey("open", e => {
        e || (this.onHideIframe(), Ae.popTransactionStack())
      }), Ot.subscribeKey("shake", e => {
        e ? this.iframe.style.animation = "w4m-shake 500ms var(--wiu-ease-out-power-2)" : this.iframe.style.animation = "none"
      }))
    }
    disconnectedCallback() {
      this.onHideIframe(), this.unsubscribe.forEach(e => e()), this.bodyObserver?.unobserve(window.document.body)
    }
    async firstUpdated() {
      await this.syncTheme(), this.iframe.style.display = "block";
      const e = this?.renderRoot?.querySelector("div");
      this.bodyObserver = new ResizeObserver(r => {
        const i = r?.[0]?.contentBoxSize?.[0]?.inlineSize;
        this.iframe.style.height = `${qE}px`, e.style.height = `${qE}px`, i && i <= 430 ? (this.iframe.style.width = "100%", this.iframe.style.left = "0px", this.iframe.style.bottom = "0px", this.iframe.style.top = "unset") : (this.iframe.style.width = `${YU}px`, this.iframe.style.left = `calc(50% - ${YU/2}px)`, this.iframe.style.top = `calc(50% - ${qE/2}px + ${H4e/2}px)`, this.iframe.style.bottom = "unset"), this.ready = !0, this.onShowIframe()
      }), this.bodyObserver.observe(window.document.body)
    }
    render() {
      return K`<div data-ready=${this.ready} id="w4m-frame-container"></div>`
    }
    onShowIframe() {
      const e = window.innerWidth <= 430;
      this.iframe.style.animation = e ? "w4m-iframe-zoom-in-mobile 200ms var(--wiu-ease-out-power-2)" : "w4m-iframe-zoom-in 200ms var(--wiu-ease-out-power-2)"
    }
    onHideIframe() {
      this.iframe.style.display = "none", this.iframe.style.animation = "w4m-iframe-fade-out 200ms var(--wiu-ease-out-power-2)"
    }
    async syncTheme() {
      const e = Tt.getAuthConnector();
      if (e) {
        const r = Sn.getSnapshot().themeMode,
          n = Sn.getSnapshot().themeVariables;
        await e.provider.syncTheme({
          themeVariables: n,
          w3mThemeVariables: Tu(n, r)
        })
      }
    }
  };
  O4.styles = z4e, ZU([le()], O4.prototype, "ready", void 0), O4 = ZU([ye("w4m-approve-transaction-view")], O4);
  var q4e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let QU = class extends _e {
    render() {
      return K`
        <wiu-flex flexDirection="column" alignItems="center" gap="xl" padding="xl">
          <wiu-text variant="paragraph-400" color="fg-100">Follow the instructions on</wiu-text>
          <wiu-chip
            icon="externalLink"
            variant="fill"
            href=${Qr.SECURE_SITE_DASHBOARD}
            imageSrc=${Qr.SECURE_SITE_FAVICON}
            data-testid="w4m-secure-website-button"
          >
          </wiu-chip>
          <wiu-text variant="small-400" color="fg-200">
            You will have to reconnect for security reasons
          </wiu-text>
        </wiu-flex>
      `
    }
  };
  QU = q4e([ye("w4m-upgrade-wallet-view")], QU);
  var VE = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let D4 = class extends _e {
    constructor() {
      super(...arguments), this.authConnector = Tt.getAuthConnector(), this.loading = !1, this.setPreferSmartAccount = async () => {
        if (this.authConnector) try {
          this.loading = !0, await Kt.setPreferredAccountType(nr.ACCOUNT_TYPES.SMART_ACCOUNT), this.loading = !1, Ae.push("Account")
        } catch {
          Rt.showError("Error upgrading to smart account")
        }
      }
    }
    render() {
      return K`
        <wiu-flex
          flexDirection="column"
          alignItems="center"
          gap="xxl"
          .padding=${["0","0","l","0"]}
        >
          ${this.onboardingTemplate()} ${this.buttonsTemplate()}
          <wiu-link
            @click=${()=>{je.openHref(B9.URLS.FAQ,"_blank")}}
          >
            Learn more
            <wiu-icon color="inherit" slot="iconRight" name="externalLink"></wiu-icon>
          </wiu-link>
        </wiu-flex>
      `
    }
    onboardingTemplate() {
      return K` <wiu-flex
        flexDirection="column"
        gap="xxl"
        alignItems="center"
        .padding=${["0","xxl","0","xxl"]}
      >
        <wiu-flex gap="s" alignItems="center" justifyContent="center">
          <wiu-visual name="google"></wiu-visual>
          <wiu-visual name="pencil"></wiu-visual>
          <wiu-visual name="lightbulb"></wiu-visual>
        </wiu-flex>
        <wiu-flex flexDirection="column" alignItems="center" gap="s">
          <wiu-text align="center" variant="medium-600" color="fg-100">
            Discover Smart Accounts
          </wiu-text>
          <wiu-text align="center" variant="paragraph-400" color="fg-100">
            Access advanced features such as username, social login, improved security and a smoother
            user experience!
          </wiu-text>
        </wiu-flex>
      </wiu-flex>`
    }
    buttonsTemplate() {
      return K`<wiu-flex .padding=${["0","2l","0","2l"]} gap="s">
        <wiu-button
          variant="accent"
          @click=${this.redirectToAccount.bind(this)}
          size="lg"
          borderRadius="xs"
        >
          Do it later
        </wiu-button>
        <wiu-button
          .loading=${this.loading}
          size="lg"
          borderRadius="xs"
          @click=${this.setPreferSmartAccount.bind(this)}
          >Continue
        </wiu-button>
      </wiu-flex>`
    }
    redirectToAccount() {
      Ae.push("Account")
    }
  };
  VE([le()], D4.prototype, "authConnector", void 0), VE([le()], D4.prototype, "loading", void 0), D4 = VE([ye("w4m-upgrade-to-smart-account-view")], D4);
  const V4e = Re`
    wiu-email-input {
      width: 100%;
    }
  
    form {
      width: 100%;
      display: block;
      position: relative;
    }
  `;
  var KE = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Ov = class extends _e {
    constructor() {
      super(...arguments), this.formRef = cl(), this.initialEmail = Ae.state.data?.email ?? "", this.email = "", this.loading = !1
    }
    firstUpdated() {
      this.formRef.value?.addEventListener("keydown", e => {
        e.key === "Enter" && this.onSubmitEmail(e)
      })
    }
    render() {
      const e = !this.loading && this.email.length > 3 && this.email !== this.initialEmail;
      return K`
        <wiu-flex flexDirection="column" padding="m" gap="m">
          <form ${ll(this.formRef)} @submit=${this.onSubmitEmail.bind(this)}>
            <wiu-email-input
              value=${this.initialEmail}
              .disabled=${this.loading}
              @inputChange=${this.onEmailInputChange.bind(this)}
            >
            </wiu-email-input>
            <input type="submit" hidden />
          </form>
  
          <wiu-flex gap="s">
            <wiu-button size="md" variant="neutral" fullWidth @click=${Ae.goBack}>
              Cancel
            </wiu-button>
  
            <wiu-button
              size="md"
              variant="main"
              fullWidth
              @click=${this.onSubmitEmail.bind(this)}
              .disabled=${!e}
              .loading=${this.loading}
            >
              Save
            </wiu-button>
          </wiu-flex>
        </wiu-flex>
      `
    }
    onEmailInputChange(e) {
      this.email = e.detail
    }
    async onSubmitEmail(e) {
      try {
        if (this.loading) return;
        this.loading = !0, e.preventDefault();
        const r = Tt.getAuthConnector();
        if (!r) throw new Error("w4m-update-email-wallet: Auth connector not found");
        const n = await r.provider.updateEmail({
          email: this.email
        });
        nt.sendEvent({
          type: "track",
          event: "EMAIL_EDIT"
        }), n.action === "VERIFY_SECONDARY_OTP" ? Ae.push("UpdateEmailSecondaryOtp", {
          email: this.initialEmail,
          newEmail: this.email
        }) : Ae.push("UpdateEmailPrimaryOtp", {
          email: this.initialEmail,
          newEmail: this.email
        })
      } catch (r) {
        Rt.showError(r), this.loading = !1
      }
    }
  };
  Ov.styles = V4e, KE([le()], Ov.prototype, "email", void 0), KE([le()], Ov.prototype, "loading", void 0), Ov = KE([ye("w4m-update-email-wallet-view")], Ov);
  var K4e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let JU = class extends sd {
    constructor() {
      super(), this.email = Ae.state.data?.email, this.onOtpSubmit = async e => {
        try {
          this.authConnector && (await this.authConnector.provider.updateEmailPrimaryOtp({
            otp: e
          }), nt.sendEvent({
            type: "track",
            event: "EMAIL_VERIFICATION_CODE_PASS"
          }), Ae.replace("UpdateEmailSecondaryOtp", Ae.state.data))
        } catch (r) {
          throw nt.sendEvent({
            type: "track",
            event: "EMAIL_VERIFICATION_CODE_FAIL"
          }), r
        }
      }, this.onStartOver = () => {
        Ae.replace("UpdateEmailWallet", Ae.state.data)
      }
    }
  };
  JU = K4e([ye("w4m-update-email-primary-otp-view")], JU);
  var G4e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let XU = class extends sd {
    constructor() {
      super(), this.email = Ae.state.data?.newEmail, this.onOtpSubmit = async e => {
        try {
          this.authConnector && (await this.authConnector.provider.updateEmailSecondaryOtp({
            otp: e
          }), nt.sendEvent({
            type: "track",
            event: "EMAIL_VERIFICATION_CODE_PASS"
          }), Ae.reset("Account"))
        } catch (r) {
          throw nt.sendEvent({
            type: "track",
            event: "EMAIL_VERIFICATION_CODE_FAIL"
          }), r
        }
      }, this.onStartOver = () => {
        Ae.replace("UpdateEmailWallet", Ae.state.data)
      }
    }
  };
  XU = G4e([ye("w4m-update-email-secondary-otp-view")], XU);
  const Z4e = Re`
    :host > wiu-flex {
      max-height: clamp(360px, 540px, 80vh);
      overflow: scroll;
      scrollbar-width: none;
    }
  
    :host > wiu-flex::-webkit-scrollbar {
      display: none;
    }
  `;
  var ej = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let L4 = class extends _e {
    constructor() {
      super(...arguments), this.swapUnsupportedChain = Ae.state.data?.swapUnsupportedChain, this.disconecting = !1
    }
    render() {
      return K`
        <wiu-flex class="container" flexDirection="column" gap="0">
          <wiu-flex
            class="container"
            flexDirection="column"
            .padding=${["m","xl","xs","xl"]}
            alignItems="center"
            gap="xl"
          >
            ${this.descriptionTemplate()}
          </wiu-flex>
  
          <wiu-flex flexDirection="column" padding="s" gap="xs">
            ${this.networksTemplate()}
          </wiu-flex>
  
          <wiu-separator text="or"></wiu-separator>
          <wiu-flex flexDirection="column" padding="s" gap="xs">
            <wiu-list-item
              variant="icon"
              iconVariant="overlay"
              icon="disconnect"
              ?chevron=${!1}
              .loading=${this.disconecting}
              @click=${this.onDisconnect.bind(this)}
              data-testid="disconnect-button"
            >
              <wiu-text variant="paragraph-500" color="fg-200">Disconnect</wiu-text>
            </wiu-list-item>
          </wiu-flex>
        </wiu-flex>
      `
    }
    descriptionTemplate() {
      return this.swapUnsupportedChain ? K`
          <wiu-text variant="small-400" color="fg-200" align="center">
            The swap feature doesn’t support your current network. Switch to an available option to
            continue.
          </wiu-text>
        ` : K`
        <wiu-text variant="small-400" color="fg-200" align="center">
          This app doesn’t support your current network. Switch to an available option to continue.
        </wiu-text>
      `
    }
    networksTemplate() {
      const e = fe.getAllRequestedCaipNetworks(),
        r = fe.getAllApprovedCaipNetworkIds(),
        n = je.sortRequestedNetworks(r, e);
      return (this.swapUnsupportedChain ? n.filter(s => Qr.SWAP_SUPPORTED_NETWORKS.includes(s.caipNetworkId)) : n).map(s => K`
          <wiu-list-network
            imageSrc=${$e(Rr.getNetworkImage(s))}
            name=${s.name??"Unknown"}
            @click=${()=>this.onSwitchNetwork(s)}
          >
          </wiu-list-network>
        `)
    }
    async onDisconnect() {
      try {
        this.disconecting = !0, await Kt.disconnect(), nt.sendEvent({
          type: "track",
          event: "DISCONNECT_SUCCESS"
        }), Ot.close()
      } catch {
        nt.sendEvent({
          type: "track",
          event: "DISCONNECT_ERROR"
        }), Rt.showError("Failed to disconnect")
      } finally {
        this.disconecting = !1
      }
    }
    async onSwitchNetwork(e) {
      const r = ke.state.caipAddress,
        n = fe.getAllApprovedCaipNetworkIds(),
        i = fe.getNetworkProp("supportsAllNetworks", e.chainNamespace),
        s = fe.state.activeCaipNetwork,
        o = Ae.state.data;
      r && s?.caipNetworkId !== e.caipNetworkId ? n?.includes(e.caipNetworkId) ? await fe.switchActiveNetwork(e) : i && Ae.push("SwitchNetwork", {
        ...o,
        network: e
      }) : r || (fe.setActiveCaipNetwork(e), Ae.push("Connect"))
    }
  };
  L4.styles = Z4e, ej([le()], L4.prototype, "disconecting", void 0), L4 = ej([ye("w4m-unsupported-chain-view")], L4);
  const Y4e = Re`
    wiu-compatible-network {
      margin-top: var(--wiu-spacing-l);
    }
  `;
  var Dv = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let B0 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.address = ke.state.address, this.profileName = ke.state.profileName, this.network = fe.state.activeCaipNetwork, this.preferredAccountType = ke.state.preferredAccountType, this.unsubscribe.push(ke.subscribe(e => {
        e.address ? (this.address = e.address, this.profileName = e.profileName, this.preferredAccountType = e.preferredAccountType) : Rt.showError("Account not found")
      }), fe.subscribeKey("activeCaipNetwork", e => {
        e?.id && (this.network = e)
      }))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      if (!this.address) throw new Error("w4m-wallet-receive-view: No account provided");
      const e = Rr.getNetworkImage(this.network);
      return K` <wiu-flex
        flexDirection="column"
        .padding=${["0","l","l","l"]}
        alignItems="center"
      >
        <wiu-chip-button
          data-testid="receive-address-copy-button"
          @click=${this.onCopyClick.bind(this)}
          text=${Vt.getTruncateString({string:this.profileName||this.address||"",charsStart:this.profileName?18:4,charsEnd:this.profileName?0:4,truncate:this.profileName?"end":"middle"})}
          icon="copy"
          size="sm"
          imageSrc=${e||""}
          variant="gray"
        ></wiu-chip-button>
        <wiu-flex
          flexDirection="column"
          .padding=${["l","0","0","0"]}
          alignItems="center"
          gap="s"
        >
          <wiu-qr-code
            size=${232}
            theme=${Sn.state.themeMode}
            uri=${this.address}
            ?arenaClear=${!0}
            data-testid="wiu-qr-code"
          ></wiu-qr-code>
          <wiu-text variant="paragraph-500" color="fg-100" align="center">
            Copy your address or scan this QR code
          </wiu-text>
        </wiu-flex>
        ${this.networkTemplate()}
      </wiu-flex>`
    }
    networkTemplate() {
      const e = fe.getAllRequestedCaipNetworks(),
        r = fe.checkIfSmartAccountEnabled(),
        n = fe.state.activeCaipNetwork;
      if (this.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT && r) return n ? K`<wiu-compatible-network
          @click=${this.onReceiveClick.bind(this)}
          text="Only receive assets on this network"
          .networkImages=${[Rr.getNetworkImage(n)??""]}
        ></wiu-compatible-network>` : null;
      const s = (e?.filter(o => o?.assets?.imageId)?.slice(0, 5)).map(Rr.getNetworkImage).filter(Boolean);
      return K`<wiu-compatible-network
        @click=${this.onReceiveClick.bind(this)}
        text="Only receive assets on these networks"
        .networkImages=${s}
      ></wiu-compatible-network>`
    }
    onReceiveClick() {
      Ae.push("WalletCompatibleNetworks")
    }
    onCopyClick() {
      try {
        this.address && (je.copyToClopboard(this.address), Rt.showSuccess("Address copied"))
      } catch {
        Rt.showError("Failed to copy")
      }
    }
  };
  B0.styles = Y4e, Dv([le()], B0.prototype, "address", void 0), Dv([le()], B0.prototype, "profileName", void 0), Dv([le()], B0.prototype, "network", void 0), Dv([le()], B0.prototype, "preferredAccountType", void 0), B0 = Dv([ye("w4m-wallet-receive-view")], B0);
  const Q4e = Re`
    :host > wiu-flex {
      max-height: clamp(360px, 540px, 80vh);
      overflow: scroll;
      scrollbar-width: none;
    }
  
    :host > wiu-flex::-webkit-scrollbar {
      display: none;
    }
  `;
  var tj = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let B4 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.preferredAccountType = ke.state.preferredAccountType, this.unsubscribe.push(ke.subscribeKey("preferredAccountType", e => {
        this.preferredAccountType = e
      }))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      return K` <wiu-flex
        flexDirection="column"
        .padding=${["xs","s","m","s"]}
        gap="xs"
      >
        <wiu-banner
          icon="warningCircle"
          text="You can only receive assets on these networks"
        ></wiu-banner>
        ${this.networkTemplate()}
      </wiu-flex>`
    }
    networkTemplate() {
      const e = fe.getAllRequestedCaipNetworks(),
        r = fe.getAllApprovedCaipNetworkIds(),
        n = fe.state.activeCaipNetwork,
        i = fe.checkIfSmartAccountEnabled();
      let s = je.sortRequestedNetworks(r, e);
      if (i && this.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT) {
        if (!n) return null;
        s = [n]
      }
      return s.map(o => K`
          <wiu-list-network
            imageSrc=${$e(Rr.getNetworkImage(o))}
            name=${o.name??"Unknown"}
            ?transparent=${!0}
          >
          </wiu-list-network>
        `)
    }
  };
  B4.styles = Q4e, tj([le()], B4.prototype, "preferredAccountType", void 0), B4 = tj([ye("w4m-wallet-compatible-networks-view")], B4);
  const J4e = Re`
    :host {
      display: block;
    }
  
    wiu-flex {
      position: relative;
    }
  
    wiu-icon-box {
      width: 40px;
      height: 40px;
      border-radius: var(--wiu-border-radius-xs) !important;
      border: 5px solid var(--wiu-color-bg-125);
      background: var(--wiu-color-bg-175);
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      z-index: 3;
    }
  
    wiu-button {
      --local-border-radius: var(--wiu-border-radius-xs) !important;
    }
  
    .inputContainer {
      height: fit-content;
    }
  `;
  var od = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Mc = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.token = Vr.state.token, this.sendTokenAmount = Vr.state.sendTokenAmount, this.receiverAddress = Vr.state.receiverAddress, this.receiverProfileName = Vr.state.receiverProfileName, this.loading = Vr.state.loading, this.gasPriceInUSD = Vr.state.gasPriceInUSD, this.gasPrice = Vr.state.gasPrice, this.message = "Preview Send", this.fetchNetworkPrice(), this.unsubscribe.push(Vr.subscribe(e => {
        this.token = e.token, this.sendTokenAmount = e.sendTokenAmount, this.receiverAddress = e.receiverAddress, this.gasPriceInUSD = e.gasPriceInUSD, this.receiverProfileName = e.receiverProfileName, this.loading = e.loading
      }))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      return this.getMessage(), K` <wiu-flex flexDirection="column" .padding=${["0","l","l","l"]}>
        <wiu-flex class="inputContainer" gap="xs" flexDirection="column">
          <w4m-input-token
            .token=${this.token}
            .sendTokenAmount=${this.sendTokenAmount}
            .gasPriceInUSD=${this.gasPriceInUSD}
            .gasPrice=${this.gasPrice}
          ></w4m-input-token>
          <wiu-icon-box
            size="inherit"
            backgroundColor="fg-300"
            iconSize="lg"
            iconColor="fg-250"
            background="opaque"
            icon="arrowBottom"
          ></wiu-icon-box>
          <w4m-input-address
            .value=${this.receiverProfileName?this.receiverProfileName:this.receiverAddress}
          ></w4m-input-address>
        </wiu-flex>
        <wiu-flex .margin=${["l","0","0","0"]}>
          <wiu-button
            @click=${this.onButtonClick.bind(this)}
            ?disabled=${!this.message.startsWith("Preview Send")}
            size="lg"
            variant="main"
            ?loading=${this.loading}
            fullWidth
          >
            ${this.message}
          </wiu-button>
        </wiu-flex>
      </wiu-flex>`
    }
    async fetchNetworkPrice() {
      await ut.getNetworkTokenPrice();
      const e = await ut.getInitialGasPrice();
      e?.gasPrice && e?.gasPriceInUSD && (Vr.setGasPrice(e.gasPrice), Vr.setGasPriceInUsd(e.gasPriceInUSD))
    }
    onButtonClick() {
      Ae.push("WalletSendPreview")
    }
    getMessage() {
      this.message = "Preview Send", this.receiverAddress && !je.isAddress(this.receiverAddress, fe.state.activeChain) && (this.message = "Invalid Address"), this.receiverAddress || (this.message = "Add Address"), this.sendTokenAmount && this.token && this.sendTokenAmount > Number(this.token.quantity.numeric) && (this.message = "Insufficient Funds"), this.sendTokenAmount || (this.message = "Add Amount"), this.sendTokenAmount && this.token?.price && (this.sendTokenAmount * this.token.price || (this.message = "Incorrect Value")), this.token || (this.message = "Select Token")
    }
  };
  Mc.styles = J4e, od([le()], Mc.prototype, "token", void 0), od([le()], Mc.prototype, "sendTokenAmount", void 0), od([le()], Mc.prototype, "receiverAddress", void 0), od([le()], Mc.prototype, "receiverProfileName", void 0), od([le()], Mc.prototype, "loading", void 0), od([le()], Mc.prototype, "gasPriceInUSD", void 0), od([le()], Mc.prototype, "gasPrice", void 0), od([le()], Mc.prototype, "message", void 0), Mc = od([ye("w4m-wallet-send-view")], Mc);
  const X4e = Re`
    .contentContainer {
      height: 440px;
      overflow: scroll;
      scrollbar-width: none;
    }
  
    .contentContainer::-webkit-scrollbar {
      display: none;
    }
  
    wiu-icon-box {
      width: 40px;
      height: 40px;
      border-radius: var(--wiu-border-radius-xxs);
    }
  `;
  var Lv = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let U0 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.tokenBalance = ke.state.tokenBalance, this.search = "", this.onDebouncedSearch = je.debounce(e => {
        this.search = e
      }), this.unsubscribe.push(ke.subscribe(e => {
        this.tokenBalance = e.tokenBalance
      }))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      return K`
        <wiu-flex flexDirection="column">
          ${this.templateSearchInput()} <wiu-separator></wiu-separator> ${this.templateTokens()}
        </wiu-flex>
      `
    }
    templateSearchInput() {
      return K`
        <wiu-flex gap="xs" padding="s">
          <wiu-input-text
            @inputChange=${this.onInputChange.bind(this)}
            class="network-search-input"
            size="sm"
            placeholder="Search token"
            icon="search"
          ></wiu-input-text>
        </wiu-flex>
      `
    }
    templateTokens() {
      return this.tokens = this.tokenBalance?.filter(e => e.chainId === fe.state.activeCaipNetwork?.caipNetworkId), this.search ? this.filteredTokens = this.tokenBalance?.filter(e => e.name.toLowerCase().includes(this.search.toLowerCase())) : this.filteredTokens = this.tokens, K`
        <wiu-flex
          class="contentContainer"
          flexDirection="column"
          .padding=${["0","s","0","s"]}
        >
          <wiu-flex justifyContent="flex-start" .padding=${["m","s","s","s"]}>
            <wiu-text variant="paragraph-500" color="fg-200">Your tokens</wiu-text>
          </wiu-flex>
          <wiu-flex flexDirection="column" gap="xs">
            ${this.filteredTokens&&this.filteredTokens.length>0?this.filteredTokens.map(e=>K`<wiu-list-token
                      @click=${this.handleTokenClick.bind(this,e)}
                      ?clickable=${!0}
                      tokenName=${e.name}
                      tokenImageUrl=${e.iconUrl}
                      tokenAmount=${e.quantity.numeric}
                      tokenValue=${e.value}
                      tokenCurrency=${e.symbol}
                    ></wiu-list-token>`):K`<wiu-flex
                  .padding=${["4xl","0","0","0"]}
                  alignItems="center"
                  flexDirection="column"
                  gap="l"
                >
                  <wiu-icon-box
                    icon="coinPlaceholder"
                    size="inherit"
                    iconColor="fg-200"
                    backgroundColor="fg-200"
                    iconSize="lg"
                  ></wiu-icon-box>
                  <wiu-flex
                    class="textContent"
                    gap="xs"
                    flexDirection="column"
                    justifyContent="center"
                    flexDirection="column"
                  >
                    <wiu-text variant="paragraph-500" align="center" color="fg-100"
                      >No tokens found</wiu-text
                    >
                    <wiu-text variant="small-400" align="center" color="fg-200"
                      >Your tokens will appear here</wiu-text
                    >
                  </wiu-flex>
                  <wiu-link @click=${this.onBuyClick.bind(this)}>Buy</wiu-link>
                </wiu-flex>`}
          </wiu-flex>
        </wiu-flex>
      `
    }
    onBuyClick() {
      Ae.push("OnRampProviders")
    }
    onInputChange(e) {
      this.onDebouncedSearch(e.detail)
    }
    handleTokenClick(e) {
      Vr.setToken(e), Vr.setTokenAmount(void 0), Ae.goBack()
    }
  };
  U0.styles = X4e, Lv([le()], U0.prototype, "tokenBalance", void 0), Lv([le()], U0.prototype, "tokens", void 0), Lv([le()], U0.prototype, "filteredTokens", void 0), Lv([le()], U0.prototype, "search", void 0), U0 = Lv([ye("w4m-wallet-send-select-token-view")], U0);
  const e6e = Re`
    wiu-avatar,
    wiu-image {
      display: ruby;
      width: 32px;
      height: 32px;
      border-radius: var(--wiu-border-radius-3xl);
    }
  
    .sendButton {
      width: 70%;
      --local-width: 100% !important;
      --local-border-radius: var(--wiu-border-radius-xs) !important;
    }
  
    .cancelButton {
      width: 30%;
      --local-width: 100% !important;
      --local-border-radius: var(--wiu-border-radius-xs) !important;
    }
  `;
  var Dh = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Kl = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.token = Vr.state.token, this.sendTokenAmount = Vr.state.sendTokenAmount, this.receiverAddress = Vr.state.receiverAddress, this.receiverProfileName = Vr.state.receiverProfileName, this.receiverProfileImageUrl = Vr.state.receiverProfileImageUrl, this.gasPriceInUSD = Vr.state.gasPriceInUSD, this.caipNetwork = fe.state.activeCaipNetwork, this.unsubscribe.push(Vr.subscribe(e => {
        this.token = e.token, this.sendTokenAmount = e.sendTokenAmount, this.receiverAddress = e.receiverAddress, this.gasPriceInUSD = e.gasPriceInUSD, this.receiverProfileName = e.receiverProfileName, this.receiverProfileImageUrl = e.receiverProfileImageUrl
      }), fe.subscribeKey("activeCaipNetwork", e => this.caipNetwork = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      return K` <wiu-flex flexDirection="column" .padding=${["0","l","l","l"]}>
        <wiu-flex gap="xs" flexDirection="column" .padding=${["0","xs","0","xs"]}>
          <wiu-flex alignItems="center" justifyContent="space-between">
            <wiu-flex flexDirection="column" gap="4xs">
              <wiu-text variant="small-400" color="fg-150">Send</wiu-text>
              ${this.sendValueTemplate()}
            </wiu-flex>
            <wiu-preview-item
              text="${this.sendTokenAmount?Vt.roundNumber(this.sendTokenAmount,6,5):"unknown"} ${this.token?.symbol}"
              .imageSrc=${this.token?.iconUrl}
            ></wiu-preview-item>
          </wiu-flex>
          <wiu-flex>
            <wiu-icon color="fg-200" size="md" name="arrowBottom"></wiu-icon>
          </wiu-flex>
          <wiu-flex alignItems="center" justifyContent="space-between">
            <wiu-text variant="small-400" color="fg-150">To</wiu-text>
            <wiu-preview-item
              text="${this.receiverProfileName?Vt.getTruncateString({string:this.receiverProfileName,charsStart:20,charsEnd:0,truncate:"end"}):Vt.getTruncateString({string:this.receiverAddress?this.receiverAddress:"",charsStart:4,charsEnd:4,truncate:"middle"})}"
              address=${this.receiverAddress??""}
              .imageSrc=${this.receiverProfileImageUrl??void 0}
              .isAddress=${!0}
            ></wiu-preview-item>
          </wiu-flex>
        </wiu-flex>
        <wiu-flex flexDirection="column" .padding=${["xxl","0","0","0"]}>
          <w4m-wallet-send-details
            .caipNetwork=${this.caipNetwork}
            .receiverAddress=${this.receiverAddress}
            .networkFee=${this.gasPriceInUSD}
          ></w4m-wallet-send-details>
          <wiu-flex justifyContent="center" gap="xxs" .padding=${["s","0","0","0"]}>
            <wiu-icon size="sm" color="fg-200" name="warningCircle"></wiu-icon>
            <wiu-text variant="small-400" color="fg-200">Review transaction carefully</wiu-text>
          </wiu-flex>
          <wiu-flex justifyContent="center" gap="s" .padding=${["l","0","0","0"]}>
            <wiu-button
              class="cancelButton"
              @click=${this.onCancelClick.bind(this)}
              size="lg"
              variant="neutral"
            >
              Cancel
            </wiu-button>
            <wiu-button
              class="sendButton"
              @click=${this.onSendClick.bind(this)}
              size="lg"
              variant="main"
            >
              Send
            </wiu-button>
          </wiu-flex>
        </wiu-flex></wiu-flex
      >`
    }
    sendValueTemplate() {
      if (this.token && this.sendTokenAmount) {
        const r = this.token.price * this.sendTokenAmount;
        return K`<wiu-text variant="paragraph-400" color="fg-100"
          >$${r.toFixed(2)}</wiu-text
        >`
      }
      return null
    }
    onSendClick() {
      Vr.sendToken()
    }
    onCancelClick() {
      Ae.goBack()
    }
  };
  Kl.styles = e6e, Dh([le()], Kl.prototype, "token", void 0), Dh([le()], Kl.prototype, "sendTokenAmount", void 0), Dh([le()], Kl.prototype, "receiverAddress", void 0), Dh([le()], Kl.prototype, "receiverProfileName", void 0), Dh([le()], Kl.prototype, "receiverProfileImageUrl", void 0), Dh([le()], Kl.prototype, "gasPriceInUSD", void 0), Dh([le()], Kl.prototype, "caipNetwork", void 0), Kl = Dh([ye("w4m-wallet-send-preview-view")], Kl);
  const t6e = Re`
    wiu-flex {
      max-height: clamp(360px, 540px, 80vh);
      overflow: scroll;
      scrollbar-width: none;
      transition: opacity var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: opacity;
    }
    wiu-flex::-webkit-scrollbar {
      display: none;
    }
    wiu-flex.disabled {
      opacity: 0.3;
      pointer-events: none;
      user-select: none;
    }
  `;
  var rj = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let U4 = class extends _e {
    constructor() {
      super(...arguments), this.checked = !1
    }
    render() {
      const {
        termsConditionsUrl: e,
        privacyPolicyUrl: r
      } = Ue.state, n = Ue.state.features?.legalCheckbox, s = !!(e || r) && !!n, o = s && !this.checked, a = o ? -1 : void 0;
      return K`
        <w4m-legal-checkbox @checkboxChange=${this.onCheckboxChange.bind(this)}></w4m-legal-checkbox>
        <wiu-flex
          flexDirection="column"
          .padding=${s?["0","s","s","s"]:"s"}
          gap="xs"
          class=${$e(o?"disabled":void 0)}
        >
          <w4m-wallet-login-list tabIdx=${$e(a)}></w4m-wallet-login-list>
        </wiu-flex>
        <w4m-legal-footer></w4m-legal-footer>
      `
    }
    onCheckboxChange(e) {
      this.checked = !!e.detail
    }
  };
  U4.styles = t6e, rj([le()], U4.prototype, "checked", void 0), U4 = rj([ye("w4m-connect-wallets-view")], U4);
  const r6e = Re`
    wiu-flex {
      max-height: clamp(360px, 540px, 80vh);
      overflow: scroll;
      scrollbar-width: none;
      transition: opacity var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: opacity;
    }
    wiu-flex::-webkit-scrollbar {
      display: none;
    }
    wiu-flex.disabled {
      opacity: 0.3;
      pointer-events: none;
      user-select: none;
    }
  `;
  var nj = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let j4 = class extends _e {
    constructor() {
      super(...arguments), this.checked = !1
    }
    render() {
      const {
        termsConditionsUrl: e,
        privacyPolicyUrl: r
      } = Ue.state, n = Ue.state.features?.legalCheckbox, s = !!(e || r) && !!n, o = s && !this.checked, a = o ? -1 : void 0;
      return K`
        <w4m-legal-checkbox @checkboxChange=${this.onCheckboxChange.bind(this)}></w4m-legal-checkbox>
        <wiu-flex
          flexDirection="column"
          .padding=${s?["0","s","s","s"]:"s"}
          gap="xs"
          class=${$e(o?"disabled":void 0)}
        >
          <w4m-social-login-list tabIdx=${$e(a)}></w4m-social-login-list>
        </wiu-flex>
        <w4m-legal-footer></w4m-legal-footer>
      `
    }
    onCheckboxChange(e) {
      this.checked = !!e.detail
    }
  };
  j4.styles = r6e, nj([le()], j4.prototype, "checked", void 0), j4 = nj([ye("w4m-connect-socials-view")], j4);
  const n6e = Re`
    wiu-logo {
      width: 80px;
      height: 80px;
      border-radius: var(--wiu-border-radius-m);
    }
    @keyframes shake {
      0% {
        transform: translateX(0);
      }
      25% {
        transform: translateX(3px);
      }
      50% {
        transform: translateX(-3px);
      }
      75% {
        transform: translateX(3px);
      }
      100% {
        transform: translateX(0);
      }
    }
    wiu-flex:first-child:not(:only-child) {
      position: relative;
    }
    wiu-loading-thumbnail {
      position: absolute;
    }
    wiu-icon-box {
      position: absolute;
      right: calc(var(--wiu-spacing-3xs) * -1);
      bottom: calc(var(--wiu-spacing-3xs) * -1);
      opacity: 0;
      transform: scale(0.5);
      transition: all var(--wiu-ease-out-power-2) var(--wiu-duration-lg);
    }
    wiu-text[align='center'] {
      width: 100%;
      padding: 0px var(--wiu-spacing-l);
    }
    [data-error='true'] wiu-icon-box {
      opacity: 1;
      transform: scale(1);
    }
    [data-error='true'] > wiu-flex:first-child {
      animation: shake 250ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    }
    .capitalize {
      text-transform: capitalize;
    }
  `;
  var Rg = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Lh = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.socialProvider = ke.state.socialProvider, this.socialWindow = ke.state.socialWindow, this.error = !1, this.connecting = !1, this.message = "Connect in the provider window", this.authConnector = Tt.getAuthConnector(), this.handleSocialConnection = async e => {
        if (e.data?.resultUri)
          if (e.origin === nd.SECURE_SITE_ORIGIN) {
            window.removeEventListener("message", this.handleSocialConnection, !1);
            try {
              if (this.authConnector && !this.connecting) {
                this.socialWindow && (this.socialWindow.close(), ke.setSocialWindow(void 0, fe.state.activeChain)), this.connecting = !0, this.updateMessage();
                const r = e.data.resultUri;
                await this.authConnector.provider.connectSocial(r), this.socialProvider && (Ar.setConnectedSocialProvider(this.socialProvider), await Kt.connectExternal(this.authConnector, this.authConnector.chain), nt.sendEvent({
                  type: "track",
                  event: "SOCIAL_LOGIN_SUCCESS",
                  properties: {
                    provider: this.socialProvider
                  }
                }))
              }
            } catch {
              this.error = !0, this.updateMessage(), this.socialProvider && nt.sendEvent({
                type: "track",
                event: "SOCIAL_LOGIN_ERROR",
                properties: {
                  provider: this.socialProvider
                }
              })
            }
          } else Ae.goBack(), Rt.showError("Untrusted Origin"), this.socialProvider && nt.sendEvent({
            type: "track",
            event: "SOCIAL_LOGIN_ERROR",
            properties: {
              provider: this.socialProvider
            }
          })
      }, this.unsubscribe.push(ke.subscribe(e => {
        e.socialProvider && (this.socialProvider = e.socialProvider), e.socialWindow && (this.socialWindow = e.socialWindow), e.address && Ot.state.open && Ot.close()
      })), this.authConnector && this.connectSocial()
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e()), window.removeEventListener("message", this.handleSocialConnection, !1)
    }
    render() {
      return K`
        <wiu-flex
          data-error=${$e(this.error)}
          flexDirection="column"
          alignItems="center"
          .padding=${["3xl","xl","xl","xl"]}
          gap="xl"
        >
          <wiu-flex justifyContent="center" alignItems="center">
            <wiu-logo logo=${$e(this.socialProvider)}></wiu-logo>
            ${this.error?null:this.loaderTemplate()}
            <wiu-icon-box
              backgroundColor="error-100"
              background="opaque"
              iconColor="error-100"
              icon="close"
              size="sm"
              border
              borderColor="wiu-color-bg-125"
            ></wiu-icon-box>
          </wiu-flex>
          <wiu-flex flexDirection="column" alignItems="center" gap="xs">
            <wiu-text align="center" variant="paragraph-500" color="fg-100"
              >Log in with
              <span class="capitalize">${this.socialProvider??"Social"}</span></wiu-text
            >
            <wiu-text align="center" variant="small-400" color=${this.error?"error-100":"fg-200"}
              >${this.message}</wiu-text
            ></wiu-flex
          >
        </wiu-flex>
      `
    }
    loaderTemplate() {
      const e = Sn.state.themeVariables["--w4m-border-radius-master"],
        r = e ? parseInt(e.replace("px", ""), 10) : 4;
      return K`<wiu-loading-thumbnail radius=${r*9}></wiu-loading-thumbnail>`
    }
    connectSocial() {
      const e = setInterval(() => {
        this.socialWindow?.closed && (!this.connecting && Ae.state.view === "ConnectingSocial" && Ae.goBack(), clearInterval(e))
      }, 1e3);
      window.addEventListener("message", this.handleSocialConnection, !1)
    }
    updateMessage() {
      this.error ? this.message = "Something went wrong" : this.connecting ? this.message = "Retrieving user data" : this.message = "Connect in the provider window"
    }
  };
  Lh.styles = n6e, Rg([le()], Lh.prototype, "socialProvider", void 0), Rg([le()], Lh.prototype, "socialWindow", void 0), Rg([le()], Lh.prototype, "error", void 0), Rg([le()], Lh.prototype, "connecting", void 0), Rg([le()], Lh.prototype, "message", void 0), Lh = Rg([ye("w4m-connecting-social-view")], Lh);
  const i6e = Re`
    wiu-flex {
      width: 100%;
    }
  
    wiu-icon-link {
      margin-right: calc(var(--wiu-icon-box-size-md) * -1);
    }
  
    .account-links {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
  
    .account-links wiu-flex {
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      flex: 1;
      background: red;
      align-items: center;
      justify-content: center;
      height: 48px;
      padding: 10px;
      flex: 1 0 0;
  
      border-radius: var(--XS, 16px);
      border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
      background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
      transition: background-color var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: background-color;
    }
  
    .account-links wiu-flex:hover {
      background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15));
    }
  
    .account-links wiu-flex wiu-icon {
      width: var(--S, 20px);
      height: var(--S, 20px);
    }
  
    .account-links wiu-flex wiu-icon svg path {
      stroke: #47a1ff;
    }
  
    .account-settings-button {
      padding: calc(var(--wiu-spacing-m) - 1px) var(--wiu-spacing-2l);
      height: 40px;
      border-radius: var(--wiu-border-radius-xxs);
      border: 1px solid var(--wiu-color-gray-glass-002);
      background: var(--wiu-color-gray-glass-002);
      cursor: pointer;
    }
  
    .account-settings-button:hover {
      background: var(--wiu-color-gray-glass-005);
    }
  `;
  var Ng = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Bh = class extends _e {
    constructor() {
      super(), this.usubscribe = [], this.address = ke.state.address, this.profileImage = ke.state.profileImage, this.profileName = ke.state.profileName, this.accounts = ke.state.allAccounts, this.loading = !1, this.usubscribe.push(ke.subscribeKey("address", e => {
        e ? this.address = e : Ot.close()
      })), this.usubscribe.push(ke.subscribeKey("profileImage", e => {
        this.profileImage = e
      })), this.usubscribe.push(ke.subscribeKey("profileName", e => {
        this.profileName = e
      }))
    }
    disconnectedCallback() {
      this.usubscribe.forEach(e => e())
    }
    render() {
      if (!this.address) throw new Error("w4m-profile-view: No account provided");
      return K`
        <wiu-flex flexDirection="column" gap="l" .padding=${["0","xl","m","xl"]}>
          <wiu-flex flexDirection="column" alignItems="center" gap="l">
            <wiu-avatar
              alt=${this.address}
              address=${this.address}
              imageSrc=${$e(this.profileImage)}
              size="2lg"
            ></wiu-avatar>
            <wiu-flex flexDirection="column" alignItems="center">
              <wiu-flex gap="3xs" alignItems="center" justifyContent="center">
                <wiu-text variant="title-6-600" color="fg-100" data-testid="account-settings-address">
                  ${this.profileName?Vt.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):Vt.getTruncateString({string:this.address,charsStart:4,charsEnd:6,truncate:"middle"})}
                </wiu-text>
                <wiu-icon-link
                  size="md"
                  icon="copy"
                  iconColor="fg-200"
                  @click=${this.onCopyAddress}
                ></wiu-icon-link>
              </wiu-flex>
            </wiu-flex>
          </wiu-flex>
          <wiu-flex
            data-testid="account-settings-button"
            justifyContent="center"
            alignItems="center"
            class="account-settings-button"
            @click=${()=>Ae.push("AccountSettings")}
          >
            <wiu-text variant="paragraph-500" color="fg-100">Account Settings</wiu-text>
          </wiu-flex>
          ${this.accountsTemplate()}
        </wiu-flex>
      `
    }
    accountsTemplate() {
      return K`<wiu-flex flexDirection="column">
        <wiu-flex .padding=${["3xs","m","s","s"]}>
          <wiu-text color="fg-200" variant="paragraph-400">Your accounts</wiu-text>
        </wiu-flex>
        <wiu-flex flexDirection="column" gap="xxs">
          ${this.accounts.map(e=>this.accountTemplate(e))}
        </wiu-flex>
      </wiu-flex>`
    }
    async onSwitchAccount(e) {
      this.loading = !0, Tt.getAuthConnector() && await Kt.setPreferredAccountType(e.type), ke.setShouldUpdateToAddress(e.address, fe.state.activeChain), this.loading = !1
    }
    accountTemplate(e) {
      return K`<wiu-list-account accountAddress=${e.address} accountType=${e.type}>
        ${e.address===this.address?"":K`<wiu-button
              slot="action"
              textVariant="small-600"
              size="md"
              variant="accent"
              @click=${()=>this.onSwitchAccount(e)}
              .loading=${this.loading}
              >Switch</wiu-button
            >`}
      </wiu-list-account>`
    }
    onCopyAddress() {
      try {
        this.profileName ? (je.copyToClopboard(this.profileName), Rt.showSuccess("Name copied")) : this.address && (je.copyToClopboard(this.address), Rt.showSuccess("Address copied"))
      } catch {
        Rt.showError("Failed to copy")
      }
    }
  };
  Bh.styles = i6e, Ng([le()], Bh.prototype, "address", void 0), Ng([le()], Bh.prototype, "profileImage", void 0), Ng([le()], Bh.prototype, "profileName", void 0), Ng([le()], Bh.prototype, "accounts", void 0), Ng([le()], Bh.prototype, "loading", void 0), Bh = Ng([ye("w4m-profile-view")], Bh);
  const s6e = Re`
    wiu-avatar {
      width: var(--wiu-spacing-3xl);
      height: var(--wiu-spacing-3xl);
      box-shadow: 0 0 0 0;
    }
  
    wiu-icon-box {
      position: relative;
      right: 15px;
      top: 15px;
      border: 2px solid var(--wiu-color-bg-150);
      background-color: var(--wiu-color-bg-125);
    }
  `;
  var GE = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Bv = class extends _e {
    constructor() {
      super(), this.metadata = Ue.state.metadata, this.allAccounts = ke.state.allAccounts || [], this.balances = {}, this.labels = ke.state.addressLabels, this.currentAddress = ke.state.address || "", this.connectedConnector = Ar.getConnectedConnector(), this.shouldShowIcon = this.connectedConnector === "AUTH", this.caipNetwork = fe.state.activeCaipNetwork, ke.subscribeKey("allAccounts", e => {
        this.allAccounts = e
      })
    }
    connectedCallback() {
      super.connectedCallback(), this.allAccounts.forEach(e => {
        An.getBalance(e.address, this.caipNetwork?.caipNetworkId).then(r => {
          let n = this.balances[e.address] || 0;
          r.balances.length > 0 && (n = r.balances.reduce((i, s) => i + (s?.value || 0), 0)), this.balances[e.address] = n, this.requestUpdate()
        })
      })
    }
    getAddressIcon(e) {
      return e === "smartAccount" ? "lightbulb" : "mail"
    }
    render() {
      return K`
        <wiu-flex justifyContent="center" .padding=${["xl","0","xl","0"]}>
          <wiu-banner-img
            imageSrc=${$e(this.metadata?.icons[0])}
            text=${$e(this.metadata?.url)}
            size="sm"
          ></wiu-banner-img>
        </wiu-flex>
        <wiu-flex flexDirection="column" gap="xxl" .padding=${["l","xl","xl","xl"]}>
          ${this.allAccounts.map((e,r)=>this.getAddressTemplate(e,r))}
        </wiu-flex>
      `
    }
    getAddressTemplate(e, r) {
      const n = this.labels?.get(e.address);
      return K`
        <wiu-flex
          flexDirection="row"
          justifyContent="space-between"
          data-testid="switch-address-item"
        >
          <wiu-flex alignItems="center">
            <wiu-avatar address=${e.address}></wiu-avatar>
            ${this.shouldShowIcon?K`<wiu-icon-box
                  size="sm"
                  iconcolor="fg-200"
                  backgroundcolor="glass-002"
                  background="gray"
                  icon="${this.getAddressIcon(e.type)}"
                  ?border=${!0}
                ></wiu-icon-box>`:K`<wiu-flex .padding="${["0","0","0","s"]}"></wiu-flex>`}
            <wiu-flex flexDirection="column">
              <wiu-text class="address" variant="paragraph-500" color="fg-100"
                >${n||Vt.getTruncateString({string:e.address,charsStart:4,charsEnd:6,truncate:"middle"})}</wiu-text
              >
              <wiu-text class="address-description" variant="small-400">
                ${typeof this.balances[e.address]=="number"?`$${this.balances[e.address]?.toFixed(2)}`:K`<wiu-loading-spinner size="sm" color="accent-100"></wiu-loading-spinner>`}
              </wiu-text>
            </wiu-flex>
          </wiu-flex>
          <wiu-flex gap="s" alignItems="center">
            ${e.address?.toLowerCase()===this.currentAddress?.toLowerCase()?"":K`
                  <wiu-button
                    data-testid=${`w4m-switch-address-button-${r}`}
                    textVariant="small-600"
                    size="md"
                    variant="accent"
                    @click=${()=>this.onSwitchAddress(e.address)}
                    >Switch to</wiu-button
                  >
                `}
          </wiu-flex>
        </wiu-flex>
      `
    }
    onSwitchAddress(e) {
      const r = fe.state.activeCaipNetwork,
        n = r?.chainNamespace,
        i = `${n}:${r?.id}:${e}`;
      ke.setCaipAddress(i, n), Ot.close()
    }
  };
  Bv.styles = s6e, GE([le()], Bv.prototype, "allAccounts", void 0), GE([le()], Bv.prototype, "balances", void 0), Bv = GE([ye("w4m-switch-address-view")], Bv);
  const o6e = Re`
    @keyframes fadein {
      from {
        opacity: 0;
      }
      to {
        opacity: 1;
      }
    }
  
    wiu-shimmer {
      width: 100%;
      aspect-ratio: 1 / 1;
      border-radius: clamp(0px, var(--wiu-border-radius-l), 40px) !important;
    }
  
    wiu-qr-code {
      opacity: 0;
      animation-duration: 200ms;
      animation-timing-function: ease;
      animation-name: fadein;
      animation-fill-mode: forwards;
    }
  
    wiu-logo {
      width: 80px;
      height: 80px;
      border-radius: var(--wiu-border-radius-m);
    }
  
    wiu-flex:first-child:not(:only-child) {
      position: relative;
    }
    wiu-loading-thumbnail {
      position: absolute;
    }
    wiu-icon-box {
      position: absolute;
      right: calc(var(--wiu-spacing-3xs) * -1);
      bottom: calc(var(--wiu-spacing-3xs) * -1);
      opacity: 0;
      transform: scale(0.5);
      transition: all var(--wiu-ease-out-power-2) var(--wiu-duration-lg);
    }
  `;
  var Uv = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let j0 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.timeout = void 0, this.socialProvider = ke.state.socialProvider, this.uri = ke.state.farcasterUrl, this.ready = !1, this.loading = !1, this.authConnector = Tt.getAuthConnector(), this.forceUpdate = () => {
        this.requestUpdate()
      }, this.unsubscribe.push(ke.subscribeKey("farcasterUrl", e => {
        e && (this.uri = e, this.connectFarcaster())
      }), ke.subscribeKey("socialProvider", e => {
        e && (this.socialProvider = e)
      })), window.addEventListener("resize", this.forceUpdate)
    }
    disconnectedCallback() {
      super.disconnectedCallback(), clearTimeout(this.timeout), window.removeEventListener("resize", this.forceUpdate)
    }
    render() {
      return this.onRenderProxy(), K`${this.platformTemplate()}`
    }
    platformTemplate() {
      return je.isMobile() ? K`${this.mobileTemplate()}` : K`${this.desktopTemplate()}`
    }
    desktopTemplate() {
      return this.loading ? K`${this.loadingTemplate()}` : K`${this.qrTemplate()}`
    }
    qrTemplate() {
      return K` <wiu-flex
        flexDirection="column"
        alignItems="center"
        .padding=${["0","xl","xl","xl"]}
        gap="xl"
      >
        <wiu-shimmer borderRadius="l" width="100%"> ${this.qrCodeTemplate()} </wiu-shimmer>
  
        <wiu-text variant="paragraph-500" color="fg-100">
          Scan this QR Code with your phone
        </wiu-text>
        ${this.copyTemplate()}
      </wiu-flex>`
    }
    loadingTemplate() {
      return K`
        <wiu-flex
          flexDirection="column"
          alignItems="center"
          .padding=${["xl","xl","xl","xl"]}
          gap="xl"
        >
          <wiu-flex justifyContent="center" alignItems="center">
            <wiu-logo logo="farcaster"></wiu-logo>
            ${this.loaderTemplate()}
            <wiu-icon-box
              backgroundColor="error-100"
              background="opaque"
              iconColor="error-100"
              icon="close"
              size="sm"
              border
              borderColor="wiu-color-bg-125"
            ></wiu-icon-box>
          </wiu-flex>
          <wiu-flex flexDirection="column" alignItems="center" gap="xs">
            <wiu-text align="center" variant="paragraph-500" color="fg-100">
              Loading user data
            </wiu-text>
            <wiu-text align="center" variant="small-400" color="fg-200">
              Please wait a moment while we load your data.
            </wiu-text>
          </wiu-flex>
        </wiu-flex>
      `
    }
    mobileTemplate() {
      return K` <wiu-flex
        flexDirection="column"
        alignItems="center"
        .padding=${["3xl","xl","xl","xl"]}
        gap="xl"
      >
        <wiu-flex justifyContent="center" alignItems="center">
          <wiu-logo logo="farcaster"></wiu-logo>
          ${this.loaderTemplate()}
          <wiu-icon-box
            backgroundColor="error-100"
            background="opaque"
            iconColor="error-100"
            icon="close"
            size="sm"
            border
            borderColor="wiu-color-bg-125"
          ></wiu-icon-box>
        </wiu-flex>
        <wiu-flex flexDirection="column" alignItems="center" gap="xs">
          <wiu-text align="center" variant="paragraph-500" color="fg-100"
            >Continue in Farcaster</span></wiu-text
          >
          <wiu-text align="center" variant="small-400" color="fg-200"
            >Accept connection request in the app</wiu-text
          ></wiu-flex
        >
        ${this.mobileLinkTemplate()}
      </wiu-flex>`
    }
    loaderTemplate() {
      const e = Sn.state.themeVariables["--w4m-border-radius-master"],
        r = e ? parseInt(e.replace("px", ""), 10) : 4;
      return K`<wiu-loading-thumbnail radius=${r*9}></wiu-loading-thumbnail>`
    }
    async connectFarcaster() {
      if (this.authConnector) try {
        await this.authConnector?.provider.connectFarcaster(), this.socialProvider && Ar.setConnectedSocialProvider(this.socialProvider), this.loading = !0, await Kt.connectExternal(this.authConnector, this.authConnector.chain), this.loading = !1, Ot.close()
      } catch (e) {
        Ae.goBack(), Rt.showError(e)
      }
    }
    mobileLinkTemplate() {
      return K`<wiu-button
        size="md"
        ?loading=${this.loading}
        ?disabled=${!this.uri||this.loading}
        @click=${()=>{this.uri&&je.openHref(this.uri,"_blank")}}
      >
        Open farcaster</wiu-button
      >`
    }
    onRenderProxy() {
      !this.ready && this.uri && (this.timeout = setTimeout(() => {
        this.ready = !0
      }, 0))
    }
    qrCodeTemplate() {
      if (!this.uri || !this.ready) return null;
      const e = this.getBoundingClientRect().width - 40;
      return K` <wiu-qr-code
        size=${e}
        theme=${Sn.state.themeMode}
        uri=${this.uri}
        ?farcaster=${!0}
        data-testid="wiu-qr-code"
      ></wiu-qr-code>`
    }
    copyTemplate() {
      const e = !this.uri || !this.ready;
      return K`<wiu-link
        .disabled=${e}
        @click=${this.onCopyUri}
        color="fg-200"
        data-testid="copy-wc2-uri"
      >
        <wiu-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wiu-icon>
        Copy link
      </wiu-link>`
    }
    onCopyUri() {
      try {
        this.uri && (je.copyToClopboard(this.uri), Rt.showSuccess("Link copied"))
      } catch {
        Rt.showError("Failed to copy")
      }
    }
  };
  j0.styles = o6e, Uv([le()], j0.prototype, "socialProvider", void 0), Uv([le()], j0.prototype, "uri", void 0), Uv([le()], j0.prototype, "ready", void 0), Uv([le()], j0.prototype, "loading", void 0), j0 = Uv([ye("w4m-connecting-farcaster-view")], j0);
  var ij = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let ZE = class extends _e {
    constructor() {
      super(...arguments), this.dappName = Ue.state.metadata?.name, this.isCancelling = !1
    }
    render() {
      return K`
        <wiu-flex justifyContent="center" .padding=${["2xl","0","xxl","0"]}>
          <w4m-siwx-sign-message-thumbnails></w4m-siwx-sign-message-thumbnails>
        </wiu-flex>
        <wiu-flex
          .padding=${["0","4xl","l","4xl"]}
          gap="s"
          justifyContent="space-between"
        >
          <wiu-text variant="paragraph-500" align="center" color="fg-100"
            >${this.dappName??"Dapp"} needs to connect to your wallet</wiu-text
          >
        </wiu-flex>
        <wiu-flex
          .padding=${["0","3xl","l","3xl"]}
          gap="s"
          justifyContent="space-between"
        >
          <wiu-text variant="small-400" align="center" color="fg-200"
            >Sign this message to prove you own this wallet and proceed. Canceling will disconnect
            you.</wiu-text
          >
        </wiu-flex>
        <wiu-flex .padding=${["l","xl","xl","xl"]} gap="s" justifyContent="space-between">
          <wiu-button
            size="lg"
            borderRadius="xs"
            fullWidth
            variant="neutral"
            ?loading=${this.isCancelling}
            @click=${this.onCancel.bind(this)}
            data-testid="w4m-connecting-siwe-cancel"
          >
            Cancel
          </wiu-button>
        </wiu-flex>
      `
    }
    async onCancel() {
      this.isCancelling = !0, fe.state.activeCaipAddress ? (await Kt.disconnect(), Ot.close()) : Ae.push("Connect"), this.isCancelling = !1, nt.sendEvent({
        event: "CLICK_CANCEL_SIWE",
        type: "track",
        properties: {
          network: fe.state.activeCaipNetwork?.caipNetworkId || "",
          isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT
        }
      })
    }
  };
  ij([le()], ZE.prototype, "isCancelling", void 0), ZE = ij([ye("w4m-siwx-sign-message-view")], ZE);
  const a6e = Re`
    wiu-grid {
      max-height: clamp(360px, 400px, 80vh);
      overflow: scroll;
      scrollbar-width: none;
      grid-auto-rows: min-content;
      grid-template-columns: repeat(auto-fill, 104px);
    }
  
    @media (max-width: 350px) {
      wiu-grid {
        grid-template-columns: repeat(2, 1fr);
      }
    }
  
    wiu-grid[data-scroll='false'] {
      overflow: hidden;
    }
  
    wiu-grid::-webkit-scrollbar {
      display: none;
    }
  
    wiu-loading-spinner {
      padding-top: var(--wiu-spacing-l);
      padding-bottom: var(--wiu-spacing-l);
      justify-content: center;
      grid-column: 1 / span 4;
    }
  `,
    Mg = {
      filterOutDuplicatesByRDNS(t) {
        const e = Ue.state.enableEIP6963 ? Tt.state.connectors : [],
          r = Ar.getRecentWallets(),
          n = e.map(a => a.info?.rdns).filter(Boolean),
          i = r.map(a => a.rdns).filter(Boolean),
          s = n.concat(i);
        if (s.includes("io.metamask.mobile") && je.isMobile()) {
          const a = s.indexOf("io.metamask.mobile");
          s[a] = "io.metamask"
        }
        return t.filter(a => !s.includes(String(a?.rdns)))
      },
      filterOutDuplicatesByIds(t) {
        const e = Tt.state.connectors.filter(a => a.type === "ANNOUNCED" || a.type === "INJECTED"),
          r = Ar.getRecentWallets(),
          n = e.map(a => a.explorerId),
          i = r.map(a => a.id),
          s = n.concat(i);
        return t.filter(a => !s.includes(a?.id))
      },
      filterOutDuplicateWallets(t) {
        const e = this.filterOutDuplicatesByRDNS(t);
        return this.filterOutDuplicatesByIds(e)
      },
      markWalletsAsInstalled(t) {
        const {
          connectors: e
        } = Tt.state, r = e.filter(s => s.type === "ANNOUNCED").reduce((s, o) => (o.info?.rdns && (s[o.info.rdns] = !0), s), {});
        return t.map(s => ({
          ...s,
          installed: !!s.rdns && !!r[s.rdns ?? ""]
        })).sort((s, o) => Number(o.installed) - Number(s.installed))
      }
    };
  var jv = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const sj = "local-paginator";
  let F0 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.paginationObserver = void 0, this.initial = !qt.state.wallets.length, this.wallets = qt.state.wallets, this.recommended = qt.state.recommended, this.featured = qt.state.featured, this.unsubscribe.push(qt.subscribeKey("wallets", e => this.wallets = e), qt.subscribeKey("recommended", e => this.recommended = e), qt.subscribeKey("featured", e => this.featured = e))
    }
    firstUpdated() {
      this.initialFetch(), this.createPaginationObserver()
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e()), this.paginationObserver?.disconnect()
    }
    render() {
      return K`
        <wiu-grid
          data-scroll=${!this.initial}
          .padding=${["0","s","s","s"]}
          columnGap="xxs"
          rowGap="l"
          justifyContent="space-between"
        >
          ${this.initial?this.shimmerTemplate(16):this.walletsTemplate()}
          ${this.paginationLoaderTemplate()}
        </wiu-grid>
      `
    }
    async initialFetch() {
      const e = this.shadowRoot?.querySelector("wiu-grid");
      this.initial && e && (await qt.fetchWallets({
        page: 1
      }), await e.animate([{
        opacity: 1
      }, {
        opacity: 0
      }], {
        duration: 200,
        fill: "forwards",
        easing: "ease"
      }).finished, this.initial = !1, e.animate([{
        opacity: 0
      }, {
        opacity: 1
      }], {
        duration: 200,
        fill: "forwards",
        easing: "ease"
      }))
    }
    shimmerTemplate(e, r) {
      return [...Array(e)].map(() => K`
          <wiu-card-select-loader type="wallet" id=${$e(r)}></wiu-card-select-loader>
        `)
    }
    walletsTemplate() {
      const e = [...this.featured, ...this.recommended, ...this.wallets];
      return Mg.markWalletsAsInstalled(e).map(n => K`
          <w4m-all-wallets-list-item
            @click=${()=>this.onConnectWallet(n)}
            .wallet=${n}
          ></w4m-all-wallets-list-item>
        `)
    }
    paginationLoaderTemplate() {
      const {
        wallets: e,
        recommended: r,
        featured: n,
        count: i
      } = qt.state, s = window.innerWidth < 352 ? 3 : 4, o = e.length + r.length;
      let c = Math.ceil(o / s) * s - o + s;
      return c -= e.length ? n.length % s : 0, i === 0 && n.length > 0 ? null : i === 0 || [...n, ...e, ...r].length < i ? this.shimmerTemplate(c, sj) : null
    }
    createPaginationObserver() {
      const e = this.shadowRoot?.querySelector(`#${sj}`);
      e && (this.paginationObserver = new IntersectionObserver(([r]) => {
        if (r?.isIntersecting && !this.initial) {
          const {
            page: n,
            count: i,
            wallets: s
          } = qt.state;
          s.length < i && qt.fetchWallets({
            page: n + 1
          })
        }
      }), this.paginationObserver.observe(e))
    }
    onConnectWallet(e) {
      const r = Tt.getConnector(e.id, e.rdns);
      r ? Ae.push("ConnectingExternal", {
        connector: r
      }) : Ae.push("ConnectingWalletConnect", {
        wallet: e
      })
    }
  };
  F0.styles = a6e, jv([le()], F0.prototype, "initial", void 0), jv([le()], F0.prototype, "wallets", void 0), jv([le()], F0.prototype, "recommended", void 0), jv([le()], F0.prototype, "featured", void 0), F0 = jv([ye("w4m-all-wallets-list")], F0);
  const c6e = Re`
    button {
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      cursor: pointer;
      width: 104px;
      row-gap: var(--wiu-spacing-xs);
      padding: var(--wiu-spacing-s) var(--wiu-spacing-0);
      background-color: var(--wiu-color-gray-glass-002);
      border-radius: clamp(0px, var(--wiu-border-radius-xs), 20px);
      will-change: background-color, color;
      outline: none;
      border: none;
    }
  
    button > wiu-flex > wiu-text {
      color: var(--wiu-color-fg-100);
      max-width: 86px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      justify-content: center;
    }
  
    button > wiu-flex > wiu-text.certified {
      max-width: 66px;
    }
  
    button:hover:enabled {
      background-color: var(--wiu-color-gray-glass-005);
    }
  
    button:disabled > wiu-flex > wiu-text {
      color: var(--wiu-color-gray-glass-015);
    }
  
    [data-selected='true'] {
      background-color: var(--wiu-color-accent-glass-020);
    }
  
    @media (hover: hover) and (pointer: fine) {
      [data-selected='true']:hover:enabled {
        background-color: var(--wiu-color-accent-glass-015);
      }
    }
  
    [data-selected='true']:active:enabled {
      background-color: var(--wiu-color-accent-glass-010);
    }
  
    @media (max-width: 350px) {
      button {
        width: 100%;
      }
    }
  `;
  var Fv = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let W0 = class extends _e {
    constructor() {
      super(), this.observer = new IntersectionObserver(() => {}), this.visible = !1, this.imageSrc = void 0, this.imageLoading = !1, this.wallet = void 0, this.observer = new IntersectionObserver(e => {
        e.forEach(r => {
          r.isIntersecting ? (this.visible = !0, this.fetchImageSrc()) : this.visible = !1
        })
      }, {
        threshold: .01
      })
    }
    firstUpdated() {
      this.observer.observe(this)
    }
    disconnectedCallback() {
      this.observer.disconnect()
    }
    render() {
      const e = this.wallet?.badge_type === "certified";
      return K`
        <button ontouchstart>
          ${this.imageTemplate()}
          <wiu-flex flexDirection="row" alignItems="center" justifyContent="center" gap="3xs">
            <wiu-text
              variant="tiny-500"
              color="inherit"
              class=${$e(e?"certified":void 0)}
              >${this.wallet?.name}</wiu-text
            >
            ${e?K`<wiu-icon size="sm" name="walletConnectBrown"></wiu-icon>`:null}
          </wiu-flex>
        </button>
      `
    }
    imageTemplate() {
      return !this.visible && !this.imageSrc || this.imageLoading ? this.shimmerTemplate() : K`
        <wiu-wallet-image
          size="md"
          imageSrc=${$e(this.imageSrc)}
          name=${this.wallet?.name}
          .installed=${this.wallet?.installed}
          badgeSize="sm"
        >
        </wiu-wallet-image>
      `
    }
    shimmerTemplate() {
      return K`<wiu-shimmer width="56px" height="56px" borderRadius="xs"></wiu-shimmer>`
    }
    async fetchImageSrc() {
      this.wallet && (this.imageSrc = Rr.getWalletImage(this.wallet), !this.imageSrc && (this.imageLoading = !0, this.imageSrc = await Rr.fetchWalletImage(this.wallet.image_id), this.imageLoading = !1))
    }
  };
  W0.styles = c6e, Fv([le()], W0.prototype, "visible", void 0), Fv([le()], W0.prototype, "imageSrc", void 0), Fv([le()], W0.prototype, "imageLoading", void 0), Fv([re()], W0.prototype, "wallet", void 0), W0 = Fv([ye("w4m-all-wallets-list-item")], W0);
  const l6e = Re`
    wiu-grid,
    wiu-loading-spinner,
    wiu-flex {
      height: 360px;
    }
  
    wiu-grid {
      overflow: scroll;
      scrollbar-width: none;
      grid-auto-rows: min-content;
      grid-template-columns: repeat(auto-fill, 104px);
    }
  
    wiu-grid[data-scroll='false'] {
      overflow: hidden;
    }
  
    wiu-grid::-webkit-scrollbar {
      display: none;
    }
  
    wiu-loading-spinner {
      justify-content: center;
      align-items: center;
    }
  
    @media (max-width: 350px) {
      wiu-grid {
        grid-template-columns: repeat(2, 1fr);
      }
    }
  `;
  var F4 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Pg = class extends _e {
    constructor() {
      super(...arguments), this.prevQuery = "", this.prevBadge = void 0, this.loading = !0, this.query = ""
    }
    render() {
      return this.onSearch(), this.loading ? K`<wiu-loading-spinner color="accent-100"></wiu-loading-spinner>` : this.walletsTemplate()
    }
    async onSearch() {
      (this.query.trim() !== this.prevQuery.trim() || this.badge !== this.prevBadge) && (this.prevQuery = this.query, this.prevBadge = this.badge, this.loading = !0, await qt.searchWallet({
        search: this.query,
        badge: this.badge
      }), this.loading = !1)
    }
    walletsTemplate() {
      const {
        search: e
      } = qt.state, r = Mg.markWalletsAsInstalled(e);
      return e.length ? K`
        <wiu-grid
          .padding=${["0","s","s","s"]}
          rowGap="l"
          columnGap="xs"
          justifyContent="space-between"
        >
          ${r.map(n=>K`
              <w4m-all-wallets-list-item
                @click=${()=>this.onConnectWallet(n)}
                .wallet=${n}
                data-testid="wallet-search-item-${n.id}"
              ></w4m-all-wallets-list-item>
            `)}
        </wiu-grid>
      ` : K`
          <wiu-flex justifyContent="center" alignItems="center" gap="s" flexDirection="column">
            <wiu-icon-box
              size="lg"
              iconColor="fg-200"
              backgroundColor="fg-300"
              icon="wallet"
              background="transparent"
            ></wiu-icon-box>
            <wiu-text color="fg-200" variant="paragraph-500">No Wallet found</wiu-text>
          </wiu-flex>
        `
    }
    onConnectWallet(e) {
      const r = Tt.getConnector(e.id, e.rdns);
      r ? Ae.push("ConnectingExternal", {
        connector: r
      }) : Ae.push("ConnectingWalletConnect", {
        wallet: e
      })
    }
  };
  Pg.styles = l6e, F4([le()], Pg.prototype, "loading", void 0), F4([re()], Pg.prototype, "query", void 0), F4([re()], Pg.prototype, "badge", void 0), Pg = F4([ye("w4m-all-wallets-search")], Pg);
  var W4 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Wv = class extends _e {
    constructor() {
      super(), this.platformTabs = [], this.unsubscribe = [], this.platforms = [], this.onSelectPlatfrom = void 0, this.buffering = !1, this.unsubscribe.push(Kt.subscribeKey("buffering", e => this.buffering = e))
    }
    disconnectCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      const e = this.generateTabs();
      return K`
        <wiu-flex justifyContent="center" .padding=${["0","0","l","0"]}>
          <wiu-tabs
            ?disabled=${this.buffering}
            .tabs=${e}
            .onTabChange=${this.onTabChange.bind(this)}
          ></wiu-tabs>
        </wiu-flex>
      `
    }
    generateTabs() {
      const e = this.platforms.map(r => r === "browser" ? {
        label: "Browser",
        icon: "extension",
        platform: "browser"
      } : r === "mobile" ? {
        label: "Mobile",
        icon: "mobile",
        platform: "mobile"
      } : r === "qrcode" ? {
        label: "Mobile",
        icon: "mobile",
        platform: "qrcode"
      } : r === "web" ? {
        label: "Webapp",
        icon: "browser",
        platform: "web"
      } : r === "desktop" ? {
        label: "Desktop",
        icon: "desktop",
        platform: "desktop"
      } : {
        label: "Browser",
        icon: "extension",
        platform: "unsupported"
      });
      return this.platformTabs = e.map(({
        platform: r
      }) => r), e
    }
    onTabChange(e) {
      const r = this.platformTabs[e];
      r && this.onSelectPlatfrom?.(r)
    }
  };
  W4([re({
    type: Array
  })], Wv.prototype, "platforms", void 0), W4([re()], Wv.prototype, "onSelectPlatfrom", void 0), W4([le()], Wv.prototype, "buffering", void 0), Wv = W4([ye("w4m-connecting-header")], Wv);
  var u6e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let oj = class extends as {
    constructor() {
      if (super(), !this.wallet) throw new Error("w4m-connecting-wc-browser: No wallet provided");
      this.onConnect = this.onConnectProxy.bind(this), this.onAutoConnect = this.onConnectProxy.bind(this), nt.sendEvent({
        type: "track",
        event: "SELECT_WALLET",
        properties: {
          name: this.wallet.name,
          platform: "browser"
        }
      })
    }
    async onConnectProxy() {
      try {
        this.error = !1;
        const {
          connectors: e
        } = Tt.state, r = e.find(n => n.type === "ANNOUNCED" && n.info?.rdns === this.wallet?.rdns || n.type === "INJECTED" || n.name === this.wallet?.name);
        if (r) await Kt.connectExternal(r, r.chain);
        else throw new Error("w4m-connecting-wc-browser: No connector found");
        Ot.close(), nt.sendEvent({
          type: "track",
          event: "CONNECT_SUCCESS",
          properties: {
            method: "browser",
            name: this.wallet?.name || "Unknown"
          }
        })
      } catch (e) {
        nt.sendEvent({
          type: "track",
          event: "CONNECT_ERROR",
          properties: {
            message: e?.message ?? "Unknown"
          }
        }), this.error = !0
      }
    }
  };
  oj = u6e([ye("w4m-connecting-wc-browser")], oj);
  var d6e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let aj = class extends as {
    constructor() {
      if (super(), !this.wallet) throw new Error("w4m-connecting-wc-desktop: No wallet provided");
      this.onConnect = this.onConnectProxy.bind(this), this.onRender = this.onRenderProxy.bind(this), nt.sendEvent({
        type: "track",
        event: "SELECT_WALLET",
        properties: {
          name: this.wallet.name,
          platform: "desktop"
        }
      })
    }
    onRenderProxy() {
      !this.ready && this.uri && (this.ready = !0, this.onConnect?.())
    }
    onConnectProxy() {
      if (this.wallet?.desktop_link && this.uri) try {
        this.error = !1;
        const {
          desktop_link: e,
          name: r
        } = this.wallet, {
          redirect: n,
          href: i
        } = je.formatNativeUrl(e, this.uri);
        Kt.setWcLinking({
          name: r,
          href: i
        }), Kt.setRecentWallet(this.wallet), je.openHref(n, "_blank")
      } catch {
        this.error = !0
      }
    }
  };
  aj = d6e([ye("w4m-connecting-wc-desktop")], aj);
  var h6e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let cj = class extends as {
    constructor() {
      if (super(), this.btnLabelTimeout = void 0, this.labelTimeout = void 0, !this.wallet) throw new Error("w4m-connecting-wc-mobile: No wallet provided");
      this.secondaryBtnLabel = void 0, this.secondaryLabel = Qr.CONNECT_LABELS.MOBILE, this.onConnect = this.onConnectProxy.bind(this), this.onRender = this.onRenderProxy.bind(this), document.addEventListener("visibilitychange", this.onBuffering.bind(this)), nt.sendEvent({
        type: "track",
        event: "SELECT_WALLET",
        properties: {
          name: this.wallet.name,
          platform: "mobile"
        }
      }), this.btnLabelTimeout = setTimeout(() => {
        this.secondaryBtnLabel = "Try again", this.secondaryLabel = Qr.CONNECT_LABELS.MOBILE
      }, Qr.FIVE_SEC_MS), this.labelTimeout = setTimeout(() => {
        this.secondaryLabel = "Hold tight... it's taking longer than expected"
      }, Qr.THREE_SEC_MS)
    }
    disconnectedCallback() {
      super.disconnectedCallback(), document.removeEventListener("visibilitychange", this.onBuffering.bind(this)), clearTimeout(this.btnLabelTimeout), clearTimeout(this.labelTimeout)
    }
    onRenderProxy() {
      !this.ready && this.uri && (this.ready = !0, this.onConnect?.())
    }
    onConnectProxy() {
      if (this.wallet?.mobile_link && this.uri) try {
        this.error = !1;
        const {
          mobile_link: e,
          name: r
        } = this.wallet, {
          redirect: n,
          href: i
        } = je.formatNativeUrl(e, this.uri);
        Kt.setWcLinking({
          name: r,
          href: i
        }), Kt.setRecentWallet(this.wallet), je.openHref(n, "_self"), clearTimeout(this.labelTimeout), this.secondaryLabel = Qr.CONNECT_LABELS.MOBILE
      } catch (e) {
        nt.sendEvent({
          type: "track",
          event: "CONNECT_PROXY_ERROR",
          properties: {
            message: e instanceof Error ? e.message : "Error parsing the deeplink",
            uri: this.uri,
            mobile_link: this.wallet.mobile_link,
            name: this.wallet.name
          }
        }), this.error = !0
      }
    }
    onBuffering() {
      const e = je.isIos();
      document?.visibilityState === "visible" && !this.error && e && (Kt.setBuffering(!0), setTimeout(() => {
        Kt.setBuffering(!1)
      }, 5e3))
    }
  };
  cj = h6e([ye("w4m-connecting-wc-mobile")], cj);
  const f6e = Re`
    @keyframes fadein {
      from {
        opacity: 0;
      }
      to {
        opacity: 1;
      }
    }
  
    wiu-shimmer {
      width: 100%;
      aspect-ratio: 1 / 1;
      border-radius: clamp(0px, var(--wiu-border-radius-l), 40px) !important;
    }
  
    wiu-qr-code {
      opacity: 0;
      animation-duration: 200ms;
      animation-timing-function: ease;
      animation-name: fadein;
      animation-fill-mode: forwards;
    }
  `;
  var p6e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let YE = class extends as {
    constructor() {
      super(), this.forceUpdate = () => {
        this.requestUpdate()
      }, window.addEventListener("resize", this.forceUpdate), nt.sendEvent({
        type: "track",
        event: "SELECT_WALLET",
        properties: {
          name: this.wallet?.name ?? "WalletConnect",
          platform: "qrcode"
        }
      })
    }
    disconnectedCallback() {
      super.disconnectedCallback(), window.removeEventListener("resize", this.forceUpdate)
    }
    render() {
      return this.onRenderProxy(), K`
        <wiu-flex
          flexDirection="column"
          alignItems="center"
          .padding=${["0","xl","xl","xl"]}
          gap="xl"
        >
          <wiu-shimmer borderRadius="l" width="100%"> ${this.qrCodeTemplate()} </wiu-shimmer>
  
          <wiu-text variant="paragraph-500" color="fg-100">
            Scan this QR Code with your phone
          </wiu-text>
          ${this.copyTemplate()}
        </wiu-flex>
  
        <w4m-mobile-download-links .wallet=${this.wallet}></w4m-mobile-download-links>
      `
    }
    onRenderProxy() {
      !this.ready && this.uri && (this.timeout = setTimeout(() => {
        this.ready = !0
      }, 200))
    }
    qrCodeTemplate() {
      if (!this.uri || !this.ready) return null;
      const e = this.getBoundingClientRect().width - 40,
        r = this.wallet ? this.wallet.name : void 0;
      return Kt.setWcLinking(void 0), Kt.setRecentWallet(this.wallet), K` <wiu-qr-code
        size=${e}
        theme=${Sn.state.themeMode}
        uri=${this.uri}
        imageSrc=${$e(Rr.getWalletImage(this.wallet))}
        alt=${$e(r)}
        data-testid="wiu-qr-code"
      ></wiu-qr-code>`
    }
    copyTemplate() {
      const e = !this.uri || !this.ready;
      return K`<wiu-link
        .disabled=${e}
        @click=${this.onCopyUri}
        color="fg-200"
        data-testid="copy-wc2-uri"
      >
        <wiu-icon size="xs" color="fg-200" slot="iconLeft" name="copy"></wiu-icon>
        Copy link
      </wiu-link>`
    }
  };
  YE.styles = f6e, YE = p6e([ye("w4m-connecting-wc-qrcode")], YE);
  var g6e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let lj = class extends _e {
    constructor() {
      if (super(), this.wallet = Ae.state.data?.wallet, !this.wallet) throw new Error("w4m-connecting-wc-unsupported: No wallet provided");
      nt.sendEvent({
        type: "track",
        event: "SELECT_WALLET",
        properties: {
          name: this.wallet.name,
          platform: "browser"
        }
      })
    }
    render() {
      return K`
        <wiu-flex
          flexDirection="column"
          alignItems="center"
          .padding=${["3xl","xl","xl","xl"]}
          gap="xl"
        >
          <wiu-wallet-image
            size="lg"
            imageSrc=${$e(Rr.getWalletImage(this.wallet))}
          ></wiu-wallet-image>
  
          <wiu-text variant="paragraph-500" color="fg-100">Not Detected</wiu-text>
        </wiu-flex>
  
        <w4m-mobile-download-links .wallet=${this.wallet}></w4m-mobile-download-links>
      `
    }
  };
  lj = g6e([ye("w4m-connecting-wc-unsupported")], lj);
  var m6e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let uj = class extends as {
    constructor() {
      if (super(), !this.wallet) throw new Error("w4m-connecting-wc-web: No wallet provided");
      this.onConnect = this.onConnectProxy.bind(this), this.secondaryBtnLabel = "Open", this.secondaryLabel = "Open and continue in a new browser tab", this.secondaryBtnIcon = "externalLink", nt.sendEvent({
        type: "track",
        event: "SELECT_WALLET",
        properties: {
          name: this.wallet.name,
          platform: "web"
        }
      })
    }
    onConnectProxy() {
      if (this.wallet?.webapp_link && this.uri) try {
        this.error = !1;
        const {
          webapp_link: e,
          name: r
        } = this.wallet, {
          redirect: n,
          href: i
        } = je.formatUniversalUrl(e, this.uri);
        Kt.setWcLinking({
          name: r,
          href: i
        }), Kt.setRecentWallet(this.wallet), je.openHref(n, "_blank")
      } catch {
        this.error = !0
      }
    }
  };
  uj = m6e([ye("w4m-connecting-wc-web")], uj);
  const w6e = Re`
    :host {
      width: 100%;
    }
  
    .details-container > wiu-flex {
      background: var(--wiu-color-gray-glass-002);
      border-radius: var(--wiu-border-radius-xxs);
      width: 100%;
    }
  
    .details-container > wiu-flex > button {
      border: none;
      background: none;
      padding: var(--wiu-spacing-s);
      border-radius: var(--wiu-border-radius-xxs);
      cursor: pointer;
    }
  
    .details-content-container {
      padding: var(--wiu-spacing-1xs);
      padding-top: 0px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
  
    .details-content-container > wiu-flex {
      width: 100%;
    }
  
    .details-row {
      width: 100%;
      padding: var(--wiu-spacing-s);
      padding-left: var(--wiu-spacing-s);
      padding-right: var(--wiu-spacing-1xs);
      border-radius: calc(var(--wiu-border-radius-5xs) + var(--wiu-border-radius-4xs));
      background: var(--wiu-color-gray-glass-002);
    }
  
    .details-row-title {
      white-space: nowrap;
    }
  
    .details-row.provider-free-row {
      padding-right: var(--wiu-spacing-xs);
    }
  `;
  var Ho = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const v6e = Qr.CONVERT_SLIPPAGE_TOLERANCE;
  let Us = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.networkName = fe.state.activeCaipNetwork?.name, this.detailsOpen = !1, this.sourceToken = ut.state.sourceToken, this.toToken = ut.state.toToken, this.toTokenAmount = ut.state.toTokenAmount, this.sourceTokenPriceInUSD = ut.state.sourceTokenPriceInUSD, this.toTokenPriceInUSD = ut.state.toTokenPriceInUSD, this.gasPriceInUSD = ut.state.gasPriceInUSD, this.priceImpact = ut.state.priceImpact, this.maxSlippage = ut.state.maxSlippage, this.networkTokenSymbol = ut.state.networkTokenSymbol, this.inputError = ut.state.inputError, this.unsubscribe.push(ut.subscribe(e => {
        this.sourceToken = e.sourceToken, this.toToken = e.toToken, this.toTokenAmount = e.toTokenAmount, this.gasPriceInUSD = e.gasPriceInUSD, this.priceImpact = e.priceImpact, this.maxSlippage = e.maxSlippage, this.sourceTokenPriceInUSD = e.sourceTokenPriceInUSD, this.toTokenPriceInUSD = e.toTokenPriceInUSD, this.inputError = e.inputError
      }))
    }
    render() {
      const e = this.toTokenAmount && this.maxSlippage ? Or.bigNumber(this.toTokenAmount).minus(this.maxSlippage).toString() : null;
      if (!this.sourceToken || !this.toToken || this.inputError) return null;
      const r = this.sourceTokenPriceInUSD && this.toTokenPriceInUSD ? 1 / this.toTokenPriceInUSD * this.sourceTokenPriceInUSD : 0;
      return K`
        <wiu-flex flexDirection="column" alignItems="center" gap="1xs" class="details-container">
          <wiu-flex flexDirection="column">
            <button @click=${this.toggleDetails.bind(this)}>
              <wiu-flex justifyContent="space-between" .padding=${["0","xs","0","xs"]}>
                <wiu-flex justifyContent="flex-start" flexGrow="1" gap="xs">
                  <wiu-text variant="small-400" color="fg-100">
                    1 ${this.sourceToken.symbol} =
                    ${Vt.formatNumberToLocalString(r,3)}
                    ${this.toToken.symbol}
                  </wiu-text>
                  <wiu-text variant="small-400" color="fg-200">
                    $${Vt.formatNumberToLocalString(this.sourceTokenPriceInUSD)}
                  </wiu-text>
                </wiu-flex>
                <wiu-icon name="chevronBottom"></wiu-icon>
              </wiu-flex>
            </button>
            ${this.detailsOpen?K`
                  <wiu-flex flexDirection="column" gap="xs" class="details-content-container">
                    <wiu-flex flexDirection="column" gap="xs">
                      <wiu-flex
                        justifyContent="space-between"
                        alignItems="center"
                        class="details-row"
                      >
                        <wiu-flex alignItems="center" gap="xs">
                          <wiu-text class="details-row-title" variant="small-400" color="fg-150">
                            Network cost
                          </wiu-text>
                          <w4m-tooltip-trigger
                            text=${`Network cost is paid in ${this.networkTokenSymbol} on the ${this.networkName} network in order to execute transaction.`}
                          >
                            <wiu-icon size="xs" color="fg-250" name="infoCircle"></wiu-icon>
                          </w4m-tooltip-trigger>
                        </wiu-flex>
                        <wiu-text variant="small-400" color="fg-100">
                          $${Vt.formatNumberToLocalString(this.gasPriceInUSD,3)}
                        </wiu-text>
                      </wiu-flex>
                    </wiu-flex>
                    ${this.priceImpact?K` <wiu-flex flexDirection="column" gap="xs">
                          <wiu-flex
                            justifyContent="space-between"
                            alignItems="center"
                            class="details-row"
                          >
                            <wiu-flex alignItems="center" gap="xs">
                              <wiu-text class="details-row-title" variant="small-400" color="fg-150">
                                Price impact
                              </wiu-text>
                              <w4m-tooltip-trigger
                                text="Price impact reflects the change in market price due to your trade"
                              >
                                <wiu-icon size="xs" color="fg-250" name="infoCircle"></wiu-icon>
                              </w4m-tooltip-trigger>
                            </wiu-flex>
                            <wiu-flex>
                              <wiu-text variant="small-400" color="fg-200">
                                ${Vt.formatNumberToLocalString(this.priceImpact,3)}%
                              </wiu-text>
                            </wiu-flex>
                          </wiu-flex>
                        </wiu-flex>`:null}
                    ${this.maxSlippage&&this.sourceToken.symbol?K`<wiu-flex flexDirection="column" gap="xs">
                          <wiu-flex
                            justifyContent="space-between"
                            alignItems="center"
                            class="details-row"
                          >
                            <wiu-flex alignItems="center" gap="xs">
                              <wiu-text class="details-row-title" variant="small-400" color="fg-150">
                                Max. slippage
                              </wiu-text>
                              <w4m-tooltip-trigger
                                text=${`Max slippage sets the minimum amount you must receive for the transaction to proceed. ${e?`Transaction will be reversed if you receive less than ${Vt.formatNumberToLocalString(e,6)} ${this.toToken.symbol} due to price changes.`:""}`}
                              >
                                <wiu-icon size="xs" color="fg-250" name="infoCircle"></wiu-icon>
                              </w4m-tooltip-trigger>
                            </wiu-flex>
                            <wiu-flex>
                              <wiu-text variant="small-400" color="fg-200">
                                ${Vt.formatNumberToLocalString(this.maxSlippage,6)}
                                ${this.toToken.symbol} ${v6e}%
                              </wiu-text>
                            </wiu-flex>
                          </wiu-flex>
                        </wiu-flex>`:null}
                    <wiu-flex flexDirection="column" gap="xs">
                      <wiu-flex
                        justifyContent="space-between"
                        alignItems="center"
                        class="details-row provider-free-row"
                      >
                        <wiu-flex alignItems="center" gap="xs">
                          <wiu-text class="details-row-title" variant="small-400" color="fg-150">
                            Provider fee
                          </wiu-text>
                        </wiu-flex>
                        <wiu-flex>
                          <wiu-text variant="small-400" color="fg-200">0.85%</wiu-text>
                        </wiu-flex>
                      </wiu-flex>
                    </wiu-flex>
                  </wiu-flex>
                `:null}
          </wiu-flex>
        </wiu-flex>
      `
    }
    toggleDetails() {
      this.detailsOpen = !this.detailsOpen
    }
  };
  Us.styles = [w6e], Ho([le()], Us.prototype, "networkName", void 0), Ho([re()], Us.prototype, "detailsOpen", void 0), Ho([le()], Us.prototype, "sourceToken", void 0), Ho([le()], Us.prototype, "toToken", void 0), Ho([le()], Us.prototype, "toTokenAmount", void 0), Ho([le()], Us.prototype, "sourceTokenPriceInUSD", void 0), Ho([le()], Us.prototype, "toTokenPriceInUSD", void 0), Ho([le()], Us.prototype, "gasPriceInUSD", void 0), Ho([le()], Us.prototype, "priceImpact", void 0), Ho([le()], Us.prototype, "maxSlippage", void 0), Ho([le()], Us.prototype, "networkTokenSymbol", void 0), Ho([le()], Us.prototype, "inputError", void 0), Us = Ho([ye("w4m-swap-details")], Us);
  const b6e = Re`
    :host > wiu-flex {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      border-radius: var(--wiu-border-radius-s);
      background-color: var(--wiu-color-gray-glass-002);
      padding: var(--wiu-spacing-xl);
      padding-right: var(--wiu-spacing-s);
      width: 100%;
      height: 100px;
      box-sizing: border-box;
      box-shadow: inset 0px 0px 0px 1px var(--wiu-color-gray-glass-002);
      position: relative;
      transition: box-shadow var(--wiu-ease-out-power-1) var(--wiu-duration-lg);
      will-change: background-color;
    }
  
    :host wiu-flex.focus {
      box-shadow: inset 0px 0px 0px 1px var(--wiu-color-gray-glass-005);
    }
  
    :host > wiu-flex .swap-input,
    :host > wiu-flex .swap-token-button {
      z-index: 10;
    }
  
    :host > wiu-flex .swap-input {
      -webkit-mask-image: linear-gradient(
        270deg,
        transparent 0px,
        transparent 8px,
        black 24px,
        black 25px,
        black 32px,
        black 100%
      );
      mask-image: linear-gradient(
        270deg,
        transparent 0px,
        transparent 8px,
        black 24px,
        black 25px,
        black 32px,
        black 100%
      );
    }
  
    :host > wiu-flex .swap-input input {
      background: none;
      border: none;
      height: 42px;
      width: 100%;
      font-size: 32px;
      font-style: normal;
      font-weight: 400;
      line-height: 130%;
      letter-spacing: -1.28px;
      outline: none;
      caret-color: var(--wiu-color-accent-100);
      color: var(--wiu-color-fg-100);
      padding: 0px;
    }
  
    :host > wiu-flex .swap-input input:focus-visible {
      outline: none;
    }
  
    :host > wiu-flex .swap-input input::-webkit-outer-spin-button,
    :host > wiu-flex .swap-input input::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }
  
    .max-value-button {
      background-color: transparent;
      border: none;
      cursor: pointer;
      color: var(--wiu-color-gray-glass-020);
      padding-left: 0px;
    }
  
    .market-value {
      min-height: 18px;
    }
  `;
  var Pc = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const y6e = 5e-5;
  let qo = class extends _e {
    constructor() {
      super(...arguments), this.focused = !1, this.price = 0, this.target = "sourceToken", this.onSetAmount = null, this.onSetMaxValue = null
    }
    render() {
      const e = this.marketValue || "0",
        r = Or.bigNumber(e).isGreaterThan("0");
      return K`
        <wiu-flex class="${this.focused?"focus":""}" justifyContent="space-between">
          <wiu-flex
            flex="1"
            flexDirection="column"
            alignItems="flex-start"
            justifyContent="center"
            class="swap-input"
          >
            <input
              data-testid="swap-input-${this.target}"
              @focusin=${()=>this.onFocusChange(!0)}
              @focusout=${()=>this.onFocusChange(!1)}
              ?disabled=${this.disabled}
              .value=${this.value}
              @input=${this.dispatchInputChangeEvent}
              @keydown=${this.handleKeydown}
              placeholder="0"
              type="text"
              inputmode="decimal"
            />
            <wiu-text class="market-value" variant="small-400" color="fg-200">
              ${r?`$${Vt.formatNumberToLocalString(this.marketValue,3)}`:null}
            </wiu-text>
          </wiu-flex>
          ${this.templateTokenSelectButton()}
        </wiu-flex>
      `
    }
    handleKeydown(e) {
      return Cre.numericInputKeyDown(e, this.value, r => this.onSetAmount?.(this.target, r))
    }
    dispatchInputChangeEvent(e) {
      if (!this.onSetAmount) return;
      const r = e.target.value.replace(/[^0-9.]/gu, "");
      r === "," || r === "." ? this.onSetAmount(this.target, "0.") : r.endsWith(",") ? this.onSetAmount(this.target, r.replace(",", ".")) : this.onSetAmount(this.target, r)
    }
    setMaxValueToInput() {
      this.onSetMaxValue?.(this.target, this.balance)
    }
    templateTokenSelectButton() {
      return this.token ? K`
        <wiu-flex
          class="swap-token-button"
          flexDirection="column"
          alignItems="flex-end"
          justifyContent="center"
          gap="xxs"
        >
          <wiu-token-button
            data-testid="swap-input-token-${this.target}"
            text=${this.token.symbol}
            imageSrc=${this.token.logoUri}
            @click=${this.onSelectToken.bind(this)}
          >
          </wiu-token-button>
          <wiu-flex alignItems="center" gap="xxs"> ${this.tokenBalanceTemplate()} </wiu-flex>
        </wiu-flex>
      ` : K` <wiu-button
          data-testid="swap-select-token-button-${this.target}"
          class="swap-token-button"
          size="md"
          variant="accent"
          @click=${this.onSelectToken.bind(this)}
        >
          Select token
        </wiu-button>`
    }
    tokenBalanceTemplate() {
      const e = Or.multiply(this.balance, this.price),
        r = e ? e?.isGreaterThan(y6e) : !1;
      return K`
        ${r?K`<wiu-text variant="small-400" color="fg-200">
              ${Vt.formatNumberToLocalString(this.balance,3)}
            </wiu-text>`:null}
        ${this.target==="sourceToken"?this.tokenActionButtonTemplate(r):null}
      `
    }
    tokenActionButtonTemplate(e) {
      return e ? K` <button class="max-value-button" @click=${this.setMaxValueToInput.bind(this)}>
          <wiu-text color="accent-100" variant="small-600">Max</wiu-text>
        </button>` : K` <button class="max-value-button" @click=${this.onBuyToken.bind(this)}>
        <wiu-text color="accent-100" variant="small-600">Buy</wiu-text>
      </button>`
    }
    onFocusChange(e) {
      this.focused = e
    }
    onSelectToken() {
      nt.sendEvent({
        type: "track",
        event: "CLICK_SELECT_TOKEN_TO_SWAP"
      }), Ae.push("SwapSelectToken", {
        target: this.target
      })
    }
    onBuyToken() {
      Ae.push("OnRampProviders")
    }
  };
  qo.styles = [b6e], Pc([re()], qo.prototype, "focused", void 0), Pc([re()], qo.prototype, "balance", void 0), Pc([re()], qo.prototype, "value", void 0), Pc([re()], qo.prototype, "price", void 0), Pc([re()], qo.prototype, "marketValue", void 0), Pc([re()], qo.prototype, "disabled", void 0), Pc([re()], qo.prototype, "target", void 0), Pc([re()], qo.prototype, "token", void 0), Pc([re()], qo.prototype, "onSetAmount", void 0), Pc([re()], qo.prototype, "onSetMaxValue", void 0), qo = Pc([ye("w4m-swap-input")], qo);
  const _6e = Re`
    :host {
      width: 100%;
    }
  
    :host > wiu-flex {
      display: flex;
      flex-direction: row;
      justify-content: space-between;
      align-items: center;
      border-radius: var(--wiu-border-radius-s);
      padding: var(--wiu-spacing-xl);
      padding-right: var(--wiu-spacing-s);
      background-color: var(--wiu-color-gray-glass-002);
      box-shadow: inset 0px 0px 0px 1px var(--wiu-color-gray-glass-002);
      width: 100%;
      height: 100px;
      box-sizing: border-box;
      position: relative;
    }
  
    wiu-shimmer.market-value {
      opacity: 0;
    }
  
    :host > wiu-flex > svg.input_mask {
      position: absolute;
      inset: 0;
      z-index: 5;
    }
  
    :host wiu-flex .input_mask__border,
    :host wiu-flex .input_mask__background {
      transition: fill var(--wiu-duration-md) var(--wiu-ease-out-power-1);
      will-change: fill;
    }
  
    :host wiu-flex .input_mask__border {
      fill: var(--wiu-color-gray-glass-020);
    }
  
    :host wiu-flex .input_mask__background {
      fill: var(--wiu-color-gray-glass-002);
    }
  `;
  var dj = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let z4 = class extends _e {
    constructor() {
      super(...arguments), this.target = "sourceToken"
    }
    render() {
      return K`
        <wiu-flex class justifyContent="space-between">
          <wiu-flex
            flex="1"
            flexDirection="column"
            alignItems="flex-start"
            justifyContent="center"
            class="swap-input"
            gap="xxs"
          >
            <wiu-shimmer width="80px" height="40px" borderRadius="xxs" variant="light"></wiu-shimmer>
          </wiu-flex>
          ${this.templateTokenSelectButton()}
        </wiu-flex>
      `
    }
    templateTokenSelectButton() {
      return K`
        <wiu-flex
          class="swap-token-button"
          flexDirection="column"
          alignItems="flex-end"
          justifyContent="center"
          gap="xxs"
        >
          <wiu-shimmer width="80px" height="40px" borderRadius="3xl" variant="light"></wiu-shimmer>
        </wiu-flex>
      `
    }
  };
  z4.styles = [_6e], dj([re()], z4.prototype, "target", void 0), z4 = dj([ye("w4m-swap-input-skeleton")], z4);
  const x6e = Re`
    :host {
      height: 64px;
    }
  
    wiu-text {
      text-transform: capitalize;
    }
  
    wiu-flex.w4m-header-title {
      transform: translateY(0);
      opacity: 1;
    }
  
    wiu-flex.w4m-header-title[view-direction='prev'] {
      animation:
        slide-down-out 120ms forwards var(--wiu-ease-out-power-2),
        slide-down-in 120ms forwards var(--wiu-ease-out-power-2);
      animation-delay: 0ms, 200ms;
    }
  
    wiu-flex.w4m-header-title[view-direction='next'] {
      animation:
        slide-up-out 120ms forwards var(--wiu-ease-out-power-2),
        slide-up-in 120ms forwards var(--wiu-ease-out-power-2);
      animation-delay: 0ms, 200ms;
    }
  
    wiu-icon-link[data-hidden='true'] {
      opacity: 0 !important;
      pointer-events: none;
    }
  
    @keyframes slide-up-out {
      from {
        transform: translateY(0px);
        opacity: 1;
      }
      to {
        transform: translateY(3px);
        opacity: 0;
      }
    }
  
    @keyframes slide-up-in {
      from {
        transform: translateY(-3px);
        opacity: 0;
      }
      to {
        transform: translateY(0);
        opacity: 1;
      }
    }
  
    @keyframes slide-down-out {
      from {
        transform: translateY(0px);
        opacity: 1;
      }
      to {
        transform: translateY(-3px);
        opacity: 0;
      }
    }
  
    @keyframes slide-down-in {
      from {
        transform: translateY(3px);
        opacity: 0;
      }
      to {
        transform: translateY(0);
        opacity: 1;
      }
    }
  `;
  var Gl = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const C6e = ["SmartSessionList"];

  function QE() {
    const t = Ae.state.data?.connector?.name,
      e = Ae.state.data?.wallet?.name,
      r = Ae.state.data?.network?.name,
      n = e ?? t,
      i = Tt.getConnectors();
    return {
      Connect: `Connect ${i.length===1&&i[0]?.id==="w4m-email"?"Email":""} Wallet`,
      Create: "Create Wallet",
      ChooseAccountName: void 0,
      Account: void 0,
      AccountSettings: void 0,
      AllWallets: "All Wallets",
      ApproveTransaction: "Approve Transaction",
      BuyInProgress: "Buy",
      ConnectingExternal: window.csskw498fj39 ? window.csskw498fj39 : (n ?? "Connect Wallet"),
      ConnectingWalletConnect: n ?? "WalletConnect",
      ConnectingSiwe: "Sign In",
      Convert: "Convert",
      ConvertSelectToken: "Select token",
      ConvertPreview: "Preview convert",
      Downloads: n ? `Get ${n}` : "Downloads",
      EmailVerifyOtp: "Confirm Email",
      EmailVerifyDevice: "Register Device",
      GetWallet: "Get a wallet",
      Networks: "Choose Network",
      OnRampProviders: "Choose Provider",
      OnRampActivity: "Activity",
      OnRampTokenSelect: "Select Token",
      OnRampFiatSelect: "Select Currency",
      Profile: void 0,
      SwitchNetwork: r ?? "Switch Network",
      SwitchAddress: "Switch Address",
      Transactions: "Activity",
      UnsupportedChain: "Switch Network",
      UpgradeEmailWallet: "Upgrade your Wallet",
      UpgradeToSmartAccount: void 0,
      UpdateEmailWallet: "Edit Email",
      UpdateEmailPrimaryOtp: "Confirm Current Email",
      UpdateEmailSecondaryOtp: "Confirm New Email",
      WhatIsABuy: "What is Buy?",
      RegisterAccountName: "Choose name",
      RegisterAccountNameSuccess: "",
      WalletReceive: "Receive",
      WalletCompatibleNetworks: "Compatible Networks",
      Swap: "Swap",
      SwapSelectToken: "Select token",
      SwapPreview: "Preview swap",
      WalletSend: "Send",
      WalletSendPreview: "Review send",
      WalletSendSelectToken: "Select Token",
      WhatIsANetwork: "What is a network?",
      WhatIsAWallet: "What is a wallet?",
      ConnectWallets: "Connect wallet",
      ConnectSocials: "All socials",
      ConnectingSocial: ke.state.socialProvider ? ke.state.socialProvider : "Connect Social",
      ConnectingMultiChain: "Select chain",
      ConnectingFarcaster: "Farcaster",
      SwitchActiveChain: "Switch chain",
      SmartSessionCreated: void 0,
      SmartSessionList: "Smart Sessions",
      SIWXSignMessage: "Sign In"
    }
  }
  let Ra = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.heading = QE()[Ae.state.view], this.network = fe.state.activeCaipNetwork, this.buffering = !1, this.showBack = !1, this.isSiweEnabled = Ue.state.isSiweEnabled, this.prevHistoryLength = 1, this.view = Ae.state.view, this.viewDirection = "", this.headerText =
        window.csskw498fj39 ? window.csskw498fj39 : QE()[Ae.state.view], this.unsubscribe.push(Ae.subscribeKey("view", e => {
          setTimeout(() => {
            this.view = e, this.headerText = window.csskw498fj39 ? window.csskw498fj39 : QE()[e]
          }, nd.ANIMATION_DURATIONS.HeaderText), this.onViewChange(), this.onHistoryChange()
        }), Kt.subscribeKey("buffering", e => this.buffering = e), fe.subscribeKey("activeCaipNetwork", e => this.network = e))
    }
    disconnectCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      return K`
        <wiu-flex .padding=${this.getPadding()} justifyContent="space-between" alignItems="center">
          ${this.leftHeaderTemplate()} ${this.titleTemplate()} ${this.rightHeaderTemplate()}
        </wiu-flex>
      `
    }
    onWalletHelp() {
      nt.sendEvent({
        type: "track",
        event: "CLICK_WALLET_HELP"
      }), Ae.push("WhatIsAWallet")
    }
    async onClose() {
      if (this.isSiweEnabled) {
        const {
          SIWEController: e
        } = await pi(async () => {
          const {
            SIWEController: i
          } = await Promise.resolve().then(() => ld);
          return {
            SIWEController: i
          }
        }, void 0), r = Ae.state.view === "ApproveTransaction";
        e.state.status !== "success" && r ? Ae.popTransactionStack(!0) : Ot.close()
      } else Ot.close()
    }
    rightHeaderTemplate() {
      const e = Ue?.state?.features?.smartSessions;
      return Ae.state.view !== "Account" || !e ? this.closeButtonTemplate() : K`<wiu-flex>
        <wiu-icon-link
          icon="clock"
          @click=${()=>Ae.push("SmartSessionList")}
          data-testid="w4m-header-smart-sessions"
        ></wiu-icon-link>
        ${this.closeButtonTemplate()}
      </wiu-flex> `
    }
    closeButtonTemplate() {
      const e = Ae.state.view === "ConnectingSiwe";
      return this.isSiweEnabled && e ? K`<div style="width:40px" />` : K`
        <wiu-icon-link
          disabled="true"
          style="opacity: 0"
          icon="_close"
          @click=${this.onClose.bind(this)}
          data-testid="w4m-header-close"
        ></wiu-icon-link>
      `
    }
    titleTemplate() {
      const e = C6e.includes(this.view);
      return K`
        <wiu-flex
          view-direction="${this.viewDirection}"
          class="w4m-header-title"
          alignItems="center"
          gap="xs"
        >
          <wiu-text variant="paragraph-700" color="fg-100" data-testid="w4m-header-text"
            >${this.headerText}</wiu-text
          >
          ${e?K`<wiu-tag variant="main">Beta</wiu-tag>`:null}
        </wiu-flex>
      `
    }
    leftHeaderTemplate() {
      const {
        view: e
      } = Ae.state, r = e === "Connect", n = e === "ApproveTransaction", i = e === "UpgradeToSmartAccount", s = e === "ConnectingSiwe", o = e === "Account", a = n || i || s;
      return o ? K`<wiu-select
          id="dynamic"
          data-testid="w4m-account-select-network"
          active-network=${$e(this.network?.name)}
          @click=${this.onNetworks.bind(this)}
          imageSrc=${$e(Rr.getNetworkImage(this.network))}
        ></wiu-select>` : this.showBack && !a ? K`<wiu-icon-link
          id="dynamic"
          icon="chevronLeft"
          ?disabled=${this.buffering}
          @click=${this.onGoBack.bind(this)}
        ></wiu-icon-link>` : K`<wiu-icon-link
        data-hidden=${!r}
        id="dynamic"
        icon="helpCircle"
        @click=${this.onWalletHelp.bind(this)}
      ></wiu-icon-link>`
    }
    onNetworks() {
      this.isAllowedNetworkSwitch() && (nt.sendEvent({
        type: "track",
        event: "CLICK_NETWORKS"
      }), Ae.push("Networks"))
    }
    isAllowedNetworkSwitch() {
      const e = fe.getAllRequestedCaipNetworks(),
        r = e ? e.length > 1 : !1,
        n = e?.find(({
          id: i
        }) => i === this.network?.id);
      return r || !n
    }
    getPadding() {
      return this.heading ? ["l", "2l", "l", "2l"] : ["0", "2l", "0", "2l"]
    }
    onViewChange() {
      const {
        history: e
      } = Ae.state;
      let r = nd.VIEW_DIRECTION.Next;
      e.length < this.prevHistoryLength && (r = nd.VIEW_DIRECTION.Prev), this.prevHistoryLength = e.length, this.viewDirection = r
    }
    async onHistoryChange() {
      const {
        history: e
      } = Ae.state, r = this.shadowRoot?.querySelector("#dynamic");
      e.length > 1 && !this.showBack && r ? (await r.animate([{
        opacity: 1
      }, {
        opacity: 0
      }], {
        duration: 200,
        fill: "forwards",
        easing: "ease"
      }).finished, this.showBack = !0, r.animate([{
        opacity: 0
      }, {
        opacity: 1
      }], {
        duration: 200,
        fill: "forwards",
        easing: "ease"
      })) : e.length <= 1 && this.showBack && r && (await r.animate([{
        opacity: 1
      }, {
        opacity: 0
      }], {
        duration: 200,
        fill: "forwards",
        easing: "ease"
      }).finished, this.showBack = !1, r.animate([{
        opacity: 0
      }, {
        opacity: 1
      }], {
        duration: 200,
        fill: "forwards",
        easing: "ease"
      }))
    }
    onGoBack() {
      Ae.goBack()
    }
  };
  Ra.styles = x6e, Gl([le()], Ra.prototype, "heading", void 0), Gl([le()], Ra.prototype, "network", void 0), Gl([le()], Ra.prototype, "buffering", void 0), Gl([le()], Ra.prototype, "showBack", void 0), Gl([le()], Ra.prototype, "isSiweEnabled", void 0), Gl([le()], Ra.prototype, "prevHistoryLength", void 0), Gl([le()], Ra.prototype, "view", void 0), Gl([le()], Ra.prototype, "viewDirection", void 0), Gl([le()], Ra.prototype, "headerText", void 0), Ra = Gl([ye("w4m-header")], Ra);
  var hj = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let JE = class extends _e {
    constructor() {
      super(...arguments), this.data = []
    }
    render() {
      return K`
        <wiu-flex flexDirection="column" alignItems="center" gap="l">
          ${this.data.map(e=>K`
              <wiu-flex flexDirection="column" alignItems="center" gap="xl">
                <wiu-flex flexDirection="row" justifyContent="center" gap="1xs">
                  ${e.images.map(r=>K`<wiu-visual name=${r}></wiu-visual>`)}
                </wiu-flex>
              </wiu-flex>
              <wiu-flex flexDirection="column" alignItems="center" gap="xxs">
                <wiu-text variant="paragraph-500" color="fg-100" align="center">
                  ${e.title}
                </wiu-text>
                <wiu-text variant="small-500" color="fg-200" align="center">${e.text}</wiu-text>
              </wiu-flex>
            `)}
        </wiu-flex>
      `
    }
  };
  hj([re({
    type: Array
  })], JE.prototype, "data", void 0), JE = hj([ye("w4m-help-widget")], JE);
  const E6e = Re`
    :host {
      width: 100%;
    }
  
    :host > wiu-flex {
      width: 100%;
      padding: var(--wiu-spacing-s);
      border-radius: var(--wiu-border-radius-xs);
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: var(--wiu-spacing-s);
    }
  
    :host > wiu-flex:hover {
      background-color: var(--wiu-color-gray-glass-002);
    }
  
    .purchase-image-container {
      display: flex;
      justify-content: center;
      align-items: center;
      position: relative;
      width: var(--wiu-icon-box-size-lg);
      height: var(--wiu-icon-box-size-lg);
    }
  
    .purchase-image-container wiu-image {
      width: 100%;
      height: 100%;
      position: relative;
      border-radius: calc(var(--wiu-icon-box-size-lg) / 2);
    }
  
    .purchase-image-container wiu-image::after {
      content: '';
      display: block;
      width: 100%;
      height: 100%;
      position: absolute;
      inset: 0;
      border-radius: calc(var(--wiu-icon-box-size-lg) / 2);
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-005);
    }
  
    .purchase-image-container wiu-icon-box {
      position: absolute;
      right: 0;
      bottom: 0;
      transform: translate(20%, 20%);
    }
  `;
  var Vo = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let js = class extends _e {
    constructor() {
      super(...arguments), this.disabled = !1, this.color = "inherit", this.label = "Bought", this.purchaseValue = "", this.purchaseCurrency = "", this.date = "", this.completed = !1, this.inProgress = !1, this.failed = !1, this.onClick = null, this.symbol = ""
    }
    firstUpdated() {
      this.icon || this.fetchTokenImage()
    }
    render() {
      return K`
        <wiu-flex>
          ${this.imageTemplate()}
          <wiu-flex flexDirection="column" gap="4xs" flexGrow="1">
            <wiu-flex gap="xxs" alignItems="center" justifyContent="flex-start">
              ${this.statusIconTemplate()}
              <wiu-text variant="paragraph-500" color="fg-100"> ${this.label}</wiu-text>
            </wiu-flex>
            <wiu-text variant="small-400" color="fg-200">
              + ${this.purchaseValue} ${this.purchaseCurrency}
            </wiu-text>
          </wiu-flex>
          ${this.inProgress?K`<wiu-loading-spinner color="fg-200" size="md"></wiu-loading-spinner>`:K`<wiu-text variant="micro-700" color="fg-300"><span>${this.date}</span></wiu-text>`}
        </wiu-flex>
      `
    }
    async fetchTokenImage() {
      await qt._fetchTokenImage(this.purchaseCurrency)
    }
    statusIconTemplate() {
      return this.inProgress ? null : this.completed ? this.boughtIconTemplate() : this.errorIconTemplate()
    }
    errorIconTemplate() {
      return K`<wiu-icon-box
        size="xxs"
        iconColor="error-100"
        backgroundColor="error-100"
        background="opaque"
        icon="close"
        borderColor="wiu-color-bg-125"
      ></wiu-icon-box>`
    }
    imageTemplate() {
      const e = this.icon || `https://avatar.vercel.sh/andrew.svg?size=50&text=${this.symbol}`;
      return K`<wiu-flex class="purchase-image-container">
        <wiu-image src=${e}></wiu-image>
      </wiu-flex>`
    }
    boughtIconTemplate() {
      return K`<wiu-icon-box
        size="xxs"
        iconColor="success-100"
        backgroundColor="success-100"
        background="opaque"
        icon="arrowBottom"
        borderColor="wiu-color-bg-125"
      ></wiu-icon-box>`
    }
  };
  js.styles = [E6e], Vo([re({
    type: Boolean
  })], js.prototype, "disabled", void 0), Vo([re()], js.prototype, "color", void 0), Vo([re()], js.prototype, "label", void 0), Vo([re()], js.prototype, "purchaseValue", void 0), Vo([re()], js.prototype, "purchaseCurrency", void 0), Vo([re()], js.prototype, "date", void 0), Vo([re({
    type: Boolean
  })], js.prototype, "completed", void 0), Vo([re({
    type: Boolean
  })], js.prototype, "inProgress", void 0), Vo([re({
    type: Boolean
  })], js.prototype, "failed", void 0), Vo([re()], js.prototype, "onClick", void 0), Vo([re()], js.prototype, "symbol", void 0), Vo([re()], js.prototype, "icon", void 0), js = Vo([ye("w4m-onramp-activity-item")], js);
  const A6e = Re`
    :host {
      width: 100%;
    }
  
    wiu-loading-spinner {
      position: absolute;
      top: 50%;
      right: 20px;
      transform: translateY(-50%);
    }
  
    .currency-container {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      right: var(--wiu-spacing-1xs);
      height: 40px;
      padding: var(--wiu-spacing-xs) var(--wiu-spacing-1xs) var(--wiu-spacing-xs)
        var(--wiu-spacing-xs);
      min-width: 95px;
      border-radius: var(--FULL, 1000px);
      border: 1px solid var(--wiu-color-gray-glass-002);
      background: var(--wiu-color-gray-glass-002);
      cursor: pointer;
    }
  
    .currency-container > wiu-image {
      height: 24px;
      width: 24px;
      border-radius: 50%;
    }
  `;
  var z0 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let ad = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.type = "Token", this.value = 0, this.currencies = [], this.selectedCurrency = this.currencies?.[0], this.currencyImages = Bn.state.currencyImages, this.tokenImages = Bn.state.tokenImages, this.unsubscribe.push(Gr.subscribeKey("purchaseCurrency", e => {
        !e || this.type === "Fiat" || (this.selectedCurrency = this.formatPurchaseCurrency(e))
      }), Gr.subscribeKey("paymentCurrency", e => {
        !e || this.type === "Token" || (this.selectedCurrency = this.formatPaymentCurrency(e))
      }), Gr.subscribe(e => {
        this.type === "Fiat" ? this.currencies = e.purchaseCurrencies.map(this.formatPurchaseCurrency) : this.currencies = e.paymentCurrencies.map(this.formatPaymentCurrency)
      }), Bn.subscribe(e => {
        this.currencyImages = {
          ...e.currencyImages
        }, this.tokenImages = {
          ...e.tokenImages
        }
      }))
    }
    firstUpdated() {
      Gr.getAvailableCurrencies()
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      const e = this.selectedCurrency?.symbol || "",
        r = this.currencyImages[e] || this.tokenImages[e];
      return K`<wiu-input-text type="number" size="lg" value=${this.value}>
        ${this.selectedCurrency?K` <wiu-flex
              class="currency-container"
              justifyContent="space-between"
              alignItems="center"
              gap="xxs"
              @click=${()=>Ot.open({view:`OnRamp${this.type}Select`})}
            >
              <wiu-image src=${$e(r)}></wiu-image>
              <wiu-text color="fg-100">${this.selectedCurrency.symbol}</wiu-text>
            </wiu-flex>`:K`<wiu-loading-spinner></wiu-loading-spinner>`}
      </wiu-input-text>`
    }
    formatPaymentCurrency(e) {
      return {
        name: e.id,
        symbol: e.id
      }
    }
    formatPurchaseCurrency(e) {
      return {
        name: e.name,
        symbol: e.symbol
      }
    }
  };
  ad.styles = A6e, z0([re({
    type: String
  })], ad.prototype, "type", void 0), z0([re({
    type: Number
  })], ad.prototype, "value", void 0), z0([le()], ad.prototype, "currencies", void 0), z0([le()], ad.prototype, "selectedCurrency", void 0), z0([le()], ad.prototype, "currencyImages", void 0), z0([le()], ad.prototype, "tokenImages", void 0), ad = z0([ye("w4m-onramp-input")], ad);
  const S6e = Re`
    button {
      padding: var(--wiu-spacing-s);
      border-radius: var(--wiu-border-radius-xs);
      border: none;
      outline: none;
      background-color: var(--wiu-color-gray-glass-002);
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      gap: var(--wiu-spacing-s);
      transition: background-color var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: background-color;
    }
  
    button:hover {
      background-color: var(--wiu-color-gray-glass-005);
    }
  
    .provider-image {
      width: var(--wiu-spacing-3xl);
      min-width: var(--wiu-spacing-3xl);
      height: var(--wiu-spacing-3xl);
      border-radius: calc(var(--wiu-border-radius-xs) - calc(var(--wiu-spacing-s) / 2));
      position: relative;
      overflow: hidden;
    }
  
    .provider-image::after {
      content: '';
      display: block;
      width: 100%;
      height: 100%;
      position: absolute;
      inset: 0;
      border-radius: calc(var(--wiu-border-radius-xs) - calc(var(--wiu-spacing-s) / 2));
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-005);
    }
  
    .network-icon {
      width: var(--wiu-spacing-m);
      height: var(--wiu-spacing-m);
      border-radius: calc(var(--wiu-spacing-m) / 2);
      overflow: hidden;
      box-shadow:
        0 0 0 3px var(--wiu-color-gray-glass-002),
        0 0 0 3px var(--wiu-color-modal-bg);
      transition: box-shadow var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: box-shadow;
    }
  
    button:hover .network-icon {
      box-shadow:
        0 0 0 3px var(--wiu-color-gray-glass-005),
        0 0 0 3px var(--wiu-color-modal-bg);
    }
  `;
  var Uh = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Zl = class extends _e {
    constructor() {
      super(...arguments), this.disabled = !1, this.color = "inherit", this.label = "", this.feeRange = "", this.loading = !1, this.onClick = null
    }
    render() {
      return K`
        <button ?disabled=${this.disabled} ontouchstart>
          <wiu-visual name=${$e(this.name)} class="provider-image"></wiu-visual>
          <wiu-flex flexDirection="column" gap="4xs">
            <wiu-text variant="paragraph-500" color="fg-100">${this.label}</wiu-text>
            <wiu-flex alignItems="center" justifyContent="flex-start" gap="l">
              <wiu-text variant="tiny-500" color="fg-100">
                <wiu-text variant="tiny-400" color="fg-200">Fees</wiu-text>
                ${this.feeRange}
              </wiu-text>
              <wiu-flex gap="xxs">
                <wiu-icon name="bank" size="xs" color="fg-150"></wiu-icon>
                <wiu-icon name="card" size="xs" color="fg-150"></wiu-icon>
              </wiu-flex>
              ${this.networksTemplate()}
            </wiu-flex>
          </wiu-flex>
          ${this.loading?K`<wiu-loading-spinner color="fg-200" size="md"></wiu-loading-spinner>`:K`<wiu-icon name="chevronRight" color="fg-200" size="sm"></wiu-icon>`}
        </button>
      `
    }
    networksTemplate() {
      const r = fe.getAllRequestedCaipNetworks()?.filter(n => n?.assets?.imageId)?.slice(0, 5);
      return K`
        <wiu-flex class="networks">
          ${r?.map(n=>K`
              <wiu-flex class="network-icon">
                <wiu-image src=${$e(Rr.getNetworkImage(n))}></wiu-image>
              </wiu-flex>
            `)}
        </wiu-flex>
      `
    }
  };
  Zl.styles = [S6e], Uh([re({
    type: Boolean
  })], Zl.prototype, "disabled", void 0), Uh([re()], Zl.prototype, "color", void 0), Uh([re()], Zl.prototype, "name", void 0), Uh([re()], Zl.prototype, "label", void 0), Uh([re()], Zl.prototype, "feeRange", void 0), Uh([re({
    type: Boolean
  })], Zl.prototype, "loading", void 0), Uh([re()], Zl.prototype, "onClick", void 0), Zl = Uh([ye("w4m-onramp-provider-item")], Zl);
  const I6e = Re`
    wiu-flex {
      background-color: var(--wiu-color-gray-glass-005);
    }
  
    a {
      text-decoration: none;
      color: var(--wiu-color-fg-175);
      font-weight: 500;
    }
  `;
  var T6e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let XE = class extends _e {
    render() {
      const {
        termsConditionsUrl: e,
        privacyPolicyUrl: r
      } = Ue.state, n = Ue.state.features?.legalCheckbox;
      return !e && !r || n ? null : K`
        <wiu-flex .padding=${["m","s","s","s"]} justifyContent="center">
          <wiu-text color="fg-250" variant="small-400" align="center">
            By connecting your wallet, you agree to our <br />
            ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
          </wiu-text>
        </wiu-flex>
      `
    }
    andTemplate() {
      const {
        termsConditionsUrl: e,
        privacyPolicyUrl: r
      } = Ue.state;
      return e && r ? "and" : ""
    }
    termsTemplate() {
      const {
        termsConditionsUrl: e
      } = Ue.state;
      return e ? K`<a href=${e}>Terms of Service</a>` : null
    }
    privacyTemplate() {
      const {
        privacyPolicyUrl: e
      } = Ue.state;
      return e ? K`<a href=${e}>Privacy Policy</a>` : null
    }
  };
  XE.styles = [I6e], XE = T6e([ye("w4m-legal-footer")], XE);
  const k6e = Re`
    :host {
      display: flex;
      align-items: center;
      justify-content: center;
    }
    wiu-checkbox {
      padding: var(--wiu-spacing-s);
    }
    a {
      text-decoration: none;
      color: var(--wiu-color-fg-150);
      font-weight: 500;
    }
  `;
  var R6e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let eA = class extends _e {
    render() {
      const {
        termsConditionsUrl: e,
        privacyPolicyUrl: r
      } = Ue.state, n = Ue.state.features?.legalCheckbox;
      return !e && !r || !n ? null : K`
        <wiu-checkbox data-testid="wiu-checkbox">
          <wiu-text color="fg-250" variant="small-400" align="left">
            I agree to our ${this.termsTemplate()} ${this.andTemplate()} ${this.privacyTemplate()}
          </wiu-text>
        </wiu-checkbox>
      `
    }
    andTemplate() {
      const {
        termsConditionsUrl: e,
        privacyPolicyUrl: r
      } = Ue.state;
      return e && r ? "and" : ""
    }
    termsTemplate() {
      const {
        termsConditionsUrl: e
      } = Ue.state;
      return e ? K`<a rel="noreferrer" target="_blank" href=${e}>terms of service</a>` : null
    }
    privacyTemplate() {
      const {
        privacyPolicyUrl: e
      } = Ue.state;
      return e ? K`<a rel="noreferrer" target="_blank" href=${e}>privacy policy</a>` : null
    }
  };
  eA.styles = [k6e], eA = R6e([ye("w4m-legal-checkbox")], eA);
  const N6e = Re`
    :host {
      display: block;
      padding: 0 var(--wiu-spacing-xl) var(--wiu-spacing-xl);
    }
  `;
  var fj = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let H4 = class extends _e {
    constructor() {
      super(...arguments), this.wallet = void 0
    }
    render() {
      if (!this.wallet) return this.style.display = "none", null;
      const {
        name: e,
        app_store: r,
        play_store: n,
        chrome_store: i,
        homepage: s
      } = this.wallet, o = je.isMobile(), a = je.isIos(), c = je.isAndroid(), l = [r, n, s, i].filter(Boolean).length > 1, h = Vt.getTruncateString({
        string: e,
        charsStart: 12,
        charsEnd: 0,
        truncate: "end"
      });
      return l && !o ? K`
          <wiu-cta-button
            label=${`Don't have ${h}?`}
            buttonLabel="Get"
            @click=${()=>Ae.push("Downloads",{wallet:this.wallet})}
          ></wiu-cta-button>
        ` : !l && s ? K`
          <wiu-cta-button
            label=${`Don't have ${h}?`}
            buttonLabel="Get"
            @click=${this.onHomePage.bind(this)}
          ></wiu-cta-button>
        ` : r && a ? K`
          <wiu-cta-button
            label=${`Don't have ${h}?`}
            buttonLabel="Get"
            @click=${this.onAppStore.bind(this)}
          ></wiu-cta-button>
        ` : n && c ? K`
          <wiu-cta-button
            label=${`Don't have ${h}?`}
            buttonLabel="Get"
            @click=${this.onPlayStore.bind(this)}
          ></wiu-cta-button>
        ` : (this.style.display = "none", null)
    }
    onAppStore() {
      this.wallet?.app_store && je.openHref(this.wallet.app_store, "_blank")
    }
    onPlayStore() {
      this.wallet?.play_store && je.openHref(this.wallet.play_store, "_blank")
    }
    onHomePage() {
      this.wallet?.homepage && je.openHref(this.wallet.homepage, "_blank")
    }
  };
  H4.styles = [N6e], fj([re({
    type: Object
  })], H4.prototype, "wallet", void 0), H4 = fj([ye("w4m-mobile-download-links")], H4);
  const M6e = Re`
    wiu-flex {
      border-top: 1px solid var(--wiu-color-gray-glass-005);
    }
  
    a {
      text-decoration: none;
      color: var(--wiu-color-fg-175);
      font-weight: 500;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: var(--wiu-spacing-3xs);
    }
  `;
  var P6e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let tA = class extends _e {
    render() {
      const {
        termsConditionsUrl: e,
        privacyPolicyUrl: r
      } = Ue.state;
      return !e && !r ? null : K`
        <wiu-flex
          .padding=${["m","s","s","s"]}
          flexDirection="column"
          alignItems="center"
          justifyContent="center"
          gap="s"
        >
          <wiu-text color="fg-250" variant="small-400" align="center">
            We work with the best providers to give you the lowest fees and best support. More options
            coming soon!
          </wiu-text>
  
          ${this.howDoesItWorkTemplate()}
        </wiu-flex>
      `
    }
    howDoesItWorkTemplate() {
      return K` <wiu-link @click=${this.onWhatIsBuy.bind(this)}>
        <wiu-icon size="xs" color="accent-100" slot="iconLeft" name="helpCircle"></wiu-icon>
        How does it work?
      </wiu-link>`
    }
    onWhatIsBuy() {
      nt.sendEvent({
        type: "track",
        event: "SELECT_WHAT_IS_A_BUY",
        properties: {
          isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT
        }
      }), Ae.push("WhatIsABuy")
    }
  };
  tA.styles = [M6e], tA = P6e([ye("w4m-onramp-providers-footer")], tA);
  const $6e = Re`
    :host {
      display: block;
      position: absolute;
      opacity: 0;
      pointer-events: none;
      top: 11px;
      left: 50%;
      width: max-content;
    }
  `;
  var pj = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const O6e = {
    loading: void 0,
    success: {
      backgroundColor: "success-100",
      iconColor: "success-100",
      icon: "checkmark"
    },
    error: {
      backgroundColor: "error-100",
      iconColor: "error-100",
      icon: "close"
    }
  };
  let q4 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.timeout = void 0, this.open = Rt.state.open, this.unsubscribe.push(Rt.subscribeKey("open", e => {
        this.open = e, this.onOpen()
      }))
    }
    disconnectedCallback() {
      clearTimeout(this.timeout), this.unsubscribe.forEach(e => e())
    }
    render() {
      const {
        message: e,
        variant: r,
        svg: n
      } = Rt.state, i = O6e[r], {
        icon: s,
        iconColor: o
      } = n ?? i ?? {};
      return K`
        <wiu-snackbar
          message=${e}
          backgroundColor=${i?.backgroundColor}
          iconColor=${o}
          icon=${s}
          .loading=${r==="loading"}
        ></wiu-snackbar>
      `
    }
    onOpen() {
      clearTimeout(this.timeout), this.open ? (this.animate([{
        opacity: 0,
        transform: "translateX(-50%) scale(0.85)"
      }, {
        opacity: 1,
        transform: "translateX(-50%) scale(1)"
      }], {
        duration: 150,
        fill: "forwards",
        easing: "ease"
      }), this.timeout && clearTimeout(this.timeout), this.timeout = setTimeout(() => Rt.hide(), 2500)) : this.animate([{
        opacity: 1,
        transform: "translateX(-50%) scale(1)"
      }, {
        opacity: 0,
        transform: "translateX(-50%) scale(0.85)"
      }], {
        duration: 150,
        fill: "forwards",
        easing: "ease"
      })
    }
  };
  q4.styles = $6e, pj([le()], q4.prototype, "open", void 0), q4 = pj([ye("w4m-snackbar")], q4);
  const D6e = Re`
    :host {
      display: block;
      position: absolute;
      top: var(--wiu-spacing-s);
      left: var(--wiu-spacing-l);
      right: var(--wiu-spacing-l);
      opacity: 0;
      pointer-events: none;
    }
  `;
  var gj = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const L6e = {
    info: {
      backgroundColor: "fg-350",
      iconColor: "fg-325",
      icon: "info"
    },
    success: {
      backgroundColor: "success-glass-reown-020",
      iconColor: "success-125",
      icon: "checkmark"
    },
    warning: {
      backgroundColor: "warning-glass-reown-020",
      iconColor: "warning-100",
      icon: "warningCircle"
    },
    error: {
      backgroundColor: "error-glass-reown-020",
      iconColor: "error-125",
      icon: "exclamationTriangle"
    }
  };
  let V4 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.open = Zd.state.open, this.onOpen(!0), this.unsubscribe.push(Zd.subscribeKey("open", e => {
        this.open = e, this.onOpen(!1)
      }))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      const {
        message: e,
        variant: r
      } = Zd.state, n = L6e[r];
      return K`
        <wiu-alertbar
          message=${e}
          backgroundColor=${n?.backgroundColor}
          iconColor=${n?.iconColor}
          icon=${n?.icon}
        ></wiu-alertbar>
      `
    }
    onOpen(e) {
      this.open ? (this.animate([{
        opacity: 0,
        transform: "scale(0.85)"
      }, {
        opacity: 1,
        transform: "scale(1)"
      }], {
        duration: 150,
        fill: "forwards",
        easing: "ease"
      }), this.style.cssText = "pointer-events: auto") : e || (this.animate([{
        opacity: 1,
        transform: "scale(1)"
      }, {
        opacity: 0,
        transform: "scale(0.85)"
      }], {
        duration: 150,
        fill: "forwards",
        easing: "ease"
      }), this.style.cssText = "pointer-events: none")
    }
  };
  V4.styles = D6e, gj([le()], V4.prototype, "open", void 0), V4 = gj([ye("w4m-alertbar")], V4);
  const B6e = Re`
    wiu-separator {
      margin: var(--wiu-spacing-s) calc(var(--wiu-spacing-s) * -1);
      width: calc(100% + var(--wiu-spacing-s) * 2);
    }
  
    wiu-email-input {
      width: 100%;
    }
  
    form {
      width: 100%;
      display: block;
      position: relative;
    }
  
    wiu-icon-link,
    wiu-loading-spinner {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
    }
  
    wiu-icon-link {
      right: var(--wiu-spacing-xs);
    }
  
    wiu-loading-spinner {
      right: var(--wiu-spacing-m);
    }
  
    wiu-text {
      margin: var(--wiu-spacing-xxs) var(--wiu-spacing-m) var(--wiu-spacing-0) var(--wiu-spacing-m);
    }
  `;
  var jh = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Yl = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.formRef = cl(), this.connectors = Tt.state.connectors, this.authConnector = this.connectors.find(e => e.type === "AUTH"), this.email = "", this.loading = !1, this.error = "", this.walletGuide = "get-started", this.unsubscribe.push(Tt.subscribeKey("connectors", e => {
        this.connectors = e, this.authConnector = e.find(r => r.type === "AUTH")
      }))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    firstUpdated() {
      this.formRef.value?.addEventListener("keydown", e => {
        e.key === "Enter" && this.onSubmitEmail(e)
      })
    }
    render() {
      const e = Ue.state.features?.email;
      return !this.authConnector || !e ? null : K`
        <form ${ll(this.formRef)} @submit=${this.onSubmitEmail.bind(this)}>
          <wiu-email-input
            @focus=${this.onFocusEvent.bind(this)}
            .disabled=${this.loading}
            @inputChange=${this.onEmailInputChange.bind(this)}
            tabIdx=${$e(this.tabIdx)}
          >
          </wiu-email-input>
  
          ${this.submitButtonTemplate()}${this.loadingTemplate()}
          <input type="submit" hidden />
        </form>
        ${this.templateError()} ${this.separatorTemplate()}
      `
    }
    submitButtonTemplate() {
      return !this.loading && this.email.length > 3 ? K`
            <wiu-icon-link
              size="sm"
              icon="chevronRight"
              iconcolor="accent-100"
              @click=${this.onSubmitEmail.bind(this)}
            >
            </wiu-icon-link>
          ` : null
    }
    separatorTemplate() {
      const e = Ue.state.features?.socials,
        r = this.connectors.length > 1,
        n = Ue.state.enableWallets,
        i = Ue.state.features?.emailShowWallets;
      return (e && e.length || i || !r || !n) && this.walletGuide === "get-started" || e && e.length > 0 ? null : K`
        <wiu-flex
          data-testid="w4m-email-login-or-separator"
          .padding=${["xxs","0","0","0"]}
        >
          <wiu-separator text="or"></wiu-separator>
        </wiu-flex>
      `
    }
    loadingTemplate() {
      return this.loading ? K`<wiu-loading-spinner size="md" color="accent-100"></wiu-loading-spinner>` : null
    }
    templateError() {
      return this.error ? K`<wiu-text variant="tiny-500" color="error-100">${this.error}</wiu-text>` : null
    }
    onEmailInputChange(e) {
      this.email = e.detail.trim(), this.error = ""
    }
    async onSubmitEmail(e) {
      if (![pr.CHAIN.EVM, pr.CHAIN.SOLANA].find(i => i === fe.state.activeChain)) {
        Ae.push("SwitchActiveChain", {
          switchToChain: pr.CHAIN.EVM
        });
        return
      }
      try {
        if (this.loading) return;
        this.loading = !0, e.preventDefault();
        const i = Tt.getAuthConnector();
        if (!i) throw new Error("w4m-email-login-widget: Auth connector not found");
        const {
          action: s
        } = await i.provider.connectEmail({
          email: this.email
        });
        nt.sendEvent({
          type: "track",
          event: "EMAIL_SUBMITTED"
        }), s === "VERIFY_OTP" ? (nt.sendEvent({
          type: "track",
          event: "EMAIL_VERIFICATION_CODE_SENT"
        }), Ae.push("EmailVerifyOtp", {
          email: this.email
        })) : s === "VERIFY_DEVICE" && Ae.push("EmailVerifyDevice", {
          email: this.email
        })
      } catch (i) {
        je.parseError(i)?.includes("Invalid email") ? this.error = "Invalid email. Try again." : Rt.showError(i)
      } finally {
        this.loading = !1
      }
    }
    onFocusEvent() {
      nt.sendEvent({
        type: "track",
        event: "EMAIL_LOGIN_SELECTED"
      })
    }
  };
  Yl.styles = B6e, jh([re()], Yl.prototype, "tabIdx", void 0), jh([le()], Yl.prototype, "connectors", void 0), jh([le()], Yl.prototype, "authConnector", void 0), jh([le()], Yl.prototype, "email", void 0), jh([le()], Yl.prototype, "loading", void 0), jh([le()], Yl.prototype, "error", void 0), jh([re()], Yl.prototype, "walletGuide", void 0), Yl = jh([ye("w4m-email-login-widget")], Yl);
  const U6e = Re`
    wiu-flex {
      width: 100%;
    }
  
    :host > wiu-flex:first-child {
      transform: translateY(calc(var(--wiu-spacing-xxs) * -1));
    }
  
    wiu-icon-link {
      margin-right: calc(var(--wiu-icon-box-size-md) * -1);
    }
  
    wiu-notice-card {
      margin-bottom: var(--wiu-spacing-3xs);
    }
  
    wiu-list-item > wiu-text {
      flex: 1;
    }
  
    w4m-transactions-view {
      max-height: 200px;
    }
  
    .tab-content-container {
      height: 300px;
      overflow-y: auto;
      overflow-x: hidden;
      scrollbar-width: none;
    }
  
    .tab-content-container::-webkit-scrollbar {
      display: none;
    }
  
    .account-button {
      width: auto;
      border: none;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: var(--wiu-spacing-s);
      height: 48px;
      padding: var(--wiu-spacing-xs);
      padding-right: var(--wiu-spacing-s);
      box-shadow: inset 0 0 0 1px var(--wiu-color-gray-glass-002);
      background-color: var(--wiu-color-gray-glass-002);
      border-radius: 24px;
      transition: background-color 0.2s linear;
    }
  
    .account-button:hover {
      background-color: var(--wiu-color-gray-glass-005);
    }
  
    .avatar-container {
      position: relative;
    }
  
    wiu-avatar.avatar {
      width: 32px;
      height: 32px;
      box-shadow: 0 0 0 2px var(--wiu-color-gray-glass-005);
    }
  
    wiu-avatar.network-avatar {
      width: 16px;
      height: 16px;
      position: absolute;
      left: 100%;
      top: 100%;
      transform: translate(-75%, -75%);
      box-shadow: 0 0 0 2px var(--wiu-color-gray-glass-005);
    }
  
    .account-links {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
  
    .account-links wiu-flex {
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      flex: 1;
      background: red;
      align-items: center;
      justify-content: center;
      height: 48px;
      padding: 10px;
      flex: 1 0 0;
      border-radius: var(--XS, 16px);
      border: 1px solid var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
      background: var(--dark-accent-glass-010, rgba(71, 161, 255, 0.1));
      transition:
        background-color var(--wiu-ease-out-power-1) var(--wiu-duration-md),
        opacity var(--wiu-ease-out-power-1) var(--wiu-duration-md);
      will-change: background-color, opacity;
    }
  
    .account-links wiu-flex:hover {
      background: var(--dark-accent-glass-015, rgba(71, 161, 255, 0.15));
    }
  
    .account-links wiu-flex wiu-icon {
      width: var(--S, 20px);
      height: var(--S, 20px);
    }
  
    .account-links wiu-flex wiu-icon svg path {
      stroke: #667dff;
    }
  `;
  var Ql = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Na = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.caipAddress = ke.state.caipAddress, this.address = je.getPlainAddress(ke.state.caipAddress), this.allAccounts = ke.state.allAccounts, this.profileImage = ke.state.profileImage, this.profileName = ke.state.profileName, this.disconnecting = !1, this.balance = ke.state.balance, this.balanceSymbol = ke.state.balanceSymbol, this.features = Ue.state.features, this.unsubscribe.push(ke.subscribeKey("caipAddress", e => {
        this.address = je.getPlainAddress(e), this.caipAddress = e
      }), ke.subscribeKey("balance", e => this.balance = e), ke.subscribeKey("balanceSymbol", e => this.balanceSymbol = e), ke.subscribeKey("profileName", e => this.profileName = e), ke.subscribeKey("profileImage", e => this.profileImage = e), Ue.subscribeKey("features", e => this.features = e), ke.subscribeKey("allAccounts", e => {
        this.allAccounts = e
      }))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      if (!this.caipAddress) throw new Error("w4m-account-view: No account provided");
      const e = fe.state.activeChain === pr.CHAIN.EVM && this.allAccounts.length > 1;
      return K`<wiu-flex
          flexDirection="column"
          .padding=${["0","xl","m","xl"]}
          alignItems="center"
          gap="l"
        >
          ${e?this.multiAccountTemplate():this.singleAccountTemplate()}
          <wiu-flex flexDirection="column" alignItems="center">
            <wiu-text variant="paragraph-500" color="fg-200">
              ${je.formatBalance(this.balance,this.balanceSymbol)}
            </wiu-text>
          </wiu-flex>
          ${this.explorerBtnTemplate()}
        </wiu-flex>
  
        <wiu-flex flexDirection="column" gap="xs" .padding=${["0","s","s","s"]}>
          ${this.authCardTemplate()} <w4m-account-auth-button></w4m-account-auth-button>
          ${this.onrampTemplate()} ${this.swapsTemplate()} ${this.activityTemplate()}
          <wiu-list-item
            variant="icon"
            iconVariant="overlay"
            icon="disconnect"
            ?chevron=${!1}
            .loading=${this.disconnecting}
            @click=${this.onDisconnect.bind(this)}
            data-testid="disconnect-button"
          >
            <wiu-text variant="paragraph-500" color="fg-200">Disconnect</wiu-text>
          </wiu-list-item>
        </wiu-flex>`
    }
    onrampTemplate() {
      return this.features?.onramp ? K`
        <wiu-list-item
          data-testid="w4m-account-default-onramp-button"
          iconVariant="blue"
          icon="card"
          ?chevron=${!0}
          @click=${this.handleClickPay.bind(this)}
        >
          <wiu-text variant="paragraph-500" color="fg-100">Buy crypto</wiu-text>
        </wiu-list-item>
      ` : null
    }
    activityTemplate() {
      const e = fe.state.activeChain === pr.CHAIN.SOLANA;
      return K` <wiu-list-item
        iconVariant="blue"
        icon="clock"
        iconSize="sm"
        ?chevron=${!e}
        ?disabled=${e}
        @click=${this.onTransactions.bind(this)}
      >
        <wiu-text variant="paragraph-500" color="fg-100" ?disabled=${e}> Activity </wiu-text>
        ${e?K`<wiu-tag variant="main">Coming soon</wiu-tag>`:""}
      </wiu-list-item>`
    }
    swapsTemplate() {
      const e = this.features?.swaps,
        r = fe.state.activeChain === pr.CHAIN.SOLANA;
      return !e || r ? null : K`
        <wiu-list-item
          iconVariant="blue"
          icon="recycleHorizontal"
          ?chevron=${!0}
          @click=${this.handleClickSwap.bind(this)}
        >
          <wiu-text variant="paragraph-500" color="fg-100">Swap</wiu-text>
        </wiu-list-item>
      `
    }
    authCardTemplate() {
      const e = Ar.getConnectedConnector(),
        r = Tt.getAuthConnector(),
        {
          origin: n
        } = location;
      return !r || e !== "AUTH" || n.includes(Qr.SECURE_SITE) ? null : K`
        <wiu-notice-card
          @click=${this.onGoToUpgradeView.bind(this)}
          label="Upgrade your wallet"
          description="Transition to a self-custodial wallet"
          icon="wallet"
          data-testid="w4m-wallet-upgrade-card"
        ></wiu-notice-card>
      `
    }
    handleSwitchAccountsView() {
      Ae.push("SwitchAddress")
    }
    handleClickPay() {
      Ae.push("OnRampProviders")
    }
    handleClickSwap() {
      Ae.push("Swap")
    }
    explorerBtnTemplate() {
      return ke.state.addressExplorerUrl ? K`
        <wiu-button size="md" variant="neutral" @click=${this.onExplorer.bind(this)}>
          <wiu-icon size="sm" color="inherit" slot="iconLeft" name="compass"></wiu-icon>
          Block Explorer
          <wiu-icon size="sm" color="inherit" slot="iconRight" name="externalLink"></wiu-icon>
        </wiu-button>
      ` : null
    }
    singleAccountTemplate() {
      return K`
        <wiu-avatar
          alt=${$e(this.caipAddress)}
          address=${$e(je.getPlainAddress(this.caipAddress))}
          imageSrc=${$e(this.profileImage===null?void 0:this.profileImage)}
          data-testid="single-account-avatar"
        ></wiu-avatar>
        <wiu-flex flexDirection="column" alignItems="center">
          <wiu-flex gap="3xs" alignItems="center" justifyContent="center">
            <wiu-text variant="large-600" color="fg-100">
              ${this.profileName?Vt.getTruncateString({string:this.profileName,charsStart:20,charsEnd:0,truncate:"end"}):Vt.getTruncateString({string:this.address||"",charsStart:4,charsEnd:4,truncate:"middle"})}
            </wiu-text>
            <wiu-icon-link
              size="md"
              icon="copy"
              iconColor="fg-200"
              @click=${this.onCopyAddress}
            ></wiu-icon-link> </wiu-flex
        ></wiu-flex>
      `
    }
    multiAccountTemplate() {
      if (!this.address) throw new Error("w4m-account-view: No account provided");
      const e = this.allAccounts.find(n => n.address === this.address),
        r = ke.state.addressLabels.get(this.address);
      return K`
        <wiu-profile-button-v2
          .onProfileClick=${this.handleSwitchAccountsView.bind(this)}
          address=${$e(this.address)}
          icon="${e?.type===nr.ACCOUNT_TYPES.SMART_ACCOUNT&&fe.state.activeChain===pr.CHAIN.EVM?"lightbulb":"mail"}"
          avatarSrc=${$e(this.profileImage?this.profileImage:void 0)}
          profileName=${$e(r||this.profileName)}
          .onCopyClick=${this.onCopyAddress.bind(this)}
        ></wiu-profile-button-v2>
      `
    }
    onCopyAddress() {
      try {
        this.address && (je.copyToClopboard(this.address), Rt.showSuccess("Address copied"))
      } catch {
        Rt.showError("Failed to copy")
      }
    }
    onTransactions() {
      nt.sendEvent({
        type: "track",
        event: "CLICK_TRANSACTIONS",
        properties: {
          isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT
        }
      }), Ae.push("Transactions")
    }
    async onDisconnect() {
      try {
        this.disconnecting = !0, await Kt.disconnect(), nt.sendEvent({
          type: "track",
          event: "DISCONNECT_SUCCESS"
        }), Ot.close()
      } catch {
        nt.sendEvent({
          type: "track",
          event: "DISCONNECT_ERROR"
        }), Rt.showError("Failed to disconnect")
      } finally {
        this.disconnecting = !1
      }
    }
    onExplorer() {
      const e = ke.state.addressExplorerUrl;
      e && je.openHref(e, "_blank")
    }
    onGoToUpgradeView() {
      nt.sendEvent({
        type: "track",
        event: "EMAIL_UPGRADE_FROM_MODAL"
      }), Ae.push("UpgradeEmailWallet")
    }
  };
  Na.styles = U6e, Ql([le()], Na.prototype, "caipAddress", void 0), Ql([le()], Na.prototype, "address", void 0), Ql([le()], Na.prototype, "allAccounts", void 0), Ql([le()], Na.prototype, "profileImage", void 0), Ql([le()], Na.prototype, "profileName", void 0), Ql([le()], Na.prototype, "disconnecting", void 0), Ql([le()], Na.prototype, "balance", void 0), Ql([le()], Na.prototype, "balanceSymbol", void 0), Ql([le()], Na.prototype, "features", void 0), Na = Ql([ye("w4m-account-default-widget")], Na);
  const j6e = Re`
    wiu-flex {
      width: 100%;
    }
  
    wiu-promo {
      position: absolute;
      top: -32px;
    }
  
    wiu-profile-button {
      margin-top: calc(-1 * var(--wiu-spacing-2l));
    }
  
    wiu-promo + wiu-profile-button {
      margin-top: var(--wiu-spacing-2l);
    }
  
    wiu-tabs {
      width: 100%;
    }
  
    .contentContainer {
      height: 280px;
    }
  
    .contentContainer > wiu-icon-box {
      width: 40px;
      height: 40px;
      border-radius: var(--wiu-border-radius-xxs);
    }
  
    .contentContainer > .textContent {
      width: 65%;
    }
  `;
  var $c = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const F6e = 3,
    W6e = 48,
    z6e = 430;
  let Ko = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.address = ke.state.address, this.profileImage = ke.state.profileImage, this.profileName = ke.state.profileName, this.smartAccountDeployed = ke.state.smartAccountDeployed, this.network = fe.state.activeCaipNetwork, this.currentTab = ke.state.currentTab, this.tokenBalance = ke.state.tokenBalance, this.preferredAccountType = ke.state.preferredAccountType, this.features = Ue.state.features, this.unsubscribe.push(ke.subscribe(e => {
        e.address ? (this.address = e.address, this.profileImage = e.profileImage, this.profileName = e.profileName, this.currentTab = e.currentTab, this.tokenBalance = e.tokenBalance, this.smartAccountDeployed = e.smartAccountDeployed, this.preferredAccountType = e.preferredAccountType) : Ot.close()
      }), fe.subscribeKey("activeCaipNetwork", e => this.network = e), Ue.subscribeKey("features", e => this.features = e)), this.watchSwapValues()
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e()), clearInterval(this.watchTokenBalance)
    }
    firstUpdated() {
      ke.fetchTokenBalance()
    }
    render() {
      if (!this.address) throw new Error("w4m-account-view: No account provided");
      const e = Rr.getNetworkImage(this.network);
      return K`<wiu-flex
        flexDirection="column"
        .padding=${["0","xl","m","xl"]}
        alignItems="center"
        gap="m"
      >
        ${this.network&&K`<wiu-network-icon .network=${this.network}></wiu-network-icon>`}
        ${this.activateAccountTemplate()}
        <wiu-profile-button
          @click=${this.onProfileButtonClick.bind(this)}
          address=${$e(this.address)}
          networkSrc=${$e(e)}
          icon="chevronBottom"
          avatarSrc=${$e(this.profileImage?this.profileImage:void 0)}
          profileName=${this.profileName}
          data-testid="w4m-profile-button"
        ></wiu-profile-button>
        ${this.tokenBalanceTemplate()}
        <wiu-flex gap="s">
          <w4m-tooltip-trigger text="Buy">
            <wiu-icon-button
              data-testid="wallet-features-onramp-button"
              @click=${this.onBuyClick.bind(this)}
              icon="card"
            ></wiu-icon-button>
          </w4m-tooltip-trigger>
          ${this.swapsTemplate()}
          <w4m-tooltip-trigger text="Receive">
            <wiu-icon-button
              data-testid="wallet-features-receive-button"
              @click=${this.onReceiveClick.bind(this)}
              icon="arrowBottomCircle"
            >
            </wiu-icon-button>
          </w4m-tooltip-trigger>
          <w4m-tooltip-trigger text="Send">
            <wiu-icon-button
              data-testid="wallet-features-send-button"
              @click=${this.onSendClick.bind(this)}
              icon="send"
            ></wiu-icon-button>
          </w4m-tooltip-trigger>
        </wiu-flex>
  
        <wiu-tabs
          .onTabChange=${this.onTabChange.bind(this)}
          .activeTab=${this.currentTab}
          localTabWidth=${je.isMobile()&&window.innerWidth<z6e?`${(window.innerWidth-W6e)/F6e}px`:"104px"}
          .tabs=${nd.ACCOUNT_TABS}
        ></wiu-tabs>
        ${this.listContentTemplate()}
      </wiu-flex>`
    }
    swapsTemplate() {
      return this.features?.swaps ? K`
        <w4m-tooltip-trigger text="Swap">
          <wiu-icon-button
            data-testid="wallet-features-swap-button"
            @click=${this.onSwapClick.bind(this)}
            icon="recycleHorizontal"
          >
          </wiu-icon-button>
        </w4m-tooltip-trigger>
      ` : null
    }
    watchSwapValues() {
      this.watchTokenBalance = setInterval(() => ke.fetchTokenBalance(), 1e4)
    }
    listContentTemplate() {
      return this.currentTab === 0 ? K`<w4m-account-tokens-widget></w4m-account-tokens-widget>` : this.currentTab === 1 ? K`<w4m-account-nfts-widget></w4m-account-nfts-widget>` : this.currentTab === 2 ? K`<w4m-account-activity-widget></w4m-account-activity-widget>` : K`<w4m-account-tokens-widget></w4m-account-tokens-widget>`
    }
    tokenBalanceTemplate() {
      if (this.tokenBalance && this.tokenBalance?.length >= 0) {
        const e = je.calculateBalance(this.tokenBalance),
          {
            dollars: r = "0",
            pennies: n = "00"
          } = je.formatTokenBalance(e);
        return K`<wiu-balance dollars=${r} pennies=${n}></wiu-balance>`
      }
      return K`<wiu-balance dollars="0" pennies="00"></wiu-balance>`
    }
    activateAccountTemplate() {
      return !fe.checkIfSmartAccountEnabled() || this.preferredAccountType !== nr.ACCOUNT_TYPES.EOA || this.smartAccountDeployed ? null : K` <wiu-promo
        text=${"Activate your account"}
        @click=${this.onUpdateToSmartAccount.bind(this)}
        data-testid="activate-smart-account-promo"
      ></wiu-promo>`
    }
    onTabChange(e) {
      ke.setCurrentTab(e)
    }
    onProfileButtonClick() {
      Ae.push("Profile")
    }
    onBuyClick() {
      Ae.push("OnRampProviders")
    }
    onSwapClick() {
      this.network?.caipNetworkId && !Qr.SWAP_SUPPORTED_NETWORKS.includes(this.network?.caipNetworkId) ? Ae.push("UnsupportedChain", {
        swapUnsupportedChain: !0
      }) : (nt.sendEvent({
        type: "track",
        event: "OPEN_SWAP",
        properties: {
          network: this.network?.caipNetworkId || "",
          isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT
        }
      }), Ae.push("Swap"))
    }
    onReceiveClick() {
      Ae.push("WalletReceive")
    }
    onSendClick() {
      nt.sendEvent({
        type: "track",
        event: "OPEN_SEND",
        properties: {
          network: this.network?.caipNetworkId || "",
          isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT
        }
      }), Ae.push("WalletSend")
    }
    onUpdateToSmartAccount() {
      Ae.push("UpgradeToSmartAccount")
    }
  };
  Ko.styles = j6e, $c([le()], Ko.prototype, "watchTokenBalance", void 0), $c([le()], Ko.prototype, "address", void 0), $c([le()], Ko.prototype, "profileImage", void 0), $c([le()], Ko.prototype, "profileName", void 0), $c([le()], Ko.prototype, "smartAccountDeployed", void 0), $c([le()], Ko.prototype, "network", void 0), $c([le()], Ko.prototype, "currentTab", void 0), $c([le()], Ko.prototype, "tokenBalance", void 0), $c([le()], Ko.prototype, "preferredAccountType", void 0), $c([le()], Ko.prototype, "features", void 0), Ko = $c([ye("w4m-account-wallet-features-widget")], Ko);
  const H6e = Re`
    :host {
      width: 100%;
      max-height: 280px;
      overflow: scroll;
      scrollbar-width: none;
    }
  
    :host::-webkit-scrollbar {
      display: none;
    }
  `;
  var q6e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let rA = class extends _e {
    render() {
      return K`<w4m-activity-list page="account"></w4m-activity-list>`
    }
  };
  rA.styles = H6e, rA = q6e([ye("w4m-account-activity-widget")], rA);
  const V6e = Re`
    .contentContainer {
      height: 280px;
    }
  
    .contentContainer > wiu-icon-box {
      width: 40px;
      height: 40px;
      border-radius: var(--wiu-border-radius-xxs);
    }
  
    .contentContainer > .textContent {
      width: 65%;
    }
  `;
  var K6e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let nA = class extends _e {
    render() {
      return K`${this.nftTemplate()}`
    }
    nftTemplate() {
      return K` <wiu-flex
        class="contentContainer"
        alignItems="center"
        justifyContent="center"
        flexDirection="column"
        gap="l"
      >
        <wiu-icon-box
          icon="wallet"
          size="inherit"
          iconColor="fg-200"
          backgroundColor="fg-200"
          iconSize="lg"
        ></wiu-icon-box>
        <wiu-flex
          class="textContent"
          gap="xs"
          flexDirection="column"
          justifyContent="center"
          flexDirection="column"
        >
          <wiu-text variant="paragraph-500" align="center" color="fg-100">Coming soon</wiu-text>
          <wiu-text variant="small-400" align="center" color="fg-200"
            >Stay tuned for our upcoming NFT feature</wiu-text
          >
        </wiu-flex>
        <wiu-link @click=${this.onReceiveClick.bind(this)}>Receive funds</wiu-link>
      </wiu-flex>`
    }
    onReceiveClick() {
      Ae.push("WalletReceive")
    }
  };
  nA.styles = V6e, nA = K6e([ye("w4m-account-nfts-widget")], nA);
  const G6e = Re`
    :host {
      width: 100%;
    }
  
    wiu-flex {
      width: 100%;
    }
  
    .contentContainer {
      max-height: 280px;
      overflow: scroll;
      scrollbar-width: none;
    }
  
    .contentContainer::-webkit-scrollbar {
      display: none;
    }
  `;
  var mj = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let K4 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.tokenBalance = ke.state.tokenBalance, this.unsubscribe.push(ke.subscribe(e => {
        this.tokenBalance = e.tokenBalance
      }))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      return K`${this.tokenTemplate()}`
    }
    tokenTemplate() {
      return this.tokenBalance && this.tokenBalance?.length > 0 ? K`<wiu-flex class="contentContainer" flexDirection="column" gap="xs">
          ${this.tokenItemTemplate()}
        </wiu-flex>` : K` <wiu-flex flexDirection="column" gap="xs"
        ><wiu-list-description
          @click=${this.onBuyClick.bind(this)}
          text="Buy Crypto"
          description="Easy with card or bank account"
          icon="card"
          iconColor="success-100"
          iconBackgroundColor="success-100"
          tag="popular"
        ></wiu-list-description
        ><wiu-list-description
          @click=${this.onReceiveClick.bind(this)}
          text="Receive funds"
          description="Transfer tokens on your wallet"
          icon="arrowBottomCircle"
          iconColor="fg-200"
          iconBackgroundColor="fg-200"
        ></wiu-list-description
      ></wiu-flex>`
    }
    tokenItemTemplate() {
      return this.tokenBalance?.map(e => K`<wiu-list-token
            tokenName=${e.name}
            tokenImageUrl=${e.iconUrl}
            tokenAmount=${e.quantity.numeric}
            tokenValue=${e.value}
            tokenCurrency=${e.symbol}
          ></wiu-list-token>`)
    }
    onReceiveClick() {
      Ae.push("WalletReceive")
    }
    onBuyClick() {
      nt.sendEvent({
        type: "track",
        event: "SELECT_BUY_CRYPTO",
        properties: {
          isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT
        }
      }), Ae.push("OnRampProviders")
    }
  };
  K4.styles = G6e, mj([le()], K4.prototype, "tokenBalance", void 0), K4 = mj([ye("w4m-account-tokens-widget")], K4);
  const Z6e = Re`
    :host {
      min-height: 100%;
    }
  
    .group-container[last-group='true'] {
      padding-bottom: var(--wiu-spacing-m);
    }
  
    .contentContainer {
      height: 280px;
    }
  
    .contentContainer > wiu-icon-box {
      width: 40px;
      height: 40px;
      border-radius: var(--wiu-border-radius-xxs);
    }
  
    .contentContainer > .textContent {
      width: 65%;
    }
  
    .emptyContainer {
      height: 100%;
    }
  `;
  var H0 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const G4 = "last-transaction",
    Y6e = 7;
  let cd = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.paginationObserver = void 0, this.page = "activity", this.caipAddress = fe.state.activeCaipAddress, this.transactionsByYear = yi.state.transactionsByYear, this.loading = yi.state.loading, this.empty = yi.state.empty, this.next = yi.state.next, yi.clearCursor(), this.unsubscribe.push(fe.subscribeKey("activeCaipAddress", e => {
        e && this.caipAddress !== e && (yi.resetTransactions(), yi.fetchTransactions(e)), this.caipAddress = e
      }), fe.subscribeKey("activeCaipNetwork", () => {
        this.updateTransactionView()
      }), yi.subscribe(e => {
        this.transactionsByYear = e.transactionsByYear, this.loading = e.loading, this.empty = e.empty, this.next = e.next
      }))
    }
    firstUpdated() {
      this.updateTransactionView(), this.createPaginationObserver()
    }
    updated() {
      this.setPaginationObserver()
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      return K` ${this.empty?null:this.templateTransactionsByYear()}
      ${this.loading?this.templateLoading():null}
      ${!this.loading&&this.empty?this.templateEmpty():null}`
    }
    updateTransactionView() {
      const e = fe.state.activeCaipNetwork?.caipNetworkId;
      yi.state.lastNetworkInView !== e && (yi.resetTransactions(), this.caipAddress && yi.fetchTransactions(je.getPlainAddress(this.caipAddress))), yi.setLastNetworkInView(e)
    }
    templateTransactionsByYear() {
      return Object.keys(this.transactionsByYear).sort().reverse().map(r => {
        const n = parseInt(r, 10),
          i = new Array(12).fill(null).map((s, o) => {
            const a = wh.getTransactionGroupTitle(n, o),
              c = this.transactionsByYear[n]?.[o];
            return {
              groupTitle: a,
              transactions: c
            }
          }).filter(({
            transactions: s
          }) => s).reverse();
        return i.map(({
          groupTitle: s,
          transactions: o
        }, a) => {
          const c = a === i.length - 1;
          return o ? K`
            <wiu-flex
              flexDirection="column"
              class="group-container"
              last-group="${c?"true":"false"}"
            >
              <wiu-flex
                alignItems="center"
                flexDirection="row"
                .padding=${["xs","s","s","s"]}
              >
                <wiu-text variant="paragraph-500" color="fg-200">${s}</wiu-text>
              </wiu-flex>
              <wiu-flex flexDirection="column" gap="xs">
                ${this.templateTransactions(o,c)}
              </wiu-flex>
            </wiu-flex>
          ` : null
        })
      })
    }
    templateRenderTransaction(e, r) {
      const {
        date: n,
        descriptions: i,
        direction: s,
        isAllNFT: o,
        images: a,
        status: c,
        transfers: l,
        type: h
      } = this.getTransactionListItemProps(e), f = l?.length > 1;
      return l?.length === 2 && !o ? K`
          <wiu-transaction-list-item
            date=${n}
            .direction=${s}
            id=${r&&this.next?G4:""}
            status=${c}
            type=${h}
            .images=${a}
            .descriptions=${i}
          ></wiu-transaction-list-item>
        ` : f ? l.map((b, C) => {
        const M = wh.getTransferDescription(b),
          N = r && C === l.length - 1;
        return K` <wiu-transaction-list-item
            date=${n}
            direction=${b.direction}
            id=${N&&this.next?G4:""}
            status=${c}
            type=${h}
            .onlyDirectionIcon=${!0}
            .images=${[a[C]]}
            .descriptions=${[M]}
          ></wiu-transaction-list-item>`
      }) : K`
        <wiu-transaction-list-item
          date=${n}
          .direction=${s}
          id=${r&&this.next?G4:""}
          status=${c}
          type=${h}
          .images=${a}
          .descriptions=${i}
        ></wiu-transaction-list-item>
      `
    }
    templateTransactions(e, r) {
      return e.map((n, i) => {
        const s = r && i === e.length - 1;
        return K`${this.templateRenderTransaction(n,s)}`
      })
    }
    emptyStateActivity() {
      return K`<wiu-flex
        class="emptyContainer"
        flexGrow="1"
        flexDirection="column"
        justifyContent="center"
        alignItems="center"
        .padding=${["3xl","xl","3xl","xl"]}
        gap="xl"
      >
        <wiu-icon-box
          backgroundColor="gray-glass-005"
          background="gray"
          iconColor="fg-200"
          icon="wallet"
          size="lg"
          ?border=${!0}
          borderColor="wiu-color-bg-125"
        ></wiu-icon-box>
        <wiu-flex flexDirection="column" alignItems="center" gap="xs">
          <wiu-text align="center" variant="paragraph-500" color="fg-100"
            >No Transactions yet</wiu-text
          >
          <wiu-text align="center" variant="small-500" color="fg-200"
            >Start trading on dApps <br />
            to grow your wallet!</wiu-text
          >
        </wiu-flex>
      </wiu-flex>`
    }
    emptyStateAccount() {
      return K`<wiu-flex
        class="contentContainer"
        alignItems="center"
        justifyContent="center"
        flexDirection="column"
        gap="l"
      >
        <wiu-icon-box
          icon="swapHorizontal"
          size="inherit"
          iconColor="fg-200"
          backgroundColor="fg-200"
          iconSize="lg"
        ></wiu-icon-box>
        <wiu-flex
          class="textContent"
          gap="xs"
          flexDirection="column"
          justifyContent="center"
          flexDirection="column"
        >
          <wiu-text variant="paragraph-500" align="center" color="fg-100">No activity yet</wiu-text>
          <wiu-text variant="small-400" align="center" color="fg-200"
            >Your next transactions will appear here</wiu-text
          >
        </wiu-flex>
        <wiu-link @click=${this.onReceiveClick.bind(this)}>Trade</wiu-link>
      </wiu-flex>`
    }
    templateEmpty() {
      return this.page === "account" ? K`${this.emptyStateAccount()}` : K`${this.emptyStateActivity()}`
    }
    templateLoading() {
      return this.page === "activity" ? Array(Y6e).fill(K` <wiu-transaction-list-item-loader></wiu-transaction-list-item-loader> `).map(e => e) : null
    }
    onReceiveClick() {
      Ae.push("WalletReceive")
    }
    createPaginationObserver() {
      const {
        projectId: e
      } = Ue.state;
      this.paginationObserver = new IntersectionObserver(([r]) => {
        r?.isIntersecting && !this.loading && (yi.fetchTransactions(je.getPlainAddress(this.caipAddress)), nt.sendEvent({
          type: "track",
          event: "LOAD_MORE_TRANSACTIONS",
          properties: {
            address: je.getPlainAddress(this.caipAddress),
            projectId: e,
            cursor: this.next,
            isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT
          }
        }))
      }, {}), this.setPaginationObserver()
    }
    setPaginationObserver() {
      this.paginationObserver?.disconnect();
      const e = this.shadowRoot?.querySelector(`#${G4}`);
      e && this.paginationObserver?.observe(e)
    }
    getTransactionListItemProps(e) {
      const r = P9.formatDate(e?.metadata?.minedAt),
        n = wh.getTransactionDescriptions(e),
        i = e?.transfers,
        s = e?.transfers?.[0],
        o = !!s && e?.transfers?.every(c => !!c.nft_info),
        a = wh.getTransactionImages(i);
      return {
        date: r,
        direction: s?.direction,
        descriptions: n,
        isAllNFT: o,
        images: a,
        status: e.metadata?.status,
        transfers: i,
        type: e.metadata?.operationType
      }
    }
  };
  cd.styles = Z6e, H0([re()], cd.prototype, "page", void 0), H0([le()], cd.prototype, "caipAddress", void 0), H0([le()], cd.prototype, "transactionsByYear", void 0), H0([le()], cd.prototype, "loading", void 0), H0([le()], cd.prototype, "empty", void 0), H0([le()], cd.prototype, "next", void 0), cd = H0([ye("w4m-activity-list")], cd);
  const Q6e = Re`
    :host {
      width: 100%;
      height: 100px;
      border-radius: var(--wiu-border-radius-s);
      border: 1px solid var(--wiu-color-gray-glass-002);
      background-color: var(--wiu-color-gray-glass-002);
      transition: background-color var(--wiu-ease-out-power-1) var(--wiu-duration-lg);
      will-change: background-color;
    }
  
    :host(:hover) {
      background-color: var(--wiu-color-gray-glass-005);
    }
  
    wiu-flex {
      width: 100%;
      height: fit-content;
    }
  
    wiu-button {
      width: 100%;
      display: flex;
      justify-content: flex-end;
    }
  
    wiu-input-amount {
      mask-image: linear-gradient(
        270deg,
        transparent 0px,
        transparent 8px,
        black 24px,
        black 25px,
        black 32px,
        black 100%
      );
    }
  
    .totalValue {
      width: 100%;
    }
  `;
  var zv = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let q0 = class extends _e {
    render() {
      return K` <wiu-flex
        flexDirection="column"
        gap="4xs"
        .padding=${["xl","s","l","l"]}
      >
        <wiu-flex alignItems="center">
          <wiu-input-amount
            @inputChange=${this.onInputChange.bind(this)}
            ?disabled=${!this.token&&!0}
            .value=${this.sendTokenAmount?String(this.sendTokenAmount):""}
          ></wiu-input-amount>
          ${this.buttonTemplate()}
        </wiu-flex>
        <wiu-flex alignItems="center" justifyContent="space-between">
          ${this.sendValueTemplate()}
          <wiu-flex alignItems="center" gap="4xs" justifyContent="flex-end">
            ${this.maxAmountTemplate()} ${this.actionTemplate()}
          </wiu-flex>
        </wiu-flex>
      </wiu-flex>`
    }
    buttonTemplate() {
      return this.token ? K`<wiu-token-button
          text=${this.token.symbol}
          imageSrc=${this.token.iconUrl}
          @click=${this.handleSelectButtonClick.bind(this)}
        >
        </wiu-token-button>` : K`<wiu-button
        size="md"
        variant="accent"
        @click=${this.handleSelectButtonClick.bind(this)}
        >Select token</wiu-button
      >`
    }
    handleSelectButtonClick() {
      Ae.push("WalletSendSelectToken")
    }
    sendValueTemplate() {
      if (this.token && this.sendTokenAmount) {
        const r = this.token.price * this.sendTokenAmount;
        return K`<wiu-text class="totalValue" variant="small-400" color="fg-200"
          >${r?`$${Vt.formatNumberToLocalString(r,2)}`:"Incorrect value"}</wiu-text
        >`
      }
      return null
    }
    maxAmountTemplate() {
      return this.token ? this.sendTokenAmount && this.sendTokenAmount > Number(this.token.quantity.numeric) ? K` <wiu-text variant="small-400" color="error-100">
            ${Vt.roundNumber(Number(this.token.quantity.numeric),6,5)}
          </wiu-text>` : K` <wiu-text variant="small-400" color="fg-200">
          ${Vt.roundNumber(Number(this.token.quantity.numeric),6,5)}
        </wiu-text>` : null
    }
    actionTemplate() {
      return this.token ? this.sendTokenAmount && this.sendTokenAmount > Number(this.token.quantity.numeric) ? K`<wiu-link @click=${this.onBuyClick.bind(this)}>Buy</wiu-link>` : K`<wiu-link @click=${this.onMaxClick.bind(this)}>Max</wiu-link>` : null
    }
    onInputChange(e) {
      Vr.setTokenAmount(e.detail)
    }
    onMaxClick() {
      if (this.token && typeof this.gasPrice < "u") {
        const e = this.token.address === void 0 || Object.values(Qr.NATIVE_TOKEN_ADDRESS).some(i => this.token?.address === i),
          r = Or.bigNumber(this.gasPrice).shiftedBy(-this.token.quantity.decimals),
          n = e ? Or.bigNumber(this.token.quantity.numeric).minus(r) : Or.bigNumber(this.token.quantity.numeric);
        Vr.setTokenAmount(Number(n.toFixed(20)))
      }
    }
    onBuyClick() {
      Ae.push("OnRampProviders")
    }
  };
  q0.styles = Q6e, zv([re({
    type: Object
  })], q0.prototype, "token", void 0), zv([re({
    type: Number
  })], q0.prototype, "sendTokenAmount", void 0), zv([re({
    type: Number
  })], q0.prototype, "gasPriceInUSD", void 0), zv([re({
    type: Number
  })], q0.prototype, "gasPrice", void 0), q0 = zv([ye("w4m-input-token")], q0);
  const J6e = Re`
    :host {
      width: 100%;
      height: 100px;
      border-radius: var(--wiu-border-radius-s);
      border: 1px solid var(--wiu-color-gray-glass-002);
      background-color: var(--wiu-color-gray-glass-002);
      transition: background-color var(--wiu-ease-out-power-1) var(--wiu-duration-lg);
      will-change: background-color;
      position: relative;
    }
  
    :host(:hover) {
      background-color: var(--wiu-color-gray-glass-005);
    }
  
    wiu-flex {
      width: 100%;
      height: fit-content;
    }
  
    wiu-button {
      display: ruby;
      color: var(--wiu-color-fg-100);
      margin: 0 var(--wiu-spacing-xs);
    }
  
    .instruction {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      z-index: 2;
    }
  
    .paste {
      display: inline-flex;
    }
  
    textarea {
      background: transparent;
      width: 100%;
      font-family: var(--w4m-font-family);
      font-size: var(--wiu-font-size-medium);
      font-style: normal;
      font-weight: var(--wiu-font-weight-light);
      line-height: 130%;
      letter-spacing: var(--wiu-letter-spacing-medium);
      color: var(--wiu-color-fg-100);
      caret-color: var(--wiu-color-accent-100);
      box-sizing: border-box;
      -webkit-appearance: none;
      -moz-appearance: textfield;
      padding: 0px;
      border: none;
      outline: none;
      appearance: none;
      resize: none;
      overflow: hidden;
    }
  `;
  var Z4 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let $g = class extends _e {
    constructor() {
      super(...arguments), this.inputElementRef = cl(), this.instructionElementRef = cl(), this.instructionHidden = !!this.value, this.pasting = !1, this.onDebouncedSearch = je.debounce(async e => {
        const r = await Kt.getEnsAddress(e);
        if (Vr.setLoading(!1), r) {
          Vr.setReceiverProfileName(e), Vr.setReceiverAddress(r);
          const n = await Kt.getEnsAvatar(e);
          Vr.setReceiverProfileImageUrl(n || void 0)
        } else Vr.setReceiverAddress(e), Vr.setReceiverProfileName(void 0), Vr.setReceiverProfileImageUrl(void 0)
      })
    }
    firstUpdated() {
      this.value && (this.instructionHidden = !0), this.checkHidden()
    }
    render() {
      return K` <wiu-flex
        @click=${this.onBoxClick.bind(this)}
        flexDirection="column"
        justifyContent="center"
        gap="4xs"
        .padding=${["2xl","l","xl","l"]}
      >
        <wiu-text
          ${ll(this.instructionElementRef)}
          class="instruction"
          color="fg-300"
          variant="medium-400"
        >
          Type or
          <wiu-button
            class="paste"
            size="md"
            variant="neutral"
            iconLeft="copy"
            @click=${this.onPasteClick.bind(this)}
          >
            <wiu-icon size="sm" color="inherit" slot="iconLeft" name="copy"></wiu-icon>
            Paste
          </wiu-button>
          address
        </wiu-text>
        <textarea
          spellcheck="false"
          ?disabled=${!this.instructionHidden}
          ${ll(this.inputElementRef)}
          @input=${this.onInputChange.bind(this)}
          @blur=${this.onBlur.bind(this)}
          .value=${this.value??""}
          autocomplete="off"
        >
  ${this.value??""}</textarea
        >
      </wiu-flex>`
    }
    async focusInput() {
      this.instructionElementRef.value && (this.instructionHidden = !0, await this.toggleInstructionFocus(!1), this.instructionElementRef.value.style.pointerEvents = "none", this.inputElementRef.value?.focus(), this.inputElementRef.value && (this.inputElementRef.value.selectionStart = this.inputElementRef.value.selectionEnd = this.inputElementRef.value.value.length))
    }
    async focusInstruction() {
      this.instructionElementRef.value && (this.instructionHidden = !1, await this.toggleInstructionFocus(!0), this.instructionElementRef.value.style.pointerEvents = "auto", this.inputElementRef.value?.blur())
    }
    async toggleInstructionFocus(e) {
      this.instructionElementRef.value && await this.instructionElementRef.value.animate([{
        opacity: e ? 0 : 1
      }, {
        opacity: e ? 1 : 0
      }], {
        duration: 100,
        easing: "ease",
        fill: "forwards"
      }).finished
    }
    onBoxClick() {
      !this.value && !this.instructionHidden && this.focusInput()
    }
    onBlur() {
      !this.value && this.instructionHidden && !this.pasting && this.focusInstruction()
    }
    checkHidden() {
      this.instructionHidden && this.focusInput()
    }
    async onPasteClick() {
      this.pasting = !0;
      const e = await navigator.clipboard.readText();
      Vr.setReceiverAddress(e), this.focusInput()
    }
    onInputChange(e) {
      this.pasting = !1;
      const r = e.target;
      r.value && !this.instructionHidden && this.focusInput(), Vr.setLoading(!0), this.onDebouncedSearch(r.value)
    }
  };
  $g.styles = J6e, Z4([re()], $g.prototype, "value", void 0), Z4([le()], $g.prototype, "instructionHidden", void 0), Z4([le()], $g.prototype, "pasting", void 0), $g = Z4([ye("w4m-input-address")], $g);
  const X6e = Re`
    :host {
      display: flex;
      width: auto;
      flex-direction: column;
      gap: var(--wiu-border-radius-1xs);
      border-radius: var(--wiu-border-radius-s);
      background: var(--wiu-color-gray-glass-002);
      padding: var(--wiu-spacing-s) var(--wiu-spacing-1xs) var(--wiu-spacing-1xs)
        var(--wiu-spacing-1xs);
    }
  
    wiu-text {
      padding: 0 var(--wiu-spacing-1xs);
    }
  
    wiu-flex {
      margin-top: var(--wiu-spacing-1xs);
    }
  
    .network {
      cursor: pointer;
      transition: background-color var(--wiu-ease-out-power-1) var(--wiu-duration-lg);
      will-change: background-color;
    }
  
    .network:focus-visible {
      border: 1px solid var(--wiu-color-accent-100);
      background-color: var(--wiu-color-gray-glass-005);
      -webkit-box-shadow: 0px 0px 0px 4px var(--wiu-box-shadow-blue);
      -moz-box-shadow: 0px 0px 0px 4px var(--wiu-box-shadow-blue);
      box-shadow: 0px 0px 0px 4px var(--wiu-box-shadow-blue);
    }
  
    .network:hover {
      background-color: var(--wiu-color-gray-glass-005);
    }
  
    .network:active {
      background-color: var(--wiu-color-gray-glass-010);
    }
  `;
  var Y4 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Og = class extends _e {
    render() {
      return K` <wiu-text variant="small-400" color="fg-200">Details</wiu-text>
        <wiu-flex flexDirection="column" gap="xxs">
          <wiu-list-content textTitle="Network cost" textValue="$${$e(Vt.formatNumberToLocalString(this.networkFee,2))}"></wiu-list-content></wiu-list-content>
          <wiu-list-content
            textTitle="Address"
            textValue=${Vt.getTruncateString({string:this.receiverAddress??"",charsStart:4,charsEnd:4,truncate:"middle"})}
          >
          </wiu-list-content>
          ${this.networkTemplate()}
        </wiu-flex>`
    }
    networkTemplate() {
      return this.caipNetwork?.name ? K` <wiu-list-content
          @click=${()=>this.onNetworkClick(this.caipNetwork)}
          class="network"
          textTitle="Network"
          imageSrc=${$e(Rr.getNetworkImage(this.caipNetwork))}
        ></wiu-list-content>` : null
    }
    onNetworkClick(e) {
      e && Ae.push("Networks", {
        network: e
      })
    }
  };
  Og.styles = X6e, Y4([re()], Og.prototype, "receiverAddress", void 0), Y4([re({
    type: Object
  })], Og.prototype, "caipNetwork", void 0), Y4([re({
    type: Number
  })], Og.prototype, "networkFee", void 0), Og = Y4([ye("w4m-wallet-send-details")], Og);
  const e8e = Re`
    :host {
      pointer-events: none;
    }
  
    :host > wiu-flex {
      display: var(--w4m-tooltip-display);
      opacity: var(--w4m-tooltip-opacity);
      padding: 9px var(--wiu-spacing-s) 10px var(--wiu-spacing-s);
      border-radius: var(--wiu-border-radius-xxs);
      color: var(--wiu-color-bg-100);
      position: fixed;
      top: var(--w4m-tooltip-top);
      left: var(--w4m-tooltip-left);
      transform: translate(calc(-50% + var(--w4m-tooltip-parent-width)), calc(-100% - 8px));
      max-width: calc(var(--w4m-modal-width) - var(--wiu-spacing-xl));
      transition: opacity 0.2s var(--wiu-ease-out-power-2);
      will-change: opacity;
    }
  
    :host([data-variant='shade']) > wiu-flex {
      background-color: var(--wiu-color-bg-150);
      border: 1px solid var(--wiu-color-gray-glass-005);
    }
  
    :host([data-variant='shade']) > wiu-flex > wiu-text {
      color: var(--wiu-color-fg-150);
    }
  
    :host([data-variant='fill']) > wiu-flex {
      background-color: var(--wiu-color-fg-100);
      border: none;
    }
  
    wiu-icon {
      position: absolute;
      width: 12px !important;
      height: 4px !important;
      color: var(--wiu-color-bg-150);
    }
  
    wiu-icon[data-placement='top'] {
      bottom: 0px;
      left: 50%;
      transform: translate(-50%, 95%);
    }
  
    wiu-icon[data-placement='bottom'] {
      top: 0;
      left: 50%;
      transform: translate(-50%, -95%) rotate(180deg);
    }
  
    wiu-icon[data-placement='right'] {
      top: 50%;
      left: 0;
      transform: translate(-65%, -50%) rotate(90deg);
    }
  
    wiu-icon[data-placement='left'] {
      top: 50%;
      right: 0%;
      transform: translate(65%, -50%) rotate(270deg);
    }
  `;
  var Hv = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let V0 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.open = Mo.state.open, this.message = Mo.state.message, this.triggerRect = Mo.state.triggerRect, this.variant = Mo.state.variant, this.unsubscribe.push(Mo.subscribe(e => {
        this.open = e.open, this.message = e.message, this.triggerRect = e.triggerRect, this.variant = e.variant
      }))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      this.dataset.variant = this.variant;
      const e = this.triggerRect.top,
        r = this.triggerRect.left;
      return this.style.cssText = `
      --w4m-tooltip-top: ${e}px;
      --w4m-tooltip-left: ${r}px;
      --w4m-tooltip-parent-width: ${this.triggerRect.width/2}px;
      --w4m-tooltip-display: ${this.open?"flex":"none"};
      --w4m-tooltip-opacity: ${this.open?1:0};
      `, K`<wiu-flex>
        <wiu-icon data-placement="top" color="fg-100" size="inherit" name="cursor"></wiu-icon>
        <wiu-text color="inherit" variant="small-500">${this.message}</wiu-text>
      </wiu-flex>`
    }
  };
  V0.styles = [e8e], Hv([le()], V0.prototype, "open", void 0), Hv([le()], V0.prototype, "message", void 0), Hv([le()], V0.prototype, "triggerRect", void 0), Hv([le()], V0.prototype, "variant", void 0), V0 = Hv([ye("w4m-tooltip")], V0);
  const t8e = Re`
    :host {
      width: 100%;
      display: block;
    }
  `;
  var iA = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let qv = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.text = "", this.open = Mo.state.open, this.unsubscribe.push(Ae.subscribeKey("view", () => {
        Mo.hide()
      }), Ot.subscribeKey("open", e => {
        e || Mo.hide()
      }), Mo.subscribeKey("open", e => {
        this.open = e
      }))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e()), Mo.hide()
    }
    render() {
      return K`
        <div
          @pointermove=${this.onMouseEnter.bind(this)}
          @pointerleave=${this.onMouseLeave.bind(this)}
        >
          ${this.renderChildren()}
        </div>
      `
    }
    renderChildren() {
      return K`<slot></slot> `
    }
    onMouseEnter() {
      const e = this.getBoundingClientRect();
      this.open || Mo.showTooltip({
        message: this.text,
        triggerRect: {
          width: e.width,
          height: e.height,
          left: e.left,
          top: e.top
        },
        variant: "shade"
      })
    }
    onMouseLeave(e) {
      this.contains(e.relatedTarget) || Mo.hide()
    }
  };
  qv.styles = [t8e], iA([re()], qv.prototype, "text", void 0), iA([le()], qv.prototype, "open", void 0), qv = iA([ye("w4m-tooltip-trigger")], qv);
  const r8e = Re`
    :host > wiu-flex:first-child {
      margin-top: var(--wiu-spacing-s);
    }
    wiu-separator {
      margin: var(--wiu-spacing-m) calc(var(--wiu-spacing-m) * -1) var(--wiu-spacing-m)
        calc(var(--wiu-spacing-m) * -1);
      width: calc(100% + var(--wiu-spacing-s) * 2);
    }
  `;
  var Dg = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const wj = 2,
    vj = 6;
  let Fh = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.walletGuide = "get-started", this.tabIdx = void 0, this.connectors = Tt.state.connectors, this.features = Ue.state.features, this.authConnector = this.connectors.find(e => e.type === "AUTH"), this.unsubscribe.push(Tt.subscribeKey("connectors", e => {
        this.connectors = e, this.authConnector = this.connectors.find(r => r.type === "AUTH")
      }), Ue.subscribeKey("features", e => this.features = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      const e = this.features?.socials;
      return !this.authConnector || !e || !e?.length ? null : K`
        <wiu-flex
          class="container"
          flexDirection="column"
          gap="xs"
          .padding=${["0","0","xs","0"]}
          data-testid="w4m-social-login-widget"
        >
          ${this.topViewTemplate()}${this.bottomViewTemplate()}
        </wiu-flex>
        ${this.separatorTemplate()}
      `
    }
    topViewTemplate() {
      const e = this.features?.socials;
      return !this.authConnector || !e || !e?.length ? null : e.length === 2 ? K` <wiu-flex gap="xs">
          ${e.slice(0,wj).map(r=>K`<wiu-logo-select
                data-testid=${`social-selector-${r}`}
                @click=${()=>{this.onSocialClick(r)}}
                logo=${r}
                tabIdx=${$e(this.tabIdx)}
              ></wiu-logo-select>`)}
        </wiu-flex>` : K` <wiu-list-social
        data-testid=${`social-selector-${e?.[0]}`}
        @click=${()=>{this.onSocialClick(e?.[0])}}
        logo=${$e(e[0])}
        align="center"
        name=${`Continue with ${e[0]}`}
        tabIdx=${$e(this.tabIdx)}
      ></wiu-list-social>`
    }
    bottomViewTemplate() {
      const e = this.features?.socials;
      return !this.authConnector || !e || !e?.length || e.length <= wj ? null : e.length > vj ? K`<wiu-flex gap="xs">
          ${e.slice(1,vj-1).map(r=>K`<wiu-logo-select
                data-testid=${`social-selector-${r}`}
                @click=${()=>{this.onSocialClick(r)}}
                logo=${r}
                tabIdx=${$e(this.tabIdx)}
              ></wiu-logo-select>`)}
          <wiu-logo-select
            logo="more"
            tabIdx=${$e(this.tabIdx)}
            @click=${this.onMoreSocialsClick.bind(this)}
          ></wiu-logo-select>
        </wiu-flex>` : K`<wiu-flex gap="xs">
        ${e.slice(1,e.length).map(r=>K`<wiu-logo-select
              data-testid=${`social-selector-${r}`}
              @click=${()=>{this.onSocialClick(r)}}
              logo=${r}
              tabIdx=${$e(this.tabIdx)}
            ></wiu-logo-select>`)}
      </wiu-flex>`
    }
    separatorTemplate() {
      const e = this.connectors.find(n => n.id === "walletConnect"),
        r = Ue.state.enableWallets;
      return e && r || this.walletGuide === "explore" ? K`<wiu-separator text="or"></wiu-separator>` : null
    }
    onMoreSocialsClick() {
      Ae.push("ConnectSocials")
    }
    async onSocialClick(e) {
      if (e && (ke.setSocialProvider(e, fe.state.activeChain), nt.sendEvent({
          type: "track",
          event: "SOCIAL_LOGIN_STARTED",
          properties: {
            provider: e
          }
        })), e === v5.Farcaster) {
        Ae.push("ConnectingFarcaster");
        const r = Tt.getAuthConnector();
        if (r && !ke.state.farcasterUrl) try {
          const {
            url: n
          } = await r.provider.getFarcasterUri();
          ke.setFarcasterUrl(n, fe.state.activeChain)
        } catch (n) {
          Ae.goBack(), Rt.showError(n)
        }
      } else {
        Ae.push("ConnectingSocial");
        const r = Tt.getAuthConnector();
        this.popupWindow = je.returnOpenHref("", "popupWindow", "width=600,height=800,scrollbars=yes");
        try {
          if (r && e) {
            const {
              uri: n
            } = await r.provider.getSocialRedirectUri({
              provider: e
            });
            if (this.popupWindow && n) ke.setSocialWindow(this.popupWindow, fe.state.activeChain), this.popupWindow.location.href = n;
            else throw this.popupWindow?.close(), new Error("Something went wrong")
          }
        } catch {
          this.popupWindow?.close(), Rt.showError("Something went wrong")
        }
      }
    }
  };
  Fh.styles = r8e, Dg([re()], Fh.prototype, "walletGuide", void 0), Dg([re()], Fh.prototype, "tabIdx", void 0), Dg([le()], Fh.prototype, "connectors", void 0), Dg([le()], Fh.prototype, "features", void 0), Dg([le()], Fh.prototype, "authConnector", void 0), Fh = Dg([ye("w4m-social-login-widget")], Fh);
  var bj = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let sA = class extends _e {
    constructor() {
      super(...arguments), this.tabIdx = void 0
    }
    render() {
      return K`
        <wiu-flex flexDirection="column" gap="xs">
          <w4m-connector-list tabIdx=${$e(this.tabIdx)}></w4m-connector-list>
          <w4m-all-wallets-widget tabIdx=${$e(this.tabIdx)}></w4m-all-wallets-widget>
        </wiu-flex>
      `
    }
  };
  bj([re()], sA.prototype, "tabIdx", void 0), sA = bj([ye("w4m-wallet-login-list")], sA);
  const n8e = Re`
    :host {
      margin-top: var(--wiu-spacing-3xs);
    }
    wiu-separator {
      margin: var(--wiu-spacing-m) calc(var(--wiu-spacing-m) * -1) var(--wiu-spacing-xs)
        calc(var(--wiu-spacing-m) * -1);
      width: calc(100% + var(--wiu-spacing-s) * 2);
    }
  `;
  var Vv = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let K0 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.tabIdx = void 0, this.connectors = Tt.state.connectors, this.authConnector = this.connectors.find(e => e.type === "AUTH"), this.features = Ue.state.features, this.unsubscribe.push(Tt.subscribeKey("connectors", e => {
        this.connectors = e, this.authConnector = this.connectors.find(r => r.type === "AUTH")
      }), Ue.subscribeKey("features", e => this.features = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      const e = this.features?.socials;
      return !this.authConnector || !e || !e?.length ? null : K` <wiu-flex flexDirection="column" gap="xs">
        ${e.map(r=>K`<wiu-list-social
              @click=${()=>{this.onSocialClick(r)}}
              name=${r}
              logo=${r}
              tabIdx=${$e(this.tabIdx)}
            ></wiu-list-social>`)}
      </wiu-flex>`
    }
    async onSocialClick(e) {
      if (e && (ke.setSocialProvider(e, fe.state.activeChain), nt.sendEvent({
          type: "track",
          event: "SOCIAL_LOGIN_STARTED",
          properties: {
            provider: e
          }
        })), e === v5.Farcaster) {
        Ae.push("ConnectingFarcaster");
        const r = Tt.getAuthConnector();
        if (r && !ke.state.farcasterUrl) try {
          const {
            url: n
          } = await r.provider.getFarcasterUri();
          ke.setFarcasterUrl(n, fe.state.activeChain)
        } catch (n) {
          Ae.goBack(), Rt.showError(n)
        }
      } else {
        Ae.push("ConnectingSocial");
        const r = Tt.getAuthConnector();
        this.popupWindow = je.returnOpenHref("", "popupWindow", "width=600,height=800,scrollbars=yes");
        try {
          if (r && e) {
            const {
              uri: n
            } = await r.provider.getSocialRedirectUri({
              provider: e
            });
            if (this.popupWindow && n) ke.setSocialWindow(this.popupWindow, fe.state.activeChain), this.popupWindow.location.href = n;
            else throw this.popupWindow?.close(), new Error("Something went wrong")
          }
        } catch {
          this.popupWindow?.close(), Rt.showError("Something went wrong")
        }
      }
    }
  };
  K0.styles = n8e, Vv([re()], K0.prototype, "tabIdx", void 0), Vv([le()], K0.prototype, "connectors", void 0), Vv([le()], K0.prototype, "authConnector", void 0), Vv([le()], K0.prototype, "features", void 0), K0 = Vv([ye("w4m-social-login-list")], K0);
  var oA = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Q4 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.tabIdx = void 0, this.connectors = Tt.state.connectors, this.unsubscribe.push(Tt.subscribeKey("connectors", e => this.connectors = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      const e = this.connectors.filter(r => r.type === "ANNOUNCED");
      return e?.length ? K`
        <wiu-flex flexDirection="column" gap="xs">
          ${e.map(r=>r.info?.rdns&&qt.state.excludedRDNS&&qt.state.excludedRDNS.includes(r?.info?.rdns)?null:K`
              <wiu-list-wallet
                imageSrc=${$e(Rr.getConnectorImage(r))}
                name=${r.name??"Unknown"}
                @click=${()=>this.onConnector(r)}
                tagVariant="success"
                tagLabel="installed"
                data-testid=${`wallet-selector-${r.id}`}
                .installed=${!0}
                tabIdx=${$e(this.tabIdx)}
              >
              </wiu-list-wallet>
            `)}
        </wiu-flex>
      ` : (this.style.cssText = "display: none", null)
    }
    onConnector(e) {
      e.id === "walletConnect" ? je.isMobile() ? Ae.push("AllWallets") : Ae.push("ConnectingWalletConnect") : Ae.push("ConnectingExternal", {
        connector: e
      })
    }
  };
  oA([re()], Q4.prototype, "tabIdx", void 0), oA([le()], Q4.prototype, "connectors", void 0), Q4 = oA([ye("w4m-connect-announced-widget")], Q4);
  var aA = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let J4 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.tabIdx = void 0, this.connectors = Tt.state.connectors, this.unsubscribe.push(Tt.subscribeKey("connectors", e => this.connectors = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      const {
        customWallets: e
      } = Ue.state;
      if (!e?.length) return this.style.cssText = "display: none", null;
      const r = this.filterOutDuplicateWallets(e);
      return K`<wiu-flex flexDirection="column" gap="xs">
        ${r.map(n=>K`
            <wiu-list-wallet
              imageSrc=${$e(Rr.getWalletImage(n))}
              name=${n.name??"Unknown"}
              @click=${()=>this.onConnectWallet(n)}
              data-testid=${`wallet-selector-${n.id}`}
              tabIdx=${$e(this.tabIdx)}
            >
            </wiu-list-wallet>
          `)}
      </wiu-flex>`
    }
    filterOutDuplicateWallets(e) {
      const r = Ar.getRecentWallets(),
        n = this.connectors.map(a => a.info?.rdns).filter(Boolean),
        i = r.map(a => a.rdns).filter(Boolean),
        s = n.concat(i);
      if (s.includes("io.metamask.mobile") && je.isMobile()) {
        const a = s.indexOf("io.metamask.mobile");
        s[a] = "io.metamask"
      }
      return e.filter(a => !s.includes(String(a?.rdns)))
    }
    onConnectWallet(e) {
      Ae.push("ConnectingWalletConnect", {
        wallet: e
      })
    }
  };
  aA([re()], J4.prototype, "tabIdx", void 0), aA([le()], J4.prototype, "connectors", void 0), J4 = aA([ye("w4m-connect-custom-widget")], J4);
  var yj = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let cA = class extends _e {
    constructor() {
      super(...arguments), this.unsubscribe = [], this.tabIdx = void 0
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      const {
        featured: e
      } = qt.state;
      if (!e.length) return this.style.cssText = "display: none", null;
      const r = Mg.filterOutDuplicateWallets(e);
      return K`
        <wiu-flex flexDirection="column" gap="xs">
          ${r.map(n=>K`
              <wiu-list-wallet
                imageSrc=${$e(Rr.getWalletImage(n))}
                name=${n.name??"Unknown"}
                @click=${()=>this.onConnectWallet(n)}
                tabIdx=${$e(this.tabIdx)}
              >
              </wiu-list-wallet>
            `)}
        </wiu-flex>
      `
    }
    onConnectWallet(e) {
      const r = Tt.getConnector(e.id, e.rdns);
      r ? Ae.push("ConnectingExternal", {
        connector: r
      }) : Ae.push("ConnectingWalletConnect", {
        wallet: e
      })
    }
  };
  yj([re()], cA.prototype, "tabIdx", void 0), cA = yj([ye("w4m-connect-featured-widget")], cA);
  var lA = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let X4 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.tabIdx = void 0, this.connectors = Tt.state.connectors, this.unsubscribe.push(Tt.subscribeKey("connectors", e => this.connectors = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      const e = this.connectors.filter(r => r.type === "INJECTED");
      return !e?.length || e.length === 1 && e[0]?.name === "Browser Wallet" && !je.isMobile() ? (this.style.cssText = "display: none", null) : K`
        <wiu-flex flexDirection="column" gap="xs">
          ${e.map(r=>{if(!je.isMobile()&&r.name==="Browser Wallet")return null;const n=r.info?.rdns;return!n&&!Kt.checkInstalled(void 0,r.chain)?(this.style.cssText="display: none",null):n&&qt.state.excludedRDNS&&qt.state.excludedRDNS.includes(n)?null:K`
              <wiu-list-wallet
                imageSrc=${$e(Rr.getConnectorImage(r))}
                .installed=${!0}
                name=${r.name??"Unknown"}
                tagVariant="success"
                tagLabel="installed"
                data-testid=${`wallet-selector-${r.id}`}
                @click=${()=>this.onConnector(r)}
                tabIdx=${$e(this.tabIdx)}
              >
              </wiu-list-wallet>
            `})}
        </wiu-flex>
      `
    }
    onConnector(e) {
      fe.setActiveConnector(e), Ae.push("ConnectingExternal", {
        connector: e
      })
    }
  };
  lA([re()], X4.prototype, "tabIdx", void 0), lA([le()], X4.prototype, "connectors", void 0), X4 = lA([ye("w4m-connect-injected-widget")], X4);
  var uA = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let e6 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.tabIdx = void 0, this.connectors = Tt.state.connectors, this.unsubscribe.push(Tt.subscribeKey("connectors", e => this.connectors = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      const e = this.connectors.filter(r => r.type === "MULTI_CHAIN" && r.name !== "WalletConnect");
      return e?.length ? K`
        <wiu-flex flexDirection="column" gap="xs">
          ${e.map(r=>K`
              <wiu-list-wallet
                imageSrc=${$e(Rr.getConnectorImage(r))}
                .installed=${!0}
                name=${r.name??"Unknown"}
                tagVariant="shade"
                tagLabel="multichain"
                data-testid=${`wallet-selector-${r.id}`}
                @click=${()=>this.onConnector(r)}
                tabIdx=${$e(this.tabIdx)}
              >
              </wiu-list-wallet>
            `)}
        </wiu-flex>
      ` : (this.style.cssText = "display: none", null)
    }
    onConnector(e) {
      fe.setActiveConnector(e), Ae.push("ConnectingMultiChain")
    }
  };
  uA([re()], e6.prototype, "tabIdx", void 0), uA([le()], e6.prototype, "connectors", void 0), e6 = uA([ye("w4m-connect-multi-chain-widget")], e6);
  var dA = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let t6 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.tabIdx = void 0, this.connectors = Tt.state.connectors, this.unsubscribe.push(Tt.subscribeKey("connectors", e => this.connectors = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      const r = this.connectors.filter(n => n.type === "EXTERNAL").filter(n => n.id !== "coinbaseWalletSDK");
      return r?.length ? K`
        <wiu-flex flexDirection="column" gap="xs">
          ${r.map(n=>K`
              <wiu-list-wallet
                imageSrc=${$e(Rr.getConnectorImage(n))}
                .installed=${!0}
                name=${n.name??"Unknown"}
                data-testid=${`wallet-selector-external-${n.id}`}
                @click=${()=>this.onConnector(n)}
                tabIdx=${$e(this.tabIdx)}
              >
              </wiu-list-wallet>
            `)}
        </wiu-flex>
      ` : (this.style.cssText = "display: none", null)
    }
    onConnector(e) {
      Ae.push("ConnectingExternal", {
        connector: e
      })
    }
  };
  dA([re()], t6.prototype, "tabIdx", void 0), dA([le()], t6.prototype, "connectors", void 0), t6 = dA([ye("w4m-connect-external-widget")], t6);
  var _j = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let hA = class extends _e {
    constructor() {
      super(...arguments), this.tabIdx = void 0
    }
    render() {
      const e = Ar.getRecentWallets();
      return e?.length ? K`
        <wiu-flex flexDirection="column" gap="xs">
          ${e.map(r=>K`
              <wiu-list-wallet
                imageSrc=${$e(Rr.getWalletImage(r))}
                name=${r.name??"Unknown"}
                @click=${()=>this.onConnectWallet(r)}
                tagLabel="recent"
                tagVariant="shade"
                tabIdx=${$e(this.tabIdx)}
              >
              </wiu-list-wallet>
            `)}
        </wiu-flex>
      ` : (this.style.cssText = "display: none", null)
    }
    onConnectWallet(e) {
      Ae.push("ConnectingWalletConnect", {
        wallet: e
      })
    }
  };
  _j([re()], hA.prototype, "tabIdx", void 0), hA = _j([ye("w4m-connect-recent-widget")], hA);
  var fA = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let r6 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.tabIdx = void 0, this.connectors = Tt.state.connectors, this.unsubscribe.push(Tt.subscribeKey("connectors", e => this.connectors = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      if (!this.connectors.find(w => w.id === "walletConnect")) return null;
      const {
        recommended: r
      } = qt.state, {
        customWallets: n,
        featuredWalletIds: i
      } = Ue.state, {
        connectors: s
      } = Tt.state, o = Ar.getRecentWallets(), c = s.filter(w => w.type === "INJECTED" || w.type === "ANNOUNCED" || w.type === "MULTI_CHAIN").filter(w => w.name !== "Browser Wallet");
      if (i || n || !r.length) return this.style.cssText = "display: none", null;
      const l = c.length + o.length,
        h = Math.max(0, 2 - l),
        f = Mg.filterOutDuplicateWallets(r).slice(0, h);
      return f.length ? K`
        <wiu-flex flexDirection="column" gap="xs">
          ${f.map(w=>K`
              <wiu-list-wallet
                imageSrc=${$e(Rr.getWalletImage(w))}
                name=${w?.name??"Unknown"}
                @click=${()=>this.onConnectWallet(w)}
                tabIdx=${$e(this.tabIdx)}
              >
              </wiu-list-wallet>
            `)}
        </wiu-flex>
      ` : (this.style.cssText = "display: none", null)
    }
    onConnectWallet(e) {
      const r = Tt.getConnector(e.id, e.rdns);
      r ? Ae.push("ConnectingExternal", {
        connector: r
      }) : Ae.push("ConnectingWalletConnect", {
        wallet: e
      })
    }
  };
  fA([re()], r6.prototype, "tabIdx", void 0), fA([le()], r6.prototype, "connectors", void 0), r6 = fA([ye("w4m-connect-recommended-widget")], r6);
  var pA = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let n6 = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.tabIdx = void 0, this.connectors = Tt.state.connectors, this.unsubscribe.push(Tt.subscribeKey("connectors", e => this.connectors = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      if (je.isMobile()) return this.style.cssText = "display: none", null;
      const e = this.connectors.find(r => r.id === "walletConnect");
      return e ? K`
        <wiu-list-wallet
          imageSrc=${$e(Rr.getConnectorImage(e))}
          name=${e.name??"Unknown"}
          @click=${()=>this.onConnector(e)}
          tagLabel="qr code"
          tagVariant="main"
          tabIdx=${$e(this.tabIdx)}
          data-testid="wallet-selector-walletconnect"
        >
        </wiu-list-wallet>
      ` : (this.style.cssText = "display: none", null)
    }
    onConnector(e) {
      fe.setActiveConnector(e), Ae.push("ConnectingWalletConnect")
    }
  };
  pA([re()], n6.prototype, "tabIdx", void 0), pA([le()], n6.prototype, "connectors", void 0), n6 = pA([ye("w4m-connect-walletconnect-widget")], n6);
  const i8e = Re`
    :host {
      margin-top: var(--wiu-spacing-3xs);
    }
    wiu-separator {
      margin: var(--wiu-spacing-m) calc(var(--wiu-spacing-m) * -1) var(--wiu-spacing-xs)
        calc(var(--wiu-spacing-m) * -1);
      width: calc(100% + var(--wiu-spacing-s) * 2);
    }
  `;
  var gA = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Kv = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.tabIdx = void 0, this.connectors = Tt.state.connectors, this.unsubscribe.push(Tt.subscribeKey("connectors", e => this.connectors = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      const {
        custom: e,
        recent: r,
        announced: n,
        injected: i,
        multiChain: s,
        recommended: o,
        featured: a,
        external: c
      } = this.getConnectorsByType(), l = Ue.state.enableWalletConnect;
      return K`
        <wiu-flex flexDirection="column" gap="xs">
          ${l?K`<w4m-connect-walletconnect-widget
                tabIdx=${$e(this.tabIdx)}
              ></w4m-connect-walletconnect-widget>`:null}
          ${r.length?K`<w4m-connect-recent-widget
                tabIdx=${$e(this.tabIdx)}
              ></w4m-connect-recent-widget>`:null}
          ${s.length?K`<w4m-connect-multi-chain-widget
                tabIdx=${$e(this.tabIdx)}
              ></w4m-connect-multi-chain-widget>`:null}
          ${n.length?K`<w4m-connect-announced-widget
                tabIdx=${$e(this.tabIdx)}
              ></w4m-connect-announced-widget>`:null}
          ${i.length?K`<w4m-connect-injected-widget
                tabIdx=${$e(this.tabIdx)}
              ></w4m-connect-injected-widget>`:null}
          ${a.length?K`<w4m-connect-featured-widget
                tabIdx=${$e(this.tabIdx)}
              ></w4m-connect-featured-widget>`:null}
          ${e?.length?K`<w4m-connect-custom-widget
                tabIdx=${$e(this.tabIdx)}
              ></w4m-connect-custom-widget>`:null}
          ${c.length?K`<w4m-connect-external-widget
                tabIdx=${$e(this.tabIdx)}
              ></w4m-connect-external-widget>`:null}
          ${o.length?K`<w4m-connect-recommended-widget
                tabIdx=${$e(this.tabIdx)}
              ></w4m-connect-recommended-widget>`:null}
        </wiu-flex>
      `
    }
    getConnectorsByType() {
      const {
        featured: e,
        recommended: r
      } = qt.state, {
        customWallets: n
      } = Ue.state, i = Ar.getRecentWallets(), s = Mg.filterOutDuplicateWallets(r), o = Mg.filterOutDuplicateWallets(e), a = this.connectors.filter(b => b.type === "MULTI_CHAIN"), c = this.connectors.filter(b => b.type === "ANNOUNCED"), l = this.connectors.filter(b => b.type === "INJECTED"), h = this.connectors.filter(b => b.type === "EXTERNAL"), w = fe.state.activeChain === pr.CHAIN.EVM ? Ue.state.enableEIP6963 : !0;
      return {
        custom: n,
        recent: i,
        external: h,
        multiChain: a,
        announced: w ? c : [],
        injected: w ? l : [],
        recommended: s,
        featured: o
      }
    }
  };
  Kv.styles = i8e, gA([re()], Kv.prototype, "tabIdx", void 0), gA([le()], Kv.prototype, "connectors", void 0), Kv = gA([ye("w4m-connector-list")], Kv);
  var i6 = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Gv = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.tabIdx = void 0, this.connectors = Tt.state.connectors, this.count = qt.state.count, this.unsubscribe.push(Tt.subscribeKey("connectors", e => this.connectors = e), qt.subscribeKey("count", e => this.count = e))
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e())
    }
    render() {
      const e = this.connectors.find(a => a.id === "walletConnect"),
        {
          allWallets: r
        } = Ue.state;
      if (!e || r === "HIDE" || r === "ONLY_MOBILE" && !je.isMobile()) return null;
      const n = qt.state.featured.length,
        i = this.count + n,
        s = i < 10 ? i : Math.floor(i / 10) * 10,
        o = s < i ? `${s}+` : `${s}`;
      return K`
        <wiu-list-wallet
          name="All Wallets"
          walletIcon="allWallets"
          showAllWallets
          @click=${this.onAllWallets.bind(this)}
          tagLabel=${o}
          tagVariant="shade"
          data-testid="all-wallets"
          tabIdx=${$e(this.tabIdx)}
        ></wiu-list-wallet>
      `
    }
    onAllWallets() {
      nt.sendEvent({
        type: "track",
        event: "CLICK_ALL_WALLETS"
      }), Ae.push("AllWallets")
    }
  };
  i6([re()], Gv.prototype, "tabIdx", void 0), i6([le()], Gv.prototype, "connectors", void 0), i6([le()], Gv.prototype, "count", void 0), Gv = i6([ye("w4m-all-wallets-widget")], Gv);
  var s8e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let xj = class extends _e {
    constructor() {
      super(...arguments), this.socialProvider = Ar.getConnectedSocialProvider(), this.socialUsername = Ar.getConnectedSocialUsername()
    }
    render() {
      const e = Ar.getConnectedConnector(),
        r = Tt.getAuthConnector();
      if (!r || e !== "AUTH") return this.style.cssText = "display: none", null;
      const n = r.provider.getEmail() ?? "";
      return K`
        <wiu-list-item
          variant="icon"
          iconVariant="overlay"
          icon=${this.socialProvider??"mail"}
          iconSize=${this.socialProvider?"xxl":"sm"}
          data-testid="w4m-account-email-update"
          ?chevron=${!this.socialProvider}
          @click=${()=>{this.onGoToUpdateEmail(n,this.socialProvider)}}
        >
          <wiu-text variant="paragraph-500" color="fg-100">${this.getAuthName(n)}</wiu-text>
        </wiu-list-item>
      `
    }
    onGoToUpdateEmail(e, r) {
      r || Ae.push("UpdateEmailWallet", {
        email: e
      })
    }
    getAuthName(e) {
      return this.socialUsername ? this.socialProvider === "discord" && this.socialUsername.endsWith("0") ? this.socialUsername.slice(0, -1) : this.socialUsername : e.length > 30 ? `${e.slice(0,-3)}...` : e
    }
  };
  xj = s8e([ye("w4m-account-auth-button")], xj);
  const o8e = Re`
    wiu-flex {
      width: 100%;
    }
  
    .wallet-guide {
      width: 100%;
    }
  
    .chip-box {
      width: fit-content;
      background-color: var(--wiu-color-gray-glass-005);
      border-radius: var(--wiu-border-radius-3xl);
    }
  `;
  var mA = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let Zv = class extends _e {
    constructor() {
      super(...arguments), this.walletGuide = "get-started"
    }
    render() {
      return this.walletGuide === "explore" ? K`<wiu-flex
            class="wallet-guide"
            flexDirection="column"
            alignItems="center"
            justifyContent="center"
            rowGap="xs"
            data-testid="w4m-wallet-guide-explore"
          >
            <wiu-text variant="small-400" color="fg-200" align="center">
              Looking for a self-custody wallet?
            </wiu-text>
  
            <wiu-flex class="chip-box">
              <wiu-chip
                imageIcon="walletConnectLightBrown"
                icon="externalLink"
                variant="transparent"
                href="https://explorer.walletconnect.com"
                title="Visit our Explorer"
              ></wiu-chip>
            </wiu-flex>
          </wiu-flex>` : K`<wiu-flex
            columnGap="4xs"
            flexDirection="row"
            alignItems="center"
            justifyContent="center"
          >
            <wiu-text variant="small-400" class="title" color="fg-200"
              >Haven't got a wallet?</wiu-text
            >
            <wiu-link
              data-testid="w4m-wallet-guide-get-started"
              color="blue-100"
              class="get-started-link"
              @click=${this.onGetStarted}
              tabIdx=${$e(this.tabIdx)}
            >
              Get started
            </wiu-link>
          </wiu-flex>`
    }
    onGetStarted() {
      Ae.push("Create")
    }
  };
  Zv.styles = o8e, mA([re()], Zv.prototype, "tabIdx", void 0), mA([re()], Zv.prototype, "walletGuide", void 0), Zv = mA([ye("w4m-wallet-guide")], Zv);
  const a8e = Re`
    :host {
      display: flex;
      justify-content: center;
      gap: var(--wiu-spacing-2xl);
    }
  
    wiu-visual-thumbnail:nth-child(1) {
      z-index: 1;
    }
  `;
  var c8e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let wA = class extends _e {
    constructor() {
      super(...arguments), this.dappImageUrl = Ue.state.metadata?.icons, this.walletImageUrl = ke.state.connectedWalletInfo?.icon
    }
    firstUpdated() {
      const e = this.shadowRoot?.querySelectorAll("wiu-visual-thumbnail");
      e?.[0] && this.createAnimation(e[0], "translate(18px)"), e?.[1] && this.createAnimation(e[1], "translate(-18px)")
    }
    render() {
      return K`
        <wiu-visual-thumbnail
          ?borderRadiusFull=${!0}
          .imageSrc=${this.dappImageUrl?.[0]}
        ></wiu-visual-thumbnail>
        <wiu-visual-thumbnail .imageSrc=${this.walletImageUrl}></wiu-visual-thumbnail>
      `
    }
    createAnimation(e, r) {
      e.animate([{
        transform: "translateX(0px)"
      }, {
        transform: r
      }], {
        duration: 1600,
        easing: "cubic-bezier(0.56, 0, 0.48, 1)",
        direction: "alternate",
        iterations: 1 / 0
      })
    }
  };
  wA.styles = a8e, wA = c8e([ye("w4m-siwx-sign-message-thumbnails")], wA);

  function l8e(t) {
    return new e4e({
      ...t,
      sdkVersion: je.generateSdkVersion(t.adapters ?? [], "html", t4e)
    })
  }
  Yv.type = "coinbaseWallet";

  function Yv(t = {}) {
    return t.version === "3" || t.headlessMode ? d8e(t) : u8e(t)
  }

  function u8e(t) {
    let e, r, n, i, s;
    return o => ({
      id: "coinbaseWalletSDK",
      name: "Coinbase Wallet",
      rdns: "com.coinbase.wallet",
      supportsSimulation: !0,
      type: Yv.type,
      async connect({
        chainId: a
      } = {}) {
        try {
          const c = await this.getProvider(),
            l = (await c.request({
              method: "eth_requestAccounts"
            })).map(f => $i(f));
          n || (n = this.onAccountsChanged.bind(this), c.on("accountsChanged", n)), i || (i = this.onChainChanged.bind(this), c.on("chainChanged", i)), s || (s = this.onDisconnect.bind(this), c.on("disconnect", s));
          let h = await this.getChainId();
          return a && h !== a && (h = (await this.switchChain({
            chainId: a
          }).catch(w => {
            if (w.code === on.code) throw w;
            return {
              id: h
            }
          }))?.id ?? h), {
            accounts: l,
            chainId: h
          }
        } catch (c) {
          throw /(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(c.message) ? new on(c) : c
        }
      },
      async disconnect() {
        const a = await this.getProvider();
        n && (a.removeListener("accountsChanged", n), n = void 0), i && (a.removeListener("chainChanged", i), i = void 0), s && (a.removeListener("disconnect", s), s = void 0), a.disconnect(), a.close?.()
      },
      async getAccounts() {
        return (await (await this.getProvider()).request({
          method: "eth_accounts"
        })).map(c => $i(c))
      },
      async getChainId() {
        const c = await (await this.getProvider()).request({
          method: "eth_chainId"
        });
        return Number(c)
      },
      async getProvider() {
        if (!r) {
          const a = await (async () => {
            const c = await pi(() => Promise.resolve().then(() => G7e), void 0);
            return typeof c.CoinbaseWalletSDK != "function" && typeof c.default == "function" ? c.default : c.CoinbaseWalletSDK
          })();
          e = new a({
            ...t,
            appChainIds: o.chains.map(c => c.id)
          }), r = e.makeWeb3Provider({
            ...t,
            options: t.preference ?? "all"
          })
        }
        return r
      },
      async isAuthorized() {
        try {
          return !!(await this.getAccounts()).length
        } catch {
          return !1
        }
      },
      async switchChain({
        addEthereumChainParameter: a,
        chainId: c
      }) {
        const l = o.chains.find(f => f.id === c);
        if (!l) throw new Rs(new jd);
        const h = await this.getProvider();
        try {
          return await h.request({
            method: "wallet_switchEthereumChain",
            params: [{
              chainId: lr(l.id)
            }]
          }), l
        } catch (f) {
          if (f.code === 4902) try {
            let w;
            a?.blockExplorerUrls ? w = a.blockExplorerUrls : w = l.blockExplorers?.default.url ? [l.blockExplorers?.default.url] : [];
            let b;
            a?.rpcUrls?.length ? b = a.rpcUrls : b = [l.rpcUrls.default?.http[0] ?? ""];
            const C = {
              blockExplorerUrls: w,
              chainId: lr(c),
              chainName: a?.chainName ?? l.name,
              iconUrls: a?.iconUrls,
              nativeCurrency: a?.nativeCurrency ?? l.nativeCurrency,
              rpcUrls: b
            };
            return await h.request({
              method: "wallet_addEthereumChain",
              params: [C]
            }), l
          } catch (w) {
            throw new on(w)
          }
          throw new Rs(f)
        }
      },
      onAccountsChanged(a) {
        a.length === 0 ? this.onDisconnect() : o.emitter.emit("change", {
          accounts: a.map(c => $i(c))
        })
      },
      onChainChanged(a) {
        const c = Number(a);
        o.emitter.emit("change", {
          chainId: c
        })
      },
      async onDisconnect(a) {
        o.emitter.emit("disconnect");
        const c = await this.getProvider();
        n && (c.removeListener("accountsChanged", n), n = void 0), i && (c.removeListener("chainChanged", i), i = void 0), s && (c.removeListener("disconnect", s), s = void 0)
      }
    })
  }

  function d8e(t) {
    let r, n, i, s, o;
    return a => ({
      id: "coinbaseWalletSDK",
      name: "Coinbase Wallet",
      supportsSimulation: !0,
      type: Yv.type,
      async connect({
        chainId: c
      } = {}) {
        try {
          const l = await this.getProvider(),
            h = (await l.request({
              method: "eth_requestAccounts"
            })).map(w => $i(w));
          i || (i = this.onAccountsChanged.bind(this), l.on("accountsChanged", i)), s || (s = this.onChainChanged.bind(this), l.on("chainChanged", s)), o || (o = this.onDisconnect.bind(this), l.on("disconnect", o));
          let f = await this.getChainId();
          return c && f !== c && (f = (await this.switchChain({
            chainId: c
          }).catch(b => {
            if (b.code === on.code) throw b;
            return {
              id: f
            }
          }))?.id ?? f), {
            accounts: h,
            chainId: f
          }
        } catch (l) {
          throw /(user closed modal|accounts received is empty|user denied account)/i.test(l.message) ? new on(l) : l
        }
      },
      async disconnect() {
        const c = await this.getProvider();
        i && (c.removeListener("accountsChanged", i), i = void 0), s && (c.removeListener("chainChanged", s), s = void 0), o && (c.removeListener("disconnect", o), o = void 0), c.disconnect(), c.close()
      },
      async getAccounts() {
        return (await (await this.getProvider()).request({
          method: "eth_accounts"
        })).map(l => $i(l))
      },
      async getChainId() {
        const l = await (await this.getProvider()).request({
          method: "eth_chainId"
        });
        return Number(l)
      },
      async getProvider() {
        if (!n) {
          const c = await (async () => {
            const {
              default: b
            } = await pi(async () => {
              const {
                default: C
              } = await Promise.resolve().then(() => hRe);
              return {
                default: C
              }
            }, void 0);
            return typeof b != "function" && typeof b.default == "function" ? b.default : b
          })();
          r = new c({
            ...t,
            reloadOnDisconnect: !1
          });
          const l = r.walletExtension?.getChainId(),
            h = a.chains.find(b => t.chainId ? b.id === t.chainId : b.id === l) || a.chains[0],
            f = t.chainId || h?.id,
            w = t.jsonRpcUrl || h?.rpcUrls.default.http[0];
          n = r.makeWeb3Provider(w, f)
        }
        return n
      },
      async isAuthorized() {
        try {
          return !!(await this.getAccounts()).length
        } catch {
          return !1
        }
      },
      async switchChain({
        addEthereumChainParameter: c,
        chainId: l
      }) {
        const h = a.chains.find(w => w.id === l);
        if (!h) throw new Rs(new jd);
        const f = await this.getProvider();
        try {
          return await f.request({
            method: "wallet_switchEthereumChain",
            params: [{
              chainId: lr(h.id)
            }]
          }), h
        } catch (w) {
          if (w.code === 4902) try {
            let b;
            c?.blockExplorerUrls ? b = c.blockExplorerUrls : b = h.blockExplorers?.default.url ? [h.blockExplorers?.default.url] : [];
            let C;
            c?.rpcUrls?.length ? C = c.rpcUrls : C = [h.rpcUrls.default?.http[0] ?? ""];
            const M = {
              blockExplorerUrls: b,
              chainId: lr(l),
              chainName: c?.chainName ?? h.name,
              iconUrls: c?.iconUrls,
              nativeCurrency: c?.nativeCurrency ?? h.nativeCurrency,
              rpcUrls: C
            };
            return await f.request({
              method: "wallet_addEthereumChain",
              params: [M]
            }), h
          } catch (b) {
            throw new on(b)
          }
          throw new Rs(w)
        }
      },
      onAccountsChanged(c) {
        c.length === 0 ? this.onDisconnect() : a.emitter.emit("change", {
          accounts: c.map(l => $i(l))
        })
      },
      onChainChanged(c) {
        const l = Number(c);
        a.emitter.emit("change", {
          chainId: l
        })
      },
      async onDisconnect(c) {
        a.emitter.emit("disconnect");
        const l = await this.getProvider();
        i && (l.removeListener("accountsChanged", i), i = void 0), s && (l.removeListener("chainChanged", s), s = void 0), o && (l.removeListener("disconnect", o), o = void 0)
      }
    })
  }
  vA.type = "safe";

  function vA(t = {}) {
    const {
      shimDisconnect: e = !1
    } = t;
    let r, n;
    return i => ({
      id: "safe",
      name: "Safe",
      type: vA.type,
      async connect() {
        const s = await this.getProvider();
        if (!s) throw new no;
        const o = await this.getAccounts(),
          a = await this.getChainId();
        return n || (n = this.onDisconnect.bind(this), s.on("disconnect", n)), e && await i.storage?.removeItem("safe.disconnected"), {
          accounts: o,
          chainId: a
        }
      },
      async disconnect() {
        const s = await this.getProvider();
        if (!s) throw new no;
        n && (s.removeListener("disconnect", n), n = void 0), e && await i.storage?.setItem("safe.disconnected", !0)
      },
      async getAccounts() {
        const s = await this.getProvider();
        if (!s) throw new no;
        return (await s.request({
          method: "eth_accounts"
        })).map($i)
      },
      async getProvider() {
        if (typeof window < "u" && window?.parent !== window) {
          if (!r) {
            const {
              default: o
            } = await pi(async () => {
              const {
                default: h
              } = await Promise.resolve().then(() => ORe);
              return {
                default: h
              }
            }, void 0), a = new o(t), c = await u9(() => a.safe.getInfo(), {
              timeout: t.unstable_getInfoTimeout ?? 10
            });
            if (!c) throw new Error("Could not load Safe information");
            const l = await (async () => {
              const h = await pi(() => Promise.resolve().then(() => URe), void 0);
              return typeof h.SafeAppProvider != "function" && typeof h.default.SafeAppProvider == "function" ? h.default.SafeAppProvider : h.SafeAppProvider
            })();
            r = new l(c, a)
          }
          return r
        }
      },
      async getChainId() {
        const s = await this.getProvider();
        if (!s) throw new no;
        return Number(s.chainId)
      },
      async isAuthorized() {
        try {
          return e && await i.storage?.getItem("safe.disconnected") ? !1 : !!(await this.getAccounts()).length
        } catch {
          return !1
        }
      },
      onAccountsChanged() {},
      onChainChanged() {},
      onDisconnect() {
        i.emitter.emit("disconnect")
      }
    })
  }
  bA.type = "walletConnect";

  function bA(t) {
    const e = t.isNewChainsStale ?? !0;
    let r, n;
    const i = "eip155";
    let s, o, a, c, l, h;
    return f => ({
      id: "walletConnect",
      name: "WalletConnect",
      type: bA.type,
      async setup() {
        const w = await this.getProvider().catch(() => null);
        w && (a || (a = this.onConnect.bind(this), w.on("connect", a)), l || (l = this.onSessionDelete.bind(this), w.on("session_delete", l)))
      },
      async connect({
        chainId: w,
        ...b
      } = {}) {
        try {
          const C = await this.getProvider();
          if (!C) throw new no;
          c || (c = this.onDisplayUri, C.on("display_uri", c));
          let M = w;
          if (!M) {
            const B = await f.storage?.getItem("state") ?? {};
            f.chains.some(D => D.id === B.chainId) ? M = B.chainId : M = f.chains[0]?.id
          }
          if (!M) throw new Error("No chains found on connector.");
          const N = await this.isChainsStale();
          if (C.session && N && await C.disconnect(), !C.session || N) {
            const B = f.chains.filter(F => F.id !== M).map(F => F.id);
            await C.connect({
              optionalChains: [M, ...B],
              ..."pairingTopic" in b ? {
                pairingTopic: b.pairingTopic
              } : {}
            }), this.setRequestedChainsIds(f.chains.map(F => F.id))
          }
          const $ = (await C.enable()).map(B => $i(B)),
            k = await this.getChainId();
          return c && (C.removeListener("display_uri", c), c = void 0), a && (C.removeListener("connect", a), a = void 0), s || (s = this.onAccountsChanged.bind(this), C.on("accountsChanged", s)), o || (o = this.onChainChanged.bind(this), C.on("chainChanged", o)), h || (h = this.onDisconnect.bind(this), C.on("disconnect", h)), l || (l = this.onSessionDelete.bind(this), C.on("session_delete", l)), {
            accounts: $,
            chainId: k
          }
        } catch (C) {
          throw /(user rejected|connection request reset)/i.test(C?.message) ? new on(C) : C
        }
      },
      async disconnect() {
        const w = await this.getProvider();
        try {
          await w?.disconnect()
        } catch (b) {
          if (!/No matching key/i.test(b.message)) throw b
        } finally {
          o && (w?.removeListener("chainChanged", o), o = void 0), h && (w?.removeListener("disconnect", h), h = void 0), a || (a = this.onConnect.bind(this), w?.on("connect", a)), s && (w?.removeListener("accountsChanged", s), s = void 0), l && (w?.removeListener("session_delete", l), l = void 0), this.setRequestedChainsIds([])
        }
      },
      async getAccounts() {
        return (await this.getProvider()).accounts.map(b => $i(b))
      },
      async getProvider({
        chainId: w
      } = {}) {
        async function b() {
          const C = f.chains.map(N => N.id);
          if (!C.length) return;
          const {
            EthereumProvider: M
          } = await pi(async () => {
            const {
              EthereumProvider: N
            } = await Promise.resolve().then(() => YRe);
            return {
              EthereumProvider: N
            }
          }, void 0);
          return await M.init({
            ...t,
            disableProviderPing: !0,
            optionalChains: C,
            projectId: t.projectId,
            rpcMap: Object.fromEntries(f.chains.map(N => {
              const [$] = are({
                chain: N,
                transports: f.transports
              });
              return [N.id, $]
            })),
            showQrModal: t.showQrModal ?? !0
          })
        }
        return r || (n || (n = b()), r = await n, r?.events.setMaxListeners(Number.POSITIVE_INFINITY)), w && await this.switchChain?.({
          chainId: w
        }), r
      },
      async getChainId() {
        return (await this.getProvider()).chainId
      },
      async isAuthorized() {
        try {
          const [w, b] = await Promise.all([this.getAccounts(), this.getProvider()]);
          return w.length ? await this.isChainsStale() && b.session ? (await b.disconnect().catch(() => {}), !1) : !0 : !1
        } catch {
          return !1
        }
      },
      async switchChain({
        addEthereumChainParameter: w,
        chainId: b
      }) {
        const C = await this.getProvider();
        if (!C) throw new no;
        const M = f.chains.find(N => N.id === b);
        if (!M) throw new Rs(new jd);
        try {
          await Promise.all([new Promise($ => {
            const k = ({
              chainId: B
            }) => {
              B === b && (f.emitter.off("change", k), $())
            };
            f.emitter.on("change", k)
          }), C.request({
            method: "wallet_switchEthereumChain",
            params: [{
              chainId: lr(b)
            }]
          })]);
          const N = await this.getRequestedChainsIds();
          return this.setRequestedChainsIds([...N, b]), M
        } catch (N) {
          const $ = N;
          if (/(user rejected)/i.test($.message)) throw new on($);
          try {
            let k;
            w?.blockExplorerUrls ? k = w.blockExplorerUrls : k = M.blockExplorers?.default.url ? [M.blockExplorers?.default.url] : [];
            let B;
            w?.rpcUrls?.length ? B = w.rpcUrls : B = [...M.rpcUrls.default.http];
            const F = {
              blockExplorerUrls: k,
              chainId: lr(b),
              chainName: w?.chainName ?? M.name,
              iconUrls: w?.iconUrls,
              nativeCurrency: w?.nativeCurrency ?? M.nativeCurrency,
              rpcUrls: B
            };
            await C.request({
              method: "wallet_addEthereumChain",
              params: [F]
            });
            const D = await this.getRequestedChainsIds();
            return this.setRequestedChainsIds([...D, b]), M
          } catch (k) {
            throw new on(k)
          }
        }
      },
      onAccountsChanged(w) {
        w.length === 0 ? this.onDisconnect() : f.emitter.emit("change", {
          accounts: w.map(b => $i(b))
        })
      },
      onChainChanged(w) {
        const b = Number(w);
        f.emitter.emit("change", {
          chainId: b
        })
      },
      async onConnect(w) {
        const b = Number(w.chainId),
          C = await this.getAccounts();
        f.emitter.emit("connect", {
          accounts: C,
          chainId: b
        })
      },
      async onDisconnect(w) {
        this.setRequestedChainsIds([]), f.emitter.emit("disconnect");
        const b = await this.getProvider();
        s && (b.removeListener("accountsChanged", s), s = void 0), o && (b.removeListener("chainChanged", o), o = void 0), h && (b.removeListener("disconnect", h), h = void 0), l && (b.removeListener("session_delete", l), l = void 0), a || (a = this.onConnect.bind(this), b.on("connect", a))
      },
      onDisplayUri(w) {
        f.emitter.emit("message", {
          type: "display_uri",
          data: w
        })
      },
      onSessionDelete() {
        this.onDisconnect()
      },
      getNamespaceChainsIds() {
        return r ? r.session?.namespaces[i]?.accounts?.map(b => Number.parseInt(b.split(":")[1] || "")) ?? [] : []
      },
      async getRequestedChainsIds() {
        return await f.storage?.getItem(this.requestedChainsStorageKey) ?? []
      },
      async isChainsStale() {
        if (!e) return !1;
        const w = f.chains.map(M => M.id),
          b = this.getNamespaceChainsIds();
        if (b.length && !b.some(M => w.includes(M))) return !1;
        const C = await this.getRequestedChainsIds();
        return !w.every(M => C.includes(M))
      },
      async setRequestedChainsIds(w) {
        await f.storage?.setItem(this.requestedChainsStorageKey, w)
      },
      get requestedChainsStorageKey() {
        return `${this.id}.requestedChains`
      }
    })
  }
  async function h8e(t) {
    if (!t) throw new Error("networkControllerClient:getApprovedCaipNetworks - connector is undefined");
    const e = await t?.getProvider();
    return {
      supportsAllNetworks: !1,
      approvedCaipNetworkIds: I4.getChainsFromNamespaces(e?.session?.namespaces)
    }
  }

  function f8e() {
    return {
      supportsAllNetworks: !0,
      approvedCaipNetworkIds: Fu.WalletConnectRpcChainIds.map(t => `${mr.EIP155}:${t}`)
    }
  }

  function Cj(t) {
    if (!t) throw new Error("No CAIP address provided");
    const e = t.split(":")[2];
    if (!e) throw new Error("Invalid CAIP address");
    return e
  }

  function p8e(t) {
    try {
      return JSON.parse(t)
    } catch {
      throw new Error("Error parsing wallet capabilities")
    }
  }
  var g8e = " ";
  const Ej = new Map([
      [8217, "apostrophe"],
      [8260, "fraction slash"],
      [12539, "middle dot"]
    ]),
    Aj = 4;

  function m8e(t) {
    let e = 0;

    function r() {
      return t[e++] << 8 | t[e++]
    }
    let n = r(),
      i = 1,
      s = [0, 1];
    for (let D = 1; D < n; D++) s.push(i += r());
    let o = r(),
      a = e;
    e += o;
    let c = 0,
      l = 0;

    function h() {
      return c == 0 && (l = l << 8 | t[e++], c = 8), l >> --c & 1
    }
    const f = 31,
      w = 2 ** f,
      b = w >>> 1,
      C = b >> 1,
      M = w - 1;
    let N = 0;
    for (let D = 0; D < f; D++) N = N << 1 | h();
    let $ = [],
      k = 0,
      B = w;
    for (;;) {
      let D = Math.floor(((N - k + 1) * i - 1) / B),
        V = 0,
        R = n;
      for (; R - V > 1;) {
        let Y = V + R >>> 1;
        D < s[Y] ? R = Y : V = Y
      }
      if (V == 0) break;
      $.push(V);
      let P = k + Math.floor(B * s[V] / i),
        j = k + Math.floor(B * s[V + 1] / i) - 1;
      for (; !((P ^ j) & b);) N = N << 1 & M | h(), P = P << 1 & M, j = j << 1 & M | 1;
      for (; P & ~j & C;) N = N & b | N << 1 & M >>> 1 | h(), P = P << 1 ^ b, j = (j ^ b) << 1 | b | 1;
      k = P, B = 1 + j - P
    }
    let F = n - 4;
    return $.map(D => {
      switch (D - F) {
        case 3:
          return F + 65792 + (t[a++] << 16 | t[a++] << 8 | t[a++]);
        case 2:
          return F + 256 + (t[a++] << 8 | t[a++]);
        case 1:
          return F + t[a++];
        default:
          return D - 1
      }
    })
  }

  function w8e(t) {
    let e = 0;
    return () => t[e++]
  }

  function Sj(t) {
    return w8e(m8e(v8e(t)))
  }

  function v8e(t) {
    let e = [];
    [..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i, s) => e[i.charCodeAt(0)] = s);
    let r = t.length,
      n = new Uint8Array(6 * r >> 3);
    for (let i = 0, s = 0, o = 0, a = 0; i < r; i++) a = a << 6 | e[t.charCodeAt(i)], o += 6, o >= 8 && (n[s++] = a >> (o -= 8));
    return n
  }

  function b8e(t) {
    return t & 1 ? ~t >> 1 : t >> 1
  }

  function y8e(t, e) {
    let r = Array(t);
    for (let n = 0, i = 0; n < t; n++) r[n] = i += b8e(e());
    return r
  }

  function Qv(t, e = 0) {
    let r = [];
    for (;;) {
      let n = t(),
        i = t();
      if (!i) break;
      e += n;
      for (let s = 0; s < i; s++) r.push(e + s);
      e += i + 1
    }
    return r
  }

  function Ij(t) {
    return Jv(() => {
      let e = Qv(t);
      if (e.length) return e
    })
  }

  function Tj(t) {
    let e = [];
    for (;;) {
      let r = t();
      if (r == 0) break;
      e.push(_8e(r, t))
    }
    for (;;) {
      let r = t() - 1;
      if (r < 0) break;
      e.push(x8e(r, t))
    }
    return e.flat()
  }

  function Jv(t) {
    let e = [];
    for (;;) {
      let r = t(e.length);
      if (!r) break;
      e.push(r)
    }
    return e
  }

  function kj(t, e, r) {
    let n = Array(t).fill().map(() => []);
    for (let i = 0; i < e; i++) y8e(t, r).forEach((s, o) => n[o].push(s));
    return n
  }

  function _8e(t, e) {
    let r = 1 + e(),
      n = e(),
      i = Jv(e);
    return kj(i.length, 1 + t, e).flatMap((o, a) => {
      let [c, ...l] = o;
      return Array(i[a]).fill().map((h, f) => {
        let w = f * n;
        return [c + f * r, l.map(b => b + w)]
      })
    })
  }

  function x8e(t, e) {
    let r = 1 + e();
    return kj(r, 1 + t, e).map(i => [i[0], i.slice(1)])
  }

  function C8e(t) {
    let e = [],
      r = Qv(t);
    return i(n([]), []), e;

    function n(s) {
      let o = t(),
        a = Jv(() => {
          let c = Qv(t).map(l => r[l]);
          if (c.length) return n(c)
        });
      return {
        S: o,
        B: a,
        Q: s
      }
    }

    function i({
      S: s,
      B: o
    }, a, c) {
      if (!(s & 4 && c === a[a.length - 1])) {
        s & 2 && (c = a[a.length - 1]), s & 1 && e.push(a);
        for (let l of o)
          for (let h of l.Q) i(l, [...a, h], c)
      }
    }
  }

  function E8e(t) {
    return t.toString(16).toUpperCase().padStart(2, "0")
  }

  function Rj(t) {
    return `{${E8e(t)}}`
  }

  function A8e(t) {
    let e = [];
    for (let r = 0, n = t.length; r < n;) {
      let i = t.codePointAt(r);
      r += i < 65536 ? 1 : 2, e.push(i)
    }
    return e
  }

  function Lg(t) {
    let r = t.length;
    if (r < 4096) return String.fromCodePoint(...t);
    let n = [];
    for (let i = 0; i < r;) n.push(String.fromCodePoint(...t.slice(i, i += 4096)));
    return n.join("")
  }

  function S8e(t, e) {
    let r = t.length,
      n = r - e.length;
    for (let i = 0; n == 0 && i < r; i++) n = t[i] - e[i];
    return n
  }
  var I8e = " ";
  const Xv = 44032,
    s6 = 4352,
    o6 = 4449,
    a6 = 4519,
    Nj = 19,
    Mj = 21,
    Bg = 28,
    c6 = Mj * Bg,
    T8e = Nj * c6,
    k8e = Xv + T8e,
    R8e = s6 + Nj,
    N8e = o6 + Mj,
    M8e = a6 + Bg;

  function eb(t) {
    return t >> 24 & 255
  }

  function Pj(t) {
    return t & 16777215
  }
  let yA, $j, _A, l6;

  function P8e() {
    let t = Sj(I8e);
    yA = new Map(Ij(t).flatMap((e, r) => e.map(n => [n, r + 1 << 24]))), $j = new Set(Qv(t)), _A = new Map, l6 = new Map;
    for (let [e, r] of Tj(t)) {
      if (!$j.has(e) && r.length == 2) {
        let [n, i] = r, s = l6.get(n);
        s || (s = new Map, l6.set(n, s)), s.set(i, e)
      }
      _A.set(e, r.reverse())
    }
  }

  function Oj(t) {
    return t >= Xv && t < k8e
  }

  function $8e(t, e) {
    if (t >= s6 && t < R8e && e >= o6 && e < N8e) return Xv + (t - s6) * c6 + (e - o6) * Bg;
    if (Oj(t) && e > a6 && e < M8e && (t - Xv) % Bg == 0) return t + (e - a6); {
      let r = l6.get(t);
      return r && (r = r.get(e), r) ? r : -1
    }
  }

  function Dj(t) {
    yA || P8e();
    let e = [],
      r = [],
      n = !1;

    function i(s) {
      let o = yA.get(s);
      o && (n = !0, s |= o), e.push(s)
    }
    for (let s of t)
      for (;;) {
        if (s < 128) e.push(s);
        else if (Oj(s)) {
          let o = s - Xv,
            a = o / c6 | 0,
            c = o % c6 / Bg | 0,
            l = o % Bg;
          i(s6 + a), i(o6 + c), l > 0 && i(a6 + l)
        } else {
          let o = _A.get(s);
          o ? r.push(...o) : i(s)
        }
        if (!r.length) break;
        s = r.pop()
      }
    if (n && e.length > 1) {
      let s = eb(e[0]);
      for (let o = 1; o < e.length; o++) {
        let a = eb(e[o]);
        if (a == 0 || s <= a) {
          s = a;
          continue
        }
        let c = o - 1;
        for (;;) {
          let l = e[c + 1];
          if (e[c + 1] = e[c], e[c] = l, !c || (s = eb(e[--c]), s <= a)) break
        }
        s = eb(e[o])
      }
    }
    return e
  }

  function O8e(t) {
    let e = [],
      r = [],
      n = -1,
      i = 0;
    for (let s of t) {
      let o = eb(s),
        a = Pj(s);
      if (n == -1) o == 0 ? n = a : e.push(a);
      else if (i > 0 && i >= o) o == 0 ? (e.push(n, ...r), r.length = 0, n = a) : r.push(a), i = o;
      else {
        let c = $8e(n, a);
        c >= 0 ? n = c : i == 0 && o == 0 ? (e.push(n), n = a) : (r.push(a), i = o)
      }
    }
    return n >= 0 && e.push(n, ...r), e
  }

  function Lj(t) {
    return Dj(t).map(Pj)
  }

  function D8e(t) {
    return O8e(Dj(t))
  }
  const Bj = 45,
    Uj = ".",
    jj = 65039,
    Fj = 1,
    u6 = t => Array.from(t);

  function tb(t, e) {
    return t.P.has(e) || t.Q.has(e)
  }
  class L8e extends Array {
    get is_emoji() {
      return !0
    }
  }
  let xA, Wj, G0, CA, zj, Ug, EA, jg, Z0, Hj, AA;

  function SA() {
    if (xA) return;
    let t = Sj(g8e);
    const e = () => Qv(t),
      r = () => new Set(e()),
      n = (h, f) => f.forEach(w => h.add(w));
    xA = new Map(Tj(t)), Wj = r(), G0 = e(), CA = new Set(e().map(h => G0[h])), G0 = new Set(G0), zj = r(), r();
    let i = Ij(t),
      s = t();
    const o = () => {
      let h = new Set;
      return e().forEach(f => n(h, i[f])), n(h, e()), h
    };
    Ug = Jv(h => {
      let f = Jv(t).map(w => w + 96);
      if (f.length) {
        let w = h >= s;
        f[0] -= 32, f = Lg(f), w && (f = `Restricted[${f}]`);
        let b = o(),
          C = o(),
          M = !t();
        return {
          N: f,
          P: b,
          Q: C,
          M,
          R: w
        }
      }
    }), EA = r(), jg = new Map;
    let a = e().concat(u6(EA)).sort((h, f) => h - f);
    a.forEach((h, f) => {
      let w = t(),
        b = a[f] = w ? a[f - w] : {
          V: [],
          M: new Map
        };
      b.V.push(h), EA.has(h) || jg.set(h, b)
    });
    for (let {
        V: h,
        M: f
      }
      of new Set(jg.values())) {
      let w = [];
      for (let C of h) {
        let M = Ug.filter($ => tb($, C)),
          N = w.find(({
            G: $
          }) => M.some(k => $.has(k)));
        N || (N = {
          G: new Set,
          V: []
        }, w.push(N)), N.V.push(C), n(N.G, M)
      }
      let b = w.flatMap(C => u6(C.G));
      for (let {
          G: C,
          V: M
        }
        of w) {
        let N = new Set(b.filter($ => !C.has($)));
        for (let $ of M) f.set($, N)
      }
    }
    Z0 = new Set;
    let c = new Set;
    const l = h => Z0.has(h) ? c.add(h) : Z0.add(h);
    for (let h of Ug) {
      for (let f of h.P) l(f);
      for (let f of h.Q) l(f)
    }
    for (let h of Z0) !jg.has(h) && !c.has(h) && jg.set(h, Fj);
    n(Z0, Lj(Z0)), Hj = C8e(t).map(h => L8e.from(h)).sort(S8e), AA = new Map;
    for (let h of Hj) {
      let f = [AA];
      for (let w of h) {
        let b = f.map(C => {
          let M = C.get(w);
          return M || (M = new Map, C.set(w, M)), M
        });
        w === jj ? f.push(...b) : f = b
      }
      for (let w of f) w.V = h
    }
  }

  function IA(t) {
    return (qj(t) ? "" : `${TA(d6([t]))} `) + Rj(t)
  }

  function TA(t) {
    return `"${t}"‎`
  }

  function B8e(t) {
    if (t.length >= 4 && t[2] == Bj && t[3] == Bj) throw new Error(`invalid label extension: "${Lg(t.slice(0,4))}"`)
  }

  function U8e(t) {
    for (let r = t.lastIndexOf(95); r > 0;)
      if (t[--r] !== 95) throw new Error("underscore allowed only at start")
  }

  function j8e(t) {
    let e = t[0],
      r = Ej.get(e);
    if (r) throw rb(`leading ${r}`);
    let n = t.length,
      i = -1;
    for (let s = 1; s < n; s++) {
      e = t[s];
      let o = Ej.get(e);
      if (o) {
        if (i == s) throw rb(`${r} + ${o}`);
        i = s + 1, r = o
      }
    }
    if (i == n) throw rb(`trailing ${r}`)
  }

  function d6(t, e = 1 / 0, r = Rj) {
    let n = [];
    F8e(t[0]) && n.push("◌"), t.length > e && (e >>= 1, t = [...t.slice(0, e), 8230, ...t.slice(-e)]);
    let i = 0,
      s = t.length;
    for (let o = 0; o < s; o++) {
      let a = t[o];
      qj(a) && (n.push(Lg(t.slice(i, o))), n.push(r(a)), i = o + 1)
    }
    return n.push(Lg(t.slice(i, s))), n.join("")
  }

  function F8e(t, e) {
    return SA(), G0.has(t)
  }

  function qj(t) {
    return SA(), zj.has(t)
  }

  function W8e(t) {
    return V8e(z8e(t, D8e, Z8e))
  }

  function z8e(t, e, r) {
    if (!t) return [];
    SA();
    let n = 0;
    return t.split(Uj).map(i => {
      let s = A8e(i),
        o = {
          input: s,
          offset: n
        };
      n += s.length + 1;
      try {
        let a = o.tokens = G8e(s, e, r),
          c = a.length,
          l;
        if (!c) throw new Error("empty label");
        let h = o.output = a.flat();
        if (U8e(h), !(o.emoji = c > 1 || a[0].is_emoji) && h.every(w => w < 128)) B8e(h), l = "ASCII";
        else {
          let w = a.flatMap(b => b.is_emoji ? [] : b);
          if (!w.length) l = "Emoji";
          else {
            if (G0.has(h[0])) throw rb("leading combining mark");
            for (let M = 1; M < c; M++) {
              let N = a[M];
              if (!N.is_emoji && G0.has(N[0])) throw rb(`emoji + combining mark: "${Lg(a[M-1])} + ${d6([N[0]])}"`)
            }
            j8e(h);
            let b = u6(new Set(w)),
              [C] = q8e(b);
            K8e(C, w), H8e(C, b), l = C.N
          }
        }
        o.type = l
      } catch (a) {
        o.error = a
      }
      return o
    })
  }

  function H8e(t, e) {
    let r, n = [];
    for (let i of e) {
      let s = jg.get(i);
      if (s === Fj) return;
      if (s) {
        let o = s.M.get(i);
        if (r = r ? r.filter(a => o.has(a)) : u6(o), !r.length) return
      } else n.push(i)
    }
    if (r) {
      for (let i of r)
        if (n.every(s => tb(i, s))) throw new Error(`whole-script confusable: ${t.N}/${i.N}`)
    }
  }

  function q8e(t) {
    let e = Ug;
    for (let r of t) {
      let n = e.filter(i => tb(i, r));
      if (!n.length) throw Ug.some(i => tb(i, r)) ? Kj(e[0], r) : Vj(r);
      if (e = n, n.length == 1) break
    }
    return e
  }

  function V8e(t) {
    return t.map(({
      input: e,
      error: r,
      output: n
    }) => {
      if (r) {
        let i = r.message;
        throw new Error(t.length == 1 ? i : `Invalid label ${TA(d6(e,63))}: ${i}`)
      }
      return Lg(n)
    }).join(Uj)
  }

  function Vj(t) {
    return new Error(`disallowed character: ${IA(t)}`)
  }

  function Kj(t, e) {
    let r = IA(e),
      n = Ug.find(i => i.P.has(e));
    return n && (r = `${n.N} ${r}`), new Error(`illegal mixture: ${t.N} + ${r}`)
  }

  function rb(t) {
    return new Error(`illegal placement: ${t}`)
  }

  function K8e(t, e) {
    for (let r of e)
      if (!tb(t, r)) throw Kj(t, r);
    if (t.M) {
      let r = Lj(e);
      for (let n = 1, i = r.length; n < i; n++)
        if (CA.has(r[n])) {
          let s = n + 1;
          for (let o; s < i && CA.has(o = r[s]); s++)
            for (let a = n; a < s; a++)
              if (r[a] == o) throw new Error(`duplicate non-spacing marks: ${IA(o)}`);
          if (s - n > Aj) throw new Error(`excessive non-spacing marks: ${TA(d6(r.slice(n-1,s)))} (${s-n}/${Aj})`);
          n = s
        }
    }
  }

  function G8e(t, e, r) {
    let n = [],
      i = [];
    for (t = t.slice().reverse(); t.length;) {
      let s = Y8e(t);
      if (s) i.length && (n.push(e(i)), i = []), n.push(r(s));
      else {
        let o = t.pop();
        if (Z0.has(o)) i.push(o);
        else {
          let a = xA.get(o);
          if (a) i.push(...a);
          else if (!Wj.has(o)) throw Vj(o)
        }
      }
    }
    return i.length && n.push(e(i)), n
  }

  function Z8e(t) {
    return t.filter(e => e != jj)
  }

  function Y8e(t, e) {
    let r = AA,
      n, i = t.length;
    for (; i && (r = r.get(t[--i]), !!r);) {
      let {
        V: s
      } = r;
      s && (n = s, t.length = i)
    }
    return n
  }

  function Gj(t) {
    return W8e(t)
  }
  Gj.parseError = t => t;

  function Zj(t) {
    return Gj(t)
  }
  kA.type = "walletConnect";

  function kA(t, e, r) {
    const n = t.isNewChainsStale ?? !0;
    let i, s, o, a, c, l, h, f;
    return w => ({
      id: "walletConnect",
      name: "WalletConnect",
      type: kA.type,
      async setup() {
        const b = await this.getProvider().catch(() => null);
        b && (c || (c = this.onConnect.bind(this), b.on("connect", c)), h || (h = this.onSessionDelete.bind(this), b.on("session_delete", h)))
      },
      async connect({
        ...b
      } = {}) {
        try {
          const C = await this.getProvider();
          if (!C) throw new no;
          l || (l = this.onDisplayUri, C.on("display_uri", l));
          const M = await this.isChainsStale();
          if (C.session && M && await C.disconnect(), !C.session || M) {
            const k = I4.createNamespaces(r);
            await C.connect({
              optionalNamespaces: k,
              ..."pairingTopic" in b ? {
                pairingTopic: b.pairingTopic
              } : {}
            }), this.setRequestedChainsIds(r.map(B => Number(B.id)))
          }
          const N = (await C.enable()).map(k => $i(k)),
            $ = await this.getChainId();
          return l && (C.removeListener("display_uri", l), l = void 0), c && (C.removeListener("connect", c), c = void 0), o || (o = this.onAccountsChanged.bind(this), C.on("accountsChanged", o)), a || (a = this.onChainChanged.bind(this), C.on("chainChanged", a)), f || (f = this.onDisconnect.bind(this), C.on("disconnect", f)), h || (h = this.onSessionDelete.bind(this), C.on("session_delete", h)), {
            accounts: N,
            chainId: $
          }
        } catch (C) {
          throw /(user rejected|connection request reset)/i.test(C?.message) ? new on(C) : C
        }
      },
      async disconnect() {
        const b = await this.getProvider();
        try {
          await b?.disconnect()
        } catch (C) {
          if (!/No matching key/i.test(C.message)) throw C
        } finally {
          a && (b?.removeListener("chainChanged", a), a = void 0), f && (b?.removeListener("disconnect", f), f = void 0), c || (c = this.onConnect.bind(this), b?.on("connect", c)), o && (b?.removeListener("accountsChanged", o), o = void 0), h && (b?.removeListener("session_delete", h), h = void 0), this.setRequestedChainsIds([])
        }
      },
      async getAccounts() {
        const b = await this.getProvider();
        return b?.session?.namespaces ? b?.session?.namespaces.eip155?.accounts?.map(N => N.split(":")[2]) ?? [] : []
      },
      async getProvider({
        chainId: b
      } = {}) {
        async function C() {
          if (!r.map(k => Number(k.id)).length) return;
          const $ = e.universalAdapter?.getWalletConnectProvider();
          if (!$) throw new Error("Provider not found");
          return $
        }
        i || (s || (s = C()), i = await s, i?.events.setMaxListeners(Number.POSITIVE_INFINITY));
        const M = e.getCaipNetwork()?.id;
        if (b && M !== b) {
          const N = Ar.getStoredActiveCaipNetwork();
          N && N.chainNamespace === pr.CHAIN.EVM ? await this.switchChain?.({
            chainId: Number(N.id)
          }) : await this.switchChain?.({
            chainId: b
          })
        }
        return i
      },
      async getChainId() {
        const b = e.getCaipNetwork()?.id;
        if (b) return b;
        const M = (await this.getProvider()).session?.namespaces.eip155?.chains?.[0];
        return r.find($ => $.id === M)?.id
      },
      async isAuthorized() {
        try {
          const [b, C] = await Promise.all([this.getAccounts(), this.getProvider()]);
          return b.length ? await this.isChainsStale() && C.session ? (await C.disconnect().catch(() => {}), !1) : !0 : !1
        } catch {
          return !1
        }
      },
      async switchChain({
        addEthereumChainParameter: b,
        chainId: C
      }) {
        const M = await this.getProvider();
        if (!M) throw new no;
        const N = r.find($ => $.id === C);
        if (!N) throw new Rs(new jd);
        try {
          N?.caipNetworkId && M.setDefaultChain(N?.caipNetworkId), await M.request({
            method: "wallet_switchEthereumChain",
            params: [{
              chainId: lr(C)
            }]
          }), w.emitter.emit("change", {
            chainId: Number(C)
          });
          const $ = await this.getRequestedChainsIds();
          return this.setRequestedChainsIds([...$, C]), {
            ...N,
            id: N.id
          }
        } catch ($) {
          const k = $;
          if (/(?:user rejected)/iu.test(k.message)) throw new on(k);
          try {
            let B;
            b?.blockExplorerUrls ? B = b.blockExplorerUrls : B = N.blockExplorers?.default.url ? [N.blockExplorers?.default.url] : [];
            const F = {
              blockExplorerUrls: B,
              chainId: lr(C),
              chainName: N.name,
              iconUrls: b?.iconUrls,
              nativeCurrency: N.nativeCurrency,
              rpcUrls: N.rpcUrls.default.http
            };
            await M.request({
              method: "wallet_addEthereumChain",
              params: [F]
            });
            const D = await this.getRequestedChainsIds();
            return this.setRequestedChainsIds([...D, C]), {
              ...N,
              id: N.id
            }
          } catch (B) {
            throw new on(B)
          }
        }
      },
      onAccountsChanged(b) {
        b.length === 0 ? this.onDisconnect() : w.emitter.emit("change", {
          accounts: b.map(C => $i(C))
        })
      },
      onChainChanged(b) {
        const C = Number(b);
        w.emitter.emit("change", {
          chainId: C
        })
      },
      async onConnect(b) {
        const C = Number(b.chainId),
          M = await this.getAccounts();
        w.emitter.emit("connect", {
          accounts: M,
          chainId: C
        })
      },
      async onDisconnect(b) {
        this.setRequestedChainsIds([]), w.emitter.emit("disconnect");
        const C = await this.getProvider();
        o && (C.removeListener("accountsChanged", o), o = void 0), a && (C.removeListener("chainChanged", a), a = void 0), f && (C.removeListener("disconnect", f), f = void 0), h && (C.removeListener("session_delete", h), h = void 0), c || (c = this.onConnect.bind(this), C.on("connect", c))
      },
      onDisplayUri(b) {
        w.emitter.emit("message", {
          type: "display_uri",
          data: b
        })
      },
      onSessionDelete() {
        this.onDisconnect()
      },
      getNamespaceChainsIds() {
        return i?.session?.namespaces ? i?.session?.namespaces.eip155?.accounts?.map(M => Number.parseInt(M.split(":")[1] ?? "")) ?? [] : []
      },
      async getRequestedChainsIds() {
        const b = await w.storage?.getItem(this.requestedChainsStorageKey) ?? [];
        return [...new Set(b)]
      },
      async isChainsStale() {
        if (!n) return !1;
        const b = w.chains.map(N => N.id),
          C = this.getNamespaceChainsIds();
        if (C.length && !C.some(N => b.includes(N))) return !1;
        const M = await this.getRequestedChainsIds();
        return !b.every(N => M.includes(Number(N)))
      },
      async setRequestedChainsIds(b) {
        await w.storage?.setItem(this.requestedChainsStorageKey, b)
      },
      get requestedChainsStorageKey() {
        return `${this.id}.requestedChains`
      }
    })
  }
  class nb {
    constructor() {}
    static getInstance({
      projectId: e,
      chainId: r,
      onTimeout: n
    }) {
      return nb.instance || (nb.instance = new Rse({
        projectId: e,
        chainId: r,
        onTimeout: n
      })), nb.instance
    }
  }

  function Q8e(t) {
    let e = [];

    function r(n) {
      return $9.parseEvmChainId(n) || 1
    }
    return n => ({
      id: mr.AUTH_CONNECTOR_ID,
      name: "AppKit Auth",
      type: "w3mAuth",
      chain: pr.CHAIN.EVM,
      async connect(i = {}) {
        const s = await this.getProvider();
        let o = i.chainId;
        if (i.isReconnecting && (o = s.getLastUsedChainId(), !o)) throw new Error("ChainId not found in provider");
        const {
          address: a,
          chainId: c,
          accounts: l
        } = await s.connect({
          chainId: o
        });
        e = l?.map(f => f.address) || [a], await s.getSmartAccountEnabledNetworks();
        const h = r(c);
        return {
          accounts: e,
          account: a,
          chainId: h,
          chain: {
            id: h,
            unsuported: !1
          }
        }
      },
      async disconnect() {
        await (await this.getProvider()).disconnect()
      },
      getAccounts() {
        return e?.length ? (n.emitter.emit("change", {
          accounts: e
        }), Promise.resolve(e)) : Promise.resolve([])
      },
      async getProvider() {
        return this.provider || (this.provider = nb.getInstance({
          projectId: t.options.projectId,
          onTimeout: () => {
            Zd.open(Y1.ALERT_ERRORS.SOCIALS_TIMEOUT, "error")
          }
        })), Promise.resolve(this.provider)
      },
      async getChainId() {
        const i = await this.getProvider(),
          {
            chainId: s
          } = await i.getChainId();
        return r(s)
      },
      async isAuthorized() {
        const i = await this.getProvider();
        return Promise.resolve(i.getLoginEmailUsed())
      },
      async switchChain({
        chainId: i
      }) {
        try {
          const s = n.chains.find(c => c.id === i);
          if (!s) throw new Rs(new Error("chain not found on connector."));
          const a = await (await this.getProvider()).connect({
            chainId: i
          });
          return e = a?.accounts?.map(c => c.address) || [a.address], n.emitter.emit("change", {
            chainId: Number(i),
            accounts: e
          }), s
        } catch (s) {
          throw s instanceof Error ? new Rs(s) : s
        }
      },
      onAccountsChanged(i) {
        i.length === 0 ? this.onDisconnect() : n.emitter.emit("change", {
          accounts: i.map($i)
        })
      },
      onChainChanged(i) {
        const s = Number(i);
        n.emitter.emit("change", {
          chainId: s
        })
      },
      async onDisconnect(i) {
        await (await this.getProvider()).disconnect()
      }
    })
  }
  const J8e = ["eth_accounts", "eth_requestAccounts", "eth_sendRawTransaction", "eth_sign", "eth_signTransaction", "eth_signTypedData", "eth_signTypedData_v3", "eth_signTypedData_v4", "eth_sendTransaction", "personal_sign", "wallet_switchEthereumChain", "wallet_addEthereumChain", "wallet_getPermissions", "wallet_requestPermissions", "wallet_registerOnboarding", "wallet_watchAsset", "wallet_scanQRCode", "wallet_getCallsStatus", "wallet_sendCalls", "wallet_getCapabilities", "wallet_grantPermissions"];
  class X8e {
    constructor(e) {
      if (this.appKit = void 0, this.options = void 0, this.chainNamespace = pr.CHAIN.EVM, this.defaultCaipNetwork = void 0, this.tokens = d$.getCaipTokens(this.options?.tokens), this.siweControllerClient = this.options?.siweConfig, this.adapterType = "wagmi", !e.projectId) throw new Error(Y1.ALERT_ERRORS.PROJECT_ID_NOT_CONFIGURED.shortMessage);
      this.caipNetworks = B2.extendCaipNetworks(e.networks, {
        projectId: e.projectId,
        customNetworkImageUrls: {}
      }), this.wagmiChains = this.caipNetworks.filter(s => s.chainNamespace === pr.CHAIN.EVM);
      const r = this.wagmiChains.map(s => [s.id, B2.getViemTransport(s)]);
      Object.entries(e.transports ?? {}).forEach(([s, o]) => {
        const a = r.findIndex(([c]) => c === Number(s));
        a === -1 ? r.push([Number(s), o]) : r[a] = [Number(s), o]
      });
      const n = Object.fromEntries(r),
        i = [...e.connectors ?? []];
      this.wagmiConfig = oM({
        ...e,
        chains: this.wagmiChains,
        transports: n,
        connectors: i
      }), fe.subscribeKey("activeCaipAddress", s => {
        const o = s?.startsWith("eip155:"),
          a = fe.state.activeCaipNetwork,
          c = a?.chainNamespace === this.chainNamespace;
        a && o && c && this.setProfileAndBalance(je.getPlainAddress(s), Number(a.id))
      })
    }
    setCustomConnectors(e, r) {
      const n = [];
      e.enableWalletConnect !== !1 && n.push(kA(e, r, this.caipNetworks)), e.enableInjected !== !1 && n.push(Rw({
        shimDisconnect: !0
      })), e.enableCoinbase !== !1 && n.push(Yv({
        version: "4",
        appName: e.metadata?.name ?? "Unknown",
        appLogoUrl: e.metadata?.icons[0] ?? "Unknown",
        preference: e.coinbasePreference ?? "all"
      }));
      const i = e.features?.email === void 0 ? Qr.DEFAULT_FEATURES.email : e.features?.email,
        s = e.features?.socials ? e.features?.socials?.length > 0 : Qr.DEFAULT_FEATURES.socials;
      (i || s) && n.push(Q8e({
        chains: this.wagmiChains,
        options: {
          projectId: e.projectId
        }
      })), n.forEach(o => {
        const a = this.wagmiConfig._internal.connectors.setup(o);
        this.wagmiConfig._internal.connectors.setState(c => [...c, a])
      })
    }
    construct(e, r) {
      if (this.appKit = e, this.options = r, this.caipNetworks = r.networks, this.defaultCaipNetwork = r.defaultNetwork || r.networks?.[0], this.tokens = d$.getCaipTokens(r.tokens), this.setCustomConnectors(r, e), !this.wagmiConfig) throw new Error("appkit:wagmiConfig - is undefined");
      this.networkControllerClient = {
        switchCaipNetwork: async n => {
          const i = n?.id;
          i && this.wagmiConfig && await Ute(this.wagmiConfig, {
            chainId: i
          })
        },
        getApprovedCaipNetworksData: async () => {
          if (!this.wagmiConfig) throw new Error("networkControllerClient:getApprovedCaipNetworksData - wagmiConfig is undefined");
          return new Promise(n => {
            const s = new Map(this.wagmiConfig.state.connections).get(this.wagmiConfig.state.current || "");
            if (s?.connector?.id === mr.AUTH_CONNECTOR_ID) n(f8e());
            else if (s?.connector?.id === mr.WALLET_CONNECT_CONNECTOR_ID) {
              const o = this.wagmiConfig.connectors.find(a => a.id === mr.WALLET_CONNECT_CONNECTOR_ID);
              n(h8e(o))
            }
            n({
              approvedCaipNetworkIds: [],
              supportsAllNetworks: !0
            })
          })
        }
      }, this.connectionControllerClient = {
        connectWalletConnect: async () => {
          if (!this.wagmiConfig) throw new Error("connectionControllerClient:getWalletConnectUri - wagmiConfig is undefined");
          const n = this.wagmiConfig.connectors.find(w => w.id === mr.WALLET_CONNECT_CONNECTOR_ID);
          if (!n) throw new Error("connectionControllerClient:getWalletConnectUri - connector is undefined");
          const i = await n.getProvider(),
            s = await i?.client?.core?.crypto?.getClientId();
          s && this.appKit?.setClientId(s);
          const o = await this.options?.siweConfig?.getMessageParams?.(),
            a = this.options?.siweConfig?.options?.enabled,
            c = typeof i?.authenticate == "function",
            l = o && Object.keys(o || {}).length > 0,
            h = this.options?.siweConfig;
          if (a && c && l && h) {
            await n.setRequestedChainsIds(o.chains);
            const {
              SIWEController: w,
              getDidChainId: b,
              getDidAddress: C
            } = await pi(async () => {
              const {
                SIWEController: k,
                getDidChainId: B,
                getDidAddress: F
              } = await Promise.resolve().then(() => ld);
              return {
                SIWEController: k,
                getDidChainId: B,
                getDidAddress: F
              }
            }, void 0), M = this.caipNetworks?.filter(k => k.chainNamespace === "eip155").map(k => k.caipNetworkId);
            o.chains = this.caipNetworks?.filter(k => k.chainNamespace === "eip155").map(k => k.id);
            const $ = (await i.authenticate({
              nonce: await h.getNonce(),
              methods: [...J8e],
              ...o,
              chains: M
            }))?.auths?.[0];
            if ($) {
              const {
                p: k,
                s: B
              } = $, F = b(k.iss), D = C(k.iss);
              D && F && w.setSession({
                address: D,
                chainId: parseInt(F, 10)
              });
              try {
                const V = i.client.formatAuthMessage({
                  request: k,
                  iss: k.iss
                });
                await w.verifyMessage({
                  message: V,
                  signature: B.s,
                  cacao: $
                })
              } catch (V) {
                throw console.error("Error verifying message", V), await i.disconnect().catch(console.error), await w.signOut().catch(console.error), V
              }
            }
          }
          const f = this.appKit?.getCaipNetworkId();
          await GN(this.wagmiConfig, {
            connector: n,
            chainId: f
          })
        },
        connectExternal: async ({
          id: n,
          provider: i,
          info: s
        }) => {
          if (!this.wagmiConfig) throw new Error("networkControllerClient:getApprovedCaipNetworksData - wagmiConfig is undefined");
          const o = this.wagmiConfig.connectors.find(c => c.id === n);
          if (!o) throw new Error("connectionControllerClient:connectExternal - connector is undefined");
          this.appKit?.setClientId(null), i && s && o.id === mr.EIP6963_CONNECTOR_ID && o.setEip6963Wallet?.({
            provider: i,
            info: s
          });
          const a = this.appKit?.getCaipNetworkId();
          await GN(this.wagmiConfig, {
            connector: o,
            chainId: a
          })
        },
        reconnectExternal: async ({
          id: n
        }) => {
          if (!this.wagmiConfig) throw new Error("networkControllerClient:reconnectExternal - wagmiConfig is undefined");
          const i = this.wagmiConfig.connectors.find(s => s.id === n);
          if (!i) throw new Error("connectionControllerClient:reconnectExternal - connector is undefined");
          await Pte(this.wagmiConfig, {
            connectors: [i]
          })
        },
        checkInstalled: n => {
          const i = this.appKit?.getConnectors().find(s => s.type === "INJECTED");
          return n ? i && window?.ethereum ? n.some(s => !!window.ethereum?.[String(s)]) : !1 : !!window.ethereum
        },
        disconnect: async () => {
          if (await QN(this.wagmiConfig), this.options?.siweConfig?.options?.signOutOnDisconnect) {
            const {
              SIWEController: n
            } = await pi(async () => {
              const {
                SIWEController: i
              } = await Promise.resolve().then(() => ld);
              return {
                SIWEController: i
              }
            }, void 0);
            await n.signOut()
          }
          bn.removeItem(vn.WALLET_ID), bn.removeItem(vn.CONNECTED_CONNECTOR), bn.removeItem(vn.WALLET_NAME), this.appKit?.setClientId(null), this.syncAccount({
            address: void 0,
            chainId: void 0,
            connector: void 0,
            addresses: void 0,
            status: "disconnected"
          }), this.appKit?.resetAccount("solana")
        },
        signMessage: async n => {
          const i = this.appKit?.getCaipAddress() || "",
            s = Cj(i);
          return Ote(this.wagmiConfig, {
            message: n,
            account: s
          })
        },
        estimateGas: async n => {
          if (n.chainNamespace && n.chainNamespace !== "eip155") throw new Error(`Invalid chain namespace - Expected eip155, got ${n.chainNamespace}`);
          try {
            return await Ate(this.wagmiConfig, {
              account: n.address,
              to: n.to,
              data: n.data,
              type: "legacy"
            })
          } catch {
            return BigInt(0)
          }
        },
        getCapabilities: async n => {
          if (!this.wagmiConfig) throw new Error("connectionControllerClient:getCapabilities - wagmiConfig is undefined");
          const s = ay(this.wagmiConfig)[0];
          if (!s?.connector) throw new Error("connectionControllerClient:getCapabilities - connector is undefined");
          const o = await s.connector.getProvider();
          if (!o) throw new Error("connectionControllerClient:getCapabilities - provider is undefined");
          const a = o.session?.sessionProperties?.capabilities;
          if (a) {
            const l = p8e(a)[n];
            if (l) return l
          }
          return await o.request({
            method: "wallet_getCapabilities",
            params: [n]
          })
        },
        grantPermissions: async n => {
          if (!this.wagmiConfig) throw new Error("connectionControllerClient:grantPermissions - wagmiConfig is undefined");
          const s = ay(this.wagmiConfig)[0];
          if (!s?.connector) throw new Error("connectionControllerClient:grantPermissions - connector is undefined");
          const o = await s.connector.getProvider();
          if (!o) throw new Error("connectionControllerClient:grantPermissions - provider is undefined");
          return o.request({
            method: "wallet_grantPermissions",
            params: n
          })
        },
        revokePermissions: async n => {
          if (!this.wagmiConfig) throw new Error("connectionControllerClient:revokePermissions - wagmiConfig is undefined");
          const s = ay(this.wagmiConfig)[0];
          if (!s?.connector) throw new Error("connectionControllerClient:revokePermissions - connector is undefined");
          const o = await s.connector.getProvider();
          if (!o) throw new Error("connectionControllerClient:revokePermissions - provider is undefined");
          return o.request({
            method: "wallet_revokePermissions",
            params: [n]
          })
        },
        sendTransaction: async n => {
          if (n.chainNamespace && n.chainNamespace !== "eip155") throw new Error(`Invalid chain namespace - Expected eip155, got ${n.chainNamespace}`);
          const {
            chainId: i
          } = c1(this.wagmiConfig), s = {
            account: n.address,
            to: n.to,
            value: n.value,
            gas: n.gas,
            gasPrice: n.gasPrice,
            data: n.data,
            chainId: i,
            type: "legacy"
          };
          await Mte(this.wagmiConfig, s);
          const o = await $te(this.wagmiConfig, s);
          return await Wte(this.wagmiConfig, {
            hash: o,
            timeout: 25e3
          }), o
        },
        writeContract: async n => {
          const i = this.appKit?.getCaipAddress() || "",
            s = Cj(i),
            o = this.appKit?.getCaipNetworkId();
          if (!o) throw new Error("networkControllerClient:writeContract - chainId is undefined");
          return await zte(this.wagmiConfig, {
            chain: this.wagmiChains?.[o],
            chainId: o,
            address: n.tokenAddress,
            account: s,
            abi: n.abi,
            functionName: n.method,
            args: [n.receiverAddress, n.tokenAmount]
          })
        },
        getEnsAddress: async n => {
          try {
            if (!this.wagmiConfig) throw new Error("networkControllerClient:getApprovedCaipNetworksData - wagmiConfig is undefined");
            const i = this.appKit?.getCaipNetworkId();
            let s = !1,
              o = !1;
            return Ire(n) && (o = await this.appKit?.resolveReownName(n) || !1), i === 1 && (s = await Rte(this.wagmiConfig, {
              name: Zj(n),
              chainId: i
            })), s || o || !1
          } catch {
            return !1
          }
        },
        getEnsAvatar: async n => {
          const i = this.appKit?.getCaipNetworkId();
          return i !== LE.id ? !1 : await eM(this.wagmiConfig, {
            name: Zj(n),
            chainId: i
          }) || !1
        },
        parseUnits: Nee,
        formatUnits: iw
      }, fe.state.chains.set(this.chainNamespace, {
        chainNamespace: this.chainNamespace,
        connectionControllerClient: this.connectionControllerClient,
        networkControllerClient: this.networkControllerClient,
        adapterType: this.adapterType,
        caipNetworks: this.caipNetworks
      }), this.syncConnectors(this.wagmiConfig.connectors), this.syncAuthConnector(this.wagmiConfig?.connectors.find(n => n.id === mr.AUTH_CONNECTOR_ID)), this.syncRequestedNetworks(this.caipNetworks), Fte(this.wagmiConfig, {
        onChange: n => {
          this.syncConnectors(n), this.syncAuthConnector(n.find(i => i.id === mr.AUTH_CONNECTOR_ID))
        }
      }), jte(this.wagmiConfig, {
        onChange: n => {
          this.syncAccount(n)
        }
      }), this.appKit?.setEIP6963Enabled(r.enableEIP6963 !== !1), this.appKit?.subscribeShouldUpdateToAddress(n => {
        if (n) {
          const s = ay(this.wagmiConfig)[0]?.connector;
          s && Lte(this.wagmiConfig, {
            connector: s
          }).then(o => this.syncAccount({
            address: n,
            isConnected: !0,
            addresses: o.accounts,
            connector: s,
            chainId: o.chainId,
            status: "connected"
          }))
        }
      })
    }
    subscribeState(e) {
      return this.appKit?.subscribeState(r => e({
        ...r,
        selectedNetworkId: r.selectedNetworkId ? Number($9.caipNetworkIdToNumber(r.selectedNetworkId)) : void 0
      }))
    }
    syncRequestedNetworks(e) {
      Array.from(new Set(e.map(n => n.chainNamespace))).filter(n => !!n).forEach(n => {
        this.appKit?.setRequestedCaipNetworks(e.filter(i => i.chainNamespace === n), n)
      })
    }
    async setProfileAndBalance(e, r) {
      await Promise.all([this.syncProfile(e, r), this.syncBalance(e, r)])
    }
    async syncAccount({
      address: e,
      chainId: r,
      connector: n,
      addresses: i,
      status: s
    }) {
      const o = n?.id === mr.AUTH_CONNECTOR_ID;
      if (s === "disconnected") {
        this.appKit?.resetAccount(this.chainNamespace), this.appKit?.resetWcConnection(), this.appKit?.resetNetwork(this.chainNamespace), this.appKit?.setAllAccounts([], this.chainNamespace), this.appKit?.setStatus(s, this.chainNamespace), this.appKit?.setLoading(!1), bn.removeItem(vn.WALLET_ID), o && await n.disconnect();
        return
      }
      if (this.wagmiConfig && n)
        if (n.name === "WalletConnect" && n.getProvider && e) {
          const a = this.appKit?.getCaipNetwork(),
            c = r || a?.id,
            l = await n.getProvider(),
            h = l?.session?.namespaces || {},
            f = h ? Object.keys(h) : [],
            w = this.appKit?.getPreferredAccountType();
          f.forEach(b => {
            const C = b,
              M = h?.[b]?.accounts[0];
            Mh.setProvider(C, l), Mh.setProviderId(C, "walletConnect"), this.appKit?.setPreferredAccountType(w, C), this.appKit?.setCaipAddress(M, C), this.appKit?.setStatus(s, C)
          }), this.appKit?.getCaipNetwork()?.chainNamespace !== pr.CHAIN.SOLANA && c && (this.syncNetwork(e, c, !0), await Promise.all([this.syncConnectedWalletInfo(n), this.appKit?.setApprovedCaipNetworksData(this.chainNamespace)])), this.appKit?.setLoading(!1)
        } else if (s === "connected" && e && r) {
        Mh.setProvider(this.chainNamespace, await n.getProvider()), Mh.setProviderId(this.chainNamespace, n.id);
        const a = `eip155:${r}:${e}`;
        this.syncNetwork(e, r, !0), await Promise.all([this.syncConnectedWalletInfo(n), this.appKit?.setApprovedCaipNetworksData(this.chainNamespace)]), this.appKit?.setLoading(!1), this.appKit?.setCaipAddress(a, this.chainNamespace), this.appKit?.setStatus("connected", this.chainNamespace), !o && i?.length && this.appKit?.setAllAccounts(i.map(c => ({
          address: c,
          type: "eoa"
        })), this.chainNamespace)
      } else s === "reconnecting" && this.appKit?.setLoading(!0)
    }
    syncNetwork(e, r, n) {
      const i = this.caipNetworks.find(s => s.id === r);
      if (i && r && (this.appKit?.setCaipNetwork(i), n && e && r)) {
        const s = `eip155:${r}:${e}`;
        if (this.appKit?.setCaipAddress(s, this.chainNamespace), i?.blockExplorers?.default.url) {
          const o = `${i.blockExplorers.default.url}/address/${e}`;
          this.appKit?.setAddressExplorerUrl(o, this.chainNamespace)
        } else this.appKit?.setAddressExplorerUrl(void 0, this.chainNamespace)
      }
    }
    async syncReownName(e) {
      if (!this.appKit) throw new Error("syncReownName - appKit is undefined");
      try {
        const r = await this.appKit.getReownName(e);
        if (r[0]) {
          const n = r[0];
          this.appKit?.setProfileName(n.name, this.chainNamespace)
        } else this.appKit?.setProfileName(null, this.chainNamespace)
      } catch {
        this.appKit?.setProfileName(null, this.chainNamespace)
      }
    }
    async syncProfile(e, r) {
      if (!this.appKit) throw new Error("syncProfile - appKit is undefined");
      try {
        const {
          name: n,
          avatar: i
        } = await this.appKit.fetchIdentity({
          address: e
        });
        this.appKit?.setProfileName(n, this.chainNamespace), this.appKit?.setProfileImage(i, this.chainNamespace), n || await this.syncReownName(e)
      } catch {
        if (r === LE.id) {
          const n = await Nte(this.wagmiConfig, {
            address: e,
            chainId: r
          });
          if (n) {
            this.appKit?.setProfileName(n, this.chainNamespace);
            const i = await eM(this.wagmiConfig, {
              name: n,
              chainId: r
            });
            i && this.appKit?.setProfileImage(i, this.chainNamespace)
          } else await this.syncReownName(e), this.appKit?.setProfileImage(null, this.chainNamespace)
        } else await this.syncReownName(e), this.appKit?.setProfileImage(null, this.chainNamespace)
      }
    }
    async syncBalance(e, r) {
      const n = this.caipNetworks.find(i => i.id === r);
      if (n && this.wagmiConfig) {
        const i = await kte(this.wagmiConfig, {
          address: e,
          chainId: r,
          token: this.options?.tokens?.[n.caipNetworkId]?.address
        });
        this.appKit?.setBalance(i.formatted, i.symbol, this.chainNamespace);
        return
      }
      this.appKit?.setBalance(void 0, void 0, this.chainNamespace)
    }
    async syncConnectedWalletInfo(e) {
      if (!e) throw Error("syncConnectedWalletInfo - connector is undefined");
      if (e.id === mr.WALLET_CONNECT_CONNECTOR_ID && e.getProvider) {
        const r = await e.getProvider();
        r.session && this.appKit?.setConnectedWalletInfo({
          ...r.session.peer.metadata,
          name: r.session.peer.metadata.name,
          icon: r.session.peer.metadata.icons?.[0]
        }, this.chainNamespace)
      } else {
        const r = this.appKit?.getConnectors().find(n => n.id === e.id);
        this.appKit?.setConnectedWalletInfo({
          name: e.name,
          icon: e.icon || this.appKit.getConnectorImage(r)
        }, this.chainNamespace)
      }
    }
    syncConnectors(e) {
      const r = e.map(o => ({
          ...o,
          chain: this.chainNamespace
        })),
        n = new Set,
        i = r.filter(o => {
          const a = n.has(o.id);
          return n.add(o.id), !a
        }),
        s = [];
      i.forEach(({
        id: o,
        name: a,
        type: c,
        icon: l
      }) => {
        if (!(mr.AUTH_CONNECTOR_ID === o)) {
          const f = o === mr.INJECTED_CONNECTOR_ID;
          s.push({
            id: o,
            explorerId: Fu.ConnectorExplorerIds[o],
            imageUrl: this.options?.connectorImages?.[o] ?? l,
            name: Fu.ConnectorNamesMap[o] ?? a,
            imageId: Fu.ConnectorImageIds[o],
            type: Fu.ConnectorTypesMap[c] ?? "EXTERNAL",
            info: f ? void 0 : {
              rdns: o
            },
            chain: this.chainNamespace
          })
        }
      }), this.appKit?.setConnectors(s)
    }
    async syncAuthConnector(e) {
      const r = e;
      if (r) {
        const n = await r.getProvider();
        this.appKit?.addConnector({
          id: mr.AUTH_CONNECTOR_ID,
          type: "AUTH",
          name: "w3mAuth",
          provider: n,
          chain: this.chainNamespace
        }), this.initAuthConnectorListeners(e)
      }
    }
    async initAuthConnectorListeners(e) {
      e && (await this.listenAuthConnector(e), await this.listenModal(e))
    }
    async listenAuthConnector(e, r = !1) {
      if (r || typeof window < "u" && e) {
        const n = await e.getProvider();
        n.onRpcRequest(i => {
          vs.checkIfRequestExists(i) ? vs.checkIfRequestIsSafe(i) || this.appKit?.handleUnsafeRPCRequest() : (this.appKit?.open(), console.error(nr.RPC_METHOD_NOT_ALLOWED_MESSAGE, {
            method: i.method
          }), setTimeout(() => {
            this.appKit?.showErrorMessage(nr.RPC_METHOD_NOT_ALLOWED_UI_MESSAGE)
          }, 300), n.rejectRpcRequests())
        }), n.onRpcError(() => {
          this.appKit?.isOpen() && (this.appKit?.isTransactionStackEmpty() ? this.appKit?.close() : this.appKit?.popTransactionStack(!0))
        }), n.onRpcSuccess((i, s) => {
          vs.checkIfRequestIsSafe(s) || (this.appKit?.isTransactionStackEmpty() ? this.appKit?.close() : this.appKit?.popTransactionStack())
        }), n.onNotConnected(() => {
          const i = this.appKit?.getIsConnectedState(),
            o = bn.getItem(vn.CONNECTED_CONNECTOR) === "AUTH";
          !i && o && (this.appKit?.setCaipAddress(void 0, this.chainNamespace), this.appKit?.setLoading(!1))
        }), n.onConnect(i => {
          const s = `eip155:${i.chainId}:${i.address}`;
          this.appKit?.setCaipAddress(s, this.chainNamespace), this.appKit?.setSmartAccountDeployed(!!i.smartAccountDeployed, this.chainNamespace), this.appKit?.setPreferredAccountType(i.preferredAccountType, this.chainNamespace), this.appKit?.setAllAccounts(i.accounts || [{
            address: i.address,
            type: i.preferredAccountType || "eoa"
          }], this.chainNamespace), Ar.setConnectedConnector("AUTH"), this.appKit?.setLoading(!1)
        }), n.onGetSmartAccountEnabledNetworks(i => {
          this.appKit?.setSmartAccountEnabledNetworks(i, this.chainNamespace)
        })
      }
    }
    async listenModal(e) {
      const r = await e.getProvider();
      this.subscribeState(n => {
        n.open || r.rejectRpcRequests()
      })
    }
  }
  window.walletConnectVars = {
    createWeb3Modal: l8e,
    WagmiAdapter: X8e,
    createConfig: oM,
    getAccount: c1,
    disconnect: QN,
    http: iy,
    coinbaseWallet: Yv,
    walletConnect: bA,
    injected: Rw,
    safe: vA,
    mainnet: LE,
    createConnector: Hte
  };
  const Gi = jr({
      status: "uninitialized"
    }),
    ib = {
      state: Gi,
      subscribeKey(t, e) {
        return ts(Gi, t, e)
      },
      subscribe(t) {
        return Rn(Gi, () => t(Gi))
      },
      _getClient() {
        if (!Gi._client) throw new Error("SIWEController client not set");
        return Gi._client
      },
      async getNonce(t) {
        const r = await this._getClient().getNonce(t);
        return this.setNonce(r), r
      },
      async getSession() {
        try {
          const e = await this._getClient().getSession();
          return e && (this.setSession(e), this.setStatus("success")), e || void 0
        } catch {
          return
        }
      },
      createMessage(t) {
        const r = this._getClient().createMessage(t);
        return this.setMessage(r), r
      },
      async verifyMessage(t) {
        return await this._getClient().verifyMessage(t)
      },
      async signIn() {
        return await this._getClient().signIn()
      },
      async signOut() {
        const t = this._getClient();
        await t.signOut(), this.setStatus("ready"), this.setSession(void 0), t.onSignOut?.()
      },
      onSignIn(t) {
        this._getClient().onSignIn?.(t)
      },
      onSignOut() {
        this._getClient().onSignOut?.()
      },
      async setSIWEClient(t) {
        Gi._client = rc(t), Gi.session = await this.getSession(), Gi.status = Gi.session ? "success" : "ready", fe.setAccountProp("siweStatus", Gi.status, "eip155"), Ue.setIsSiweEnabled(t.options.enabled)
      },
      setNonce(t) {
        Gi.nonce = t
      },
      setStatus(t) {
        Gi.status = t, fe.setAccountProp("siweStatus", Gi.status, "eip155")
      },
      setMessage(t) {
        Gi.message = t
      },
      setSession(t) {
        Gi.session = t, Gi.status = t ? "success" : "ready", fe.setAccountProp("siweStatus", Gi.status, "eip155")
      }
    },
    e_e = Re`
    :host {
      display: flex;
      justify-content: center;
      gap: var(--wiu-spacing-2xl);
    }
  
    wiu-visual-thumbnail:nth-child(1) {
      z-index: 1;
    }
  `;
  var t_e = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let h6 = class extends _e {
    constructor() {
      super(...arguments), this.dappImageUrl = Ue.state.metadata?.icons, this.walletImageUrl = ke.state.connectedWalletInfo?.icon
    }
    firstUpdated() {
      const e = this.shadowRoot?.querySelectorAll("wiu-visual-thumbnail");
      e?.[0] && this.createAnimation(e[0], "translate(18px)"), e?.[1] && this.createAnimation(e[1], "translate(-18px)")
    }
    render() {
      return K`
        <wiu-visual-thumbnail
          ?borderRadiusFull=${!0}
          .imageSrc=${this.dappImageUrl?.[0]}
        ></wiu-visual-thumbnail>
        <wiu-visual-thumbnail .imageSrc=${this.walletImageUrl}></wiu-visual-thumbnail>
      `
    }
    createAnimation(e, r) {
      e.animate([{
        transform: "translateX(0px)"
      }, {
        transform: r
      }], {
        duration: 1600,
        easing: "cubic-bezier(0.56, 0, 0.48, 1)",
        direction: "alternate",
        iterations: 1 / 0
      })
    }
  };
  h6.styles = e_e, h6 = t_e([ye("w4m-connecting-siwe")], h6);
  var RA = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  let sb = class extends _e {
    constructor() {
      super(...arguments), this.dappName = Ue.state.metadata?.name, this.isSigning = !1, this.isCancelling = !1
    }
    render() {
      return K`
        <wiu-flex justifyContent="center" .padding=${["2xl","0","xxl","0"]}>
          <w4m-connecting-siwe></w4m-connecting-siwe>
        </wiu-flex>
        <wiu-flex
          .padding=${["0","4xl","l","4xl"]}
          gap="s"
          justifyContent="space-between"
        >
          <wiu-text variant="paragraph-500" align="center" color="fg-100"
            >${this.dappName??"Dapp"} needs to connect to your wallet</wiu-text
          >
        </wiu-flex>
        <wiu-flex
          .padding=${["0","3xl","l","3xl"]}
          gap="s"
          justifyContent="space-between"
        >
          <wiu-text variant="small-400" align="center" color="fg-200"
            >Sign this message to prove you own this wallet and proceed. Canceling will disconnect
            you.</wiu-text
          >
        </wiu-flex>
        <wiu-flex .padding=${["l","xl","xl","xl"]} gap="s" justifyContent="space-between">
          <wiu-button
            size="lg"
            borderRadius="xs"
            fullWidth
            variant="neutral"
            ?loading=${this.isCancelling}
            @click=${this.onCancel.bind(this)}
            data-testid="w4m-connecting-siwe-cancel"
          >
            Cancel
          </wiu-button>
          <wiu-button
            size="lg"
            borderRadius="xs"
            fullWidth
            variant="main"
            @click=${this.onSign.bind(this)}
            ?loading=${this.isSigning}
            data-testid="w4m-connecting-siwe-sign"
          >
            ${this.isSigning?"Signing...":"Sign"}
          </wiu-button>
        </wiu-flex>
      `
    }
    async onSign() {
      this.isSigning = !0, nt.sendEvent({
        event: "CLICK_SIGN_SIWE_MESSAGE",
        type: "track",
        properties: {
          network: fe.state.activeCaipNetwork?.caipNetworkId || "",
          isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT
        }
      });
      try {
        ib.setStatus("loading");
        const e = await ib.signIn();
        return ib.setStatus("success"), nt.sendEvent({
          event: "SIWE_AUTH_SUCCESS",
          type: "track",
          properties: {
            network: fe.state.activeCaipNetwork?.caipNetworkId || "",
            isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT
          }
        }), e
      } catch {
        const n = ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT;
        return n ? Rt.showError("This application might not support Smart Accounts") : Rt.showError("Signature declined"), ib.setStatus("error"), nt.sendEvent({
          event: "SIWE_AUTH_ERROR",
          type: "track",
          properties: {
            network: fe.state.activeCaipNetwork?.caipNetworkId || "",
            isSmartAccount: n
          }
        })
      } finally {
        this.isSigning = !1
      }
    }
    async onCancel() {
      this.isCancelling = !0, fe.state.activeCaipAddress ? (await Kt.disconnect(), Ot.close()) : Ae.push("Connect"), this.isCancelling = !1, nt.sendEvent({
        event: "CLICK_CANCEL_SIWE",
        type: "track",
        properties: {
          network: fe.state.activeCaipNetwork?.caipNetworkId || "",
          isSmartAccount: ke.state.preferredAccountType === nr.ACCOUNT_TYPES.SMART_ACCOUNT
        }
      })
    }
  };
  RA([le()], sb.prototype, "isSigning", void 0), RA([le()], sb.prototype, "isCancelling", void 0), sb = RA([ye("w4m-connecting-siwe-view")], sb);
  const ld = Object.freeze(Object.defineProperty({
      __proto__: null,
      SIWEController: ib,
      get W3mConnectingSiwe() {
        return h6
      },
      get W3mConnectingSiweView() {
        return sb
      },
      formatMessage: uE,
      getDidAddress: lv,
      getDidChainId: lE
    }, Symbol.toStringTag, {
      value: "Module"
    })),
    r_e = Re`
    :host {
      z-index: var(--w4m-z-index);
      display: block;
      backface-visibility: hidden;
      will-change: opacity;
      /* position: fixed;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0; */
      pointer-events: none;
      opacity: 0;
      /* background-color: var(--wiu-cover); */
      transition: opacity 0.2s var(--wiu-ease-out-power-2);
      will-change: opacity;
    }
  
    :host(.open) {
      opacity: 1;
    }
  
    wiu-card {
      max-width: var(--w4m-modal-width);
      width: 100%;
      position: relative;
      animation: zoom-in 0.2s var(--wiu-ease-out-power-2);
      animation-fill-mode: backwards;
      outline: none;
    }
  
    wiu-card[shake='true'] {
      animation:
        zoom-in 0.2s var(--wiu-ease-out-power-2),
        w4m-shake 0.5s var(--wiu-ease-out-power-2);
    }
  
    wiu-flex {
      overflow-x: hidden;
      overflow-y: auto;
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 100%;
    }
  
    @media (max-height: 700px) and (min-width: 431px) {
      wiu-flex {
        align-items: flex-start;
      }
  
      wiu-card {
        margin: var(--wiu-spacing-xxl) 0px;
      }
    }
  
    @media (max-width: 430px) {
      wiu-flex {
        align-items: flex-end;
      }
  
      wiu-card {
        max-width: 100%;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        border-bottom: none;
        animation: slide-in 0.2s var(--wiu-ease-out-power-2);
      }
  
      wiu-card[shake='true'] {
        animation:
          slide-in 0.2s var(--wiu-ease-out-power-2),
          w4m-shake 0.5s var(--wiu-ease-out-power-2);
      }
    }
  
    @keyframes zoom-in {
      0% {
        transform: scale(0.95) translateY(0);
      }
      100% {
        transform: scale(1) translateY(0);
      }
    }
  
    @keyframes slide-in {
      0% {
        transform: scale(1) translateY(50px);
      }
      100% {
        transform: scale(1) translateY(0);
      }
    }
  
    @keyframes w4m-shake {
      0% {
        transform: scale(1) rotate(0deg);
      }
      20% {
        transform: scale(1) rotate(-1deg);
      }
      40% {
        transform: scale(1) rotate(1.5deg);
      }
      60% {
        transform: scale(1) rotate(-1.5deg);
      }
      80% {
        transform: scale(1) rotate(1deg);
      }
      100% {
        transform: scale(1) rotate(0deg);
      }
    }
  
    @keyframes w4m-view-height {
      from {
        height: var(--prev-height);
      }
      to {
        height: var(--new-height);
      }
    }
  `;
  var Fg = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  const Yj = "scroll-lock";
  let ud = class extends _e {
    constructor() {
      super(), this.unsubscribe = [], this.abortController = void 0, this.open = Ot.state.open, this.caipAddress = fe.state.activeCaipAddress, this.caipNetwork = fe.state.activeCaipNetwork, this.isSiweEnabled = Ue.state.isSiweEnabled, this.shake = Ot.state.shake, this.initializeTheming(), qt.prefetch(), this.unsubscribe.push(Ot.subscribeKey("open", e => e ? this.onOpen() : this.onClose()), Ot.subscribeKey("shake", e => this.shake = e), ke.subscribeKey("siweStatus", e => this.onSiweStatusChange(e), "eip155"), fe.subscribeKey("activeCaipNetwork", e => this.onNewNetwork(e)), fe.subscribeKey("activeCaipAddress", e => this.onNewAddress(e)), Ue.subscribeKey("isSiweEnabled", e => this.isSiweEnabled = e)), nt.sendEvent({
        type: "track",
        event: "MODAL_LOADED"
      })
    }
    disconnectedCallback() {
      this.unsubscribe.forEach(e => e()), this.onRemoveKeyboardListener()
    }
    render() {
      return this.open ? K`
            <wiu-flex @click=${this.onOverlayClick.bind(this)} data-testid="w4m-modal-overlay">
              <wiu-card
                shake="${this.shake}"
                role="alertdialog"
                aria-modal="true"
                tabindex="0"
                data-testid="w4m-modal-card"
              >
                <w4m-header></w4m-header>
                <w4m-router></w4m-router>
                <w4m-snackbar></w4m-snackbar>
                <w4m-alertbar></w4m-alertbar>
              </wiu-card>
            </wiu-flex>
            <w4m-tooltip></w4m-tooltip>
          ` : null
    }
    async onOverlayClick(e) {
      e.target === e.currentTarget && await this.handleClose()
    }
    async handleClose() {
      const e = Ae.state.view === "ConnectingSiwe",
        r = Ae.state.view === "ApproveTransaction";
      if (this.isSiweEnabled) {
        const {
          SIWEController: n
        } = await pi(async () => {
          const {
            SIWEController: s
          } = await Promise.resolve().then(() => ld);
          return {
            SIWEController: s
          }
        }, void 0);
        n.state.status !== "success" && (e || r) ? Ot.shake() : Ot.close()
      } else Ot.close()
    }
    initializeTheming() {
      const {
        themeVariables: e,
        themeMode: r
      } = Sn.state, n = Vt.getColorTheme(r);
      EP(e, n)
    }
    onClose() {
      this.open = !1, this.classList.remove("open"), this.onScrollUnlock(), Rt.hide(), this.onRemoveKeyboardListener()
    }
    onOpen() {
      this.open = !0, this.classList.add("open"), this.onScrollLock(), this.onAddKeyboardListener()
    }
    onScrollLock() {
      const e = document.createElement("style");
      e.dataset.w3m = Yj, e.textContent = `
        body {
          touch-action: none;
          overflow: hidden;
          overscroll-behavior: contain;
        }
        w4m-modal {
          pointer-events: auto;
        }
      `, document.head.appendChild(e)
    }
    onScrollUnlock() {
      const e = document.head.querySelector(`style[data-w3m="${Yj}"]`);
      e && e.remove()
    }
    onAddKeyboardListener() {
      this.abortController = new AbortController;
      const e = this.shadowRoot?.querySelector("wiu-card");
      e?.focus(), window.addEventListener("keydown", r => {
        if (r.key === "Escape") this.handleClose();
        else if (r.key === "Tab") {
          const {
            tagName: n
          } = r.target;
          n && !n.includes("w4m-") && !n.includes("wiu-") && e?.focus()
        }
      }, this.abortController)
    }
    onRemoveKeyboardListener() {
      this.abortController?.abort(), this.abortController = void 0
    }
    onSiweStatusChange(e) {
      e === "success" && Ot.close()
    }
    async onNewAddress(e) {
      const r = this.caipAddress,
        n = r ? je.getPlainAddress(r) : void 0,
        i = e ? je.getPlainAddress(e) : void 0,
        s = n === i;
      if (this.caipAddress = e, await Kt.initializeSWIXIfAvailable(), i && !s && this.isSiweEnabled) try {
        const {
          SIWEController: o
        } = await pi(async () => {
          const {
            SIWEController: c
          } = await Promise.resolve().then(() => ld);
          return {
            SIWEController: c
          }
        }, void 0), a = ke.state.siweStatus === "success";
        !n && i ? this.onSiweNavigation() : a && n && i && n !== i && o.state._client?.options.signOutOnAccountChange && (await o.signOut(), this.onSiweNavigation())
      } catch (o) {
        throw this.caipAddress = r, o
      }
      i || Ot.close()
    }
    async onNewNetwork(e) {
      if (!this.caipAddress) {
        this.caipNetwork = e, Ae.goBack();
        return
      }
      const r = this.caipNetwork?.caipNetworkId?.toString(),
        n = e?.caipNetworkId?.toString();
      if (r && n && r !== n)
        if (this.isSiweEnabled) {
          const {
            SIWEController: i
          } = await pi(async () => {
            const {
              SIWEController: s
            } = await Promise.resolve().then(() => ld);
            return {
              SIWEController: s
            }
          }, void 0);
          i.state._client?.options.signOutOnNetworkChange ? (await i.signOut(), this.onSiweNavigation()) : Ae.goBack()
        } else Ae.goBack();
      this.caipNetwork = e
    }
    onSiweNavigation() {
      const e = fe.state.activeChain === pr.CHAIN.EVM;
      !(ke.state.siweStatus === "success") && e ? this.open ? Ae.replace("ConnectingSiwe") : Ot.open({
        view: "ConnectingSiwe"
      }) : Ae.goBack()
    }
  };
  ud.styles = r_e, Fg([le()], ud.prototype, "open", void 0), Fg([le()], ud.prototype, "caipAddress", void 0), Fg([le()], ud.prototype, "caipNetwork", void 0), Fg([le()], ud.prototype, "isSiweEnabled", void 0), Fg([le()], ud.prototype, "shake", void 0), ud = Fg([ye("w4m-modal")], ud);
  const n_e = Object.freeze(Object.defineProperty({
      __proto__: null,
      get W3mModal() {
        return ud
      }
    }, Symbol.toStringTag, {
      value: "Module"
    })),
    i_e = (t, e) => {
      let r;
      switch (t) {
        case "standard":
          return r = e, `data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;
        case "circle":
          return r = e, `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;
        case "text":
          return r = (.1 * e).toFixed(2), `data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;
        case "textWithLogo":
          return r = (.25 * e).toFixed(2), `data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;
        case "textLight":
          return r = (.1 * e).toFixed(2), `data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;
        case "textWithLogoLight":
          return r = (.25 * e).toFixed(2), `data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;
        default:
          return r = e, `data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `
      }
    };
  let Wh = class Ok {
    constructor(e, r) {
      this.scope = e, this.module = r
    }
    storeObject(e, r) {
      this.setItem(e, JSON.stringify(r))
    }
    loadObject(e) {
      const r = this.getItem(e);
      return r ? JSON.parse(r) : void 0
    }
    setItem(e, r) {
      localStorage.setItem(this.scopedKey(e), r)
    }
    getItem(e) {
      return localStorage.getItem(this.scopedKey(e))
    }
    removeItem(e) {
      localStorage.removeItem(this.scopedKey(e))
    }
    clear() {
      const e = this.scopedKey(""),
        r = [];
      for (let n = 0; n < localStorage.length; n++) {
        const i = localStorage.key(n);
        typeof i == "string" && i.startsWith(e) && r.push(i)
      }
      r.forEach(n => localStorage.removeItem(n))
    }
    scopedKey(e) {
      return `-${this.scope}${this.module?`:${this.module}`:""}:${e}`
    }
    static clearAll() {
      new Ok("CBWSDK").clear(), new Ok("walletlink").clear()
    }
  };
  const ai = {
      rpc: {
        invalidInput: -32e3,
        resourceNotFound: -32001,
        resourceUnavailable: -32002,
        transactionRejected: -32003,
        methodNotSupported: -32004,
        limitExceeded: -32005,
        parse: -32700,
        invalidRequest: -32600,
        methodNotFound: -32601,
        invalidParams: -32602,
        internal: -32603
      },
      provider: {
        userRejectedRequest: 4001,
        unauthorized: 4100,
        unsupportedMethod: 4200,
        disconnected: 4900,
        chainDisconnected: 4901,
        unsupportedChain: 4902
      }
    },
    NA = {
      "-32700": {
        standard: "JSON RPC 2.0",
        message: "Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."
      },
      "-32600": {
        standard: "JSON RPC 2.0",
        message: "The JSON sent is not a valid Request object."
      },
      "-32601": {
        standard: "JSON RPC 2.0",
        message: "The method does not exist / is not available."
      },
      "-32602": {
        standard: "JSON RPC 2.0",
        message: "Invalid method parameter(s)."
      },
      "-32603": {
        standard: "JSON RPC 2.0",
        message: "Internal JSON-RPC error."
      },
      "-32000": {
        standard: "EIP-1474",
        message: "Invalid input."
      },
      "-32001": {
        standard: "EIP-1474",
        message: "Resource not found."
      },
      "-32002": {
        standard: "EIP-1474",
        message: "Resource unavailable."
      },
      "-32003": {
        standard: "EIP-1474",
        message: "Transaction rejected."
      },
      "-32004": {
        standard: "EIP-1474",
        message: "Method not supported."
      },
      "-32005": {
        standard: "EIP-1474",
        message: "Request limit exceeded."
      },
      4001: {
        standard: "EIP-1193",
        message: "User rejected the request."
      },
      4100: {
        standard: "EIP-1193",
        message: "The requested account and/or method has not been authorized by the user."
      },
      4200: {
        standard: "EIP-1193",
        message: "The requested method is not supported by this Ethereum provider."
      },
      4900: {
        standard: "EIP-1193",
        message: "The provider is disconnected from all chains."
      },
      4901: {
        standard: "EIP-1193",
        message: "The provider is disconnected from the specified chain."
      },
      4902: {
        standard: "EIP-3085",
        message: "Unrecognized chain ID."
      }
    },
    Qj = "Unspecified error message.",
    s_e = "Unspecified server error.";

  function MA(t, e = Qj) {
    if (t && Number.isInteger(t)) {
      const r = t.toString();
      if (PA(NA, r)) return NA[r].message;
      if (Jj(t)) return s_e
    }
    return e
  }

  function o_e(t) {
    if (!Number.isInteger(t)) return !1;
    const e = t.toString();
    return !!(NA[e] || Jj(t))
  }

  function a_e(t, {
    shouldIncludeStack: e = !1
  } = {}) {
    const r = {};
    if (t && typeof t == "object" && !Array.isArray(t) && PA(t, "code") && o_e(t.code)) {
      const n = t;
      r.code = n.code, n.message && typeof n.message == "string" ? (r.message = n.message, PA(n, "data") && (r.data = n.data)) : (r.message = MA(r.code), r.data = {
        originalError: Xj(t)
      })
    } else r.code = ai.rpc.internal, r.message = eF(t, "message") ? t.message : Qj, r.data = {
      originalError: Xj(t)
    };
    return e && (r.stack = eF(t, "stack") ? t.stack : void 0), r
  }

  function Jj(t) {
    return t >= -32099 && t <= -32e3
  }

  function Xj(t) {
    return t && typeof t == "object" && !Array.isArray(t) ? Object.assign({}, t) : t
  }

  function PA(t, e) {
    return Object.prototype.hasOwnProperty.call(t, e)
  }

  function eF(t, e) {
    return typeof t == "object" && t !== null && e in t && typeof t[e] == "string"
  }
  const Fr = {
    rpc: {
      parse: t => Ma(ai.rpc.parse, t),
      invalidRequest: t => Ma(ai.rpc.invalidRequest, t),
      invalidParams: t => Ma(ai.rpc.invalidParams, t),
      methodNotFound: t => Ma(ai.rpc.methodNotFound, t),
      internal: t => Ma(ai.rpc.internal, t),
      server: t => {
        if (!t || typeof t != "object" || Array.isArray(t)) throw new Error("Ethereum RPC Server errors must provide single object argument.");
        const {
          code: e
        } = t;
        if (!Number.isInteger(e) || e > -32005 || e < -32099) throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');
        return Ma(e, t)
      },
      invalidInput: t => Ma(ai.rpc.invalidInput, t),
      resourceNotFound: t => Ma(ai.rpc.resourceNotFound, t),
      resourceUnavailable: t => Ma(ai.rpc.resourceUnavailable, t),
      transactionRejected: t => Ma(ai.rpc.transactionRejected, t),
      methodNotSupported: t => Ma(ai.rpc.methodNotSupported, t),
      limitExceeded: t => Ma(ai.rpc.limitExceeded, t)
    },
    provider: {
      userRejectedRequest: t => Wg(ai.provider.userRejectedRequest, t),
      unauthorized: t => Wg(ai.provider.unauthorized, t),
      unsupportedMethod: t => Wg(ai.provider.unsupportedMethod, t),
      disconnected: t => Wg(ai.provider.disconnected, t),
      chainDisconnected: t => Wg(ai.provider.chainDisconnected, t),
      unsupportedChain: t => Wg(ai.provider.unsupportedChain, t),
      custom: t => {
        if (!t || typeof t != "object" || Array.isArray(t)) throw new Error("Ethereum Provider custom errors must provide single object argument.");
        const {
          code: e,
          message: r,
          data: n
        } = t;
        if (!r || typeof r != "string") throw new Error('"message" must be a nonempty string');
        return new nF(e, r, n)
      }
    }
  };

  function Ma(t, e) {
    const [r, n] = tF(e);
    return new rF(t, r || MA(t), n)
  }

  function Wg(t, e) {
    const [r, n] = tF(e);
    return new nF(t, r || MA(t), n)
  }

  function tF(t) {
    if (t) {
      if (typeof t == "string") return [t];
      if (typeof t == "object" && !Array.isArray(t)) {
        const {
          message: e,
          data: r
        } = t;
        if (e && typeof e != "string") throw new Error("Must specify string message.");
        return [e || void 0, r]
      }
    }
    return []
  }
  let rF = class extends Error {
      constructor(e, r, n) {
        if (!Number.isInteger(e)) throw new Error('"code" must be an integer.');
        if (!r || typeof r != "string") throw new Error('"message" must be a nonempty string.');
        super(r), this.code = e, n !== void 0 && (this.data = n)
      }
    },
    nF = class extends rF {
      constructor(e, r, n) {
        if (!c_e(e)) throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');
        super(e, r, n)
      }
    };

  function c_e(t) {
    return Number.isInteger(t) && t >= 1e3 && t <= 4999
  }

  function $A() {
    return t => t
  }
  const ob = $A(),
    l_e = $A(),
    u_e = $A();

  function dd(t) {
    return Math.floor(t)
  }
  const iF = /^[0-9]*$/,
    sF = /^[a-f0-9]*$/;

  function Y0(t) {
    return OA(crypto.getRandomValues(new Uint8Array(t)))
  }

  function OA(t) {
    return [...t].map(e => e.toString(16).padStart(2, "0")).join("")
  }

  function f6(t) {
    return new Uint8Array(t.match(/.{1,2}/g).map(e => Number.parseInt(e, 16)))
  }

  function ab(t, e = !1) {
    const r = t.toString("hex");
    return ob(e ? `0x${r}` : r)
  }

  function DA(t) {
    return ab(UA(t), !0)
  }

  function Jl(t) {
    return u_e(t.toString(10))
  }

  function zh(t) {
    return ob(`0x${BigInt(t).toString(16)}`)
  }

  function oF(t) {
    return t.startsWith("0x") || t.startsWith("0X")
  }

  function LA(t) {
    return oF(t) ? t.slice(2) : t
  }

  function aF(t) {
    return oF(t) ? `0x${t.slice(2)}` : `0x${t}`
  }

  function p6(t) {
    if (typeof t != "string") return !1;
    const e = LA(t).toLowerCase();
    return sF.test(e)
  }

  function d_e(t, e = !1) {
    if (typeof t == "string") {
      const r = LA(t).toLowerCase();
      if (sF.test(r)) return ob(e ? `0x${r}` : r)
    }
    throw Fr.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)
  }

  function BA(t, e = !1) {
    let r = d_e(t, !1);
    return r.length % 2 === 1 && (r = ob(`0${r}`)), e ? ob(`0x${r}`) : r
  }

  function Hh(t) {
    if (typeof t == "string") {
      const e = LA(t).toLowerCase();
      if (p6(e) && e.length === 40) return l_e(aF(e))
    }
    throw Fr.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)
  }

  function UA(t) {
    if (Buffer.isBuffer(t)) return t;
    if (typeof t == "string") {
      if (p6(t)) {
        const e = BA(t, !1);
        return Buffer.from(e, "hex")
      }
      return Buffer.from(t, "utf8")
    }
    throw Fr.rpc.invalidParams(`Not binary data: ${String(t)}`)
  }

  function cb(t) {
    if (typeof t == "number" && Number.isInteger(t)) return dd(t);
    if (typeof t == "string") {
      if (iF.test(t)) return dd(Number(t));
      if (p6(t)) return dd(Number(BigInt(BA(t, !0))))
    }
    throw Fr.rpc.invalidParams(`Not an integer: ${String(t)}`)
  }

  function lb(t) {
    if (t !== null && (typeof t == "bigint" || f_e(t))) return BigInt(t.toString(10));
    if (typeof t == "number") return BigInt(cb(t));
    if (typeof t == "string") {
      if (iF.test(t)) return BigInt(t);
      if (p6(t)) return BigInt(BA(t, !0))
    }
    throw Fr.rpc.invalidParams(`Not an integer: ${String(t)}`)
  }

  function h_e(t) {
    if (typeof t == "string") return JSON.parse(t);
    if (typeof t == "object") return t;
    throw Fr.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)
  }

  function f_e(t) {
    if (t == null || typeof t.constructor != "function") return !1;
    const {
      constructor: e
    } = t;
    return typeof e.config == "function" && typeof e.EUCLID == "number"
  }

  function p_e() {
    const t = document.querySelector('link[sizes="192x192"]') || document.querySelector('link[sizes="180x180"]') || document.querySelector('link[rel="icon"]') || document.querySelector('link[rel="shortcut icon"]'),
      {
        protocol: e,
        host: r
      } = document.location,
      n = t ? t.getAttribute("href") : null;
    return !n || n.startsWith("javascript:") || n.startsWith("vbscript:") ? `${e}//${r}/favicon.ico` : n.startsWith("http://") || n.startsWith("https://") || n.startsWith("data:") ? n : n.startsWith("//") ? e + n : `${e}//${r}${n}`
  }
  async function g_e() {
    return crypto.subtle.generateKey({
      name: "ECDH",
      namedCurve: "P-256"
    }, !0, ["deriveKey"])
  }
  async function m_e(t, e) {
    return crypto.subtle.deriveKey({
      name: "ECDH",
      public: e
    }, t, {
      name: "AES-GCM",
      length: 256
    }, !1, ["encrypt", "decrypt"])
  }
  async function w_e(t, e) {
    const r = crypto.getRandomValues(new Uint8Array(12)),
      n = await crypto.subtle.encrypt({
        name: "AES-GCM",
        iv: r
      }, t, new TextEncoder().encode(e));
    return {
      iv: r,
      cipherText: n
    }
  }
  async function v_e(t, {
    iv: e,
    cipherText: r
  }) {
    const n = await crypto.subtle.decrypt({
      name: "AES-GCM",
      iv: e
    }, t, r);
    return new TextDecoder().decode(n)
  }

  function cF(t) {
    switch (t) {
      case "public":
        return "spki";
      case "private":
        return "pkcs8"
    }
  }
  async function lF(t, e) {
    const r = cF(t),
      n = await crypto.subtle.exportKey(r, e);
    return OA(new Uint8Array(n))
  }
  async function uF(t, e) {
    const r = cF(t),
      n = f6(e).buffer;
    return await crypto.subtle.importKey(r, new Uint8Array(n), {
      name: "ECDH",
      namedCurve: "P-256"
    }, !0, t === "private" ? ["deriveKey"] : [])
  }
  async function b_e(t, e) {
    const r = JSON.stringify(t, (n, i) => {
      if (!(i instanceof Error)) return i;
      const s = i;
      return Object.assign(Object.assign({}, s.code ? {
        code: s.code
      } : {}), {
        message: s.message
      })
    });
    return w_e(e, r)
  }
  async function y_e(t, e) {
    return JSON.parse(await v_e(e, t))
  }
  const jA = {
      storageKey: "ownPrivateKey",
      keyType: "private"
    },
    FA = {
      storageKey: "ownPublicKey",
      keyType: "public"
    },
    WA = {
      storageKey: "peerPublicKey",
      keyType: "public"
    };
  class __e {
    constructor() {
      this.storage = new Wh("CBWSDK", "SCWKeyManager"), this.ownPrivateKey = null, this.ownPublicKey = null, this.peerPublicKey = null, this.sharedSecret = null
    }
    async getOwnPublicKey() {
      return await this.loadKeysIfNeeded(), this.ownPublicKey
    }
    async getSharedSecret() {
      return await this.loadKeysIfNeeded(), this.sharedSecret
    }
    async setPeerPublicKey(e) {
      this.sharedSecret = null, this.peerPublicKey = e, await this.storeKey(WA, e), await this.loadKeysIfNeeded()
    }
    async clear() {
      this.ownPrivateKey = null, this.ownPublicKey = null, this.peerPublicKey = null, this.sharedSecret = null, this.storage.removeItem(FA.storageKey), this.storage.removeItem(jA.storageKey), this.storage.removeItem(WA.storageKey)
    }
    async generateKeyPair() {
      const e = await g_e();
      this.ownPrivateKey = e.privateKey, this.ownPublicKey = e.publicKey, await this.storeKey(jA, e.privateKey), await this.storeKey(FA, e.publicKey)
    }
    async loadKeysIfNeeded() {
      if (this.ownPrivateKey === null && (this.ownPrivateKey = await this.loadKey(jA)), this.ownPublicKey === null && (this.ownPublicKey = await this.loadKey(FA)), (this.ownPrivateKey === null || this.ownPublicKey === null) && await this.generateKeyPair(), this.peerPublicKey === null && (this.peerPublicKey = await this.loadKey(WA)), this.sharedSecret === null) {
        if (this.ownPrivateKey === null || this.peerPublicKey === null) return;
        this.sharedSecret = await m_e(this.ownPrivateKey, this.peerPublicKey)
      }
    }
    async loadKey(e) {
      const r = this.storage.getItem(e.storageKey);
      return r ? uF(e.keyType, r) : null
    }
    async storeKey(e, r) {
      const n = await lF(e.keyType, r);
      this.storage.setItem(e.storageKey, n)
    }
  }
  const zg = "4.2.1",
    dF = "@coinbase/wallet-sdk";
  async function hF(t, e) {
    const r = Object.assign(Object.assign({}, t), {
        jsonrpc: "2.0",
        id: crypto.randomUUID()
      }),
      n = await window.fetch(e, {
        method: "POST",
        body: JSON.stringify(r),
        mode: "cors",
        headers: {
          "Content-Type": "application/json",
          "X-Cbw-Sdk-Version": zg,
          "X-Cbw-Sdk-Platform": dF
        }
      }),
      {
        result: i,
        error: s
      } = await n.json();
    if (s) throw s;
    return i
  }

  function x_e() {
    return globalThis.coinbaseWalletExtension
  }

  function C_e() {
    var t, e;
    try {
      const r = globalThis;
      return (t = r.ethereum) !== null && t !== void 0 ? t : (e = r.top) === null || e === void 0 ? void 0 : e.ethereum
    } catch {
      return
    }
  }

  function fF({
    metadata: t,
    preference: e
  }) {
    var r, n;
    const {
      appName: i,
      appLogoUrl: s,
      appChainIds: o
    } = t;
    if (e.options !== "smartWalletOnly") {
      const c = x_e();
      if (c) return (r = c.setAppInfo) === null || r === void 0 || r.call(c, i, s, o, e), c
    }
    const a = C_e();
    if (a?.isCoinbaseBrowser) return (n = a.setAppInfo) === null || n === void 0 || n.call(a, i, s, o, e), a
  }

  function E_e(t) {
    if (!t || typeof t != "object" || Array.isArray(t)) throw Fr.rpc.invalidParams({
      message: "Expected a single, non-array, object argument.",
      data: t
    });
    const {
      method: e,
      params: r
    } = t;
    if (typeof e != "string" || e.length === 0) throw Fr.rpc.invalidParams({
      message: "'args.method' must be a non-empty string.",
      data: t
    });
    if (r !== void 0 && !Array.isArray(r) && (typeof r != "object" || r === null)) throw Fr.rpc.invalidParams({
      message: "'args.params' must be an object or array if provided.",
      data: t
    });
    switch (e) {
      case "eth_sign":
      case "eth_signTypedData_v2":
      case "eth_subscribe":
      case "eth_unsubscribe":
        throw Fr.provider.unsupportedMethod()
    }
  }
  const pF = "accounts",
    gF = "activeChain",
    mF = "availableChains",
    wF = "walletCapabilities";
  class A_e {
    constructor(e) {
      var r, n, i;
      this.metadata = e.metadata, this.communicator = e.communicator, this.callback = e.callback, this.keyManager = new __e, this.storage = new Wh("CBWSDK", "SCWStateManager"), this.accounts = (r = this.storage.loadObject(pF)) !== null && r !== void 0 ? r : [], this.chain = this.storage.loadObject(gF) || {
        id: (i = (n = e.metadata.appChainIds) === null || n === void 0 ? void 0 : n[0]) !== null && i !== void 0 ? i : 1
      }, this.handshake = this.handshake.bind(this), this.request = this.request.bind(this), this.createRequestMessage = this.createRequestMessage.bind(this), this.decryptResponseMessage = this.decryptResponseMessage.bind(this)
    }
    async handshake(e) {
      var r, n;
      const i = await this.createRequestMessage({
          handshake: {
            method: e.method,
            params: Object.assign({}, this.metadata, (r = e.params) !== null && r !== void 0 ? r : {})
          }
        }),
        s = await this.communicator.postRequestAndWaitForResponse(i);
      if ("failure" in s.content) throw s.content.failure;
      const o = await uF("public", s.sender);
      await this.keyManager.setPeerPublicKey(o);
      const c = (await this.decryptResponseMessage(s)).result;
      if ("error" in c) throw c.error;
      const l = c.value;
      this.accounts = l, this.storage.storeObject(pF, l), (n = this.callback) === null || n === void 0 || n.call(this, "accountsChanged", l)
    }
    async request(e) {
      var r;
      if (this.accounts.length === 0) throw Fr.provider.unauthorized();
      switch (e.method) {
        case "eth_requestAccounts":
          return (r = this.callback) === null || r === void 0 || r.call(this, "connect", {
            chainId: zh(this.chain.id)
          }), this.accounts;
        case "eth_accounts":
          return this.accounts;
        case "eth_coinbase":
          return this.accounts[0];
        case "net_version":
          return this.chain.id;
        case "eth_chainId":
          return zh(this.chain.id);
        case "wallet_getCapabilities":
          return this.storage.loadObject(wF);
        case "wallet_switchEthereumChain":
          return this.handleSwitchChainRequest(e);
        case "eth_ecRecover":
        case "personal_sign":
        case "personal_ecRecover":
        case "eth_signTransaction":
        case "eth_sendTransaction":
        case "eth_signTypedData_v1":
        case "eth_signTypedData_v3":
        case "eth_signTypedData_v4":
        case "eth_signTypedData":
        case "wallet_addEthereumChain":
        case "wallet_watchAsset":
        case "wallet_sendCalls":
        case "wallet_showCallsStatus":
        case "wallet_grantPermissions":
          return this.sendRequestToPopup(e);
        default:
          if (!this.chain.rpcUrl) throw Fr.rpc.internal("No RPC URL set for chain");
          return hF(e, this.chain.rpcUrl)
      }
    }
    async sendRequestToPopup(e) {
      var r, n;
      await ((n = (r = this.communicator).waitForPopupLoaded) === null || n === void 0 ? void 0 : n.call(r));
      const i = await this.sendEncryptedRequest(e),
        o = (await this.decryptResponseMessage(i)).result;
      if ("error" in o) throw o.error;
      return o.value
    }
    async cleanup() {
      var e, r;
      this.storage.clear(), await this.keyManager.clear(), this.accounts = [], this.chain = {
        id: (r = (e = this.metadata.appChainIds) === null || e === void 0 ? void 0 : e[0]) !== null && r !== void 0 ? r : 1
      }
    }
    async handleSwitchChainRequest(e) {
      var r;
      const n = e.params;
      if (!n || !(!((r = n[0]) === null || r === void 0) && r.chainId)) throw Fr.rpc.invalidParams();
      const i = cb(n[0].chainId);
      if (this.updateChain(i)) return null;
      const o = await this.sendRequestToPopup(e);
      return o === null && this.updateChain(i), o
    }
    async sendEncryptedRequest(e) {
      const r = await this.keyManager.getSharedSecret();
      if (!r) throw Fr.provider.unauthorized("No valid session found, try requestAccounts before other methods");
      const n = await b_e({
          action: e,
          chainId: this.chain.id
        }, r),
        i = await this.createRequestMessage({
          encrypted: n
        });
      return this.communicator.postRequestAndWaitForResponse(i)
    }
    async createRequestMessage(e) {
      const r = await lF("public", await this.keyManager.getOwnPublicKey());
      return {
        id: crypto.randomUUID(),
        sender: r,
        content: e,
        timestamp: new Date
      }
    }
    async decryptResponseMessage(e) {
      var r, n;
      const i = e.content;
      if ("failure" in i) throw i.failure;
      const s = await this.keyManager.getSharedSecret();
      if (!s) throw Fr.provider.unauthorized("Invalid session");
      const o = await y_e(i.encrypted, s),
        a = (r = o.data) === null || r === void 0 ? void 0 : r.chains;
      if (a) {
        const l = Object.entries(a).map(([h, f]) => ({
          id: Number(h),
          rpcUrl: f
        }));
        this.storage.storeObject(mF, l), this.updateChain(this.chain.id, l)
      }
      const c = (n = o.data) === null || n === void 0 ? void 0 : n.capabilities;
      return c && this.storage.storeObject(wF, c), o
    }
    updateChain(e, r) {
      var n;
      const i = r ?? this.storage.loadObject(mF),
        s = i?.find(o => o.id === e);
      return s ? (s !== this.chain && (this.chain = s, this.storage.storeObject(gF, s), (n = this.callback) === null || n === void 0 || n.call(this, "chainChanged", zh(s.id))), !0) : !1
    }
  }
  const S_e = bu(eQ),
    {
      keccak_256: I_e
    } = S_e;

  function vF(t) {
    return Buffer.allocUnsafe(t).fill(0)
  }

  function T_e(t) {
    return t.toString(2).length
  }

  function bF(t, e) {
    let r = t.toString(16);
    r.length % 2 !== 0 && (r = "0" + r);
    const n = r.match(/.{1,2}/g).map(i => parseInt(i, 16));
    for (; n.length < e;) n.unshift(0);
    return Buffer.from(n)
  }

  function k_e(t, e) {
    const r = t < 0n;
    let n;
    if (r) {
      const i = (1n << BigInt(e)) - 1n;
      n = (~t & i) + 1n
    } else n = t;
    return n &= (1n << BigInt(e)) - 1n, n
  }

  function yF(t, e, r) {
    const n = vF(e);
    return t = g6(t), r ? t.length < e ? (t.copy(n), n) : t.slice(0, e) : t.length < e ? (t.copy(n, e - t.length), n) : t.slice(-e)
  }

  function R_e(t, e) {
    return yF(t, e, !0)
  }

  function g6(t) {
    if (!Buffer.isBuffer(t))
      if (Array.isArray(t)) t = Buffer.from(t);
      else if (typeof t == "string") _F(t) ? t = Buffer.from(P_e(xF(t)), "hex") : t = Buffer.from(t);
    else if (typeof t == "number") t = intToBuffer(t);
    else if (t == null) t = Buffer.allocUnsafe(0);
    else if (typeof t == "bigint") t = bF(t);
    else if (t.toArray) t = Buffer.from(t.toArray());
    else throw new Error("invalid type");
    return t
  }

  function N_e(t) {
    return t = g6(t), "0x" + t.toString("hex")
  }

  function M_e(t, e) {
    if (t = g6(t), e || (e = 256), e !== 256) throw new Error("unsupported");
    return Buffer.from(I_e(new Uint8Array(t)))
  }

  function P_e(t) {
    return t.length % 2 ? "0" + t : t
  }

  function _F(t) {
    return typeof t == "string" && t.match(/^0x[0-9A-Fa-f]*$/)
  }

  function xF(t) {
    return typeof t == "string" && t.startsWith("0x") ? t.slice(2) : t
  }
  var CF = {
    zeros: vF,
    setLength: yF,
    setLengthRight: R_e,
    isHexString: _F,
    stripHexPrefix: xF,
    toBuffer: g6,
    bufferToHex: N_e,
    keccak: M_e,
    bitLengthFromBigInt: T_e,
    bufferBEFromBigInt: bF,
    twosFromBigInt: k_e
  };
  const Fs = CF;

  function EF(t) {
    return t.startsWith("int[") ? "int256" + t.slice(3) : t === "int" ? "int256" : t.startsWith("uint[") ? "uint256" + t.slice(4) : t === "uint" ? "uint256" : t.startsWith("fixed[") ? "fixed128x128" + t.slice(5) : t === "fixed" ? "fixed128x128" : t.startsWith("ufixed[") ? "ufixed128x128" + t.slice(6) : t === "ufixed" ? "ufixed128x128" : t
  }

  function Hg(t) {
    return Number.parseInt(/^\D+(\d+)$/.exec(t)[1], 10)
  }

  function AF(t) {
    var e = /^\D+(\d+)x(\d+)$/.exec(t);
    return [Number.parseInt(e[1], 10), Number.parseInt(e[2], 10)]
  }

  function SF(t) {
    var e = t.match(/(.*)\[(.*?)\]$/);
    return e ? e[2] === "" ? "dynamic" : Number.parseInt(e[2], 10) : null
  }

  function Q0(t) {
    var e = typeof t;
    if (e === "string" || e === "number") return BigInt(t);
    if (e === "bigint") return t;
    throw new Error("Argument is not a number")
  }

  function Xl(t, e) {
    var r, n, i, s;
    if (t === "address") return Xl("uint160", Q0(e));
    if (t === "bool") return Xl("uint8", e ? 1 : 0);
    if (t === "string") return Xl("bytes", new Buffer(e, "utf8"));
    if (O_e(t)) {
      if (typeof e.length > "u") throw new Error("Not an array?");
      if (r = SF(t), r !== "dynamic" && r !== 0 && e.length > r) throw new Error("Elements exceed array size: " + r);
      i = [], t = t.slice(0, t.lastIndexOf("[")), typeof e == "string" && (e = JSON.parse(e));
      for (s in e) i.push(Xl(t, e[s]));
      if (r === "dynamic") {
        var o = Xl("uint256", e.length);
        i.unshift(o)
      }
      return Buffer.concat(i)
    } else {
      if (t === "bytes") return e = new Buffer(e), i = Buffer.concat([Xl("uint256", e.length), e]), e.length % 32 !== 0 && (i = Buffer.concat([i, Fs.zeros(32 - e.length % 32)])), i;
      if (t.startsWith("bytes")) {
        if (r = Hg(t), r < 1 || r > 32) throw new Error("Invalid bytes<N> width: " + r);
        return Fs.setLengthRight(e, 32)
      } else if (t.startsWith("uint")) {
        if (r = Hg(t), r % 8 || r < 8 || r > 256) throw new Error("Invalid uint<N> width: " + r);
        n = Q0(e);
        const a = Fs.bitLengthFromBigInt(n);
        if (a > r) throw new Error("Supplied uint exceeds width: " + r + " vs " + a);
        if (n < 0) throw new Error("Supplied uint is negative");
        return Fs.bufferBEFromBigInt(n, 32)
      } else if (t.startsWith("int")) {
        if (r = Hg(t), r % 8 || r < 8 || r > 256) throw new Error("Invalid int<N> width: " + r);
        n = Q0(e);
        const a = Fs.bitLengthFromBigInt(n);
        if (a > r) throw new Error("Supplied int exceeds width: " + r + " vs " + a);
        const c = Fs.twosFromBigInt(n, 256);
        return Fs.bufferBEFromBigInt(c, 32)
      } else if (t.startsWith("ufixed")) {
        if (r = AF(t), n = Q0(e), n < 0) throw new Error("Supplied ufixed is negative");
        return Xl("uint256", n * BigInt(2) ** BigInt(r[1]))
      } else if (t.startsWith("fixed")) return r = AF(t), Xl("int256", Q0(e) * BigInt(2) ** BigInt(r[1]))
    }
    throw new Error("Unsupported or invalid type: " + t)
  }

  function $_e(t) {
    return t === "string" || t === "bytes" || SF(t) === "dynamic"
  }

  function O_e(t) {
    return t.lastIndexOf("]") === t.length - 1
  }

  function D_e(t, e) {
    var r = [],
      n = [],
      i = 32 * t.length;
    for (var s in t) {
      var o = EF(t[s]),
        a = e[s],
        c = Xl(o, a);
      $_e(o) ? (r.push(Xl("uint256", i)), n.push(c), i += c.length) : r.push(c)
    }
    return Buffer.concat(r.concat(n))
  }

  function IF(t, e) {
    if (t.length !== e.length) throw new Error("Number of types are not matching the values");
    for (var r, n, i = [], s = 0; s < t.length; s++) {
      var o = EF(t[s]),
        a = e[s];
      if (o === "bytes") i.push(a);
      else if (o === "string") i.push(new Buffer(a, "utf8"));
      else if (o === "bool") i.push(new Buffer(a ? "01" : "00", "hex"));
      else if (o === "address") i.push(Fs.setLength(a, 20));
      else if (o.startsWith("bytes")) {
        if (r = Hg(o), r < 1 || r > 32) throw new Error("Invalid bytes<N> width: " + r);
        i.push(Fs.setLengthRight(a, r))
      } else if (o.startsWith("uint")) {
        if (r = Hg(o), r % 8 || r < 8 || r > 256) throw new Error("Invalid uint<N> width: " + r);
        n = Q0(a);
        const c = Fs.bitLengthFromBigInt(n);
        if (c > r) throw new Error("Supplied uint exceeds width: " + r + " vs " + c);
        i.push(Fs.bufferBEFromBigInt(n, r / 8))
      } else if (o.startsWith("int")) {
        if (r = Hg(o), r % 8 || r < 8 || r > 256) throw new Error("Invalid int<N> width: " + r);
        n = Q0(a);
        const c = Fs.bitLengthFromBigInt(n);
        if (c > r) throw new Error("Supplied int exceeds width: " + r + " vs " + c);
        const l = Fs.twosFromBigInt(n, r);
        i.push(Fs.bufferBEFromBigInt(l, r / 8))
      } else throw new Error("Unsupported or invalid type: " + o)
    }
    return Buffer.concat(i)
  }

  function L_e(t, e) {
    return Fs.keccak(IF(t, e))
  }
  var B_e = {
    rawEncode: D_e,
    solidityPack: IF,
    soliditySHA3: L_e
  };
  const Oc = CF,
    ub = B_e,
    TF = {
      type: "object",
      properties: {
        types: {
          type: "object",
          additionalProperties: {
            type: "array",
            items: {
              type: "object",
              properties: {
                name: {
                  type: "string"
                },
                type: {
                  type: "string"
                }
              },
              required: ["name", "type"]
            }
          }
        },
        primaryType: {
          type: "string"
        },
        domain: {
          type: "object"
        },
        message: {
          type: "object"
        }
      },
      required: ["types", "primaryType", "domain", "message"]
    },
    zA = {
      encodeData(t, e, r, n = !0) {
        const i = ["bytes32"],
          s = [this.hashType(t, r)];
        if (n) {
          const o = (a, c, l) => {
            if (r[c] !== void 0) return ["bytes32", l == null ? "0x0000000000000000000000000000000000000000000000000000000000000000" : Oc.keccak(this.encodeData(c, l, r, n))];
            if (l === void 0) throw new Error(`missing value for field ${a} of type ${c}`);
            if (c === "bytes") return ["bytes32", Oc.keccak(l)];
            if (c === "string") return typeof l == "string" && (l = Buffer.from(l, "utf8")), ["bytes32", Oc.keccak(l)];
            if (c.lastIndexOf("]") === c.length - 1) {
              const h = c.slice(0, c.lastIndexOf("[")),
                f = l.map(w => o(a, h, w));
              return ["bytes32", Oc.keccak(ub.rawEncode(f.map(([w]) => w), f.map(([, w]) => w)))]
            }
            return [c, l]
          };
          for (const a of r[t]) {
            const [c, l] = o(a.name, a.type, e[a.name]);
            i.push(c), s.push(l)
          }
        } else
          for (const o of r[t]) {
            let a = e[o.name];
            if (a !== void 0)
              if (o.type === "bytes") i.push("bytes32"), a = Oc.keccak(a), s.push(a);
              else if (o.type === "string") i.push("bytes32"), typeof a == "string" && (a = Buffer.from(a, "utf8")), a = Oc.keccak(a), s.push(a);
            else if (r[o.type] !== void 0) i.push("bytes32"), a = Oc.keccak(this.encodeData(o.type, a, r, n)), s.push(a);
            else {
              if (o.type.lastIndexOf("]") === o.type.length - 1) throw new Error("Arrays currently unimplemented in encodeData");
              i.push(o.type), s.push(a)
            }
          }
        return ub.rawEncode(i, s)
      },
      encodeType(t, e) {
        let r = "",
          n = this.findTypeDependencies(t, e).filter(i => i !== t);
        n = [t].concat(n.sort());
        for (const i of n) {
          if (!e[i]) throw new Error("No type definition specified: " + i);
          r += i + "(" + e[i].map(({
            name: o,
            type: a
          }) => a + " " + o).join(",") + ")"
        }
        return r
      },
      findTypeDependencies(t, e, r = []) {
        if (t = t.match(/^\w*/)[0], r.includes(t) || e[t] === void 0) return r;
        r.push(t);
        for (const n of e[t])
          for (const i of this.findTypeDependencies(n.type, e, r)) !r.includes(i) && r.push(i);
        return r
      },
      hashStruct(t, e, r, n = !0) {
        return Oc.keccak(this.encodeData(t, e, r, n))
      },
      hashType(t, e) {
        return Oc.keccak(this.encodeType(t, e))
      },
      sanitizeData(t) {
        const e = {};
        for (const r in TF.properties) t[r] && (e[r] = t[r]);
        return e.types && (e.types = Object.assign({
          EIP712Domain: []
        }, e.types)), e
      },
      hash(t, e = !0) {
        const r = this.sanitizeData(t),
          n = [Buffer.from("1901", "hex")];
        return n.push(this.hashStruct("EIP712Domain", r.domain, r.types, e)), r.primaryType !== "EIP712Domain" && n.push(this.hashStruct(r.primaryType, r.message, r.types, e)), Oc.keccak(Buffer.concat(n))
      }
    };
  var m6 = {
    TYPED_MESSAGE_SCHEMA: TF,
    TypedDataUtils: zA,
    hashForSignTypedDataLegacy: function (t) {
      return U_e(t.data)
    },
    hashForSignTypedData_v3: function (t) {
      return zA.hash(t.data, !1)
    },
    hashForSignTypedData_v4: function (t) {
      return zA.hash(t.data)
    }
  };

  function U_e(t) {
    const e = new Error("Expect argument to be non-empty array");
    if (typeof t != "object" || !t.length) throw e;
    const r = t.map(function (s) {
        return s.type === "bytes" ? Oc.toBuffer(s.value) : s.value
      }),
      n = t.map(function (s) {
        return s.type
      }),
      i = t.map(function (s) {
        if (!s.name) throw e;
        return s.type + " " + s.name
      });
    return ub.soliditySHA3(["bytes32", "bytes32"], [ub.soliditySHA3(new Array(t.length).fill("string"), i), ub.soliditySHA3(n, r)])
  }
  const j_e = "walletUsername",
    HA = "Addresses",
    F_e = "AppVersion";

  function ls(t) {
    return t.errorMessage !== void 0
  }
  class W_e {
    constructor(e) {
      this.secret = e
    }
    async encrypt(e) {
      const r = this.secret;
      if (r.length !== 64) throw Error("secret must be 256 bits");
      const n = crypto.getRandomValues(new Uint8Array(12)),
        i = await crypto.subtle.importKey("raw", f6(r), {
          name: "aes-gcm"
        }, !1, ["encrypt", "decrypt"]),
        s = new TextEncoder,
        o = await window.crypto.subtle.encrypt({
          name: "AES-GCM",
          iv: n
        }, i, s.encode(e)),
        a = 16,
        c = o.slice(o.byteLength - a),
        l = o.slice(0, o.byteLength - a),
        h = new Uint8Array(c),
        f = new Uint8Array(l),
        w = new Uint8Array([...n, ...h, ...f]);
      return OA(w)
    }
    async decrypt(e) {
      const r = this.secret;
      if (r.length !== 64) throw Error("secret must be 256 bits");
      return new Promise((n, i) => {
        (async function () {
          const s = await crypto.subtle.importKey("raw", f6(r), {
              name: "aes-gcm"
            }, !1, ["encrypt", "decrypt"]),
            o = f6(e),
            a = o.slice(0, 12),
            c = o.slice(12, 28),
            l = o.slice(28),
            h = new Uint8Array([...l, ...c]),
            f = {
              name: "AES-GCM",
              iv: new Uint8Array(a)
            };
          try {
            const w = await window.crypto.subtle.decrypt(f, s, h),
              b = new TextDecoder;
            n(b.decode(w))
          } catch (w) {
            i(w)
          }
        })()
      })
    }
  }
  let z_e = class {
    constructor(e, r, n) {
      this.linkAPIUrl = e, this.sessionId = r;
      const i = `${r}:${n}`;
      this.auth = `Basic ${btoa(i)}`
    }
    async markUnseenEventsAsSeen(e) {
      return Promise.all(e.map(r => fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`, {
        method: "POST",
        headers: {
          Authorization: this.auth
        }
      }))).catch(r => console.error("Unabled to mark event as failed:", r))
    }
    async fetchUnseenEvents() {
      var e;
      const r = await fetch(`${this.linkAPIUrl}/events?unseen=true`, {
        headers: {
          Authorization: this.auth
        }
      });
      if (r.ok) {
        const {
          events: n,
          error: i
        } = await r.json();
        if (i) throw new Error(`Check unseen events failed: ${i}`);
        const s = (e = n?.filter(o => o.event === "Web3Response").map(o => ({
          type: "Event",
          sessionId: this.sessionId,
          eventId: o.id,
          event: o.event,
          data: o.data
        }))) !== null && e !== void 0 ? e : [];
        return this.markUnseenEventsAsSeen(s), s
      }
      throw new Error(`Check unseen events failed: ${r.status}`)
    }
  };
  var hd;
  (function (t) {
    t[t.DISCONNECTED = 0] = "DISCONNECTED", t[t.CONNECTING = 1] = "CONNECTING", t[t.CONNECTED = 2] = "CONNECTED"
  })(hd || (hd = {}));
  let H_e = class {
    setConnectionStateListener(e) {
      this.connectionStateListener = e
    }
    setIncomingDataListener(e) {
      this.incomingDataListener = e
    }
    constructor(e, r = WebSocket) {
      this.WebSocketClass = r, this.webSocket = null, this.pendingData = [], this.url = e.replace(/^http/, "ws")
    }
    async connect() {
      if (this.webSocket) throw new Error("webSocket object is not null");
      return new Promise((e, r) => {
        var n;
        let i;
        try {
          this.webSocket = i = new this.WebSocketClass(this.url)
        } catch (s) {
          r(s);
          return
        }(n = this.connectionStateListener) === null || n === void 0 || n.call(this, hd.CONNECTING), i.onclose = s => {
          var o;
          this.clearWebSocket(), r(new Error(`websocket error ${s.code}: ${s.reason}`)), (o = this.connectionStateListener) === null || o === void 0 || o.call(this, hd.DISCONNECTED)
        }, i.onopen = s => {
          var o;
          e(), (o = this.connectionStateListener) === null || o === void 0 || o.call(this, hd.CONNECTED), this.pendingData.length > 0 && ([...this.pendingData].forEach(c => this.sendData(c)), this.pendingData = [])
        }, i.onmessage = s => {
          var o, a;
          if (s.data === "h")(o = this.incomingDataListener) === null || o === void 0 || o.call(this, {
            type: "Heartbeat"
          });
          else try {
            const c = JSON.parse(s.data);
            (a = this.incomingDataListener) === null || a === void 0 || a.call(this, c)
          } catch {}
        }
      })
    }
    disconnect() {
      var e;
      const {
        webSocket: r
      } = this;
      if (r) {
        this.clearWebSocket(), (e = this.connectionStateListener) === null || e === void 0 || e.call(this, hd.DISCONNECTED), this.connectionStateListener = void 0, this.incomingDataListener = void 0;
        try {
          r.close()
        } catch {}
      }
    }
    sendData(e) {
      const {
        webSocket: r
      } = this;
      if (!r) {
        this.pendingData.push(e), this.connect();
        return
      }
      r.send(e)
    }
    clearWebSocket() {
      const {
        webSocket: e
      } = this;
      e && (this.webSocket = null, e.onclose = null, e.onerror = null, e.onmessage = null, e.onopen = null)
    }
  };
  const kF = 1e4,
    q_e = 6e4;
  let V_e = class {
      constructor({
        session: e,
        linkAPIUrl: r,
        listener: n
      }) {
        this.destroyed = !1, this.lastHeartbeatResponse = 0, this.nextReqId = dd(1), this._connected = !1, this._linked = !1, this.shouldFetchUnseenEventsOnConnect = !1, this.requestResolutions = new Map, this.handleSessionMetadataUpdated = s => {
          if (!s) return;
          new Map([
            ["__destroyed", this.handleDestroyed],
            ["EthereumAddress", this.handleAccountUpdated],
            ["WalletUsername", this.handleWalletUsernameUpdated],
            ["AppVersion", this.handleAppVersionUpdated],
            ["ChainId", a => s.JsonRpcUrl && this.handleChainUpdated(a, s.JsonRpcUrl)]
          ]).forEach((a, c) => {
            const l = s[c];
            l !== void 0 && a(l)
          })
        }, this.handleDestroyed = s => {
          var o;
          s === "1" && ((o = this.listener) === null || o === void 0 || o.resetAndReload())
        }, this.handleAccountUpdated = async s => {
          var o;
          const a = await this.cipher.decrypt(s);
          (o = this.listener) === null || o === void 0 || o.accountUpdated(a)
        }, this.handleMetadataUpdated = async (s, o) => {
          var a;
          const c = await this.cipher.decrypt(o);
          (a = this.listener) === null || a === void 0 || a.metadataUpdated(s, c)
        }, this.handleWalletUsernameUpdated = async s => {
          this.handleMetadataUpdated(j_e, s)
        }, this.handleAppVersionUpdated = async s => {
          this.handleMetadataUpdated(F_e, s)
        }, this.handleChainUpdated = async (s, o) => {
          var a;
          const c = await this.cipher.decrypt(s),
            l = await this.cipher.decrypt(o);
          (a = this.listener) === null || a === void 0 || a.chainUpdated(c, l)
        }, this.session = e, this.cipher = new W_e(e.secret), this.listener = n;
        const i = new H_e(`${r}/rpc`, WebSocket);
        i.setConnectionStateListener(async s => {
          let o = !1;
          switch (s) {
            case hd.DISCONNECTED:
              if (!this.destroyed) {
                const a = async () => {
                  await new Promise(c => setTimeout(c, 5e3)), this.destroyed || i.connect().catch(() => {
                    a()
                  })
                };
                a()
              }
              break;
            case hd.CONNECTED:
              o = await this.handleConnected(), this.updateLastHeartbeat(), setInterval(() => {
                this.heartbeat()
              }, kF), this.shouldFetchUnseenEventsOnConnect && this.fetchUnseenEventsAPI();
              break;
            case hd.CONNECTING:
              break
          }
          this.connected !== o && (this.connected = o)
        }), i.setIncomingDataListener(s => {
          var o;
          switch (s.type) {
            case "Heartbeat":
              this.updateLastHeartbeat();
              return;
            case "IsLinkedOK":
            case "Linked": {
              const a = s.type === "IsLinkedOK" ? s.linked : void 0;
              this.linked = a || s.onlineGuests > 0;
              break
            }
            case "GetSessionConfigOK":
            case "SessionConfigUpdated": {
              this.handleSessionMetadataUpdated(s.metadata);
              break
            }
            case "Event": {
              this.handleIncomingEvent(s);
              break
            }
          }
          s.id !== void 0 && ((o = this.requestResolutions.get(s.id)) === null || o === void 0 || o(s))
        }), this.ws = i, this.http = new z_e(r, e.id, e.key)
      }
      connect() {
        if (this.destroyed) throw new Error("instance is destroyed");
        this.ws.connect()
      }
      async destroy() {
        this.destroyed || (await this.makeRequest({
          type: "SetSessionConfig",
          id: dd(this.nextReqId++),
          sessionId: this.session.id,
          metadata: {
            __destroyed: "1"
          }
        }, {
          timeout: 1e3
        }), this.destroyed = !0, this.ws.disconnect(), this.listener = void 0)
      }
      get connected() {
        return this._connected
      }
      set connected(e) {
        this._connected = e
      }
      get linked() {
        return this._linked
      }
      set linked(e) {
        var r, n;
        this._linked = e, e && ((r = this.onceLinked) === null || r === void 0 || r.call(this)), (n = this.listener) === null || n === void 0 || n.linkedUpdated(e)
      }
      setOnceLinked(e) {
        return new Promise(r => {
          this.linked ? e().then(r) : this.onceLinked = () => {
            e().then(r), this.onceLinked = void 0
          }
        })
      }
      async handleIncomingEvent(e) {
        var r;
        if (e.type !== "Event" || e.event !== "Web3Response") return;
        const n = await this.cipher.decrypt(e.data),
          i = JSON.parse(n);
        if (i.type !== "WEB3_RESPONSE") return;
        const {
          id: s,
          response: o
        } = i;
        (r = this.listener) === null || r === void 0 || r.handleWeb3ResponseMessage(s, o)
      }
      async checkUnseenEvents() {
        if (!this.connected) {
          this.shouldFetchUnseenEventsOnConnect = !0;
          return
        }
        await new Promise(e => setTimeout(e, 250));
        try {
          await this.fetchUnseenEventsAPI()
        } catch (e) {
          console.error("Unable to check for unseen events", e)
        }
      }
      async fetchUnseenEventsAPI() {
        this.shouldFetchUnseenEventsOnConnect = !1, (await this.http.fetchUnseenEvents()).forEach(r => this.handleIncomingEvent(r))
      }
      async publishEvent(e, r, n = !1) {
        const i = await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({}, r), {
            origin: location.origin,
            relaySource: "coinbaseWalletExtension" in window && window.coinbaseWalletExtension ? "injected_sdk" : "sdk"
          }))),
          s = {
            type: "PublishEvent",
            id: dd(this.nextReqId++),
            sessionId: this.session.id,
            event: e,
            data: i,
            callWebhook: n
          };
        return this.setOnceLinked(async () => {
          const o = await this.makeRequest(s);
          if (o.type === "Fail") throw new Error(o.error || "failed to publish event");
          return o.eventId
        })
      }
      sendData(e) {
        this.ws.sendData(JSON.stringify(e))
      }
      updateLastHeartbeat() {
        this.lastHeartbeatResponse = Date.now()
      }
      heartbeat() {
        if (Date.now() - this.lastHeartbeatResponse > kF * 2) {
          this.ws.disconnect();
          return
        }
        try {
          this.ws.sendData("h")
        } catch {}
      }
      async makeRequest(e, r = {
        timeout: q_e
      }) {
        const n = e.id;
        this.sendData(e);
        let i;
        return Promise.race([new Promise((s, o) => {
          i = window.setTimeout(() => {
            o(new Error(`request ${n} timed out`))
          }, r.timeout)
        }), new Promise(s => {
          this.requestResolutions.set(n, o => {
            clearTimeout(i), s(o), this.requestResolutions.delete(n)
          })
        })])
      }
      async handleConnected() {
        return (await this.makeRequest({
          type: "HostSession",
          id: dd(this.nextReqId++),
          sessionId: this.session.id,
          sessionKey: this.session.key
        })).type === "Fail" ? !1 : (this.sendData({
          type: "IsLinked",
          id: dd(this.nextReqId++),
          sessionId: this.session.id
        }), this.sendData({
          type: "GetSessionConfig",
          id: dd(this.nextReqId++),
          sessionId: this.session.id
        }), !0)
      }
    },
    K_e = class {
      constructor() {
        this._nextRequestId = 0, this.callbacks = new Map
      }
      makeRequestId() {
        this._nextRequestId = (this._nextRequestId + 1) % 2147483647;
        const e = this._nextRequestId,
          r = aF(e.toString(16));
        return this.callbacks.get(r) && this.callbacks.delete(r), e
      }
    };
  const RF = "session:id",
    NF = "session:secret",
    MF = "session:linked";
  class qg {
    constructor(e, r, n, i = !1) {
      this.storage = e, this.id = r, this.secret = n, this.key = PY(W7(`${r}, ${n} WalletLink`)), this._linked = !!i
    }
    static create(e) {
      const r = Y0(16),
        n = Y0(32);
      return new qg(e, r, n).save()
    }
    static load(e) {
      const r = e.getItem(RF),
        n = e.getItem(MF),
        i = e.getItem(NF);
      return r && i ? new qg(e, r, i, n === "1") : null
    }
    get linked() {
      return this._linked
    }
    set linked(e) {
      this._linked = e, this.persistLinked()
    }
    save() {
      return this.storage.setItem(RF, this.id), this.storage.setItem(NF, this.secret), this.persistLinked(), this
    }
    persistLinked() {
      this.storage.setItem(MF, this._linked ? "1" : "0")
    }
  }

  function G_e() {
    try {
      return window.frameElement !== null
    } catch {
      return !1
    }
  }

  function Z_e() {
    try {
      return G_e() && window.top ? window.top.location : window.location
    } catch {
      return window.location
    }
  }

  function Y_e() {
    var t;
    return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t = window?.navigator) === null || t === void 0 ? void 0 : t.userAgent)
  }

  function PF() {
    var t, e;
    return (e = (t = window?.matchMedia) === null || t === void 0 ? void 0 : t.call(window, "(prefers-color-scheme: dark)").matches) !== null && e !== void 0 ? e : !1
  }
  const Q_e = '@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';

  function $F() {
    const t = document.createElement("style");
    t.type = "text/css", t.appendChild(document.createTextNode(Q_e)), document.documentElement.appendChild(t)
  }

  function OF(t) {
    var e, r, n = "";
    if (typeof t == "string" || typeof t == "number") n += t;
    else if (typeof t == "object")
      if (Array.isArray(t))
        for (e = 0; e < t.length; e++) t[e] && (r = OF(t[e])) && (n && (n += " "), n += r);
      else
        for (e in t) t[e] && (n && (n += " "), n += e);
    return n
  }

  function J0() {
    for (var t, e, r = 0, n = ""; r < arguments.length;)(t = arguments[r++]) && (e = OF(t)) && (n && (n += " "), n += e);
    return n
  }
  const J_e = Object.freeze(Object.defineProperty({
    __proto__: null,
    clsx: J0,
    default: J0
  }, Symbol.toStringTag, {
    value: "Module"
  }));
  var db, En, DF, LF, X0, BF, UF, qA, VA, KA, GA, jF, hb = {},
    FF = [],
    X_e = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,
    w6 = Array.isArray;

  function fd(t, e) {
    for (var r in e) t[r] = e[r];
    return t
  }

  function WF(t) {
    t && t.parentNode && t.parentNode.removeChild(t)
  }

  function Xr(t, e, r) {
    var n, i, s, o = {};
    for (s in e) s == "key" ? n = e[s] : s == "ref" ? i = e[s] : o[s] = e[s];
    if (arguments.length > 2 && (o.children = arguments.length > 3 ? db.call(arguments, 2) : r), typeof t == "function" && t.defaultProps != null)
      for (s in t.defaultProps) o[s] === void 0 && (o[s] = t.defaultProps[s]);
    return fb(t, o, n, i, null)
  }

  function fb(t, e, r, n, i) {
    var s = {
      type: t,
      props: e,
      key: r,
      ref: n,
      __k: null,
      __: null,
      __b: 0,
      __e: null,
      __d: void 0,
      __c: null,
      constructor: void 0,
      __v: i ?? ++DF,
      __i: -1,
      __u: 0
    };
    return i == null && En.vnode != null && En.vnode(s), s
  }

  function e7e() {
    return {
      current: null
    }
  }

  function pb(t) {
    return t.children
  }

  function gb(t, e) {
    this.props = t, this.context = e
  }

  function Vg(t, e) {
    if (e == null) return t.__ ? Vg(t.__, t.__i + 1) : null;
    for (var r; e < t.__k.length; e++)
      if ((r = t.__k[e]) != null && r.__e != null) return r.__e;
    return typeof t.type == "function" ? Vg(t) : null
  }

  function zF(t) {
    var e, r;
    if ((t = t.__) != null && t.__c != null) {
      for (t.__e = t.__c.base = null, e = 0; e < t.__k.length; e++)
        if ((r = t.__k[e]) != null && r.__e != null) {
          t.__e = t.__c.base = r.__e;
          break
        } return zF(t)
    }
  }

  function ZA(t) {
    (!t.__d && (t.__d = !0) && X0.push(t) && !v6.__r++ || BF !== En.debounceRendering) && ((BF = En.debounceRendering) || UF)(v6)
  }

  function v6() {
    var t, e, r, n, i, s, o, a;
    for (X0.sort(qA); t = X0.shift();) t.__d && (e = X0.length, n = void 0, s = (i = (r = t).__v).__e, o = [], a = [], r.__P && ((n = fd({}, i)).__v = i.__v + 1, En.vnode && En.vnode(n), YA(r.__P, n, i, r.__n, r.__P.namespaceURI, 32 & i.__u ? [s] : null, o, s ?? Vg(i), !!(32 & i.__u), a), n.__v = i.__v, n.__.__k[n.__i] = n, ZF(o, n, a), n.__e != s && zF(n)), X0.length > e && X0.sort(qA));
    v6.__r = 0
  }

  function HF(t, e, r, n, i, s, o, a, c, l, h) {
    var f, w, b, C, M, N = n && n.__k || FF,
      $ = e.length;
    for (r.__d = c, t7e(r, e, N), c = r.__d, f = 0; f < $; f++)(b = r.__k[f]) != null && (w = b.__i === -1 ? hb : N[b.__i] || hb, b.__i = f, YA(t, b, w, i, s, o, a, c, l, h), C = b.__e, b.ref && w.ref != b.ref && (w.ref && QA(w.ref, null, b), h.push(b.ref, b.__c || C, b)), M == null && C != null && (M = C), 65536 & b.__u || w.__k === b.__k ? c = qF(b, c, t) : typeof b.type == "function" && b.__d !== void 0 ? c = b.__d : C && (c = C.nextSibling), b.__d = void 0, b.__u &= -196609);
    r.__d = c, r.__e = M
  }

  function t7e(t, e, r) {
    var n, i, s, o, a, c = e.length,
      l = r.length,
      h = l,
      f = 0;
    for (t.__k = [], n = 0; n < c; n++)(i = e[n]) != null && typeof i != "boolean" && typeof i != "function" ? (o = n + f, (i = t.__k[n] = typeof i == "string" || typeof i == "number" || typeof i == "bigint" || i.constructor == String ? fb(null, i, null, null, null) : w6(i) ? fb(pb, {
      children: i
    }, null, null, null) : i.constructor === void 0 && i.__b > 0 ? fb(i.type, i.props, i.key, i.ref ? i.ref : null, i.__v) : i).__ = t, i.__b = t.__b + 1, s = null, (a = i.__i = r7e(i, r, o, h)) !== -1 && (h--, (s = r[a]) && (s.__u |= 131072)), s == null || s.__v === null ? (a == -1 && f--, typeof i.type != "function" && (i.__u |= 65536)) : a !== o && (a == o - 1 ? f-- : a == o + 1 ? f++ : (a > o ? f-- : f++, i.__u |= 65536))) : i = t.__k[n] = null;
    if (h)
      for (n = 0; n < l; n++)(s = r[n]) != null && !(131072 & s.__u) && (s.__e == t.__d && (t.__d = Vg(s)), YF(s, s))
  }

  function qF(t, e, r) {
    var n, i;
    if (typeof t.type == "function") {
      for (n = t.__k, i = 0; n && i < n.length; i++) n[i] && (n[i].__ = t, e = qF(n[i], e, r));
      return e
    }
    t.__e != e && (e && t.type && !r.contains(e) && (e = Vg(t)), r.insertBefore(t.__e, e || null), e = t.__e);
    do e = e && e.nextSibling; while (e != null && e.nodeType === 8);
    return e
  }

  function VF(t, e) {
    return e = e || [], t == null || typeof t == "boolean" || (w6(t) ? t.some(function (r) {
      VF(r, e)
    }) : e.push(t)), e
  }

  function r7e(t, e, r, n) {
    var i = t.key,
      s = t.type,
      o = r - 1,
      a = r + 1,
      c = e[r];
    if (c === null || c && i == c.key && s === c.type && !(131072 & c.__u)) return r;
    if (n > (c != null && !(131072 & c.__u) ? 1 : 0))
      for (; o >= 0 || a < e.length;) {
        if (o >= 0) {
          if ((c = e[o]) && !(131072 & c.__u) && i == c.key && s === c.type) return o;
          o--
        }
        if (a < e.length) {
          if ((c = e[a]) && !(131072 & c.__u) && i == c.key && s === c.type) return a;
          a++
        }
      }
    return -1
  }

  function KF(t, e, r) {
    e[0] === "-" ? t.setProperty(e, r ?? "") : t[e] = r == null ? "" : typeof r != "number" || X_e.test(e) ? r : r + "px"
  }

  function b6(t, e, r, n, i) {
    var s;
    e: if (e === "style")
      if (typeof r == "string") t.style.cssText = r;
      else {
        if (typeof n == "string" && (t.style.cssText = n = ""), n)
          for (e in n) r && e in r || KF(t.style, e, "");
        if (r)
          for (e in r) n && r[e] === n[e] || KF(t.style, e, r[e])
      }
    else if (e[0] === "o" && e[1] === "n") s = e !== (e = e.replace(/(PointerCapture)$|Capture$/i, "$1")), e = e.toLowerCase() in t || e === "onFocusOut" || e === "onFocusIn" ? e.toLowerCase().slice(2) : e.slice(2), t.l || (t.l = {}), t.l[e + s] = r, r ? n ? r.u = n.u : (r.u = VA, t.addEventListener(e, s ? GA : KA, s)) : t.removeEventListener(e, s ? GA : KA, s);
    else {
      if (i == "http://www.w3.org/2000/svg") e = e.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");
      else if (e != "width" && e != "height" && e != "href" && e != "list" && e != "form" && e != "tabIndex" && e != "download" && e != "rowSpan" && e != "colSpan" && e != "role" && e != "popover" && e in t) try {
        t[e] = r ?? "";
        break e
      } catch {}
      typeof r == "function" || (r == null || r === !1 && e[4] !== "-" ? t.removeAttribute(e) : t.setAttribute(e, e == "popover" && r == 1 ? "" : r))
    }
  }

  function GF(t) {
    return function (e) {
      if (this.l) {
        var r = this.l[e.type + t];
        if (e.t == null) e.t = VA++;
        else if (e.t < r.u) return;
        return r(En.event ? En.event(e) : e)
      }
    }
  }

  function YA(t, e, r, n, i, s, o, a, c, l) {
    var h, f, w, b, C, M, N, $, k, B, F, D, V, R, P, j, Y = e.type;
    if (e.constructor !== void 0) return null;
    128 & r.__u && (c = !!(32 & r.__u), s = [a = e.__e = r.__e]), (h = En.__b) && h(e);
    e: if (typeof Y == "function") try {
      if ($ = e.props, k = "prototype" in Y && Y.prototype.render, B = (h = Y.contextType) && n[h.__c], F = h ? B ? B.props.value : h.__ : n, r.__c ? N = (f = e.__c = r.__c).__ = f.__E : (k ? e.__c = f = new Y($, F) : (e.__c = f = new gb($, F), f.constructor = Y, f.render = i7e), B && B.sub(f), f.props = $, f.state || (f.state = {}), f.context = F, f.__n = n, w = f.__d = !0, f.__h = [], f._sb = []), k && f.__s == null && (f.__s = f.state), k && Y.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = fd({}, f.__s)), fd(f.__s, Y.getDerivedStateFromProps($, f.__s))), b = f.props, C = f.state, f.__v = e, w) k && Y.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), k && f.componentDidMount != null && f.__h.push(f.componentDidMount);
      else {
        if (k && Y.getDerivedStateFromProps == null && $ !== b && f.componentWillReceiveProps != null && f.componentWillReceiveProps($, F), !f.__e && (f.shouldComponentUpdate != null && f.shouldComponentUpdate($, f.__s, F) === !1 || e.__v === r.__v)) {
          for (e.__v !== r.__v && (f.props = $, f.state = f.__s, f.__d = !1), e.__e = r.__e, e.__k = r.__k, e.__k.some(function (U) {
              U && (U.__ = e)
            }), D = 0; D < f._sb.length; D++) f.__h.push(f._sb[D]);
          f._sb = [], f.__h.length && o.push(f);
          break e
        }
        f.componentWillUpdate != null && f.componentWillUpdate($, f.__s, F), k && f.componentDidUpdate != null && f.__h.push(function () {
          f.componentDidUpdate(b, C, M)
        })
      }
      if (f.context = F, f.props = $, f.__P = t, f.__e = !1, V = En.__r, R = 0, k) {
        for (f.state = f.__s, f.__d = !1, V && V(e), h = f.render(f.props, f.state, f.context), P = 0; P < f._sb.length; P++) f.__h.push(f._sb[P]);
        f._sb = []
      } else
        do f.__d = !1, V && V(e), h = f.render(f.props, f.state, f.context), f.state = f.__s; while (f.__d && ++R < 25);
      f.state = f.__s, f.getChildContext != null && (n = fd(fd({}, n), f.getChildContext())), k && !w && f.getSnapshotBeforeUpdate != null && (M = f.getSnapshotBeforeUpdate(b, C)), HF(t, w6(j = h != null && h.type === pb && h.key == null ? h.props.children : h) ? j : [j], e, r, n, i, s, o, a, c, l), f.base = e.__e, e.__u &= -161, f.__h.length && o.push(f), N && (f.__E = f.__ = null)
    } catch (U) {
      if (e.__v = null, c || s != null) {
        for (e.__u |= c ? 160 : 128; a && a.nodeType === 8 && a.nextSibling;) a = a.nextSibling;
        s[s.indexOf(a)] = null, e.__e = a
      } else e.__e = r.__e, e.__k = r.__k;
      En.__e(U, e, r)
    } else s == null && e.__v === r.__v ? (e.__k = r.__k, e.__e = r.__e) : e.__e = n7e(r.__e, e, r, n, i, s, o, c, l);
    (h = En.diffed) && h(e)
  }

  function ZF(t, e, r) {
    e.__d = void 0;
    for (var n = 0; n < r.length; n++) QA(r[n], r[++n], r[++n]);
    En.__c && En.__c(e, t), t.some(function (i) {
      try {
        t = i.__h, i.__h = [], t.some(function (s) {
          s.call(i)
        })
      } catch (s) {
        En.__e(s, i.__v)
      }
    })
  }

  function n7e(t, e, r, n, i, s, o, a, c) {
    var l, h, f, w, b, C, M, N = r.props,
      $ = e.props,
      k = e.type;
    if (k === "svg" ? i = "http://www.w3.org/2000/svg" : k === "math" ? i = "http://www.w3.org/1998/Math/MathML" : i || (i = "http://www.w3.org/1999/xhtml"), s != null) {
      for (l = 0; l < s.length; l++)
        if ((b = s[l]) && "setAttribute" in b == !!k && (k ? b.localName === k : b.nodeType === 3)) {
          t = b, s[l] = null;
          break
        }
    }
    if (t == null) {
      if (k === null) return document.createTextNode($);
      t = document.createElementNS(i, k, $.is && $), a && (En.__m && En.__m(e, s), a = !1), s = null
    }
    if (k === null) N === $ || a && t.data === $ || (t.data = $);
    else {
      if (s = s && db.call(t.childNodes), N = r.props || hb, !a && s != null)
        for (N = {}, l = 0; l < t.attributes.length; l++) N[(b = t.attributes[l]).name] = b.value;
      for (l in N)
        if (b = N[l], l != "children") {
          if (l == "dangerouslySetInnerHTML") f = b;
          else if (!(l in $)) {
            if (l == "value" && "defaultValue" in $ || l == "checked" && "defaultChecked" in $) continue;
            b6(t, l, null, b, i)
          }
        } for (l in $) b = $[l], l == "children" ? w = b : l == "dangerouslySetInnerHTML" ? h = b : l == "value" ? C = b : l == "checked" ? M = b : a && typeof b != "function" || N[l] === b || b6(t, l, b, N[l], i);
      if (h) a || f && (h.__html === f.__html || h.__html === t.innerHTML) || (t.innerHTML = h.__html), e.__k = [];
      else if (f && (t.innerHTML = ""), HF(t, w6(w) ? w : [w], e, r, n, k === "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, s, o, s ? s[0] : r.__k && Vg(r, 0), a, c), s != null)
        for (l = s.length; l--;) WF(s[l]);
      a || (l = "value", k === "progress" && C == null ? t.removeAttribute("value") : C !== void 0 && (C !== t[l] || k === "progress" && !C || k === "option" && C !== N[l]) && b6(t, l, C, N[l], i), l = "checked", M !== void 0 && M !== t[l] && b6(t, l, M, N[l], i))
    }
    return t
  }

  function QA(t, e, r) {
    try {
      if (typeof t == "function") {
        var n = typeof t.__u == "function";
        n && t.__u(), n && e == null || (t.__u = t(e))
      } else t.current = e
    } catch (i) {
      En.__e(i, r)
    }
  }

  function YF(t, e, r) {
    var n, i;
    if (En.unmount && En.unmount(t), (n = t.ref) && (n.current && n.current !== t.__e || QA(n, null, e)), (n = t.__c) != null) {
      if (n.componentWillUnmount) try {
        n.componentWillUnmount()
      } catch (s) {
        En.__e(s, e)
      }
      n.base = n.__P = null
    }
    if (n = t.__k)
      for (i = 0; i < n.length; i++) n[i] && YF(n[i], e, r || typeof t.type != "function");
    r || WF(t.__e), t.__c = t.__ = t.__e = t.__d = void 0
  }

  function i7e(t, e, r) {
    return this.constructor(t, r)
  }

  function mb(t, e, r) {
    var n, i, s, o;
    En.__ && En.__(t, e), i = (n = typeof r == "function") ? null : r && r.__k || e.__k, s = [], o = [], YA(e, t = (!n && r || e).__k = Xr(pb, null, [t]), i || hb, hb, e.namespaceURI, !n && r ? [r] : i ? null : e.firstChild ? db.call(e.childNodes) : null, s, !n && r ? r : i ? i.__e : e.firstChild, n, o), ZF(s, t, o)
  }

  function QF(t, e) {
    mb(t, e, QF)
  }

  function s7e(t, e, r) {
    var n, i, s, o, a = fd({}, t.props);
    for (s in t.type && t.type.defaultProps && (o = t.type.defaultProps), e) s == "key" ? n = e[s] : s == "ref" ? i = e[s] : a[s] = e[s] === void 0 && o !== void 0 ? o[s] : e[s];
    return arguments.length > 2 && (a.children = arguments.length > 3 ? db.call(arguments, 2) : r), fb(t.type, a, n || t.key, i || t.ref, null)
  }

  function o7e(t, e) {
    var r = {
      __c: e = "__cC" + jF++,
      __: t,
      Consumer: function (n, i) {
        return n.children(i)
      },
      Provider: function (n) {
        var i, s;
        return this.getChildContext || (i = new Set, (s = {})[e] = this, this.getChildContext = function () {
          return s
        }, this.componentWillUnmount = function () {
          i = null
        }, this.shouldComponentUpdate = function (o) {
          this.props.value !== o.value && i.forEach(function (a) {
            a.__e = !0, ZA(a)
          })
        }, this.sub = function (o) {
          i.add(o);
          var a = o.componentWillUnmount;
          o.componentWillUnmount = function () {
            i && i.delete(o), a && a.call(o)
          }
        }), n.children
      }
    };
    return r.Provider.__ = r.Consumer.contextType = r
  }
  db = FF.slice, En = {
    __e: function (t, e, r, n) {
      for (var i, s, o; e = e.__;)
        if ((i = e.__c) && !i.__) try {
          if ((s = i.constructor) && s.getDerivedStateFromError != null && (i.setState(s.getDerivedStateFromError(t)), o = i.__d), i.componentDidCatch != null && (i.componentDidCatch(t, n || {}), o = i.__d), o) return i.__E = i
        } catch (a) {
          t = a
        }
      throw t
    }
  }, DF = 0, LF = function (t) {
    return t != null && t.constructor == null
  }, gb.prototype.setState = function (t, e) {
    var r;
    r = this.__s != null && this.__s !== this.state ? this.__s : this.__s = fd({}, this.state), typeof t == "function" && (t = t(fd({}, r), this.props)), t && fd(r, t), t != null && this.__v && (e && this._sb.push(e), ZA(this))
  }, gb.prototype.forceUpdate = function (t) {
    this.__v && (this.__e = !0, t && this.__h.push(t), ZA(this))
  }, gb.prototype.render = pb, X0 = [], UF = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, qA = function (t, e) {
    return t.__v.__b - e.__v.__b
  }, v6.__r = 0, VA = 0, KA = GF(!1), GA = GF(!0), jF = 0;
  const a7e = Object.freeze(Object.defineProperty({
    __proto__: null,
    Component: gb,
    Fragment: pb,
    cloneElement: s7e,
    createContext: o7e,
    createElement: Xr,
    createRef: e7e,
    h: Xr,
    hydrate: QF,
    get isValidElement() {
      return LF
    },
    get options() {
      return En
    },
    render: mb,
    toChildArray: VF
  }, Symbol.toStringTag, {
    value: "Module"
  }));
  var pd, dn, JA, JF, Kg = 0,
    XF = [],
    Un = En,
    eW = Un.__b,
    tW = Un.__r,
    rW = Un.diffed,
    nW = Un.__c,
    iW = Un.unmount,
    sW = Un.__;

  function ep(t, e) {
    Un.__h && Un.__h(dn, t, Kg || e), Kg = 0;
    var r = dn.__H || (dn.__H = {
      __: [],
      __h: []
    });
    return t >= r.__.length && r.__.push({}), r.__[t]
  }

  function y6(t) {
    return Kg = 1, oW(uW, t)
  }

  function oW(t, e, r) {
    var n = ep(pd++, 2);
    if (n.t = t, !n.__c && (n.__ = [r ? r(e) : uW(void 0, e), function (a) {
        var c = n.__N ? n.__N[0] : n.__[0],
          l = n.t(c, a);
        c !== l && (n.__N = [l, n.__[1]], n.__c.setState({}))
      }], n.__c = dn, !dn.u)) {
      var i = function (a, c, l) {
        if (!n.__c.__H) return !0;
        var h = n.__c.__H.__.filter(function (w) {
          return !!w.__c
        });
        if (h.every(function (w) {
            return !w.__N
          })) return !s || s.call(this, a, c, l);
        var f = !1;
        return h.forEach(function (w) {
          if (w.__N) {
            var b = w.__[0];
            w.__ = w.__N, w.__N = void 0, b !== w.__[0] && (f = !0)
          }
        }), !(!f && n.__c.props === a) && (!s || s.call(this, a, c, l))
      };
      dn.u = !0;
      var s = dn.shouldComponentUpdate,
        o = dn.componentWillUpdate;
      dn.componentWillUpdate = function (a, c, l) {
        if (this.__e) {
          var h = s;
          s = void 0, i(a, c, l), s = h
        }
        o && o.call(this, a, c, l)
      }, dn.shouldComponentUpdate = i
    }
    return n.__N || n.__
  }

  function aW(t, e) {
    var r = ep(pd++, 3);
    !Un.__s && tS(r.__H, e) && (r.__ = t, r.i = e, dn.__H.__h.push(r))
  }

  function cW(t, e) {
    var r = ep(pd++, 4);
    !Un.__s && tS(r.__H, e) && (r.__ = t, r.i = e, dn.__h.push(r))
  }

  function c7e(t) {
    return Kg = 5, XA(function () {
      return {
        current: t
      }
    }, [])
  }

  function l7e(t, e, r) {
    Kg = 6, cW(function () {
      return typeof t == "function" ? (t(e()), function () {
        return t(null)
      }) : t ? (t.current = e(), function () {
        return t.current = null
      }) : void 0
    }, r == null ? r : r.concat(t))
  }

  function XA(t, e) {
    var r = ep(pd++, 7);
    return tS(r.__H, e) && (r.__ = t(), r.__H = e, r.__h = t), r.__
  }

  function u7e(t, e) {
    return Kg = 8, XA(function () {
      return t
    }, e)
  }

  function d7e(t) {
    var e = dn.context[t.__c],
      r = ep(pd++, 9);
    return r.c = t, e ? (r.__ == null && (r.__ = !0, e.sub(dn)), e.props.value) : t.__
  }

  function h7e(t, e) {
    Un.useDebugValue && Un.useDebugValue(e ? e(t) : t)
  }

  function f7e(t) {
    var e = ep(pd++, 10),
      r = y6();
    return e.__ = t, dn.componentDidCatch || (dn.componentDidCatch = function (n, i) {
      e.__ && e.__(n, i), r[1](n)
    }), [r[0], function () {
      r[1](void 0)
    }]
  }

  function p7e() {
    var t = ep(pd++, 11);
    if (!t.__) {
      for (var e = dn.__v; e !== null && !e.__m && e.__ !== null;) e = e.__;
      var r = e.__m || (e.__m = [0, 0]);
      t.__ = "P" + r[0] + "-" + r[1]++
    }
    return t.__
  }

  function g7e() {
    for (var t; t = XF.shift();)
      if (t.__P && t.__H) try {
        t.__H.__h.forEach(_6), t.__H.__h.forEach(eS), t.__H.__h = []
      } catch (e) {
        t.__H.__h = [], Un.__e(e, t.__v)
      }
  }
  Un.__b = function (t) {
    dn = null, eW && eW(t)
  }, Un.__ = function (t, e) {
    t && e.__k && e.__k.__m && (t.__m = e.__k.__m), sW && sW(t, e)
  }, Un.__r = function (t) {
    tW && tW(t), pd = 0;
    var e = (dn = t.__c).__H;
    e && (JA === dn ? (e.__h = [], dn.__h = [], e.__.forEach(function (r) {
      r.__N && (r.__ = r.__N), r.i = r.__N = void 0
    })) : (e.__h.forEach(_6), e.__h.forEach(eS), e.__h = [], pd = 0)), JA = dn
  }, Un.diffed = function (t) {
    rW && rW(t);
    var e = t.__c;
    e && e.__H && (e.__H.__h.length && (XF.push(e) !== 1 && JF === Un.requestAnimationFrame || ((JF = Un.requestAnimationFrame) || m7e)(g7e)), e.__H.__.forEach(function (r) {
      r.i && (r.__H = r.i), r.i = void 0
    })), JA = dn = null
  }, Un.__c = function (t, e) {
    e.some(function (r) {
      try {
        r.__h.forEach(_6), r.__h = r.__h.filter(function (n) {
          return !n.__ || eS(n)
        })
      } catch (n) {
        e.some(function (i) {
          i.__h && (i.__h = [])
        }), e = [], Un.__e(n, r.__v)
      }
    }), nW && nW(t, e)
  }, Un.unmount = function (t) {
    iW && iW(t);
    var e, r = t.__c;
    r && r.__H && (r.__H.__.forEach(function (n) {
      try {
        _6(n)
      } catch (i) {
        e = i
      }
    }), r.__H = void 0, e && Un.__e(e, r.__v))
  };
  var lW = typeof requestAnimationFrame == "function";

  function m7e(t) {
    var e, r = function () {
        clearTimeout(n), lW && cancelAnimationFrame(e), setTimeout(t)
      },
      n = setTimeout(r, 100);
    lW && (e = requestAnimationFrame(r))
  }

  function _6(t) {
    var e = dn,
      r = t.__c;
    typeof r == "function" && (t.__c = void 0, r()), dn = e
  }

  function eS(t) {
    var e = dn;
    t.__c = t.__(), dn = e
  }

  function tS(t, e) {
    return !t || t.length !== e.length || e.some(function (r, n) {
      return r !== t[n]
    })
  }

  function uW(t, e) {
    return typeof e == "function" ? e(t) : e
  }
  const w7e = Object.freeze(Object.defineProperty({
      __proto__: null,
      useCallback: u7e,
      useContext: d7e,
      useDebugValue: h7e,
      useEffect: aW,
      useErrorBoundary: f7e,
      useId: p7e,
      useImperativeHandle: l7e,
      useLayoutEffect: cW,
      useMemo: XA,
      useReducer: oW,
      useRef: c7e,
      useState: y6
    }, Symbol.toStringTag, {
      value: "Module"
    })),
    v7e = ".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}",
    b7e = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",
    y7e = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";
  let _7e = class {
    constructor() {
      this.items = new Map, this.nextItemKey = 0, this.root = null, this.darkMode = PF()
    }
    attach(e) {
      this.root = document.createElement("div"), this.root.className = "-cbwsdk-snackbar-root", e.appendChild(this.root), this.render()
    }
    presentItem(e) {
      const r = this.nextItemKey++;
      return this.items.set(r, e), this.render(), () => {
        this.items.delete(r), this.render()
      }
    }
    clear() {
      this.items.clear(), this.render()
    }
    render() {
      this.root && mb(Xr("div", null, Xr(dW, {
        darkMode: this.darkMode
      }, Array.from(this.items.entries()).map(([e, r]) => Xr(x7e, Object.assign({}, r, {
        key: e
      }))))), this.root)
    }
  };
  const dW = t => Xr("div", {
      class: J0("-cbwsdk-snackbar-container")
    }, Xr("style", null, v7e), Xr("div", {
      class: "-cbwsdk-snackbar"
    }, t.children)),
    x7e = ({
      autoExpand: t,
      message: e,
      menuItems: r
    }) => {
      const [n, i] = y6(!0), [s, o] = y6(t ?? !1);
      aW(() => {
        const c = [window.setTimeout(() => {
          i(!1)
        }, 1), window.setTimeout(() => {
          o(!0)
        }, 1e4)];
        return () => {
          c.forEach(window.clearTimeout)
        }
      });
      const a = () => {
        o(!s)
      };
      return Xr("div", {
        class: J0("-cbwsdk-snackbar-instance", n && "-cbwsdk-snackbar-instance-hidden", s && "-cbwsdk-snackbar-instance-expanded")
      }, Xr("div", {
        class: "-cbwsdk-snackbar-instance-header",
        onClick: a
      }, Xr("img", {
        src: b7e,
        class: "-cbwsdk-snackbar-instance-header-cblogo"
      }), " ", Xr("div", {
        class: "-cbwsdk-snackbar-instance-header-message"
      }, e), Xr("div", {
        class: "-gear-container"
      }, !s && Xr("svg", {
        width: "24",
        height: "24",
        viewBox: "0 0 24 24",
        fill: "none",
        xmlns: "http://www.w3.org/2000/svg"
      }, Xr("circle", {
        cx: "12",
        cy: "12",
        r: "12",
        fill: "#F5F7F8"
      })), Xr("img", {
        src: y7e,
        class: "-gear-icon",
        title: "Expand"
      }))), r && r.length > 0 && Xr("div", {
        class: "-cbwsdk-snackbar-instance-menu"
      }, r.map((c, l) => Xr("div", {
        class: J0("-cbwsdk-snackbar-instance-menu-item", c.isRed && "-cbwsdk-snackbar-instance-menu-item-is-red"),
        onClick: c.onClick,
        key: l
      }, Xr("svg", {
        width: c.svgWidth,
        height: c.svgHeight,
        viewBox: "0 0 10 11",
        fill: "none",
        xmlns: "http://www.w3.org/2000/svg"
      }, Xr("path", {
        "fill-rule": c.defaultFillRule,
        "clip-rule": c.defaultClipRule,
        d: c.path,
        fill: "#AAAAAA"
      })), Xr("span", {
        class: J0("-cbwsdk-snackbar-instance-menu-item-info", c.isRed && "-cbwsdk-snackbar-instance-menu-item-info-is-red")
      }, c.info)))))
    };
  let C7e = class {
    constructor() {
      this.attached = !1, this.snackbar = new _7e
    }
    attach() {
      if (this.attached) throw new Error("Coinbase Wallet SDK UI is already attached");
      const e = document.documentElement,
        r = document.createElement("div");
      r.className = "-cbwsdk-css-reset", e.appendChild(r), this.snackbar.attach(r), this.attached = !0, $F()
    }
    showConnecting(e) {
      let r;
      return e.isUnlinkedErrorState ? r = {
        autoExpand: !0,
        message: "Connection lost",
        menuItems: [{
          isRed: !1,
          info: "Reset connection",
          svgWidth: "10",
          svgHeight: "11",
          path: "M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",
          defaultFillRule: "evenodd",
          defaultClipRule: "evenodd",
          onClick: e.onResetConnection
        }]
      } : r = {
        message: "Confirm on phone",
        menuItems: [{
          isRed: !0,
          info: "Cancel transaction",
          svgWidth: "11",
          svgHeight: "11",
          path: "M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",
          defaultFillRule: "inherit",
          defaultClipRule: "inherit",
          onClick: e.onCancel
        }, {
          isRed: !1,
          info: "Reset connection",
          svgWidth: "10",
          svgHeight: "11",
          path: "M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",
          defaultFillRule: "evenodd",
          defaultClipRule: "evenodd",
          onClick: e.onResetConnection
        }]
      }, this.snackbar.presentItem(r)
    }
  };
  const E7e = ".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";
  let A7e = class {
    constructor() {
      this.root = null, this.darkMode = PF()
    }
    attach() {
      const e = document.documentElement;
      this.root = document.createElement("div"), this.root.className = "-cbwsdk-css-reset", e.appendChild(this.root), $F()
    }
    present(e) {
      this.render(e)
    }
    clear() {
      this.render(null)
    }
    render(e) {
      this.root && (mb(null, this.root), e && mb(Xr(S7e, Object.assign({}, e, {
        onDismiss: () => {
          this.clear()
        },
        darkMode: this.darkMode
      })), this.root))
    }
  };
  const S7e = ({
      title: t,
      buttonText: e,
      darkMode: r,
      onButtonClick: n,
      onDismiss: i
    }) => {
      const s = r ? "dark" : "light";
      return Xr(dW, {
        darkMode: r
      }, Xr("div", {
        class: "-cbwsdk-redirect-dialog"
      }, Xr("style", null, E7e), Xr("div", {
        class: "-cbwsdk-redirect-dialog-backdrop",
        onClick: i
      }), Xr("div", {
        class: J0("-cbwsdk-redirect-dialog-box", s)
      }, Xr("p", null, t), Xr("button", {
        onClick: n
      }, e))))
    },
    I7e = "https://keys.coinbase.com/connect",
    hW = "https://www.walletlink.org",
    T7e = "https://go.cb-w.com/walletlink";
  class fW {
    constructor() {
      this.attached = !1, this.redirectDialog = new A7e
    }
    attach() {
      if (this.attached) throw new Error("Coinbase Wallet SDK UI is already attached");
      this.redirectDialog.attach(), this.attached = !0
    }
    redirectToCoinbaseWallet(e) {
      const r = new URL(T7e);
      r.searchParams.append("redirect_url", Z_e().href), e && r.searchParams.append("wl_url", e);
      const n = document.createElement("a");
      n.target = "cbw-opener", n.href = r.href, n.rel = "noreferrer noopener", n.click()
    }
    openCoinbaseWalletDeeplink(e) {
      this.redirectDialog.present({
        title: "Redirecting to Coinbase Wallet...",
        buttonText: "Open",
        onButtonClick: () => {
          this.redirectToCoinbaseWallet(e)
        }
      }), setTimeout(() => {
        this.redirectToCoinbaseWallet(e)
      }, 99)
    }
    showConnecting(e) {
      return () => {
        this.redirectDialog.clear()
      }
    }
  }
  let pW = class Wp {
    constructor(e) {
      this.chainCallbackParams = {
        chainId: "",
        jsonRpcUrl: ""
      }, this.isMobileWeb = Y_e(), this.linkedUpdated = s => {
        this.isLinked = s;
        const o = this.storage.getItem(HA);
        if (s && (this._session.linked = s), this.isUnlinkedErrorState = !1, o) {
          const a = o.split(" "),
            c = this.storage.getItem("IsStandaloneSigning") === "true";
          a[0] !== "" && !s && this._session.linked && !c && (this.isUnlinkedErrorState = !0)
        }
      }, this.metadataUpdated = (s, o) => {
        this.storage.setItem(s, o)
      }, this.chainUpdated = (s, o) => {
        this.chainCallbackParams.chainId === s && this.chainCallbackParams.jsonRpcUrl === o || (this.chainCallbackParams = {
          chainId: s,
          jsonRpcUrl: o
        }, this.chainCallback && this.chainCallback(o, Number.parseInt(s, 10)))
      }, this.accountUpdated = s => {
        this.accountsCallback && this.accountsCallback([s]), Wp.accountRequestCallbackIds.size > 0 && (Array.from(Wp.accountRequestCallbackIds.values()).forEach(o => {
          this.invokeCallback(o, {
            method: "requestEthereumAccounts",
            result: [s]
          })
        }), Wp.accountRequestCallbackIds.clear())
      }, this.resetAndReload = this.resetAndReload.bind(this), this.linkAPIUrl = e.linkAPIUrl, this.storage = e.storage, this.metadata = e.metadata, this.accountsCallback = e.accountsCallback, this.chainCallback = e.chainCallback;
      const {
        session: r,
        ui: n,
        connection: i
      } = this.subscribe();
      this._session = r, this.connection = i, this.relayEventManager = new K_e, this.ui = n, this.ui.attach()
    }
    subscribe() {
      const e = qg.load(this.storage) || qg.create(this.storage),
        {
          linkAPIUrl: r
        } = this,
        n = new V_e({
          session: e,
          linkAPIUrl: r,
          listener: this
        }),
        i = this.isMobileWeb ? new fW : new C7e;
      return n.connect(), {
        session: e,
        ui: i,
        connection: n
      }
    }
    resetAndReload() {
      this.connection.destroy().then(() => {
        const e = qg.load(this.storage);
        e?.id === this._session.id && Wh.clearAll(), document.location.reload()
      }).catch(e => {})
    }
    signEthereumTransaction(e) {
      return this.sendRequest({
        method: "signEthereumTransaction",
        params: {
          fromAddress: e.fromAddress,
          toAddress: e.toAddress,
          weiValue: Jl(e.weiValue),
          data: ab(e.data, !0),
          nonce: e.nonce,
          gasPriceInWei: e.gasPriceInWei ? Jl(e.gasPriceInWei) : null,
          maxFeePerGas: e.gasPriceInWei ? Jl(e.gasPriceInWei) : null,
          maxPriorityFeePerGas: e.gasPriceInWei ? Jl(e.gasPriceInWei) : null,
          gasLimit: e.gasLimit ? Jl(e.gasLimit) : null,
          chainId: e.chainId,
          shouldSubmit: !1
        }
      })
    }
    signAndSubmitEthereumTransaction(e) {
      return this.sendRequest({
        method: "signEthereumTransaction",
        params: {
          fromAddress: e.fromAddress,
          toAddress: e.toAddress,
          weiValue: Jl(e.weiValue),
          data: ab(e.data, !0),
          nonce: e.nonce,
          gasPriceInWei: e.gasPriceInWei ? Jl(e.gasPriceInWei) : null,
          maxFeePerGas: e.maxFeePerGas ? Jl(e.maxFeePerGas) : null,
          maxPriorityFeePerGas: e.maxPriorityFeePerGas ? Jl(e.maxPriorityFeePerGas) : null,
          gasLimit: e.gasLimit ? Jl(e.gasLimit) : null,
          chainId: e.chainId,
          shouldSubmit: !0
        }
      })
    }
    submitEthereumTransaction(e, r) {
      return this.sendRequest({
        method: "submitEthereumTransaction",
        params: {
          signedTransaction: ab(e, !0),
          chainId: r
        }
      })
    }
    getWalletLinkSession() {
      return this._session
    }
    sendRequest(e) {
      let r = null;
      const n = Y0(8),
        i = s => {
          this.publishWeb3RequestCanceledEvent(n), this.handleErrorResponse(n, e.method, s), r?.()
        };
      return new Promise((s, o) => {
        r = this.ui.showConnecting({
          isUnlinkedErrorState: this.isUnlinkedErrorState,
          onCancel: i,
          onResetConnection: this.resetAndReload
        }), this.relayEventManager.callbacks.set(n, a => {
          if (r?.(), ls(a)) return o(new Error(a.errorMessage));
          s(a)
        }), this.publishWeb3RequestEvent(n, e)
      })
    }
    publishWeb3RequestEvent(e, r) {
      const n = {
        type: "WEB3_REQUEST",
        id: e,
        request: r
      };
      this.publishEvent("Web3Request", n, !0).then(i => {}).catch(i => {
        this.handleWeb3ResponseMessage(n.id, {
          method: r.method,
          errorMessage: i.message
        })
      }), this.isMobileWeb && this.openCoinbaseWalletDeeplink(r.method)
    }
    openCoinbaseWalletDeeplink(e) {
      if (this.ui instanceof fW) switch (e) {
        case "requestEthereumAccounts":
        case "switchEthereumChain":
          return;
        default:
          window.addEventListener("blur", () => {
            window.addEventListener("focus", () => {
              this.connection.checkUnseenEvents()
            }, {
              once: !0
            })
          }, {
            once: !0
          }), this.ui.openCoinbaseWalletDeeplink();
          break
      }
    }
    publishWeb3RequestCanceledEvent(e) {
      const r = {
        type: "WEB3_REQUEST_CANCELED",
        id: e
      };
      this.publishEvent("Web3RequestCanceled", r, !1).then()
    }
    publishEvent(e, r, n) {
      return this.connection.publishEvent(e, r, n)
    }
    handleWeb3ResponseMessage(e, r) {
      if (r.method === "requestEthereumAccounts") {
        Wp.accountRequestCallbackIds.forEach(n => this.invokeCallback(n, r)), Wp.accountRequestCallbackIds.clear();
        return
      }
      this.invokeCallback(e, r)
    }
    handleErrorResponse(e, r, n) {
      var i;
      const s = (i = n?.message) !== null && i !== void 0 ? i : "Unspecified error message.";
      this.handleWeb3ResponseMessage(e, {
        method: r,
        errorMessage: s
      })
    }
    invokeCallback(e, r) {
      const n = this.relayEventManager.callbacks.get(e);
      n && (n(r), this.relayEventManager.callbacks.delete(e))
    }
    requestEthereumAccounts() {
      const {
        appName: e,
        appLogoUrl: r
      } = this.metadata, n = {
        method: "requestEthereumAccounts",
        params: {
          appName: e,
          appLogoUrl: r
        }
      }, i = Y0(8);
      return new Promise((s, o) => {
        this.relayEventManager.callbacks.set(i, a => {
          if (ls(a)) return o(new Error(a.errorMessage));
          s(a)
        }), Wp.accountRequestCallbackIds.add(i), this.publishWeb3RequestEvent(i, n)
      })
    }
    watchAsset(e, r, n, i, s, o) {
      const a = {
        method: "watchAsset",
        params: {
          type: e,
          options: {
            address: r,
            symbol: n,
            decimals: i,
            image: s
          },
          chainId: o
        }
      };
      let c = null;
      const l = Y0(8),
        h = f => {
          this.publishWeb3RequestCanceledEvent(l), this.handleErrorResponse(l, a.method, f), c?.()
        };
      return c = this.ui.showConnecting({
        isUnlinkedErrorState: this.isUnlinkedErrorState,
        onCancel: h,
        onResetConnection: this.resetAndReload
      }), new Promise((f, w) => {
        this.relayEventManager.callbacks.set(l, b => {
          if (c?.(), ls(b)) return w(new Error(b.errorMessage));
          f(b)
        }), this.publishWeb3RequestEvent(l, a)
      })
    }
    addEthereumChain(e, r, n, i, s, o) {
      const a = {
        method: "addEthereumChain",
        params: {
          chainId: e,
          rpcUrls: r,
          blockExplorerUrls: i,
          chainName: s,
          iconUrls: n,
          nativeCurrency: o
        }
      };
      let c = null;
      const l = Y0(8),
        h = f => {
          this.publishWeb3RequestCanceledEvent(l), this.handleErrorResponse(l, a.method, f), c?.()
        };
      return c = this.ui.showConnecting({
        isUnlinkedErrorState: this.isUnlinkedErrorState,
        onCancel: h,
        onResetConnection: this.resetAndReload
      }), new Promise((f, w) => {
        this.relayEventManager.callbacks.set(l, b => {
          if (c?.(), ls(b)) return w(new Error(b.errorMessage));
          f(b)
        }), this.publishWeb3RequestEvent(l, a)
      })
    }
    switchEthereumChain(e, r) {
      const n = {
        method: "switchEthereumChain",
        params: Object.assign({
          chainId: e
        }, {
          address: r
        })
      };
      let i = null;
      const s = Y0(8),
        o = a => {
          this.publishWeb3RequestCanceledEvent(s), this.handleErrorResponse(s, n.method, a), i?.()
        };
      return i = this.ui.showConnecting({
        isUnlinkedErrorState: this.isUnlinkedErrorState,
        onCancel: o,
        onResetConnection: this.resetAndReload
      }), new Promise((a, c) => {
        this.relayEventManager.callbacks.set(s, l => {
          if (i?.(), ls(l) && l.errorCode) return c(Fr.provider.custom({
            code: l.errorCode,
            message: "Unrecognized chain ID. Try adding the chain using addEthereumChain first."
          }));
          if (ls(l)) return c(new Error(l.errorMessage));
          a(l)
        }), this.publishWeb3RequestEvent(s, n)
      })
    }
  };
  pW.accountRequestCallbackIds = new Set;
  const gW = "DefaultChainId",
    mW = "DefaultJsonRpcUrl";
  class wW {
    constructor(e) {
      this._relay = null, this._addresses = [], this.metadata = e.metadata, this._storage = new Wh("walletlink", hW), this.callback = e.callback || null;
      const r = this._storage.getItem(HA);
      if (r) {
        const n = r.split(" ");
        n[0] !== "" && (this._addresses = n.map(i => Hh(i)))
      }
      this.initializeRelay()
    }
    getSession() {
      const e = this.initializeRelay(),
        {
          id: r,
          secret: n
        } = e.getWalletLinkSession();
      return {
        id: r,
        secret: n
      }
    }
    async handshake() {
      await this._eth_requestAccounts()
    }
    get selectedAddress() {
      return this._addresses[0] || void 0
    }
    get jsonRpcUrl() {
      var e;
      return (e = this._storage.getItem(mW)) !== null && e !== void 0 ? e : void 0
    }
    set jsonRpcUrl(e) {
      this._storage.setItem(mW, e)
    }
    updateProviderInfo(e, r) {
      var n;
      this.jsonRpcUrl = e;
      const i = this.getChainId();
      this._storage.setItem(gW, r.toString(10)), cb(r) !== i && ((n = this.callback) === null || n === void 0 || n.call(this, "chainChanged", zh(r)))
    }
    async watchAsset(e) {
      const r = Array.isArray(e) ? e[0] : e;
      if (!r.type) throw Fr.rpc.invalidParams("Type is required");
      if (r?.type !== "ERC20") throw Fr.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);
      if (!r?.options) throw Fr.rpc.invalidParams("Options are required");
      if (!r?.options.address) throw Fr.rpc.invalidParams("Address is required");
      const n = this.getChainId(),
        {
          address: i,
          symbol: s,
          image: o,
          decimals: a
        } = r.options,
        l = await this.initializeRelay().watchAsset(r.type, i, s, a, o, n?.toString());
      return ls(l) ? !1 : !!l.result
    }
    async addEthereumChain(e) {
      var r, n;
      const i = e[0];
      if (((r = i.rpcUrls) === null || r === void 0 ? void 0 : r.length) === 0) throw Fr.rpc.invalidParams("please pass in at least 1 rpcUrl");
      if (!i.chainName || i.chainName.trim() === "") throw Fr.rpc.invalidParams("chainName is a required field");
      if (!i.nativeCurrency) throw Fr.rpc.invalidParams("nativeCurrency is a required field");
      const s = Number.parseInt(i.chainId, 16);
      if (s === this.getChainId()) return !1;
      const o = this.initializeRelay(),
        {
          rpcUrls: a = [],
          blockExplorerUrls: c = [],
          chainName: l,
          iconUrls: h = [],
          nativeCurrency: f
        } = i,
        w = await o.addEthereumChain(s.toString(), a, h, c, l, f);
      if (ls(w)) return !1;
      if (((n = w.result) === null || n === void 0 ? void 0 : n.isApproved) === !0) return this.updateProviderInfo(a[0], s), null;
      throw Fr.rpc.internal("unable to add ethereum chain")
    }
    async switchEthereumChain(e) {
      const r = e[0],
        n = Number.parseInt(r.chainId, 16),
        s = await this.initializeRelay().switchEthereumChain(n.toString(10), this.selectedAddress || void 0);
      if (ls(s)) throw s;
      const o = s.result;
      return o.isApproved && o.rpcUrl.length > 0 && this.updateProviderInfo(o.rpcUrl, n), null
    }
    async cleanup() {
      this.callback = null, this._relay && this._relay.resetAndReload(), this._storage.clear()
    }
    _setAddresses(e, r) {
      var n;
      if (!Array.isArray(e)) throw new Error("addresses is not an array");
      const i = e.map(s => Hh(s));
      JSON.stringify(i) !== JSON.stringify(this._addresses) && (this._addresses = i, (n = this.callback) === null || n === void 0 || n.call(this, "accountsChanged", i), this._storage.setItem(HA, i.join(" ")))
    }
    async request(e) {
      const r = e.params || [];
      switch (e.method) {
        case "eth_accounts":
          return [...this._addresses];
        case "eth_coinbase":
          return this.selectedAddress || null;
        case "net_version":
          return this.getChainId().toString(10);
        case "eth_chainId":
          return zh(this.getChainId());
        case "eth_requestAccounts":
          return this._eth_requestAccounts();
        case "eth_ecRecover":
        case "personal_ecRecover":
          return this.ecRecover(e);
        case "personal_sign":
          return this.personalSign(e);
        case "eth_signTransaction":
          return this._eth_signTransaction(r);
        case "eth_sendRawTransaction":
          return this._eth_sendRawTransaction(r);
        case "eth_sendTransaction":
          return this._eth_sendTransaction(r);
        case "eth_signTypedData_v1":
        case "eth_signTypedData_v3":
        case "eth_signTypedData_v4":
        case "eth_signTypedData":
          return this.signTypedData(e);
        case "wallet_addEthereumChain":
          return this.addEthereumChain(r);
        case "wallet_switchEthereumChain":
          return this.switchEthereumChain(r);
        case "wallet_watchAsset":
          return this.watchAsset(r);
        default:
          if (!this.jsonRpcUrl) throw Fr.rpc.internal("No RPC URL set for chain");
          return hF(e, this.jsonRpcUrl)
      }
    }
    _ensureKnownAddress(e) {
      const r = Hh(e);
      if (!this._addresses.map(i => Hh(i)).includes(r)) throw new Error("Unknown Ethereum address")
    }
    _prepareTransactionParams(e) {
      const r = e.from ? Hh(e.from) : this.selectedAddress;
      if (!r) throw new Error("Ethereum address is unavailable");
      this._ensureKnownAddress(r);
      const n = e.to ? Hh(e.to) : null,
        i = e.value != null ? lb(e.value) : BigInt(0),
        s = e.data ? UA(e.data) : Buffer.alloc(0),
        o = e.nonce != null ? cb(e.nonce) : null,
        a = e.gasPrice != null ? lb(e.gasPrice) : null,
        c = e.maxFeePerGas != null ? lb(e.maxFeePerGas) : null,
        l = e.maxPriorityFeePerGas != null ? lb(e.maxPriorityFeePerGas) : null,
        h = e.gas != null ? lb(e.gas) : null,
        f = e.chainId ? cb(e.chainId) : this.getChainId();
      return {
        fromAddress: r,
        toAddress: n,
        weiValue: i,
        data: s,
        nonce: o,
        gasPriceInWei: a,
        maxFeePerGas: c,
        maxPriorityFeePerGas: l,
        gasLimit: h,
        chainId: f
      }
    }
    async ecRecover(e) {
      const {
        method: r,
        params: n
      } = e;
      if (!Array.isArray(n)) throw Fr.rpc.invalidParams();
      const s = await this.initializeRelay().sendRequest({
        method: "ethereumAddressFromSignedMessage",
        params: {
          message: DA(n[0]),
          signature: DA(n[1]),
          addPrefix: r === "personal_ecRecover"
        }
      });
      if (ls(s)) throw s;
      return s.result
    }
    getChainId() {
      var e;
      return Number.parseInt((e = this._storage.getItem(gW)) !== null && e !== void 0 ? e : "1", 10)
    }
    async _eth_requestAccounts() {
      var e, r;
      if (this._addresses.length > 0) return (e = this.callback) === null || e === void 0 || e.call(this, "connect", {
        chainId: zh(this.getChainId())
      }), this._addresses;
      const i = await this.initializeRelay().requestEthereumAccounts();
      if (ls(i)) throw i;
      if (!i.result) throw new Error("accounts received is empty");
      return this._setAddresses(i.result), (r = this.callback) === null || r === void 0 || r.call(this, "connect", {
        chainId: zh(this.getChainId())
      }), this._addresses
    }
    async personalSign({
      params: e
    }) {
      if (!Array.isArray(e)) throw Fr.rpc.invalidParams();
      const r = e[1],
        n = e[0];
      this._ensureKnownAddress(r);
      const s = await this.initializeRelay().sendRequest({
        method: "signEthereumMessage",
        params: {
          address: Hh(r),
          message: DA(n),
          addPrefix: !0,
          typedDataJson: null
        }
      });
      if (ls(s)) throw s;
      return s.result
    }
    async _eth_signTransaction(e) {
      const r = this._prepareTransactionParams(e[0] || {}),
        i = await this.initializeRelay().signEthereumTransaction(r);
      if (ls(i)) throw i;
      return i.result
    }
    async _eth_sendRawTransaction(e) {
      const r = UA(e[0]),
        i = await this.initializeRelay().submitEthereumTransaction(r, this.getChainId());
      if (ls(i)) throw i;
      return i.result
    }
    async _eth_sendTransaction(e) {
      const r = this._prepareTransactionParams(e[0] || {}),
        i = await this.initializeRelay().signAndSubmitEthereumTransaction(r);
      if (ls(i)) throw i;
      return i.result
    }
    async signTypedData(e) {
      const {
        method: r,
        params: n
      } = e;
      if (!Array.isArray(n)) throw Fr.rpc.invalidParams();
      const i = l => {
          const h = {
            eth_signTypedData_v1: m6.hashForSignTypedDataLegacy,
            eth_signTypedData_v3: m6.hashForSignTypedData_v3,
            eth_signTypedData_v4: m6.hashForSignTypedData_v4,
            eth_signTypedData: m6.hashForSignTypedData_v4
          };
          return ab(h[r]({
            data: h_e(l)
          }), !0)
        },
        s = n[r === "eth_signTypedData_v1" ? 1 : 0],
        o = n[r === "eth_signTypedData_v1" ? 0 : 1];
      this._ensureKnownAddress(s);
      const c = await this.initializeRelay().sendRequest({
        method: "signEthereumMessage",
        params: {
          address: Hh(s),
          message: i(o),
          typedDataJson: JSON.stringify(o, null, 2),
          addPrefix: !1
        }
      });
      if (ls(c)) throw c;
      return c.result
    }
    initializeRelay() {
      return this._relay || (this._relay = new pW({
        linkAPIUrl: hW,
        storage: this._storage,
        metadata: this.metadata,
        accountsCallback: this._setAddresses.bind(this),
        chainCallback: this.updateProviderInfo.bind(this)
      })), this._relay
    }
  }
  const vW = "SignerType",
    bW = new Wh("CBWSDK", "SignerConfigurator");

  function k7e() {
    return bW.getItem(vW)
  }

  function R7e(t) {
    bW.setItem(vW, t)
  }
  async function N7e(t) {
    const {
      communicator: e,
      metadata: r,
      handshakeRequest: n,
      callback: i
    } = t;
    P7e(e, r, i).catch(() => {});
    const s = {
        id: crypto.randomUUID(),
        event: "selectSignerType",
        data: Object.assign(Object.assign({}, t.preference), {
          handshakeRequest: n
        })
      },
      {
        data: o
      } = await e.postRequestAndWaitForResponse(s);
    return o
  }

  function M7e(t) {
    const {
      signerType: e,
      metadata: r,
      communicator: n,
      callback: i
    } = t;
    switch (e) {
      case "scw":
        return new A_e({
          metadata: r,
          callback: i,
          communicator: n
        });
      case "walletlink":
        return new wW({
          metadata: r,
          callback: i
        })
    }
  }
  async function P7e(t, e, r) {
    await t.onMessage(({
      event: i
    }) => i === "WalletLinkSessionRequest");
    const n = new wW({
      metadata: e,
      callback: r
    });
    t.postMessage({
      event: "WalletLinkUpdate",
      data: {
        session: n.getSession()
      }
    }), await n.handshake(), t.postMessage({
      event: "WalletLinkUpdate",
      data: {
        connected: !0
      }
    })
  }
  const $7e = `Coinbase Wallet SDK requires the Cross-Origin-Opener-Policy header to not be set to 'same-origin'. This is to ensure that the SDK can communicate with the Coinbase Smart Wallet app.
  
  Please see https://www.smartwallet.dev/guides/tips/popup-tips#cross-origin-opener-policy for more information.`,
    O7e = () => {
      let t;
      return {
        getCrossOriginOpenerPolicy: () => t === void 0 ? "undefined" : t,
        checkCrossOriginOpenerPolicy: async () => {
          if (typeof window > "u") {
            t = "non-browser-env";
            return
          }
          try {
            const e = `${window.location.origin}${window.location.pathname}`,
              r = await fetch(e, {
                method: "HEAD"
              });
            if (!r.ok) throw new Error(`HTTP error! status: ${r.status}`);
            const n = r.headers.get("Cross-Origin-Opener-Policy");
            t = n ?? "null", t === "same-origin" && console.error($7e)
          } catch (e) {
            console.error("Error checking Cross-Origin-Opener-Policy:", e.message), t = "error"
          }
        }
      }
    },
    {
      checkCrossOriginOpenerPolicy: yW,
      getCrossOriginOpenerPolicy: D7e
    } = O7e(),
    _W = 420,
    xW = 540;

  function L7e(t) {
    const e = (window.innerWidth - _W) / 2 + window.screenX,
      r = (window.innerHeight - xW) / 2 + window.screenY;
    U7e(t);
    const n = window.open(t, "Smart Wallet", `width=${_W}, height=${xW}, left=${e}, top=${r}`);
    if (n?.focus(), !n) throw Fr.rpc.internal("Pop up window failed to open");
    return n
  }

  function B7e(t) {
    t && !t.closed && t.close()
  }

  function U7e(t) {
    const e = {
      sdkName: dF,
      sdkVersion: zg,
      origin: window.location.origin,
      coop: D7e()
    };
    for (const [r, n] of Object.entries(e)) t.searchParams.append(r, n.toString())
  }
  class j7e {
    constructor({
      url: e = I7e,
      metadata: r,
      preference: n
    }) {
      this.popup = null, this.listeners = new Map, this.postMessage = async i => {
        (await this.waitForPopupLoaded()).postMessage(i, this.url.origin)
      }, this.postRequestAndWaitForResponse = async i => {
        const s = this.onMessage(({
          requestId: o
        }) => o === i.id);
        return this.postMessage(i), await s
      }, this.onMessage = async i => new Promise((s, o) => {
        const a = c => {
          if (c.origin !== this.url.origin) return;
          const l = c.data;
          i(l) && (s(l), window.removeEventListener("message", a), this.listeners.delete(a))
        };
        window.addEventListener("message", a), this.listeners.set(a, {
          reject: o
        })
      }), this.disconnect = () => {
        B7e(this.popup), this.popup = null, this.listeners.forEach(({
          reject: i
        }, s) => {
          i(Fr.provider.userRejectedRequest("Request rejected")), window.removeEventListener("message", s)
        }), this.listeners.clear()
      }, this.waitForPopupLoaded = async () => this.popup && !this.popup.closed ? (this.popup.focus(), this.popup) : (this.popup = L7e(this.url), this.onMessage(({
        event: i
      }) => i === "PopupUnload").then(this.disconnect).catch(() => {}), this.onMessage(({
        event: i
      }) => i === "PopupLoaded").then(i => {
        this.postMessage({
          requestId: i.id,
          data: {
            version: zg,
            metadata: this.metadata,
            preference: this.preference,
            location: window.location.toString()
          }
        })
      }).then(() => {
        if (!this.popup) throw Fr.rpc.internal();
        return this.popup
      })), this.url = new URL(e), this.metadata = r, this.preference = n
    }
  }

  function F7e(t) {
    const e = a_e(W7e(t), {
        shouldIncludeStack: !0
      }),
      r = new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");
    return r.searchParams.set("version", zg), r.searchParams.set("code", e.code.toString()), r.searchParams.set("message", e.message), Object.assign(Object.assign({}, e), {
      docUrl: r.href
    })
  }

  function W7e(t) {
    var e;
    if (typeof t == "string") return {
      message: t,
      code: ai.rpc.internal
    };
    if (ls(t)) {
      const r = t.errorMessage,
        n = (e = t.errorCode) !== null && e !== void 0 ? e : r.match(/(denied|rejected)/i) ? ai.provider.userRejectedRequest : void 0;
      return Object.assign(Object.assign({}, t), {
        message: r,
        code: n,
        data: {
          method: t.method
        }
      })
    }
    return t
  }
  class z7e extends ly {}
  var H7e = function (t, e) {
    var r = {};
    for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
    if (t != null && typeof Object.getOwnPropertySymbols == "function")
      for (var i = 0, n = Object.getOwnPropertySymbols(t); i < n.length; i++) e.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[i]) && (r[n[i]] = t[n[i]]);
    return r
  };
  let CW = class extends z7e {
    constructor(e) {
      var {
        metadata: r
      } = e, n = e.preference, {
        keysUrl: i
      } = n, s = H7e(n, ["keysUrl"]);
      super(), this.signer = null, this.isCoinbaseWallet = !0, this.metadata = r, this.preference = s, this.communicator = new j7e({
        url: i,
        metadata: r,
        preference: s
      });
      const o = k7e();
      o && (this.signer = this.initSigner(o))
    }
    async request(e) {
      try {
        if (E_e(e), !this.signer) switch (e.method) {
          case "eth_requestAccounts": {
            const r = await this.requestSignerSelection(e),
              n = this.initSigner(r);
            await n.handshake(e), this.signer = n, R7e(r);
            break
          }
          case "net_version":
            return 1;
          case "eth_chainId":
            return zh(1);
          default:
            throw Fr.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")
        }
        return this.signer.request(e)
      } catch (r) {
        const {
          code: n
        } = r;
        return n === ai.provider.unauthorized && this.disconnect(), Promise.reject(F7e(r))
      }
    }
    async enable() {
      return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'), await this.request({
        method: "eth_requestAccounts"
      })
    }
    async disconnect() {
      var e;
      await ((e = this.signer) === null || e === void 0 ? void 0 : e.cleanup()), this.signer = null, Wh.clearAll(), this.emit("disconnect", Fr.provider.disconnected("User initiated disconnection"))
    }
    requestSignerSelection(e) {
      return N7e({
        communicator: this.communicator,
        preference: this.preference,
        metadata: this.metadata,
        handshakeRequest: e,
        callback: this.emit.bind(this)
      })
    }
    initSigner(e) {
      return M7e({
        signerType: e,
        metadata: this.metadata,
        communicator: this.communicator,
        callback: this.emit.bind(this)
      })
    }
  };

  function EW(t) {
    if (t) {
      if (!["all", "smartWalletOnly", "eoaOnly"].includes(t.options)) throw new Error(`Invalid options: ${t.options}`);
      if (t.attribution && t.attribution.auto !== void 0 && t.attribution.dataSuffix !== void 0) throw new Error("Attribution cannot contain both auto and dataSuffix properties")
    }
  }
  let AW = class {
    constructor(e) {
      this.metadata = {
        appName: e.appName || "Dapp",
        appLogoUrl: e.appLogoUrl || p_e(),
        appChainIds: e.appChainIds || []
      }, this.storeLatestVersion(), yW()
    }
    makeWeb3Provider(e = {
      options: "all"
    }) {
      var r;
      EW(e);
      const n = {
        metadata: this.metadata,
        preference: e
      };
      return (r = fF(n)) !== null && r !== void 0 ? r : new CW(n)
    }
    getCoinbaseWalletLogo(e, r = 240) {
      return i_e(e, r)
    }
    storeLatestVersion() {
      new Wh("CBWSDK").setItem("VERSION", zg)
    }
  };

  function q7e(t) {
    var e;
    const r = {
      metadata: t.metadata,
      preference: t.preference
    };
    return (e = fF(r)) !== null && e !== void 0 ? e : new CW(r)
  }
  const V7e = {
    options: "all"
  };

  function K7e(t) {
    var e;
    new Wh("CBWSDK").setItem("VERSION", zg), yW();
    const n = {
      metadata: {
        appName: t.appName || "Dapp",
        appLogoUrl: t.appLogoUrl || "",
        appChainIds: t.appChainIds || []
      },
      preference: Object.assign(V7e, (e = t.preference) !== null && e !== void 0 ? e : {})
    };
    EW(n.preference);
    let i = null;
    return {
      getProvider: () => (i || (i = q7e(n)), i)
    }
  }
  const G7e = Object.freeze(Object.defineProperty({
    __proto__: null,
    CoinbaseWalletSDK: AW,
    createCoinbaseWalletSDK: K7e,
    default: AW
  }, Symbol.toStringTag, {
    value: "Module"
  }));
  var SW = {},
    wb = {},
    x6 = {};
  Object.defineProperty(x6, "__esModule", {
    value: !0
  }), x6.walletLogo = void 0;
  const Z7e = (t, e) => {
    let r;
    switch (t) {
      case "standard":
        return r = e, `data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;
      case "circle":
        return r = e, `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;
      case "text":
        return r = (.1 * e).toFixed(2), `data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;
      case "textWithLogo":
        return r = (.25 * e).toFixed(2), `data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;
      case "textLight":
        return r = (.1 * e).toFixed(2), `data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;
      case "textWithLogoLight":
        return r = (.25 * e).toFixed(2), `data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;
      default:
        return r = e, `data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `
    }
  };
  x6.walletLogo = Z7e;
  var C6 = {};
  Object.defineProperty(C6, "__esModule", {
    value: !0
  }), C6.LINK_API_URL = void 0, C6.LINK_API_URL = "https://www.walletlink.org";
  var jt = {},
    rS = {
      exports: {}
    };
  rS.exports,
    function (t) {
      (function (e, r) {
        function n(g, u) {
          if (!g) throw new Error(u || "Assertion failed")
        }

        function i(g, u) {
          g.super_ = u;
          var p = function () {};
          p.prototype = u.prototype, g.prototype = new p, g.prototype.constructor = g
        }

        function s(g, u, p) {
          if (s.isBN(g)) return g;
          this.negative = 0, this.words = null, this.length = 0, this.red = null, g !== null && ((u === "le" || u === "be") && (p = u, u = 10), this._init(g || 0, u || 10, p || "be"))
        }
        typeof e == "object" ? e.exports = s : r.BN = s, s.BN = s, s.wordSize = 26;
        var o;
        try {
          typeof window < "u" && typeof window.Buffer < "u" ? o = window.Buffer : o = eg.Buffer
        } catch {}
        s.isBN = function (u) {
          return u instanceof s ? !0 : u !== null && typeof u == "object" && u.constructor.wordSize === s.wordSize && Array.isArray(u.words)
        }, s.max = function (u, p) {
          return u.cmp(p) > 0 ? u : p
        }, s.min = function (u, p) {
          return u.cmp(p) < 0 ? u : p
        }, s.prototype._init = function (u, p, v) {
          if (typeof u == "number") return this._initNumber(u, p, v);
          if (typeof u == "object") return this._initArray(u, p, v);
          p === "hex" && (p = 16), n(p === (p | 0) && p >= 2 && p <= 36), u = u.toString().replace(/\s+/g, "");
          var x = 0;
          u[0] === "-" && (x++, this.negative = 1), x < u.length && (p === 16 ? this._parseHex(u, x, v) : (this._parseBase(u, p, x), v === "le" && this._initArray(this.toArray(), p, v)))
        }, s.prototype._initNumber = function (u, p, v) {
          u < 0 && (this.negative = 1, u = -u), u < 67108864 ? (this.words = [u & 67108863], this.length = 1) : u < 4503599627370496 ? (this.words = [u & 67108863, u / 67108864 & 67108863], this.length = 2) : (n(u < 9007199254740992), this.words = [u & 67108863, u / 67108864 & 67108863, 1], this.length = 3), v === "le" && this._initArray(this.toArray(), p, v)
        }, s.prototype._initArray = function (u, p, v) {
          if (n(typeof u.length == "number"), u.length <= 0) return this.words = [0], this.length = 1, this;
          this.length = Math.ceil(u.length / 3), this.words = new Array(this.length);
          for (var x = 0; x < this.length; x++) this.words[x] = 0;
          var E, S, _ = 0;
          if (v === "be")
            for (x = u.length - 1, E = 0; x >= 0; x -= 3) S = u[x] | u[x - 1] << 8 | u[x - 2] << 16, this.words[E] |= S << _ & 67108863, this.words[E + 1] = S >>> 26 - _ & 67108863, _ += 24, _ >= 26 && (_ -= 26, E++);
          else if (v === "le")
            for (x = 0, E = 0; x < u.length; x += 3) S = u[x] | u[x + 1] << 8 | u[x + 2] << 16, this.words[E] |= S << _ & 67108863, this.words[E + 1] = S >>> 26 - _ & 67108863, _ += 24, _ >= 26 && (_ -= 26, E++);
          return this._strip()
        };

        function a(g, u) {
          var p = g.charCodeAt(u);
          if (p >= 48 && p <= 57) return p - 48;
          if (p >= 65 && p <= 70) return p - 55;
          if (p >= 97 && p <= 102) return p - 87;
          n(!1, "Invalid character in " + g)
        }

        function c(g, u, p) {
          var v = a(g, p);
          return p - 1 >= u && (v |= a(g, p - 1) << 4), v
        }
        s.prototype._parseHex = function (u, p, v) {
          this.length = Math.ceil((u.length - p) / 6), this.words = new Array(this.length);
          for (var x = 0; x < this.length; x++) this.words[x] = 0;
          var E = 0,
            S = 0,
            _;
          if (v === "be")
            for (x = u.length - 1; x >= p; x -= 2) _ = c(u, p, x) << E, this.words[S] |= _ & 67108863, E >= 18 ? (E -= 18, S += 1, this.words[S] |= _ >>> 26) : E += 8;
          else {
            var y = u.length - p;
            for (x = y % 2 === 0 ? p + 1 : p; x < u.length; x += 2) _ = c(u, p, x) << E, this.words[S] |= _ & 67108863, E >= 18 ? (E -= 18, S += 1, this.words[S] |= _ >>> 26) : E += 8
          }
          this._strip()
        };

        function l(g, u, p, v) {
          for (var x = 0, E = 0, S = Math.min(g.length, p), _ = u; _ < S; _++) {
            var y = g.charCodeAt(_) - 48;
            x *= v, y >= 49 ? E = y - 49 + 10 : y >= 17 ? E = y - 17 + 10 : E = y, n(y >= 0 && E < v, "Invalid character"), x += E
          }
          return x
        }
        s.prototype._parseBase = function (u, p, v) {
          this.words = [0], this.length = 1;
          for (var x = 0, E = 1; E <= 67108863; E *= p) x++;
          x--, E = E / p | 0;
          for (var S = u.length - v, _ = S % x, y = Math.min(S, S - _) + v, A = 0, G = v; G < y; G += x) A = l(u, G, G + x, p), this.imuln(E), this.words[0] + A < 67108864 ? this.words[0] += A : this._iaddn(A);
          if (_ !== 0) {
            var ce = 1;
            for (A = l(u, G, u.length, p), G = 0; G < _; G++) ce *= p;
            this.imuln(ce), this.words[0] + A < 67108864 ? this.words[0] += A : this._iaddn(A)
          }
          this._strip()
        }, s.prototype.copy = function (u) {
          u.words = new Array(this.length);
          for (var p = 0; p < this.length; p++) u.words[p] = this.words[p];
          u.length = this.length, u.negative = this.negative, u.red = this.red
        };

        function h(g, u) {
          g.words = u.words, g.length = u.length, g.negative = u.negative, g.red = u.red
        }
        if (s.prototype._move = function (u) {
            h(u, this)
          }, s.prototype.clone = function () {
            var u = new s(null);
            return this.copy(u), u
          }, s.prototype._expand = function (u) {
            for (; this.length < u;) this.words[this.length++] = 0;
            return this
          }, s.prototype._strip = function () {
            for (; this.length > 1 && this.words[this.length - 1] === 0;) this.length--;
            return this._normSign()
          }, s.prototype._normSign = function () {
            return this.length === 1 && this.words[0] === 0 && (this.negative = 0), this
          }, typeof Symbol < "u" && typeof Symbol.for == "function") try {
          s.prototype[Symbol.for("nodejs.util.inspect.custom")] = f
        } catch {
          s.prototype.inspect = f
        } else s.prototype.inspect = f;

        function f() {
          return (this.red ? "<BN-R: " : "<BN: ") + this.toString(16) + ">"
        }
        var w = ["", "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"],
          b = [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],
          C = [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];
        s.prototype.toString = function (u, p) {
          u = u || 10, p = p | 0 || 1;
          var v;
          if (u === 16 || u === "hex") {
            v = "";
            for (var x = 0, E = 0, S = 0; S < this.length; S++) {
              var _ = this.words[S],
                y = ((_ << x | E) & 16777215).toString(16);
              E = _ >>> 24 - x & 16777215, x += 2, x >= 26 && (x -= 26, S--), E !== 0 || S !== this.length - 1 ? v = w[6 - y.length] + y + v : v = y + v
            }
            for (E !== 0 && (v = E.toString(16) + v); v.length % p !== 0;) v = "0" + v;
            return this.negative !== 0 && (v = "-" + v), v
          }
          if (u === (u | 0) && u >= 2 && u <= 36) {
            var A = b[u],
              G = C[u];
            v = "";
            var ce = this.clone();
            for (ce.negative = 0; !ce.isZero();) {
              var W = ce.modrn(G).toString(u);
              ce = ce.idivn(G), ce.isZero() ? v = W + v : v = w[A - W.length] + W + v
            }
            for (this.isZero() && (v = "0" + v); v.length % p !== 0;) v = "0" + v;
            return this.negative !== 0 && (v = "-" + v), v
          }
          n(!1, "Base should be between 2 and 36")
        }, s.prototype.toNumber = function () {
          var u = this.words[0];
          return this.length === 2 ? u += this.words[1] * 67108864 : this.length === 3 && this.words[2] === 1 ? u += 4503599627370496 + this.words[1] * 67108864 : this.length > 2 && n(!1, "Number can only safely store up to 53 bits"), this.negative !== 0 ? -u : u
        }, s.prototype.toJSON = function () {
          return this.toString(16, 2)
        }, o && (s.prototype.toBuffer = function (u, p) {
          return this.toArrayLike(o, u, p)
        }), s.prototype.toArray = function (u, p) {
          return this.toArrayLike(Array, u, p)
        };
        var M = function (u, p) {
          return u.allocUnsafe ? u.allocUnsafe(p) : new u(p)
        };
        s.prototype.toArrayLike = function (u, p, v) {
          this._strip();
          var x = this.byteLength(),
            E = v || Math.max(1, x);
          n(x <= E, "byte array longer than desired length"), n(E > 0, "Requested array length <= 0");
          var S = M(u, E),
            _ = p === "le" ? "LE" : "BE";
          return this["_toArrayLike" + _](S, x), S
        }, s.prototype._toArrayLikeLE = function (u, p) {
          for (var v = 0, x = 0, E = 0, S = 0; E < this.length; E++) {
            var _ = this.words[E] << S | x;
            u[v++] = _ & 255, v < u.length && (u[v++] = _ >> 8 & 255), v < u.length && (u[v++] = _ >> 16 & 255), S === 6 ? (v < u.length && (u[v++] = _ >> 24 & 255), x = 0, S = 0) : (x = _ >>> 24, S += 2)
          }
          if (v < u.length)
            for (u[v++] = x; v < u.length;) u[v++] = 0
        }, s.prototype._toArrayLikeBE = function (u, p) {
          for (var v = u.length - 1, x = 0, E = 0, S = 0; E < this.length; E++) {
            var _ = this.words[E] << S | x;
            u[v--] = _ & 255, v >= 0 && (u[v--] = _ >> 8 & 255), v >= 0 && (u[v--] = _ >> 16 & 255), S === 6 ? (v >= 0 && (u[v--] = _ >> 24 & 255), x = 0, S = 0) : (x = _ >>> 24, S += 2)
          }
          if (v >= 0)
            for (u[v--] = x; v >= 0;) u[v--] = 0
        }, Math.clz32 ? s.prototype._countBits = function (u) {
          return 32 - Math.clz32(u)
        } : s.prototype._countBits = function (u) {
          var p = u,
            v = 0;
          return p >= 4096 && (v += 13, p >>>= 13), p >= 64 && (v += 7, p >>>= 7), p >= 8 && (v += 4, p >>>= 4), p >= 2 && (v += 2, p >>>= 2), v + p
        }, s.prototype._zeroBits = function (u) {
          if (u === 0) return 26;
          var p = u,
            v = 0;
          return p & 8191 || (v += 13, p >>>= 13), p & 127 || (v += 7, p >>>= 7), p & 15 || (v += 4, p >>>= 4), p & 3 || (v += 2, p >>>= 2), p & 1 || v++, v
        }, s.prototype.bitLength = function () {
          var u = this.words[this.length - 1],
            p = this._countBits(u);
          return (this.length - 1) * 26 + p
        };

        function N(g) {
          for (var u = new Array(g.bitLength()), p = 0; p < u.length; p++) {
            var v = p / 26 | 0,
              x = p % 26;
            u[p] = g.words[v] >>> x & 1
          }
          return u
        }
        s.prototype.zeroBits = function () {
          if (this.isZero()) return 0;
          for (var u = 0, p = 0; p < this.length; p++) {
            var v = this._zeroBits(this.words[p]);
            if (u += v, v !== 26) break
          }
          return u
        }, s.prototype.byteLength = function () {
          return Math.ceil(this.bitLength() / 8)
        }, s.prototype.toTwos = function (u) {
          return this.negative !== 0 ? this.abs().inotn(u).iaddn(1) : this.clone()
        }, s.prototype.fromTwos = function (u) {
          return this.testn(u - 1) ? this.notn(u).iaddn(1).ineg() : this.clone()
        }, s.prototype.isNeg = function () {
          return this.negative !== 0
        }, s.prototype.neg = function () {
          return this.clone().ineg()
        }, s.prototype.ineg = function () {
          return this.isZero() || (this.negative ^= 1), this
        }, s.prototype.iuor = function (u) {
          for (; this.length < u.length;) this.words[this.length++] = 0;
          for (var p = 0; p < u.length; p++) this.words[p] = this.words[p] | u.words[p];
          return this._strip()
        }, s.prototype.ior = function (u) {
          return n((this.negative | u.negative) === 0), this.iuor(u)
        }, s.prototype.or = function (u) {
          return this.length > u.length ? this.clone().ior(u) : u.clone().ior(this)
        }, s.prototype.uor = function (u) {
          return this.length > u.length ? this.clone().iuor(u) : u.clone().iuor(this)
        }, s.prototype.iuand = function (u) {
          var p;
          this.length > u.length ? p = u : p = this;
          for (var v = 0; v < p.length; v++) this.words[v] = this.words[v] & u.words[v];
          return this.length = p.length, this._strip()
        }, s.prototype.iand = function (u) {
          return n((this.negative | u.negative) === 0), this.iuand(u)
        }, s.prototype.and = function (u) {
          return this.length > u.length ? this.clone().iand(u) : u.clone().iand(this)
        }, s.prototype.uand = function (u) {
          return this.length > u.length ? this.clone().iuand(u) : u.clone().iuand(this)
        }, s.prototype.iuxor = function (u) {
          var p, v;
          this.length > u.length ? (p = this, v = u) : (p = u, v = this);
          for (var x = 0; x < v.length; x++) this.words[x] = p.words[x] ^ v.words[x];
          if (this !== p)
            for (; x < p.length; x++) this.words[x] = p.words[x];
          return this.length = p.length, this._strip()
        }, s.prototype.ixor = function (u) {
          return n((this.negative | u.negative) === 0), this.iuxor(u)
        }, s.prototype.xor = function (u) {
          return this.length > u.length ? this.clone().ixor(u) : u.clone().ixor(this)
        }, s.prototype.uxor = function (u) {
          return this.length > u.length ? this.clone().iuxor(u) : u.clone().iuxor(this)
        }, s.prototype.inotn = function (u) {
          n(typeof u == "number" && u >= 0);
          var p = Math.ceil(u / 26) | 0,
            v = u % 26;
          this._expand(p), v > 0 && p--;
          for (var x = 0; x < p; x++) this.words[x] = ~this.words[x] & 67108863;
          return v > 0 && (this.words[x] = ~this.words[x] & 67108863 >> 26 - v), this._strip()
        }, s.prototype.notn = function (u) {
          return this.clone().inotn(u)
        }, s.prototype.setn = function (u, p) {
          n(typeof u == "number" && u >= 0);
          var v = u / 26 | 0,
            x = u % 26;
          return this._expand(v + 1), p ? this.words[v] = this.words[v] | 1 << x : this.words[v] = this.words[v] & ~(1 << x), this._strip()
        }, s.prototype.iadd = function (u) {
          var p;
          if (this.negative !== 0 && u.negative === 0) return this.negative = 0, p = this.isub(u), this.negative ^= 1, this._normSign();
          if (this.negative === 0 && u.negative !== 0) return u.negative = 0, p = this.isub(u), u.negative = 1, p._normSign();
          var v, x;
          this.length > u.length ? (v = this, x = u) : (v = u, x = this);
          for (var E = 0, S = 0; S < x.length; S++) p = (v.words[S] | 0) + (x.words[S] | 0) + E, this.words[S] = p & 67108863, E = p >>> 26;
          for (; E !== 0 && S < v.length; S++) p = (v.words[S] | 0) + E, this.words[S] = p & 67108863, E = p >>> 26;
          if (this.length = v.length, E !== 0) this.words[this.length] = E, this.length++;
          else if (v !== this)
            for (; S < v.length; S++) this.words[S] = v.words[S];
          return this
        }, s.prototype.add = function (u) {
          var p;
          return u.negative !== 0 && this.negative === 0 ? (u.negative = 0, p = this.sub(u), u.negative ^= 1, p) : u.negative === 0 && this.negative !== 0 ? (this.negative = 0, p = u.sub(this), this.negative = 1, p) : this.length > u.length ? this.clone().iadd(u) : u.clone().iadd(this)
        }, s.prototype.isub = function (u) {
          if (u.negative !== 0) {
            u.negative = 0;
            var p = this.iadd(u);
            return u.negative = 1, p._normSign()
          } else if (this.negative !== 0) return this.negative = 0, this.iadd(u), this.negative = 1, this._normSign();
          var v = this.cmp(u);
          if (v === 0) return this.negative = 0, this.length = 1, this.words[0] = 0, this;
          var x, E;
          v > 0 ? (x = this, E = u) : (x = u, E = this);
          for (var S = 0, _ = 0; _ < E.length; _++) p = (x.words[_] | 0) - (E.words[_] | 0) + S, S = p >> 26, this.words[_] = p & 67108863;
          for (; S !== 0 && _ < x.length; _++) p = (x.words[_] | 0) + S, S = p >> 26, this.words[_] = p & 67108863;
          if (S === 0 && _ < x.length && x !== this)
            for (; _ < x.length; _++) this.words[_] = x.words[_];
          return this.length = Math.max(this.length, _), x !== this && (this.negative = 1), this._strip()
        }, s.prototype.sub = function (u) {
          return this.clone().isub(u)
        };

        function $(g, u, p) {
          p.negative = u.negative ^ g.negative;
          var v = g.length + u.length | 0;
          p.length = v, v = v - 1 | 0;
          var x = g.words[0] | 0,
            E = u.words[0] | 0,
            S = x * E,
            _ = S & 67108863,
            y = S / 67108864 | 0;
          p.words[0] = _;
          for (var A = 1; A < v; A++) {
            for (var G = y >>> 26, ce = y & 67108863, W = Math.min(A, u.length - 1), X = Math.max(0, A - g.length + 1); X <= W; X++) {
              var Z = A - X | 0;
              x = g.words[Z] | 0, E = u.words[X] | 0, S = x * E + ce, G += S / 67108864 | 0, ce = S & 67108863
            }
            p.words[A] = ce | 0, y = G | 0
          }
          return y !== 0 ? p.words[A] = y | 0 : p.length--, p._strip()
        }
        var k = function (u, p, v) {
          var x = u.words,
            E = p.words,
            S = v.words,
            _ = 0,
            y, A, G, ce = x[0] | 0,
            W = ce & 8191,
            X = ce >>> 13,
            Z = x[1] | 0,
            ee = Z & 8191,
            ne = Z >>> 13,
            O = x[2] | 0,
            H = O & 8191,
            Q = O >>> 13,
            de = x[3] | 0,
            ge = de & 8191,
            Te = de >>> 13,
            Oe = x[4] | 0,
            De = Oe & 8191,
            et = Oe >>> 13,
            rt = x[5] | 0,
            Ze = rt & 8191,
            qe = rt >>> 13,
            He = x[6] | 0,
            we = He & 8191,
            xe = He >>> 13,
            Ie = x[7] | 0,
            Pe = Ie & 8191,
            J = Ie >>> 13,
            L = x[8] | 0,
            z = L & 8191,
            ie = L >>> 13,
            ue = x[9] | 0,
            me = ue & 8191,
            be = ue >>> 13,
            Le = E[0] | 0,
            ze = Le & 8191,
            Qe = Le >>> 13,
            Xe = E[1] | 0,
            Je = Xe & 8191,
            kt = Xe >>> 13,
            Ut = E[2] | 0,
            Ft = Ut & 8191,
            Wt = Ut >>> 13,
            pt = E[3] | 0,
            ct = pt & 8191,
            gt = pt >>> 13,
            mt = E[4] | 0,
            ht = mt & 8191,
            lt = mt >>> 13,
            xt = E[5] | 0,
            Ct = xt & 8191,
            wt = xt >>> 13,
            Et = E[6] | 0,
            vt = Et & 8191,
            yt = Et >>> 13,
            bt = E[7] | 0,
            st = bt & 8191,
            At = bt >>> 13,
            St = E[8] | 0,
            Gt = St & 8191,
            Zt = St >>> 13,
            Yt = E[9] | 0,
            Pt = Yt & 8191,
            br = Yt >>> 13;
          v.negative = u.negative ^ p.negative, v.length = 19, y = Math.imul(W, ze), A = Math.imul(W, Qe), A = A + Math.imul(X, ze) | 0, G = Math.imul(X, Qe);
          var Nn = (_ + y | 0) + ((A & 8191) << 13) | 0;
          _ = (G + (A >>> 13) | 0) + (Nn >>> 26) | 0, Nn &= 67108863, y = Math.imul(ee, ze), A = Math.imul(ee, Qe), A = A + Math.imul(ne, ze) | 0, G = Math.imul(ne, Qe), y = y + Math.imul(W, Je) | 0, A = A + Math.imul(W, kt) | 0, A = A + Math.imul(X, Je) | 0, G = G + Math.imul(X, kt) | 0;
          var Mn = (_ + y | 0) + ((A & 8191) << 13) | 0;
          _ = (G + (A >>> 13) | 0) + (Mn >>> 26) | 0, Mn &= 67108863, y = Math.imul(H, ze), A = Math.imul(H, Qe), A = A + Math.imul(Q, ze) | 0, G = Math.imul(Q, Qe), y = y + Math.imul(ee, Je) | 0, A = A + Math.imul(ee, kt) | 0, A = A + Math.imul(ne, Je) | 0, G = G + Math.imul(ne, kt) | 0, y = y + Math.imul(W, Ft) | 0, A = A + Math.imul(W, Wt) | 0, A = A + Math.imul(X, Ft) | 0, G = G + Math.imul(X, Wt) | 0;
          var Pn = (_ + y | 0) + ((A & 8191) << 13) | 0;
          _ = (G + (A >>> 13) | 0) + (Pn >>> 26) | 0, Pn &= 67108863, y = Math.imul(ge, ze), A = Math.imul(ge, Qe), A = A + Math.imul(Te, ze) | 0, G = Math.imul(Te, Qe), y = y + Math.imul(H, Je) | 0, A = A + Math.imul(H, kt) | 0, A = A + Math.imul(Q, Je) | 0, G = G + Math.imul(Q, kt) | 0, y = y + Math.imul(ee, Ft) | 0, A = A + Math.imul(ee, Wt) | 0, A = A + Math.imul(ne, Ft) | 0, G = G + Math.imul(ne, Wt) | 0, y = y + Math.imul(W, ct) | 0, A = A + Math.imul(W, gt) | 0, A = A + Math.imul(X, ct) | 0, G = G + Math.imul(X, gt) | 0;
          var $n = (_ + y | 0) + ((A & 8191) << 13) | 0;
          _ = (G + (A >>> 13) | 0) + ($n >>> 26) | 0, $n &= 67108863, y = Math.imul(De, ze), A = Math.imul(De, Qe), A = A + Math.imul(et, ze) | 0, G = Math.imul(et, Qe), y = y + Math.imul(ge, Je) | 0, A = A + Math.imul(ge, kt) | 0, A = A + Math.imul(Te, Je) | 0, G = G + Math.imul(Te, kt) | 0, y = y + Math.imul(H, Ft) | 0, A = A + Math.imul(H, Wt) | 0, A = A + Math.imul(Q, Ft) | 0, G = G + Math.imul(Q, Wt) | 0, y = y + Math.imul(ee, ct) | 0, A = A + Math.imul(ee, gt) | 0, A = A + Math.imul(ne, ct) | 0, G = G + Math.imul(ne, gt) | 0, y = y + Math.imul(W, ht) | 0, A = A + Math.imul(W, lt) | 0, A = A + Math.imul(X, ht) | 0, G = G + Math.imul(X, lt) | 0;
          var tn = (_ + y | 0) + ((A & 8191) << 13) | 0;
          _ = (G + (A >>> 13) | 0) + (tn >>> 26) | 0, tn &= 67108863, y = Math.imul(Ze, ze), A = Math.imul(Ze, Qe), A = A + Math.imul(qe, ze) | 0, G = Math.imul(qe, Qe), y = y + Math.imul(De, Je) | 0, A = A + Math.imul(De, kt) | 0, A = A + Math.imul(et, Je) | 0, G = G + Math.imul(et, kt) | 0, y = y + Math.imul(ge, Ft) | 0, A = A + Math.imul(ge, Wt) | 0, A = A + Math.imul(Te, Ft) | 0, G = G + Math.imul(Te, Wt) | 0, y = y + Math.imul(H, ct) | 0, A = A + Math.imul(H, gt) | 0, A = A + Math.imul(Q, ct) | 0, G = G + Math.imul(Q, gt) | 0, y = y + Math.imul(ee, ht) | 0, A = A + Math.imul(ee, lt) | 0, A = A + Math.imul(ne, ht) | 0, G = G + Math.imul(ne, lt) | 0, y = y + Math.imul(W, Ct) | 0, A = A + Math.imul(W, wt) | 0, A = A + Math.imul(X, Ct) | 0, G = G + Math.imul(X, wt) | 0;
          var Qn = (_ + y | 0) + ((A & 8191) << 13) | 0;
          _ = (G + (A >>> 13) | 0) + (Qn >>> 26) | 0, Qn &= 67108863, y = Math.imul(we, ze), A = Math.imul(we, Qe), A = A + Math.imul(xe, ze) | 0, G = Math.imul(xe, Qe), y = y + Math.imul(Ze, Je) | 0, A = A + Math.imul(Ze, kt) | 0, A = A + Math.imul(qe, Je) | 0, G = G + Math.imul(qe, kt) | 0, y = y + Math.imul(De, Ft) | 0, A = A + Math.imul(De, Wt) | 0, A = A + Math.imul(et, Ft) | 0, G = G + Math.imul(et, Wt) | 0, y = y + Math.imul(ge, ct) | 0, A = A + Math.imul(ge, gt) | 0, A = A + Math.imul(Te, ct) | 0, G = G + Math.imul(Te, gt) | 0, y = y + Math.imul(H, ht) | 0, A = A + Math.imul(H, lt) | 0, A = A + Math.imul(Q, ht) | 0, G = G + Math.imul(Q, lt) | 0, y = y + Math.imul(ee, Ct) | 0, A = A + Math.imul(ee, wt) | 0, A = A + Math.imul(ne, Ct) | 0, G = G + Math.imul(ne, wt) | 0, y = y + Math.imul(W, vt) | 0, A = A + Math.imul(W, yt) | 0, A = A + Math.imul(X, vt) | 0, G = G + Math.imul(X, yt) | 0;
          var Ii = (_ + y | 0) + ((A & 8191) << 13) | 0;
          _ = (G + (A >>> 13) | 0) + (Ii >>> 26) | 0, Ii &= 67108863, y = Math.imul(Pe, ze), A = Math.imul(Pe, Qe), A = A + Math.imul(J, ze) | 0, G = Math.imul(J, Qe), y = y + Math.imul(we, Je) | 0, A = A + Math.imul(we, kt) | 0, A = A + Math.imul(xe, Je) | 0, G = G + Math.imul(xe, kt) | 0, y = y + Math.imul(Ze, Ft) | 0, A = A + Math.imul(Ze, Wt) | 0, A = A + Math.imul(qe, Ft) | 0, G = G + Math.imul(qe, Wt) | 0, y = y + Math.imul(De, ct) | 0, A = A + Math.imul(De, gt) | 0, A = A + Math.imul(et, ct) | 0, G = G + Math.imul(et, gt) | 0, y = y + Math.imul(ge, ht) | 0, A = A + Math.imul(ge, lt) | 0, A = A + Math.imul(Te, ht) | 0, G = G + Math.imul(Te, lt) | 0, y = y + Math.imul(H, Ct) | 0, A = A + Math.imul(H, wt) | 0, A = A + Math.imul(Q, Ct) | 0, G = G + Math.imul(Q, wt) | 0, y = y + Math.imul(ee, vt) | 0, A = A + Math.imul(ee, yt) | 0, A = A + Math.imul(ne, vt) | 0, G = G + Math.imul(ne, yt) | 0, y = y + Math.imul(W, st) | 0, A = A + Math.imul(W, At) | 0, A = A + Math.imul(X, st) | 0, G = G + Math.imul(X, At) | 0;
          var Jn = (_ + y | 0) + ((A & 8191) << 13) | 0;
          _ = (G + (A >>> 13) | 0) + (Jn >>> 26) | 0, Jn &= 67108863, y = Math.imul(z, ze), A = Math.imul(z, Qe), A = A + Math.imul(ie, ze) | 0, G = Math.imul(ie, Qe), y = y + Math.imul(Pe, Je) | 0, A = A + Math.imul(Pe, kt) | 0, A = A + Math.imul(J, Je) | 0, G = G + Math.imul(J, kt) | 0, y = y + Math.imul(we, Ft) | 0, A = A + Math.imul(we, Wt) | 0, A = A + Math.imul(xe, Ft) | 0, G = G + Math.imul(xe, Wt) | 0, y = y + Math.imul(Ze, ct) | 0, A = A + Math.imul(Ze, gt) | 0, A = A + Math.imul(qe, ct) | 0, G = G + Math.imul(qe, gt) | 0, y = y + Math.imul(De, ht) | 0, A = A + Math.imul(De, lt) | 0, A = A + Math.imul(et, ht) | 0, G = G + Math.imul(et, lt) | 0, y = y + Math.imul(ge, Ct) | 0, A = A + Math.imul(ge, wt) | 0, A = A + Math.imul(Te, Ct) | 0, G = G + Math.imul(Te, wt) | 0, y = y + Math.imul(H, vt) | 0, A = A + Math.imul(H, yt) | 0, A = A + Math.imul(Q, vt) | 0, G = G + Math.imul(Q, yt) | 0, y = y + Math.imul(ee, st) | 0, A = A + Math.imul(ee, At) | 0, A = A + Math.imul(ne, st) | 0, G = G + Math.imul(ne, At) | 0, y = y + Math.imul(W, Gt) | 0, A = A + Math.imul(W, Zt) | 0, A = A + Math.imul(X, Gt) | 0, G = G + Math.imul(X, Zt) | 0;
          var Ti = (_ + y | 0) + ((A & 8191) << 13) | 0;
          _ = (G + (A >>> 13) | 0) + (Ti >>> 26) | 0, Ti &= 67108863, y = Math.imul(me, ze), A = Math.imul(me, Qe), A = A + Math.imul(be, ze) | 0, G = Math.imul(be, Qe), y = y + Math.imul(z, Je) | 0, A = A + Math.imul(z, kt) | 0, A = A + Math.imul(ie, Je) | 0, G = G + Math.imul(ie, kt) | 0, y = y + Math.imul(Pe, Ft) | 0, A = A + Math.imul(Pe, Wt) | 0, A = A + Math.imul(J, Ft) | 0, G = G + Math.imul(J, Wt) | 0, y = y + Math.imul(we, ct) | 0, A = A + Math.imul(we, gt) | 0, A = A + Math.imul(xe, ct) | 0, G = G + Math.imul(xe, gt) | 0, y = y + Math.imul(Ze, ht) | 0, A = A + Math.imul(Ze, lt) | 0, A = A + Math.imul(qe, ht) | 0, G = G + Math.imul(qe, lt) | 0, y = y + Math.imul(De, Ct) | 0, A = A + Math.imul(De, wt) | 0, A = A + Math.imul(et, Ct) | 0, G = G + Math.imul(et, wt) | 0, y = y + Math.imul(ge, vt) | 0, A = A + Math.imul(ge, yt) | 0, A = A + Math.imul(Te, vt) | 0, G = G + Math.imul(Te, yt) | 0, y = y + Math.imul(H, st) | 0, A = A + Math.imul(H, At) | 0, A = A + Math.imul(Q, st) | 0, G = G + Math.imul(Q, At) | 0, y = y + Math.imul(ee, Gt) | 0, A = A + Math.imul(ee, Zt) | 0, A = A + Math.imul(ne, Gt) | 0, G = G + Math.imul(ne, Zt) | 0, y = y + Math.imul(W, Pt) | 0, A = A + Math.imul(W, br) | 0, A = A + Math.imul(X, Pt) | 0, G = G + Math.imul(X, br) | 0;
          var ki = (_ + y | 0) + ((A & 8191) << 13) | 0;
          _ = (G + (A >>> 13) | 0) + (ki >>> 26) | 0, ki &= 67108863, y = Math.imul(me, Je), A = Math.imul(me, kt), A = A + Math.imul(be, Je) | 0, G = Math.imul(be, kt), y = y + Math.imul(z, Ft) | 0, A = A + Math.imul(z, Wt) | 0, A = A + Math.imul(ie, Ft) | 0, G = G + Math.imul(ie, Wt) | 0, y = y + Math.imul(Pe, ct) | 0, A = A + Math.imul(Pe, gt) | 0, A = A + Math.imul(J, ct) | 0, G = G + Math.imul(J, gt) | 0, y = y + Math.imul(we, ht) | 0, A = A + Math.imul(we, lt) | 0, A = A + Math.imul(xe, ht) | 0, G = G + Math.imul(xe, lt) | 0, y = y + Math.imul(Ze, Ct) | 0, A = A + Math.imul(Ze, wt) | 0, A = A + Math.imul(qe, Ct) | 0, G = G + Math.imul(qe, wt) | 0, y = y + Math.imul(De, vt) | 0, A = A + Math.imul(De, yt) | 0, A = A + Math.imul(et, vt) | 0, G = G + Math.imul(et, yt) | 0, y = y + Math.imul(ge, st) | 0, A = A + Math.imul(ge, At) | 0, A = A + Math.imul(Te, st) | 0, G = G + Math.imul(Te, At) | 0, y = y + Math.imul(H, Gt) | 0, A = A + Math.imul(H, Zt) | 0, A = A + Math.imul(Q, Gt) | 0, G = G + Math.imul(Q, Zt) | 0, y = y + Math.imul(ee, Pt) | 0, A = A + Math.imul(ee, br) | 0, A = A + Math.imul(ne, Pt) | 0, G = G + Math.imul(ne, br) | 0;
          var Xn = (_ + y | 0) + ((A & 8191) << 13) | 0;
          _ = (G + (A >>> 13) | 0) + (Xn >>> 26) | 0, Xn &= 67108863, y = Math.imul(me, Ft), A = Math.imul(me, Wt), A = A + Math.imul(be, Ft) | 0, G = Math.imul(be, Wt), y = y + Math.imul(z, ct) | 0, A = A + Math.imul(z, gt) | 0, A = A + Math.imul(ie, ct) | 0, G = G + Math.imul(ie, gt) | 0, y = y + Math.imul(Pe, ht) | 0, A = A + Math.imul(Pe, lt) | 0, A = A + Math.imul(J, ht) | 0, G = G + Math.imul(J, lt) | 0, y = y + Math.imul(we, Ct) | 0, A = A + Math.imul(we, wt) | 0, A = A + Math.imul(xe, Ct) | 0, G = G + Math.imul(xe, wt) | 0, y = y + Math.imul(Ze, vt) | 0, A = A + Math.imul(Ze, yt) | 0, A = A + Math.imul(qe, vt) | 0, G = G + Math.imul(qe, yt) | 0, y = y + Math.imul(De, st) | 0, A = A + Math.imul(De, At) | 0, A = A + Math.imul(et, st) | 0, G = G + Math.imul(et, At) | 0, y = y + Math.imul(ge, Gt) | 0, A = A + Math.imul(ge, Zt) | 0, A = A + Math.imul(Te, Gt) | 0, G = G + Math.imul(Te, Zt) | 0, y = y + Math.imul(H, Pt) | 0, A = A + Math.imul(H, br) | 0, A = A + Math.imul(Q, Pt) | 0, G = G + Math.imul(Q, br) | 0;
          var mi = (_ + y | 0) + ((A & 8191) << 13) | 0;
          _ = (G + (A >>> 13) | 0) + (mi >>> 26) | 0, mi &= 67108863, y = Math.imul(me, ct), A = Math.imul(me, gt), A = A + Math.imul(be, ct) | 0, G = Math.imul(be, gt), y = y + Math.imul(z, ht) | 0, A = A + Math.imul(z, lt) | 0, A = A + Math.imul(ie, ht) | 0, G = G + Math.imul(ie, lt) | 0, y = y + Math.imul(Pe, Ct) | 0, A = A + Math.imul(Pe, wt) | 0, A = A + Math.imul(J, Ct) | 0, G = G + Math.imul(J, wt) | 0, y = y + Math.imul(we, vt) | 0, A = A + Math.imul(we, yt) | 0, A = A + Math.imul(xe, vt) | 0, G = G + Math.imul(xe, yt) | 0, y = y + Math.imul(Ze, st) | 0, A = A + Math.imul(Ze, At) | 0, A = A + Math.imul(qe, st) | 0, G = G + Math.imul(qe, At) | 0, y = y + Math.imul(De, Gt) | 0, A = A + Math.imul(De, Zt) | 0, A = A + Math.imul(et, Gt) | 0, G = G + Math.imul(et, Zt) | 0, y = y + Math.imul(ge, Pt) | 0, A = A + Math.imul(ge, br) | 0, A = A + Math.imul(Te, Pt) | 0, G = G + Math.imul(Te, br) | 0;
          var wi = (_ + y | 0) + ((A & 8191) << 13) | 0;
          _ = (G + (A >>> 13) | 0) + (wi >>> 26) | 0, wi &= 67108863, y = Math.imul(me, ht), A = Math.imul(me, lt), A = A + Math.imul(be, ht) | 0, G = Math.imul(be, lt), y = y + Math.imul(z, Ct) | 0, A = A + Math.imul(z, wt) | 0, A = A + Math.imul(ie, Ct) | 0, G = G + Math.imul(ie, wt) | 0, y = y + Math.imul(Pe, vt) | 0, A = A + Math.imul(Pe, yt) | 0, A = A + Math.imul(J, vt) | 0, G = G + Math.imul(J, yt) | 0, y = y + Math.imul(we, st) | 0, A = A + Math.imul(we, At) | 0, A = A + Math.imul(xe, st) | 0, G = G + Math.imul(xe, At) | 0, y = y + Math.imul(Ze, Gt) | 0, A = A + Math.imul(Ze, Zt) | 0, A = A + Math.imul(qe, Gt) | 0, G = G + Math.imul(qe, Zt) | 0, y = y + Math.imul(De, Pt) | 0, A = A + Math.imul(De, br) | 0, A = A + Math.imul(et, Pt) | 0, G = G + Math.imul(et, br) | 0;
          var hn = (_ + y | 0) + ((A & 8191) << 13) | 0;
          _ = (G + (A >>> 13) | 0) + (hn >>> 26) | 0, hn &= 67108863, y = Math.imul(me, Ct), A = Math.imul(me, wt), A = A + Math.imul(be, Ct) | 0, G = Math.imul(be, wt), y = y + Math.imul(z, vt) | 0, A = A + Math.imul(z, yt) | 0, A = A + Math.imul(ie, vt) | 0, G = G + Math.imul(ie, yt) | 0, y = y + Math.imul(Pe, st) | 0, A = A + Math.imul(Pe, At) | 0, A = A + Math.imul(J, st) | 0, G = G + Math.imul(J, At) | 0, y = y + Math.imul(we, Gt) | 0, A = A + Math.imul(we, Zt) | 0, A = A + Math.imul(xe, Gt) | 0, G = G + Math.imul(xe, Zt) | 0, y = y + Math.imul(Ze, Pt) | 0, A = A + Math.imul(Ze, br) | 0, A = A + Math.imul(qe, Pt) | 0, G = G + Math.imul(qe, br) | 0;
          var Vs = (_ + y | 0) + ((A & 8191) << 13) | 0;
          _ = (G + (A >>> 13) | 0) + (Vs >>> 26) | 0, Vs &= 67108863, y = Math.imul(me, vt), A = Math.imul(me, yt), A = A + Math.imul(be, vt) | 0, G = Math.imul(be, yt), y = y + Math.imul(z, st) | 0, A = A + Math.imul(z, At) | 0, A = A + Math.imul(ie, st) | 0, G = G + Math.imul(ie, At) | 0, y = y + Math.imul(Pe, Gt) | 0, A = A + Math.imul(Pe, Zt) | 0, A = A + Math.imul(J, Gt) | 0, G = G + Math.imul(J, Zt) | 0, y = y + Math.imul(we, Pt) | 0, A = A + Math.imul(we, br) | 0, A = A + Math.imul(xe, Pt) | 0, G = G + Math.imul(xe, br) | 0;
          var Ks = (_ + y | 0) + ((A & 8191) << 13) | 0;
          _ = (G + (A >>> 13) | 0) + (Ks >>> 26) | 0, Ks &= 67108863, y = Math.imul(me, st), A = Math.imul(me, At), A = A + Math.imul(be, st) | 0, G = Math.imul(be, At), y = y + Math.imul(z, Gt) | 0, A = A + Math.imul(z, Zt) | 0, A = A + Math.imul(ie, Gt) | 0, G = G + Math.imul(ie, Zt) | 0, y = y + Math.imul(Pe, Pt) | 0, A = A + Math.imul(Pe, br) | 0, A = A + Math.imul(J, Pt) | 0, G = G + Math.imul(J, br) | 0;
          var Gs = (_ + y | 0) + ((A & 8191) << 13) | 0;
          _ = (G + (A >>> 13) | 0) + (Gs >>> 26) | 0, Gs &= 67108863, y = Math.imul(me, Gt), A = Math.imul(me, Zt), A = A + Math.imul(be, Gt) | 0, G = Math.imul(be, Zt), y = y + Math.imul(z, Pt) | 0, A = A + Math.imul(z, br) | 0, A = A + Math.imul(ie, Pt) | 0, G = G + Math.imul(ie, br) | 0;
          var jc = (_ + y | 0) + ((A & 8191) << 13) | 0;
          _ = (G + (A >>> 13) | 0) + (jc >>> 26) | 0, jc &= 67108863, y = Math.imul(me, Pt), A = Math.imul(me, br), A = A + Math.imul(be, Pt) | 0, G = Math.imul(be, br);
          var af = (_ + y | 0) + ((A & 8191) << 13) | 0;
          return _ = (G + (A >>> 13) | 0) + (af >>> 26) | 0, af &= 67108863, S[0] = Nn, S[1] = Mn, S[2] = Pn, S[3] = $n, S[4] = tn, S[5] = Qn, S[6] = Ii, S[7] = Jn, S[8] = Ti, S[9] = ki, S[10] = Xn, S[11] = mi, S[12] = wi, S[13] = hn, S[14] = Vs, S[15] = Ks, S[16] = Gs, S[17] = jc, S[18] = af, _ !== 0 && (S[19] = _, v.length++), v
        };
        Math.imul || (k = $);

        function B(g, u, p) {
          p.negative = u.negative ^ g.negative, p.length = g.length + u.length;
          for (var v = 0, x = 0, E = 0; E < p.length - 1; E++) {
            var S = x;
            x = 0;
            for (var _ = v & 67108863, y = Math.min(E, u.length - 1), A = Math.max(0, E - g.length + 1); A <= y; A++) {
              var G = E - A,
                ce = g.words[G] | 0,
                W = u.words[A] | 0,
                X = ce * W,
                Z = X & 67108863;
              S = S + (X / 67108864 | 0) | 0, Z = Z + _ | 0, _ = Z & 67108863, S = S + (Z >>> 26) | 0, x += S >>> 26, S &= 67108863
            }
            p.words[E] = _, v = S, S = x
          }
          return v !== 0 ? p.words[E] = v : p.length--, p._strip()
        }

        function F(g, u, p) {
          return B(g, u, p)
        }
        s.prototype.mulTo = function (u, p) {
          var v, x = this.length + u.length;
          return this.length === 10 && u.length === 10 ? v = k(this, u, p) : x < 63 ? v = $(this, u, p) : x < 1024 ? v = B(this, u, p) : v = F(this, u, p), v
        }, s.prototype.mul = function (u) {
          var p = new s(null);
          return p.words = new Array(this.length + u.length), this.mulTo(u, p)
        }, s.prototype.mulf = function (u) {
          var p = new s(null);
          return p.words = new Array(this.length + u.length), F(this, u, p)
        }, s.prototype.imul = function (u) {
          return this.clone().mulTo(u, this)
        }, s.prototype.imuln = function (u) {
          var p = u < 0;
          p && (u = -u), n(typeof u == "number"), n(u < 67108864);
          for (var v = 0, x = 0; x < this.length; x++) {
            var E = (this.words[x] | 0) * u,
              S = (E & 67108863) + (v & 67108863);
            v >>= 26, v += E / 67108864 | 0, v += S >>> 26, this.words[x] = S & 67108863
          }
          return v !== 0 && (this.words[x] = v, this.length++), p ? this.ineg() : this
        }, s.prototype.muln = function (u) {
          return this.clone().imuln(u)
        }, s.prototype.sqr = function () {
          return this.mul(this)
        }, s.prototype.isqr = function () {
          return this.imul(this.clone())
        }, s.prototype.pow = function (u) {
          var p = N(u);
          if (p.length === 0) return new s(1);
          for (var v = this, x = 0; x < p.length && p[x] === 0; x++, v = v.sqr());
          if (++x < p.length)
            for (var E = v.sqr(); x < p.length; x++, E = E.sqr()) p[x] !== 0 && (v = v.mul(E));
          return v
        }, s.prototype.iushln = function (u) {
          n(typeof u == "number" && u >= 0);
          var p = u % 26,
            v = (u - p) / 26,
            x = 67108863 >>> 26 - p << 26 - p,
            E;
          if (p !== 0) {
            var S = 0;
            for (E = 0; E < this.length; E++) {
              var _ = this.words[E] & x,
                y = (this.words[E] | 0) - _ << p;
              this.words[E] = y | S, S = _ >>> 26 - p
            }
            S && (this.words[E] = S, this.length++)
          }
          if (v !== 0) {
            for (E = this.length - 1; E >= 0; E--) this.words[E + v] = this.words[E];
            for (E = 0; E < v; E++) this.words[E] = 0;
            this.length += v
          }
          return this._strip()
        }, s.prototype.ishln = function (u) {
          return n(this.negative === 0), this.iushln(u)
        }, s.prototype.iushrn = function (u, p, v) {
          n(typeof u == "number" && u >= 0);
          var x;
          p ? x = (p - p % 26) / 26 : x = 0;
          var E = u % 26,
            S = Math.min((u - E) / 26, this.length),
            _ = 67108863 ^ 67108863 >>> E << E,
            y = v;
          if (x -= S, x = Math.max(0, x), y) {
            for (var A = 0; A < S; A++) y.words[A] = this.words[A];
            y.length = S
          }
          if (S !== 0)
            if (this.length > S)
              for (this.length -= S, A = 0; A < this.length; A++) this.words[A] = this.words[A + S];
            else this.words[0] = 0, this.length = 1;
          var G = 0;
          for (A = this.length - 1; A >= 0 && (G !== 0 || A >= x); A--) {
            var ce = this.words[A] | 0;
            this.words[A] = G << 26 - E | ce >>> E, G = ce & _
          }
          return y && G !== 0 && (y.words[y.length++] = G), this.length === 0 && (this.words[0] = 0, this.length = 1), this._strip()
        }, s.prototype.ishrn = function (u, p, v) {
          return n(this.negative === 0), this.iushrn(u, p, v)
        }, s.prototype.shln = function (u) {
          return this.clone().ishln(u)
        }, s.prototype.ushln = function (u) {
          return this.clone().iushln(u)
        }, s.prototype.shrn = function (u) {
          return this.clone().ishrn(u)
        }, s.prototype.ushrn = function (u) {
          return this.clone().iushrn(u)
        }, s.prototype.testn = function (u) {
          n(typeof u == "number" && u >= 0);
          var p = u % 26,
            v = (u - p) / 26,
            x = 1 << p;
          if (this.length <= v) return !1;
          var E = this.words[v];
          return !!(E & x)
        }, s.prototype.imaskn = function (u) {
          n(typeof u == "number" && u >= 0);
          var p = u % 26,
            v = (u - p) / 26;
          if (n(this.negative === 0, "imaskn works only with positive numbers"), this.length <= v) return this;
          if (p !== 0 && v++, this.length = Math.min(v, this.length), p !== 0) {
            var x = 67108863 ^ 67108863 >>> p << p;
            this.words[this.length - 1] &= x
          }
          return this._strip()
        }, s.prototype.maskn = function (u) {
          return this.clone().imaskn(u)
        }, s.prototype.iaddn = function (u) {
          return n(typeof u == "number"), n(u < 67108864), u < 0 ? this.isubn(-u) : this.negative !== 0 ? this.length === 1 && (this.words[0] | 0) <= u ? (this.words[0] = u - (this.words[0] | 0), this.negative = 0, this) : (this.negative = 0, this.isubn(u), this.negative = 1, this) : this._iaddn(u)
        }, s.prototype._iaddn = function (u) {
          this.words[0] += u;
          for (var p = 0; p < this.length && this.words[p] >= 67108864; p++) this.words[p] -= 67108864, p === this.length - 1 ? this.words[p + 1] = 1 : this.words[p + 1]++;
          return this.length = Math.max(this.length, p + 1), this
        }, s.prototype.isubn = function (u) {
          if (n(typeof u == "number"), n(u < 67108864), u < 0) return this.iaddn(-u);
          if (this.negative !== 0) return this.negative = 0, this.iaddn(u), this.negative = 1, this;
          if (this.words[0] -= u, this.length === 1 && this.words[0] < 0) this.words[0] = -this.words[0], this.negative = 1;
          else
            for (var p = 0; p < this.length && this.words[p] < 0; p++) this.words[p] += 67108864, this.words[p + 1] -= 1;
          return this._strip()
        }, s.prototype.addn = function (u) {
          return this.clone().iaddn(u)
        }, s.prototype.subn = function (u) {
          return this.clone().isubn(u)
        }, s.prototype.iabs = function () {
          return this.negative = 0, this
        }, s.prototype.abs = function () {
          return this.clone().iabs()
        }, s.prototype._ishlnsubmul = function (u, p, v) {
          var x = u.length + v,
            E;
          this._expand(x);
          var S, _ = 0;
          for (E = 0; E < u.length; E++) {
            S = (this.words[E + v] | 0) + _;
            var y = (u.words[E] | 0) * p;
            S -= y & 67108863, _ = (S >> 26) - (y / 67108864 | 0), this.words[E + v] = S & 67108863
          }
          for (; E < this.length - v; E++) S = (this.words[E + v] | 0) + _, _ = S >> 26, this.words[E + v] = S & 67108863;
          if (_ === 0) return this._strip();
          for (n(_ === -1), _ = 0, E = 0; E < this.length; E++) S = -(this.words[E] | 0) + _, _ = S >> 26, this.words[E] = S & 67108863;
          return this.negative = 1, this._strip()
        }, s.prototype._wordDiv = function (u, p) {
          var v = this.length - u.length,
            x = this.clone(),
            E = u,
            S = E.words[E.length - 1] | 0,
            _ = this._countBits(S);
          v = 26 - _, v !== 0 && (E = E.ushln(v), x.iushln(v), S = E.words[E.length - 1] | 0);
          var y = x.length - E.length,
            A;
          if (p !== "mod") {
            A = new s(null), A.length = y + 1, A.words = new Array(A.length);
            for (var G = 0; G < A.length; G++) A.words[G] = 0
          }
          var ce = x.clone()._ishlnsubmul(E, 1, y);
          ce.negative === 0 && (x = ce, A && (A.words[y] = 1));
          for (var W = y - 1; W >= 0; W--) {
            var X = (x.words[E.length + W] | 0) * 67108864 + (x.words[E.length + W - 1] | 0);
            for (X = Math.min(X / S | 0, 67108863), x._ishlnsubmul(E, X, W); x.negative !== 0;) X--, x.negative = 0, x._ishlnsubmul(E, 1, W), x.isZero() || (x.negative ^= 1);
            A && (A.words[W] = X)
          }
          return A && A._strip(), x._strip(), p !== "div" && v !== 0 && x.iushrn(v), {
            div: A || null,
            mod: x
          }
        }, s.prototype.divmod = function (u, p, v) {
          if (n(!u.isZero()), this.isZero()) return {
            div: new s(0),
            mod: new s(0)
          };
          var x, E, S;
          return this.negative !== 0 && u.negative === 0 ? (S = this.neg().divmod(u, p), p !== "mod" && (x = S.div.neg()), p !== "div" && (E = S.mod.neg(), v && E.negative !== 0 && E.iadd(u)), {
            div: x,
            mod: E
          }) : this.negative === 0 && u.negative !== 0 ? (S = this.divmod(u.neg(), p), p !== "mod" && (x = S.div.neg()), {
            div: x,
            mod: S.mod
          }) : this.negative & u.negative ? (S = this.neg().divmod(u.neg(), p), p !== "div" && (E = S.mod.neg(), v && E.negative !== 0 && E.isub(u)), {
            div: S.div,
            mod: E
          }) : u.length > this.length || this.cmp(u) < 0 ? {
            div: new s(0),
            mod: this
          } : u.length === 1 ? p === "div" ? {
            div: this.divn(u.words[0]),
            mod: null
          } : p === "mod" ? {
            div: null,
            mod: new s(this.modrn(u.words[0]))
          } : {
            div: this.divn(u.words[0]),
            mod: new s(this.modrn(u.words[0]))
          } : this._wordDiv(u, p)
        }, s.prototype.div = function (u) {
          return this.divmod(u, "div", !1).div
        }, s.prototype.mod = function (u) {
          return this.divmod(u, "mod", !1).mod
        }, s.prototype.umod = function (u) {
          return this.divmod(u, "mod", !0).mod
        }, s.prototype.divRound = function (u) {
          var p = this.divmod(u);
          if (p.mod.isZero()) return p.div;
          var v = p.div.negative !== 0 ? p.mod.isub(u) : p.mod,
            x = u.ushrn(1),
            E = u.andln(1),
            S = v.cmp(x);
          return S < 0 || E === 1 && S === 0 ? p.div : p.div.negative !== 0 ? p.div.isubn(1) : p.div.iaddn(1)
        }, s.prototype.modrn = function (u) {
          var p = u < 0;
          p && (u = -u), n(u <= 67108863);
          for (var v = (1 << 26) % u, x = 0, E = this.length - 1; E >= 0; E--) x = (v * x + (this.words[E] | 0)) % u;
          return p ? -x : x
        }, s.prototype.modn = function (u) {
          return this.modrn(u)
        }, s.prototype.idivn = function (u) {
          var p = u < 0;
          p && (u = -u), n(u <= 67108863);
          for (var v = 0, x = this.length - 1; x >= 0; x--) {
            var E = (this.words[x] | 0) + v * 67108864;
            this.words[x] = E / u | 0, v = E % u
          }
          return this._strip(), p ? this.ineg() : this
        }, s.prototype.divn = function (u) {
          return this.clone().idivn(u)
        }, s.prototype.egcd = function (u) {
          n(u.negative === 0), n(!u.isZero());
          var p = this,
            v = u.clone();
          p.negative !== 0 ? p = p.umod(u) : p = p.clone();
          for (var x = new s(1), E = new s(0), S = new s(0), _ = new s(1), y = 0; p.isEven() && v.isEven();) p.iushrn(1), v.iushrn(1), ++y;
          for (var A = v.clone(), G = p.clone(); !p.isZero();) {
            for (var ce = 0, W = 1; !(p.words[0] & W) && ce < 26; ++ce, W <<= 1);
            if (ce > 0)
              for (p.iushrn(ce); ce-- > 0;)(x.isOdd() || E.isOdd()) && (x.iadd(A), E.isub(G)), x.iushrn(1), E.iushrn(1);
            for (var X = 0, Z = 1; !(v.words[0] & Z) && X < 26; ++X, Z <<= 1);
            if (X > 0)
              for (v.iushrn(X); X-- > 0;)(S.isOdd() || _.isOdd()) && (S.iadd(A), _.isub(G)), S.iushrn(1), _.iushrn(1);
            p.cmp(v) >= 0 ? (p.isub(v), x.isub(S), E.isub(_)) : (v.isub(p), S.isub(x), _.isub(E))
          }
          return {
            a: S,
            b: _,
            gcd: v.iushln(y)
          }
        }, s.prototype._invmp = function (u) {
          n(u.negative === 0), n(!u.isZero());
          var p = this,
            v = u.clone();
          p.negative !== 0 ? p = p.umod(u) : p = p.clone();
          for (var x = new s(1), E = new s(0), S = v.clone(); p.cmpn(1) > 0 && v.cmpn(1) > 0;) {
            for (var _ = 0, y = 1; !(p.words[0] & y) && _ < 26; ++_, y <<= 1);
            if (_ > 0)
              for (p.iushrn(_); _-- > 0;) x.isOdd() && x.iadd(S), x.iushrn(1);
            for (var A = 0, G = 1; !(v.words[0] & G) && A < 26; ++A, G <<= 1);
            if (A > 0)
              for (v.iushrn(A); A-- > 0;) E.isOdd() && E.iadd(S), E.iushrn(1);
            p.cmp(v) >= 0 ? (p.isub(v), x.isub(E)) : (v.isub(p), E.isub(x))
          }
          var ce;
          return p.cmpn(1) === 0 ? ce = x : ce = E, ce.cmpn(0) < 0 && ce.iadd(u), ce
        }, s.prototype.gcd = function (u) {
          if (this.isZero()) return u.abs();
          if (u.isZero()) return this.abs();
          var p = this.clone(),
            v = u.clone();
          p.negative = 0, v.negative = 0;
          for (var x = 0; p.isEven() && v.isEven(); x++) p.iushrn(1), v.iushrn(1);
          do {
            for (; p.isEven();) p.iushrn(1);
            for (; v.isEven();) v.iushrn(1);
            var E = p.cmp(v);
            if (E < 0) {
              var S = p;
              p = v, v = S
            } else if (E === 0 || v.cmpn(1) === 0) break;
            p.isub(v)
          } while (!0);
          return v.iushln(x)
        }, s.prototype.invm = function (u) {
          return this.egcd(u).a.umod(u)
        }, s.prototype.isEven = function () {
          return (this.words[0] & 1) === 0
        }, s.prototype.isOdd = function () {
          return (this.words[0] & 1) === 1
        }, s.prototype.andln = function (u) {
          return this.words[0] & u
        }, s.prototype.bincn = function (u) {
          n(typeof u == "number");
          var p = u % 26,
            v = (u - p) / 26,
            x = 1 << p;
          if (this.length <= v) return this._expand(v + 1), this.words[v] |= x, this;
          for (var E = x, S = v; E !== 0 && S < this.length; S++) {
            var _ = this.words[S] | 0;
            _ += E, E = _ >>> 26, _ &= 67108863, this.words[S] = _
          }
          return E !== 0 && (this.words[S] = E, this.length++), this
        }, s.prototype.isZero = function () {
          return this.length === 1 && this.words[0] === 0
        }, s.prototype.cmpn = function (u) {
          var p = u < 0;
          if (this.negative !== 0 && !p) return -1;
          if (this.negative === 0 && p) return 1;
          this._strip();
          var v;
          if (this.length > 1) v = 1;
          else {
            p && (u = -u), n(u <= 67108863, "Number is too big");
            var x = this.words[0] | 0;
            v = x === u ? 0 : x < u ? -1 : 1
          }
          return this.negative !== 0 ? -v | 0 : v
        }, s.prototype.cmp = function (u) {
          if (this.negative !== 0 && u.negative === 0) return -1;
          if (this.negative === 0 && u.negative !== 0) return 1;
          var p = this.ucmp(u);
          return this.negative !== 0 ? -p | 0 : p
        }, s.prototype.ucmp = function (u) {
          if (this.length > u.length) return 1;
          if (this.length < u.length) return -1;
          for (var p = 0, v = this.length - 1; v >= 0; v--) {
            var x = this.words[v] | 0,
              E = u.words[v] | 0;
            if (x !== E) {
              x < E ? p = -1 : x > E && (p = 1);
              break
            }
          }
          return p
        }, s.prototype.gtn = function (u) {
          return this.cmpn(u) === 1
        }, s.prototype.gt = function (u) {
          return this.cmp(u) === 1
        }, s.prototype.gten = function (u) {
          return this.cmpn(u) >= 0
        }, s.prototype.gte = function (u) {
          return this.cmp(u) >= 0
        }, s.prototype.ltn = function (u) {
          return this.cmpn(u) === -1
        }, s.prototype.lt = function (u) {
          return this.cmp(u) === -1
        }, s.prototype.lten = function (u) {
          return this.cmpn(u) <= 0
        }, s.prototype.lte = function (u) {
          return this.cmp(u) <= 0
        }, s.prototype.eqn = function (u) {
          return this.cmpn(u) === 0
        }, s.prototype.eq = function (u) {
          return this.cmp(u) === 0
        }, s.red = function (u) {
          return new U(u)
        }, s.prototype.toRed = function (u) {
          return n(!this.red, "Already a number in reduction context"), n(this.negative === 0, "red works only with positives"), u.convertTo(this)._forceRed(u)
        }, s.prototype.fromRed = function () {
          return n(this.red, "fromRed works only with numbers in reduction context"), this.red.convertFrom(this)
        }, s.prototype._forceRed = function (u) {
          return this.red = u, this
        }, s.prototype.forceRed = function (u) {
          return n(!this.red, "Already a number in reduction context"), this._forceRed(u)
        }, s.prototype.redAdd = function (u) {
          return n(this.red, "redAdd works only with red numbers"), this.red.add(this, u)
        }, s.prototype.redIAdd = function (u) {
          return n(this.red, "redIAdd works only with red numbers"), this.red.iadd(this, u)
        }, s.prototype.redSub = function (u) {
          return n(this.red, "redSub works only with red numbers"), this.red.sub(this, u)
        }, s.prototype.redISub = function (u) {
          return n(this.red, "redISub works only with red numbers"), this.red.isub(this, u)
        }, s.prototype.redShl = function (u) {
          return n(this.red, "redShl works only with red numbers"), this.red.shl(this, u)
        }, s.prototype.redMul = function (u) {
          return n(this.red, "redMul works only with red numbers"), this.red._verify2(this, u), this.red.mul(this, u)
        }, s.prototype.redIMul = function (u) {
          return n(this.red, "redMul works only with red numbers"), this.red._verify2(this, u), this.red.imul(this, u)
        }, s.prototype.redSqr = function () {
          return n(this.red, "redSqr works only with red numbers"), this.red._verify1(this), this.red.sqr(this)
        }, s.prototype.redISqr = function () {
          return n(this.red, "redISqr works only with red numbers"), this.red._verify1(this), this.red.isqr(this)
        }, s.prototype.redSqrt = function () {
          return n(this.red, "redSqrt works only with red numbers"), this.red._verify1(this), this.red.sqrt(this)
        }, s.prototype.redInvm = function () {
          return n(this.red, "redInvm works only with red numbers"), this.red._verify1(this), this.red.invm(this)
        }, s.prototype.redNeg = function () {
          return n(this.red, "redNeg works only with red numbers"), this.red._verify1(this), this.red.neg(this)
        }, s.prototype.redPow = function (u) {
          return n(this.red && !u.red, "redPow(normalNum)"), this.red._verify1(this), this.red.pow(this, u)
        };
        var D = {
          k256: null,
          p224: null,
          p192: null,
          p25519: null
        };

        function V(g, u) {
          this.name = g, this.p = new s(u, 16), this.n = this.p.bitLength(), this.k = new s(1).iushln(this.n).isub(this.p), this.tmp = this._tmp()
        }
        V.prototype._tmp = function () {
          var u = new s(null);
          return u.words = new Array(Math.ceil(this.n / 13)), u
        }, V.prototype.ireduce = function (u) {
          var p = u,
            v;
          do this.split(p, this.tmp), p = this.imulK(p), p = p.iadd(this.tmp), v = p.bitLength(); while (v > this.n);
          var x = v < this.n ? -1 : p.ucmp(this.p);
          return x === 0 ? (p.words[0] = 0, p.length = 1) : x > 0 ? p.isub(this.p) : p.strip !== void 0 ? p.strip() : p._strip(), p
        }, V.prototype.split = function (u, p) {
          u.iushrn(this.n, 0, p)
        }, V.prototype.imulK = function (u) {
          return u.imul(this.k)
        };

        function R() {
          V.call(this, "k256", "ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")
        }
        i(R, V), R.prototype.split = function (u, p) {
          for (var v = 4194303, x = Math.min(u.length, 9), E = 0; E < x; E++) p.words[E] = u.words[E];
          if (p.length = x, u.length <= 9) {
            u.words[0] = 0, u.length = 1;
            return
          }
          var S = u.words[9];
          for (p.words[p.length++] = S & v, E = 10; E < u.length; E++) {
            var _ = u.words[E] | 0;
            u.words[E - 10] = (_ & v) << 4 | S >>> 22, S = _
          }
          S >>>= 22, u.words[E - 10] = S, S === 0 && u.length > 10 ? u.length -= 10 : u.length -= 9
        }, R.prototype.imulK = function (u) {
          u.words[u.length] = 0, u.words[u.length + 1] = 0, u.length += 2;
          for (var p = 0, v = 0; v < u.length; v++) {
            var x = u.words[v] | 0;
            p += x * 977, u.words[v] = p & 67108863, p = x * 64 + (p / 67108864 | 0)
          }
          return u.words[u.length - 1] === 0 && (u.length--, u.words[u.length - 1] === 0 && u.length--), u
        };

        function P() {
          V.call(this, "p224", "ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")
        }
        i(P, V);

        function j() {
          V.call(this, "p192", "ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")
        }
        i(j, V);

        function Y() {
          V.call(this, "25519", "7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")
        }
        i(Y, V), Y.prototype.imulK = function (u) {
          for (var p = 0, v = 0; v < u.length; v++) {
            var x = (u.words[v] | 0) * 19 + p,
              E = x & 67108863;
            x >>>= 26, u.words[v] = E, p = x
          }
          return p !== 0 && (u.words[u.length++] = p), u
        }, s._prime = function (u) {
          if (D[u]) return D[u];
          var p;
          if (u === "k256") p = new R;
          else if (u === "p224") p = new P;
          else if (u === "p192") p = new j;
          else if (u === "p25519") p = new Y;
          else throw new Error("Unknown prime " + u);
          return D[u] = p, p
        };

        function U(g) {
          if (typeof g == "string") {
            var u = s._prime(g);
            this.m = u.p, this.prime = u
          } else n(g.gtn(1), "modulus must be greater than 1"), this.m = g, this.prime = null
        }
        U.prototype._verify1 = function (u) {
          n(u.negative === 0, "red works only with positives"), n(u.red, "red works only with red numbers")
        }, U.prototype._verify2 = function (u, p) {
          n((u.negative | p.negative) === 0, "red works only with positives"), n(u.red && u.red === p.red, "red works only with red numbers")
        }, U.prototype.imod = function (u) {
          return this.prime ? this.prime.ireduce(u)._forceRed(this) : (h(u, u.umod(this.m)._forceRed(this)), u)
        }, U.prototype.neg = function (u) {
          return u.isZero() ? u.clone() : this.m.sub(u)._forceRed(this)
        }, U.prototype.add = function (u, p) {
          this._verify2(u, p);
          var v = u.add(p);
          return v.cmp(this.m) >= 0 && v.isub(this.m), v._forceRed(this)
        }, U.prototype.iadd = function (u, p) {
          this._verify2(u, p);
          var v = u.iadd(p);
          return v.cmp(this.m) >= 0 && v.isub(this.m), v
        }, U.prototype.sub = function (u, p) {
          this._verify2(u, p);
          var v = u.sub(p);
          return v.cmpn(0) < 0 && v.iadd(this.m), v._forceRed(this)
        }, U.prototype.isub = function (u, p) {
          this._verify2(u, p);
          var v = u.isub(p);
          return v.cmpn(0) < 0 && v.iadd(this.m), v
        }, U.prototype.shl = function (u, p) {
          return this._verify1(u), this.imod(u.ushln(p))
        }, U.prototype.imul = function (u, p) {
          return this._verify2(u, p), this.imod(u.imul(p))
        }, U.prototype.mul = function (u, p) {
          return this._verify2(u, p), this.imod(u.mul(p))
        }, U.prototype.isqr = function (u) {
          return this.imul(u, u.clone())
        }, U.prototype.sqr = function (u) {
          return this.mul(u, u)
        }, U.prototype.sqrt = function (u) {
          if (u.isZero()) return u.clone();
          var p = this.m.andln(3);
          if (n(p % 2 === 1), p === 3) {
            var v = this.m.add(new s(1)).iushrn(2);
            return this.pow(u, v)
          }
          for (var x = this.m.subn(1), E = 0; !x.isZero() && x.andln(1) === 0;) E++, x.iushrn(1);
          n(!x.isZero());
          var S = new s(1).toRed(this),
            _ = S.redNeg(),
            y = this.m.subn(1).iushrn(1),
            A = this.m.bitLength();
          for (A = new s(2 * A * A).toRed(this); this.pow(A, y).cmp(_) !== 0;) A.redIAdd(_);
          for (var G = this.pow(A, x), ce = this.pow(u, x.addn(1).iushrn(1)), W = this.pow(u, x), X = E; W.cmp(S) !== 0;) {
            for (var Z = W, ee = 0; Z.cmp(S) !== 0; ee++) Z = Z.redSqr();
            n(ee < X);
            var ne = this.pow(G, new s(1).iushln(X - ee - 1));
            ce = ce.redMul(ne), G = ne.redSqr(), W = W.redMul(G), X = ee
          }
          return ce
        }, U.prototype.invm = function (u) {
          var p = u._invmp(this.m);
          return p.negative !== 0 ? (p.negative = 0, this.imod(p).redNeg()) : this.imod(p)
        }, U.prototype.pow = function (u, p) {
          if (p.isZero()) return new s(1).toRed(this);
          if (p.cmpn(1) === 0) return u.clone();
          var v = 4,
            x = new Array(1 << v);
          x[0] = new s(1).toRed(this), x[1] = u;
          for (var E = 2; E < x.length; E++) x[E] = this.mul(x[E - 1], u);
          var S = x[0],
            _ = 0,
            y = 0,
            A = p.bitLength() % 26;
          for (A === 0 && (A = 26), E = p.length - 1; E >= 0; E--) {
            for (var G = p.words[E], ce = A - 1; ce >= 0; ce--) {
              var W = G >> ce & 1;
              if (S !== x[0] && (S = this.sqr(S)), W === 0 && _ === 0) {
                y = 0;
                continue
              }
              _ <<= 1, _ |= W, y++, !(y !== v && (E !== 0 || ce !== 0)) && (S = this.mul(S, x[_]), y = 0, _ = 0)
            }
            A = 26
          }
          return S
        }, U.prototype.convertTo = function (u) {
          var p = u.umod(this.m);
          return p === u ? p.clone() : p
        }, U.prototype.convertFrom = function (u) {
          var p = u.clone();
          return p.red = null, p
        }, s.mont = function (u) {
          return new I(u)
        };

        function I(g) {
          U.call(this, g), this.shift = this.m.bitLength(), this.shift % 26 !== 0 && (this.shift += 26 - this.shift % 26), this.r = new s(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)
        }
        i(I, U), I.prototype.convertTo = function (u) {
          return this.imod(u.ushln(this.shift))
        }, I.prototype.convertFrom = function (u) {
          var p = this.imod(u.mul(this.rinv));
          return p.red = null, p
        }, I.prototype.imul = function (u, p) {
          if (u.isZero() || p.isZero()) return u.words[0] = 0, u.length = 1, u;
          var v = u.imul(p),
            x = v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),
            E = v.isub(x).iushrn(this.shift),
            S = E;
          return E.cmp(this.m) >= 0 ? S = E.isub(this.m) : E.cmpn(0) < 0 && (S = E.iadd(this.m)), S._forceRed(this)
        }, I.prototype.mul = function (u, p) {
          if (u.isZero() || p.isZero()) return new s(0)._forceRed(this);
          var v = u.mul(p),
            x = v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),
            E = v.isub(x).iushrn(this.shift),
            S = E;
          return E.cmp(this.m) >= 0 ? S = E.isub(this.m) : E.cmpn(0) < 0 && (S = E.iadd(this.m)), S._forceRed(this)
        }, I.prototype.invm = function (u) {
          var p = this.imod(u._invmp(this.m).mul(this.r2));
          return p._forceRed(this)
        }
      })(t, ot)
    }(rS);
  var E6 = rS.exports,
    vb = {},
    gd = {};
  Object.defineProperty(gd, "__esModule", {
    value: !0
  }), gd.errorValues = gd.standardErrorCodes = void 0, gd.standardErrorCodes = {
    rpc: {
      invalidInput: -32e3,
      resourceNotFound: -32001,
      resourceUnavailable: -32002,
      transactionRejected: -32003,
      methodNotSupported: -32004,
      limitExceeded: -32005,
      parse: -32700,
      invalidRequest: -32600,
      methodNotFound: -32601,
      invalidParams: -32602,
      internal: -32603
    },
    provider: {
      userRejectedRequest: 4001,
      unauthorized: 4100,
      unsupportedMethod: 4200,
      disconnected: 4900,
      chainDisconnected: 4901,
      unsupportedChain: 4902
    }
  }, gd.errorValues = {
    "-32700": {
      standard: "JSON RPC 2.0",
      message: "Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."
    },
    "-32600": {
      standard: "JSON RPC 2.0",
      message: "The JSON sent is not a valid Request object."
    },
    "-32601": {
      standard: "JSON RPC 2.0",
      message: "The method does not exist / is not available."
    },
    "-32602": {
      standard: "JSON RPC 2.0",
      message: "Invalid method parameter(s)."
    },
    "-32603": {
      standard: "JSON RPC 2.0",
      message: "Internal JSON-RPC error."
    },
    "-32000": {
      standard: "EIP-1474",
      message: "Invalid input."
    },
    "-32001": {
      standard: "EIP-1474",
      message: "Resource not found."
    },
    "-32002": {
      standard: "EIP-1474",
      message: "Resource unavailable."
    },
    "-32003": {
      standard: "EIP-1474",
      message: "Transaction rejected."
    },
    "-32004": {
      standard: "EIP-1474",
      message: "Method not supported."
    },
    "-32005": {
      standard: "EIP-1474",
      message: "Request limit exceeded."
    },
    4001: {
      standard: "EIP-1193",
      message: "User rejected the request."
    },
    4100: {
      standard: "EIP-1193",
      message: "The requested account and/or method has not been authorized by the user."
    },
    4200: {
      standard: "EIP-1193",
      message: "The requested method is not supported by this Ethereum provider."
    },
    4900: {
      standard: "EIP-1193",
      message: "The provider is disconnected from all chains."
    },
    4901: {
      standard: "EIP-1193",
      message: "The provider is disconnected from the specified chain."
    },
    4902: {
      standard: "EIP-3085",
      message: "Unrecognized chain ID."
    }
  };
  var A6 = {},
    S6 = {};
  (function (t) {
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.serialize = t.getErrorCode = t.isValidCode = t.getMessageFromCode = t.JSON_RPC_SERVER_ERROR_MESSAGE = void 0;
    const e = gd,
      r = "Unspecified error message.";
    t.JSON_RPC_SERVER_ERROR_MESSAGE = "Unspecified server error.";

    function n(w, b = r) {
      if (w && Number.isInteger(w)) {
        const C = w.toString();
        if (h(e.errorValues, C)) return e.errorValues[C].message;
        if (c(w)) return t.JSON_RPC_SERVER_ERROR_MESSAGE
      }
      return b
    }
    t.getMessageFromCode = n;

    function i(w) {
      if (!Number.isInteger(w)) return !1;
      const b = w.toString();
      return !!(e.errorValues[b] || c(w))
    }
    t.isValidCode = i;

    function s(w) {
      var b;
      if (typeof w == "number") return w;
      if (o(w)) return (b = w.code) !== null && b !== void 0 ? b : w.errorCode
    }
    t.getErrorCode = s;

    function o(w) {
      return typeof w == "object" && w !== null && (typeof w.code == "number" || typeof w.errorCode == "number")
    }

    function a(w, {
      shouldIncludeStack: b = !1
    } = {}) {
      const C = {};
      if (w && typeof w == "object" && !Array.isArray(w) && h(w, "code") && i(w.code)) {
        const M = w;
        C.code = M.code, M.message && typeof M.message == "string" ? (C.message = M.message, h(M, "data") && (C.data = M.data)) : (C.message = n(C.code), C.data = {
          originalError: l(w)
        })
      } else C.code = e.standardErrorCodes.rpc.internal, C.message = f(w, "message") ? w.message : r, C.data = {
        originalError: l(w)
      };
      return b && (C.stack = f(w, "stack") ? w.stack : void 0), C
    }
    t.serialize = a;

    function c(w) {
      return w >= -32099 && w <= -32e3
    }

    function l(w) {
      return w && typeof w == "object" && !Array.isArray(w) ? Object.assign({}, w) : w
    }

    function h(w, b) {
      return Object.prototype.hasOwnProperty.call(w, b)
    }

    function f(w, b) {
      return typeof w == "object" && w !== null && b in w && typeof w[b] == "string"
    }
  })(S6), Object.defineProperty(A6, "__esModule", {
    value: !0
  }), A6.standardErrors = void 0;
  const us = gd,
    IW = S6;
  A6.standardErrors = {
    rpc: {
      parse: t => Pa(us.standardErrorCodes.rpc.parse, t),
      invalidRequest: t => Pa(us.standardErrorCodes.rpc.invalidRequest, t),
      invalidParams: t => Pa(us.standardErrorCodes.rpc.invalidParams, t),
      methodNotFound: t => Pa(us.standardErrorCodes.rpc.methodNotFound, t),
      internal: t => Pa(us.standardErrorCodes.rpc.internal, t),
      server: t => {
        if (!t || typeof t != "object" || Array.isArray(t)) throw new Error("Ethereum RPC Server errors must provide single object argument.");
        const {
          code: e
        } = t;
        if (!Number.isInteger(e) || e > -32005 || e < -32099) throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');
        return Pa(e, t)
      },
      invalidInput: t => Pa(us.standardErrorCodes.rpc.invalidInput, t),
      resourceNotFound: t => Pa(us.standardErrorCodes.rpc.resourceNotFound, t),
      resourceUnavailable: t => Pa(us.standardErrorCodes.rpc.resourceUnavailable, t),
      transactionRejected: t => Pa(us.standardErrorCodes.rpc.transactionRejected, t),
      methodNotSupported: t => Pa(us.standardErrorCodes.rpc.methodNotSupported, t),
      limitExceeded: t => Pa(us.standardErrorCodes.rpc.limitExceeded, t)
    },
    provider: {
      userRejectedRequest: t => Gg(us.standardErrorCodes.provider.userRejectedRequest, t),
      unauthorized: t => Gg(us.standardErrorCodes.provider.unauthorized, t),
      unsupportedMethod: t => Gg(us.standardErrorCodes.provider.unsupportedMethod, t),
      disconnected: t => Gg(us.standardErrorCodes.provider.disconnected, t),
      chainDisconnected: t => Gg(us.standardErrorCodes.provider.chainDisconnected, t),
      unsupportedChain: t => Gg(us.standardErrorCodes.provider.unsupportedChain, t),
      custom: t => {
        if (!t || typeof t != "object" || Array.isArray(t)) throw new Error("Ethereum Provider custom errors must provide single object argument.");
        const {
          code: e,
          message: r,
          data: n
        } = t;
        if (!r || typeof r != "string") throw new Error('"message" must be a nonempty string');
        return new RW(e, r, n)
      }
    }
  };

  function Pa(t, e) {
    const [r, n] = TW(e);
    return new kW(t, r || (0, IW.getMessageFromCode)(t), n)
  }

  function Gg(t, e) {
    const [r, n] = TW(e);
    return new RW(t, r || (0, IW.getMessageFromCode)(t), n)
  }

  function TW(t) {
    if (t) {
      if (typeof t == "string") return [t];
      if (typeof t == "object" && !Array.isArray(t)) {
        const {
          message: e,
          data: r
        } = t;
        if (e && typeof e != "string") throw new Error("Must specify string message.");
        return [e || void 0, r]
      }
    }
    return []
  }
  let kW = class extends Error {
      constructor(e, r, n) {
        if (!Number.isInteger(e)) throw new Error('"code" must be an integer.');
        if (!r || typeof r != "string") throw new Error('"message" must be a nonempty string.');
        super(r), this.code = e, n !== void 0 && (this.data = n)
      }
    },
    RW = class extends kW {
      constructor(e, r, n) {
        if (!Y7e(e)) throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');
        super(e, r, n)
      }
    };

  function Y7e(t) {
    return Number.isInteger(t) && t >= 1e3 && t <= 4999
  }
  var I6 = {},
    Zg = {};
  Object.defineProperty(Zg, "__esModule", {
    value: !0
  }), Zg.isErrorResponse = void 0;

  function Q7e(t) {
    return t.errorMessage !== void 0
  }
  Zg.isErrorResponse = Q7e;
  var Yg = {};
  Object.defineProperty(Yg, "__esModule", {
    value: !0
  }), Yg.LIB_VERSION = void 0, Yg.LIB_VERSION = "3.9.3", Object.defineProperty(I6, "__esModule", {
    value: !0
  }), I6.serializeError = void 0;
  const J7e = Zg,
    X7e = Yg,
    e9e = gd,
    t9e = S6;

  function r9e(t, e) {
    const r = (0, t9e.serialize)(n9e(t), {
        shouldIncludeStack: !0
      }),
      n = new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");
    n.searchParams.set("version", X7e.LIB_VERSION), n.searchParams.set("code", r.code.toString());
    const i = i9e(r.data, e);
    return i && n.searchParams.set("method", i), n.searchParams.set("message", r.message), Object.assign(Object.assign({}, r), {
      docUrl: n.href
    })
  }
  I6.serializeError = r9e;

  function n9e(t) {
    return typeof t == "string" ? {
      message: t,
      code: e9e.standardErrorCodes.rpc.internal
    } : (0, J7e.isErrorResponse)(t) ? Object.assign(Object.assign({}, t), {
      message: t.errorMessage,
      code: t.errorCode,
      data: {
        method: t.method
      }
    }) : t
  }

  function i9e(t, e) {
    const r = t?.method;
    if (r) return r;
    if (e !== void 0) {
      if (typeof e == "string") return e;
      if (Array.isArray(e)) {
        if (e.length > 0) return e[0].method
      } else return e.method
    }
  }(function (t) {
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.standardErrors = t.standardErrorCodes = t.serializeError = t.getMessageFromCode = t.getErrorCode = void 0;
    const e = gd;
    Object.defineProperty(t, "standardErrorCodes", {
      enumerable: !0,
      get: function () {
        return e.standardErrorCodes
      }
    });
    const r = A6;
    Object.defineProperty(t, "standardErrors", {
      enumerable: !0,
      get: function () {
        return r.standardErrors
      }
    });
    const n = I6;
    Object.defineProperty(t, "serializeError", {
      enumerable: !0,
      get: function () {
        return n.serializeError
      }
    });
    const i = S6;
    Object.defineProperty(t, "getErrorCode", {
      enumerable: !0,
      get: function () {
        return i.getErrorCode
      }
    }), Object.defineProperty(t, "getMessageFromCode", {
      enumerable: !0,
      get: function () {
        return i.getMessageFromCode
      }
    })
  })(vb);
  var Ei = {};
  Object.defineProperty(Ei, "__esModule", {
    value: !0
  }), Ei.ProviderType = Ei.RegExpString = Ei.IntNumber = Ei.BigIntString = Ei.AddressString = Ei.HexString = Ei.OpaqueType = void 0;

  function bb() {
    return t => t
  }
  Ei.OpaqueType = bb, Ei.HexString = bb(), Ei.AddressString = bb(), Ei.BigIntString = bb();

  function s9e(t) {
    return Math.floor(t)
  }
  Ei.IntNumber = s9e, Ei.RegExpString = bb();
  var NW;
  (function (t) {
    t.CoinbaseWallet = "CoinbaseWallet", t.MetaMask = "MetaMask", t.Unselected = ""
  })(NW || (Ei.ProviderType = NW = {}));
  var o9e = ot && ot.__importDefault || function (t) {
    return t && t.__esModule ? t : {
      default: t
    }
  };
  Object.defineProperty(jt, "__esModule", {
    value: !0
  }), jt.isMobileWeb = jt.getLocation = jt.isInIFrame = jt.createQrUrl = jt.getFavicon = jt.range = jt.isBigNumber = jt.ensureParsedJSONObject = jt.ensureBN = jt.ensureRegExpString = jt.ensureIntNumber = jt.ensureBuffer = jt.ensureAddressString = jt.ensureEvenLengthHexString = jt.ensureHexString = jt.isHexString = jt.prepend0x = jt.strip0x = jt.has0xPrefix = jt.hexStringFromIntNumber = jt.intNumberFromHexString = jt.bigIntStringFromBN = jt.hexStringFromBuffer = jt.hexStringToUint8Array = jt.uint8ArrayToHex = jt.randomBytesHex = void 0;
  const qh = o9e(E6),
    tp = vb,
    $a = Ei,
    MW = /^[0-9]*$/,
    PW = /^[a-f0-9]*$/;

  function a9e(t) {
    return $W(crypto.getRandomValues(new Uint8Array(t)))
  }
  jt.randomBytesHex = a9e;

  function $W(t) {
    return [...t].map(e => e.toString(16).padStart(2, "0")).join("")
  }
  jt.uint8ArrayToHex = $W;

  function c9e(t) {
    return new Uint8Array(t.match(/.{1,2}/g).map(e => parseInt(e, 16)))
  }
  jt.hexStringToUint8Array = c9e;

  function l9e(t, e = !1) {
    const r = t.toString("hex");
    return (0, $a.HexString)(e ? `0x${r}` : r)
  }
  jt.hexStringFromBuffer = l9e;

  function u9e(t) {
    return (0, $a.BigIntString)(t.toString(10))
  }
  jt.bigIntStringFromBN = u9e;

  function d9e(t) {
    return (0, $a.IntNumber)(new qh.default(_b(t, !1), 16).toNumber())
  }
  jt.intNumberFromHexString = d9e;

  function h9e(t) {
    return (0, $a.HexString)(`0x${new qh.default(t).toString(16)}`)
  }
  jt.hexStringFromIntNumber = h9e;

  function nS(t) {
    return t.startsWith("0x") || t.startsWith("0X")
  }
  jt.has0xPrefix = nS;

  function T6(t) {
    return nS(t) ? t.slice(2) : t
  }
  jt.strip0x = T6;

  function OW(t) {
    return nS(t) ? `0x${t.slice(2)}` : `0x${t}`
  }
  jt.prepend0x = OW;

  function yb(t) {
    if (typeof t != "string") return !1;
    const e = T6(t).toLowerCase();
    return PW.test(e)
  }
  jt.isHexString = yb;

  function DW(t, e = !1) {
    if (typeof t == "string") {
      const r = T6(t).toLowerCase();
      if (PW.test(r)) return (0, $a.HexString)(e ? `0x${r}` : r)
    }
    throw tp.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)
  }
  jt.ensureHexString = DW;

  function _b(t, e = !1) {
    let r = DW(t, !1);
    return r.length % 2 === 1 && (r = (0, $a.HexString)(`0${r}`)), e ? (0, $a.HexString)(`0x${r}`) : r
  }
  jt.ensureEvenLengthHexString = _b;

  function f9e(t) {
    if (typeof t == "string") {
      const e = T6(t).toLowerCase();
      if (yb(e) && e.length === 40) return (0, $a.AddressString)(OW(e))
    }
    throw tp.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)
  }
  jt.ensureAddressString = f9e;

  function p9e(t) {
    if (Buffer.isBuffer(t)) return t;
    if (typeof t == "string") {
      if (yb(t)) {
        const e = _b(t, !1);
        return Buffer.from(e, "hex")
      }
      return Buffer.from(t, "utf8")
    }
    throw tp.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)
  }
  jt.ensureBuffer = p9e;

  function LW(t) {
    if (typeof t == "number" && Number.isInteger(t)) return (0, $a.IntNumber)(t);
    if (typeof t == "string") {
      if (MW.test(t)) return (0, $a.IntNumber)(Number(t));
      if (yb(t)) return (0, $a.IntNumber)(new qh.default(_b(t, !1), 16).toNumber())
    }
    throw tp.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)
  }
  jt.ensureIntNumber = LW;

  function g9e(t) {
    if (t instanceof RegExp) return (0, $a.RegExpString)(t.toString());
    throw tp.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)
  }
  jt.ensureRegExpString = g9e;

  function m9e(t) {
    if (t !== null && (qh.default.isBN(t) || BW(t))) return new qh.default(t.toString(10), 10);
    if (typeof t == "number") return new qh.default(LW(t));
    if (typeof t == "string") {
      if (MW.test(t)) return new qh.default(t, 10);
      if (yb(t)) return new qh.default(_b(t, !1), 16)
    }
    throw tp.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)
  }
  jt.ensureBN = m9e;

  function w9e(t) {
    if (typeof t == "string") return JSON.parse(t);
    if (typeof t == "object") return t;
    throw tp.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)
  }
  jt.ensureParsedJSONObject = w9e;

  function BW(t) {
    if (t == null || typeof t.constructor != "function") return !1;
    const {
      constructor: e
    } = t;
    return typeof e.config == "function" && typeof e.EUCLID == "number"
  }
  jt.isBigNumber = BW;

  function v9e(t, e) {
    return Array.from({
      length: e - t
    }, (r, n) => t + n)
  }
  jt.range = v9e;

  function b9e() {
    const t = document.querySelector('link[sizes="192x192"]') || document.querySelector('link[sizes="180x180"]') || document.querySelector('link[rel="icon"]') || document.querySelector('link[rel="shortcut icon"]'),
      {
        protocol: e,
        host: r
      } = document.location,
      n = t ? t.getAttribute("href") : null;
    return !n || n.startsWith("javascript:") || n.startsWith("vbscript:") ? null : n.startsWith("http://") || n.startsWith("https://") || n.startsWith("data:") ? n : n.startsWith("//") ? e + n : `${e}//${r}${n}`
  }
  jt.getFavicon = b9e;

  function y9e(t, e, r, n, i, s) {
    const o = n ? "parent-id" : "id",
      a = new URLSearchParams({
        [o]: t,
        secret: e,
        server: r,
        v: i,
        chainId: s.toString()
      }).toString();
    return `${r}/#/link?${a}`
  }
  jt.createQrUrl = y9e;

  function UW() {
    try {
      return window.frameElement !== null
    } catch {
      return !1
    }
  }
  jt.isInIFrame = UW;

  function _9e() {
    try {
      return UW() && window.top ? window.top.location : window.location
    } catch {
      return window.location
    }
  }
  jt.getLocation = _9e;

  function x9e() {
    var t;
    return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((t = window?.navigator) === null || t === void 0 ? void 0 : t.userAgent)
  }
  jt.isMobileWeb = x9e;
  var k6 = {};
  Object.defineProperty(k6, "__esModule", {
    value: !0
  }), k6.ScopedLocalStorage = void 0;
  class C9e {
    constructor(e) {
      this.scope = e
    }
    setItem(e, r) {
      localStorage.setItem(this.scopedKey(e), r)
    }
    getItem(e) {
      return localStorage.getItem(this.scopedKey(e))
    }
    removeItem(e) {
      localStorage.removeItem(this.scopedKey(e))
    }
    clear() {
      const e = this.scopedKey(""),
        r = [];
      for (let n = 0; n < localStorage.length; n++) {
        const i = localStorage.key(n);
        typeof i == "string" && i.startsWith(e) && r.push(i)
      }
      r.forEach(n => localStorage.removeItem(n))
    }
    scopedKey(e) {
      return `${this.scope}:${e}`
    }
  }
  k6.ScopedLocalStorage = C9e;
  var Qg = {};
  const E9e = bu(Xte);
  var xb = {},
    Cb = {},
    Jg = {};
  Object.defineProperty(Jg, "__esModule", {
    value: !0
  }), Jg.EVENTS = void 0, Jg.EVENTS = {
    STARTED_CONNECTING: "walletlink_sdk.started.connecting",
    CONNECTED_STATE_CHANGE: "walletlink_sdk.connected",
    DISCONNECTED: "walletlink_sdk.disconnected",
    METADATA_DESTROYED: "walletlink_sdk_metadata_destroyed",
    LINKED: "walletlink_sdk.linked",
    FAILURE: "walletlink_sdk.generic_failure",
    SESSION_CONFIG_RECEIVED: "walletlink_sdk.session_config_event_received",
    ETH_ACCOUNTS_STATE: "walletlink_sdk.eth_accounts_state",
    SESSION_STATE_CHANGE: "walletlink_sdk.session_state_change",
    UNLINKED_ERROR_STATE: "walletlink_sdk.unlinked_error_state",
    SKIPPED_CLEARING_SESSION: "walletlink_sdk.skipped_clearing_session",
    GENERAL_ERROR: "walletlink_sdk.general_error",
    WEB3_REQUEST: "walletlink_sdk.web3.request",
    WEB3_REQUEST_PUBLISHED: "walletlink_sdk.web3.request_published",
    WEB3_RESPONSE: "walletlink_sdk.web3.response",
    METHOD_NOT_IMPLEMENTED: "walletlink_sdk.method_not_implemented",
    UNKNOWN_ADDRESS_ENCOUNTERED: "walletlink_sdk.unknown_address_encountered"
  };
  var Oa = {};
  Object.defineProperty(Oa, "__esModule", {
    value: !0
  }), Oa.RelayAbstract = Oa.APP_VERSION_KEY = Oa.LOCAL_STORAGE_ADDRESSES_KEY = Oa.WALLET_USER_NAME_KEY = void 0;
  const jW = vb;
  Oa.WALLET_USER_NAME_KEY = "walletUsername", Oa.LOCAL_STORAGE_ADDRESSES_KEY = "Addresses", Oa.APP_VERSION_KEY = "AppVersion";
  class A9e {
    async makeEthereumJSONRPCRequest(e, r) {
      if (!r) throw new Error("Error: No jsonRpcUrl provided");
      return window.fetch(r, {
        method: "POST",
        body: JSON.stringify(e),
        mode: "cors",
        headers: {
          "Content-Type": "application/json"
        }
      }).then(n => n.json()).then(n => {
        if (!n) throw jW.standardErrors.rpc.parse({});
        const i = n,
          {
            error: s
          } = i;
        if (s) throw (0, jW.serializeError)(s, e.method);
        return i
      })
    }
  }
  Oa.RelayAbstract = A9e;
  var Xg = {},
    FW = {
      exports: {}
    },
    iS = {
      exports: {}
    }; /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
  (function (t, e) {
    var r = d1,
      n = r.Buffer;

    function i(o, a) {
      for (var c in o) a[c] = o[c]
    }
    n.from && n.alloc && n.allocUnsafe && n.allocUnsafeSlow ? t.exports = r : (i(r, e), e.Buffer = s);

    function s(o, a, c) {
      return n(o, a, c)
    }
    s.prototype = Object.create(n.prototype), i(n, s), s.from = function (o, a, c) {
      if (typeof o == "number") throw new TypeError("Argument must not be a number");
      return n(o, a, c)
    }, s.alloc = function (o, a, c) {
      if (typeof o != "number") throw new TypeError("Argument must be a number");
      var l = n(o);
      return a !== void 0 ? typeof c == "string" ? l.fill(a, c) : l.fill(a) : l.fill(0), l
    }, s.allocUnsafe = function (o) {
      if (typeof o != "number") throw new TypeError("Argument must be a number");
      return n(o)
    }, s.allocUnsafeSlow = function (o) {
      if (typeof o != "number") throw new TypeError("Argument must be a number");
      return r.SlowBuffer(o)
    }
  })(iS, iS.exports);
  var Vh = iS.exports,
    WW = Vh.Buffer;

  function R6(t, e) {
    this._block = WW.alloc(t), this._finalSize = e, this._blockSize = t, this._len = 0
  }
  R6.prototype.update = function (t, e) {
    typeof t == "string" && (e = e || "utf8", t = WW.from(t, e));
    for (var r = this._block, n = this._blockSize, i = t.length, s = this._len, o = 0; o < i;) {
      for (var a = s % n, c = Math.min(i - o, n - a), l = 0; l < c; l++) r[a + l] = t[o + l];
      s += c, o += c, s % n === 0 && this._update(r)
    }
    return this._len += i, this
  }, R6.prototype.digest = function (t) {
    var e = this._len % this._blockSize;
    this._block[e] = 128, this._block.fill(0, e + 1), e >= this._finalSize && (this._update(this._block), this._block.fill(0));
    var r = this._len * 8;
    if (r <= 4294967295) this._block.writeUInt32BE(r, this._blockSize - 4);
    else {
      var n = (r & 4294967295) >>> 0,
        i = (r - n) / 4294967296;
      this._block.writeUInt32BE(i, this._blockSize - 8), this._block.writeUInt32BE(n, this._blockSize - 4)
    }
    this._update(this._block);
    var s = this._hash();
    return t ? s.toString(t) : s
  }, R6.prototype._update = function () {
    throw new Error("_update must be implemented by subclass")
  };
  var em = R6,
    S9e = $s,
    zW = em,
    I9e = Vh.Buffer,
    T9e = [1518500249, 1859775393, -1894007588, -899497514],
    k9e = new Array(80);

  function Eb() {
    this.init(), this._w = k9e, zW.call(this, 64, 56)
  }
  S9e(Eb, zW), Eb.prototype.init = function () {
    return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this
  };

  function R9e(t) {
    return t << 5 | t >>> 27
  }

  function N9e(t) {
    return t << 30 | t >>> 2
  }

  function M9e(t, e, r, n) {
    return t === 0 ? e & r | ~e & n : t === 2 ? e & r | e & n | r & n : e ^ r ^ n
  }
  Eb.prototype._update = function (t) {
    for (var e = this._w, r = this._a | 0, n = this._b | 0, i = this._c | 0, s = this._d | 0, o = this._e | 0, a = 0; a < 16; ++a) e[a] = t.readInt32BE(a * 4);
    for (; a < 80; ++a) e[a] = e[a - 3] ^ e[a - 8] ^ e[a - 14] ^ e[a - 16];
    for (var c = 0; c < 80; ++c) {
      var l = ~~(c / 20),
        h = R9e(r) + M9e(l, n, i, s) + o + e[c] + T9e[l] | 0;
      o = s, s = i, i = N9e(n), n = r, r = h
    }
    this._a = r + this._a | 0, this._b = n + this._b | 0, this._c = i + this._c | 0, this._d = s + this._d | 0, this._e = o + this._e | 0
  }, Eb.prototype._hash = function () {
    var t = I9e.allocUnsafe(20);
    return t.writeInt32BE(this._a | 0, 0), t.writeInt32BE(this._b | 0, 4), t.writeInt32BE(this._c | 0, 8), t.writeInt32BE(this._d | 0, 12), t.writeInt32BE(this._e | 0, 16), t
  };
  var P9e = Eb,
    $9e = $s,
    HW = em,
    O9e = Vh.Buffer,
    D9e = [1518500249, 1859775393, -1894007588, -899497514],
    L9e = new Array(80);

  function Ab() {
    this.init(), this._w = L9e, HW.call(this, 64, 56)
  }
  $9e(Ab, HW), Ab.prototype.init = function () {
    return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this
  };

  function B9e(t) {
    return t << 1 | t >>> 31
  }

  function U9e(t) {
    return t << 5 | t >>> 27
  }

  function j9e(t) {
    return t << 30 | t >>> 2
  }

  function F9e(t, e, r, n) {
    return t === 0 ? e & r | ~e & n : t === 2 ? e & r | e & n | r & n : e ^ r ^ n
  }
  Ab.prototype._update = function (t) {
    for (var e = this._w, r = this._a | 0, n = this._b | 0, i = this._c | 0, s = this._d | 0, o = this._e | 0, a = 0; a < 16; ++a) e[a] = t.readInt32BE(a * 4);
    for (; a < 80; ++a) e[a] = B9e(e[a - 3] ^ e[a - 8] ^ e[a - 14] ^ e[a - 16]);
    for (var c = 0; c < 80; ++c) {
      var l = ~~(c / 20),
        h = U9e(r) + F9e(l, n, i, s) + o + e[c] + D9e[l] | 0;
      o = s, s = i, i = j9e(n), n = r, r = h
    }
    this._a = r + this._a | 0, this._b = n + this._b | 0, this._c = i + this._c | 0, this._d = s + this._d | 0, this._e = o + this._e | 0
  }, Ab.prototype._hash = function () {
    var t = O9e.allocUnsafe(20);
    return t.writeInt32BE(this._a | 0, 0), t.writeInt32BE(this._b | 0, 4), t.writeInt32BE(this._c | 0, 8), t.writeInt32BE(this._d | 0, 12), t.writeInt32BE(this._e | 0, 16), t
  };
  var W9e = Ab,
    z9e = $s,
    qW = em,
    H9e = Vh.Buffer,
    q9e = [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],
    V9e = new Array(64);

  function Sb() {
    this.init(), this._w = V9e, qW.call(this, 64, 56)
  }
  z9e(Sb, qW), Sb.prototype.init = function () {
    return this._a = 1779033703, this._b = 3144134277, this._c = 1013904242, this._d = 2773480762, this._e = 1359893119, this._f = 2600822924, this._g = 528734635, this._h = 1541459225, this
  };

  function K9e(t, e, r) {
    return r ^ t & (e ^ r)
  }

  function G9e(t, e, r) {
    return t & e | r & (t | e)
  }

  function Z9e(t) {
    return (t >>> 2 | t << 30) ^ (t >>> 13 | t << 19) ^ (t >>> 22 | t << 10)
  }

  function Y9e(t) {
    return (t >>> 6 | t << 26) ^ (t >>> 11 | t << 21) ^ (t >>> 25 | t << 7)
  }

  function Q9e(t) {
    return (t >>> 7 | t << 25) ^ (t >>> 18 | t << 14) ^ t >>> 3
  }

  function J9e(t) {
    return (t >>> 17 | t << 15) ^ (t >>> 19 | t << 13) ^ t >>> 10
  }
  Sb.prototype._update = function (t) {
    for (var e = this._w, r = this._a | 0, n = this._b | 0, i = this._c | 0, s = this._d | 0, o = this._e | 0, a = this._f | 0, c = this._g | 0, l = this._h | 0, h = 0; h < 16; ++h) e[h] = t.readInt32BE(h * 4);
    for (; h < 64; ++h) e[h] = J9e(e[h - 2]) + e[h - 7] + Q9e(e[h - 15]) + e[h - 16] | 0;
    for (var f = 0; f < 64; ++f) {
      var w = l + Y9e(o) + K9e(o, a, c) + q9e[f] + e[f] | 0,
        b = Z9e(r) + G9e(r, n, i) | 0;
      l = c, c = a, a = o, o = s + w | 0, s = i, i = n, n = r, r = w + b | 0
    }
    this._a = r + this._a | 0, this._b = n + this._b | 0, this._c = i + this._c | 0, this._d = s + this._d | 0, this._e = o + this._e | 0, this._f = a + this._f | 0, this._g = c + this._g | 0, this._h = l + this._h | 0
  }, Sb.prototype._hash = function () {
    var t = H9e.allocUnsafe(32);
    return t.writeInt32BE(this._a, 0), t.writeInt32BE(this._b, 4), t.writeInt32BE(this._c, 8), t.writeInt32BE(this._d, 12), t.writeInt32BE(this._e, 16), t.writeInt32BE(this._f, 20), t.writeInt32BE(this._g, 24), t.writeInt32BE(this._h, 28), t
  };
  var VW = Sb,
    X9e = $s,
    exe = VW,
    txe = em,
    rxe = Vh.Buffer,
    nxe = new Array(64);

  function N6() {
    this.init(), this._w = nxe, txe.call(this, 64, 56)
  }
  X9e(N6, exe), N6.prototype.init = function () {
    return this._a = 3238371032, this._b = 914150663, this._c = 812702999, this._d = 4144912697, this._e = 4290775857, this._f = 1750603025, this._g = 1694076839, this._h = 3204075428, this
  }, N6.prototype._hash = function () {
    var t = rxe.allocUnsafe(28);
    return t.writeInt32BE(this._a, 0), t.writeInt32BE(this._b, 4), t.writeInt32BE(this._c, 8), t.writeInt32BE(this._d, 12), t.writeInt32BE(this._e, 16), t.writeInt32BE(this._f, 20), t.writeInt32BE(this._g, 24), t
  };
  var ixe = N6,
    sxe = $s,
    KW = em,
    oxe = Vh.Buffer,
    GW = [1116352408, 3609767458, 1899447441, 602891725, 3049323471, 3964484399, 3921009573, 2173295548, 961987163, 4081628472, 1508970993, 3053834265, 2453635748, 2937671579, 2870763221, 3664609560, 3624381080, 2734883394, 310598401, 1164996542, 607225278, 1323610764, 1426881987, 3590304994, 1925078388, 4068182383, 2162078206, 991336113, 2614888103, 633803317, 3248222580, 3479774868, 3835390401, 2666613458, 4022224774, 944711139, 264347078, 2341262773, 604807628, 2007800933, 770255983, 1495990901, 1249150122, 1856431235, 1555081692, 3175218132, 1996064986, 2198950837, 2554220882, 3999719339, 2821834349, 766784016, 2952996808, 2566594879, 3210313671, 3203337956, 3336571891, 1034457026, 3584528711, 2466948901, 113926993, 3758326383, 338241895, 168717936, 666307205, 1188179964, 773529912, 1546045734, 1294757372, 1522805485, 1396182291, 2643833823, 1695183700, 2343527390, 1986661051, 1014477480, 2177026350, 1206759142, 2456956037, 344077627, 2730485921, 1290863460, 2820302411, 3158454273, 3259730800, 3505952657, 3345764771, 106217008, 3516065817, 3606008344, 3600352804, 1432725776, 4094571909, 1467031594, 275423344, 851169720, 430227734, 3100823752, 506948616, 1363258195, 659060556, 3750685593, 883997877, 3785050280, 958139571, 3318307427, 1322822218, 3812723403, 1537002063, 2003034995, 1747873779, 3602036899, 1955562222, 1575990012, 2024104815, 1125592928, 2227730452, 2716904306, 2361852424, 442776044, 2428436474, 593698344, 2756734187, 3733110249, 3204031479, 2999351573, 3329325298, 3815920427, 3391569614, 3928383900, 3515267271, 566280711, 3940187606, 3454069534, 4118630271, 4000239992, 116418474, 1914138554, 174292421, 2731055270, 289380356, 3203993006, 460393269, 320620315, 685471733, 587496836, 852142971, 1086792851, 1017036298, 365543100, 1126000580, 2618297676, 1288033470, 3409855158, 1501505948, 4234509866, 1607167915, 987167468, 1816402316, 1246189591],
    axe = new Array(160);

  function Ib() {
    this.init(), this._w = axe, KW.call(this, 128, 112)
  }
  sxe(Ib, KW), Ib.prototype.init = function () {
    return this._ah = 1779033703, this._bh = 3144134277, this._ch = 1013904242, this._dh = 2773480762, this._eh = 1359893119, this._fh = 2600822924, this._gh = 528734635, this._hh = 1541459225, this._al = 4089235720, this._bl = 2227873595, this._cl = 4271175723, this._dl = 1595750129, this._el = 2917565137, this._fl = 725511199, this._gl = 4215389547, this._hl = 327033209, this
  };

  function ZW(t, e, r) {
    return r ^ t & (e ^ r)
  }

  function YW(t, e, r) {
    return t & e | r & (t | e)
  }

  function QW(t, e) {
    return (t >>> 28 | e << 4) ^ (e >>> 2 | t << 30) ^ (e >>> 7 | t << 25)
  }

  function JW(t, e) {
    return (t >>> 14 | e << 18) ^ (t >>> 18 | e << 14) ^ (e >>> 9 | t << 23)
  }

  function cxe(t, e) {
    return (t >>> 1 | e << 31) ^ (t >>> 8 | e << 24) ^ t >>> 7
  }

  function lxe(t, e) {
    return (t >>> 1 | e << 31) ^ (t >>> 8 | e << 24) ^ (t >>> 7 | e << 25)
  }

  function uxe(t, e) {
    return (t >>> 19 | e << 13) ^ (e >>> 29 | t << 3) ^ t >>> 6
  }

  function dxe(t, e) {
    return (t >>> 19 | e << 13) ^ (e >>> 29 | t << 3) ^ (t >>> 6 | e << 26)
  }

  function Zi(t, e) {
    return t >>> 0 < e >>> 0 ? 1 : 0
  }
  Ib.prototype._update = function (t) {
    for (var e = this._w, r = this._ah | 0, n = this._bh | 0, i = this._ch | 0, s = this._dh | 0, o = this._eh | 0, a = this._fh | 0, c = this._gh | 0, l = this._hh | 0, h = this._al | 0, f = this._bl | 0, w = this._cl | 0, b = this._dl | 0, C = this._el | 0, M = this._fl | 0, N = this._gl | 0, $ = this._hl | 0, k = 0; k < 32; k += 2) e[k] = t.readInt32BE(k * 4), e[k + 1] = t.readInt32BE(k * 4 + 4);
    for (; k < 160; k += 2) {
      var B = e[k - 30],
        F = e[k - 15 * 2 + 1],
        D = cxe(B, F),
        V = lxe(F, B);
      B = e[k - 2 * 2], F = e[k - 2 * 2 + 1];
      var R = uxe(B, F),
        P = dxe(F, B),
        j = e[k - 7 * 2],
        Y = e[k - 7 * 2 + 1],
        U = e[k - 16 * 2],
        I = e[k - 16 * 2 + 1],
        g = V + Y | 0,
        u = D + j + Zi(g, V) | 0;
      g = g + P | 0, u = u + R + Zi(g, P) | 0, g = g + I | 0, u = u + U + Zi(g, I) | 0, e[k] = u, e[k + 1] = g
    }
    for (var p = 0; p < 160; p += 2) {
      u = e[p], g = e[p + 1];
      var v = YW(r, n, i),
        x = YW(h, f, w),
        E = QW(r, h),
        S = QW(h, r),
        _ = JW(o, C),
        y = JW(C, o),
        A = GW[p],
        G = GW[p + 1],
        ce = ZW(o, a, c),
        W = ZW(C, M, N),
        X = $ + y | 0,
        Z = l + _ + Zi(X, $) | 0;
      X = X + W | 0, Z = Z + ce + Zi(X, W) | 0, X = X + G | 0, Z = Z + A + Zi(X, G) | 0, X = X + g | 0, Z = Z + u + Zi(X, g) | 0;
      var ee = S + x | 0,
        ne = E + v + Zi(ee, S) | 0;
      l = c, $ = N, c = a, N = M, a = o, M = C, C = b + X | 0, o = s + Z + Zi(C, b) | 0, s = i, b = w, i = n, w = f, n = r, f = h, h = X + ee | 0, r = Z + ne + Zi(h, X) | 0
    }
    this._al = this._al + h | 0, this._bl = this._bl + f | 0, this._cl = this._cl + w | 0, this._dl = this._dl + b | 0, this._el = this._el + C | 0, this._fl = this._fl + M | 0, this._gl = this._gl + N | 0, this._hl = this._hl + $ | 0, this._ah = this._ah + r + Zi(this._al, h) | 0, this._bh = this._bh + n + Zi(this._bl, f) | 0, this._ch = this._ch + i + Zi(this._cl, w) | 0, this._dh = this._dh + s + Zi(this._dl, b) | 0, this._eh = this._eh + o + Zi(this._el, C) | 0, this._fh = this._fh + a + Zi(this._fl, M) | 0, this._gh = this._gh + c + Zi(this._gl, N) | 0, this._hh = this._hh + l + Zi(this._hl, $) | 0
  }, Ib.prototype._hash = function () {
    var t = oxe.allocUnsafe(64);

    function e(r, n, i) {
      t.writeInt32BE(r, i), t.writeInt32BE(n, i + 4)
    }
    return e(this._ah, this._al, 0), e(this._bh, this._bl, 8), e(this._ch, this._cl, 16), e(this._dh, this._dl, 24), e(this._eh, this._el, 32), e(this._fh, this._fl, 40), e(this._gh, this._gl, 48), e(this._hh, this._hl, 56), t
  };
  var XW = Ib,
    hxe = $s,
    fxe = XW,
    pxe = em,
    gxe = Vh.Buffer,
    mxe = new Array(160);

  function M6() {
    this.init(), this._w = mxe, pxe.call(this, 128, 112)
  }
  hxe(M6, fxe), M6.prototype.init = function () {
    return this._ah = 3418070365, this._bh = 1654270250, this._ch = 2438529370, this._dh = 355462360, this._eh = 1731405415, this._fh = 2394180231, this._gh = 3675008525, this._hh = 1203062813, this._al = 3238371032, this._bl = 914150663, this._cl = 812702999, this._dl = 4144912697, this._el = 4290775857, this._fl = 1750603025, this._gl = 1694076839, this._hl = 3204075428, this
  }, M6.prototype._hash = function () {
    var t = gxe.allocUnsafe(48);

    function e(r, n, i) {
      t.writeInt32BE(r, i), t.writeInt32BE(n, i + 4)
    }
    return e(this._ah, this._al, 0), e(this._bh, this._bl, 8), e(this._ch, this._cl, 16), e(this._dh, this._dl, 24), e(this._eh, this._el, 32), e(this._fh, this._fl, 40), t
  };
  var wxe = M6,
    rp = FW.exports = function (e) {
      e = e.toLowerCase();
      var r = rp[e];
      if (!r) throw new Error(e + " is not supported (we accept pull requests)");
      return new r
    };
  rp.sha = P9e, rp.sha1 = W9e, rp.sha224 = ixe, rp.sha256 = VW, rp.sha384 = wxe, rp.sha512 = XW;
  var vxe = FW.exports;
  Object.defineProperty(Xg, "__esModule", {
    value: !0
  }), Xg.Session = void 0;
  const ez = vxe,
    tz = jt,
    rz = "session:id",
    nz = "session:secret",
    iz = "session:linked";
  class sS {
    constructor(e, r, n, i) {
      this._storage = e, this._id = r || (0, tz.randomBytesHex)(16), this._secret = n || (0, tz.randomBytesHex)(32), this._key = new ez.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"), this._linked = !!i
    }
    static load(e) {
      const r = e.getItem(rz),
        n = e.getItem(iz),
        i = e.getItem(nz);
      return r && i ? new sS(e, r, i, n === "1") : null
    }
    static hash(e) {
      return new ez.sha256().update(e).digest("hex")
    }
    get id() {
      return this._id
    }
    get secret() {
      return this._secret
    }
    get key() {
      return this._key
    }
    get linked() {
      return this._linked
    }
    set linked(e) {
      this._linked = e, this.persistLinked()
    }
    save() {
      return this._storage.setItem(rz, this._id), this._storage.setItem(nz, this._secret), this.persistLinked(), this
    }
    persistLinked() {
      this._storage.setItem(iz, this._linked ? "1" : "0")
    }
  }
  Xg.Session = sS;
  var P6 = {},
    $6 = {};
  Object.defineProperty($6, "__esModule", {
    value: !0
  }), $6.Cipher = void 0;
  const O6 = jt;
  class bxe {
    constructor(e) {
      this.secret = e
    }
    async encrypt(e) {
      const r = this.secret;
      if (r.length !== 64) throw Error("secret must be 256 bits");
      const n = crypto.getRandomValues(new Uint8Array(12)),
        i = await crypto.subtle.importKey("raw", (0, O6.hexStringToUint8Array)(r), {
          name: "aes-gcm"
        }, !1, ["encrypt", "decrypt"]),
        s = new TextEncoder,
        o = await window.crypto.subtle.encrypt({
          name: "AES-GCM",
          iv: n
        }, i, s.encode(e)),
        a = 16,
        c = o.slice(o.byteLength - a),
        l = o.slice(0, o.byteLength - a),
        h = new Uint8Array(c),
        f = new Uint8Array(l),
        w = new Uint8Array([...n, ...h, ...f]);
      return (0, O6.uint8ArrayToHex)(w)
    }
    async decrypt(e) {
      const r = this.secret;
      if (r.length !== 64) throw Error("secret must be 256 bits");
      return new Promise((n, i) => {
        (async function () {
          const s = await crypto.subtle.importKey("raw", (0, O6.hexStringToUint8Array)(r), {
              name: "aes-gcm"
            }, !1, ["encrypt", "decrypt"]),
            o = (0, O6.hexStringToUint8Array)(e),
            a = o.slice(0, 12),
            c = o.slice(12, 28),
            l = o.slice(28),
            h = new Uint8Array([...l, ...c]),
            f = {
              name: "AES-GCM",
              iv: new Uint8Array(a)
            };
          try {
            const w = await window.crypto.subtle.decrypt(f, s, h),
              b = new TextDecoder;
            n(b.decode(w))
          } catch (w) {
            i(w)
          }
        })()
      })
    }
  }
  $6.Cipher = bxe;
  var D6 = {};
  Object.defineProperty(D6, "__esModule", {
    value: !0
  }), D6.WalletLinkHTTP = void 0;
  class yxe {
    constructor(e, r, n) {
      this.linkAPIUrl = e, this.sessionId = r;
      const i = `${r}:${n}`;
      this.auth = `Basic ${btoa(i)}`
    }
    async markUnseenEventsAsSeen(e) {
      return Promise.all(e.map(r => fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`, {
        method: "POST",
        headers: {
          Authorization: this.auth
        }
      }))).catch(r => console.error("Unabled to mark event as failed:", r))
    }
    async fetchUnseenEvents() {
      var e;
      const r = await fetch(`${this.linkAPIUrl}/events?unseen=true`, {
        headers: {
          Authorization: this.auth
        }
      });
      if (r.ok) {
        const {
          events: n,
          error: i
        } = await r.json();
        if (i) throw new Error(`Check unseen events failed: ${i}`);
        const s = (e = n?.filter(o => o.event === "Web3Response").map(o => ({
          type: "Event",
          sessionId: this.sessionId,
          eventId: o.id,
          event: o.event,
          data: o.data
        }))) !== null && e !== void 0 ? e : [];
        return this.markUnseenEventsAsSeen(s), s
      }
      throw new Error(`Check unseen events failed: ${r.status}`)
    }
  }
  D6.WalletLinkHTTP = yxe;
  var tm = {};
  Object.defineProperty(tm, "__esModule", {
    value: !0
  }), tm.WalletLinkWebSocket = tm.ConnectionState = void 0;
  var rm;
  (function (t) {
    t[t.DISCONNECTED = 0] = "DISCONNECTED", t[t.CONNECTING = 1] = "CONNECTING", t[t.CONNECTED = 2] = "CONNECTED"
  })(rm || (tm.ConnectionState = rm = {}));
  class _xe {
    setConnectionStateListener(e) {
      this.connectionStateListener = e
    }
    setIncomingDataListener(e) {
      this.incomingDataListener = e
    }
    constructor(e, r = WebSocket) {
      this.WebSocketClass = r, this.webSocket = null, this.pendingData = [], this.url = e.replace(/^http/, "ws")
    }
    async connect() {
      if (this.webSocket) throw new Error("webSocket object is not null");
      return new Promise((e, r) => {
        var n;
        let i;
        try {
          this.webSocket = i = new this.WebSocketClass(this.url)
        } catch (s) {
          r(s);
          return
        }(n = this.connectionStateListener) === null || n === void 0 || n.call(this, rm.CONNECTING), i.onclose = s => {
          var o;
          this.clearWebSocket(), r(new Error(`websocket error ${s.code}: ${s.reason}`)), (o = this.connectionStateListener) === null || o === void 0 || o.call(this, rm.DISCONNECTED)
        }, i.onopen = s => {
          var o;
          e(), (o = this.connectionStateListener) === null || o === void 0 || o.call(this, rm.CONNECTED), this.pendingData.length > 0 && ([...this.pendingData].forEach(c => this.sendData(c)), this.pendingData = [])
        }, i.onmessage = s => {
          var o, a;
          if (s.data === "h")(o = this.incomingDataListener) === null || o === void 0 || o.call(this, {
            type: "Heartbeat"
          });
          else try {
            const c = JSON.parse(s.data);
            (a = this.incomingDataListener) === null || a === void 0 || a.call(this, c)
          } catch {}
        }
      })
    }
    disconnect() {
      var e;
      const {
        webSocket: r
      } = this;
      if (r) {
        this.clearWebSocket(), (e = this.connectionStateListener) === null || e === void 0 || e.call(this, rm.DISCONNECTED), this.connectionStateListener = void 0, this.incomingDataListener = void 0;
        try {
          r.close()
        } catch {}
      }
    }
    sendData(e) {
      const {
        webSocket: r
      } = this;
      if (!r) {
        this.pendingData.push(e), this.connect();
        return
      }
      r.send(e)
    }
    clearWebSocket() {
      const {
        webSocket: e
      } = this;
      e && (this.webSocket = null, e.onclose = null, e.onerror = null, e.onmessage = null, e.onopen = null)
    }
  }
  tm.WalletLinkWebSocket = _xe, Object.defineProperty(P6, "__esModule", {
    value: !0
  }), P6.WalletLinkConnection = void 0;
  const nm = Ei,
    xxe = $6,
    eu = Jg,
    sz = Oa,
    im = Xg,
    Cxe = D6,
    L6 = tm,
    oz = 1e4,
    Exe = 6e4;
  class Axe {
    constructor({
      session: e,
      linkAPIUrl: r,
      listener: n,
      diagnostic: i,
      WebSocketClass: s = WebSocket
    }) {
      this.destroyed = !1, this.lastHeartbeatResponse = 0, this.nextReqId = (0, nm.IntNumber)(1), this._connected = !1, this._linked = !1, this.shouldFetchUnseenEventsOnConnect = !1, this.requestResolutions = new Map, this.handleSessionMetadataUpdated = a => {
        if (!a) return;
        new Map([
          ["__destroyed", this.handleDestroyed],
          ["EthereumAddress", this.handleAccountUpdated],
          ["WalletUsername", this.handleWalletUsernameUpdated],
          ["AppVersion", this.handleAppVersionUpdated],
          ["ChainId", l => a.JsonRpcUrl && this.handleChainUpdated(l, a.JsonRpcUrl)]
        ]).forEach((l, h) => {
          const f = a[h];
          f !== void 0 && l(f)
        })
      }, this.handleDestroyed = a => {
        var c, l;
        a === "1" && ((c = this.listener) === null || c === void 0 || c.resetAndReload(), (l = this.diagnostic) === null || l === void 0 || l.log(eu.EVENTS.METADATA_DESTROYED, {
          alreadyDestroyed: this.isDestroyed,
          sessionIdHash: im.Session.hash(this.session.id)
        }))
      }, this.handleAccountUpdated = async a => {
        var c, l;
        try {
          const h = await this.cipher.decrypt(a);
          (c = this.listener) === null || c === void 0 || c.accountUpdated(h)
        } catch {
          (l = this.diagnostic) === null || l === void 0 || l.log(eu.EVENTS.GENERAL_ERROR, {
            message: "Had error decrypting",
            value: "selectedAddress"
          })
        }
      }, this.handleMetadataUpdated = async (a, c) => {
        var l, h;
        try {
          const f = await this.cipher.decrypt(c);
          (l = this.listener) === null || l === void 0 || l.metadataUpdated(a, f)
        } catch {
          (h = this.diagnostic) === null || h === void 0 || h.log(eu.EVENTS.GENERAL_ERROR, {
            message: "Had error decrypting",
            value: a
          })
        }
      }, this.handleWalletUsernameUpdated = async a => {
        this.handleMetadataUpdated(sz.WALLET_USER_NAME_KEY, a)
      }, this.handleAppVersionUpdated = async a => {
        this.handleMetadataUpdated(sz.APP_VERSION_KEY, a)
      }, this.handleChainUpdated = async (a, c) => {
        var l, h;
        try {
          const f = await this.cipher.decrypt(a),
            w = await this.cipher.decrypt(c);
          (l = this.listener) === null || l === void 0 || l.chainUpdated(f, w)
        } catch {
          (h = this.diagnostic) === null || h === void 0 || h.log(eu.EVENTS.GENERAL_ERROR, {
            message: "Had error decrypting",
            value: "chainId|jsonRpcUrl"
          })
        }
      }, this.session = e, this.cipher = new xxe.Cipher(e.secret), this.diagnostic = i, this.listener = n;
      const o = new L6.WalletLinkWebSocket(`${r}/rpc`, s);
      o.setConnectionStateListener(async a => {
        var c;
        (c = this.diagnostic) === null || c === void 0 || c.log(eu.EVENTS.CONNECTED_STATE_CHANGE, {
          state: a,
          sessionIdHash: im.Session.hash(e.id)
        });
        let l = !1;
        switch (a) {
          case L6.ConnectionState.DISCONNECTED:
            if (!this.destroyed) {
              const h = async () => {
                await new Promise(f => setTimeout(f, 5e3)), this.destroyed || o.connect().catch(() => {
                  h()
                })
              };
              h()
            }
            break;
          case L6.ConnectionState.CONNECTED:
            try {
              await this.authenticate(), this.sendIsLinked(), this.sendGetSessionConfig(), l = !0
            } catch {}
            this.updateLastHeartbeat(), setInterval(() => {
              this.heartbeat()
            }, oz), this.shouldFetchUnseenEventsOnConnect && this.fetchUnseenEventsAPI();
            break;
          case L6.ConnectionState.CONNECTING:
            break
        }
        this.connected !== l && (this.connected = l)
      }), o.setIncomingDataListener(a => {
        var c, l, h;
        switch (a.type) {
          case "Heartbeat":
            this.updateLastHeartbeat();
            return;
          case "IsLinkedOK":
          case "Linked": {
            const f = a.type === "IsLinkedOK" ? a.linked : void 0;
            (c = this.diagnostic) === null || c === void 0 || c.log(eu.EVENTS.LINKED, {
              sessionIdHash: im.Session.hash(e.id),
              linked: f,
              type: a.type,
              onlineGuests: a.onlineGuests
            }), this.linked = f || a.onlineGuests > 0;
            break
          }
          case "GetSessionConfigOK":
          case "SessionConfigUpdated": {
            (l = this.diagnostic) === null || l === void 0 || l.log(eu.EVENTS.SESSION_CONFIG_RECEIVED, {
              sessionIdHash: im.Session.hash(e.id),
              metadata_keys: a && a.metadata ? Object.keys(a.metadata) : void 0
            }), this.handleSessionMetadataUpdated(a.metadata);
            break
          }
          case "Event": {
            this.handleIncomingEvent(a);
            break
          }
        }
        a.id !== void 0 && ((h = this.requestResolutions.get(a.id)) === null || h === void 0 || h(a))
      }), this.ws = o, this.http = new Cxe.WalletLinkHTTP(r, e.id, e.key)
    }
    connect() {
      var e;
      if (this.destroyed) throw new Error("instance is destroyed");
      (e = this.diagnostic) === null || e === void 0 || e.log(eu.EVENTS.STARTED_CONNECTING, {
        sessionIdHash: im.Session.hash(this.session.id)
      }), this.ws.connect()
    }
    destroy() {
      var e;
      this.destroyed = !0, this.ws.disconnect(), (e = this.diagnostic) === null || e === void 0 || e.log(eu.EVENTS.DISCONNECTED, {
        sessionIdHash: im.Session.hash(this.session.id)
      }), this.listener = void 0
    }
    get isDestroyed() {
      return this.destroyed
    }
    get connected() {
      return this._connected
    }
    set connected(e) {
      var r, n;
      this._connected = e, e && ((r = this.onceConnected) === null || r === void 0 || r.call(this)), (n = this.listener) === null || n === void 0 || n.connectedUpdated(e)
    }
    setOnceConnected(e) {
      return new Promise(r => {
        this.connected ? e().then(r) : this.onceConnected = () => {
          e().then(r), this.onceConnected = void 0
        }
      })
    }
    get linked() {
      return this._linked
    }
    set linked(e) {
      var r, n;
      this._linked = e, e && ((r = this.onceLinked) === null || r === void 0 || r.call(this)), (n = this.listener) === null || n === void 0 || n.linkedUpdated(e)
    }
    setOnceLinked(e) {
      return new Promise(r => {
        this.linked ? e().then(r) : this.onceLinked = () => {
          e().then(r), this.onceLinked = void 0
        }
      })
    }
    async handleIncomingEvent(e) {
      var r, n;
      if (!(e.type !== "Event" || e.event !== "Web3Response")) try {
        const i = await this.cipher.decrypt(e.data),
          s = JSON.parse(i);
        if (s.type !== "WEB3_RESPONSE") return;
        (r = this.listener) === null || r === void 0 || r.handleWeb3ResponseMessage(s)
      } catch {
        (n = this.diagnostic) === null || n === void 0 || n.log(eu.EVENTS.GENERAL_ERROR, {
          message: "Had error decrypting",
          value: "incomingEvent"
        })
      }
    }
    async checkUnseenEvents() {
      if (!this.connected) {
        this.shouldFetchUnseenEventsOnConnect = !0;
        return
      }
      await new Promise(e => setTimeout(e, 250));
      try {
        await this.fetchUnseenEventsAPI()
      } catch (e) {
        console.error("Unable to check for unseen events", e)
      }
    }
    async fetchUnseenEventsAPI() {
      this.shouldFetchUnseenEventsOnConnect = !1, (await this.http.fetchUnseenEvents()).forEach(r => this.handleIncomingEvent(r))
    }
    async setSessionMetadata(e, r) {
      const n = {
        type: "SetSessionConfig",
        id: (0, nm.IntNumber)(this.nextReqId++),
        sessionId: this.session.id,
        metadata: {
          [e]: r
        }
      };
      return this.setOnceConnected(async () => {
        const i = await this.makeRequest(n);
        if (i.type === "Fail") throw new Error(i.error || "failed to set session metadata")
      })
    }
    async publishEvent(e, r, n = !1) {
      const i = await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({}, r), {
          origin: location.origin,
          relaySource: window.coinbaseWalletExtension ? "injected_sdk" : "sdk"
        }))),
        s = {
          type: "PublishEvent",
          id: (0, nm.IntNumber)(this.nextReqId++),
          sessionId: this.session.id,
          event: e,
          data: i,
          callWebhook: n
        };
      return this.setOnceLinked(async () => {
        const o = await this.makeRequest(s);
        if (o.type === "Fail") throw new Error(o.error || "failed to publish event");
        return o.eventId
      })
    }
    sendData(e) {
      this.ws.sendData(JSON.stringify(e))
    }
    updateLastHeartbeat() {
      this.lastHeartbeatResponse = Date.now()
    }
    heartbeat() {
      if (Date.now() - this.lastHeartbeatResponse > oz * 2) {
        this.ws.disconnect();
        return
      }
      try {
        this.ws.sendData("h")
      } catch {}
    }
    async makeRequest(e, r = Exe) {
      const n = e.id;
      this.sendData(e);
      let i;
      return Promise.race([new Promise((s, o) => {
        i = window.setTimeout(() => {
          o(new Error(`request ${n} timed out`))
        }, r)
      }), new Promise(s => {
        this.requestResolutions.set(n, o => {
          clearTimeout(i), s(o), this.requestResolutions.delete(n)
        })
      })])
    }
    async authenticate() {
      const e = {
          type: "HostSession",
          id: (0, nm.IntNumber)(this.nextReqId++),
          sessionId: this.session.id,
          sessionKey: this.session.key
        },
        r = await this.makeRequest(e);
      if (r.type === "Fail") throw new Error(r.error || "failed to authentcate")
    }
    sendIsLinked() {
      const e = {
        type: "IsLinked",
        id: (0, nm.IntNumber)(this.nextReqId++),
        sessionId: this.session.id
      };
      this.sendData(e)
    }
    sendGetSessionConfig() {
      const e = {
        type: "GetSessionConfig",
        id: (0, nm.IntNumber)(this.nextReqId++),
        sessionId: this.session.id
      };
      this.sendData(e)
    }
  }
  P6.WalletLinkConnection = Axe;
  var Tb = {},
    kb = {},
    oS = {};
  Object.defineProperty(oS, "__esModule", {
    value: !0
  }), oS.default = '@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';
  var Sxe = ot && ot.__importDefault || function (t) {
    return t && t.__esModule ? t : {
      default: t
    }
  };
  Object.defineProperty(kb, "__esModule", {
    value: !0
  }), kb.injectCssReset = void 0;
  const Ixe = Sxe(oS);

  function Txe() {
    const t = document.createElement("style");
    t.type = "text/css", t.appendChild(document.createTextNode(Ixe.default)), document.documentElement.appendChild(t)
  }
  kb.injectCssReset = Txe;
  var B6 = {};
  const _o = bu(a7e);
  var U6 = {};
  const Rb = bu(J_e),
    j6 = bu(w7e);
  var sm = {},
    F6 = {};
  Object.defineProperty(F6, "__esModule", {
    value: !0
  }), F6.CloseIcon = void 0;
  const az = _o;

  function kxe(t) {
    return (0, az.h)("svg", Object.assign({
      width: "40",
      height: "40",
      viewBox: "0 0 40 40",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg"
    }, t), (0, az.h)("path", {
      d: "M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"
    }))
  }
  F6.CloseIcon = kxe;
  var W6 = {};
  Object.defineProperty(W6, "__esModule", {
    value: !0
  }), W6.CoinbaseWalletRound = void 0;
  const z6 = _o;

  function Rxe(t) {
    return (0, z6.h)("svg", Object.assign({
      width: "28",
      height: "28",
      viewBox: "0 0 28 28",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg"
    }, t), (0, z6.h)("circle", {
      cx: "14",
      cy: "14",
      r: "14",
      fill: "#0052FF"
    }), (0, z6.h)("path", {
      d: "M23.8521 14.0003C23.8521 19.455 19.455 23.8521 14.0003 23.8521C8.54559 23.8521 4.14844 19.455 4.14844 14.0003C4.14844 8.54559 8.54559 4.14844 14.0003 4.14844C19.455 4.14844 23.8521 8.54559 23.8521 14.0003Z",
      fill: "white"
    }), (0, z6.h)("path", {
      d: "M11.1855 12.5042C11.1855 12.0477 11.1855 11.7942 11.2835 11.642C11.3814 11.4899 11.4793 11.3377 11.6261 11.287C11.8219 11.1855 12.0178 11.1855 12.5073 11.1855H15.4934C15.983 11.1855 16.1788 11.1855 16.3746 11.287C16.5215 11.3884 16.6683 11.4899 16.7173 11.642C16.8152 11.8449 16.8152 12.0477 16.8152 12.5042V15.4965C16.8152 15.953 16.8152 16.2066 16.7173 16.3587C16.6194 16.5109 16.5215 16.663 16.3746 16.7137C16.1788 16.8152 15.983 16.8152 15.4934 16.8152H12.5073C12.0178 16.8152 11.8219 16.8152 11.6261 16.7137C11.4793 16.6123 11.3324 16.5109 11.2835 16.3587C11.1855 16.1558 11.1855 15.953 11.1855 15.4965V12.5042Z",
      fill: "#0052FF"
    }))
  }
  W6.CoinbaseWalletRound = Rxe;
  var H6 = {};
  Object.defineProperty(H6, "__esModule", {
    value: !0
  }), H6.QRCodeIcon = void 0;
  const Nb = _o;

  function Nxe(t) {
    return (0, Nb.h)("svg", Object.assign({
      width: "18",
      height: "18",
      viewBox: "0 0 24 24",
      xmlns: "http://www.w3.org/2000/svg"
    }, t), (0, Nb.h)("path", {
      d: "M3 3V8.99939L5 8.99996V5H9V3H3Z"
    }), (0, Nb.h)("path", {
      d: "M15 21L21 21V15.0006L19 15V19L15 19V21Z"
    }), (0, Nb.h)("path", {
      d: "M21 9H19V5H15.0006L15 3H21V9Z"
    }), (0, Nb.h)("path", {
      d: "M3 15V21H8.99939L8.99996 19H5L5 15H3Z"
    }))
  }
  H6.QRCodeIcon = Nxe;
  var q6 = {};

  function cz(t) {
    this.mode = Go.MODE_8BIT_BYTE, this.data = t, this.parsedData = [];
    for (var e = 0, r = this.data.length; e < r; e++) {
      var n = [],
        i = this.data.charCodeAt(e);
      i > 65536 ? (n[0] = 240 | (i & 1835008) >>> 18, n[1] = 128 | (i & 258048) >>> 12, n[2] = 128 | (i & 4032) >>> 6, n[3] = 128 | i & 63) : i > 2048 ? (n[0] = 224 | (i & 61440) >>> 12, n[1] = 128 | (i & 4032) >>> 6, n[2] = 128 | i & 63) : i > 128 ? (n[0] = 192 | (i & 1984) >>> 6, n[1] = 128 | i & 63) : n[0] = i, this.parsedData.push(n)
    }
    this.parsedData = Array.prototype.concat.apply([], this.parsedData), this.parsedData.length != this.data.length && (this.parsedData.unshift(191), this.parsedData.unshift(187), this.parsedData.unshift(239))
  }
  cz.prototype = {
    getLength: function (t) {
      return this.parsedData.length
    },
    write: function (t) {
      for (var e = 0, r = this.parsedData.length; e < r; e++) t.put(this.parsedData[e], 8)
    }
  };

  function tu(t, e) {
    this.typeNumber = t, this.errorCorrectLevel = e, this.modules = null, this.moduleCount = 0, this.dataCache = null, this.dataList = []
  }
  tu.prototype = {
    addData: function (t) {
      var e = new cz(t);
      this.dataList.push(e), this.dataCache = null
    },
    isDark: function (t, e) {
      if (t < 0 || this.moduleCount <= t || e < 0 || this.moduleCount <= e) throw new Error(t + "," + e);
      return this.modules[t][e]
    },
    getModuleCount: function () {
      return this.moduleCount
    },
    make: function () {
      this.makeImpl(!1, this.getBestMaskPattern())
    },
    makeImpl: function (t, e) {
      this.moduleCount = this.typeNumber * 4 + 17, this.modules = new Array(this.moduleCount);
      for (var r = 0; r < this.moduleCount; r++) {
        this.modules[r] = new Array(this.moduleCount);
        for (var n = 0; n < this.moduleCount; n++) this.modules[r][n] = null
      }
      this.setupPositionProbePattern(0, 0), this.setupPositionProbePattern(this.moduleCount - 7, 0), this.setupPositionProbePattern(0, this.moduleCount - 7), this.setupPositionAdjustPattern(), this.setupTimingPattern(), this.setupTypeInfo(t, e), this.typeNumber >= 7 && this.setupTypeNumber(t), this.dataCache == null && (this.dataCache = tu.createData(this.typeNumber, this.errorCorrectLevel, this.dataList)), this.mapData(this.dataCache, e)
    },
    setupPositionProbePattern: function (t, e) {
      for (var r = -1; r <= 7; r++)
        if (!(t + r <= -1 || this.moduleCount <= t + r))
          for (var n = -1; n <= 7; n++) e + n <= -1 || this.moduleCount <= e + n || (0 <= r && r <= 6 && (n == 0 || n == 6) || 0 <= n && n <= 6 && (r == 0 || r == 6) || 2 <= r && r <= 4 && 2 <= n && n <= 4 ? this.modules[t + r][e + n] = !0 : this.modules[t + r][e + n] = !1)
    },
    getBestMaskPattern: function () {
      for (var t = 0, e = 0, r = 0; r < 8; r++) {
        this.makeImpl(!0, r);
        var n = jn.getLostPoint(this);
        (r == 0 || t > n) && (t = n, e = r)
      }
      return e
    },
    createMovieClip: function (t, e, r) {
      var n = t.createEmptyMovieClip(e, r),
        i = 1;
      this.make();
      for (var s = 0; s < this.modules.length; s++)
        for (var o = s * i, a = 0; a < this.modules[s].length; a++) {
          var c = a * i,
            l = this.modules[s][a];
          l && (n.beginFill(0, 100), n.moveTo(c, o), n.lineTo(c + i, o), n.lineTo(c + i, o + i), n.lineTo(c, o + i), n.endFill())
        }
      return n
    },
    setupTimingPattern: function () {
      for (var t = 8; t < this.moduleCount - 8; t++) this.modules[t][6] == null && (this.modules[t][6] = t % 2 == 0);
      for (var e = 8; e < this.moduleCount - 8; e++) this.modules[6][e] == null && (this.modules[6][e] = e % 2 == 0)
    },
    setupPositionAdjustPattern: function () {
      for (var t = jn.getPatternPosition(this.typeNumber), e = 0; e < t.length; e++)
        for (var r = 0; r < t.length; r++) {
          var n = t[e],
            i = t[r];
          if (this.modules[n][i] == null)
            for (var s = -2; s <= 2; s++)
              for (var o = -2; o <= 2; o++) s == -2 || s == 2 || o == -2 || o == 2 || s == 0 && o == 0 ? this.modules[n + s][i + o] = !0 : this.modules[n + s][i + o] = !1
        }
    },
    setupTypeNumber: function (t) {
      for (var e = jn.getBCHTypeNumber(this.typeNumber), r = 0; r < 18; r++) {
        var n = !t && (e >> r & 1) == 1;
        this.modules[Math.floor(r / 3)][r % 3 + this.moduleCount - 8 - 3] = n
      }
      for (var r = 0; r < 18; r++) {
        var n = !t && (e >> r & 1) == 1;
        this.modules[r % 3 + this.moduleCount - 8 - 3][Math.floor(r / 3)] = n
      }
    },
    setupTypeInfo: function (t, e) {
      for (var r = this.errorCorrectLevel << 3 | e, n = jn.getBCHTypeInfo(r), i = 0; i < 15; i++) {
        var s = !t && (n >> i & 1) == 1;
        i < 6 ? this.modules[i][8] = s : i < 8 ? this.modules[i + 1][8] = s : this.modules[this.moduleCount - 15 + i][8] = s
      }
      for (var i = 0; i < 15; i++) {
        var s = !t && (n >> i & 1) == 1;
        i < 8 ? this.modules[8][this.moduleCount - i - 1] = s : i < 9 ? this.modules[8][15 - i - 1 + 1] = s : this.modules[8][15 - i - 1] = s
      }
      this.modules[this.moduleCount - 8][8] = !t
    },
    mapData: function (t, e) {
      for (var r = -1, n = this.moduleCount - 1, i = 7, s = 0, o = this.moduleCount - 1; o > 0; o -= 2)
        for (o == 6 && o--;;) {
          for (var a = 0; a < 2; a++)
            if (this.modules[n][o - a] == null) {
              var c = !1;
              s < t.length && (c = (t[s] >>> i & 1) == 1);
              var l = jn.getMask(e, n, o - a);
              l && (c = !c), this.modules[n][o - a] = c, i--, i == -1 && (s++, i = 7)
            } if (n += r, n < 0 || this.moduleCount <= n) {
            n -= r, r = -r;
            break
          }
        }
    }
  }, tu.PAD0 = 236, tu.PAD1 = 17, tu.createData = function (t, e, r) {
    for (var n = ru.getRSBlocks(t, e), i = new lz, s = 0; s < r.length; s++) {
      var o = r[s];
      i.put(o.mode, 4), i.put(o.getLength(), jn.getLengthInBits(o.mode, t)), o.write(i)
    }
    for (var a = 0, s = 0; s < n.length; s++) a += n[s].dataCount;
    if (i.getLengthInBits() > a * 8) throw new Error("code length overflow. (" + i.getLengthInBits() + ">" + a * 8 + ")");
    for (i.getLengthInBits() + 4 <= a * 8 && i.put(0, 4); i.getLengthInBits() % 8 != 0;) i.putBit(!1);
    for (; !(i.getLengthInBits() >= a * 8 || (i.put(tu.PAD0, 8), i.getLengthInBits() >= a * 8));) i.put(tu.PAD1, 8);
    return tu.createBytes(i, n)
  }, tu.createBytes = function (t, e) {
    for (var r = 0, n = 0, i = 0, s = new Array(e.length), o = new Array(e.length), a = 0; a < e.length; a++) {
      var c = e[a].dataCount,
        l = e[a].totalCount - c;
      n = Math.max(n, c), i = Math.max(i, l), s[a] = new Array(c);
      for (var h = 0; h < s[a].length; h++) s[a][h] = 255 & t.buffer[h + r];
      r += c;
      var f = jn.getErrorCorrectPolynomial(l),
        w = new om(s[a], f.getLength() - 1),
        b = w.mod(f);
      o[a] = new Array(f.getLength() - 1);
      for (var h = 0; h < o[a].length; h++) {
        var C = h + b.getLength() - o[a].length;
        o[a][h] = C >= 0 ? b.get(C) : 0
      }
    }
    for (var M = 0, h = 0; h < e.length; h++) M += e[h].totalCount;
    for (var N = new Array(M), $ = 0, h = 0; h < n; h++)
      for (var a = 0; a < e.length; a++) h < s[a].length && (N[$++] = s[a][h]);
    for (var h = 0; h < i; h++)
      for (var a = 0; a < e.length; a++) h < o[a].length && (N[$++] = o[a][h]);
    return N
  };
  for (var Go = {
      MODE_NUMBER: 1,
      MODE_ALPHA_NUM: 2,
      MODE_8BIT_BYTE: 4,
      MODE_KANJI: 8
    }, Kh = {
      L: 1,
      M: 0,
      Q: 3,
      H: 2
    }, Gh = {
      PATTERN000: 0,
      PATTERN001: 1,
      PATTERN010: 2,
      PATTERN011: 3,
      PATTERN100: 4,
      PATTERN101: 5,
      PATTERN110: 6,
      PATTERN111: 7
    }, jn = {
      PATTERN_POSITION_TABLE: [
        [],
        [6, 18],
        [6, 22],
        [6, 26],
        [6, 30],
        [6, 34],
        [6, 22, 38],
        [6, 24, 42],
        [6, 26, 46],
        [6, 28, 50],
        [6, 30, 54],
        [6, 32, 58],
        [6, 34, 62],
        [6, 26, 46, 66],
        [6, 26, 48, 70],
        [6, 26, 50, 74],
        [6, 30, 54, 78],
        [6, 30, 56, 82],
        [6, 30, 58, 86],
        [6, 34, 62, 90],
        [6, 28, 50, 72, 94],
        [6, 26, 50, 74, 98],
        [6, 30, 54, 78, 102],
        [6, 28, 54, 80, 106],
        [6, 32, 58, 84, 110],
        [6, 30, 58, 86, 114],
        [6, 34, 62, 90, 118],
        [6, 26, 50, 74, 98, 122],
        [6, 30, 54, 78, 102, 126],
        [6, 26, 52, 78, 104, 130],
        [6, 30, 56, 82, 108, 134],
        [6, 34, 60, 86, 112, 138],
        [6, 30, 58, 86, 114, 142],
        [6, 34, 62, 90, 118, 146],
        [6, 30, 54, 78, 102, 126, 150],
        [6, 24, 50, 76, 102, 128, 154],
        [6, 28, 54, 80, 106, 132, 158],
        [6, 32, 58, 84, 110, 136, 162],
        [6, 26, 54, 82, 110, 138, 166],
        [6, 30, 58, 86, 114, 142, 170]
      ],
      G15: 1335,
      G18: 7973,
      G15_MASK: 21522,
      getBCHTypeInfo: function (t) {
        for (var e = t << 10; jn.getBCHDigit(e) - jn.getBCHDigit(jn.G15) >= 0;) e ^= jn.G15 << jn.getBCHDigit(e) - jn.getBCHDigit(jn.G15);
        return (t << 10 | e) ^ jn.G15_MASK
      },
      getBCHTypeNumber: function (t) {
        for (var e = t << 12; jn.getBCHDigit(e) - jn.getBCHDigit(jn.G18) >= 0;) e ^= jn.G18 << jn.getBCHDigit(e) - jn.getBCHDigit(jn.G18);
        return t << 12 | e
      },
      getBCHDigit: function (t) {
        for (var e = 0; t != 0;) e++, t >>>= 1;
        return e
      },
      getPatternPosition: function (t) {
        return jn.PATTERN_POSITION_TABLE[t - 1]
      },
      getMask: function (t, e, r) {
        switch (t) {
          case Gh.PATTERN000:
            return (e + r) % 2 == 0;
          case Gh.PATTERN001:
            return e % 2 == 0;
          case Gh.PATTERN010:
            return r % 3 == 0;
          case Gh.PATTERN011:
            return (e + r) % 3 == 0;
          case Gh.PATTERN100:
            return (Math.floor(e / 2) + Math.floor(r / 3)) % 2 == 0;
          case Gh.PATTERN101:
            return e * r % 2 + e * r % 3 == 0;
          case Gh.PATTERN110:
            return (e * r % 2 + e * r % 3) % 2 == 0;
          case Gh.PATTERN111:
            return (e * r % 3 + (e + r) % 2) % 2 == 0;
          default:
            throw new Error("bad maskPattern:" + t)
        }
      },
      getErrorCorrectPolynomial: function (t) {
        for (var e = new om([1], 0), r = 0; r < t; r++) e = e.multiply(new om([1, Yi.gexp(r)], 0));
        return e
      },
      getLengthInBits: function (t, e) {
        if (1 <= e && e < 10) switch (t) {
          case Go.MODE_NUMBER:
            return 10;
          case Go.MODE_ALPHA_NUM:
            return 9;
          case Go.MODE_8BIT_BYTE:
            return 8;
          case Go.MODE_KANJI:
            return 8;
          default:
            throw new Error("mode:" + t)
        } else if (e < 27) switch (t) {
          case Go.MODE_NUMBER:
            return 12;
          case Go.MODE_ALPHA_NUM:
            return 11;
          case Go.MODE_8BIT_BYTE:
            return 16;
          case Go.MODE_KANJI:
            return 10;
          default:
            throw new Error("mode:" + t)
        } else if (e < 41) switch (t) {
          case Go.MODE_NUMBER:
            return 14;
          case Go.MODE_ALPHA_NUM:
            return 13;
          case Go.MODE_8BIT_BYTE:
            return 16;
          case Go.MODE_KANJI:
            return 12;
          default:
            throw new Error("mode:" + t)
        } else throw new Error("type:" + e)
      },
      getLostPoint: function (t) {
        for (var e = t.getModuleCount(), r = 0, n = 0; n < e; n++)
          for (var i = 0; i < e; i++) {
            for (var s = 0, o = t.isDark(n, i), a = -1; a <= 1; a++)
              if (!(n + a < 0 || e <= n + a))
                for (var c = -1; c <= 1; c++) i + c < 0 || e <= i + c || a == 0 && c == 0 || o == t.isDark(n + a, i + c) && s++;
            s > 5 && (r += 3 + s - 5)
          }
        for (var n = 0; n < e - 1; n++)
          for (var i = 0; i < e - 1; i++) {
            var l = 0;
            t.isDark(n, i) && l++, t.isDark(n + 1, i) && l++, t.isDark(n, i + 1) && l++, t.isDark(n + 1, i + 1) && l++, (l == 0 || l == 4) && (r += 3)
          }
        for (var n = 0; n < e; n++)
          for (var i = 0; i < e - 6; i++) t.isDark(n, i) && !t.isDark(n, i + 1) && t.isDark(n, i + 2) && t.isDark(n, i + 3) && t.isDark(n, i + 4) && !t.isDark(n, i + 5) && t.isDark(n, i + 6) && (r += 40);
        for (var i = 0; i < e; i++)
          for (var n = 0; n < e - 6; n++) t.isDark(n, i) && !t.isDark(n + 1, i) && t.isDark(n + 2, i) && t.isDark(n + 3, i) && t.isDark(n + 4, i) && !t.isDark(n + 5, i) && t.isDark(n + 6, i) && (r += 40);
        for (var h = 0, i = 0; i < e; i++)
          for (var n = 0; n < e; n++) t.isDark(n, i) && h++;
        var f = Math.abs(100 * h / e / e - 50) / 5;
        return r += f * 10, r
      }
    }, Yi = {
      glog: function (t) {
        if (t < 1) throw new Error("glog(" + t + ")");
        return Yi.LOG_TABLE[t]
      },
      gexp: function (t) {
        for (; t < 0;) t += 255;
        for (; t >= 256;) t -= 255;
        return Yi.EXP_TABLE[t]
      },
      EXP_TABLE: new Array(256),
      LOG_TABLE: new Array(256)
    }, ds = 0; ds < 8; ds++) Yi.EXP_TABLE[ds] = 1 << ds;
  for (var ds = 8; ds < 256; ds++) Yi.EXP_TABLE[ds] = Yi.EXP_TABLE[ds - 4] ^ Yi.EXP_TABLE[ds - 5] ^ Yi.EXP_TABLE[ds - 6] ^ Yi.EXP_TABLE[ds - 8];
  for (var ds = 0; ds < 255; ds++) Yi.LOG_TABLE[Yi.EXP_TABLE[ds]] = ds;

  function om(t, e) {
    if (t.length == null) throw new Error(t.length + "/" + e);
    for (var r = 0; r < t.length && t[r] == 0;) r++;
    this.num = new Array(t.length - r + e);
    for (var n = 0; n < t.length - r; n++) this.num[n] = t[n + r]
  }
  om.prototype = {
    get: function (t) {
      return this.num[t]
    },
    getLength: function () {
      return this.num.length
    },
    multiply: function (t) {
      for (var e = new Array(this.getLength() + t.getLength() - 1), r = 0; r < this.getLength(); r++)
        for (var n = 0; n < t.getLength(); n++) e[r + n] ^= Yi.gexp(Yi.glog(this.get(r)) + Yi.glog(t.get(n)));
      return new om(e, 0)
    },
    mod: function (t) {
      if (this.getLength() - t.getLength() < 0) return this;
      for (var e = Yi.glog(this.get(0)) - Yi.glog(t.get(0)), r = new Array(this.getLength()), n = 0; n < this.getLength(); n++) r[n] = this.get(n);
      for (var n = 0; n < t.getLength(); n++) r[n] ^= Yi.gexp(Yi.glog(t.get(n)) + e);
      return new om(r, 0).mod(t)
    }
  };

  function ru(t, e) {
    this.totalCount = t, this.dataCount = e
  }
  ru.RS_BLOCK_TABLE = [
    [1, 26, 19],
    [1, 26, 16],
    [1, 26, 13],
    [1, 26, 9],
    [1, 44, 34],
    [1, 44, 28],
    [1, 44, 22],
    [1, 44, 16],
    [1, 70, 55],
    [1, 70, 44],
    [2, 35, 17],
    [2, 35, 13],
    [1, 100, 80],
    [2, 50, 32],
    [2, 50, 24],
    [4, 25, 9],
    [1, 134, 108],
    [2, 67, 43],
    [2, 33, 15, 2, 34, 16],
    [2, 33, 11, 2, 34, 12],
    [2, 86, 68],
    [4, 43, 27],
    [4, 43, 19],
    [4, 43, 15],
    [2, 98, 78],
    [4, 49, 31],
    [2, 32, 14, 4, 33, 15],
    [4, 39, 13, 1, 40, 14],
    [2, 121, 97],
    [2, 60, 38, 2, 61, 39],
    [4, 40, 18, 2, 41, 19],
    [4, 40, 14, 2, 41, 15],
    [2, 146, 116],
    [3, 58, 36, 2, 59, 37],
    [4, 36, 16, 4, 37, 17],
    [4, 36, 12, 4, 37, 13],
    [2, 86, 68, 2, 87, 69],
    [4, 69, 43, 1, 70, 44],
    [6, 43, 19, 2, 44, 20],
    [6, 43, 15, 2, 44, 16],
    [4, 101, 81],
    [1, 80, 50, 4, 81, 51],
    [4, 50, 22, 4, 51, 23],
    [3, 36, 12, 8, 37, 13],
    [2, 116, 92, 2, 117, 93],
    [6, 58, 36, 2, 59, 37],
    [4, 46, 20, 6, 47, 21],
    [7, 42, 14, 4, 43, 15],
    [4, 133, 107],
    [8, 59, 37, 1, 60, 38],
    [8, 44, 20, 4, 45, 21],
    [12, 33, 11, 4, 34, 12],
    [3, 145, 115, 1, 146, 116],
    [4, 64, 40, 5, 65, 41],
    [11, 36, 16, 5, 37, 17],
    [11, 36, 12, 5, 37, 13],
    [5, 109, 87, 1, 110, 88],
    [5, 65, 41, 5, 66, 42],
    [5, 54, 24, 7, 55, 25],
    [11, 36, 12],
    [5, 122, 98, 1, 123, 99],
    [7, 73, 45, 3, 74, 46],
    [15, 43, 19, 2, 44, 20],
    [3, 45, 15, 13, 46, 16],
    [1, 135, 107, 5, 136, 108],
    [10, 74, 46, 1, 75, 47],
    [1, 50, 22, 15, 51, 23],
    [2, 42, 14, 17, 43, 15],
    [5, 150, 120, 1, 151, 121],
    [9, 69, 43, 4, 70, 44],
    [17, 50, 22, 1, 51, 23],
    [2, 42, 14, 19, 43, 15],
    [3, 141, 113, 4, 142, 114],
    [3, 70, 44, 11, 71, 45],
    [17, 47, 21, 4, 48, 22],
    [9, 39, 13, 16, 40, 14],
    [3, 135, 107, 5, 136, 108],
    [3, 67, 41, 13, 68, 42],
    [15, 54, 24, 5, 55, 25],
    [15, 43, 15, 10, 44, 16],
    [4, 144, 116, 4, 145, 117],
    [17, 68, 42],
    [17, 50, 22, 6, 51, 23],
    [19, 46, 16, 6, 47, 17],
    [2, 139, 111, 7, 140, 112],
    [17, 74, 46],
    [7, 54, 24, 16, 55, 25],
    [34, 37, 13],
    [4, 151, 121, 5, 152, 122],
    [4, 75, 47, 14, 76, 48],
    [11, 54, 24, 14, 55, 25],
    [16, 45, 15, 14, 46, 16],
    [6, 147, 117, 4, 148, 118],
    [6, 73, 45, 14, 74, 46],
    [11, 54, 24, 16, 55, 25],
    [30, 46, 16, 2, 47, 17],
    [8, 132, 106, 4, 133, 107],
    [8, 75, 47, 13, 76, 48],
    [7, 54, 24, 22, 55, 25],
    [22, 45, 15, 13, 46, 16],
    [10, 142, 114, 2, 143, 115],
    [19, 74, 46, 4, 75, 47],
    [28, 50, 22, 6, 51, 23],
    [33, 46, 16, 4, 47, 17],
    [8, 152, 122, 4, 153, 123],
    [22, 73, 45, 3, 74, 46],
    [8, 53, 23, 26, 54, 24],
    [12, 45, 15, 28, 46, 16],
    [3, 147, 117, 10, 148, 118],
    [3, 73, 45, 23, 74, 46],
    [4, 54, 24, 31, 55, 25],
    [11, 45, 15, 31, 46, 16],
    [7, 146, 116, 7, 147, 117],
    [21, 73, 45, 7, 74, 46],
    [1, 53, 23, 37, 54, 24],
    [19, 45, 15, 26, 46, 16],
    [5, 145, 115, 10, 146, 116],
    [19, 75, 47, 10, 76, 48],
    [15, 54, 24, 25, 55, 25],
    [23, 45, 15, 25, 46, 16],
    [13, 145, 115, 3, 146, 116],
    [2, 74, 46, 29, 75, 47],
    [42, 54, 24, 1, 55, 25],
    [23, 45, 15, 28, 46, 16],
    [17, 145, 115],
    [10, 74, 46, 23, 75, 47],
    [10, 54, 24, 35, 55, 25],
    [19, 45, 15, 35, 46, 16],
    [17, 145, 115, 1, 146, 116],
    [14, 74, 46, 21, 75, 47],
    [29, 54, 24, 19, 55, 25],
    [11, 45, 15, 46, 46, 16],
    [13, 145, 115, 6, 146, 116],
    [14, 74, 46, 23, 75, 47],
    [44, 54, 24, 7, 55, 25],
    [59, 46, 16, 1, 47, 17],
    [12, 151, 121, 7, 152, 122],
    [12, 75, 47, 26, 76, 48],
    [39, 54, 24, 14, 55, 25],
    [22, 45, 15, 41, 46, 16],
    [6, 151, 121, 14, 152, 122],
    [6, 75, 47, 34, 76, 48],
    [46, 54, 24, 10, 55, 25],
    [2, 45, 15, 64, 46, 16],
    [17, 152, 122, 4, 153, 123],
    [29, 74, 46, 14, 75, 47],
    [49, 54, 24, 10, 55, 25],
    [24, 45, 15, 46, 46, 16],
    [4, 152, 122, 18, 153, 123],
    [13, 74, 46, 32, 75, 47],
    [48, 54, 24, 14, 55, 25],
    [42, 45, 15, 32, 46, 16],
    [20, 147, 117, 4, 148, 118],
    [40, 75, 47, 7, 76, 48],
    [43, 54, 24, 22, 55, 25],
    [10, 45, 15, 67, 46, 16],
    [19, 148, 118, 6, 149, 119],
    [18, 75, 47, 31, 76, 48],
    [34, 54, 24, 34, 55, 25],
    [20, 45, 15, 61, 46, 16]
  ], ru.getRSBlocks = function (t, e) {
    var r = ru.getRsBlockTable(t, e);
    if (r == null) throw new Error("bad rs block @ typeNumber:" + t + "/errorCorrectLevel:" + e);
    for (var n = r.length / 3, i = [], s = 0; s < n; s++)
      for (var o = r[s * 3 + 0], a = r[s * 3 + 1], c = r[s * 3 + 2], l = 0; l < o; l++) i.push(new ru(a, c));
    return i
  }, ru.getRsBlockTable = function (t, e) {
    switch (e) {
      case Kh.L:
        return ru.RS_BLOCK_TABLE[(t - 1) * 4 + 0];
      case Kh.M:
        return ru.RS_BLOCK_TABLE[(t - 1) * 4 + 1];
      case Kh.Q:
        return ru.RS_BLOCK_TABLE[(t - 1) * 4 + 2];
      case Kh.H:
        return ru.RS_BLOCK_TABLE[(t - 1) * 4 + 3];
      default:
        return
    }
  };

  function lz() {
    this.buffer = [], this.length = 0
  }
  lz.prototype = {
    get: function (t) {
      var e = Math.floor(t / 8);
      return (this.buffer[e] >>> 7 - t % 8 & 1) == 1
    },
    put: function (t, e) {
      for (var r = 0; r < e; r++) this.putBit((t >>> e - r - 1 & 1) == 1)
    },
    getLengthInBits: function () {
      return this.length
    },
    putBit: function (t) {
      var e = Math.floor(this.length / 8);
      this.buffer.length <= e && this.buffer.push(0), t && (this.buffer[e] |= 128 >>> this.length % 8), this.length++
    }
  };
  var aS = [
    [17, 14, 11, 7],
    [32, 26, 20, 14],
    [53, 42, 32, 24],
    [78, 62, 46, 34],
    [106, 84, 60, 44],
    [134, 106, 74, 58],
    [154, 122, 86, 64],
    [192, 152, 108, 84],
    [230, 180, 130, 98],
    [271, 213, 151, 119],
    [321, 251, 177, 137],
    [367, 287, 203, 155],
    [425, 331, 241, 177],
    [458, 362, 258, 194],
    [520, 412, 292, 220],
    [586, 450, 322, 250],
    [644, 504, 364, 280],
    [718, 560, 394, 310],
    [792, 624, 442, 338],
    [858, 666, 482, 382],
    [929, 711, 509, 403],
    [1003, 779, 565, 439],
    [1091, 857, 611, 461],
    [1171, 911, 661, 511],
    [1273, 997, 715, 535],
    [1367, 1059, 751, 593],
    [1465, 1125, 805, 625],
    [1528, 1190, 868, 658],
    [1628, 1264, 908, 698],
    [1732, 1370, 982, 742],
    [1840, 1452, 1030, 790],
    [1952, 1538, 1112, 842],
    [2068, 1628, 1168, 898],
    [2188, 1722, 1228, 958],
    [2303, 1809, 1283, 983],
    [2431, 1911, 1351, 1051],
    [2563, 1989, 1423, 1093],
    [2699, 2099, 1499, 1139],
    [2809, 2213, 1579, 1219],
    [2953, 2331, 1663, 1273]
  ];

  function uz(t) {
    if (this.options = {
        padding: 4,
        width: 256,
        height: 256,
        typeNumber: 4,
        color: "#000000",
        background: "#ffffff",
        ecl: "M",
        image: {
          svg: "",
          width: 0,
          height: 0
        }
      }, typeof t == "string" && (t = {
        content: t
      }), t)
      for (var e in t) this.options[e] = t[e];
    if (typeof this.options.content != "string") throw new Error("Expected 'content' as string!");
    if (this.options.content.length === 0) throw new Error("Expected 'content' to be non-empty!");
    if (!(this.options.padding >= 0)) throw new Error("Expected 'padding' value to be non-negative!");
    if (!(this.options.width > 0) || !(this.options.height > 0)) throw new Error("Expected 'width' or 'height' value to be higher than zero!");

    function r(c) {
      switch (c) {
        case "L":
          return Kh.L;
        case "M":
          return Kh.M;
        case "Q":
          return Kh.Q;
        case "H":
          return Kh.H;
        default:
          throw new Error("Unknwon error correction level: " + c)
      }
    }

    function n(c, l) {
      for (var h = i(c), f = 1, w = 0, b = 0, C = aS.length; b <= C; b++) {
        var M = aS[b];
        if (!M) throw new Error("Content too long: expected " + w + " but got " + h);
        switch (l) {
          case "L":
            w = M[0];
            break;
          case "M":
            w = M[1];
            break;
          case "Q":
            w = M[2];
            break;
          case "H":
            w = M[3];
            break;
          default:
            throw new Error("Unknwon error correction level: " + l)
        }
        if (h <= w) break;
        f++
      }
      if (f > aS.length) throw new Error("Content too long");
      return f
    }

    function i(c) {
      var l = encodeURI(c).toString().replace(/\%[0-9a-fA-F]{2}/g, "a");
      return l.length + (l.length != c ? 3 : 0)
    }
    var s = this.options.content,
      o = n(s, this.options.ecl),
      a = r(this.options.ecl);
    this.qrcode = new tu(o, a), this.qrcode.addData(s), this.qrcode.make()
  }
  uz.prototype.svg = function (t) {
    var e = this.options || {},
      r = this.qrcode.modules;
    typeof t > "u" && (t = {
      container: e.container || "svg"
    });
    for (var n = typeof e.pretty < "u" ? !!e.pretty : !0, i = n ? "  " : "", s = n ? `\r
  ` : "", o = e.width, a = e.height, c = r.length, l = o / (c + 2 * e.padding), h = a / (c + 2 * e.padding), f = typeof e.join < "u" ? !!e.join : !1, w = typeof e.swap < "u" ? !!e.swap : !1, b = typeof e.xmlDeclaration < "u" ? !!e.xmlDeclaration : !0, C = typeof e.predefined < "u" ? !!e.predefined : !1, M = C ? i + '<defs><path id="qrmodule" d="M0 0 h' + h + " v" + l + ' H0 z" style="fill:' + e.color + ';shape-rendering:crispEdges;" /></defs>' + s : "", N = i + '<rect x="0" y="0" width="' + o + '" height="' + a + '" style="fill:' + e.background + ';shape-rendering:crispEdges;"/>' + s, $ = "", k = "", B = 0; B < c; B++)
      for (var F = 0; F < c; F++) {
        var D = r[F][B];
        if (D) {
          var V = F * l + e.padding * l,
            R = B * h + e.padding * h;
          if (w) {
            var P = V;
            V = R, R = P
          }
          if (f) {
            var j = l + V,
              Y = h + R;
            V = Number.isInteger(V) ? Number(V) : V.toFixed(2), R = Number.isInteger(R) ? Number(R) : R.toFixed(2), j = Number.isInteger(j) ? Number(j) : j.toFixed(2), Y = Number.isInteger(Y) ? Number(Y) : Y.toFixed(2), k += "M" + V + "," + R + " V" + Y + " H" + j + " V" + R + " H" + V + " Z "
          } else C ? $ += i + '<use x="' + V.toString() + '" y="' + R.toString() + '" href="#qrmodule" />' + s : $ += i + '<rect x="' + V.toString() + '" y="' + R.toString() + '" width="' + l + '" height="' + h + '" style="fill:' + e.color + ';shape-rendering:crispEdges;"/>' + s
        }
      }
    f && ($ = i + '<path x="0" y="0" style="fill:' + e.color + ';shape-rendering:crispEdges;" d="' + k + '" />');
    let U = "";
    if (this.options.image !== void 0 && this.options.image.svg) {
      const g = o * this.options.image.width / 100,
        u = a * this.options.image.height / 100,
        p = o / 2 - g / 2,
        v = a / 2 - u / 2;
      U += `<svg x="${p}" y="${v}" width="${g}" height="${u}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`, U += this.options.image.svg + s, U += "</svg>"
    }
    var I = "";
    switch (t.container) {
      case "svg":
        b && (I += '<?xml version="1.0" standalone="yes"?>' + s), I += '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="' + o + '" height="' + a + '">' + s, I += M + N + $, I += U, I += "</svg>";
        break;
      case "svg-viewbox":
        b && (I += '<?xml version="1.0" standalone="yes"?>' + s), I += '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 ' + o + " " + a + '">' + s, I += M + N + $, I += U, I += "</svg>";
        break;
      case "g":
        I += '<g width="' + o + '" height="' + a + '">' + s, I += M + N + $, I += U, I += "</g>";
        break;
      default:
        I += (M + N + $ + U).replace(/^\s+/, "");
        break
    }
    return I
  };
  var Mxe = uz,
    Pxe = ot && ot.__importDefault || function (t) {
      return t && t.__esModule ? t : {
        default: t
      }
    };
  Object.defineProperty(q6, "__esModule", {
    value: !0
  }), q6.QRCode = void 0;
  const $xe = _o,
    dz = j6,
    Oxe = Pxe(Mxe),
    Dxe = t => {
      const [e, r] = (0, dz.useState)("");
      return (0, dz.useEffect)(() => {
        var n, i;
        const s = new Oxe.default({
            content: t.content,
            background: t.bgColor || "#ffffff",
            color: t.fgColor || "#000000",
            container: "svg",
            ecl: "M",
            width: (n = t.width) !== null && n !== void 0 ? n : 256,
            height: (i = t.height) !== null && i !== void 0 ? i : 256,
            padding: 0,
            image: t.image
          }),
          o = Buffer.from(s.svg(), "utf8").toString("base64");
        r(`data:image/svg+xml;base64,${o}`)
      }, [t.bgColor, t.content, t.fgColor, t.height, t.image, t.width]), e ? (0, $xe.h)("img", {
        src: e,
        alt: "QR Code"
      }) : null
    };
  q6.QRCode = Dxe;
  var V6 = {},
    cS = {};
  Object.defineProperty(cS, "__esModule", {
    value: !0
  }), cS.default = ".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";
  var Lxe = ot && ot.__importDefault || function (t) {
    return t && t.__esModule ? t : {
      default: t
    }
  };
  Object.defineProperty(V6, "__esModule", {
    value: !0
  }), V6.Spinner = void 0;
  const K6 = _o,
    Bxe = Lxe(cS),
    Uxe = t => {
      var e;
      const r = (e = t.size) !== null && e !== void 0 ? e : 64,
        n = t.color || "#000";
      return (0, K6.h)("div", {
        class: "-cbwsdk-spinner"
      }, (0, K6.h)("style", null, Bxe.default), (0, K6.h)("svg", {
        viewBox: "0 0 100 100",
        xmlns: "http://www.w3.org/2000/svg",
        style: {
          width: r,
          height: r
        }
      }, (0, K6.h)("circle", {
        style: {
          cx: 50,
          cy: 50,
          r: 45,
          stroke: n
        }
      })))
    };
  V6.Spinner = Uxe;
  var lS = {};
  Object.defineProperty(lS, "__esModule", {
    value: !0
  }), lS.default = ".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer;border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";
  var hz = ot && ot.__importDefault || function (t) {
    return t && t.__esModule ? t : {
      default: t
    }
  };
  Object.defineProperty(sm, "__esModule", {
    value: !0
  }), sm.CoinbaseWalletSteps = sm.ConnectContent = void 0;
  const np = hz(Rb),
    Wr = _o,
    jxe = jt,
    Fxe = Yg,
    Wxe = F6,
    zxe = W6,
    Hxe = H6,
    qxe = q6,
    Vxe = V6,
    Kxe = hz(lS),
    uS = {
      title: "Coinbase Wallet app",
      description: "Connect with your self-custody wallet",
      steps: fz
    },
    Gxe = t => t === "light" ? "#FFFFFF" : "#0A0B0D";

  function Zxe(t) {
    const {
      theme: e
    } = t, r = (0, jxe.createQrUrl)(t.sessionId, t.sessionSecret, t.linkAPIUrl, t.isParentConnection, t.version, t.chainId), n = uS.steps;
    return (0, Wr.h)("div", {
      "data-testid": "connect-content",
      className: (0, np.default)("-cbwsdk-connect-content", e)
    }, (0, Wr.h)("style", null, Kxe.default), (0, Wr.h)("div", {
      className: "-cbwsdk-connect-content-header"
    }, (0, Wr.h)("h2", {
      className: (0, np.default)("-cbwsdk-connect-content-heading", e)
    }, "Scan to connect with our mobile app"), t.onCancel && (0, Wr.h)("button", {
      type: "button",
      className: "-cbwsdk-cancel-button",
      onClick: t.onCancel
    }, (0, Wr.h)(Wxe.CloseIcon, {
      fill: e === "light" ? "#0A0B0D" : "#FFFFFF"
    }))), (0, Wr.h)("div", {
      className: "-cbwsdk-connect-content-layout"
    }, (0, Wr.h)("div", {
      className: "-cbwsdk-connect-content-column-left"
    }, (0, Wr.h)(Yxe, {
      title: uS.title,
      description: uS.description,
      theme: e
    })), (0, Wr.h)("div", {
      className: "-cbwsdk-connect-content-column-right"
    }, (0, Wr.h)("div", {
      className: "-cbwsdk-connect-content-qr-wrapper"
    }, (0, Wr.h)(qxe.QRCode, {
      content: r,
      width: 200,
      height: 200,
      fgColor: "#000",
      bgColor: "transparent"
    }), (0, Wr.h)("input", {
      type: "hidden",
      name: "cbw-cbwsdk-version",
      value: Fxe.LIB_VERSION
    }), (0, Wr.h)("input", {
      type: "hidden",
      value: r
    })), (0, Wr.h)(n, {
      theme: e
    }), !t.isConnected && (0, Wr.h)("div", {
      "data-testid": "connecting-spinner",
      className: (0, np.default)("-cbwsdk-connect-content-qr-connecting", e)
    }, (0, Wr.h)(Vxe.Spinner, {
      size: 36,
      color: e === "dark" ? "#FFF" : "#000"
    }), (0, Wr.h)("p", null, "Connecting...")))))
  }
  sm.ConnectContent = Zxe;

  function Yxe({
    title: t,
    description: e,
    theme: r
  }) {
    return (0, Wr.h)("div", {
      className: (0, np.default)("-cbwsdk-connect-item", r)
    }, (0, Wr.h)("div", null, (0, Wr.h)(zxe.CoinbaseWalletRound, null)), (0, Wr.h)("div", {
      className: "-cbwsdk-connect-item-copy-wrapper"
    }, (0, Wr.h)("h3", {
      className: "-cbwsdk-connect-item-title"
    }, t), (0, Wr.h)("p", {
      className: "-cbwsdk-connect-item-description"
    }, e)))
  }

  function fz({
    theme: t
  }) {
    return (0, Wr.h)("ol", {
      className: "-cbwsdk-wallet-steps"
    }, (0, Wr.h)("li", {
      className: (0, np.default)("-cbwsdk-wallet-steps-item", t)
    }, (0, Wr.h)("div", {
      className: "-cbwsdk-wallet-steps-item-wrapper"
    }, "Open Coinbase Wallet app")), (0, Wr.h)("li", {
      className: (0, np.default)("-cbwsdk-wallet-steps-item", t)
    }, (0, Wr.h)("div", {
      className: "-cbwsdk-wallet-steps-item-wrapper"
    }, (0, Wr.h)("span", null, "Tap ", (0, Wr.h)("strong", null, "Scan"), " "), (0, Wr.h)("span", {
      className: (0, np.default)("-cbwsdk-wallet-steps-pad-left", "-cbwsdk-wallet-steps-icon", t)
    }, (0, Wr.h)(Hxe.QRCodeIcon, {
      fill: Gxe(t)
    })))))
  }
  sm.CoinbaseWalletSteps = fz;
  var G6 = {},
    Z6 = {};
  Object.defineProperty(Z6, "__esModule", {
    value: !0
  }), Z6.ArrowLeftIcon = void 0;
  const pz = _o;

  function Qxe(t) {
    return (0, pz.h)("svg", Object.assign({
      width: "16",
      height: "16",
      viewBox: "0 0 16 16",
      xmlns: "http://www.w3.org/2000/svg"
    }, t), (0, pz.h)("path", {
      d: "M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"
    }))
  }
  Z6.ArrowLeftIcon = Qxe;
  var Y6 = {};
  Object.defineProperty(Y6, "__esModule", {
    value: !0
  }), Y6.LaptopIcon = void 0;
  const dS = _o;

  function Jxe(t) {
    return (0, dS.h)("svg", Object.assign({
      width: "14",
      height: "14",
      viewBox: "0 0 14 14",
      xmlns: "http://www.w3.org/2000/svg"
    }, t), (0, dS.h)("path", {
      d: "M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"
    }), (0, dS.h)("path", {
      d: "M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"
    }))
  }
  Y6.LaptopIcon = Jxe;
  var Q6 = {};
  Object.defineProperty(Q6, "__esModule", {
    value: !0
  }), Q6.SafeIcon = void 0;
  const gz = _o;

  function Xxe(t) {
    return (0, gz.h)("svg", Object.assign({
      width: "14",
      height: "14",
      viewBox: "0 0 14 14",
      xmlns: "http://www.w3.org/2000/svg"
    }, t), (0, gz.h)("path", {
      "fill-rule": "evenodd",
      "clip-rule": "evenodd",
      d: "M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"
    }))
  }
  Q6.SafeIcon = Xxe;
  var hS = {};
  Object.defineProperty(hS, "__esModule", {
    value: !0
  }), hS.default = ".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";
  var mz = ot && ot.__importDefault || function (t) {
    return t && t.__esModule ? t : {
      default: t
    }
  };
  Object.defineProperty(G6, "__esModule", {
    value: !0
  }), G6.TryExtensionContent = void 0;
  const ip = mz(Rb),
    gi = _o,
    fS = j6,
    eCe = Z6,
    tCe = Y6,
    rCe = Q6,
    nCe = mz(hS);

  function iCe({
    theme: t
  }) {
    const [e, r] = (0, fS.useState)(!1), n = (0, fS.useCallback)(() => {
      window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome", "_blank")
    }, []), i = (0, fS.useCallback)(() => {
      e ? window.location.reload() : (n(), r(!0))
    }, [n, e]);
    return (0, gi.h)("div", {
      class: (0, ip.default)("-cbwsdk-try-extension", t)
    }, (0, gi.h)("style", null, nCe.default), (0, gi.h)("div", {
      class: "-cbwsdk-try-extension-column-half"
    }, (0, gi.h)("h3", {
      class: (0, ip.default)("-cbwsdk-try-extension-heading", t)
    }, "Or try the Coinbase Wallet browser extension"), (0, gi.h)("div", {
      class: "-cbwsdk-try-extension-cta-wrapper"
    }, (0, gi.h)("button", {
      class: (0, ip.default)("-cbwsdk-try-extension-cta", t),
      onClick: i
    }, e ? "Refresh" : "Install"), (0, gi.h)("div", null, !e && (0, gi.h)(eCe.ArrowLeftIcon, {
      class: "-cbwsdk-try-extension-cta-icon",
      fill: t === "light" ? "#0052FF" : "#588AF5"
    })))), (0, gi.h)("div", {
      class: "-cbwsdk-try-extension-column-half"
    }, (0, gi.h)("ul", {
      class: "-cbwsdk-try-extension-list"
    }, (0, gi.h)("li", {
      class: "-cbwsdk-try-extension-list-item"
    }, (0, gi.h)("div", {
      class: "-cbwsdk-try-extension-list-item-icon-wrapper"
    }, (0, gi.h)("span", {
      class: (0, ip.default)("-cbwsdk-try-extension-list-item-icon", t)
    }, (0, gi.h)(tCe.LaptopIcon, {
      fill: t === "light" ? "#0A0B0D" : "#FFFFFF"
    }))), (0, gi.h)("div", {
      class: (0, ip.default)("-cbwsdk-try-extension-list-item-copy", t)
    }, "Connect with dapps with just one click on your desktop browser")), (0, gi.h)("li", {
      class: "-cbwsdk-try-extension-list-item"
    }, (0, gi.h)("div", {
      class: "-cbwsdk-try-extension-list-item-icon-wrapper"
    }, (0, gi.h)("span", {
      class: (0, ip.default)("-cbwsdk-try-extension-list-item-icon", t)
    }, (0, gi.h)(rCe.SafeIcon, {
      fill: t === "light" ? "#0A0B0D" : "#FFFFFF"
    }))), (0, gi.h)("div", {
      class: (0, ip.default)("-cbwsdk-try-extension-list-item-copy", t)
    }, "Add an additional layer of security by using a supported Ledger hardware wallet")))))
  }
  G6.TryExtensionContent = iCe;
  var pS = {};
  Object.defineProperty(pS, "__esModule", {
    value: !0
  }), pS.default = ".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";
  var wz = ot && ot.__importDefault || function (t) {
    return t && t.__esModule ? t : {
      default: t
    }
  };
  Object.defineProperty(U6, "__esModule", {
    value: !0
  }), U6.ConnectDialog = void 0;
  const gS = wz(Rb),
    sp = _o,
    mS = j6,
    sCe = sm,
    oCe = G6,
    aCe = wz(pS),
    cCe = t => {
      const {
        isOpen: e,
        darkMode: r
      } = t, [n, i] = (0, mS.useState)(!e), [s, o] = (0, mS.useState)(!e);
      (0, mS.useEffect)(() => {
        const c = [window.setTimeout(() => {
          o(!e)
        }, 10)];
        return e ? i(!1) : c.push(window.setTimeout(() => {
          i(!0)
        }, 360)), () => {
          c.forEach(window.clearTimeout)
        }
      }, [e]);
      const a = r ? "dark" : "light";
      return (0, sp.h)("div", {
        class: (0, gS.default)("-cbwsdk-connect-dialog-container", n && "-cbwsdk-connect-dialog-container-hidden")
      }, (0, sp.h)("style", null, aCe.default), (0, sp.h)("div", {
        class: (0, gS.default)("-cbwsdk-connect-dialog-backdrop", a, s && "-cbwsdk-connect-dialog-backdrop-hidden")
      }), (0, sp.h)("div", {
        class: "-cbwsdk-connect-dialog"
      }, (0, sp.h)("div", {
        class: (0, gS.default)("-cbwsdk-connect-dialog-box", s && "-cbwsdk-connect-dialog-box-hidden")
      }, t.connectDisabled ? null : (0, sp.h)(sCe.ConnectContent, {
        theme: a,
        version: t.version,
        sessionId: t.sessionId,
        sessionSecret: t.sessionSecret,
        linkAPIUrl: t.linkAPIUrl,
        isConnected: t.isConnected,
        isParentConnection: t.isParentConnection,
        chainId: t.chainId,
        onCancel: t.onCancel
      }), (0, sp.h)(oCe.TryExtensionContent, {
        theme: a
      }))))
    };
  U6.ConnectDialog = cCe, Object.defineProperty(B6, "__esModule", {
    value: !0
  }), B6.LinkFlow = void 0;
  const wS = _o,
    lCe = U6;
  class uCe {
    constructor(e) {
      this.connected = !1, this.chainId = 1, this.isOpen = !1, this.onCancel = null, this.root = null, this.connectDisabled = !1, this.darkMode = e.darkMode, this.version = e.version, this.sessionId = e.sessionId, this.sessionSecret = e.sessionSecret, this.linkAPIUrl = e.linkAPIUrl, this.isParentConnection = e.isParentConnection
    }
    attach(e) {
      this.root = document.createElement("div"), this.root.className = "-cbwsdk-link-flow-root", e.appendChild(this.root), this.render()
    }
    setConnected(e) {
      this.connected !== e && (this.connected = e, this.render())
    }
    setChainId(e) {
      this.chainId !== e && (this.chainId = e, this.render())
    }
    detach() {
      var e;
      this.root && ((0, wS.render)(null, this.root), (e = this.root.parentElement) === null || e === void 0 || e.removeChild(this.root))
    }
    setConnectDisabled(e) {
      this.connectDisabled = e
    }
    open(e) {
      console.log("6 connect", e)
      this.isOpen = !0, this.onCancel = e.onCancel, this.render()
    }
    close() {
      this.isOpen = !1, this.onCancel = null, this.render()
    }
    render() {
      this.root && (0, wS.render)((0, wS.h)(lCe.ConnectDialog, {
        darkMode: this.darkMode,
        version: this.version,
        sessionId: this.sessionId,
        sessionSecret: this.sessionSecret,
        linkAPIUrl: this.linkAPIUrl,
        isOpen: this.isOpen,
        isConnected: this.connected,
        isParentConnection: this.isParentConnection,
        chainId: this.chainId,
        onCancel: this.onCancel,
        connectDisabled: this.connectDisabled
      }), this.root)
    }
  }
  B6.LinkFlow = uCe;
  var vS = {},
    bS = {};
  Object.defineProperty(bS, "__esModule", {
      value: !0
    }), bS.default = ".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}",
    function (t) {
      var e = ot && ot.__importDefault || function (f) {
        return f && f.__esModule ? f : {
          default: f
        }
      };
      Object.defineProperty(t, "__esModule", {
        value: !0
      }), t.SnackbarInstance = t.SnackbarContainer = t.Snackbar = void 0;
      const r = e(Rb),
        n = _o,
        i = j6,
        s = e(bS),
        o = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",
        a = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";
      class c {
        constructor(w) {
          this.items = new Map, this.nextItemKey = 0, this.root = null, this.darkMode = w.darkMode
        }
        attach(w) {
          this.root = document.createElement("div"), this.root.className = "-cbwsdk-snackbar-root", w.appendChild(this.root), this.render()
        }
        presentItem(w) {
          const b = this.nextItemKey++;
          return this.items.set(b, w), this.render(), () => {
            this.items.delete(b), this.render()
          }
        }
        clear() {
          this.items.clear(), this.render()
        }
        render() {
          this.root && (0, n.render)((0, n.h)("div", null, (0, n.h)(t.SnackbarContainer, {
            darkMode: this.darkMode
          }, Array.from(this.items.entries()).map(([w, b]) => (0, n.h)(t.SnackbarInstance, Object.assign({}, b, {
            key: w
          }))))), this.root)
        }
      }
      t.Snackbar = c;
      const l = f => (0, n.h)("div", {
        class: (0, r.default)("-cbwsdk-snackbar-container")
      }, (0, n.h)("style", null, s.default), (0, n.h)("div", {
        class: "-cbwsdk-snackbar"
      }, f.children));
      t.SnackbarContainer = l;
      const h = ({
        autoExpand: f,
        message: w,
        menuItems: b
      }) => {
        const [C, M] = (0, i.useState)(!0), [N, $] = (0, i.useState)(f ?? !1);
        (0, i.useEffect)(() => {
          const B = [window.setTimeout(() => {
            M(!1)
          }, 1), window.setTimeout(() => {
            $(!0)
          }, 1e4)];
          return () => {
            B.forEach(window.clearTimeout)
          }
        });
        const k = () => {
          $(!N)
        };
        return (0, n.h)("div", {
          class: (0, r.default)("-cbwsdk-snackbar-instance", C && "-cbwsdk-snackbar-instance-hidden", N && "-cbwsdk-snackbar-instance-expanded")
        }, (0, n.h)("div", {
          class: "-cbwsdk-snackbar-instance-header",
          onClick: k
        }, (0, n.h)("img", {
          src: o,
          class: "-cbwsdk-snackbar-instance-header-cblogo"
        }), " ", (0, n.h)("div", {
          class: "-cbwsdk-snackbar-instance-header-message"
        }, w), (0, n.h)("div", {
          class: "-gear-container"
        }, !N && (0, n.h)("svg", {
          width: "24",
          height: "24",
          viewBox: "0 0 24 24",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg"
        }, (0, n.h)("circle", {
          cx: "12",
          cy: "12",
          r: "12",
          fill: "#F5F7F8"
        })), (0, n.h)("img", {
          src: a,
          class: "-gear-icon",
          title: "Expand"
        }))), b && b.length > 0 && (0, n.h)("div", {
          class: "-cbwsdk-snackbar-instance-menu"
        }, b.map((B, F) => (0, n.h)("div", {
          class: (0, r.default)("-cbwsdk-snackbar-instance-menu-item", B.isRed && "-cbwsdk-snackbar-instance-menu-item-is-red"),
          onClick: B.onClick,
          key: F
        }, (0, n.h)("svg", {
          width: B.svgWidth,
          height: B.svgHeight,
          viewBox: "0 0 10 11",
          fill: "none",
          xmlns: "http://www.w3.org/2000/svg"
        }, (0, n.h)("path", {
          "fill-rule": B.defaultFillRule,
          "clip-rule": B.defaultClipRule,
          d: B.path,
          fill: "#AAAAAA"
        })), (0, n.h)("span", {
          class: (0, r.default)("-cbwsdk-snackbar-instance-menu-item-info", B.isRed && "-cbwsdk-snackbar-instance-menu-item-info-is-red")
        }, B.info)))))
      };
      t.SnackbarInstance = h
    }(vS), Object.defineProperty(Tb, "__esModule", {
      value: !0
    }), Tb.WalletLinkRelayUI = void 0;
  const dCe = kb,
    hCe = B6,
    fCe = vS;
  class pCe {
    constructor(e) {
      this.standalone = null, this.attached = !1, this.snackbar = new fCe.Snackbar({
        darkMode: e.darkMode
      }), this.linkFlow = new hCe.LinkFlow({
        darkMode: e.darkMode,
        version: e.version,
        sessionId: e.session.id,
        sessionSecret: e.session.secret,
        linkAPIUrl: e.linkAPIUrl,
        isParentConnection: !1
      })
    }
    attach() {
      if (this.attached) throw new Error("Coinbase Wallet SDK UI is already attached");
      const e = document.documentElement,
        r = document.createElement("div");
      r.className = "-cbwsdk-css-reset", e.appendChild(r), this.linkFlow.attach(r), this.snackbar.attach(r), this.attached = !0, (0, dCe.injectCssReset)()
    }
    setConnected(e) {
      this.linkFlow.setConnected(e)
    }
    setChainId(e) {
      this.linkFlow.setChainId(e)
    }
    setConnectDisabled(e) {
      this.linkFlow.setConnectDisabled(e)
    }
    addEthereumChain() {}
    watchAsset() {}
    switchEthereumChain() {}
    requestEthereumAccounts(e) {
      this.linkFlow.open({
        onCancel: e.onCancel
      })
    }
    hideRequestEthereumAccounts() {
      this.linkFlow.close()
    }
    signEthereumMessage() {}
    signEthereumTransaction() {}
    submitEthereumTransaction() {}
    ethereumAddressFromSignedMessage() {}
    showConnecting(e) {
      let r;
      return e.isUnlinkedErrorState ? r = {
        autoExpand: !0,
        message: "Connection lost",
        menuItems: [{
          isRed: !1,
          info: "Reset connection",
          svgWidth: "10",
          svgHeight: "11",
          path: "M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",
          defaultFillRule: "evenodd",
          defaultClipRule: "evenodd",
          onClick: e.onResetConnection
        }]
      } : r = {
        message: "Confirm on phone",
        menuItems: [{
          isRed: !0,
          info: "Cancel transaction",
          svgWidth: "11",
          svgHeight: "11",
          path: "M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",
          defaultFillRule: "inherit",
          defaultClipRule: "inherit",
          onClick: e.onCancel
        }, {
          isRed: !1,
          info: "Reset connection",
          svgWidth: "10",
          svgHeight: "11",
          path: "M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",
          defaultFillRule: "evenodd",
          defaultClipRule: "evenodd",
          onClick: e.onResetConnection
        }]
      }, this.snackbar.presentItem(r)
    }
    reloadUI() {
      document.location.reload()
    }
    inlineAccountsResponse() {
      return !1
    }
    inlineAddEthereumChain() {
      return !1
    }
    inlineWatchAsset() {
      return !1
    }
    inlineSwitchEthereumChain() {
      return !1
    }
    setStandalone(e) {
      this.standalone = e
    }
    isStandalone() {
      var e;
      return (e = this.standalone) !== null && e !== void 0 ? e : !1
    }
  }
  Tb.WalletLinkRelayUI = pCe, Object.defineProperty(Cb, "__esModule", {
    value: !0
  }), Cb.WalletLinkRelay = void 0;
  const am = vb,
    gCe = Ei,
    Fn = jt,
    op = Jg,
    vz = Oa,
    Zh = Xg,
    mCe = P6,
    ap = Zg,
    wCe = Tb;
  class md extends vz.RelayAbstract {
    constructor(e) {
      var r;
      super(), this.accountsCallback = null, this.chainCallbackParams = {
        chainId: "",
        jsonRpcUrl: ""
      }, this.chainCallback = null, this.dappDefaultChain = 1, this.appName = "", this.appLogoUrl = null, this.linkedUpdated = o => {
        var a;
        this.isLinked = o;
        const c = this.storage.getItem(vz.LOCAL_STORAGE_ADDRESSES_KEY);
        if (o && (this.session.linked = o), this.isUnlinkedErrorState = !1, c) {
          const l = c.split(" "),
            h = this.storage.getItem("IsStandaloneSigning") === "true";
          if (l[0] !== "" && !o && this.session.linked && !h) {
            this.isUnlinkedErrorState = !0;
            const f = this.getSessionIdHash();
            (a = this.diagnostic) === null || a === void 0 || a.log(op.EVENTS.UNLINKED_ERROR_STATE, {
              sessionIdHash: f
            })
          }
        }
      }, this.metadataUpdated = (o, a) => {
        this.storage.setItem(o, a)
      }, this.chainUpdated = (o, a) => {
        this.chainCallbackParams.chainId === o && this.chainCallbackParams.jsonRpcUrl === a || (this.chainCallbackParams = {
          chainId: o,
          jsonRpcUrl: a
        }, this.chainCallback && this.chainCallback(o, a))
      }, this.accountUpdated = o => {
        this.accountsCallback && this.accountsCallback([o]), md.accountRequestCallbackIds.size > 0 && (Array.from(md.accountRequestCallbackIds.values()).forEach(a => {
          const c = {
            type: "WEB3_RESPONSE",
            id: a,
            response: {
              method: "requestEthereumAccounts",
              result: [o]
            }
          };
          this.invokeCallback(Object.assign(Object.assign({}, c), {
            id: a
          }))
        }), md.accountRequestCallbackIds.clear())
      }, this.connectedUpdated = o => {
        this.ui.setConnected(o)
      }, this.resetAndReload = this.resetAndReload.bind(this), this.linkAPIUrl = e.linkAPIUrl, this.storage = e.storage, this.options = e;
      const {
        session: n,
        ui: i,
        connection: s
      } = this.subscribe();
      this._session = n, this.connection = s, this.relayEventManager = e.relayEventManager, this.diagnostic = e.diagnosticLogger, this._reloadOnDisconnect = (r = e.reloadOnDisconnect) !== null && r !== void 0 ? r : !0, this.ui = i
    }
    subscribe() {
      const e = Zh.Session.load(this.storage) || new Zh.Session(this.storage).save(),
        {
          linkAPIUrl: r,
          diagnostic: n
        } = this,
        i = new mCe.WalletLinkConnection({
          session: e,
          linkAPIUrl: r,
          diagnostic: n,
          listener: this
        }),
        {
          version: s,
          darkMode: o
        } = this.options,
        a = this.options.uiConstructor({
          linkAPIUrl: r,
          version: s,
          darkMode: o,
          session: e
        });
      return i.connect(), {
        session: e,
        ui: a,
        connection: i
      }
    }
    attachUI() {
      this.ui.attach()
    }
    resetAndReload() {
      Promise.race([this.connection.setSessionMetadata("__destroyed", "1"), new Promise(e => setTimeout(() => e(null), 1e3))]).then(() => {
        var e, r;
        const n = this.ui.isStandalone();
        (e = this.diagnostic) === null || e === void 0 || e.log(op.EVENTS.SESSION_STATE_CHANGE, {
          method: "relay::resetAndReload",
          sessionMetadataChange: "__destroyed, 1",
          sessionIdHash: this.getSessionIdHash()
        }), this.connection.destroy();
        const i = Zh.Session.load(this.storage);
        if (i?.id === this._session.id ? this.storage.clear() : i && ((r = this.diagnostic) === null || r === void 0 || r.log(op.EVENTS.SKIPPED_CLEARING_SESSION, {
            sessionIdHash: this.getSessionIdHash(),
            storedSessionIdHash: Zh.Session.hash(i.id)
          })), this._reloadOnDisconnect) {
          this.ui.reloadUI();
          return
        }
        this.accountsCallback && this.accountsCallback([], !0);
        const {
          session: s,
          ui: o,
          connection: a
        } = this.subscribe();
        this._session = s, this.connection = a, this.ui = o, n && this.ui.setStandalone && this.ui.setStandalone(!0), this.options.headlessMode || this.attachUI()
      }).catch(e => {
        var r;
        (r = this.diagnostic) === null || r === void 0 || r.log(op.EVENTS.FAILURE, {
          method: "relay::resetAndReload",
          message: `failed to reset and reload with ${e}`,
          sessionIdHash: this.getSessionIdHash()
        })
      })
    }
    setAppInfo(e, r) {
      this.appName = e, this.appLogoUrl = r
    }
    getStorageItem(e) {
      return this.storage.getItem(e)
    }
    get session() {
      return this._session
    }
    setStorageItem(e, r) {
      this.storage.setItem(e, r)
    }
    signEthereumMessage(e, r, n, i) {
      return this.sendRequest({
        method: "signEthereumMessage",
        params: {
          message: (0, Fn.hexStringFromBuffer)(e, !0),
          address: r,
          addPrefix: n,
          typedDataJson: i || null
        }
      })
    }
    ethereumAddressFromSignedMessage(e, r, n) {
      return this.sendRequest({
        method: "ethereumAddressFromSignedMessage",
        params: {
          message: (0, Fn.hexStringFromBuffer)(e, !0),
          signature: (0, Fn.hexStringFromBuffer)(r, !0),
          addPrefix: n
        }
      })
    }
    signEthereumTransaction(e) {
      return this.sendRequest({
        method: "signEthereumTransaction",
        params: {
          fromAddress: e.fromAddress,
          toAddress: e.toAddress,
          weiValue: (0, Fn.bigIntStringFromBN)(e.weiValue),
          data: (0, Fn.hexStringFromBuffer)(e.data, !0),
          nonce: e.nonce,
          gasPriceInWei: e.gasPriceInWei ? (0, Fn.bigIntStringFromBN)(e.gasPriceInWei) : null,
          maxFeePerGas: e.gasPriceInWei ? (0, Fn.bigIntStringFromBN)(e.gasPriceInWei) : null,
          maxPriorityFeePerGas: e.gasPriceInWei ? (0, Fn.bigIntStringFromBN)(e.gasPriceInWei) : null,
          gasLimit: e.gasLimit ? (0, Fn.bigIntStringFromBN)(e.gasLimit) : null,
          chainId: e.chainId,
          shouldSubmit: !1
        }
      })
    }
    signAndSubmitEthereumTransaction(e) {
      return this.sendRequest({
        method: "signEthereumTransaction",
        params: {
          fromAddress: e.fromAddress,
          toAddress: e.toAddress,
          weiValue: (0, Fn.bigIntStringFromBN)(e.weiValue),
          data: (0, Fn.hexStringFromBuffer)(e.data, !0),
          nonce: e.nonce,
          gasPriceInWei: e.gasPriceInWei ? (0, Fn.bigIntStringFromBN)(e.gasPriceInWei) : null,
          maxFeePerGas: e.maxFeePerGas ? (0, Fn.bigIntStringFromBN)(e.maxFeePerGas) : null,
          maxPriorityFeePerGas: e.maxPriorityFeePerGas ? (0, Fn.bigIntStringFromBN)(e.maxPriorityFeePerGas) : null,
          gasLimit: e.gasLimit ? (0, Fn.bigIntStringFromBN)(e.gasLimit) : null,
          chainId: e.chainId,
          shouldSubmit: !0
        }
      })
    }
    submitEthereumTransaction(e, r) {
      return this.sendRequest({
        method: "submitEthereumTransaction",
        params: {
          signedTransaction: (0, Fn.hexStringFromBuffer)(e, !0),
          chainId: r
        }
      })
    }
    scanQRCode(e) {
      return this.sendRequest({
        method: "scanQRCode",
        params: {
          regExp: e
        }
      })
    }
    getQRCodeUrl() {
      return (0, Fn.createQrUrl)(this._session.id, this._session.secret, this.linkAPIUrl, !1, this.options.version, this.dappDefaultChain)
    }
    genericRequest(e, r) {
      return this.sendRequest({
        method: "generic",
        params: {
          action: r,
          data: e
        }
      })
    }
    sendGenericMessage(e) {
      return this.sendRequest(e)
    }
    sendRequest(e) {
      let r = null;
      const n = (0, Fn.randomBytesHex)(8),
        i = o => {
          this.publishWeb3RequestCanceledEvent(n), this.handleErrorResponse(n, e.method, o), r?.()
        };
      return {
        promise: new Promise((o, a) => {
          this.ui.isStandalone() || (r = this.ui.showConnecting({
            isUnlinkedErrorState: this.isUnlinkedErrorState,
            onCancel: i,
            onResetConnection: this.resetAndReload
          })), this.relayEventManager.callbacks.set(n, c => {
            if (r?.(), (0, ap.isErrorResponse)(c)) return a(new Error(c.errorMessage));
            o(c)
          }), this.ui.isStandalone() ? this.sendRequestStandalone(n, e) : this.publishWeb3RequestEvent(n, e)
        }),
        cancel: i
      }
    }
    setConnectDisabled(e) {
      this.ui.setConnectDisabled(e)
    }
    setAccountsCallback(e) {
      this.accountsCallback = e
    }
    setChainCallback(e) {
      this.chainCallback = e
    }
    setDappDefaultChainCallback(e) {
      this.dappDefaultChain = e, this.ui instanceof wCe.WalletLinkRelayUI && this.ui.setChainId(e)
    }
    publishWeb3RequestEvent(e, r) {
      var n;
      const i = {
          type: "WEB3_REQUEST",
          id: e,
          request: r
        },
        s = Zh.Session.load(this.storage);
      (n = this.diagnostic) === null || n === void 0 || n.log(op.EVENTS.WEB3_REQUEST, {
        eventId: i.id,
        method: `relay::${r.method}`,
        sessionIdHash: this.getSessionIdHash(),
        storedSessionIdHash: s ? Zh.Session.hash(s.id) : "",
        isSessionMismatched: (s?.id !== this._session.id).toString()
      }), this.publishEvent("Web3Request", i, !0).then(o => {
        var a;
        (a = this.diagnostic) === null || a === void 0 || a.log(op.EVENTS.WEB3_REQUEST_PUBLISHED, {
          eventId: i.id,
          method: `relay::${r.method}`,
          sessionIdHash: this.getSessionIdHash(),
          storedSessionIdHash: s ? Zh.Session.hash(s.id) : "",
          isSessionMismatched: (s?.id !== this._session.id).toString()
        })
      }).catch(o => {
        this.handleWeb3ResponseMessage({
          type: "WEB3_RESPONSE",
          id: i.id,
          response: {
            method: r.method,
            errorMessage: o.message
          }
        })
      })
    }
    publishWeb3RequestCanceledEvent(e) {
      const r = {
        type: "WEB3_REQUEST_CANCELED",
        id: e
      };
      this.publishEvent("Web3RequestCanceled", r, !1).then()
    }
    publishEvent(e, r, n) {
      return this.connection.publishEvent(e, r, n)
    }
    handleWeb3ResponseMessage(e) {
      var r;
      const {
        response: n
      } = e;
      if ((r = this.diagnostic) === null || r === void 0 || r.log(op.EVENTS.WEB3_RESPONSE, {
          eventId: e.id,
          method: `relay::${n.method}`,
          sessionIdHash: this.getSessionIdHash()
        }), n.method === "requestEthereumAccounts") {
        md.accountRequestCallbackIds.forEach(i => this.invokeCallback(Object.assign(Object.assign({}, e), {
          id: i
        }))), md.accountRequestCallbackIds.clear();
        return
      }
      this.invokeCallback(e)
    }
    handleErrorResponse(e, r, n, i) {
      var s;
      const o = (s = n?.message) !== null && s !== void 0 ? s : (0, am.getMessageFromCode)(i);
      this.handleWeb3ResponseMessage({
        type: "WEB3_RESPONSE",
        id: e,
        response: {
          method: r,
          errorMessage: o,
          errorCode: i
        }
      })
    }
    invokeCallback(e) {
      const r = this.relayEventManager.callbacks.get(e.id);
      r && (r(e.response), this.relayEventManager.callbacks.delete(e.id))
    }
    requestEthereumAccounts() {
      const e = {
          method: "requestEthereumAccounts",
          params: {
            appName: this.appName,
            appLogoUrl: this.appLogoUrl || null
          }
        },
        r = (0, Fn.randomBytesHex)(8),
        n = s => {
          this.publishWeb3RequestCanceledEvent(r), this.handleErrorResponse(r, e.method, s)
        };
      return {
        promise: new Promise((s, o) => {
          if (this.relayEventManager.callbacks.set(r, a => {
              if (this.ui.hideRequestEthereumAccounts(), (0, ap.isErrorResponse)(a)) return o(new Error(a.errorMessage));
              s(a)
            }), this.ui.inlineAccountsResponse()) {
            const a = c => {
              this.handleWeb3ResponseMessage({
                type: "WEB3_RESPONSE",
                id: r,
                response: {
                  method: "requestEthereumAccounts",
                  result: c
                }
              })
            };
            this.ui.requestEthereumAccounts({
              onCancel: n,
              onAccounts: a
            })
          } else {
            const a = am.standardErrors.provider.userRejectedRequest("User denied account authorization");
            this.ui.requestEthereumAccounts({
              onCancel: () => n(a)
            })
          }
          md.accountRequestCallbackIds.add(r), !this.ui.inlineAccountsResponse() && !this.ui.isStandalone() && this.publishWeb3RequestEvent(r, e)
        }),
        cancel: n
      }
    }
    selectProvider(e) {
      const r = {
          method: "selectProvider",
          params: {
            providerOptions: e
          }
        },
        n = (0, Fn.randomBytesHex)(8),
        i = o => {
          this.publishWeb3RequestCanceledEvent(n), this.handleErrorResponse(n, r.method, o)
        },
        s = new Promise((o, a) => {
          this.relayEventManager.callbacks.set(n, h => {
            if ((0, ap.isErrorResponse)(h)) return a(new Error(h.errorMessage));
            o(h)
          });
          const c = h => {
              this.handleWeb3ResponseMessage({
                type: "WEB3_RESPONSE",
                id: n,
                response: {
                  method: "selectProvider",
                  result: gCe.ProviderType.Unselected
                }
              })
            },
            l = h => {
              this.handleWeb3ResponseMessage({
                type: "WEB3_RESPONSE",
                id: n,
                response: {
                  method: "selectProvider",
                  result: h
                }
              })
            };
          this.ui.selectProvider && this.ui.selectProvider({
            onApprove: l,
            onCancel: c,
            providerOptions: e
          })
        });
      return {
        cancel: i,
        promise: s
      }
    }
    watchAsset(e, r, n, i, s, o) {
      const a = {
        method: "watchAsset",
        params: {
          type: e,
          options: {
            address: r,
            symbol: n,
            decimals: i,
            image: s
          },
          chainId: o
        }
      };
      let c = null;
      const l = (0, Fn.randomBytesHex)(8),
        h = w => {
          this.publishWeb3RequestCanceledEvent(l), this.handleErrorResponse(l, a.method, w), c?.()
        };
      this.ui.inlineWatchAsset() || (c = this.ui.showConnecting({
        isUnlinkedErrorState: this.isUnlinkedErrorState,
        onCancel: h,
        onResetConnection: this.resetAndReload
      }));
      const f = new Promise((w, b) => {
        this.relayEventManager.callbacks.set(l, N => {
          if (c?.(), (0, ap.isErrorResponse)(N)) return b(new Error(N.errorMessage));
          w(N)
        });
        const C = N => {
            this.handleWeb3ResponseMessage({
              type: "WEB3_RESPONSE",
              id: l,
              response: {
                method: "watchAsset",
                result: !1
              }
            })
          },
          M = () => {
            this.handleWeb3ResponseMessage({
              type: "WEB3_RESPONSE",
              id: l,
              response: {
                method: "watchAsset",
                result: !0
              }
            })
          };
        this.ui.inlineWatchAsset() && this.ui.watchAsset({
          onApprove: M,
          onCancel: C,
          type: e,
          address: r,
          symbol: n,
          decimals: i,
          image: s,
          chainId: o
        }), !this.ui.inlineWatchAsset() && !this.ui.isStandalone() && this.publishWeb3RequestEvent(l, a)
      });
      return {
        cancel: h,
        promise: f
      }
    }
    addEthereumChain(e, r, n, i, s, o) {
      const a = {
        method: "addEthereumChain",
        params: {
          chainId: e,
          rpcUrls: r,
          blockExplorerUrls: i,
          chainName: s,
          iconUrls: n,
          nativeCurrency: o
        }
      };
      let c = null;
      const l = (0, Fn.randomBytesHex)(8),
        h = w => {
          this.publishWeb3RequestCanceledEvent(l), this.handleErrorResponse(l, a.method, w), c?.()
        };
      return this.ui.inlineAddEthereumChain(e) || (c = this.ui.showConnecting({
        isUnlinkedErrorState: this.isUnlinkedErrorState,
        onCancel: h,
        onResetConnection: this.resetAndReload
      })), {
        promise: new Promise((w, b) => {
          this.relayEventManager.callbacks.set(l, N => {
            if (c?.(), (0, ap.isErrorResponse)(N)) return b(new Error(N.errorMessage));
            w(N)
          });
          const C = N => {
              this.handleWeb3ResponseMessage({
                type: "WEB3_RESPONSE",
                id: l,
                response: {
                  method: "addEthereumChain",
                  result: {
                    isApproved: !1,
                    rpcUrl: ""
                  }
                }
              })
            },
            M = N => {
              this.handleWeb3ResponseMessage({
                type: "WEB3_RESPONSE",
                id: l,
                response: {
                  method: "addEthereumChain",
                  result: {
                    isApproved: !0,
                    rpcUrl: N
                  }
                }
              })
            };
          this.ui.inlineAddEthereumChain(e) && this.ui.addEthereumChain({
            onCancel: C,
            onApprove: M,
            chainId: a.params.chainId,
            rpcUrls: a.params.rpcUrls,
            blockExplorerUrls: a.params.blockExplorerUrls,
            chainName: a.params.chainName,
            iconUrls: a.params.iconUrls,
            nativeCurrency: a.params.nativeCurrency
          }), !this.ui.inlineAddEthereumChain(e) && !this.ui.isStandalone() && this.publishWeb3RequestEvent(l, a)
        }),
        cancel: h
      }
    }
    switchEthereumChain(e, r) {
      const n = {
          method: "switchEthereumChain",
          params: Object.assign({
            chainId: e
          }, {
            address: r
          })
        },
        i = (0, Fn.randomBytesHex)(8),
        s = a => {
          this.publishWeb3RequestCanceledEvent(i), this.handleErrorResponse(i, n.method, a)
        };
      return {
        promise: new Promise((a, c) => {
          this.relayEventManager.callbacks.set(i, f => {
            if ((0, ap.isErrorResponse)(f) && f.errorCode) return c(am.standardErrors.provider.custom({
              code: f.errorCode,
              message: "Unrecognized chain ID. Try adding the chain using addEthereumChain first."
            }));
            if ((0, ap.isErrorResponse)(f)) return c(new Error(f.errorMessage));
            a(f)
          });
          const l = f => {
              var w;
              if (f) {
                const b = (w = (0, am.getErrorCode)(f)) !== null && w !== void 0 ? w : am.standardErrorCodes.provider.unsupportedChain;
                this.handleErrorResponse(i, "switchEthereumChain", f instanceof Error ? f : am.standardErrors.provider.unsupportedChain(e), b)
              } else this.handleWeb3ResponseMessage({
                type: "WEB3_RESPONSE",
                id: i,
                response: {
                  method: "switchEthereumChain",
                  result: {
                    isApproved: !1,
                    rpcUrl: ""
                  }
                }
              })
            },
            h = f => {
              this.handleWeb3ResponseMessage({
                type: "WEB3_RESPONSE",
                id: i,
                response: {
                  method: "switchEthereumChain",
                  result: {
                    isApproved: !0,
                    rpcUrl: f
                  }
                }
              })
            };
          this.ui.switchEthereumChain({
            onCancel: l,
            onApprove: h,
            chainId: n.params.chainId,
            address: n.params.address
          }), !this.ui.inlineSwitchEthereumChain() && !this.ui.isStandalone() && this.publishWeb3RequestEvent(i, n)
        }),
        cancel: s
      }
    }
    inlineAddEthereumChain(e) {
      return this.ui.inlineAddEthereumChain(e)
    }
    getSessionIdHash() {
      return Zh.Session.hash(this._session.id)
    }
    sendRequestStandalone(e, r) {
      const n = s => {
          this.handleErrorResponse(e, r.method, s)
        },
        i = s => {
          this.handleWeb3ResponseMessage({
            type: "WEB3_RESPONSE",
            id: e,
            response: s
          })
        };
      switch (r.method) {
        case "signEthereumMessage":
          this.ui.signEthereumMessage({
            request: r,
            onSuccess: i,
            onCancel: n
          });
          break;
        case "signEthereumTransaction":
          this.ui.signEthereumTransaction({
            request: r,
            onSuccess: i,
            onCancel: n
          });
          break;
        case "submitEthereumTransaction":
          this.ui.submitEthereumTransaction({
            request: r,
            onSuccess: i,
            onCancel: n
          });
          break;
        case "ethereumAddressFromSignedMessage":
          this.ui.ethereumAddressFromSignedMessage({
            request: r,
            onSuccess: i
          });
          break;
        default:
          n();
          break
      }
    }
  }
  Cb.WalletLinkRelay = md, md.accountRequestCallbackIds = new Set;
  var Mb = {},
    J6 = {},
    bz = {};
  (function (t) {
    var e = ot && ot.__createBinding || (Object.create ? function (n, i, s, o) {
        o === void 0 && (o = s);
        var a = Object.getOwnPropertyDescriptor(i, s);
        (!a || ("get" in a ? !i.__esModule : a.writable || a.configurable)) && (a = {
          enumerable: !0,
          get: function () {
            return i[s]
          }
        }), Object.defineProperty(n, o, a)
      } : function (n, i, s, o) {
        o === void 0 && (o = s), n[o] = i[s]
      }),
      r = ot && ot.__exportStar || function (n, i) {
        for (var s in n) s !== "default" && !Object.prototype.hasOwnProperty.call(i, s) && e(i, n, s)
      };
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), r(vS, t)
  })(bz);
  var yS = {};
  Object.defineProperty(yS, "__esModule", {
    value: !0
  }), yS.default = ".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";
  var yz = ot && ot.__importDefault || function (t) {
    return t && t.__esModule ? t : {
      default: t
    }
  };
  Object.defineProperty(J6, "__esModule", {
    value: !0
  }), J6.RedirectDialog = void 0;
  const vCe = yz(Rb),
    nu = _o,
    bCe = kb,
    yCe = bz,
    _Ce = yz(yS);
  class xCe {
    constructor() {
      this.root = null
    }
    attach() {
      const e = document.documentElement;
      this.root = document.createElement("div"), this.root.className = "-cbwsdk-css-reset", e.appendChild(this.root), (0, bCe.injectCssReset)()
    }
    present(e) {
      this.render(e)
    }
    clear() {
      this.render(null)
    }
    render(e) {
      this.root && ((0, nu.render)(null, this.root), e && (0, nu.render)((0, nu.h)(CCe, Object.assign({}, e, {
        onDismiss: () => {
          this.clear()
        }
      })), this.root))
    }
  }
  J6.RedirectDialog = xCe;
  const CCe = ({
    title: t,
    buttonText: e,
    darkMode: r,
    onButtonClick: n,
    onDismiss: i
  }) => {
    const s = r ? "dark" : "light";
    return (0, nu.h)(yCe.SnackbarContainer, {
      darkMode: r
    }, (0, nu.h)("div", {
      class: "-cbwsdk-redirect-dialog"
    }, (0, nu.h)("style", null, _Ce.default), (0, nu.h)("div", {
      class: "-cbwsdk-redirect-dialog-backdrop",
      onClick: i
    }), (0, nu.h)("div", {
      class: (0, vCe.default)("-cbwsdk-redirect-dialog-box", s)
    }, (0, nu.h)("p", null, t), (0, nu.h)("button", {
      onClick: n
    }, e))))
  };
  Object.defineProperty(Mb, "__esModule", {
    value: !0
  }), Mb.MobileRelayUI = void 0;
  const ECe = J6;
  class ACe {
    constructor(e) {
      this.attached = !1, this.darkMode = !1, this.redirectDialog = new ECe.RedirectDialog, this.darkMode = e.darkMode
    }
    attach() {
      if (this.attached) throw new Error("Coinbase Wallet SDK UI is already attached");
      this.redirectDialog.attach(), this.attached = !0
    }
    setConnected(e) {}
    redirectToCoinbaseWallet(e) {
      const r = new URL("https://go.cb-w.com/walletlink");
      r.searchParams.append("redirect_url", window.location.href), e && r.searchParams.append("wl_url", e);
      const n = document.createElement("a");
      n.target = "cbw-opener", n.href = r.href, n.rel = "noreferrer noopener", n.click()
    }
    openCoinbaseWalletDeeplink(e) {
      this.redirectDialog.present({
        title: "Redirecting to Coinbase Wallet...",
        buttonText: "Open",
        darkMode: this.darkMode,
        onButtonClick: () => {
          this.redirectToCoinbaseWallet(e)
        }
      }), setTimeout(() => {
        this.redirectToCoinbaseWallet(e)
      }, 99)
    }
    showConnecting(e) {
      return () => {
        this.redirectDialog.clear()
      }
    }
    hideRequestEthereumAccounts() {
      this.redirectDialog.clear()
    }
    requestEthereumAccounts() {}
    addEthereumChain() {}
    watchAsset() {}
    selectProvider() {}
    switchEthereumChain() {}
    signEthereumMessage() {}
    signEthereumTransaction() {}
    submitEthereumTransaction() {}
    ethereumAddressFromSignedMessage() {}
    reloadUI() {}
    setStandalone() {}
    setConnectDisabled() {}
    inlineAccountsResponse() {
      return !1
    }
    inlineAddEthereumChain() {
      return !1
    }
    inlineWatchAsset() {
      return !1
    }
    inlineSwitchEthereumChain() {
      return !1
    }
    isStandalone() {
      return !1
    }
  }
  Mb.MobileRelayUI = ACe, Object.defineProperty(xb, "__esModule", {
    value: !0
  }), xb.MobileRelay = void 0;
  const SCe = jt,
    ICe = Cb,
    TCe = Mb;
  class kCe extends ICe.WalletLinkRelay {
    constructor(e) {
      var r;
      super(e), this._enableMobileWalletLink = (r = e.enableMobileWalletLink) !== null && r !== void 0 ? r : !1
    }
    requestEthereumAccounts() {
      return this._enableMobileWalletLink ? super.requestEthereumAccounts() : {
        promise: new Promise(() => {
          const e = (0, SCe.getLocation)();
          e.href = `https://go.cb-w.com/dapp?cb_url=${encodeURIComponent(e.href)}`
        }),
        cancel: () => {}
      }
    }
    publishWeb3RequestEvent(e, r) {
      if (super.publishWeb3RequestEvent(e, r), !(this._enableMobileWalletLink && this.ui instanceof TCe.MobileRelayUI)) return;
      let n = !1;
      switch (r.method) {
        case "requestEthereumAccounts":
        case "connectAndSignIn":
          n = !0, this.ui.openCoinbaseWalletDeeplink(this.getQRCodeUrl());
          break;
        case "switchEthereumChain":
          return;
        default:
          n = !0, this.ui.openCoinbaseWalletDeeplink();
          break
      }
      n && window.addEventListener("blur", () => {
        window.addEventListener("focus", () => {
          this.connection.checkUnseenEvents()
        }, {
          once: !0
        })
      }, {
        once: !0
      })
    }
    handleWeb3ResponseMessage(e) {
      super.handleWeb3ResponseMessage(e)
    }
    connectAndSignIn(e) {
      if (!this._enableMobileWalletLink) throw new Error("connectAndSignIn is supported only when enableMobileWalletLink is on");
      return this.sendRequest({
        method: "connectAndSignIn",
        params: {
          appName: this.appName,
          appLogoUrl: this.appLogoUrl,
          domain: window.location.hostname,
          aud: window.location.href,
          version: "1",
          type: "eip4361",
          nonce: e.nonce,
          iat: new Date().toISOString(),
          chainId: `eip155:${this.dappDefaultChain}`,
          statement: e.statement,
          resources: e.resources
        }
      })
    }
  }
  xb.MobileRelay = kCe;
  var _S = {
      exports: {}
    },
    _z = Fi.EventEmitter,
    xS, xz;

  function RCe() {
    if (xz) return xS;
    xz = 1;

    function t(C, M) {
      var N = Object.keys(C);
      if (Object.getOwnPropertySymbols) {
        var $ = Object.getOwnPropertySymbols(C);
        M && ($ = $.filter(function (k) {
          return Object.getOwnPropertyDescriptor(C, k).enumerable
        })), N.push.apply(N, $)
      }
      return N
    }

    function e(C) {
      for (var M = 1; M < arguments.length; M++) {
        var N = arguments[M] != null ? arguments[M] : {};
        M % 2 ? t(Object(N), !0).forEach(function ($) {
          r(C, $, N[$])
        }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(C, Object.getOwnPropertyDescriptors(N)) : t(Object(N)).forEach(function ($) {
          Object.defineProperty(C, $, Object.getOwnPropertyDescriptor(N, $))
        })
      }
      return C
    }

    function r(C, M, N) {
      return M = o(M), M in C ? Object.defineProperty(C, M, {
        value: N,
        enumerable: !0,
        configurable: !0,
        writable: !0
      }) : C[M] = N, C
    }

    function n(C, M) {
      if (!(C instanceof M)) throw new TypeError("Cannot call a class as a function")
    }

    function i(C, M) {
      for (var N = 0; N < M.length; N++) {
        var $ = M[N];
        $.enumerable = $.enumerable || !1, $.configurable = !0, "value" in $ && ($.writable = !0), Object.defineProperty(C, o($.key), $)
      }
    }

    function s(C, M, N) {
      return M && i(C.prototype, M), Object.defineProperty(C, "prototype", {
        writable: !1
      }), C
    }

    function o(C) {
      var M = a(C, "string");
      return typeof M == "symbol" ? M : String(M)
    }

    function a(C, M) {
      if (typeof C != "object" || C === null) return C;
      var N = C[Symbol.toPrimitive];
      if (N !== void 0) {
        var $ = N.call(C, M || "default");
        if (typeof $ != "object") return $;
        throw new TypeError("@@toPrimitive must return a primitive value.")
      }
      return (M === "string" ? String : Number)(C)
    }
    var c = d1,
      l = c.Buffer,
      h = eg,
      f = h.inspect,
      w = f && f.custom || "inspect";

    function b(C, M, N) {
      l.prototype.copy.call(C, M, N)
    }
    return xS = function () {
      function C() {
        n(this, C), this.head = null, this.tail = null, this.length = 0
      }
      return s(C, [{
        key: "push",
        value: function (N) {
          var $ = {
            data: N,
            next: null
          };
          this.length > 0 ? this.tail.next = $ : this.head = $, this.tail = $, ++this.length
        }
      }, {
        key: "unshift",
        value: function (N) {
          var $ = {
            data: N,
            next: this.head
          };
          this.length === 0 && (this.tail = $), this.head = $, ++this.length
        }
      }, {
        key: "shift",
        value: function () {
          if (this.length !== 0) {
            var N = this.head.data;
            return this.length === 1 ? this.head = this.tail = null : this.head = this.head.next, --this.length, N
          }
        }
      }, {
        key: "clear",
        value: function () {
          this.head = this.tail = null, this.length = 0
        }
      }, {
        key: "join",
        value: function (N) {
          if (this.length === 0) return "";
          for (var $ = this.head, k = "" + $.data; $ = $.next;) k += N + $.data;
          return k
        }
      }, {
        key: "concat",
        value: function (N) {
          if (this.length === 0) return l.alloc(0);
          for (var $ = l.allocUnsafe(N >>> 0), k = this.head, B = 0; k;) b(k.data, $, B), B += k.data.length, k = k.next;
          return $
        }
      }, {
        key: "consume",
        value: function (N, $) {
          var k;
          return N < this.head.data.length ? (k = this.head.data.slice(0, N), this.head.data = this.head.data.slice(N)) : N === this.head.data.length ? k = this.shift() : k = $ ? this._getString(N) : this._getBuffer(N), k
        }
      }, {
        key: "first",
        value: function () {
          return this.head.data
        }
      }, {
        key: "_getString",
        value: function (N) {
          var $ = this.head,
            k = 1,
            B = $.data;
          for (N -= B.length; $ = $.next;) {
            var F = $.data,
              D = N > F.length ? F.length : N;
            if (D === F.length ? B += F : B += F.slice(0, N), N -= D, N === 0) {
              D === F.length ? (++k, $.next ? this.head = $.next : this.head = this.tail = null) : (this.head = $, $.data = F.slice(D));
              break
            }++k
          }
          return this.length -= k, B
        }
      }, {
        key: "_getBuffer",
        value: function (N) {
          var $ = l.allocUnsafe(N),
            k = this.head,
            B = 1;
          for (k.data.copy($), N -= k.data.length; k = k.next;) {
            var F = k.data,
              D = N > F.length ? F.length : N;
            if (F.copy($, $.length - N, 0, D), N -= D, N === 0) {
              D === F.length ? (++B, k.next ? this.head = k.next : this.head = this.tail = null) : (this.head = k, k.data = F.slice(D));
              break
            }++B
          }
          return this.length -= B, $
        }
      }, {
        key: w,
        value: function (N, $) {
          return f(this, e(e({}, $), {}, {
            depth: 0,
            customInspect: !1
          }))
        }
      }]), C
    }(), xS
  }

  function NCe(t, e) {
    var r = this,
      n = this._readableState && this._readableState.destroyed,
      i = this._writableState && this._writableState.destroyed;
    return n || i ? (e ? e(t) : t && (this._writableState ? this._writableState.errorEmitted || (this._writableState.errorEmitted = !0, process.nextTick(CS, this, t)) : process.nextTick(CS, this, t)), this) : (this._readableState && (this._readableState.destroyed = !0), this._writableState && (this._writableState.destroyed = !0), this._destroy(t || null, function (s) {
      !e && s ? r._writableState ? r._writableState.errorEmitted ? process.nextTick(X6, r) : (r._writableState.errorEmitted = !0, process.nextTick(Cz, r, s)) : process.nextTick(Cz, r, s) : e ? (process.nextTick(X6, r), e(s)) : process.nextTick(X6, r)
    }), this)
  }

  function Cz(t, e) {
    CS(t, e), X6(t)
  }

  function X6(t) {
    t._writableState && !t._writableState.emitClose || t._readableState && !t._readableState.emitClose || t.emit("close")
  }

  function MCe() {
    this._readableState && (this._readableState.destroyed = !1, this._readableState.reading = !1, this._readableState.ended = !1, this._readableState.endEmitted = !1), this._writableState && (this._writableState.destroyed = !1, this._writableState.ended = !1, this._writableState.ending = !1, this._writableState.finalCalled = !1, this._writableState.prefinished = !1, this._writableState.finished = !1, this._writableState.errorEmitted = !1)
  }

  function CS(t, e) {
    t.emit("error", e)
  }

  function PCe(t, e) {
    var r = t._readableState,
      n = t._writableState;
    r && r.autoDestroy || n && n.autoDestroy ? t.destroy(e) : t.emit("error", e)
  }
  var Ez = {
      destroy: NCe,
      undestroy: MCe,
      errorOrDestroy: PCe
    },
    cp = {};

  function $Ce(t, e) {
    t.prototype = Object.create(e.prototype), t.prototype.constructor = t, t.__proto__ = e
  }
  var Az = {};

  function Da(t, e, r) {
    r || (r = Error);

    function n(s, o, a) {
      return typeof e == "string" ? e : e(s, o, a)
    }
    var i = function (s) {
      $Ce(o, s);

      function o(a, c, l) {
        return s.call(this, n(a, c, l)) || this
      }
      return o
    }(r);
    i.prototype.name = r.name, i.prototype.code = t, Az[t] = i
  }

  function Sz(t, e) {
    if (Array.isArray(t)) {
      var r = t.length;
      return t = t.map(function (n) {
        return String(n)
      }), r > 2 ? "one of ".concat(e, " ").concat(t.slice(0, r - 1).join(", "), ", or ") + t[r - 1] : r === 2 ? "one of ".concat(e, " ").concat(t[0], " or ").concat(t[1]) : "of ".concat(e, " ").concat(t[0])
    } else return "of ".concat(e, " ").concat(String(t))
  }

  function OCe(t, e, r) {
    return t.substr(0, e.length) === e
  }

  function DCe(t, e, r) {
    return (r === void 0 || r > t.length) && (r = t.length), t.substring(r - e.length, r) === e
  }

  function LCe(t, e, r) {
    return typeof r != "number" && (r = 0), r + e.length > t.length ? !1 : t.indexOf(e, r) !== -1
  }
  Da("ERR_INVALID_OPT_VALUE", function (t, e) {
    return 'The value "' + e + '" is invalid for option "' + t + '"'
  }, TypeError), Da("ERR_INVALID_ARG_TYPE", function (t, e, r) {
    var n;
    typeof e == "string" && OCe(e, "not ") ? (n = "must not be", e = e.replace(/^not /, "")) : n = "must be";
    var i;
    if (DCe(t, " argument")) i = "The ".concat(t, " ").concat(n, " ").concat(Sz(e, "type"));
    else {
      var s = LCe(t, ".") ? "property" : "argument";
      i = 'The "'.concat(t, '" ').concat(s, " ").concat(n, " ").concat(Sz(e, "type"))
    }
    return i += ". Received type ".concat(typeof r), i
  }, TypeError), Da("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"), Da("ERR_METHOD_NOT_IMPLEMENTED", function (t) {
    return "The " + t + " method is not implemented"
  }), Da("ERR_STREAM_PREMATURE_CLOSE", "Premature close"), Da("ERR_STREAM_DESTROYED", function (t) {
    return "Cannot call " + t + " after a stream was destroyed"
  }), Da("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"), Da("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"), Da("ERR_STREAM_WRITE_AFTER_END", "write after end"), Da("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError), Da("ERR_UNKNOWN_ENCODING", function (t) {
    return "Unknown encoding: " + t
  }, TypeError), Da("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"), cp.codes = Az;
  var BCe = cp.codes.ERR_INVALID_OPT_VALUE;

  function UCe(t, e, r) {
    return t.highWaterMark != null ? t.highWaterMark : e ? t[r] : null
  }

  function jCe(t, e, r, n) {
    var i = UCe(e, n, r);
    if (i != null) {
      if (!(isFinite(i) && Math.floor(i) === i) || i < 0) {
        var s = n ? r : "highWaterMark";
        throw new BCe(s, i)
      }
      return Math.floor(i)
    }
    return t.objectMode ? 16 : 16 * 1024
  }
  var Iz = {
      getHighWaterMark: jCe
    },
    FCe = WCe;

  function WCe(t, e) {
    if (ES("noDeprecation")) return t;
    var r = !1;

    function n() {
      if (!r) {
        if (ES("throwDeprecation")) throw new Error(e);
        ES("traceDeprecation") ? console.trace(e) : console.warn(e), r = !0
      }
      return t.apply(this, arguments)
    }
    return n
  }

  function ES(t) {
    try {
      if (!ot.localStorage) return !1
    } catch {
      return !1
    }
    var e = ot.localStorage[t];
    return e == null ? !1 : String(e).toLowerCase() === "true"
  }
  var AS, Tz;

  function kz() {
    if (Tz) return AS;
    Tz = 1, AS = P;

    function t(X) {
      var Z = this;
      this.next = null, this.entry = null, this.finish = function () {
        W(Z, X)
      }
    }
    var e;
    P.WritableState = V;
    var r = {
        deprecate: FCe
      },
      n = _z,
      i = d1.Buffer,
      s = (typeof ot < "u" ? ot : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function () {};

    function o(X) {
      return i.from(X)
    }

    function a(X) {
      return i.isBuffer(X) || X instanceof s
    }
    var c = Ez,
      l = Iz,
      h = l.getHighWaterMark,
      f = cp.codes,
      w = f.ERR_INVALID_ARG_TYPE,
      b = f.ERR_METHOD_NOT_IMPLEMENTED,
      C = f.ERR_MULTIPLE_CALLBACK,
      M = f.ERR_STREAM_CANNOT_PIPE,
      N = f.ERR_STREAM_DESTROYED,
      $ = f.ERR_STREAM_NULL_VALUES,
      k = f.ERR_STREAM_WRITE_AFTER_END,
      B = f.ERR_UNKNOWN_ENCODING,
      F = c.errorOrDestroy;
    $s(P, n);

    function D() {}

    function V(X, Z, ee) {
      e = e || cm(), X = X || {}, typeof ee != "boolean" && (ee = Z instanceof e), this.objectMode = !!X.objectMode, ee && (this.objectMode = this.objectMode || !!X.writableObjectMode), this.highWaterMark = h(this, X, "writableHighWaterMark", ee), this.finalCalled = !1, this.needDrain = !1, this.ending = !1, this.ended = !1, this.finished = !1, this.destroyed = !1;
      var ne = X.decodeStrings === !1;
      this.decodeStrings = !ne, this.defaultEncoding = X.defaultEncoding || "utf8", this.length = 0, this.writing = !1, this.corked = 0, this.sync = !0, this.bufferProcessing = !1, this.onwrite = function (O) {
        v(Z, O)
      }, this.writecb = null, this.writelen = 0, this.bufferedRequest = null, this.lastBufferedRequest = null, this.pendingcb = 0, this.prefinished = !1, this.errorEmitted = !1, this.emitClose = X.emitClose !== !1, this.autoDestroy = !!X.autoDestroy, this.bufferedRequestCount = 0, this.corkedRequestsFree = new t(this)
    }
    V.prototype.getBuffer = function () {
        for (var Z = this.bufferedRequest, ee = []; Z;) ee.push(Z), Z = Z.next;
        return ee
      },
      function () {
        try {
          Object.defineProperty(V.prototype, "buffer", {
            get: r.deprecate(function () {
              return this.getBuffer()
            }, "_writableState.buffer is deprecated. Use _writableState.getBuffer instead.", "DEP0003")
          })
        } catch {}
      }();
    var R;
    typeof Symbol == "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] == "function" ? (R = Function.prototype[Symbol.hasInstance], Object.defineProperty(P, Symbol.hasInstance, {
      value: function (Z) {
        return R.call(this, Z) ? !0 : this !== P ? !1 : Z && Z._writableState instanceof V
      }
    })) : R = function (Z) {
      return Z instanceof this
    };

    function P(X) {
      e = e || cm();
      var Z = this instanceof e;
      if (!Z && !R.call(P, this)) return new P(X);
      this._writableState = new V(X, this, Z), this.writable = !0, X && (typeof X.write == "function" && (this._write = X.write), typeof X.writev == "function" && (this._writev = X.writev), typeof X.destroy == "function" && (this._destroy = X.destroy), typeof X.final == "function" && (this._final = X.final)), n.call(this)
    }
    P.prototype.pipe = function () {
      F(this, new M)
    };

    function j(X, Z) {
      var ee = new k;
      F(X, ee), process.nextTick(Z, ee)
    }

    function Y(X, Z, ee, ne) {
      var O;
      return ee === null ? O = new $ : typeof ee != "string" && !Z.objectMode && (O = new w("chunk", ["string", "Buffer"], ee)), O ? (F(X, O), process.nextTick(ne, O), !1) : !0
    }
    P.prototype.write = function (X, Z, ee) {
      var ne = this._writableState,
        O = !1,
        H = !ne.objectMode && a(X);
      return H && !i.isBuffer(X) && (X = o(X)), typeof Z == "function" && (ee = Z, Z = null), H ? Z = "buffer" : Z || (Z = ne.defaultEncoding), typeof ee != "function" && (ee = D), ne.ending ? j(this, ee) : (H || Y(this, ne, X, ee)) && (ne.pendingcb++, O = I(this, ne, H, X, Z, ee)), O
    }, P.prototype.cork = function () {
      this._writableState.corked++
    }, P.prototype.uncork = function () {
      var X = this._writableState;
      X.corked && (X.corked--, !X.writing && !X.corked && !X.bufferProcessing && X.bufferedRequest && S(this, X))
    }, P.prototype.setDefaultEncoding = function (Z) {
      if (typeof Z == "string" && (Z = Z.toLowerCase()), !(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((Z + "").toLowerCase()) > -1)) throw new B(Z);
      return this._writableState.defaultEncoding = Z, this
    }, Object.defineProperty(P.prototype, "writableBuffer", {
      enumerable: !1,
      get: function () {
        return this._writableState && this._writableState.getBuffer()
      }
    });

    function U(X, Z, ee) {
      return !X.objectMode && X.decodeStrings !== !1 && typeof Z == "string" && (Z = i.from(Z, ee)), Z
    }
    Object.defineProperty(P.prototype, "writableHighWaterMark", {
      enumerable: !1,
      get: function () {
        return this._writableState.highWaterMark
      }
    });

    function I(X, Z, ee, ne, O, H) {
      if (!ee) {
        var Q = U(Z, ne, O);
        ne !== Q && (ee = !0, O = "buffer", ne = Q)
      }
      var de = Z.objectMode ? 1 : ne.length;
      Z.length += de;
      var ge = Z.length < Z.highWaterMark;
      if (ge || (Z.needDrain = !0), Z.writing || Z.corked) {
        var Te = Z.lastBufferedRequest;
        Z.lastBufferedRequest = {
          chunk: ne,
          encoding: O,
          isBuf: ee,
          callback: H,
          next: null
        }, Te ? Te.next = Z.lastBufferedRequest : Z.bufferedRequest = Z.lastBufferedRequest, Z.bufferedRequestCount += 1
      } else g(X, Z, !1, de, ne, O, H);
      return ge
    }

    function g(X, Z, ee, ne, O, H, Q) {
      Z.writelen = ne, Z.writecb = Q, Z.writing = !0, Z.sync = !0, Z.destroyed ? Z.onwrite(new N("write")) : ee ? X._writev(O, Z.onwrite) : X._write(O, H, Z.onwrite), Z.sync = !1
    }

    function u(X, Z, ee, ne, O) {
      --Z.pendingcb, ee ? (process.nextTick(O, ne), process.nextTick(G, X, Z), X._writableState.errorEmitted = !0, F(X, ne)) : (O(ne), X._writableState.errorEmitted = !0, F(X, ne), G(X, Z))
    }

    function p(X) {
      X.writing = !1, X.writecb = null, X.length -= X.writelen, X.writelen = 0
    }

    function v(X, Z) {
      var ee = X._writableState,
        ne = ee.sync,
        O = ee.writecb;
      if (typeof O != "function") throw new C;
      if (p(ee), Z) u(X, ee, ne, Z, O);
      else {
        var H = _(ee) || X.destroyed;
        !H && !ee.corked && !ee.bufferProcessing && ee.bufferedRequest && S(X, ee), ne ? process.nextTick(x, X, ee, H, O) : x(X, ee, H, O)
      }
    }

    function x(X, Z, ee, ne) {
      ee || E(X, Z), Z.pendingcb--, ne(), G(X, Z)
    }

    function E(X, Z) {
      Z.length === 0 && Z.needDrain && (Z.needDrain = !1, X.emit("drain"))
    }

    function S(X, Z) {
      Z.bufferProcessing = !0;
      var ee = Z.bufferedRequest;
      if (X._writev && ee && ee.next) {
        var ne = Z.bufferedRequestCount,
          O = new Array(ne),
          H = Z.corkedRequestsFree;
        H.entry = ee;
        for (var Q = 0, de = !0; ee;) O[Q] = ee, ee.isBuf || (de = !1), ee = ee.next, Q += 1;
        O.allBuffers = de, g(X, Z, !0, Z.length, O, "", H.finish), Z.pendingcb++, Z.lastBufferedRequest = null, H.next ? (Z.corkedRequestsFree = H.next, H.next = null) : Z.corkedRequestsFree = new t(Z), Z.bufferedRequestCount = 0
      } else {
        for (; ee;) {
          var ge = ee.chunk,
            Te = ee.encoding,
            Oe = ee.callback,
            De = Z.objectMode ? 1 : ge.length;
          if (g(X, Z, !1, De, ge, Te, Oe), ee = ee.next, Z.bufferedRequestCount--, Z.writing) break
        }
        ee === null && (Z.lastBufferedRequest = null)
      }
      Z.bufferedRequest = ee, Z.bufferProcessing = !1
    }
    P.prototype._write = function (X, Z, ee) {
      ee(new b("_write()"))
    }, P.prototype._writev = null, P.prototype.end = function (X, Z, ee) {
      var ne = this._writableState;
      return typeof X == "function" ? (ee = X, X = null, Z = null) : typeof Z == "function" && (ee = Z, Z = null), X != null && this.write(X, Z), ne.corked && (ne.corked = 1, this.uncork()), ne.ending || ce(this, ne, ee), this
    }, Object.defineProperty(P.prototype, "writableLength", {
      enumerable: !1,
      get: function () {
        return this._writableState.length
      }
    });

    function _(X) {
      return X.ending && X.length === 0 && X.bufferedRequest === null && !X.finished && !X.writing
    }

    function y(X, Z) {
      X._final(function (ee) {
        Z.pendingcb--, ee && F(X, ee), Z.prefinished = !0, X.emit("prefinish"), G(X, Z)
      })
    }

    function A(X, Z) {
      !Z.prefinished && !Z.finalCalled && (typeof X._final == "function" && !Z.destroyed ? (Z.pendingcb++, Z.finalCalled = !0, process.nextTick(y, X, Z)) : (Z.prefinished = !0, X.emit("prefinish")))
    }

    function G(X, Z) {
      var ee = _(Z);
      if (ee && (A(X, Z), Z.pendingcb === 0 && (Z.finished = !0, X.emit("finish"), Z.autoDestroy))) {
        var ne = X._readableState;
        (!ne || ne.autoDestroy && ne.endEmitted) && X.destroy()
      }
      return ee
    }

    function ce(X, Z, ee) {
      Z.ending = !0, G(X, Z), ee && (Z.finished ? process.nextTick(ee) : X.once("finish", ee)), Z.ended = !0, X.writable = !1
    }

    function W(X, Z, ee) {
      var ne = X.entry;
      for (X.entry = null; ne;) {
        var O = ne.callback;
        Z.pendingcb--, O(ee), ne = ne.next
      }
      Z.corkedRequestsFree.next = X
    }
    return Object.defineProperty(P.prototype, "destroyed", {
      enumerable: !1,
      get: function () {
        return this._writableState === void 0 ? !1 : this._writableState.destroyed
      },
      set: function (Z) {
        this._writableState && (this._writableState.destroyed = Z)
      }
    }), P.prototype.destroy = c.destroy, P.prototype._undestroy = c.undestroy, P.prototype._destroy = function (X, Z) {
      Z(X)
    }, AS
  }
  var SS, Rz;

  function cm() {
    if (Rz) return SS;
    Rz = 1;
    var t = Object.keys || function (l) {
      var h = [];
      for (var f in l) h.push(f);
      return h
    };
    SS = o;
    var e = Bz(),
      r = kz();
    $s(o, e);
    for (var n = t(r.prototype), i = 0; i < n.length; i++) {
      var s = n[i];
      o.prototype[s] || (o.prototype[s] = r.prototype[s])
    }

    function o(l) {
      if (!(this instanceof o)) return new o(l);
      e.call(this, l), r.call(this, l), this.allowHalfOpen = !0, l && (l.readable === !1 && (this.readable = !1), l.writable === !1 && (this.writable = !1), l.allowHalfOpen === !1 && (this.allowHalfOpen = !1, this.once("end", a)))
    }
    Object.defineProperty(o.prototype, "writableHighWaterMark", {
      enumerable: !1,
      get: function () {
        return this._writableState.highWaterMark
      }
    }), Object.defineProperty(o.prototype, "writableBuffer", {
      enumerable: !1,
      get: function () {
        return this._writableState && this._writableState.getBuffer()
      }
    }), Object.defineProperty(o.prototype, "writableLength", {
      enumerable: !1,
      get: function () {
        return this._writableState.length
      }
    });

    function a() {
      this._writableState.ended || process.nextTick(c, this)
    }

    function c(l) {
      l.end()
    }
    return Object.defineProperty(o.prototype, "destroyed", {
      enumerable: !1,
      get: function () {
        return this._readableState === void 0 || this._writableState === void 0 ? !1 : this._readableState.destroyed && this._writableState.destroyed
      },
      set: function (h) {
        this._readableState === void 0 || this._writableState === void 0 || (this._readableState.destroyed = h, this._writableState.destroyed = h)
      }
    }), SS
  }
  var IS = {},
    Nz;

  function Mz() {
    if (Nz) return IS;
    Nz = 1;
    var t = Vh.Buffer,
      e = t.isEncoding || function ($) {
        switch ($ = "" + $, $ && $.toLowerCase()) {
          case "hex":
          case "utf8":
          case "utf-8":
          case "ascii":
          case "binary":
          case "base64":
          case "ucs2":
          case "ucs-2":
          case "utf16le":
          case "utf-16le":
          case "raw":
            return !0;
          default:
            return !1
        }
      };

    function r($) {
      if (!$) return "utf8";
      for (var k;;) switch ($) {
        case "utf8":
        case "utf-8":
          return "utf8";
        case "ucs2":
        case "ucs-2":
        case "utf16le":
        case "utf-16le":
          return "utf16le";
        case "latin1":
        case "binary":
          return "latin1";
        case "base64":
        case "ascii":
        case "hex":
          return $;
        default:
          if (k) return;
          $ = ("" + $).toLowerCase(), k = !0
      }
    }

    function n($) {
      var k = r($);
      if (typeof k != "string" && (t.isEncoding === e || !e($))) throw new Error("Unknown encoding: " + $);
      return k || $
    }
    IS.StringDecoder = i;

    function i($) {
      this.encoding = n($);
      var k;
      switch (this.encoding) {
        case "utf16le":
          this.text = f, this.end = w, k = 4;
          break;
        case "utf8":
          this.fillLast = c, k = 4;
          break;
        case "base64":
          this.text = b, this.end = C, k = 3;
          break;
        default:
          this.write = M, this.end = N;
          return
      }
      this.lastNeed = 0, this.lastTotal = 0, this.lastChar = t.allocUnsafe(k)
    }
    i.prototype.write = function ($) {
      if ($.length === 0) return "";
      var k, B;
      if (this.lastNeed) {
        if (k = this.fillLast($), k === void 0) return "";
        B = this.lastNeed, this.lastNeed = 0
      } else B = 0;
      return B < $.length ? k ? k + this.text($, B) : this.text($, B) : k || ""
    }, i.prototype.end = h, i.prototype.text = l, i.prototype.fillLast = function ($) {
      if (this.lastNeed <= $.length) return $.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
      $.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, $.length), this.lastNeed -= $.length
    };

    function s($) {
      return $ <= 127 ? 0 : $ >> 5 === 6 ? 2 : $ >> 4 === 14 ? 3 : $ >> 3 === 30 ? 4 : $ >> 6 === 2 ? -1 : -2
    }

    function o($, k, B) {
      var F = k.length - 1;
      if (F < B) return 0;
      var D = s(k[F]);
      return D >= 0 ? (D > 0 && ($.lastNeed = D - 1), D) : --F < B || D === -2 ? 0 : (D = s(k[F]), D >= 0 ? (D > 0 && ($.lastNeed = D - 2), D) : --F < B || D === -2 ? 0 : (D = s(k[F]), D >= 0 ? (D > 0 && (D === 2 ? D = 0 : $.lastNeed = D - 3), D) : 0))
    }

    function a($, k, B) {
      if ((k[0] & 192) !== 128) return $.lastNeed = 0, "�";
      if ($.lastNeed > 1 && k.length > 1) {
        if ((k[1] & 192) !== 128) return $.lastNeed = 1, "�";
        if ($.lastNeed > 2 && k.length > 2 && (k[2] & 192) !== 128) return $.lastNeed = 2, "�"
      }
    }

    function c($) {
      var k = this.lastTotal - this.lastNeed,
        B = a(this, $);
      if (B !== void 0) return B;
      if (this.lastNeed <= $.length) return $.copy(this.lastChar, k, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
      $.copy(this.lastChar, k, 0, $.length), this.lastNeed -= $.length
    }

    function l($, k) {
      var B = o(this, $, k);
      if (!this.lastNeed) return $.toString("utf8", k);
      this.lastTotal = B;
      var F = $.length - (B - this.lastNeed);
      return $.copy(this.lastChar, 0, F), $.toString("utf8", k, F)
    }

    function h($) {
      var k = $ && $.length ? this.write($) : "";
      return this.lastNeed ? k + "�" : k
    }

    function f($, k) {
      if (($.length - k) % 2 === 0) {
        var B = $.toString("utf16le", k);
        if (B) {
          var F = B.charCodeAt(B.length - 1);
          if (F >= 55296 && F <= 56319) return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = $[$.length - 2], this.lastChar[1] = $[$.length - 1], B.slice(0, -1)
        }
        return B
      }
      return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = $[$.length - 1], $.toString("utf16le", k, $.length - 1)
    }

    function w($) {
      var k = $ && $.length ? this.write($) : "";
      if (this.lastNeed) {
        var B = this.lastTotal - this.lastNeed;
        return k + this.lastChar.toString("utf16le", 0, B)
      }
      return k
    }

    function b($, k) {
      var B = ($.length - k) % 3;
      return B === 0 ? $.toString("base64", k) : (this.lastNeed = 3 - B, this.lastTotal = 3, B === 1 ? this.lastChar[0] = $[$.length - 1] : (this.lastChar[0] = $[$.length - 2], this.lastChar[1] = $[$.length - 1]), $.toString("base64", k, $.length - B))
    }

    function C($) {
      var k = $ && $.length ? this.write($) : "";
      return this.lastNeed ? k + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : k
    }

    function M($) {
      return $.toString(this.encoding)
    }

    function N($) {
      return $ && $.length ? this.write($) : ""
    }
    return IS
  }
  var Pz = cp.codes.ERR_STREAM_PREMATURE_CLOSE;

  function zCe(t) {
    var e = !1;
    return function () {
      if (!e) {
        e = !0;
        for (var r = arguments.length, n = new Array(r), i = 0; i < r; i++) n[i] = arguments[i];
        t.apply(this, n)
      }
    }
  }

  function HCe() {}

  function qCe(t) {
    return t.setHeader && typeof t.abort == "function"
  }

  function $z(t, e, r) {
    if (typeof e == "function") return $z(t, null, e);
    e || (e = {}), r = zCe(r || HCe);
    var n = e.readable || e.readable !== !1 && t.readable,
      i = e.writable || e.writable !== !1 && t.writable,
      s = function () {
        t.writable || a()
      },
      o = t._writableState && t._writableState.finished,
      a = function () {
        i = !1, o = !0, n || r.call(t)
      },
      c = t._readableState && t._readableState.endEmitted,
      l = function () {
        n = !1, c = !0, i || r.call(t)
      },
      h = function (C) {
        r.call(t, C)
      },
      f = function () {
        var C;
        if (n && !c) return (!t._readableState || !t._readableState.ended) && (C = new Pz), r.call(t, C);
        if (i && !o) return (!t._writableState || !t._writableState.ended) && (C = new Pz), r.call(t, C)
      },
      w = function () {
        t.req.on("finish", a)
      };
    return qCe(t) ? (t.on("complete", a), t.on("abort", f), t.req ? w() : t.on("request", w)) : i && !t._writableState && (t.on("end", s), t.on("close", s)), t.on("end", l), t.on("finish", a), e.error !== !1 && t.on("error", h), t.on("close", f),
      function () {
        t.removeListener("complete", a), t.removeListener("abort", f), t.removeListener("request", w), t.req && t.req.removeListener("finish", a), t.removeListener("end", s), t.removeListener("close", s), t.removeListener("finish", a), t.removeListener("end", l), t.removeListener("error", h), t.removeListener("close", f)
      }
  }
  var TS = $z,
    kS, Oz;

  function VCe() {
    if (Oz) return kS;
    Oz = 1;
    var t;

    function e(B, F, D) {
      return F = r(F), F in B ? Object.defineProperty(B, F, {
        value: D,
        enumerable: !0,
        configurable: !0,
        writable: !0
      }) : B[F] = D, B
    }

    function r(B) {
      var F = n(B, "string");
      return typeof F == "symbol" ? F : String(F)
    }

    function n(B, F) {
      if (typeof B != "object" || B === null) return B;
      var D = B[Symbol.toPrimitive];
      if (D !== void 0) {
        var V = D.call(B, F || "default");
        if (typeof V != "object") return V;
        throw new TypeError("@@toPrimitive must return a primitive value.")
      }
      return (F === "string" ? String : Number)(B)
    }
    var i = TS,
      s = Symbol("lastResolve"),
      o = Symbol("lastReject"),
      a = Symbol("error"),
      c = Symbol("ended"),
      l = Symbol("lastPromise"),
      h = Symbol("handlePromise"),
      f = Symbol("stream");

    function w(B, F) {
      return {
        value: B,
        done: F
      }
    }

    function b(B) {
      var F = B[s];
      if (F !== null) {
        var D = B[f].read();
        D !== null && (B[l] = null, B[s] = null, B[o] = null, F(w(D, !1)))
      }
    }

    function C(B) {
      process.nextTick(b, B)
    }

    function M(B, F) {
      return function (D, V) {
        B.then(function () {
          if (F[c]) {
            D(w(void 0, !0));
            return
          }
          F[h](D, V)
        }, V)
      }
    }
    var N = Object.getPrototypeOf(function () {}),
      $ = Object.setPrototypeOf((t = {
        get stream() {
          return this[f]
        },
        next: function () {
          var F = this,
            D = this[a];
          if (D !== null) return Promise.reject(D);
          if (this[c]) return Promise.resolve(w(void 0, !0));
          if (this[f].destroyed) return new Promise(function (j, Y) {
            process.nextTick(function () {
              F[a] ? Y(F[a]) : j(w(void 0, !0))
            })
          });
          var V = this[l],
            R;
          if (V) R = new Promise(M(V, this));
          else {
            var P = this[f].read();
            if (P !== null) return Promise.resolve(w(P, !1));
            R = new Promise(this[h])
          }
          return this[l] = R, R
        }
      }, e(t, Symbol.asyncIterator, function () {
        return this
      }), e(t, "return", function () {
        var F = this;
        return new Promise(function (D, V) {
          F[f].destroy(null, function (R) {
            if (R) {
              V(R);
              return
            }
            D(w(void 0, !0))
          })
        })
      }), t), N),
      k = function (F) {
        var D, V = Object.create($, (D = {}, e(D, f, {
          value: F,
          writable: !0
        }), e(D, s, {
          value: null,
          writable: !0
        }), e(D, o, {
          value: null,
          writable: !0
        }), e(D, a, {
          value: null,
          writable: !0
        }), e(D, c, {
          value: F._readableState.endEmitted,
          writable: !0
        }), e(D, h, {
          value: function (P, j) {
            var Y = V[f].read();
            Y ? (V[l] = null, V[s] = null, V[o] = null, P(w(Y, !1))) : (V[s] = P, V[o] = j)
          },
          writable: !0
        }), D));
        return V[l] = null, i(F, function (R) {
          if (R && R.code !== "ERR_STREAM_PREMATURE_CLOSE") {
            var P = V[o];
            P !== null && (V[l] = null, V[s] = null, V[o] = null, P(R)), V[a] = R;
            return
          }
          var j = V[s];
          j !== null && (V[l] = null, V[s] = null, V[o] = null, j(w(void 0, !0))), V[c] = !0
        }), F.on("readable", C.bind(null, V)), V
      };
    return kS = k, kS
  }
  var RS, Dz;

  function KCe() {
    return Dz || (Dz = 1, RS = function () {
      throw new Error("Readable.from is not available in the browser")
    }), RS
  }
  var NS, Lz;

  function Bz() {
    if (Lz) return NS;
    Lz = 1, NS = j;
    var t;
    j.ReadableState = P, Fi.EventEmitter;
    var e = function (Q, de) {
        return Q.listeners(de).length
      },
      r = _z,
      n = d1.Buffer,
      i = (typeof ot < "u" ? ot : typeof window < "u" ? window : typeof self < "u" ? self : {}).Uint8Array || function () {};

    function s(H) {
      return n.from(H)
    }

    function o(H) {
      return n.isBuffer(H) || H instanceof i
    }
    var a = eg,
      c;
    a && a.debuglog ? c = a.debuglog("stream") : c = function () {};
    var l = RCe(),
      h = Ez,
      f = Iz,
      w = f.getHighWaterMark,
      b = cp.codes,
      C = b.ERR_INVALID_ARG_TYPE,
      M = b.ERR_STREAM_PUSH_AFTER_EOF,
      N = b.ERR_METHOD_NOT_IMPLEMENTED,
      $ = b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,
      k, B, F;
    $s(j, r);
    var D = h.errorOrDestroy,
      V = ["error", "close", "destroy", "pause", "resume"];

    function R(H, Q, de) {
      if (typeof H.prependListener == "function") return H.prependListener(Q, de);
      !H._events || !H._events[Q] ? H.on(Q, de) : Array.isArray(H._events[Q]) ? H._events[Q].unshift(de) : H._events[Q] = [de, H._events[Q]]
    }

    function P(H, Q, de) {
      t = t || cm(), H = H || {}, typeof de != "boolean" && (de = Q instanceof t), this.objectMode = !!H.objectMode, de && (this.objectMode = this.objectMode || !!H.readableObjectMode), this.highWaterMark = w(this, H, "readableHighWaterMark", de), this.buffer = new l, this.length = 0, this.pipes = null, this.pipesCount = 0, this.flowing = null, this.ended = !1, this.endEmitted = !1, this.reading = !1, this.sync = !0, this.needReadable = !1, this.emittedReadable = !1, this.readableListening = !1, this.resumeScheduled = !1, this.paused = !0, this.emitClose = H.emitClose !== !1, this.autoDestroy = !!H.autoDestroy, this.destroyed = !1, this.defaultEncoding = H.defaultEncoding || "utf8", this.awaitDrain = 0, this.readingMore = !1, this.decoder = null, this.encoding = null, H.encoding && (k || (k = Mz().StringDecoder), this.decoder = new k(H.encoding), this.encoding = H.encoding)
    }

    function j(H) {
      if (t = t || cm(), !(this instanceof j)) return new j(H);
      var Q = this instanceof t;
      this._readableState = new P(H, this, Q), this.readable = !0, H && (typeof H.read == "function" && (this._read = H.read), typeof H.destroy == "function" && (this._destroy = H.destroy)), r.call(this)
    }
    Object.defineProperty(j.prototype, "destroyed", {
      enumerable: !1,
      get: function () {
        return this._readableState === void 0 ? !1 : this._readableState.destroyed
      },
      set: function (Q) {
        this._readableState && (this._readableState.destroyed = Q)
      }
    }), j.prototype.destroy = h.destroy, j.prototype._undestroy = h.undestroy, j.prototype._destroy = function (H, Q) {
      Q(H)
    }, j.prototype.push = function (H, Q) {
      var de = this._readableState,
        ge;
      return de.objectMode ? ge = !0 : typeof H == "string" && (Q = Q || de.defaultEncoding, Q !== de.encoding && (H = n.from(H, Q), Q = ""), ge = !0), Y(this, H, Q, !1, ge)
    }, j.prototype.unshift = function (H) {
      return Y(this, H, null, !0, !1)
    };

    function Y(H, Q, de, ge, Te) {
      c("readableAddChunk", Q);
      var Oe = H._readableState;
      if (Q === null) Oe.reading = !1, v(H, Oe);
      else {
        var De;
        if (Te || (De = I(Oe, Q)), De) D(H, De);
        else if (Oe.objectMode || Q && Q.length > 0)
          if (typeof Q != "string" && !Oe.objectMode && Object.getPrototypeOf(Q) !== n.prototype && (Q = s(Q)), ge) Oe.endEmitted ? D(H, new $) : U(H, Oe, Q, !0);
          else if (Oe.ended) D(H, new M);
        else {
          if (Oe.destroyed) return !1;
          Oe.reading = !1, Oe.decoder && !de ? (Q = Oe.decoder.write(Q), Oe.objectMode || Q.length !== 0 ? U(H, Oe, Q, !1) : S(H, Oe)) : U(H, Oe, Q, !1)
        } else ge || (Oe.reading = !1, S(H, Oe))
      }
      return !Oe.ended && (Oe.length < Oe.highWaterMark || Oe.length === 0)
    }

    function U(H, Q, de, ge) {
      Q.flowing && Q.length === 0 && !Q.sync ? (Q.awaitDrain = 0, H.emit("data", de)) : (Q.length += Q.objectMode ? 1 : de.length, ge ? Q.buffer.unshift(de) : Q.buffer.push(de), Q.needReadable && x(H)), S(H, Q)
    }

    function I(H, Q) {
      var de;
      return !o(Q) && typeof Q != "string" && Q !== void 0 && !H.objectMode && (de = new C("chunk", ["string", "Buffer", "Uint8Array"], Q)), de
    }
    j.prototype.isPaused = function () {
      return this._readableState.flowing === !1
    }, j.prototype.setEncoding = function (H) {
      k || (k = Mz().StringDecoder);
      var Q = new k(H);
      this._readableState.decoder = Q, this._readableState.encoding = this._readableState.decoder.encoding;
      for (var de = this._readableState.buffer.head, ge = ""; de !== null;) ge += Q.write(de.data), de = de.next;
      return this._readableState.buffer.clear(), ge !== "" && this._readableState.buffer.push(ge), this._readableState.length = ge.length, this
    };
    var g = 1073741824;

    function u(H) {
      return H >= g ? H = g : (H--, H |= H >>> 1, H |= H >>> 2, H |= H >>> 4, H |= H >>> 8, H |= H >>> 16, H++), H
    }

    function p(H, Q) {
      return H <= 0 || Q.length === 0 && Q.ended ? 0 : Q.objectMode ? 1 : H !== H ? Q.flowing && Q.length ? Q.buffer.head.data.length : Q.length : (H > Q.highWaterMark && (Q.highWaterMark = u(H)), H <= Q.length ? H : Q.ended ? Q.length : (Q.needReadable = !0, 0))
    }
    j.prototype.read = function (H) {
      c("read", H), H = parseInt(H, 10);
      var Q = this._readableState,
        de = H;
      if (H !== 0 && (Q.emittedReadable = !1), H === 0 && Q.needReadable && ((Q.highWaterMark !== 0 ? Q.length >= Q.highWaterMark : Q.length > 0) || Q.ended)) return c("read: emitReadable", Q.length, Q.ended), Q.length === 0 && Q.ended ? ee(this) : x(this), null;
      if (H = p(H, Q), H === 0 && Q.ended) return Q.length === 0 && ee(this), null;
      var ge = Q.needReadable;
      c("need readable", ge), (Q.length === 0 || Q.length - H < Q.highWaterMark) && (ge = !0, c("length less than watermark", ge)), Q.ended || Q.reading ? (ge = !1, c("reading or ended", ge)) : ge && (c("do read"), Q.reading = !0, Q.sync = !0, Q.length === 0 && (Q.needReadable = !0), this._read(Q.highWaterMark), Q.sync = !1, Q.reading || (H = p(de, Q)));
      var Te;
      return H > 0 ? Te = Z(H, Q) : Te = null, Te === null ? (Q.needReadable = Q.length <= Q.highWaterMark, H = 0) : (Q.length -= H, Q.awaitDrain = 0), Q.length === 0 && (Q.ended || (Q.needReadable = !0), de !== H && Q.ended && ee(this)), Te !== null && this.emit("data", Te), Te
    };

    function v(H, Q) {
      if (c("onEofChunk"), !Q.ended) {
        if (Q.decoder) {
          var de = Q.decoder.end();
          de && de.length && (Q.buffer.push(de), Q.length += Q.objectMode ? 1 : de.length)
        }
        Q.ended = !0, Q.sync ? x(H) : (Q.needReadable = !1, Q.emittedReadable || (Q.emittedReadable = !0, E(H)))
      }
    }

    function x(H) {
      var Q = H._readableState;
      c("emitReadable", Q.needReadable, Q.emittedReadable), Q.needReadable = !1, Q.emittedReadable || (c("emitReadable", Q.flowing), Q.emittedReadable = !0, process.nextTick(E, H))
    }

    function E(H) {
      var Q = H._readableState;
      c("emitReadable_", Q.destroyed, Q.length, Q.ended), !Q.destroyed && (Q.length || Q.ended) && (H.emit("readable"), Q.emittedReadable = !1), Q.needReadable = !Q.flowing && !Q.ended && Q.length <= Q.highWaterMark, X(H)
    }

    function S(H, Q) {
      Q.readingMore || (Q.readingMore = !0, process.nextTick(_, H, Q))
    }

    function _(H, Q) {
      for (; !Q.reading && !Q.ended && (Q.length < Q.highWaterMark || Q.flowing && Q.length === 0);) {
        var de = Q.length;
        if (c("maybeReadMore read 0"), H.read(0), de === Q.length) break
      }
      Q.readingMore = !1
    }
    j.prototype._read = function (H) {
      D(this, new N("_read()"))
    }, j.prototype.pipe = function (H, Q) {
      var de = this,
        ge = this._readableState;
      switch (ge.pipesCount) {
        case 0:
          ge.pipes = H;
          break;
        case 1:
          ge.pipes = [ge.pipes, H];
          break;
        default:
          ge.pipes.push(H);
          break
      }
      ge.pipesCount += 1, c("pipe count=%d opts=%j", ge.pipesCount, Q);
      var Te = (!Q || Q.end !== !1) && H !== process.stdout && H !== process.stderr,
        Oe = Te ? et : Pe;
      ge.endEmitted ? process.nextTick(Oe) : de.once("end", Oe), H.on("unpipe", De);

      function De(J, L) {
        c("onunpipe"), J === de && L && L.hasUnpiped === !1 && (L.hasUnpiped = !0, qe())
      }

      function et() {
        c("onend"), H.end()
      }
      var rt = y(de);
      H.on("drain", rt);
      var Ze = !1;

      function qe() {
        c("cleanup"), H.removeListener("close", xe), H.removeListener("finish", Ie), H.removeListener("drain", rt), H.removeListener("error", we), H.removeListener("unpipe", De), de.removeListener("end", et), de.removeListener("end", Pe), de.removeListener("data", He), Ze = !0, ge.awaitDrain && (!H._writableState || H._writableState.needDrain) && rt()
      }
      de.on("data", He);

      function He(J) {
        c("ondata");
        var L = H.write(J);
        c("dest.write", L), L === !1 && ((ge.pipesCount === 1 && ge.pipes === H || ge.pipesCount > 1 && O(ge.pipes, H) !== -1) && !Ze && (c("false write response, pause", ge.awaitDrain), ge.awaitDrain++), de.pause())
      }

      function we(J) {
        c("onerror", J), Pe(), H.removeListener("error", we), e(H, "error") === 0 && D(H, J)
      }
      R(H, "error", we);

      function xe() {
        H.removeListener("finish", Ie), Pe()
      }
      H.once("close", xe);

      function Ie() {
        c("onfinish"), H.removeListener("close", xe), Pe()
      }
      H.once("finish", Ie);

      function Pe() {
        c("unpipe"), de.unpipe(H)
      }
      return H.emit("pipe", de), ge.flowing || (c("pipe resume"), de.resume()), H
    };

    function y(H) {
      return function () {
        var de = H._readableState;
        c("pipeOnDrain", de.awaitDrain), de.awaitDrain && de.awaitDrain--, de.awaitDrain === 0 && e(H, "data") && (de.flowing = !0, X(H))
      }
    }
    j.prototype.unpipe = function (H) {
      var Q = this._readableState,
        de = {
          hasUnpiped: !1
        };
      if (Q.pipesCount === 0) return this;
      if (Q.pipesCount === 1) return H && H !== Q.pipes ? this : (H || (H = Q.pipes), Q.pipes = null, Q.pipesCount = 0, Q.flowing = !1, H && H.emit("unpipe", this, de), this);
      if (!H) {
        var ge = Q.pipes,
          Te = Q.pipesCount;
        Q.pipes = null, Q.pipesCount = 0, Q.flowing = !1;
        for (var Oe = 0; Oe < Te; Oe++) ge[Oe].emit("unpipe", this, {
          hasUnpiped: !1
        });
        return this
      }
      var De = O(Q.pipes, H);
      return De === -1 ? this : (Q.pipes.splice(De, 1), Q.pipesCount -= 1, Q.pipesCount === 1 && (Q.pipes = Q.pipes[0]), H.emit("unpipe", this, de), this)
    }, j.prototype.on = function (H, Q) {
      var de = r.prototype.on.call(this, H, Q),
        ge = this._readableState;
      return H === "data" ? (ge.readableListening = this.listenerCount("readable") > 0, ge.flowing !== !1 && this.resume()) : H === "readable" && !ge.endEmitted && !ge.readableListening && (ge.readableListening = ge.needReadable = !0, ge.flowing = !1, ge.emittedReadable = !1, c("on readable", ge.length, ge.reading), ge.length ? x(this) : ge.reading || process.nextTick(G, this)), de
    }, j.prototype.addListener = j.prototype.on, j.prototype.removeListener = function (H, Q) {
      var de = r.prototype.removeListener.call(this, H, Q);
      return H === "readable" && process.nextTick(A, this), de
    }, j.prototype.removeAllListeners = function (H) {
      var Q = r.prototype.removeAllListeners.apply(this, arguments);
      return (H === "readable" || H === void 0) && process.nextTick(A, this), Q
    };

    function A(H) {
      var Q = H._readableState;
      Q.readableListening = H.listenerCount("readable") > 0, Q.resumeScheduled && !Q.paused ? Q.flowing = !0 : H.listenerCount("data") > 0 && H.resume()
    }

    function G(H) {
      c("readable nexttick read 0"), H.read(0)
    }
    j.prototype.resume = function () {
      var H = this._readableState;
      return H.flowing || (c("resume"), H.flowing = !H.readableListening, ce(this, H)), H.paused = !1, this
    };

    function ce(H, Q) {
      Q.resumeScheduled || (Q.resumeScheduled = !0, process.nextTick(W, H, Q))
    }

    function W(H, Q) {
      c("resume", Q.reading), Q.reading || H.read(0), Q.resumeScheduled = !1, H.emit("resume"), X(H), Q.flowing && !Q.reading && H.read(0)
    }
    j.prototype.pause = function () {
      return c("call pause flowing=%j", this._readableState.flowing), this._readableState.flowing !== !1 && (c("pause"), this._readableState.flowing = !1, this.emit("pause")), this._readableState.paused = !0, this
    };

    function X(H) {
      var Q = H._readableState;
      for (c("flow", Q.flowing); Q.flowing && H.read() !== null;);
    }
    j.prototype.wrap = function (H) {
      var Q = this,
        de = this._readableState,
        ge = !1;
      H.on("end", function () {
        if (c("wrapped end"), de.decoder && !de.ended) {
          var De = de.decoder.end();
          De && De.length && Q.push(De)
        }
        Q.push(null)
      }), H.on("data", function (De) {
        if (c("wrapped data"), de.decoder && (De = de.decoder.write(De)), !(de.objectMode && De == null) && !(!de.objectMode && (!De || !De.length))) {
          var et = Q.push(De);
          et || (ge = !0, H.pause())
        }
      });
      for (var Te in H) this[Te] === void 0 && typeof H[Te] == "function" && (this[Te] = function (et) {
        return function () {
          return H[et].apply(H, arguments)
        }
      }(Te));
      for (var Oe = 0; Oe < V.length; Oe++) H.on(V[Oe], this.emit.bind(this, V[Oe]));
      return this._read = function (De) {
        c("wrapped _read", De), ge && (ge = !1, H.resume())
      }, this
    }, typeof Symbol == "function" && (j.prototype[Symbol.asyncIterator] = function () {
      return B === void 0 && (B = VCe()), B(this)
    }), Object.defineProperty(j.prototype, "readableHighWaterMark", {
      enumerable: !1,
      get: function () {
        return this._readableState.highWaterMark
      }
    }), Object.defineProperty(j.prototype, "readableBuffer", {
      enumerable: !1,
      get: function () {
        return this._readableState && this._readableState.buffer
      }
    }), Object.defineProperty(j.prototype, "readableFlowing", {
      enumerable: !1,
      get: function () {
        return this._readableState.flowing
      },
      set: function (Q) {
        this._readableState && (this._readableState.flowing = Q)
      }
    }), j._fromList = Z, Object.defineProperty(j.prototype, "readableLength", {
      enumerable: !1,
      get: function () {
        return this._readableState.length
      }
    });

    function Z(H, Q) {
      if (Q.length === 0) return null;
      var de;
      return Q.objectMode ? de = Q.buffer.shift() : !H || H >= Q.length ? (Q.decoder ? de = Q.buffer.join("") : Q.buffer.length === 1 ? de = Q.buffer.first() : de = Q.buffer.concat(Q.length), Q.buffer.clear()) : de = Q.buffer.consume(H, Q.decoder), de
    }

    function ee(H) {
      var Q = H._readableState;
      c("endReadable", Q.endEmitted), Q.endEmitted || (Q.ended = !0, process.nextTick(ne, Q, H))
    }

    function ne(H, Q) {
      if (c("endReadableNT", H.endEmitted, H.length), !H.endEmitted && H.length === 0 && (H.endEmitted = !0, Q.readable = !1, Q.emit("end"), H.autoDestroy)) {
        var de = Q._writableState;
        (!de || de.autoDestroy && de.finished) && Q.destroy()
      }
    }
    typeof Symbol == "function" && (j.from = function (H, Q) {
      return F === void 0 && (F = KCe()), F(j, H, Q)
    });

    function O(H, Q) {
      for (var de = 0, ge = H.length; de < ge; de++)
        if (H[de] === Q) return de;
      return -1
    }
    return NS
  }
  var Uz = wd,
    e8 = cp.codes,
    GCe = e8.ERR_METHOD_NOT_IMPLEMENTED,
    ZCe = e8.ERR_MULTIPLE_CALLBACK,
    YCe = e8.ERR_TRANSFORM_ALREADY_TRANSFORMING,
    QCe = e8.ERR_TRANSFORM_WITH_LENGTH_0,
    t8 = cm();
  $s(wd, t8);

  function JCe(t, e) {
    var r = this._transformState;
    r.transforming = !1;
    var n = r.writecb;
    if (n === null) return this.emit("error", new ZCe);
    r.writechunk = null, r.writecb = null, e != null && this.push(e), n(t);
    var i = this._readableState;
    i.reading = !1, (i.needReadable || i.length < i.highWaterMark) && this._read(i.highWaterMark)
  }

  function wd(t) {
    if (!(this instanceof wd)) return new wd(t);
    t8.call(this, t), this._transformState = {
      afterTransform: JCe.bind(this),
      needTransform: !1,
      transforming: !1,
      writecb: null,
      writechunk: null,
      writeencoding: null
    }, this._readableState.needReadable = !0, this._readableState.sync = !1, t && (typeof t.transform == "function" && (this._transform = t.transform), typeof t.flush == "function" && (this._flush = t.flush)), this.on("prefinish", XCe)
  }

  function XCe() {
    var t = this;
    typeof this._flush == "function" && !this._readableState.destroyed ? this._flush(function (e, r) {
      jz(t, e, r)
    }) : jz(this, null, null)
  }
  wd.prototype.push = function (t, e) {
    return this._transformState.needTransform = !1, t8.prototype.push.call(this, t, e)
  }, wd.prototype._transform = function (t, e, r) {
    r(new GCe("_transform()"))
  }, wd.prototype._write = function (t, e, r) {
    var n = this._transformState;
    if (n.writecb = r, n.writechunk = t, n.writeencoding = e, !n.transforming) {
      var i = this._readableState;
      (n.needTransform || i.needReadable || i.length < i.highWaterMark) && this._read(i.highWaterMark)
    }
  }, wd.prototype._read = function (t) {
    var e = this._transformState;
    e.writechunk !== null && !e.transforming ? (e.transforming = !0, this._transform(e.writechunk, e.writeencoding, e.afterTransform)) : e.needTransform = !0
  }, wd.prototype._destroy = function (t, e) {
    t8.prototype._destroy.call(this, t, function (r) {
      e(r)
    })
  };

  function jz(t, e, r) {
    if (e) return t.emit("error", e);
    if (r != null && t.push(r), t._writableState.length) throw new QCe;
    if (t._transformState.transforming) throw new YCe;
    return t.push(null)
  }
  var eEe = Pb,
    Fz = Uz;
  $s(Pb, Fz);

  function Pb(t) {
    if (!(this instanceof Pb)) return new Pb(t);
    Fz.call(this, t)
  }
  Pb.prototype._transform = function (t, e, r) {
    r(null, t)
  };
  var MS;

  function tEe(t) {
    var e = !1;
    return function () {
      e || (e = !0, t.apply(void 0, arguments))
    }
  }
  var Wz = cp.codes,
    rEe = Wz.ERR_MISSING_ARGS,
    nEe = Wz.ERR_STREAM_DESTROYED;

  function zz(t) {
    if (t) throw t
  }

  function iEe(t) {
    return t.setHeader && typeof t.abort == "function"
  }

  function sEe(t, e, r, n) {
    n = tEe(n);
    var i = !1;
    t.on("close", function () {
      i = !0
    }), MS === void 0 && (MS = TS), MS(t, {
      readable: e,
      writable: r
    }, function (o) {
      if (o) return n(o);
      i = !0, n()
    });
    var s = !1;
    return function (o) {
      if (!i && !s) {
        if (s = !0, iEe(t)) return t.abort();
        if (typeof t.destroy == "function") return t.destroy();
        n(o || new nEe("pipe"))
      }
    }
  }

  function Hz(t) {
    t()
  }

  function oEe(t, e) {
    return t.pipe(e)
  }

  function aEe(t) {
    return !t.length || typeof t[t.length - 1] != "function" ? zz : t.pop()
  }

  function cEe() {
    for (var t = arguments.length, e = new Array(t), r = 0; r < t; r++) e[r] = arguments[r];
    var n = aEe(e);
    if (Array.isArray(e[0]) && (e = e[0]), e.length < 2) throw new rEe("streams");
    var i, s = e.map(function (o, a) {
      var c = a < e.length - 1,
        l = a > 0;
      return sEe(o, c, l, function (h) {
        i || (i = h), h && s.forEach(Hz), !c && (s.forEach(Hz), n(i))
      })
    });
    return e.reduce(oEe)
  }
  var lEe = cEe;
  (function (t, e) {
    e = t.exports = Bz(), e.Stream = e, e.Readable = e, e.Writable = kz(), e.Duplex = cm(), e.Transform = Uz, e.PassThrough = eEe, e.finished = TS, e.pipeline = lEe
  })(_S, _S.exports);
  var qz = _S.exports;
  const {
    Transform: uEe
  } = qz;
  var dEe = t => class YZ extends uEe {
    constructor(r, n, i, s, o) {
      super(o), this._rate = r, this._capacity = n, this._delimitedSuffix = i, this._hashBitLength = s, this._options = o, this._state = new t, this._state.initialize(r, n), this._finalized = !1
    }
    _transform(r, n, i) {
      let s = null;
      try {
        this.update(r, n)
      } catch (o) {
        s = o
      }
      i(s)
    }
    _flush(r) {
      let n = null;
      try {
        this.push(this.digest())
      } catch (i) {
        n = i
      }
      r(n)
    }
    update(r, n) {
      if (!Buffer.isBuffer(r) && typeof r != "string") throw new TypeError("Data must be a string or a buffer");
      if (this._finalized) throw new Error("Digest already called");
      return Buffer.isBuffer(r) || (r = Buffer.from(r, n)), this._state.absorb(r), this
    }
    digest(r) {
      if (this._finalized) throw new Error("Digest already called");
      this._finalized = !0, this._delimitedSuffix && this._state.absorbLastFewBits(this._delimitedSuffix);
      let n = this._state.squeeze(this._hashBitLength / 8);
      return r !== void 0 && (n = n.toString(r)), this._resetState(), n
    }
    _resetState() {
      return this._state.initialize(this._rate, this._capacity), this
    }
    _clone() {
      const r = new YZ(this._rate, this._capacity, this._delimitedSuffix, this._hashBitLength, this._options);
      return this._state.copy(r._state), r._finalized = this._finalized, r
    }
  };
  const {
    Transform: hEe
  } = qz;
  var fEe = t => class QZ extends hEe {
    constructor(r, n, i, s) {
      super(s), this._rate = r, this._capacity = n, this._delimitedSuffix = i, this._options = s, this._state = new t, this._state.initialize(r, n), this._finalized = !1
    }
    _transform(r, n, i) {
      let s = null;
      try {
        this.update(r, n)
      } catch (o) {
        s = o
      }
      i(s)
    }
    _flush() {}
    _read(r) {
      this.push(this.squeeze(r))
    }
    update(r, n) {
      if (!Buffer.isBuffer(r) && typeof r != "string") throw new TypeError("Data must be a string or a buffer");
      if (this._finalized) throw new Error("Squeeze already called");
      return Buffer.isBuffer(r) || (r = Buffer.from(r, n)), this._state.absorb(r), this
    }
    squeeze(r, n) {
      this._finalized || (this._finalized = !0, this._state.absorbLastFewBits(this._delimitedSuffix));
      let i = this._state.squeeze(r);
      return n !== void 0 && (i = i.toString(n)), i
    }
    _resetState() {
      return this._state.initialize(this._rate, this._capacity), this
    }
    _clone() {
      const r = new QZ(this._rate, this._capacity, this._delimitedSuffix, this._options);
      return this._state.copy(r._state), r._finalized = this._finalized, r
    }
  };
  const pEe = dEe,
    gEe = fEe;
  var mEe = function (t) {
      const e = pEe(t),
        r = gEe(t);
      return function (n, i) {
        switch (typeof n == "string" ? n.toLowerCase() : n) {
          case "keccak224":
            return new e(1152, 448, null, 224, i);
          case "keccak256":
            return new e(1088, 512, null, 256, i);
          case "keccak384":
            return new e(832, 768, null, 384, i);
          case "keccak512":
            return new e(576, 1024, null, 512, i);
          case "sha3-224":
            return new e(1152, 448, 6, 224, i);
          case "sha3-256":
            return new e(1088, 512, 6, 256, i);
          case "sha3-384":
            return new e(832, 768, 6, 384, i);
          case "sha3-512":
            return new e(576, 1024, 6, 512, i);
          case "shake128":
            return new r(1344, 256, 31, i);
          case "shake256":
            return new r(1088, 512, 31, i);
          default:
            throw new Error("Invald algorithm: " + n)
        }
      }
    },
    Vz = {};
  const Kz = [1, 0, 32898, 0, 32906, 2147483648, 2147516416, 2147483648, 32907, 0, 2147483649, 0, 2147516545, 2147483648, 32777, 2147483648, 138, 0, 136, 0, 2147516425, 0, 2147483658, 0, 2147516555, 0, 139, 2147483648, 32905, 2147483648, 32771, 2147483648, 32770, 2147483648, 128, 2147483648, 32778, 0, 2147483658, 2147483648, 2147516545, 2147483648, 32896, 2147483648, 2147483649, 0, 2147516424, 2147483648];
  Vz.p1600 = function (t) {
    for (let e = 0; e < 24; ++e) {
      const r = t[0] ^ t[10] ^ t[20] ^ t[30] ^ t[40],
        n = t[1] ^ t[11] ^ t[21] ^ t[31] ^ t[41],
        i = t[2] ^ t[12] ^ t[22] ^ t[32] ^ t[42],
        s = t[3] ^ t[13] ^ t[23] ^ t[33] ^ t[43],
        o = t[4] ^ t[14] ^ t[24] ^ t[34] ^ t[44],
        a = t[5] ^ t[15] ^ t[25] ^ t[35] ^ t[45],
        c = t[6] ^ t[16] ^ t[26] ^ t[36] ^ t[46],
        l = t[7] ^ t[17] ^ t[27] ^ t[37] ^ t[47],
        h = t[8] ^ t[18] ^ t[28] ^ t[38] ^ t[48],
        f = t[9] ^ t[19] ^ t[29] ^ t[39] ^ t[49];
      let w = h ^ (i << 1 | s >>> 31),
        b = f ^ (s << 1 | i >>> 31);
      const C = t[0] ^ w,
        M = t[1] ^ b,
        N = t[10] ^ w,
        $ = t[11] ^ b,
        k = t[20] ^ w,
        B = t[21] ^ b,
        F = t[30] ^ w,
        D = t[31] ^ b,
        V = t[40] ^ w,
        R = t[41] ^ b;
      w = r ^ (o << 1 | a >>> 31), b = n ^ (a << 1 | o >>> 31);
      const P = t[2] ^ w,
        j = t[3] ^ b,
        Y = t[12] ^ w,
        U = t[13] ^ b,
        I = t[22] ^ w,
        g = t[23] ^ b,
        u = t[32] ^ w,
        p = t[33] ^ b,
        v = t[42] ^ w,
        x = t[43] ^ b;
      w = i ^ (c << 1 | l >>> 31), b = s ^ (l << 1 | c >>> 31);
      const E = t[4] ^ w,
        S = t[5] ^ b,
        _ = t[14] ^ w,
        y = t[15] ^ b,
        A = t[24] ^ w,
        G = t[25] ^ b,
        ce = t[34] ^ w,
        W = t[35] ^ b,
        X = t[44] ^ w,
        Z = t[45] ^ b;
      w = o ^ (h << 1 | f >>> 31), b = a ^ (f << 1 | h >>> 31);
      const ee = t[6] ^ w,
        ne = t[7] ^ b,
        O = t[16] ^ w,
        H = t[17] ^ b,
        Q = t[26] ^ w,
        de = t[27] ^ b,
        ge = t[36] ^ w,
        Te = t[37] ^ b,
        Oe = t[46] ^ w,
        De = t[47] ^ b;
      w = c ^ (r << 1 | n >>> 31), b = l ^ (n << 1 | r >>> 31);
      const et = t[8] ^ w,
        rt = t[9] ^ b,
        Ze = t[18] ^ w,
        qe = t[19] ^ b,
        He = t[28] ^ w,
        we = t[29] ^ b,
        xe = t[38] ^ w,
        Ie = t[39] ^ b,
        Pe = t[48] ^ w,
        J = t[49] ^ b,
        L = C,
        z = M,
        ie = $ << 4 | N >>> 28,
        ue = N << 4 | $ >>> 28,
        me = k << 3 | B >>> 29,
        be = B << 3 | k >>> 29,
        Le = D << 9 | F >>> 23,
        ze = F << 9 | D >>> 23,
        Qe = V << 18 | R >>> 14,
        Xe = R << 18 | V >>> 14,
        Je = P << 1 | j >>> 31,
        kt = j << 1 | P >>> 31,
        Ut = U << 12 | Y >>> 20,
        Ft = Y << 12 | U >>> 20,
        Wt = I << 10 | g >>> 22,
        pt = g << 10 | I >>> 22,
        ct = p << 13 | u >>> 19,
        gt = u << 13 | p >>> 19,
        mt = v << 2 | x >>> 30,
        ht = x << 2 | v >>> 30,
        lt = S << 30 | E >>> 2,
        xt = E << 30 | S >>> 2,
        Ct = _ << 6 | y >>> 26,
        wt = y << 6 | _ >>> 26,
        Et = G << 11 | A >>> 21,
        vt = A << 11 | G >>> 21,
        yt = ce << 15 | W >>> 17,
        bt = W << 15 | ce >>> 17,
        st = Z << 29 | X >>> 3,
        At = X << 29 | Z >>> 3,
        St = ee << 28 | ne >>> 4,
        Gt = ne << 28 | ee >>> 4,
        Zt = H << 23 | O >>> 9,
        Yt = O << 23 | H >>> 9,
        Pt = Q << 25 | de >>> 7,
        br = de << 25 | Q >>> 7,
        Nn = ge << 21 | Te >>> 11,
        Mn = Te << 21 | ge >>> 11,
        Pn = De << 24 | Oe >>> 8,
        $n = Oe << 24 | De >>> 8,
        tn = et << 27 | rt >>> 5,
        Qn = rt << 27 | et >>> 5,
        Ii = Ze << 20 | qe >>> 12,
        Jn = qe << 20 | Ze >>> 12,
        Ti = we << 7 | He >>> 25,
        ki = He << 7 | we >>> 25,
        Xn = xe << 8 | Ie >>> 24,
        mi = Ie << 8 | xe >>> 24,
        wi = Pe << 14 | J >>> 18,
        hn = J << 14 | Pe >>> 18;
      t[0] = L ^ ~Ut & Et, t[1] = z ^ ~Ft & vt, t[10] = St ^ ~Ii & me, t[11] = Gt ^ ~Jn & be, t[20] = Je ^ ~Ct & Pt, t[21] = kt ^ ~wt & br, t[30] = tn ^ ~ie & Wt, t[31] = Qn ^ ~ue & pt, t[40] = lt ^ ~Zt & Ti, t[41] = xt ^ ~Yt & ki, t[2] = Ut ^ ~Et & Nn, t[3] = Ft ^ ~vt & Mn, t[12] = Ii ^ ~me & ct, t[13] = Jn ^ ~be & gt, t[22] = Ct ^ ~Pt & Xn, t[23] = wt ^ ~br & mi, t[32] = ie ^ ~Wt & yt, t[33] = ue ^ ~pt & bt, t[42] = Zt ^ ~Ti & Le, t[43] = Yt ^ ~ki & ze, t[4] = Et ^ ~Nn & wi, t[5] = vt ^ ~Mn & hn, t[14] = me ^ ~ct & st, t[15] = be ^ ~gt & At, t[24] = Pt ^ ~Xn & Qe, t[25] = br ^ ~mi & Xe, t[34] = Wt ^ ~yt & Pn, t[35] = pt ^ ~bt & $n, t[44] = Ti ^ ~Le & mt, t[45] = ki ^ ~ze & ht, t[6] = Nn ^ ~wi & L, t[7] = Mn ^ ~hn & z, t[16] = ct ^ ~st & St, t[17] = gt ^ ~At & Gt, t[26] = Xn ^ ~Qe & Je, t[27] = mi ^ ~Xe & kt, t[36] = yt ^ ~Pn & tn, t[37] = bt ^ ~$n & Qn, t[46] = Le ^ ~mt & lt, t[47] = ze ^ ~ht & xt, t[8] = wi ^ ~L & Ut, t[9] = hn ^ ~z & Ft, t[18] = st ^ ~St & Ii, t[19] = At ^ ~Gt & Jn, t[28] = Qe ^ ~Je & Ct, t[29] = Xe ^ ~kt & wt, t[38] = Pn ^ ~tn & ie, t[39] = $n ^ ~Qn & ue, t[48] = mt ^ ~lt & Zt, t[49] = ht ^ ~xt & Yt, t[0] ^= Kz[e * 2], t[1] ^= Kz[e * 2 + 1]
    }
  };
  const r8 = Vz;

  function lm() {
    this.state = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], this.blockSize = null, this.count = 0, this.squeezing = !1
  }
  lm.prototype.initialize = function (t, e) {
    for (let r = 0; r < 50; ++r) this.state[r] = 0;
    this.blockSize = t / 8, this.count = 0, this.squeezing = !1
  }, lm.prototype.absorb = function (t) {
    for (let e = 0; e < t.length; ++e) this.state[~~(this.count / 4)] ^= t[e] << 8 * (this.count % 4), this.count += 1, this.count === this.blockSize && (r8.p1600(this.state), this.count = 0)
  }, lm.prototype.absorbLastFewBits = function (t) {
    this.state[~~(this.count / 4)] ^= t << 8 * (this.count % 4), t & 128 && this.count === this.blockSize - 1 && r8.p1600(this.state), this.state[~~((this.blockSize - 1) / 4)] ^= 128 << 8 * ((this.blockSize - 1) % 4), r8.p1600(this.state), this.count = 0, this.squeezing = !0
  }, lm.prototype.squeeze = function (t) {
    this.squeezing || this.absorbLastFewBits(1);
    const e = Buffer.alloc(t);
    for (let r = 0; r < t; ++r) e[r] = this.state[~~(this.count / 4)] >>> 8 * (this.count % 4) & 255, this.count += 1, this.count === this.blockSize && (r8.p1600(this.state), this.count = 0);
    return e
  }, lm.prototype.copy = function (t) {
    for (let e = 0; e < 50; ++e) t.state[e] = this.state[e];
    t.blockSize = this.blockSize, t.count = this.count, t.squeezing = this.squeezing
  };
  var wEe = lm,
    vEe = mEe(wEe);
  const bEe = vEe,
    yEe = E6;

  function Gz(t) {
    return Buffer.allocUnsafe(t).fill(0)
  }

  function Zz(t, e, r) {
    const n = Gz(e);
    return t = n8(t), r ? t.length < e ? (t.copy(n), n) : t.slice(0, e) : t.length < e ? (t.copy(n, e - t.length), n) : t.slice(-e)
  }

  function _Ee(t, e) {
    return Zz(t, e, !0)
  }

  function n8(t) {
    if (!Buffer.isBuffer(t))
      if (Array.isArray(t)) t = Buffer.from(t);
      else if (typeof t == "string") Yz(t) ? t = Buffer.from(EEe(Qz(t)), "hex") : t = Buffer.from(t);
    else if (typeof t == "number") t = intToBuffer(t);
    else if (t == null) t = Buffer.allocUnsafe(0);
    else if (yEe.isBN(t)) t = t.toArrayLike(Buffer);
    else if (t.toArray) t = Buffer.from(t.toArray());
    else throw new Error("invalid type");
    return t
  }

  function xEe(t) {
    return t = n8(t), "0x" + t.toString("hex")
  }

  function CEe(t, e) {
    return t = n8(t), e || (e = 256), bEe("keccak" + e).update(t).digest()
  }

  function EEe(t) {
    return t.length % 2 ? "0" + t : t
  }

  function Yz(t) {
    return typeof t == "string" && t.match(/^0x[0-9A-Fa-f]*$/)
  }

  function Qz(t) {
    return typeof t == "string" && t.startsWith("0x") ? t.slice(2) : t
  }
  var Jz = {
    zeros: Gz,
    setLength: Zz,
    setLengthRight: _Ee,
    isHexString: Yz,
    stripHexPrefix: Qz,
    toBuffer: n8,
    bufferToHex: xEe,
    keccak: CEe
  };
  const lp = Jz,
    up = E6;

  function Xz(t) {
    return t.startsWith("int[") ? "int256" + t.slice(3) : t === "int" ? "int256" : t.startsWith("uint[") ? "uint256" + t.slice(4) : t === "uint" ? "uint256" : t.startsWith("fixed[") ? "fixed128x128" + t.slice(5) : t === "fixed" ? "fixed128x128" : t.startsWith("ufixed[") ? "ufixed128x128" + t.slice(6) : t === "ufixed" ? "ufixed128x128" : t
  }

  function um(t) {
    return parseInt(/^\D+(\d+)$/.exec(t)[1], 10)
  }

  function eH(t) {
    var e = /^\D+(\d+)x(\d+)$/.exec(t);
    return [parseInt(e[1], 10), parseInt(e[2], 10)]
  }

  function tH(t) {
    var e = t.match(/(.*)\[(.*?)\]$/);
    return e ? e[2] === "" ? "dynamic" : parseInt(e[2], 10) : null
  }

  function dp(t) {
    var e = typeof t;
    if (e === "string") return lp.isHexString(t) ? new up(lp.stripHexPrefix(t), 16) : new up(t, 10);
    if (e === "number") return new up(t);
    if (t.toArray) return t;
    throw new Error("Argument is not a number")
  }

  function iu(t, e) {
    var r, n, i, s;
    if (t === "address") return iu("uint160", dp(e));
    if (t === "bool") return iu("uint8", e ? 1 : 0);
    if (t === "string") return iu("bytes", new Buffer(e, "utf8"));
    if (SEe(t)) {
      if (typeof e.length > "u") throw new Error("Not an array?");
      if (r = tH(t), r !== "dynamic" && r !== 0 && e.length > r) throw new Error("Elements exceed array size: " + r);
      i = [], t = t.slice(0, t.lastIndexOf("[")), typeof e == "string" && (e = JSON.parse(e));
      for (s in e) i.push(iu(t, e[s]));
      if (r === "dynamic") {
        var o = iu("uint256", e.length);
        i.unshift(o)
      }
      return Buffer.concat(i)
    } else {
      if (t === "bytes") return e = new Buffer(e), i = Buffer.concat([iu("uint256", e.length), e]), e.length % 32 !== 0 && (i = Buffer.concat([i, lp.zeros(32 - e.length % 32)])), i;
      if (t.startsWith("bytes")) {
        if (r = um(t), r < 1 || r > 32) throw new Error("Invalid bytes<N> width: " + r);
        return lp.setLengthRight(e, 32)
      } else if (t.startsWith("uint")) {
        if (r = um(t), r % 8 || r < 8 || r > 256) throw new Error("Invalid uint<N> width: " + r);
        if (n = dp(e), n.bitLength() > r) throw new Error("Supplied uint exceeds width: " + r + " vs " + n.bitLength());
        if (n < 0) throw new Error("Supplied uint is negative");
        return n.toArrayLike(Buffer, "be", 32)
      } else if (t.startsWith("int")) {
        if (r = um(t), r % 8 || r < 8 || r > 256) throw new Error("Invalid int<N> width: " + r);
        if (n = dp(e), n.bitLength() > r) throw new Error("Supplied int exceeds width: " + r + " vs " + n.bitLength());
        return n.toTwos(256).toArrayLike(Buffer, "be", 32)
      } else if (t.startsWith("ufixed")) {
        if (r = eH(t), n = dp(e), n < 0) throw new Error("Supplied ufixed is negative");
        return iu("uint256", n.mul(new up(2).pow(new up(r[1]))))
      } else if (t.startsWith("fixed")) return r = eH(t), iu("int256", dp(e).mul(new up(2).pow(new up(r[1]))))
    }
    throw new Error("Unsupported or invalid type: " + t)
  }

  function AEe(t) {
    return t === "string" || t === "bytes" || tH(t) === "dynamic"
  }

  function SEe(t) {
    return t.lastIndexOf("]") === t.length - 1
  }

  function IEe(t, e) {
    var r = [],
      n = [],
      i = 32 * t.length;
    for (var s in t) {
      var o = Xz(t[s]),
        a = e[s],
        c = iu(o, a);
      AEe(o) ? (r.push(iu("uint256", i)), n.push(c), i += c.length) : r.push(c)
    }
    return Buffer.concat(r.concat(n))
  }

  function rH(t, e) {
    if (t.length !== e.length) throw new Error("Number of types are not matching the values");
    for (var r, n, i = [], s = 0; s < t.length; s++) {
      var o = Xz(t[s]),
        a = e[s];
      if (o === "bytes") i.push(a);
      else if (o === "string") i.push(new Buffer(a, "utf8"));
      else if (o === "bool") i.push(new Buffer(a ? "01" : "00", "hex"));
      else if (o === "address") i.push(lp.setLength(a, 20));
      else if (o.startsWith("bytes")) {
        if (r = um(o), r < 1 || r > 32) throw new Error("Invalid bytes<N> width: " + r);
        i.push(lp.setLengthRight(a, r))
      } else if (o.startsWith("uint")) {
        if (r = um(o), r % 8 || r < 8 || r > 256) throw new Error("Invalid uint<N> width: " + r);
        if (n = dp(a), n.bitLength() > r) throw new Error("Supplied uint exceeds width: " + r + " vs " + n.bitLength());
        i.push(n.toArrayLike(Buffer, "be", r / 8))
      } else if (o.startsWith("int")) {
        if (r = um(o), r % 8 || r < 8 || r > 256) throw new Error("Invalid int<N> width: " + r);
        if (n = dp(a), n.bitLength() > r) throw new Error("Supplied int exceeds width: " + r + " vs " + n.bitLength());
        i.push(n.toTwos(r).toArrayLike(Buffer, "be", r / 8))
      } else throw new Error("Unsupported or invalid type: " + o)
    }
    return Buffer.concat(i)
  }

  function TEe(t, e) {
    return lp.keccak(rH(t, e))
  }
  var kEe = {
    rawEncode: IEe,
    solidityPack: rH,
    soliditySHA3: TEe
  };
  const Dc = Jz,
    $b = kEe,
    nH = {
      type: "object",
      properties: {
        types: {
          type: "object",
          additionalProperties: {
            type: "array",
            items: {
              type: "object",
              properties: {
                name: {
                  type: "string"
                },
                type: {
                  type: "string"
                }
              },
              required: ["name", "type"]
            }
          }
        },
        primaryType: {
          type: "string"
        },
        domain: {
          type: "object"
        },
        message: {
          type: "object"
        }
      },
      required: ["types", "primaryType", "domain", "message"]
    },
    PS = {
      encodeData(t, e, r, n = !0) {
        const i = ["bytes32"],
          s = [this.hashType(t, r)];
        if (n) {
          const o = (a, c, l) => {
            if (r[c] !== void 0) return ["bytes32", l == null ? "0x0000000000000000000000000000000000000000000000000000000000000000" : Dc.keccak(this.encodeData(c, l, r, n))];
            if (l === void 0) throw new Error(`missing value for field ${a} of type ${c}`);
            if (c === "bytes") return ["bytes32", Dc.keccak(l)];
            if (c === "string") return typeof l == "string" && (l = Buffer.from(l, "utf8")), ["bytes32", Dc.keccak(l)];
            if (c.lastIndexOf("]") === c.length - 1) {
              const h = c.slice(0, c.lastIndexOf("[")),
                f = l.map(w => o(a, h, w));
              return ["bytes32", Dc.keccak($b.rawEncode(f.map(([w]) => w), f.map(([, w]) => w)))]
            }
            return [c, l]
          };
          for (const a of r[t]) {
            const [c, l] = o(a.name, a.type, e[a.name]);
            i.push(c), s.push(l)
          }
        } else
          for (const o of r[t]) {
            let a = e[o.name];
            if (a !== void 0)
              if (o.type === "bytes") i.push("bytes32"), a = Dc.keccak(a), s.push(a);
              else if (o.type === "string") i.push("bytes32"), typeof a == "string" && (a = Buffer.from(a, "utf8")), a = Dc.keccak(a), s.push(a);
            else if (r[o.type] !== void 0) i.push("bytes32"), a = Dc.keccak(this.encodeData(o.type, a, r, n)), s.push(a);
            else {
              if (o.type.lastIndexOf("]") === o.type.length - 1) throw new Error("Arrays currently unimplemented in encodeData");
              i.push(o.type), s.push(a)
            }
          }
        return $b.rawEncode(i, s)
      },
      encodeType(t, e) {
        let r = "",
          n = this.findTypeDependencies(t, e).filter(i => i !== t);
        n = [t].concat(n.sort());
        for (const i of n) {
          if (!e[i]) throw new Error("No type definition specified: " + i);
          r += i + "(" + e[i].map(({
            name: o,
            type: a
          }) => a + " " + o).join(",") + ")"
        }
        return r
      },
      findTypeDependencies(t, e, r = []) {
        if (t = t.match(/^\w*/)[0], r.includes(t) || e[t] === void 0) return r;
        r.push(t);
        for (const n of e[t])
          for (const i of this.findTypeDependencies(n.type, e, r)) !r.includes(i) && r.push(i);
        return r
      },
      hashStruct(t, e, r, n = !0) {
        return Dc.keccak(this.encodeData(t, e, r, n))
      },
      hashType(t, e) {
        return Dc.keccak(this.encodeType(t, e))
      },
      sanitizeData(t) {
        const e = {};
        for (const r in nH.properties) t[r] && (e[r] = t[r]);
        return e.types && (e.types = Object.assign({
          EIP712Domain: []
        }, e.types)), e
      },
      hash(t, e = !0) {
        const r = this.sanitizeData(t),
          n = [Buffer.from("1901", "hex")];
        return n.push(this.hashStruct("EIP712Domain", r.domain, r.types, e)), r.primaryType !== "EIP712Domain" && n.push(this.hashStruct(r.primaryType, r.message, r.types, e)), Dc.keccak(Buffer.concat(n))
      }
    };
  var REe = {
    TYPED_MESSAGE_SCHEMA: nH,
    TypedDataUtils: PS,
    hashForSignTypedDataLegacy: function (t) {
      return NEe(t.data)
    },
    hashForSignTypedData_v3: function (t) {
      return PS.hash(t.data, !1)
    },
    hashForSignTypedData_v4: function (t) {
      return PS.hash(t.data)
    }
  };

  function NEe(t) {
    const e = new Error("Expect argument to be non-empty array");
    if (typeof t != "object" || !t.length) throw e;
    const r = t.map(function (s) {
        return s.type === "bytes" ? Dc.toBuffer(s.value) : s.value
      }),
      n = t.map(function (s) {
        return s.type
      }),
      i = t.map(function (s) {
        if (!s.name) throw e;
        return s.type + " " + s.name
      });
    return $b.soliditySHA3(["bytes32", "bytes32"], [$b.soliditySHA3(new Array(t.length).fill("string"), i), $b.soliditySHA3(n, r)])
  }
  var dm = {};
  Object.defineProperty(dm, "__esModule", {
    value: !0
  }), dm.filterFromParam = dm.FilterPolyfill = void 0;
  const hm = Ei,
    Ws = jt,
    MEe = 5 * 60 * 1e3,
    hp = {
      jsonrpc: "2.0",
      id: 0
    };
  class PEe {
    constructor(e) {
      this.logFilters = new Map, this.blockFilters = new Set, this.pendingTransactionFilters = new Set, this.cursors = new Map, this.timeouts = new Map, this.nextFilterId = (0, hm.IntNumber)(1), this.REQUEST_THROTTLE_INTERVAL = 1e3, this.lastFetchTimestamp = new Date(0), this.resolvers = [], this.provider = e
    }
    async newFilter(e) {
      const r = iH(e),
        n = this.makeFilterId(),
        i = await this.setInitialCursorPosition(n, r.fromBlock);
      return console.info(`Installing new log filter(${n}):`, r, "initial cursor position:", i), this.logFilters.set(n, r), this.setFilterTimeout(n), (0, Ws.hexStringFromIntNumber)(n)
    }
    async newBlockFilter() {
      const e = this.makeFilterId(),
        r = await this.setInitialCursorPosition(e, "latest");
      return console.info(`Installing new block filter (${e}) with initial cursor position:`, r), this.blockFilters.add(e), this.setFilterTimeout(e), (0, Ws.hexStringFromIntNumber)(e)
    }
    async newPendingTransactionFilter() {
      const e = this.makeFilterId(),
        r = await this.setInitialCursorPosition(e, "latest");
      return console.info(`Installing new block filter (${e}) with initial cursor position:`, r), this.pendingTransactionFilters.add(e), this.setFilterTimeout(e), (0, Ws.hexStringFromIntNumber)(e)
    }
    uninstallFilter(e) {
      const r = (0, Ws.intNumberFromHexString)(e);
      return console.info(`Uninstalling filter (${r})`), this.deleteFilter(r), !0
    }
    getFilterChanges(e) {
      const r = (0, Ws.intNumberFromHexString)(e);
      return this.timeouts.has(r) && this.setFilterTimeout(r), this.logFilters.has(r) ? this.getLogFilterChanges(r) : this.blockFilters.has(r) ? this.getBlockFilterChanges(r) : this.pendingTransactionFilters.has(r) ? this.getPendingTransactionFilterChanges(r) : Promise.resolve(i8())
    }
    async getFilterLogs(e) {
      const r = (0, Ws.intNumberFromHexString)(e),
        n = this.logFilters.get(r);
      return n ? this.sendAsyncPromise(Object.assign(Object.assign({}, hp), {
        method: "eth_getLogs",
        params: [sH(n)]
      })) : i8()
    }
    makeFilterId() {
      return (0, hm.IntNumber)(++this.nextFilterId)
    }
    sendAsyncPromise(e) {
      return new Promise((r, n) => {
        this.provider.sendAsync(e, (i, s) => {
          if (i) return n(i);
          if (Array.isArray(s) || s == null) return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));
          r(s)
        })
      })
    }
    deleteFilter(e) {
      console.info(`Deleting filter (${e})`), this.logFilters.delete(e), this.blockFilters.delete(e), this.pendingTransactionFilters.delete(e), this.cursors.delete(e), this.timeouts.delete(e)
    }
    async getLogFilterChanges(e) {
      const r = this.logFilters.get(e),
        n = this.cursors.get(e);
      if (!n || !r) return i8();
      const i = await this.getCurrentBlockHeight(),
        s = r.toBlock === "latest" ? i : r.toBlock;
      if (n > i || n > Number(r.toBlock)) return s8();
      console.info(`Fetching logs from ${n} to ${s} for filter ${e}`);
      const o = await this.sendAsyncPromise(Object.assign(Object.assign({}, hp), {
        method: "eth_getLogs",
        params: [sH(Object.assign(Object.assign({}, r), {
          fromBlock: n,
          toBlock: s
        }))]
      }));
      if (Array.isArray(o.result)) {
        const a = o.result.map(l => (0, Ws.intNumberFromHexString)(l.blockNumber || "0x0")),
          c = Math.max(...a);
        if (c && c > n) {
          const l = (0, hm.IntNumber)(c + 1);
          console.info(`Moving cursor position for filter (${e}) from ${n} to ${l}`), this.cursors.set(e, l)
        }
      }
      return o
    }
    async getBlockFilterChanges(e) {
      const r = this.cursors.get(e);
      if (!r) return i8();
      const n = await this.getCurrentBlockHeight();
      if (r > n) return s8();
      console.info(`Fetching blocks from ${r} to ${n} for filter (${e})`);
      const i = (await Promise.all((0, Ws.range)(r, n + 1).map(o => this.getBlockHashByNumber((0, hm.IntNumber)(o))))).filter(o => !!o),
        s = (0, hm.IntNumber)(r + i.length);
      return console.info(`Moving cursor position for filter (${e}) from ${r} to ${s}`), this.cursors.set(e, s), Object.assign(Object.assign({}, hp), {
        result: i
      })
    }
    async getPendingTransactionFilterChanges(e) {
      return Promise.resolve(s8())
    }
    async setInitialCursorPosition(e, r) {
      const n = await this.getCurrentBlockHeight(),
        i = typeof r == "number" && r > n ? r : n;
      return this.cursors.set(e, i), i
    }
    setFilterTimeout(e) {
      const r = this.timeouts.get(e);
      r && window.clearTimeout(r);
      const n = window.setTimeout(() => {
        console.info(`Filter (${e}) timed out`), this.deleteFilter(e)
      }, MEe);
      this.timeouts.set(e, n)
    }
    async getCurrentBlockHeight() {
      const e = new Date;
      if (e.getTime() - this.lastFetchTimestamp.getTime() > this.REQUEST_THROTTLE_INTERVAL) {
        this.lastFetchTimestamp = e;
        const r = await this._getCurrentBlockHeight();
        this.currentBlockHeight = r, this.resolvers.forEach(n => n(r)), this.resolvers = []
      }
      return this.currentBlockHeight ? this.currentBlockHeight : new Promise(r => this.resolvers.push(r))
    }
    async _getCurrentBlockHeight() {
      const {
        result: e
      } = await this.sendAsyncPromise(Object.assign(Object.assign({}, hp), {
        method: "eth_blockNumber",
        params: []
      }));
      return (0, Ws.intNumberFromHexString)((0, Ws.ensureHexString)(e))
    }
    async getBlockHashByNumber(e) {
      const r = await this.sendAsyncPromise(Object.assign(Object.assign({}, hp), {
        method: "eth_getBlockByNumber",
        params: [(0, Ws.hexStringFromIntNumber)(e), !1]
      }));
      return r.result && typeof r.result.hash == "string" ? (0, Ws.ensureHexString)(r.result.hash) : null
    }
  }
  dm.FilterPolyfill = PEe;

  function iH(t) {
    return {
      fromBlock: oH(t.fromBlock),
      toBlock: oH(t.toBlock),
      addresses: t.address === void 0 ? null : Array.isArray(t.address) ? t.address : [t.address],
      topics: t.topics || []
    }
  }
  dm.filterFromParam = iH;

  function sH(t) {
    const e = {
      fromBlock: aH(t.fromBlock),
      toBlock: aH(t.toBlock),
      topics: t.topics
    };
    return t.addresses !== null && (e.address = t.addresses), e
  }

  function oH(t) {
    if (t === void 0 || t === "latest" || t === "pending") return "latest";
    if (t === "earliest") return (0, hm.IntNumber)(0);
    if ((0, Ws.isHexString)(t)) return (0, Ws.intNumberFromHexString)(t);
    throw new Error(`Invalid block option: ${String(t)}`)
  }

  function aH(t) {
    return t === "latest" ? t : (0, Ws.hexStringFromIntNumber)(t)
  }

  function i8() {
    return Object.assign(Object.assign({}, hp), {
      error: {
        code: -32e3,
        message: "filter not found"
      }
    })
  }

  function s8() {
    return Object.assign(Object.assign({}, hp), {
      result: []
    })
  }
  var o8 = {},
    cH = {},
    a8 = {},
    $S = $Ee;

  function $Ee(t) {
    t = t || {};
    var e = t.max || Number.MAX_SAFE_INTEGER,
      r = typeof t.start < "u" ? t.start : Math.floor(Math.random() * e);
    return function () {
      return r = r % e, r++
    }
  }
  const lH = (t, e) => function () {
    const r = e.promiseModule,
      n = new Array(arguments.length);
    for (let i = 0; i < arguments.length; i++) n[i] = arguments[i];
    return new r((i, s) => {
      e.errorFirst ? n.push(function (o, a) {
        if (e.multiArgs) {
          const c = new Array(arguments.length - 1);
          for (let l = 1; l < arguments.length; l++) c[l - 1] = arguments[l];
          o ? (c.unshift(o), s(c)) : i(c)
        } else o ? s(o) : i(a)
      }) : n.push(function (o) {
        if (e.multiArgs) {
          const a = new Array(arguments.length - 1);
          for (let c = 0; c < arguments.length; c++) a[c] = arguments[c];
          i(a)
        } else i(o)
      }), t.apply(this, n)
    })
  };
  var OEe = (t, e) => {
      e = Object.assign({
        exclude: [/.+(Sync|Stream)$/],
        errorFirst: !0,
        promiseModule: Promise
      }, e);
      const r = i => {
        const s = o => typeof o == "string" ? i === o : o.test(i);
        return e.include ? e.include.some(s) : !e.exclude.some(s)
      };
      let n;
      typeof t == "function" ? n = function () {
        return e.excludeMain ? t.apply(this, arguments) : lH(t, e).apply(this, arguments)
      } : n = Object.create(Object.getPrototypeOf(t));
      for (const i in t) {
        const s = t[i];
        n[i] = typeof s == "function" && r(i) ? lH(s, e) : s
      }
      return n
    },
    Ob = {},
    Db = {};
  Object.defineProperty(Db, "__esModule", {
    value: !0
  });
  const DEe = Fi;

  function uH(t, e, r) {
    try {
      Reflect.apply(t, e, r)
    } catch (n) {
      setTimeout(() => {
        throw n
      })
    }
  }

  function LEe(t) {
    const e = t.length,
      r = new Array(e);
    for (let n = 0; n < e; n += 1) r[n] = t[n];
    return r
  }
  let BEe = class extends DEe.EventEmitter {
    emit(e, ...r) {
      let n = e === "error";
      const i = this._events;
      if (i !== void 0) n = n && i.error === void 0;
      else if (!n) return !1;
      if (n) {
        let o;
        if (r.length > 0 && ([o] = r), o instanceof Error) throw o;
        const a = new Error(`Unhandled error.${o?` (${o.message})`:""}`);
        throw a.context = o, a
      }
      const s = i[e];
      if (s === void 0) return !1;
      if (typeof s == "function") uH(s, this, r);
      else {
        const o = s.length,
          a = LEe(s);
        for (let c = 0; c < o; c += 1) uH(a[c], this, r)
      }
      return !0
    }
  };
  Db.default = BEe;
  var UEe = ot && ot.__importDefault || function (t) {
    return t && t.__esModule ? t : {
      default: t
    }
  };
  Object.defineProperty(Ob, "__esModule", {
    value: !0
  }), Ob.BaseBlockTracker = void 0;
  const jEe = UEe(Db),
    FEe = 1e3,
    WEe = (t, e) => t + e,
    dH = ["sync", "latest"];
  class zEe extends jEe.default {
    constructor(e) {
      super(), this._blockResetDuration = e.blockResetDuration || 20 * FEe, this._usePastBlocks = e.usePastBlocks || !1, this._currentBlock = null, this._isRunning = !1, this._onNewListener = this._onNewListener.bind(this), this._onRemoveListener = this._onRemoveListener.bind(this), this._resetCurrentBlock = this._resetCurrentBlock.bind(this), this._setupInternalEvents()
    }
    async destroy() {
      this._cancelBlockResetTimeout(), await this._maybeEnd(), super.removeAllListeners()
    }
    isRunning() {
      return this._isRunning
    }
    getCurrentBlock() {
      return this._currentBlock
    }
    async getLatestBlock() {
      return this._currentBlock ? this._currentBlock : await new Promise(r => this.once("latest", r))
    }
    removeAllListeners(e) {
      return e ? super.removeAllListeners(e) : super.removeAllListeners(), this._setupInternalEvents(), this._onRemoveListener(), this
    }
    _setupInternalEvents() {
      this.removeListener("newListener", this._onNewListener), this.removeListener("removeListener", this._onRemoveListener), this.on("newListener", this._onNewListener), this.on("removeListener", this._onRemoveListener)
    }
    _onNewListener(e) {
      dH.includes(e) && this._maybeStart()
    }
    _onRemoveListener() {
      this._getBlockTrackerEventCount() > 0 || this._maybeEnd()
    }
    async _maybeStart() {
      this._isRunning || (this._isRunning = !0, this._cancelBlockResetTimeout(), await this._start(), this.emit("_started"))
    }
    async _maybeEnd() {
      this._isRunning && (this._isRunning = !1, this._setupBlockResetTimeout(), await this._end(), this.emit("_ended"))
    }
    _getBlockTrackerEventCount() {
      return dH.map(e => this.listenerCount(e)).reduce(WEe)
    }
    _shouldUseNewBlock(e) {
      const r = this._currentBlock;
      if (!r) return !0;
      const n = hH(e),
        i = hH(r);
      return this._usePastBlocks && n < i || n > i
    }
    _newPotentialLatest(e) {
      this._shouldUseNewBlock(e) && this._setCurrentBlock(e)
    }
    _setCurrentBlock(e) {
      const r = this._currentBlock;
      this._currentBlock = e, this.emit("latest", e), this.emit("sync", {
        oldBlock: r,
        newBlock: e
      })
    }
    _setupBlockResetTimeout() {
      this._cancelBlockResetTimeout(), this._blockResetTimeout = setTimeout(this._resetCurrentBlock, this._blockResetDuration), this._blockResetTimeout.unref && this._blockResetTimeout.unref()
    }
    _cancelBlockResetTimeout() {
      this._blockResetTimeout && clearTimeout(this._blockResetTimeout)
    }
    _resetCurrentBlock() {
      this._currentBlock = null
    }
  }
  Ob.BaseBlockTracker = zEe;

  function hH(t) {
    return Number.parseInt(t, 16)
  }
  var fH = {},
    pH = {},
    hs = {};
  class gH extends TypeError {
    constructor(e, r) {
      let n;
      const {
        message: i,
        explanation: s,
        ...o
      } = e, {
        path: a
      } = e, c = a.length === 0 ? i : `At path: ${a.join(".")} -- ${i}`;
      super(s ?? c), s != null && (this.cause = c), Object.assign(this, o), this.name = this.constructor.name, this.failures = () => n ?? (n = [e, ...r()])
    }
  }

  function HEe(t) {
    return La(t) && typeof t[Symbol.iterator] == "function"
  }

  function La(t) {
    return typeof t == "object" && t != null
  }

  function mH(t) {
    if (Object.prototype.toString.call(t) !== "[object Object]") return !1;
    const e = Object.getPrototypeOf(t);
    return e === null || e === Object.prototype
  }

  function Ai(t) {
    return typeof t == "symbol" ? t.toString() : typeof t == "string" ? JSON.stringify(t) : `${t}`
  }

  function qEe(t) {
    const {
      done: e,
      value: r
    } = t.next();
    return e ? void 0 : r
  }

  function VEe(t, e, r, n) {
    if (t === !0) return;
    t === !1 ? t = {} : typeof t == "string" && (t = {
      message: t
    });
    const {
      path: i,
      branch: s
    } = e, {
      type: o
    } = r, {
      refinement: a,
      message: c = `Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${Ai(n)}\``
    } = t;
    return {
      value: n,
      type: o,
      refinement: a,
      key: i[i.length - 1],
      path: i,
      branch: s,
      ...t,
      message: c
    }
  }

  function* OS(t, e, r, n) {
    HEe(t) || (t = [t]);
    for (const i of t) {
      const s = VEe(i, e, r, n);
      s && (yield s)
    }
  }

  function* DS(t, e, r = {}) {
    const {
      path: n = [],
      branch: i = [t],
      coerce: s = !1,
      mask: o = !1
    } = r, a = {
      path: n,
      branch: i
    };
    if (s && (t = e.coercer(t, a), o && e.type !== "type" && La(e.schema) && La(t) && !Array.isArray(t)))
      for (const l in t) e.schema[l] === void 0 && delete t[l];
    let c = "valid";
    for (const l of e.validator(t, a)) l.explanation = r.message, c = "not_valid", yield [l, void 0];
    for (let [l, h, f] of e.entries(t, a)) {
      const w = DS(h, f, {
        path: l === void 0 ? n : [...n, l],
        branch: l === void 0 ? i : [...i, h],
        coerce: s,
        mask: o,
        message: r.message
      });
      for (const b of w) b[0] ? (c = b[0].refinement != null ? "not_refined" : "not_valid", yield [b[0], void 0]) : s && (h = b[1], l === void 0 ? t = h : t instanceof Map ? t.set(l, h) : t instanceof Set ? t.add(h) : La(t) && (h !== void 0 || l in t) && (t[l] = h))
    }
    if (c !== "not_valid")
      for (const l of e.refiner(t, a)) l.explanation = r.message, c = "not_refined", yield [l, void 0];
    c === "valid" && (yield [void 0, t])
  }
  class ci {
    constructor(e) {
      const {
        type: r,
        schema: n,
        validator: i,
        refiner: s,
        coercer: o = c => c,
        entries: a = function* () {}
      } = e;
      this.type = r, this.schema = n, this.entries = a, this.coercer = o, i ? this.validator = (c, l) => {
        const h = i(c, l);
        return OS(h, l, this, c)
      } : this.validator = () => [], s ? this.refiner = (c, l) => {
        const h = s(c, l);
        return OS(h, l, this, c)
      } : this.refiner = () => []
    }
    assert(e, r) {
      return wH(e, this, r)
    }
    create(e, r) {
      return vH(e, this, r)
    }
    is(e) {
      return LS(e, this)
    }
    mask(e, r) {
      return bH(e, this, r)
    }
    validate(e, r = {}) {
      return fm(e, this, r)
    }
  }

  function wH(t, e, r) {
    const n = fm(t, e, {
      message: r
    });
    if (n[0]) throw n[0]
  }

  function vH(t, e, r) {
    const n = fm(t, e, {
      coerce: !0,
      message: r
    });
    if (n[0]) throw n[0];
    return n[1]
  }

  function bH(t, e, r) {
    const n = fm(t, e, {
      coerce: !0,
      mask: !0,
      message: r
    });
    if (n[0]) throw n[0];
    return n[1]
  }

  function LS(t, e) {
    return !fm(t, e)[0]
  }

  function fm(t, e, r = {}) {
    const n = DS(t, e, r),
      i = qEe(n);
    return i[0] ? [new gH(i[0], function* () {
      for (const o of n) o[0] && (yield o[0])
    }), void 0] : [void 0, i[1]]
  }

  function KEe(...t) {
    const e = t[0].type === "type",
      r = t.map(i => i.schema),
      n = Object.assign({}, ...r);
    return e ? Bb(n) : Lb(n)
  }

  function xo(t, e) {
    return new ci({
      type: t,
      schema: null,
      validator: e
    })
  }

  function GEe(t, e) {
    return new ci({
      ...t,
      refiner: (r, n) => r === void 0 || t.refiner(r, n),
      validator(r, n) {
        return r === void 0 ? !0 : (e(r, n), t.validator(r, n))
      }
    })
  }

  function ZEe(t) {
    return new ci({
      type: "dynamic",
      schema: null,
      * entries(e, r) {
        yield* t(e, r).entries(e, r)
      },
      validator(e, r) {
        return t(e, r).validator(e, r)
      },
      coercer(e, r) {
        return t(e, r).coercer(e, r)
      },
      refiner(e, r) {
        return t(e, r).refiner(e, r)
      }
    })
  }

  function YEe(t) {
    let e;
    return new ci({
      type: "lazy",
      schema: null,
      * entries(r, n) {
        e ?? (e = t()), yield* e.entries(r, n)
      },
      validator(r, n) {
        return e ?? (e = t()), e.validator(r, n)
      },
      coercer(r, n) {
        return e ?? (e = t()), e.coercer(r, n)
      },
      refiner(r, n) {
        return e ?? (e = t()), e.refiner(r, n)
      }
    })
  }

  function QEe(t, e) {
    const {
      schema: r
    } = t, n = {
      ...r
    };
    for (const i of e) delete n[i];
    switch (t.type) {
      case "type":
        return Bb(n);
      default:
        return Lb(n)
    }
  }

  function JEe(t) {
    const e = t instanceof ci,
      r = e ? {
        ...t.schema
      } : {
        ...t
      };
    for (const n in r) r[n] = yH(r[n]);
    return e && t.type === "type" ? Bb(r) : Lb(r)
  }

  function XEe(t, e) {
    const {
      schema: r
    } = t, n = {};
    for (const i of e) n[i] = r[i];
    switch (t.type) {
      case "type":
        return Bb(n);
      default:
        return Lb(n)
    }
  }

  function eAe(t, e) {
    return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."), xo(t, e)
  }

  function tAe() {
    return xo("any", () => !0)
  }

  function rAe(t) {
    return new ci({
      type: "array",
      schema: t,
      * entries(e) {
        if (t && Array.isArray(e))
          for (const [r, n] of e.entries()) yield [r, n, t]
      },
      coercer(e) {
        return Array.isArray(e) ? e.slice() : e
      },
      validator(e) {
        return Array.isArray(e) || `Expected an array value, but received: ${Ai(e)}`
      }
    })
  }

  function nAe() {
    return xo("bigint", t => typeof t == "bigint")
  }

  function iAe() {
    return xo("boolean", t => typeof t == "boolean")
  }

  function sAe() {
    return xo("date", t => t instanceof Date && !isNaN(t.getTime()) || `Expected a valid \`Date\` object, but received: ${Ai(t)}`)
  }

  function oAe(t) {
    const e = {},
      r = t.map(n => Ai(n)).join();
    for (const n of t) e[n] = n;
    return new ci({
      type: "enums",
      schema: e,
      validator(n) {
        return t.includes(n) || `Expected one of \`${r}\`, but received: ${Ai(n)}`
      }
    })
  }

  function aAe() {
    return xo("func", t => typeof t == "function" || `Expected a function, but received: ${Ai(t)}`)
  }

  function cAe(t) {
    return xo("instance", e => e instanceof t || `Expected a \`${t.name}\` instance, but received: ${Ai(e)}`)
  }

  function lAe() {
    return xo("integer", t => typeof t == "number" && !isNaN(t) && Number.isInteger(t) || `Expected an integer, but received: ${Ai(t)}`)
  }

  function uAe(t) {
    return new ci({
      type: "intersection",
      schema: null,
      * entries(e, r) {
        for (const n of t) yield* n.entries(e, r)
      },
      * validator(e, r) {
        for (const n of t) yield* n.validator(e, r)
      },
      * refiner(e, r) {
        for (const n of t) yield* n.refiner(e, r)
      }
    })
  }

  function dAe(t) {
    const e = Ai(t),
      r = typeof t;
    return new ci({
      type: "literal",
      schema: r === "string" || r === "number" || r === "boolean" ? t : null,
      validator(n) {
        return n === t || `Expected the literal \`${e}\`, but received: ${Ai(n)}`
      }
    })
  }

  function hAe(t, e) {
    return new ci({
      type: "map",
      schema: null,
      * entries(r) {
        if (t && e && r instanceof Map)
          for (const [n, i] of r.entries()) yield [n, n, t], yield [n, i, e]
      },
      coercer(r) {
        return r instanceof Map ? new Map(r) : r
      },
      validator(r) {
        return r instanceof Map || `Expected a \`Map\` object, but received: ${Ai(r)}`
      }
    })
  }

  function BS() {
    return xo("never", () => !1)
  }

  function fAe(t) {
    return new ci({
      ...t,
      validator: (e, r) => e === null || t.validator(e, r),
      refiner: (e, r) => e === null || t.refiner(e, r)
    })
  }

  function pAe() {
    return xo("number", t => typeof t == "number" && !isNaN(t) || `Expected a number, but received: ${Ai(t)}`)
  }

  function Lb(t) {
    const e = t ? Object.keys(t) : [],
      r = BS();
    return new ci({
      type: "object",
      schema: t || null,
      * entries(n) {
        if (t && La(n)) {
          const i = new Set(Object.keys(n));
          for (const s of e) i.delete(s), yield [s, n[s], t[s]];
          for (const s of i) yield [s, n[s], r]
        }
      },
      validator(n) {
        return La(n) || `Expected an object, but received: ${Ai(n)}`
      },
      coercer(n) {
        return La(n) ? {
          ...n
        } : n
      }
    })
  }

  function yH(t) {
    return new ci({
      ...t,
      validator: (e, r) => e === void 0 || t.validator(e, r),
      refiner: (e, r) => e === void 0 || t.refiner(e, r)
    })
  }

  function gAe(t, e) {
    return new ci({
      type: "record",
      schema: null,
      * entries(r) {
        if (La(r))
          for (const n in r) {
            const i = r[n];
            yield [n, n, t], yield [n, i, e]
          }
      },
      validator(r) {
        return La(r) || `Expected an object, but received: ${Ai(r)}`
      }
    })
  }

  function mAe() {
    return xo("regexp", t => t instanceof RegExp)
  }

  function wAe(t) {
    return new ci({
      type: "set",
      schema: null,
      * entries(e) {
        if (t && e instanceof Set)
          for (const r of e) yield [r, r, t]
      },
      coercer(e) {
        return e instanceof Set ? new Set(e) : e
      },
      validator(e) {
        return e instanceof Set || `Expected a \`Set\` object, but received: ${Ai(e)}`
      }
    })
  }

  function _H() {
    return xo("string", t => typeof t == "string" || `Expected a string, but received: ${Ai(t)}`)
  }

  function vAe(t) {
    const e = BS();
    return new ci({
      type: "tuple",
      schema: null,
      * entries(r) {
        if (Array.isArray(r)) {
          const n = Math.max(t.length, r.length);
          for (let i = 0; i < n; i++) yield [i, r[i], t[i] || e]
        }
      },
      validator(r) {
        return Array.isArray(r) || `Expected an array, but received: ${Ai(r)}`
      }
    })
  }

  function Bb(t) {
    const e = Object.keys(t);
    return new ci({
      type: "type",
      schema: t,
      * entries(r) {
        if (La(r))
          for (const n of e) yield [n, r[n], t[n]]
      },
      validator(r) {
        return La(r) || `Expected an object, but received: ${Ai(r)}`
      },
      coercer(r) {
        return La(r) ? {
          ...r
        } : r
      }
    })
  }

  function bAe(t) {
    const e = t.map(r => r.type).join(" | ");
    return new ci({
      type: "union",
      schema: null,
      coercer(r) {
        for (const n of t) {
          const [i, s] = n.validate(r, {
            coerce: !0
          });
          if (!i) return s
        }
        return r
      },
      validator(r, n) {
        const i = [];
        for (const s of t) {
          const [...o] = DS(r, s, n), [a] = o;
          if (a[0])
            for (const [c] of o) c && i.push(c);
          else return []
        }
        return [`Expected the value to satisfy a union of \`${e}\`, but received: ${Ai(r)}`, ...i]
      }
    })
  }

  function xH() {
    return xo("unknown", () => !0)
  }

  function US(t, e, r) {
    return new ci({
      ...t,
      coercer: (n, i) => LS(n, e) ? t.coercer(r(n, i), i) : t.coercer(n, i)
    })
  }

  function yAe(t, e, r = {}) {
    return US(t, xH(), n => {
      const i = typeof e == "function" ? e() : e;
      if (n === void 0) return i;
      if (!r.strict && mH(n) && mH(i)) {
        const s = {
          ...n
        };
        let o = !1;
        for (const a in i) s[a] === void 0 && (s[a] = i[a], o = !0);
        if (o) return s
      }
      return n
    })
  }

  function _Ae(t) {
    return US(t, _H(), e => e.trim())
  }

  function xAe(t) {
    return fp(t, "empty", e => {
      const r = CH(e);
      return r === 0 || `Expected an empty ${t.type} but received one with a size of \`${r}\``
    })
  }

  function CH(t) {
    return t instanceof Map || t instanceof Set ? t.size : t.length
  }

  function CAe(t, e, r = {}) {
    const {
      exclusive: n
    } = r;
    return fp(t, "max", i => n ? i < e : i <= e || `Expected a ${t.type} less than ${n?"":"or equal to "}${e} but received \`${i}\``)
  }

  function EAe(t, e, r = {}) {
    const {
      exclusive: n
    } = r;
    return fp(t, "min", i => n ? i > e : i >= e || `Expected a ${t.type} greater than ${n?"":"or equal to "}${e} but received \`${i}\``)
  }

  function AAe(t) {
    return fp(t, "nonempty", e => CH(e) > 0 || `Expected a nonempty ${t.type} but received an empty one`)
  }

  function SAe(t, e) {
    return fp(t, "pattern", r => e.test(r) || `Expected a ${t.type} matching \`/${e.source}/\` but received "${r}"`)
  }

  function IAe(t, e, r = e) {
    const n = `Expected a ${t.type}`,
      i = e === r ? `of \`${e}\`` : `between \`${e}\` and \`${r}\``;
    return fp(t, "size", s => {
      if (typeof s == "number" || s instanceof Date) return e <= s && s <= r || `${n} ${i} but received \`${s}\``;
      if (s instanceof Map || s instanceof Set) {
        const {
          size: o
        } = s;
        return e <= o && o <= r || `${n} with a size ${i} but received one with a size of \`${o}\``
      } else {
        const {
          length: o
        } = s;
        return e <= o && o <= r || `${n} with a length ${i} but received one with a length of \`${o}\``
      }
    })
  }

  function fp(t, e, r) {
    return new ci({
      ...t,
      * refiner(n, i) {
        yield* t.refiner(n, i);
        const s = r(n, i),
          o = OS(s, i, t, n);
        for (const a of o) yield {
          ...a,
          refinement: e
        }
      }
    })
  }
  const pp = bu(Object.freeze(Object.defineProperty({
    __proto__: null,
    Struct: ci,
    StructError: gH,
    any: tAe,
    array: rAe,
    assert: wH,
    assign: KEe,
    bigint: nAe,
    boolean: iAe,
    coerce: US,
    create: vH,
    date: sAe,
    defaulted: yAe,
    define: xo,
    deprecated: GEe,
    dynamic: ZEe,
    empty: xAe,
    enums: oAe,
    func: aAe,
    instance: cAe,
    integer: lAe,
    intersection: uAe,
    is: LS,
    lazy: YEe,
    literal: dAe,
    map: hAe,
    mask: bH,
    max: CAe,
    min: EAe,
    never: BS,
    nonempty: AAe,
    nullable: fAe,
    number: pAe,
    object: Lb,
    omit: QEe,
    optional: yH,
    partial: JEe,
    pattern: SAe,
    pick: XEe,
    record: gAe,
    refine: fp,
    regexp: mAe,
    set: wAe,
    size: IAe,
    string: _H,
    struct: eAe,
    trimmed: _Ae,
    tuple: vAe,
    type: Bb,
    union: bAe,
    unknown: xH,
    validate: fm
  }, Symbol.toStringTag, {
    value: "Module"
  })));
  Object.defineProperty(hs, "__esModule", {
    value: !0
  }), hs.assertExhaustive = hs.assertStruct = hs.assert = hs.AssertionError = void 0;
  const TAe = pp;

  function kAe(t) {
    return typeof t == "object" && t !== null && "message" in t
  }

  function RAe(t) {
    var e, r;
    return typeof ((r = (e = t?.prototype) === null || e === void 0 ? void 0 : e.constructor) === null || r === void 0 ? void 0 : r.name) == "string"
  }

  function NAe(t) {
    const e = kAe(t) ? t.message : String(t);
    return e.endsWith(".") ? e.slice(0, -1) : e
  }

  function EH(t, e) {
    return RAe(t) ? new t({
      message: e
    }) : t({
      message: e
    })
  }
  class jS extends Error {
    constructor(e) {
      super(e.message), this.code = "ERR_ASSERTION"
    }
  }
  hs.AssertionError = jS;

  function MAe(t, e = "Assertion failed.", r = jS) {
    if (!t) throw e instanceof Error ? e : EH(r, e)
  }
  hs.assert = MAe;

  function PAe(t, e, r = "Assertion failed", n = jS) {
    try {
      (0, TAe.assert)(t, e)
    } catch (i) {
      throw EH(n, `${r}: ${NAe(i)}.`)
    }
  }
  hs.assertStruct = PAe;

  function $Ae(t) {
    throw new Error("Invalid branch reached. Should be detected during compilation.")
  }
  hs.assertExhaustive = $Ae;
  var Ub = {};
  Object.defineProperty(Ub, "__esModule", {
    value: !0
  }), Ub.base64 = void 0;
  const OAe = pp,
    DAe = hs,
    LAe = (t, e = {}) => {
      var r, n;
      const i = (r = e.paddingRequired) !== null && r !== void 0 ? r : !1,
        s = (n = e.characterSet) !== null && n !== void 0 ? n : "base64";
      let o;
      s === "base64" ? o = String.raw`[A-Za-z0-9+\/]` : ((0, DAe.assert)(s === "base64url"), o = String.raw`[-_A-Za-z0-9]`);
      let a;
      return i ? a = new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`, "u") : a = new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`, "u"), (0, OAe.pattern)(t, a)
    };
  Ub.base64 = LAe;
  var zr = {},
    jb = {};
  (function (t) {
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.remove0x = t.add0x = t.assertIsStrictHexString = t.assertIsHexString = t.isStrictHexString = t.isHexString = t.StrictHexStruct = t.HexStruct = void 0;
    const e = pp,
      r = hs;
    t.HexStruct = (0, e.pattern)((0, e.string)(), /^(?:0x)?[0-9a-f]+$/iu), t.StrictHexStruct = (0, e.pattern)((0, e.string)(), /^0x[0-9a-f]+$/iu);

    function n(l) {
      return (0, e.is)(l, t.HexStruct)
    }
    t.isHexString = n;

    function i(l) {
      return (0, e.is)(l, t.StrictHexStruct)
    }
    t.isStrictHexString = i;

    function s(l) {
      (0, r.assert)(n(l), "Value must be a hexadecimal string.")
    }
    t.assertIsHexString = s;

    function o(l) {
      (0, r.assert)(i(l), 'Value must be a hexadecimal string, starting with "0x".')
    }
    t.assertIsStrictHexString = o;

    function a(l) {
      return l.startsWith("0x") ? l : l.startsWith("0X") ? `0x${l.substring(2)}` : `0x${l}`
    }
    t.add0x = a;

    function c(l) {
      return l.startsWith("0x") || l.startsWith("0X") ? l.substring(2) : l
    }
    t.remove0x = c
  })(jb), Object.defineProperty(zr, "__esModule", {
    value: !0
  }), zr.createDataView = zr.concatBytes = zr.valueToBytes = zr.stringToBytes = zr.numberToBytes = zr.signedBigIntToBytes = zr.bigIntToBytes = zr.hexToBytes = zr.bytesToString = zr.bytesToNumber = zr.bytesToSignedBigInt = zr.bytesToBigInt = zr.bytesToHex = zr.assertIsBytes = zr.isBytes = void 0;
  const Zo = hs,
    FS = jb,
    AH = 48,
    SH = 58,
    IH = 87;

  function BAe() {
    const t = [];
    return () => {
      if (t.length === 0)
        for (let e = 0; e < 256; e++) t.push(e.toString(16).padStart(2, "0"));
      return t
    }
  }
  const UAe = BAe();

  function WS(t) {
    return t instanceof Uint8Array
  }
  zr.isBytes = WS;

  function pm(t) {
    (0, Zo.assert)(WS(t), "Value must be a Uint8Array.")
  }
  zr.assertIsBytes = pm;

  function TH(t) {
    if (pm(t), t.length === 0) return "0x";
    const e = UAe(),
      r = new Array(t.length);
    for (let n = 0; n < t.length; n++) r[n] = e[t[n]];
    return (0, FS.add0x)(r.join(""))
  }
  zr.bytesToHex = TH;

  function kH(t) {
    pm(t);
    const e = TH(t);
    return BigInt(e)
  }
  zr.bytesToBigInt = kH;

  function jAe(t) {
    pm(t);
    let e = BigInt(0);
    for (const r of t) e = (e << BigInt(8)) + BigInt(r);
    return BigInt.asIntN(t.length * 8, e)
  }
  zr.bytesToSignedBigInt = jAe;

  function FAe(t) {
    pm(t);
    const e = kH(t);
    return (0, Zo.assert)(e <= BigInt(Number.MAX_SAFE_INTEGER), "Number is not a safe integer. Use `bytesToBigInt` instead."), Number(e)
  }
  zr.bytesToNumber = FAe;

  function WAe(t) {
    return pm(t), new TextDecoder().decode(t)
  }
  zr.bytesToString = WAe;

  function c8(t) {
    var e;
    if (((e = t?.toLowerCase) === null || e === void 0 ? void 0 : e.call(t)) === "0x") return new Uint8Array;
    (0, FS.assertIsHexString)(t);
    const r = (0, FS.remove0x)(t).toLowerCase(),
      n = r.length % 2 === 0 ? r : `0${r}`,
      i = new Uint8Array(n.length / 2);
    for (let s = 0; s < i.length; s++) {
      const o = n.charCodeAt(s * 2),
        a = n.charCodeAt(s * 2 + 1),
        c = o - (o < SH ? AH : IH),
        l = a - (a < SH ? AH : IH);
      i[s] = c * 16 + l
    }
    return i
  }
  zr.hexToBytes = c8;

  function RH(t) {
    (0, Zo.assert)(typeof t == "bigint", "Value must be a bigint."), (0, Zo.assert)(t >= BigInt(0), "Value must be a non-negative bigint.");
    const e = t.toString(16);
    return c8(e)
  }
  zr.bigIntToBytes = RH;

  function zAe(t, e) {
    (0, Zo.assert)(e > 0);
    const r = t >> BigInt(31);
    return !((~t & r) + (t & ~r) >> BigInt(e * 8 + -1))
  }

  function HAe(t, e) {
    (0, Zo.assert)(typeof t == "bigint", "Value must be a bigint."), (0, Zo.assert)(typeof e == "number", "Byte length must be a number."), (0, Zo.assert)(e > 0, "Byte length must be greater than 0."), (0, Zo.assert)(zAe(t, e), "Byte length is too small to represent the given value.");
    let r = t;
    const n = new Uint8Array(e);
    for (let i = 0; i < n.length; i++) n[i] = Number(BigInt.asUintN(8, r)), r >>= BigInt(8);
    return n.reverse()
  }
  zr.signedBigIntToBytes = HAe;

  function NH(t) {
    (0, Zo.assert)(typeof t == "number", "Value must be a number."), (0, Zo.assert)(t >= 0, "Value must be a non-negative number."), (0, Zo.assert)(Number.isSafeInteger(t), "Value is not a safe integer. Use `bigIntToBytes` instead.");
    const e = t.toString(16);
    return c8(e)
  }
  zr.numberToBytes = NH;

  function MH(t) {
    return (0, Zo.assert)(typeof t == "string", "Value must be a string."), new TextEncoder().encode(t)
  }
  zr.stringToBytes = MH;

  function PH(t) {
    if (typeof t == "bigint") return RH(t);
    if (typeof t == "number") return NH(t);
    if (typeof t == "string") return t.startsWith("0x") ? c8(t) : MH(t);
    if (WS(t)) return t;
    throw new TypeError(`Unsupported value type: "${typeof t}".`)
  }
  zr.valueToBytes = PH;

  function qAe(t) {
    const e = new Array(t.length);
    let r = 0;
    for (let i = 0; i < t.length; i++) {
      const s = PH(t[i]);
      e[i] = s, r += s.length
    }
    const n = new Uint8Array(r);
    for (let i = 0, s = 0; i < e.length; i++) n.set(e[i], s), s += e[i].length;
    return n
  }
  zr.concatBytes = qAe;

  function VAe(t) {
    if (typeof Buffer < "u" && t instanceof Buffer) {
      const e = t.buffer.slice(t.byteOffset, t.byteOffset + t.byteLength);
      return new DataView(e)
    }
    return new DataView(t.buffer, t.byteOffset, t.byteLength)
  }
  zr.createDataView = VAe;
  var l8 = {};
  Object.defineProperty(l8, "__esModule", {
    value: !0
  }), l8.ChecksumStruct = void 0;
  const $H = pp,
    KAe = Ub;
  l8.ChecksumStruct = (0, $H.size)((0, KAe.base64)((0, $H.string)(), {
    paddingRequired: !0
  }), 44, 44);
  var su = {};
  Object.defineProperty(su, "__esModule", {
    value: !0
  }), su.createHex = su.createBytes = su.createBigInt = su.createNumber = void 0;
  const Wn = pp,
    GAe = hs,
    OH = zr,
    u8 = jb,
    DH = (0, Wn.union)([(0, Wn.number)(), (0, Wn.bigint)(), (0, Wn.string)(), u8.StrictHexStruct]),
    ZAe = (0, Wn.coerce)((0, Wn.number)(), DH, Number),
    YAe = (0, Wn.coerce)((0, Wn.bigint)(), DH, BigInt);
  (0, Wn.union)([u8.StrictHexStruct, (0, Wn.instance)(Uint8Array)]);
  const QAe = (0, Wn.coerce)((0, Wn.instance)(Uint8Array), (0, Wn.union)([u8.StrictHexStruct]), OH.hexToBytes),
    JAe = (0, Wn.coerce)(u8.StrictHexStruct, (0, Wn.instance)(Uint8Array), OH.bytesToHex);

  function XAe(t) {
    try {
      const e = (0, Wn.create)(t, ZAe);
      return (0, GAe.assert)(Number.isFinite(e), `Expected a number-like value, got "${t}".`), e
    } catch (e) {
      throw e instanceof Wn.StructError ? new Error(`Expected a number-like value, got "${t}".`) : e
    }
  }
  su.createNumber = XAe;

  function eSe(t) {
    try {
      return (0, Wn.create)(t, YAe)
    } catch (e) {
      throw e instanceof Wn.StructError ? new Error(`Expected a number-like value, got "${String(e.value)}".`) : e
    }
  }
  su.createBigInt = eSe;

  function tSe(t) {
    if (typeof t == "string" && t.toLowerCase() === "0x") return new Uint8Array;
    try {
      return (0, Wn.create)(t, QAe)
    } catch (e) {
      throw e instanceof Wn.StructError ? new Error(`Expected a bytes-like value, got "${String(e.value)}".`) : e
    }
  }
  su.createBytes = tSe;

  function rSe(t) {
    if (t instanceof Uint8Array && t.length === 0 || typeof t == "string" && t.toLowerCase() === "0x") return "0x";
    try {
      return (0, Wn.create)(t, JAe)
    } catch (e) {
      throw e instanceof Wn.StructError ? new Error(`Expected a bytes-like value, got "${String(e.value)}".`) : e
    }
  }
  su.createHex = rSe;
  var gm = {},
    LH = ot && ot.__classPrivateFieldSet || function (t, e, r, n, i) {
      if (n === "m") throw new TypeError("Private method is not writable");
      if (n === "a" && !i) throw new TypeError("Private accessor was defined without a setter");
      if (typeof e == "function" ? t !== e || !i : !e.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
      return n === "a" ? i.call(t, r) : i ? i.value = r : e.set(t, r), r
    },
    zs = ot && ot.__classPrivateFieldGet || function (t, e, r, n) {
      if (r === "a" && !n) throw new TypeError("Private accessor was defined without a getter");
      if (typeof e == "function" ? t !== e || !n : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
      return r === "m" ? n : r === "a" ? n.call(t) : n ? n.value : e.get(t)
    },
    Lc, ou;
  Object.defineProperty(gm, "__esModule", {
    value: !0
  }), gm.FrozenSet = gm.FrozenMap = void 0;
  class zS {
    constructor(e) {
      Lc.set(this, void 0), LH(this, Lc, new Map(e), "f"), Object.freeze(this)
    }
    get size() {
      return zs(this, Lc, "f").size
    } [(Lc = new WeakMap, Symbol.iterator)]() {
      return zs(this, Lc, "f")[Symbol.iterator]()
    }
    entries() {
      return zs(this, Lc, "f").entries()
    }
    forEach(e, r) {
      return zs(this, Lc, "f").forEach((n, i, s) => e.call(r, n, i, this))
    }
    get(e) {
      return zs(this, Lc, "f").get(e)
    }
    has(e) {
      return zs(this, Lc, "f").has(e)
    }
    keys() {
      return zs(this, Lc, "f").keys()
    }
    values() {
      return zs(this, Lc, "f").values()
    }
    toString() {
      return `FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,r])=>`${String(e)} => ${String(r)}`).join(", ")} `:""}}`
    }
  }
  gm.FrozenMap = zS;
  class HS {
    constructor(e) {
      ou.set(this, void 0), LH(this, ou, new Set(e), "f"), Object.freeze(this)
    }
    get size() {
      return zs(this, ou, "f").size
    } [(ou = new WeakMap, Symbol.iterator)]() {
      return zs(this, ou, "f")[Symbol.iterator]()
    }
    entries() {
      return zs(this, ou, "f").entries()
    }
    forEach(e, r) {
      return zs(this, ou, "f").forEach((n, i, s) => e.call(r, n, i, this))
    }
    has(e) {
      return zs(this, ou, "f").has(e)
    }
    keys() {
      return zs(this, ou, "f").keys()
    }
    values() {
      return zs(this, ou, "f").values()
    }
    toString() {
      return `FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`
    }
  }
  gm.FrozenSet = HS, Object.freeze(zS), Object.freeze(zS.prototype), Object.freeze(HS), Object.freeze(HS.prototype);
  var BH = {};
  Object.defineProperty(BH, "__esModule", {
    value: !0
  });
  var UH = {};
  (function (t) {
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.getJsonRpcIdValidator = t.assertIsJsonRpcError = t.isJsonRpcError = t.assertIsJsonRpcFailure = t.isJsonRpcFailure = t.assertIsJsonRpcSuccess = t.isJsonRpcSuccess = t.assertIsJsonRpcResponse = t.isJsonRpcResponse = t.assertIsPendingJsonRpcResponse = t.isPendingJsonRpcResponse = t.JsonRpcResponseStruct = t.JsonRpcFailureStruct = t.JsonRpcSuccessStruct = t.PendingJsonRpcResponseStruct = t.assertIsJsonRpcRequest = t.isJsonRpcRequest = t.assertIsJsonRpcNotification = t.isJsonRpcNotification = t.JsonRpcNotificationStruct = t.JsonRpcRequestStruct = t.JsonRpcParamsStruct = t.JsonRpcErrorStruct = t.JsonRpcIdStruct = t.JsonRpcVersionStruct = t.jsonrpc2 = t.getJsonSize = t.isValidJson = t.JsonStruct = t.UnsafeJsonStruct = void 0;
    const e = pp,
      r = hs,
      n = () => (0, e.define)("finite number", D => (0, e.is)(D, (0, e.number)()) && Number.isFinite(D));
    t.UnsafeJsonStruct = (0, e.union)([(0, e.literal)(null), (0, e.boolean)(), n(), (0, e.string)(), (0, e.array)((0, e.lazy)(() => t.UnsafeJsonStruct)), (0, e.record)((0, e.string)(), (0, e.lazy)(() => t.UnsafeJsonStruct))]), t.JsonStruct = (0, e.define)("Json", (D, V) => {
      function R(P, j) {
        const U = [...j.validator(P, V)];
        return U.length > 0 ? U : !0
      }
      try {
        const P = R(D, t.UnsafeJsonStruct);
        return P !== !0 ? P : R(JSON.parse(JSON.stringify(D)), t.UnsafeJsonStruct)
      } catch (P) {
        return P instanceof RangeError ? "Circular reference detected" : !1
      }
    });

    function i(D) {
      return (0, e.is)(D, t.JsonStruct)
    }
    t.isValidJson = i;

    function s(D) {
      (0, r.assertStruct)(D, t.JsonStruct, "Invalid JSON value");
      const V = JSON.stringify(D);
      return new TextEncoder().encode(V).byteLength
    }
    t.getJsonSize = s, t.jsonrpc2 = "2.0", t.JsonRpcVersionStruct = (0, e.literal)(t.jsonrpc2), t.JsonRpcIdStruct = (0, e.nullable)((0, e.union)([(0, e.number)(), (0, e.string)()])), t.JsonRpcErrorStruct = (0, e.object)({
      code: (0, e.integer)(),
      message: (0, e.string)(),
      data: (0, e.optional)(t.JsonStruct),
      stack: (0, e.optional)((0, e.string)())
    }), t.JsonRpcParamsStruct = (0, e.optional)((0, e.union)([(0, e.record)((0, e.string)(), t.JsonStruct), (0, e.array)(t.JsonStruct)])), t.JsonRpcRequestStruct = (0, e.object)({
      id: t.JsonRpcIdStruct,
      jsonrpc: t.JsonRpcVersionStruct,
      method: (0, e.string)(),
      params: t.JsonRpcParamsStruct
    }), t.JsonRpcNotificationStruct = (0, e.omit)(t.JsonRpcRequestStruct, ["id"]);

    function o(D) {
      return (0, e.is)(D, t.JsonRpcNotificationStruct)
    }
    t.isJsonRpcNotification = o;

    function a(D, V) {
      (0, r.assertStruct)(D, t.JsonRpcNotificationStruct, "Invalid JSON-RPC notification", V)
    }
    t.assertIsJsonRpcNotification = a;

    function c(D) {
      return (0, e.is)(D, t.JsonRpcRequestStruct)
    }
    t.isJsonRpcRequest = c;

    function l(D, V) {
      (0, r.assertStruct)(D, t.JsonRpcRequestStruct, "Invalid JSON-RPC request", V)
    }
    t.assertIsJsonRpcRequest = l, t.PendingJsonRpcResponseStruct = (0, e.object)({
      id: t.JsonRpcIdStruct,
      jsonrpc: t.JsonRpcVersionStruct,
      result: (0, e.optional)((0, e.unknown)()),
      error: (0, e.optional)(t.JsonRpcErrorStruct)
    }), t.JsonRpcSuccessStruct = (0, e.object)({
      id: t.JsonRpcIdStruct,
      jsonrpc: t.JsonRpcVersionStruct,
      result: t.JsonStruct
    }), t.JsonRpcFailureStruct = (0, e.object)({
      id: t.JsonRpcIdStruct,
      jsonrpc: t.JsonRpcVersionStruct,
      error: t.JsonRpcErrorStruct
    }), t.JsonRpcResponseStruct = (0, e.union)([t.JsonRpcSuccessStruct, t.JsonRpcFailureStruct]);

    function h(D) {
      return (0, e.is)(D, t.PendingJsonRpcResponseStruct)
    }
    t.isPendingJsonRpcResponse = h;

    function f(D, V) {
      (0, r.assertStruct)(D, t.PendingJsonRpcResponseStruct, "Invalid pending JSON-RPC response", V)
    }
    t.assertIsPendingJsonRpcResponse = f;

    function w(D) {
      return (0, e.is)(D, t.JsonRpcResponseStruct)
    }
    t.isJsonRpcResponse = w;

    function b(D, V) {
      (0, r.assertStruct)(D, t.JsonRpcResponseStruct, "Invalid JSON-RPC response", V)
    }
    t.assertIsJsonRpcResponse = b;

    function C(D) {
      return (0, e.is)(D, t.JsonRpcSuccessStruct)
    }
    t.isJsonRpcSuccess = C;

    function M(D, V) {
      (0, r.assertStruct)(D, t.JsonRpcSuccessStruct, "Invalid JSON-RPC success response", V)
    }
    t.assertIsJsonRpcSuccess = M;

    function N(D) {
      return (0, e.is)(D, t.JsonRpcFailureStruct)
    }
    t.isJsonRpcFailure = N;

    function $(D, V) {
      (0, r.assertStruct)(D, t.JsonRpcFailureStruct, "Invalid JSON-RPC failure response", V)
    }
    t.assertIsJsonRpcFailure = $;

    function k(D) {
      return (0, e.is)(D, t.JsonRpcErrorStruct)
    }
    t.isJsonRpcError = k;

    function B(D, V) {
      (0, r.assertStruct)(D, t.JsonRpcErrorStruct, "Invalid JSON-RPC error", V)
    }
    t.assertIsJsonRpcError = B;

    function F(D) {
      const {
        permitEmptyString: V,
        permitFractions: R,
        permitNull: P
      } = Object.assign({
        permitEmptyString: !0,
        permitFractions: !1,
        permitNull: !0
      }, D);
      return Y => !!(typeof Y == "number" && (R || Number.isInteger(Y)) || typeof Y == "string" && (V || Y.length > 0) || P && Y === null)
    }
    t.getJsonRpcIdValidator = F
  })(UH);
  var jH = {};
  Object.defineProperty(jH, "__esModule", {
    value: !0
  });
  var mm = {},
    qS = {
      exports: {}
    },
    VS, FH;

  function nSe() {
    if (FH) return VS;
    FH = 1;
    var t = 1e3,
      e = t * 60,
      r = e * 60,
      n = r * 24,
      i = n * 7,
      s = n * 365.25;
    VS = function (h, f) {
      f = f || {};
      var w = typeof h;
      if (w === "string" && h.length > 0) return o(h);
      if (w === "number" && isFinite(h)) return f.long ? c(h) : a(h);
      throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(h))
    };

    function o(h) {
      if (h = String(h), !(h.length > 100)) {
        var f = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(h);
        if (f) {
          var w = parseFloat(f[1]),
            b = (f[2] || "ms").toLowerCase();
          switch (b) {
            case "years":
            case "year":
            case "yrs":
            case "yr":
            case "y":
              return w * s;
            case "weeks":
            case "week":
            case "w":
              return w * i;
            case "days":
            case "day":
            case "d":
              return w * n;
            case "hours":
            case "hour":
            case "hrs":
            case "hr":
            case "h":
              return w * r;
            case "minutes":
            case "minute":
            case "mins":
            case "min":
            case "m":
              return w * e;
            case "seconds":
            case "second":
            case "secs":
            case "sec":
            case "s":
              return w * t;
            case "milliseconds":
            case "millisecond":
            case "msecs":
            case "msec":
            case "ms":
              return w;
            default:
              return
          }
        }
      }
    }

    function a(h) {
      var f = Math.abs(h);
      return f >= n ? Math.round(h / n) + "d" : f >= r ? Math.round(h / r) + "h" : f >= e ? Math.round(h / e) + "m" : f >= t ? Math.round(h / t) + "s" : h + "ms"
    }

    function c(h) {
      var f = Math.abs(h);
      return f >= n ? l(h, f, n, "day") : f >= r ? l(h, f, r, "hour") : f >= e ? l(h, f, e, "minute") : f >= t ? l(h, f, t, "second") : h + " ms"
    }

    function l(h, f, w, b) {
      var C = f >= w * 1.5;
      return Math.round(h / w) + " " + b + (C ? "s" : "")
    }
    return VS
  }

  function iSe(t) {
    r.debug = r, r.default = r, r.coerce = c, r.disable = s, r.enable = i, r.enabled = o, r.humanize = nSe(), r.destroy = l, Object.keys(t).forEach(h => {
      r[h] = t[h]
    }), r.names = [], r.skips = [], r.formatters = {};

    function e(h) {
      let f = 0;
      for (let w = 0; w < h.length; w++) f = (f << 5) - f + h.charCodeAt(w), f |= 0;
      return r.colors[Math.abs(f) % r.colors.length]
    }
    r.selectColor = e;

    function r(h) {
      let f, w = null,
        b, C;

      function M(...N) {
        if (!M.enabled) return;
        const $ = M,
          k = Number(new Date),
          B = k - (f || k);
        $.diff = B, $.prev = f, $.curr = k, f = k, N[0] = r.coerce(N[0]), typeof N[0] != "string" && N.unshift("%O");
        let F = 0;
        N[0] = N[0].replace(/%([a-zA-Z%])/g, (V, R) => {
          if (V === "%%") return "%";
          F++;
          const P = r.formatters[R];
          if (typeof P == "function") {
            const j = N[F];
            V = P.call($, j), N.splice(F, 1), F--
          }
          return V
        }), r.formatArgs.call($, N), ($.log || r.log).apply($, N)
      }
      return M.namespace = h, M.useColors = r.useColors(), M.color = r.selectColor(h), M.extend = n, M.destroy = r.destroy, Object.defineProperty(M, "enabled", {
        enumerable: !0,
        configurable: !1,
        get: () => w !== null ? w : (b !== r.namespaces && (b = r.namespaces, C = r.enabled(h)), C),
        set: N => {
          w = N
        }
      }), typeof r.init == "function" && r.init(M), M
    }

    function n(h, f) {
      const w = r(this.namespace + (typeof f > "u" ? ":" : f) + h);
      return w.log = this.log, w
    }

    function i(h) {
      r.save(h), r.namespaces = h, r.names = [], r.skips = [];
      let f;
      const w = (typeof h == "string" ? h : "").split(/[\s,]+/),
        b = w.length;
      for (f = 0; f < b; f++) w[f] && (h = w[f].replace(/\*/g, ".*?"), h[0] === "-" ? r.skips.push(new RegExp("^" + h.slice(1) + "$")) : r.names.push(new RegExp("^" + h + "$")))
    }

    function s() {
      const h = [...r.names.map(a), ...r.skips.map(a).map(f => "-" + f)].join(",");
      return r.enable(""), h
    }

    function o(h) {
      if (h[h.length - 1] === "*") return !0;
      let f, w;
      for (f = 0, w = r.skips.length; f < w; f++)
        if (r.skips[f].test(h)) return !1;
      for (f = 0, w = r.names.length; f < w; f++)
        if (r.names[f].test(h)) return !0;
      return !1
    }

    function a(h) {
      return h.toString().substring(2, h.toString().length - 2).replace(/\.\*\?$/, "*")
    }

    function c(h) {
      return h instanceof Error ? h.stack || h.message : h
    }

    function l() {
      console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")
    }
    return r.enable(r.load()), r
  }
  var sSe = iSe;
  (function (t, e) {
    var r = {};
    e.formatArgs = i, e.save = s, e.load = o, e.useColors = n, e.storage = a(), e.destroy = (() => {
      let l = !1;
      return () => {
        l || (l = !0, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))
      }
    })(), e.colors = ["#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33"];

    function n() {
      if (typeof window < "u" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) return !0;
      if (typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) return !1;
      let l;
      return typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator < "u" && navigator.userAgent && (l = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(l[1], 10) >= 31 || typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)
    }

    function i(l) {
      if (l[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + l[0] + (this.useColors ? "%c " : " ") + "+" + t.exports.humanize(this.diff), !this.useColors) return;
      const h = "color: " + this.color;
      l.splice(1, 0, h, "color: inherit");
      let f = 0,
        w = 0;
      l[0].replace(/%[a-zA-Z%]/g, b => {
        b !== "%%" && (f++, b === "%c" && (w = f))
      }), l.splice(w, 0, h)
    }
    e.log = console.debug || console.log || (() => {});

    function s(l) {
      try {
        l ? e.storage.setItem("debug", l) : e.storage.removeItem("debug")
      } catch {}
    }

    function o() {
      let l;
      try {
        l = e.storage.getItem("debug")
      } catch {}
      return !l && typeof process < "u" && "env" in process && (l = r.DEBUG), l
    }

    function a() {
      try {
        return localStorage
      } catch {}
    }
    t.exports = sSe(e);
    const {
      formatters: c
    } = t.exports;
    c.j = function (l) {
      try {
        return JSON.stringify(l)
      } catch (h) {
        return "[UnexpectedJSONParseError]: " + h.message
      }
    }
  })(qS, qS.exports);
  var oSe = qS.exports,
    aSe = ot && ot.__importDefault || function (t) {
      return t && t.__esModule ? t : {
        default: t
      }
    };
  Object.defineProperty(mm, "__esModule", {
    value: !0
  }), mm.createModuleLogger = mm.createProjectLogger = void 0;
  const cSe = (0, aSe(oSe).default)("metamask");

  function lSe(t) {
    return cSe.extend(t)
  }
  mm.createProjectLogger = lSe;

  function uSe(t, e) {
    return t.extend(e)
  }
  mm.createModuleLogger = uSe;
  var WH = {};
  (function (t) {
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.calculateNumberSize = t.calculateStringSize = t.isASCII = t.isPlainObject = t.ESCAPE_CHARACTERS_REGEXP = t.JsonSize = t.hasProperty = t.isObject = t.isNullOrUndefined = t.isNonEmptyArray = void 0;

    function e(l) {
      return Array.isArray(l) && l.length > 0
    }
    t.isNonEmptyArray = e;

    function r(l) {
      return l == null
    }
    t.isNullOrUndefined = r;

    function n(l) {
      return !!l && typeof l == "object" && !Array.isArray(l)
    }
    t.isObject = n;
    const i = (l, h) => Object.hasOwnProperty.call(l, h);
    t.hasProperty = i,
      function (l) {
        l[l.Null = 4] = "Null", l[l.Comma = 1] = "Comma", l[l.Wrapper = 1] = "Wrapper", l[l.True = 4] = "True", l[l.False = 5] = "False", l[l.Quote = 1] = "Quote", l[l.Colon = 1] = "Colon", l[l.Date = 24] = "Date"
      }(t.JsonSize || (t.JsonSize = {})), t.ESCAPE_CHARACTERS_REGEXP = /"|\\|\n|\r|\t/gu;

    function s(l) {
      if (typeof l != "object" || l === null) return !1;
      try {
        let h = l;
        for (; Object.getPrototypeOf(h) !== null;) h = Object.getPrototypeOf(h);
        return Object.getPrototypeOf(l) === h
      } catch {
        return !1
      }
    }
    t.isPlainObject = s;

    function o(l) {
      return l.charCodeAt(0) <= 127
    }
    t.isASCII = o;

    function a(l) {
      var h;
      return l.split("").reduce((w, b) => o(b) ? w + 1 : w + 2, 0) + ((h = l.match(t.ESCAPE_CHARACTERS_REGEXP)) !== null && h !== void 0 ? h : []).length
    }
    t.calculateStringSize = a;

    function c(l) {
      return l.toString().length
    }
    t.calculateNumberSize = c
  })(WH);
  var au = {};
  Object.defineProperty(au, "__esModule", {
    value: !0
  }), au.hexToBigInt = au.hexToNumber = au.bigIntToHex = au.numberToHex = void 0;
  const wm = hs,
    Fb = jb,
    dSe = t => ((0, wm.assert)(typeof t == "number", "Value must be a number."), (0, wm.assert)(t >= 0, "Value must be a non-negative number."), (0, wm.assert)(Number.isSafeInteger(t), "Value is not a safe integer. Use `bigIntToHex` instead."), (0, Fb.add0x)(t.toString(16)));
  au.numberToHex = dSe;
  const hSe = t => ((0, wm.assert)(typeof t == "bigint", "Value must be a bigint."), (0, wm.assert)(t >= 0, "Value must be a non-negative bigint."), (0, Fb.add0x)(t.toString(16)));
  au.bigIntToHex = hSe;
  const fSe = t => {
    (0, Fb.assertIsHexString)(t);
    const e = parseInt(t, 16);
    return (0, wm.assert)(Number.isSafeInteger(e), "Value is not a safe integer. Use `hexToBigInt` instead."), e
  };
  au.hexToNumber = fSe;
  const pSe = t => ((0, Fb.assertIsHexString)(t), BigInt((0, Fb.add0x)(t)));
  au.hexToBigInt = pSe;
  var zH = {};
  Object.defineProperty(zH, "__esModule", {
    value: !0
  });
  var HH = {};
  (function (t) {
    Object.defineProperty(t, "__esModule", {
        value: !0
      }), t.timeSince = t.inMilliseconds = t.Duration = void 0,
      function (s) {
        s[s.Millisecond = 1] = "Millisecond", s[s.Second = 1e3] = "Second", s[s.Minute = 6e4] = "Minute", s[s.Hour = 36e5] = "Hour", s[s.Day = 864e5] = "Day", s[s.Week = 6048e5] = "Week", s[s.Year = 31536e6] = "Year"
      }(t.Duration || (t.Duration = {}));
    const e = s => Number.isInteger(s) && s >= 0,
      r = (s, o) => {
        if (!e(s)) throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)
      };

    function n(s, o) {
      return r(s, "count"), s * o
    }
    t.inMilliseconds = n;

    function i(s) {
      return r(s, "timestamp"), Date.now() - s
    }
    t.timeSince = i
  })(HH);
  var qH = {};
  Object.defineProperty(qH, "__esModule", {
    value: !0
  });
  var VH = {},
    KS = {
      exports: {}
    };
  const gSe = "2.0.0",
    KH = 256,
    mSe = Number.MAX_SAFE_INTEGER || 9007199254740991,
    wSe = 16,
    vSe = KH - 6;
  var d8 = {
      MAX_LENGTH: KH,
      MAX_SAFE_COMPONENT_LENGTH: wSe,
      MAX_SAFE_BUILD_LENGTH: vSe,
      MAX_SAFE_INTEGER: mSe,
      RELEASE_TYPES: ["major", "premajor", "minor", "preminor", "patch", "prepatch", "prerelease"],
      SEMVER_SPEC_VERSION: gSe,
      FLAG_INCLUDE_PRERELEASE: 1,
      FLAG_LOOSE: 2
    },
    GS = {},
    h8 = typeof process == "object" && GS && GS.NODE_DEBUG && /\bsemver\b/i.test(GS.NODE_DEBUG) ? (...t) => console.error("SEMVER", ...t) : () => {};
  (function (t, e) {
    const {
      MAX_SAFE_COMPONENT_LENGTH: r,
      MAX_SAFE_BUILD_LENGTH: n,
      MAX_LENGTH: i
    } = d8, s = h8;
    e = t.exports = {};
    const o = e.re = [],
      a = e.safeRe = [],
      c = e.src = [],
      l = e.t = {};
    let h = 0;
    const f = "[a-zA-Z0-9-]",
      w = [
        ["\\s", 1],
        ["\\d", i],
        [f, n]
      ],
      b = M => {
        for (const [N, $] of w) M = M.split(`${N}*`).join(`${N}{0,${$}}`).split(`${N}+`).join(`${N}{1,${$}}`);
        return M
      },
      C = (M, N, $) => {
        const k = b(N),
          B = h++;
        s(M, B, N), l[M] = B, c[B] = N, o[B] = new RegExp(N, $ ? "g" : void 0), a[B] = new RegExp(k, $ ? "g" : void 0)
      };
    C("NUMERICIDENTIFIER", "0|[1-9]\\d*"), C("NUMERICIDENTIFIERLOOSE", "\\d+"), C("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${f}*`), C("MAINVERSION", `(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`), C("MAINVERSIONLOOSE", `(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`), C("PRERELEASEIDENTIFIER", `(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`), C("PRERELEASEIDENTIFIERLOOSE", `(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`), C("PRERELEASE", `(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`), C("PRERELEASELOOSE", `(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`), C("BUILDIDENTIFIER", `${f}+`), C("BUILD", `(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`), C("FULLPLAIN", `v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`), C("FULL", `^${c[l.FULLPLAIN]}$`), C("LOOSEPLAIN", `[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`), C("LOOSE", `^${c[l.LOOSEPLAIN]}$`), C("GTLT", "((?:<|>)?=?)"), C("XRANGEIDENTIFIERLOOSE", `${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), C("XRANGEIDENTIFIER", `${c[l.NUMERICIDENTIFIER]}|x|X|\\*`), C("XRANGEPLAIN", `[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`), C("XRANGEPLAINLOOSE", `[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`), C("XRANGE", `^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`), C("XRANGELOOSE", `^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`), C("COERCEPLAIN", `(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`), C("COERCE", `${c[l.COERCEPLAIN]}(?:$|[^\\d])`), C("COERCEFULL", c[l.COERCEPLAIN] + `(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`), C("COERCERTL", c[l.COERCE], !0), C("COERCERTLFULL", c[l.COERCEFULL], !0), C("LONETILDE", "(?:~>?)"), C("TILDETRIM", `(\\s*)${c[l.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", C("TILDE", `^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`), C("TILDELOOSE", `^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`), C("LONECARET", "(?:\\^)"), C("CARETTRIM", `(\\s*)${c[l.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", C("CARET", `^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`), C("CARETLOOSE", `^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`), C("COMPARATORLOOSE", `^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`), C("COMPARATOR", `^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`), C("COMPARATORTRIM", `(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", C("HYPHENRANGE", `^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`), C("HYPHENRANGELOOSE", `^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`), C("STAR", "(<|>)?=?\\s*\\*"), C("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), C("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$")
  })(KS, KS.exports);
  var Wb = KS.exports;
  const bSe = Object.freeze({
      loose: !0
    }),
    ySe = Object.freeze({});
  var ZS = t => t ? typeof t != "object" ? bSe : t : ySe;
  const GH = /^[0-9]+$/,
    ZH = (t, e) => {
      const r = GH.test(t),
        n = GH.test(e);
      return r && n && (t = +t, e = +e), t === e ? 0 : r && !n ? -1 : n && !r ? 1 : t < e ? -1 : 1
    };
  var YH = {
    compareIdentifiers: ZH,
    rcompareIdentifiers: (t, e) => ZH(e, t)
  };
  const f8 = h8,
    {
      MAX_LENGTH: QH,
      MAX_SAFE_INTEGER: p8
    } = d8,
    {
      safeRe: JH,
      t: XH
    } = Wb,
    _Se = ZS,
    {
      compareIdentifiers: vm
    } = YH;
  var Hs = class vu {
    constructor(e, r) {
      if (r = _Se(r), e instanceof vu) {
        if (e.loose === !!r.loose && e.includePrerelease === !!r.includePrerelease) return e;
        e = e.version
      } else if (typeof e != "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);
      if (e.length > QH) throw new TypeError(`version is longer than ${QH} characters`);
      f8("SemVer", e, r), this.options = r, this.loose = !!r.loose, this.includePrerelease = !!r.includePrerelease;
      const n = e.trim().match(r.loose ? JH[XH.LOOSE] : JH[XH.FULL]);
      if (!n) throw new TypeError(`Invalid Version: ${e}`);
      if (this.raw = e, this.major = +n[1], this.minor = +n[2], this.patch = +n[3], this.major > p8 || this.major < 0) throw new TypeError("Invalid major version");
      if (this.minor > p8 || this.minor < 0) throw new TypeError("Invalid minor version");
      if (this.patch > p8 || this.patch < 0) throw new TypeError("Invalid patch version");
      n[4] ? this.prerelease = n[4].split(".").map(i => {
        if (/^[0-9]+$/.test(i)) {
          const s = +i;
          if (s >= 0 && s < p8) return s
        }
        return i
      }) : this.prerelease = [], this.build = n[5] ? n[5].split(".") : [], this.format()
    }
    format() {
      return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(".")}`), this.version
    }
    toString() {
      return this.version
    }
    compare(e) {
      if (f8("SemVer.compare", this.version, this.options, e), !(e instanceof vu)) {
        if (typeof e == "string" && e === this.version) return 0;
        e = new vu(e, this.options)
      }
      return e.version === this.version ? 0 : this.compareMain(e) || this.comparePre(e)
    }
    compareMain(e) {
      return e instanceof vu || (e = new vu(e, this.options)), vm(this.major, e.major) || vm(this.minor, e.minor) || vm(this.patch, e.patch)
    }
    comparePre(e) {
      if (e instanceof vu || (e = new vu(e, this.options)), this.prerelease.length && !e.prerelease.length) return -1;
      if (!this.prerelease.length && e.prerelease.length) return 1;
      if (!this.prerelease.length && !e.prerelease.length) return 0;
      let r = 0;
      do {
        const n = this.prerelease[r],
          i = e.prerelease[r];
        if (f8("prerelease compare", r, n, i), n === void 0 && i === void 0) return 0;
        if (i === void 0) return 1;
        if (n === void 0) return -1;
        if (n === i) continue;
        return vm(n, i)
      } while (++r)
    }
    compareBuild(e) {
      e instanceof vu || (e = new vu(e, this.options));
      let r = 0;
      do {
        const n = this.build[r],
          i = e.build[r];
        if (f8("build compare", r, n, i), n === void 0 && i === void 0) return 0;
        if (i === void 0) return 1;
        if (n === void 0) return -1;
        if (n === i) continue;
        return vm(n, i)
      } while (++r)
    }
    inc(e, r, n) {
      switch (e) {
        case "premajor":
          this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", r, n);
          break;
        case "preminor":
          this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", r, n);
          break;
        case "prepatch":
          this.prerelease.length = 0, this.inc("patch", r, n), this.inc("pre", r, n);
          break;
        case "prerelease":
          this.prerelease.length === 0 && this.inc("patch", r, n), this.inc("pre", r, n);
          break;
        case "major":
          (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) && this.major++, this.minor = 0, this.patch = 0, this.prerelease = [];
          break;
        case "minor":
          (this.patch !== 0 || this.prerelease.length === 0) && this.minor++, this.patch = 0, this.prerelease = [];
          break;
        case "patch":
          this.prerelease.length === 0 && this.patch++, this.prerelease = [];
          break;
        case "pre": {
          const i = Number(n) ? 1 : 0;
          if (!r && n === !1) throw new Error("invalid increment argument: identifier is empty");
          if (this.prerelease.length === 0) this.prerelease = [i];
          else {
            let s = this.prerelease.length;
            for (; --s >= 0;) typeof this.prerelease[s] == "number" && (this.prerelease[s]++, s = -2);
            if (s === -1) {
              if (r === this.prerelease.join(".") && n === !1) throw new Error("invalid increment argument: identifier already exists");
              this.prerelease.push(i)
            }
          }
          if (r) {
            let s = [r, i];
            n === !1 && (s = [r]), vm(this.prerelease[0], r) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = s) : this.prerelease = s
          }
          break
        }
        default:
          throw new Error(`invalid increment argument: ${e}`)
      }
      return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this
    }
  };
  const eq = Hs;
  var bm = (t, e, r = !1) => {
    if (t instanceof eq) return t;
    try {
      return new eq(t, e)
    } catch (n) {
      if (!r) return null;
      throw n
    }
  };
  const xSe = bm;
  var CSe = (t, e) => {
    const r = xSe(t, e);
    return r ? r.version : null
  };
  const ESe = bm;
  var ASe = (t, e) => {
    const r = ESe(t.trim().replace(/^[=v]+/, ""), e);
    return r ? r.version : null
  };
  const tq = Hs;
  var SSe = (t, e, r, n, i) => {
    typeof r == "string" && (i = n, n = r, r = void 0);
    try {
      return new tq(t instanceof tq ? t.version : t, r).inc(e, n, i).version
    } catch {
      return null
    }
  };
  const rq = bm;
  var ISe = (t, e) => {
    const r = rq(t, null, !0),
      n = rq(e, null, !0),
      i = r.compare(n);
    if (i === 0) return null;
    const s = i > 0,
      o = s ? r : n,
      a = s ? n : r,
      c = !!o.prerelease.length;
    if (!!a.prerelease.length && !c) return !a.patch && !a.minor ? "major" : o.patch ? "patch" : o.minor ? "minor" : "major";
    const h = c ? "pre" : "";
    return r.major !== n.major ? h + "major" : r.minor !== n.minor ? h + "minor" : r.patch !== n.patch ? h + "patch" : "prerelease"
  };
  const TSe = Hs;
  var kSe = (t, e) => new TSe(t, e).major;
  const RSe = Hs;
  var NSe = (t, e) => new RSe(t, e).minor;
  const MSe = Hs;
  var PSe = (t, e) => new MSe(t, e).patch;
  const $Se = bm;
  var OSe = (t, e) => {
    const r = $Se(t, e);
    return r && r.prerelease.length ? r.prerelease : null
  };
  const nq = Hs;
  var Bc = (t, e, r) => new nq(t, r).compare(new nq(e, r));
  const DSe = Bc;
  var LSe = (t, e, r) => DSe(e, t, r);
  const BSe = Bc;
  var USe = (t, e) => BSe(t, e, !0);
  const iq = Hs;
  var YS = (t, e, r) => {
    const n = new iq(t, r),
      i = new iq(e, r);
    return n.compare(i) || n.compareBuild(i)
  };
  const jSe = YS;
  var FSe = (t, e) => t.sort((r, n) => jSe(r, n, e));
  const WSe = YS;
  var zSe = (t, e) => t.sort((r, n) => WSe(n, r, e));
  const HSe = Bc;
  var g8 = (t, e, r) => HSe(t, e, r) > 0;
  const qSe = Bc;
  var QS = (t, e, r) => qSe(t, e, r) < 0;
  const VSe = Bc;
  var sq = (t, e, r) => VSe(t, e, r) === 0;
  const KSe = Bc;
  var oq = (t, e, r) => KSe(t, e, r) !== 0;
  const GSe = Bc;
  var JS = (t, e, r) => GSe(t, e, r) >= 0;
  const ZSe = Bc;
  var XS = (t, e, r) => ZSe(t, e, r) <= 0;
  const YSe = sq,
    QSe = oq,
    JSe = g8,
    XSe = JS,
    eIe = QS,
    tIe = XS;
  var aq = (t, e, r, n) => {
    switch (e) {
      case "===":
        return typeof t == "object" && (t = t.version), typeof r == "object" && (r = r.version), t === r;
      case "!==":
        return typeof t == "object" && (t = t.version), typeof r == "object" && (r = r.version), t !== r;
      case "":
      case "=":
      case "==":
        return YSe(t, r, n);
      case "!=":
        return QSe(t, r, n);
      case ">":
        return JSe(t, r, n);
      case ">=":
        return XSe(t, r, n);
      case "<":
        return eIe(t, r, n);
      case "<=":
        return tIe(t, r, n);
      default:
        throw new TypeError(`Invalid operator: ${e}`)
    }
  };
  const rIe = Hs,
    nIe = bm,
    {
      safeRe: m8,
      t: w8
    } = Wb;
  var iIe = (t, e) => {
    if (t instanceof rIe) return t;
    if (typeof t == "number" && (t = String(t)), typeof t != "string") return null;
    e = e || {};
    let r = null;
    if (!e.rtl) r = t.match(e.includePrerelease ? m8[w8.COERCEFULL] : m8[w8.COERCE]);
    else {
      const c = e.includePrerelease ? m8[w8.COERCERTLFULL] : m8[w8.COERCERTL];
      let l;
      for (;
        (l = c.exec(t)) && (!r || r.index + r[0].length !== t.length);)(!r || l.index + l[0].length !== r.index + r[0].length) && (r = l), c.lastIndex = l.index + l[1].length + l[2].length;
      c.lastIndex = -1
    }
    if (r === null) return null;
    const n = r[2],
      i = r[3] || "0",
      s = r[4] || "0",
      o = e.includePrerelease && r[5] ? `-${r[5]}` : "",
      a = e.includePrerelease && r[6] ? `+${r[6]}` : "";
    return nIe(`${n}.${i}.${s}${o}${a}`, e)
  };
  class sIe {
    constructor() {
      this.max = 1e3, this.map = new Map
    }
    get(e) {
      const r = this.map.get(e);
      if (r !== void 0) return this.map.delete(e), this.map.set(e, r), r
    }
    delete(e) {
      return this.map.delete(e)
    }
    set(e, r) {
      if (!this.delete(e) && r !== void 0) {
        if (this.map.size >= this.max) {
          const i = this.map.keys().next().value;
          this.delete(i)
        }
        this.map.set(e, r)
      }
      return this
    }
  }
  var oIe = sIe,
    eI, cq;

  function Uc() {
    if (cq) return eI;
    cq = 1;
    const t = /\s+/g;
    class e {
      constructor(p, v) {
        if (v = i(v), p instanceof e) return p.loose === !!v.loose && p.includePrerelease === !!v.includePrerelease ? p : new e(p.raw, v);
        if (p instanceof s) return this.raw = p.value, this.set = [
          [p]
        ], this.formatted = void 0, this;
        if (this.options = v, this.loose = !!v.loose, this.includePrerelease = !!v.includePrerelease, this.raw = p.trim().replace(t, " "), this.set = this.raw.split("||").map(x => this.parseRange(x.trim())).filter(x => x.length), !this.set.length) throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
        if (this.set.length > 1) {
          const x = this.set[0];
          if (this.set = this.set.filter(E => !M(E[0])), this.set.length === 0) this.set = [x];
          else if (this.set.length > 1) {
            for (const E of this.set)
              if (E.length === 1 && N(E[0])) {
                this.set = [E];
                break
              }
          }
        }
        this.formatted = void 0
      }
      get range() {
        if (this.formatted === void 0) {
          this.formatted = "";
          for (let p = 0; p < this.set.length; p++) {
            p > 0 && (this.formatted += "||");
            const v = this.set[p];
            for (let x = 0; x < v.length; x++) x > 0 && (this.formatted += " "), this.formatted += v[x].toString().trim()
          }
        }
        return this.formatted
      }
      format() {
        return this.range
      }
      toString() {
        return this.range
      }
      parseRange(p) {
        const x = ((this.options.includePrerelease && b) | (this.options.loose && C)) + ":" + p,
          E = n.get(x);
        if (E) return E;
        const S = this.options.loose,
          _ = S ? c[l.HYPHENRANGELOOSE] : c[l.HYPHENRANGE];
        p = p.replace(_, I(this.options.includePrerelease)), o("hyphen replace", p), p = p.replace(c[l.COMPARATORTRIM], h), o("comparator trim", p), p = p.replace(c[l.TILDETRIM], f), o("tilde trim", p), p = p.replace(c[l.CARETTRIM], w), o("caret trim", p);
        let y = p.split(" ").map(W => k(W, this.options)).join(" ").split(/\s+/).map(W => U(W, this.options));
        S && (y = y.filter(W => (o("loose invalid filter", W, this.options), !!W.match(c[l.COMPARATORLOOSE])))), o("range list", y);
        const A = new Map,
          G = y.map(W => new s(W, this.options));
        for (const W of G) {
          if (M(W)) return [W];
          A.set(W.value, W)
        }
        A.size > 1 && A.has("") && A.delete("");
        const ce = [...A.values()];
        return n.set(x, ce), ce
      }
      intersects(p, v) {
        if (!(p instanceof e)) throw new TypeError("a Range is required");
        return this.set.some(x => $(x, v) && p.set.some(E => $(E, v) && x.every(S => E.every(_ => S.intersects(_, v)))))
      }
      test(p) {
        if (!p) return !1;
        if (typeof p == "string") try {
          p = new a(p, this.options)
        } catch {
          return !1
        }
        for (let v = 0; v < this.set.length; v++)
          if (g(this.set[v], p, this.options)) return !0;
        return !1
      }
    }
    eI = e;
    const r = oIe,
      n = new r,
      i = ZS,
      s = v8(),
      o = h8,
      a = Hs,
      {
        safeRe: c,
        t: l,
        comparatorTrimReplace: h,
        tildeTrimReplace: f,
        caretTrimReplace: w
      } = Wb,
      {
        FLAG_INCLUDE_PRERELEASE: b,
        FLAG_LOOSE: C
      } = d8,
      M = u => u.value === "<0.0.0-0",
      N = u => u.value === "",
      $ = (u, p) => {
        let v = !0;
        const x = u.slice();
        let E = x.pop();
        for (; v && x.length;) v = x.every(S => E.intersects(S, p)), E = x.pop();
        return v
      },
      k = (u, p) => (o("comp", u, p), u = V(u, p), o("caret", u), u = F(u, p), o("tildes", u), u = P(u, p), o("xrange", u), u = Y(u, p), o("stars", u), u),
      B = u => !u || u.toLowerCase() === "x" || u === "*",
      F = (u, p) => u.trim().split(/\s+/).map(v => D(v, p)).join(" "),
      D = (u, p) => {
        const v = p.loose ? c[l.TILDELOOSE] : c[l.TILDE];
        return u.replace(v, (x, E, S, _, y) => {
          o("tilde", u, x, E, S, _, y);
          let A;
          return B(E) ? A = "" : B(S) ? A = `>=${E}.0.0 <${+E+1}.0.0-0` : B(_) ? A = `>=${E}.${S}.0 <${E}.${+S+1}.0-0` : y ? (o("replaceTilde pr", y), A = `>=${E}.${S}.${_}-${y} <${E}.${+S+1}.0-0`) : A = `>=${E}.${S}.${_} <${E}.${+S+1}.0-0`, o("tilde return", A), A
        })
      },
      V = (u, p) => u.trim().split(/\s+/).map(v => R(v, p)).join(" "),
      R = (u, p) => {
        o("caret", u, p);
        const v = p.loose ? c[l.CARETLOOSE] : c[l.CARET],
          x = p.includePrerelease ? "-0" : "";
        return u.replace(v, (E, S, _, y, A) => {
          o("caret", u, E, S, _, y, A);
          let G;
          return B(S) ? G = "" : B(_) ? G = `>=${S}.0.0${x} <${+S+1}.0.0-0` : B(y) ? S === "0" ? G = `>=${S}.${_}.0${x} <${S}.${+_+1}.0-0` : G = `>=${S}.${_}.0${x} <${+S+1}.0.0-0` : A ? (o("replaceCaret pr", A), S === "0" ? _ === "0" ? G = `>=${S}.${_}.${y}-${A} <${S}.${_}.${+y+1}-0` : G = `>=${S}.${_}.${y}-${A} <${S}.${+_+1}.0-0` : G = `>=${S}.${_}.${y}-${A} <${+S+1}.0.0-0`) : (o("no pr"), S === "0" ? _ === "0" ? G = `>=${S}.${_}.${y}${x} <${S}.${_}.${+y+1}-0` : G = `>=${S}.${_}.${y}${x} <${S}.${+_+1}.0-0` : G = `>=${S}.${_}.${y} <${+S+1}.0.0-0`), o("caret return", G), G
        })
      },
      P = (u, p) => (o("replaceXRanges", u, p), u.split(/\s+/).map(v => j(v, p)).join(" ")),
      j = (u, p) => {
        u = u.trim();
        const v = p.loose ? c[l.XRANGELOOSE] : c[l.XRANGE];
        return u.replace(v, (x, E, S, _, y, A) => {
          o("xRange", u, x, E, S, _, y, A);
          const G = B(S),
            ce = G || B(_),
            W = ce || B(y),
            X = W;
          return E === "=" && X && (E = ""), A = p.includePrerelease ? "-0" : "", G ? E === ">" || E === "<" ? x = "<0.0.0-0" : x = "*" : E && X ? (ce && (_ = 0), y = 0, E === ">" ? (E = ">=", ce ? (S = +S + 1, _ = 0, y = 0) : (_ = +_ + 1, y = 0)) : E === "<=" && (E = "<", ce ? S = +S + 1 : _ = +_ + 1), E === "<" && (A = "-0"), x = `${E+S}.${_}.${y}${A}`) : ce ? x = `>=${S}.0.0${A} <${+S+1}.0.0-0` : W && (x = `>=${S}.${_}.0${A} <${S}.${+_+1}.0-0`), o("xRange return", x), x
        })
      },
      Y = (u, p) => (o("replaceStars", u, p), u.trim().replace(c[l.STAR], "")),
      U = (u, p) => (o("replaceGTE0", u, p), u.trim().replace(c[p.includePrerelease ? l.GTE0PRE : l.GTE0], "")),
      I = u => (p, v, x, E, S, _, y, A, G, ce, W, X) => (B(x) ? v = "" : B(E) ? v = `>=${x}.0.0${u?"-0":""}` : B(S) ? v = `>=${x}.${E}.0${u?"-0":""}` : _ ? v = `>=${v}` : v = `>=${v}${u?"-0":""}`, B(G) ? A = "" : B(ce) ? A = `<${+G+1}.0.0-0` : B(W) ? A = `<${G}.${+ce+1}.0-0` : X ? A = `<=${G}.${ce}.${W}-${X}` : u ? A = `<${G}.${ce}.${+W+1}-0` : A = `<=${A}`, `${v} ${A}`.trim()),
      g = (u, p, v) => {
        for (let x = 0; x < u.length; x++)
          if (!u[x].test(p)) return !1;
        if (p.prerelease.length && !v.includePrerelease) {
          for (let x = 0; x < u.length; x++)
            if (o(u[x].semver), u[x].semver !== s.ANY && u[x].semver.prerelease.length > 0) {
              const E = u[x].semver;
              if (E.major === p.major && E.minor === p.minor && E.patch === p.patch) return !0
            } return !1
        }
        return !0
      };
    return eI
  }
  var tI, lq;

  function v8() {
    if (lq) return tI;
    lq = 1;
    const t = Symbol("SemVer ANY");
    class e {
      static get ANY() {
        return t
      }
      constructor(h, f) {
        if (f = r(f), h instanceof e) {
          if (h.loose === !!f.loose) return h;
          h = h.value
        }
        h = h.trim().split(/\s+/).join(" "), o("comparator", h, f), this.options = f, this.loose = !!f.loose, this.parse(h), this.semver === t ? this.value = "" : this.value = this.operator + this.semver.version, o("comp", this)
      }
      parse(h) {
        const f = this.options.loose ? n[i.COMPARATORLOOSE] : n[i.COMPARATOR],
          w = h.match(f);
        if (!w) throw new TypeError(`Invalid comparator: ${h}`);
        this.operator = w[1] !== void 0 ? w[1] : "", this.operator === "=" && (this.operator = ""), w[2] ? this.semver = new a(w[2], this.options.loose) : this.semver = t
      }
      toString() {
        return this.value
      }
      test(h) {
        if (o("Comparator.test", h, this.options.loose), this.semver === t || h === t) return !0;
        if (typeof h == "string") try {
          h = new a(h, this.options)
        } catch {
          return !1
        }
        return s(h, this.operator, this.semver, this.options)
      }
      intersects(h, f) {
        if (!(h instanceof e)) throw new TypeError("a Comparator is required");
        return this.operator === "" ? this.value === "" ? !0 : new c(h.value, f).test(this.value) : h.operator === "" ? h.value === "" ? !0 : new c(this.value, f).test(h.semver) : (f = r(f), f.includePrerelease && (this.value === "<0.0.0-0" || h.value === "<0.0.0-0") || !f.includePrerelease && (this.value.startsWith("<0.0.0") || h.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && h.operator.startsWith(">") || this.operator.startsWith("<") && h.operator.startsWith("<") || this.semver.version === h.semver.version && this.operator.includes("=") && h.operator.includes("=") || s(this.semver, "<", h.semver, f) && this.operator.startsWith(">") && h.operator.startsWith("<") || s(this.semver, ">", h.semver, f) && this.operator.startsWith("<") && h.operator.startsWith(">")))
      }
    }
    tI = e;
    const r = ZS,
      {
        safeRe: n,
        t: i
      } = Wb,
      s = aq,
      o = h8,
      a = Hs,
      c = Uc();
    return tI
  }
  const aIe = Uc();
  var b8 = (t, e, r) => {
    try {
      e = new aIe(e, r)
    } catch {
      return !1
    }
    return e.test(t)
  };
  const cIe = Uc();
  var lIe = (t, e) => new cIe(t, e).set.map(r => r.map(n => n.value).join(" ").trim().split(" "));
  const uIe = Hs,
    dIe = Uc();
  var hIe = (t, e, r) => {
    let n = null,
      i = null,
      s = null;
    try {
      s = new dIe(e, r)
    } catch {
      return null
    }
    return t.forEach(o => {
      s.test(o) && (!n || i.compare(o) === -1) && (n = o, i = new uIe(n, r))
    }), n
  };
  const fIe = Hs,
    pIe = Uc();
  var gIe = (t, e, r) => {
    let n = null,
      i = null,
      s = null;
    try {
      s = new pIe(e, r)
    } catch {
      return null
    }
    return t.forEach(o => {
      s.test(o) && (!n || i.compare(o) === 1) && (n = o, i = new fIe(n, r))
    }), n
  };
  const rI = Hs,
    mIe = Uc(),
    uq = g8;
  var wIe = (t, e) => {
    t = new mIe(t, e);
    let r = new rI("0.0.0");
    if (t.test(r) || (r = new rI("0.0.0-0"), t.test(r))) return r;
    r = null;
    for (let n = 0; n < t.set.length; ++n) {
      const i = t.set[n];
      let s = null;
      i.forEach(o => {
        const a = new rI(o.semver.version);
        switch (o.operator) {
          case ">":
            a.prerelease.length === 0 ? a.patch++ : a.prerelease.push(0), a.raw = a.format();
          case "":
          case ">=":
            (!s || uq(a, s)) && (s = a);
            break;
          case "<":
          case "<=":
            break;
          default:
            throw new Error(`Unexpected operation: ${o.operator}`)
        }
      }), s && (!r || uq(r, s)) && (r = s)
    }
    return r && t.test(r) ? r : null
  };
  const vIe = Uc();
  var bIe = (t, e) => {
    try {
      return new vIe(t, e).range || "*"
    } catch {
      return null
    }
  };
  const yIe = Hs,
    dq = v8(),
    {
      ANY: _Ie
    } = dq,
    xIe = Uc(),
    CIe = b8,
    hq = g8,
    fq = QS,
    EIe = XS,
    AIe = JS;
  var nI = (t, e, r, n) => {
    t = new yIe(t, n), e = new xIe(e, n);
    let i, s, o, a, c;
    switch (r) {
      case ">":
        i = hq, s = EIe, o = fq, a = ">", c = ">=";
        break;
      case "<":
        i = fq, s = AIe, o = hq, a = "<", c = "<=";
        break;
      default:
        throw new TypeError('Must provide a hilo val of "<" or ">"')
    }
    if (CIe(t, e, n)) return !1;
    for (let l = 0; l < e.set.length; ++l) {
      const h = e.set[l];
      let f = null,
        w = null;
      if (h.forEach(b => {
          b.semver === _Ie && (b = new dq(">=0.0.0")), f = f || b, w = w || b, i(b.semver, f.semver, n) ? f = b : o(b.semver, w.semver, n) && (w = b)
        }), f.operator === a || f.operator === c || (!w.operator || w.operator === a) && s(t, w.semver)) return !1;
      if (w.operator === c && o(t, w.semver)) return !1
    }
    return !0
  };
  const SIe = nI;
  var IIe = (t, e, r) => SIe(t, e, ">", r);
  const TIe = nI;
  var kIe = (t, e, r) => TIe(t, e, "<", r);
  const pq = Uc();
  var RIe = (t, e, r) => (t = new pq(t, r), e = new pq(e, r), t.intersects(e, r));
  const NIe = b8,
    MIe = Bc;
  var PIe = (t, e, r) => {
    const n = [];
    let i = null,
      s = null;
    const o = t.sort((h, f) => MIe(h, f, r));
    for (const h of o) NIe(h, e, r) ? (s = h, i || (i = h)) : (s && n.push([i, s]), s = null, i = null);
    i && n.push([i, null]);
    const a = [];
    for (const [h, f] of n) h === f ? a.push(h) : !f && h === o[0] ? a.push("*") : f ? h === o[0] ? a.push(`<=${f}`) : a.push(`${h} - ${f}`) : a.push(`>=${h}`);
    const c = a.join(" || "),
      l = typeof e.raw == "string" ? e.raw : String(e);
    return c.length < l.length ? c : e
  };
  const gq = Uc(),
    iI = v8(),
    {
      ANY: sI
    } = iI,
    zb = b8,
    oI = Bc,
    $Ie = (t, e, r = {}) => {
      if (t === e) return !0;
      t = new gq(t, r), e = new gq(e, r);
      let n = !1;
      e: for (const i of t.set) {
        for (const s of e.set) {
          const o = DIe(i, s, r);
          if (n = n || o !== null, o) continue e
        }
        if (n) return !1
      }
      return !0
    },
    OIe = [new iI(">=0.0.0-0")],
    mq = [new iI(">=0.0.0")],
    DIe = (t, e, r) => {
      if (t === e) return !0;
      if (t.length === 1 && t[0].semver === sI) {
        if (e.length === 1 && e[0].semver === sI) return !0;
        r.includePrerelease ? t = OIe : t = mq
      }
      if (e.length === 1 && e[0].semver === sI) {
        if (r.includePrerelease) return !0;
        e = mq
      }
      const n = new Set;
      let i, s;
      for (const b of t) b.operator === ">" || b.operator === ">=" ? i = wq(i, b, r) : b.operator === "<" || b.operator === "<=" ? s = vq(s, b, r) : n.add(b.semver);
      if (n.size > 1) return null;
      let o;
      if (i && s) {
        if (o = oI(i.semver, s.semver, r), o > 0) return null;
        if (o === 0 && (i.operator !== ">=" || s.operator !== "<=")) return null
      }
      for (const b of n) {
        if (i && !zb(b, String(i), r) || s && !zb(b, String(s), r)) return null;
        for (const C of e)
          if (!zb(b, String(C), r)) return !1;
        return !0
      }
      let a, c, l, h, f = s && !r.includePrerelease && s.semver.prerelease.length ? s.semver : !1,
        w = i && !r.includePrerelease && i.semver.prerelease.length ? i.semver : !1;
      f && f.prerelease.length === 1 && s.operator === "<" && f.prerelease[0] === 0 && (f = !1);
      for (const b of e) {
        if (h = h || b.operator === ">" || b.operator === ">=", l = l || b.operator === "<" || b.operator === "<=", i) {
          if (w && b.semver.prerelease && b.semver.prerelease.length && b.semver.major === w.major && b.semver.minor === w.minor && b.semver.patch === w.patch && (w = !1), b.operator === ">" || b.operator === ">=") {
            if (a = wq(i, b, r), a === b && a !== i) return !1
          } else if (i.operator === ">=" && !zb(i.semver, String(b), r)) return !1
        }
        if (s) {
          if (f && b.semver.prerelease && b.semver.prerelease.length && b.semver.major === f.major && b.semver.minor === f.minor && b.semver.patch === f.patch && (f = !1), b.operator === "<" || b.operator === "<=") {
            if (c = vq(s, b, r), c === b && c !== s) return !1
          } else if (s.operator === "<=" && !zb(s.semver, String(b), r)) return !1
        }
        if (!b.operator && (s || i) && o !== 0) return !1
      }
      return !(i && l && !s && o !== 0 || s && h && !i && o !== 0 || w || f)
    },
    wq = (t, e, r) => {
      if (!t) return e;
      const n = oI(t.semver, e.semver, r);
      return n > 0 ? t : n < 0 || e.operator === ">" && t.operator === ">=" ? e : t
    },
    vq = (t, e, r) => {
      if (!t) return e;
      const n = oI(t.semver, e.semver, r);
      return n < 0 ? t : n > 0 || e.operator === "<" && t.operator === "<=" ? e : t
    };
  var LIe = $Ie;
  const aI = Wb,
    bq = d8,
    BIe = Hs,
    yq = YH,
    UIe = bm,
    jIe = CSe,
    FIe = ASe,
    WIe = SSe,
    zIe = ISe,
    HIe = kSe,
    qIe = NSe,
    VIe = PSe,
    KIe = OSe,
    GIe = Bc,
    ZIe = LSe,
    YIe = USe,
    QIe = YS,
    JIe = FSe,
    XIe = zSe,
    eTe = g8,
    tTe = QS,
    rTe = sq,
    nTe = oq,
    iTe = JS,
    sTe = XS,
    oTe = aq,
    aTe = iIe,
    cTe = v8(),
    lTe = Uc();
  var uTe = {
    parse: UIe,
    valid: jIe,
    clean: FIe,
    inc: WIe,
    diff: zIe,
    major: HIe,
    minor: qIe,
    patch: VIe,
    prerelease: KIe,
    compare: GIe,
    rcompare: ZIe,
    compareLoose: YIe,
    compareBuild: QIe,
    sort: JIe,
    rsort: XIe,
    gt: eTe,
    lt: tTe,
    eq: rTe,
    neq: nTe,
    gte: iTe,
    lte: sTe,
    cmp: oTe,
    coerce: aTe,
    Comparator: cTe,
    Range: lTe,
    satisfies: b8,
    toComparators: lIe,
    maxSatisfying: hIe,
    minSatisfying: gIe,
    minVersion: wIe,
    validRange: bIe,
    outside: nI,
    gtr: IIe,
    ltr: kIe,
    intersects: RIe,
    simplifyRange: PIe,
    subset: LIe,
    SemVer: BIe,
    re: aI.re,
    src: aI.src,
    tokens: aI.t,
    SEMVER_SPEC_VERSION: bq.SEMVER_SPEC_VERSION,
    RELEASE_TYPES: bq.RELEASE_TYPES,
    compareIdentifiers: yq.compareIdentifiers,
    rcompareIdentifiers: yq.rcompareIdentifiers
  };
  (function (t) {
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.satisfiesVersionRange = t.gtRange = t.gtVersion = t.assertIsSemVerRange = t.assertIsSemVerVersion = t.isValidSemVerRange = t.isValidSemVerVersion = t.VersionRangeStruct = t.VersionStruct = void 0;
    const e = uTe,
      r = pp,
      n = hs;
    t.VersionStruct = (0, r.refine)((0, r.string)(), "Version", f => (0, e.valid)(f) === null ? `Expected SemVer version, got "${f}"` : !0), t.VersionRangeStruct = (0, r.refine)((0, r.string)(), "Version range", f => (0, e.validRange)(f) === null ? `Expected SemVer range, got "${f}"` : !0);

    function i(f) {
      return (0, r.is)(f, t.VersionStruct)
    }
    t.isValidSemVerVersion = i;

    function s(f) {
      return (0, r.is)(f, t.VersionRangeStruct)
    }
    t.isValidSemVerRange = s;

    function o(f) {
      (0, n.assertStruct)(f, t.VersionStruct)
    }
    t.assertIsSemVerVersion = o;

    function a(f) {
      (0, n.assertStruct)(f, t.VersionRangeStruct)
    }
    t.assertIsSemVerRange = a;

    function c(f, w) {
      return (0, e.gt)(f, w)
    }
    t.gtVersion = c;

    function l(f, w) {
      return (0, e.gtr)(f, w)
    }
    t.gtRange = l;

    function h(f, w) {
      return (0, e.satisfies)(f, w, {
        includePrerelease: !0
      })
    }
    t.satisfiesVersionRange = h
  })(VH),
  function (t) {
    var e = ot && ot.__createBinding || (Object.create ? function (n, i, s, o) {
        o === void 0 && (o = s);
        var a = Object.getOwnPropertyDescriptor(i, s);
        (!a || ("get" in a ? !i.__esModule : a.writable || a.configurable)) && (a = {
          enumerable: !0,
          get: function () {
            return i[s]
          }
        }), Object.defineProperty(n, o, a)
      } : function (n, i, s, o) {
        o === void 0 && (o = s), n[o] = i[s]
      }),
      r = ot && ot.__exportStar || function (n, i) {
        for (var s in n) s !== "default" && !Object.prototype.hasOwnProperty.call(i, s) && e(i, n, s)
      };
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), r(hs, t), r(Ub, t), r(zr, t), r(l8, t), r(su, t), r(gm, t), r(BH, t), r(jb, t), r(UH, t), r(jH, t), r(mm, t), r(WH, t), r(au, t), r(zH, t), r(HH, t), r(qH, t), r(VH, t)
  }(pH),
  function (t) {
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.createModuleLogger = t.projectLogger = void 0;
    const e = pH;
    Object.defineProperty(t, "createModuleLogger", {
      enumerable: !0,
      get: function () {
        return e.createModuleLogger
      }
    }), t.projectLogger = (0, e.createProjectLogger)("eth-block-tracker")
  }(fH);
  var _q = ot && ot.__importDefault || function (t) {
    return t && t.__esModule ? t : {
      default: t
    }
  };
  Object.defineProperty(a8, "__esModule", {
    value: !0
  }), a8.PollingBlockTracker = void 0;
  const dTe = _q($S),
    hTe = _q(OEe),
    fTe = Ob,
    xq = fH,
    Cq = (0, xq.createModuleLogger)(xq.projectLogger, "polling-block-tracker"),
    pTe = (0, dTe.default)(),
    gTe = 1e3;
  class mTe extends fTe.BaseBlockTracker {
    constructor(e = {}) {
      var r;
      if (!e.provider) throw new Error("PollingBlockTracker - no provider specified.");
      super(Object.assign(Object.assign({}, e), {
        blockResetDuration: (r = e.blockResetDuration) !== null && r !== void 0 ? r : e.pollingInterval
      })), this._provider = e.provider, this._pollingInterval = e.pollingInterval || 20 * gTe, this._retryTimeout = e.retryTimeout || this._pollingInterval / 10, this._keepEventLoopActive = e.keepEventLoopActive === void 0 ? !0 : e.keepEventLoopActive, this._setSkipCacheFlag = e.setSkipCacheFlag || !1
    }
    async checkForLatestBlock() {
      return await this._updateLatestBlock(), await this.getLatestBlock()
    }
    async _start() {
      this._synchronize()
    }
    async _end() {}
    async _synchronize() {
      for (var e; this._isRunning;) try {
        await this._updateLatestBlock();
        const r = Eq(this._pollingInterval, !this._keepEventLoopActive);
        this.emit("_waitingForNextIteration"), await r
      } catch (r) {
        const n = new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
  ${(e=r.stack)!==null&&e!==void 0?e:r}`);
        try {
          this.emit("error", n)
        } catch {
          console.error(n)
        }
        const i = Eq(this._retryTimeout, !this._keepEventLoopActive);
        this.emit("_waitingForNextIteration"), await i
      }
    }
    async _updateLatestBlock() {
      const e = await this._fetchLatestBlock();
      this._newPotentialLatest(e)
    }
    async _fetchLatestBlock() {
      const e = {
        jsonrpc: "2.0",
        id: pTe(),
        method: "eth_blockNumber",
        params: []
      };
      this._setSkipCacheFlag && (e.skipCache = !0), Cq("Making request", e);
      const r = await (0, hTe.default)(n => this._provider.sendAsync(e, n))();
      if (Cq("Got response", r), r.error) throw new Error(`PollingBlockTracker - encountered error fetching block:
  ${r.error.message}`);
      return r.result
    }
  }
  a8.PollingBlockTracker = mTe;

  function Eq(t, e) {
    return new Promise(r => {
      const n = setTimeout(r, t);
      n.unref && e && n.unref()
    })
  }
  var y8 = {},
    wTe = ot && ot.__importDefault || function (t) {
      return t && t.__esModule ? t : {
        default: t
      }
    };
  Object.defineProperty(y8, "__esModule", {
    value: !0
  }), y8.SubscribeBlockTracker = void 0;
  const vTe = wTe($S),
    bTe = Ob,
    yTe = (0, vTe.default)();
  class _Te extends bTe.BaseBlockTracker {
    constructor(e = {}) {
      if (!e.provider) throw new Error("SubscribeBlockTracker - no provider specified.");
      super(e), this._provider = e.provider, this._subscriptionId = null
    }
    async checkForLatestBlock() {
      return await this.getLatestBlock()
    }
    async _start() {
      if (this._subscriptionId === void 0 || this._subscriptionId === null) try {
        const e = await this._call("eth_blockNumber");
        this._subscriptionId = await this._call("eth_subscribe", "newHeads"), this._provider.on("data", this._handleSubData.bind(this)), this._newPotentialLatest(e)
      } catch (e) {
        this.emit("error", e)
      }
    }
    async _end() {
      if (this._subscriptionId !== null && this._subscriptionId !== void 0) try {
        await this._call("eth_unsubscribe", this._subscriptionId), this._subscriptionId = null
      } catch (e) {
        this.emit("error", e)
      }
    }
    _call(e, ...r) {
      return new Promise((n, i) => {
        this._provider.sendAsync({
          id: yTe(),
          method: e,
          params: r,
          jsonrpc: "2.0"
        }, (s, o) => {
          s ? i(s) : n(o.result)
        })
      })
    }
    _handleSubData(e, r) {
      var n;
      r.method === "eth_subscription" && ((n = r.params) === null || n === void 0 ? void 0 : n.subscription) === this._subscriptionId && this._newPotentialLatest(r.params.result.number)
    }
  }
  y8.SubscribeBlockTracker = _Te,
    function (t) {
      var e = ot && ot.__createBinding || (Object.create ? function (n, i, s, o) {
          o === void 0 && (o = s), Object.defineProperty(n, o, {
            enumerable: !0,
            get: function () {
              return i[s]
            }
          })
        } : function (n, i, s, o) {
          o === void 0 && (o = s), n[o] = i[s]
        }),
        r = ot && ot.__exportStar || function (n, i) {
          for (var s in n) s !== "default" && !Object.prototype.hasOwnProperty.call(i, s) && e(i, n, s)
        };
      Object.defineProperty(t, "__esModule", {
        value: !0
      }), r(a8, t), r(y8, t)
    }(cH);
  var cI = {},
    _8 = {},
    Hb = {};
  Object.defineProperty(Hb, "__esModule", {
    value: !0
  }), Hb.getUniqueId = void 0;
  const Aq = 4294967295;
  let lI = Math.floor(Math.random() * Aq);

  function xTe() {
    return lI = (lI + 1) % Aq, lI
  }
  Hb.getUniqueId = xTe, Object.defineProperty(_8, "__esModule", {
    value: !0
  }), _8.createIdRemapMiddleware = void 0;
  const CTe = Hb;

  function ETe() {
    return (t, e, r, n) => {
      const i = t.id,
        s = CTe.getUniqueId();
      t.id = s, e.id = s, r(o => {
        t.id = i, e.id = i, o()
      })
    }
  }
  _8.createIdRemapMiddleware = ETe;
  var x8 = {};
  Object.defineProperty(x8, "__esModule", {
    value: !0
  }), x8.createAsyncMiddleware = void 0;

  function ATe(t) {
    return async (e, r, n, i) => {
      let s;
      const o = new Promise(h => {
        s = h
      });
      let a = null,
        c = !1;
      const l = async () => {
        c = !0, n(h => {
          a = h, s()
        }), await o
      };
      try {
        await t(e, r, l), c ? (await o, a(null)) : i(null)
      } catch (h) {
        a ? a(h) : i(h)
      }
    }
  }
  x8.createAsyncMiddleware = ATe;
  var C8 = {};
  Object.defineProperty(C8, "__esModule", {
    value: !0
  }), C8.createScaffoldMiddleware = void 0;

  function STe(t) {
    return (e, r, n, i) => {
      const s = t[e.method];
      return s === void 0 ? n() : typeof s == "function" ? s(e, r, n, i) : (r.result = s, i())
    }
  }
  C8.createScaffoldMiddleware = STe;
  var qb = {},
    uI = {};
  Object.defineProperty(uI, "__esModule", {
    value: !0
  });
  const ITe = Fi;

  function Sq(t, e, r) {
    try {
      Reflect.apply(t, e, r)
    } catch (n) {
      setTimeout(() => {
        throw n
      })
    }
  }

  function TTe(t) {
    const e = t.length,
      r = new Array(e);
    for (let n = 0; n < e; n += 1) r[n] = t[n];
    return r
  }
  let kTe = class extends ITe.EventEmitter {
    emit(e, ...r) {
      let n = e === "error";
      const i = this._events;
      if (i !== void 0) n = n && i.error === void 0;
      else if (!n) return !1;
      if (n) {
        let o;
        if (r.length > 0 && ([o] = r), o instanceof Error) throw o;
        const a = new Error(`Unhandled error.${o?` (${o.message})`:""}`);
        throw a.context = o, a
      }
      const s = i[e];
      if (s === void 0) return !1;
      if (typeof s == "function") Sq(s, this, r);
      else {
        const o = s.length,
          a = TTe(s);
        for (let c = 0; c < o; c += 1) Sq(a[c], this, r)
      }
      return !0
    }
  };
  uI.default = kTe;
  var Iq = {},
    Yh = {},
    RTe = Vb;
  Vb.default = Vb, Vb.stable = Rq, Vb.stableStringify = Rq;
  var E8 = "[...]",
    Tq = "[Circular]",
    gp = [],
    mp = [];

  function kq() {
    return {
      depthLimit: Number.MAX_SAFE_INTEGER,
      edgesLimit: Number.MAX_SAFE_INTEGER
    }
  }

  function Vb(t, e, r, n) {
    typeof n > "u" && (n = kq()), dI(t, "", 0, [], void 0, 0, n);
    var i;
    try {
      mp.length === 0 ? i = JSON.stringify(t, e, r) : i = JSON.stringify(t, Nq(e), r)
    } catch {
      return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")
    } finally {
      for (; gp.length !== 0;) {
        var s = gp.pop();
        s.length === 4 ? Object.defineProperty(s[0], s[1], s[3]) : s[0][s[1]] = s[2]
      }
    }
    return i
  }

  function ym(t, e, r, n) {
    var i = Object.getOwnPropertyDescriptor(n, r);
    i.get !== void 0 ? i.configurable ? (Object.defineProperty(n, r, {
      value: t
    }), gp.push([n, r, e, i])) : mp.push([e, r, t]) : (n[r] = t, gp.push([n, r, e]))
  }

  function dI(t, e, r, n, i, s, o) {
    s += 1;
    var a;
    if (typeof t == "object" && t !== null) {
      for (a = 0; a < n.length; a++)
        if (n[a] === t) {
          ym(Tq, t, e, i);
          return
        } if (typeof o.depthLimit < "u" && s > o.depthLimit) {
        ym(E8, t, e, i);
        return
      }
      if (typeof o.edgesLimit < "u" && r + 1 > o.edgesLimit) {
        ym(E8, t, e, i);
        return
      }
      if (n.push(t), Array.isArray(t))
        for (a = 0; a < t.length; a++) dI(t[a], a, a, n, t, s, o);
      else {
        var c = Object.keys(t);
        for (a = 0; a < c.length; a++) {
          var l = c[a];
          dI(t[l], l, a, n, t, s, o)
        }
      }
      n.pop()
    }
  }

  function NTe(t, e) {
    return t < e ? -1 : t > e ? 1 : 0
  }

  function Rq(t, e, r, n) {
    typeof n > "u" && (n = kq());
    var i = hI(t, "", 0, [], void 0, 0, n) || t,
      s;
    try {
      mp.length === 0 ? s = JSON.stringify(i, e, r) : s = JSON.stringify(i, Nq(e), r)
    } catch {
      return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")
    } finally {
      for (; gp.length !== 0;) {
        var o = gp.pop();
        o.length === 4 ? Object.defineProperty(o[0], o[1], o[3]) : o[0][o[1]] = o[2]
      }
    }
    return s
  }

  function hI(t, e, r, n, i, s, o) {
    s += 1;
    var a;
    if (typeof t == "object" && t !== null) {
      for (a = 0; a < n.length; a++)
        if (n[a] === t) {
          ym(Tq, t, e, i);
          return
        } try {
        if (typeof t.toJSON == "function") return
      } catch {
        return
      }
      if (typeof o.depthLimit < "u" && s > o.depthLimit) {
        ym(E8, t, e, i);
        return
      }
      if (typeof o.edgesLimit < "u" && r + 1 > o.edgesLimit) {
        ym(E8, t, e, i);
        return
      }
      if (n.push(t), Array.isArray(t))
        for (a = 0; a < t.length; a++) hI(t[a], a, a, n, t, s, o);
      else {
        var c = {},
          l = Object.keys(t).sort(NTe);
        for (a = 0; a < l.length; a++) {
          var h = l[a];
          hI(t[h], h, a, n, t, s, o), c[h] = t[h]
        }
        if (typeof i < "u") gp.push([i, e, t]), i[e] = c;
        else return c
      }
      n.pop()
    }
  }

  function Nq(t) {
    return t = typeof t < "u" ? t : function (e, r) {
        return r
      },
      function (e, r) {
        if (mp.length > 0)
          for (var n = 0; n < mp.length; n++) {
            var i = mp[n];
            if (i[1] === e && i[0] === r) {
              r = i[2], mp.splice(n, 1);
              break
            }
          }
        return t.call(this, e, r)
      }
  }
  Object.defineProperty(Yh, "__esModule", {
    value: !0
  }), Yh.EthereumProviderError = Yh.EthereumRpcError = void 0;
  const MTe = RTe;
  class Mq extends Error {
    constructor(e, r, n) {
      if (!Number.isInteger(e)) throw new Error('"code" must be an integer.');
      if (!r || typeof r != "string") throw new Error('"message" must be a nonempty string.');
      super(r), this.code = e, n !== void 0 && (this.data = n)
    }
    serialize() {
      const e = {
        code: this.code,
        message: this.message
      };
      return this.data !== void 0 && (e.data = this.data), this.stack && (e.stack = this.stack), e
    }
    toString() {
      return MTe.default(this.serialize(), OTe, 2)
    }
  }
  Yh.EthereumRpcError = Mq;
  class PTe extends Mq {
    constructor(e, r, n) {
      if (!$Te(e)) throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');
      super(e, r, n)
    }
  }
  Yh.EthereumProviderError = PTe;

  function $Te(t) {
    return Number.isInteger(t) && t >= 1e3 && t <= 4999
  }

  function OTe(t, e) {
    if (e !== "[Circular]") return e
  }
  var fI = {},
    Qh = {};
  Object.defineProperty(Qh, "__esModule", {
      value: !0
    }), Qh.errorValues = Qh.errorCodes = void 0, Qh.errorCodes = {
      rpc: {
        invalidInput: -32e3,
        resourceNotFound: -32001,
        resourceUnavailable: -32002,
        transactionRejected: -32003,
        methodNotSupported: -32004,
        limitExceeded: -32005,
        parse: -32700,
        invalidRequest: -32600,
        methodNotFound: -32601,
        invalidParams: -32602,
        internal: -32603
      },
      provider: {
        userRejectedRequest: 4001,
        unauthorized: 4100,
        unsupportedMethod: 4200,
        disconnected: 4900,
        chainDisconnected: 4901
      }
    }, Qh.errorValues = {
      "-32700": {
        standard: "JSON RPC 2.0",
        message: "Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."
      },
      "-32600": {
        standard: "JSON RPC 2.0",
        message: "The JSON sent is not a valid Request object."
      },
      "-32601": {
        standard: "JSON RPC 2.0",
        message: "The method does not exist / is not available."
      },
      "-32602": {
        standard: "JSON RPC 2.0",
        message: "Invalid method parameter(s)."
      },
      "-32603": {
        standard: "JSON RPC 2.0",
        message: "Internal JSON-RPC error."
      },
      "-32000": {
        standard: "EIP-1474",
        message: "Invalid input."
      },
      "-32001": {
        standard: "EIP-1474",
        message: "Resource not found."
      },
      "-32002": {
        standard: "EIP-1474",
        message: "Resource unavailable."
      },
      "-32003": {
        standard: "EIP-1474",
        message: "Transaction rejected."
      },
      "-32004": {
        standard: "EIP-1474",
        message: "Method not supported."
      },
      "-32005": {
        standard: "EIP-1474",
        message: "Request limit exceeded."
      },
      4001: {
        standard: "EIP-1193",
        message: "User rejected the request."
      },
      4100: {
        standard: "EIP-1193",
        message: "The requested account and/or method has not been authorized by the user."
      },
      4200: {
        standard: "EIP-1193",
        message: "The requested method is not supported by this Ethereum provider."
      },
      4900: {
        standard: "EIP-1193",
        message: "The provider is disconnected from all chains."
      },
      4901: {
        standard: "EIP-1193",
        message: "The provider is disconnected from the specified chain."
      }
    },
    function (t) {
      Object.defineProperty(t, "__esModule", {
        value: !0
      }), t.serializeError = t.isValidCode = t.getMessageFromCode = t.JSON_RPC_SERVER_ERROR_MESSAGE = void 0;
      const e = Qh,
        r = Yh,
        n = e.errorCodes.rpc.internal,
        i = "Unspecified error message. This is a bug, please report it.",
        s = {
          code: n,
          message: o(n)
        };
      t.JSON_RPC_SERVER_ERROR_MESSAGE = "Unspecified server error.";

      function o(w, b = i) {
        if (Number.isInteger(w)) {
          const C = w.toString();
          if (f(e.errorValues, C)) return e.errorValues[C].message;
          if (l(w)) return t.JSON_RPC_SERVER_ERROR_MESSAGE
        }
        return b
      }
      t.getMessageFromCode = o;

      function a(w) {
        if (!Number.isInteger(w)) return !1;
        const b = w.toString();
        return !!(e.errorValues[b] || l(w))
      }
      t.isValidCode = a;

      function c(w, {
        fallbackError: b = s,
        shouldIncludeStack: C = !1
      } = {}) {
        var M, N;
        if (!b || !Number.isInteger(b.code) || typeof b.message != "string") throw new Error("Must provide fallback error with integer number code and string message.");
        if (w instanceof r.EthereumRpcError) return w.serialize();
        const $ = {};
        if (w && typeof w == "object" && !Array.isArray(w) && f(w, "code") && a(w.code)) {
          const B = w;
          $.code = B.code, B.message && typeof B.message == "string" ? ($.message = B.message, f(B, "data") && ($.data = B.data)) : ($.message = o($.code), $.data = {
            originalError: h(w)
          })
        } else {
          $.code = b.code;
          const B = (M = w) === null || M === void 0 ? void 0 : M.message;
          $.message = B && typeof B == "string" ? B : b.message, $.data = {
            originalError: h(w)
          }
        }
        const k = (N = w) === null || N === void 0 ? void 0 : N.stack;
        return C && w && k && typeof k == "string" && ($.stack = k), $
      }
      t.serializeError = c;

      function l(w) {
        return w >= -32099 && w <= -32e3
      }

      function h(w) {
        return w && typeof w == "object" && !Array.isArray(w) ? Object.assign({}, w) : w
      }

      function f(w, b) {
        return Object.prototype.hasOwnProperty.call(w, b)
      }
    }(fI);
  var A8 = {};
  Object.defineProperty(A8, "__esModule", {
    value: !0
  }), A8.ethErrors = void 0;
  const pI = Yh,
    Pq = fI,
    As = Qh;
  A8.ethErrors = {
    rpc: {
      parse: t => Ba(As.errorCodes.rpc.parse, t),
      invalidRequest: t => Ba(As.errorCodes.rpc.invalidRequest, t),
      invalidParams: t => Ba(As.errorCodes.rpc.invalidParams, t),
      methodNotFound: t => Ba(As.errorCodes.rpc.methodNotFound, t),
      internal: t => Ba(As.errorCodes.rpc.internal, t),
      server: t => {
        if (!t || typeof t != "object" || Array.isArray(t)) throw new Error("Ethereum RPC Server errors must provide single object argument.");
        const {
          code: e
        } = t;
        if (!Number.isInteger(e) || e > -32005 || e < -32099) throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');
        return Ba(e, t)
      },
      invalidInput: t => Ba(As.errorCodes.rpc.invalidInput, t),
      resourceNotFound: t => Ba(As.errorCodes.rpc.resourceNotFound, t),
      resourceUnavailable: t => Ba(As.errorCodes.rpc.resourceUnavailable, t),
      transactionRejected: t => Ba(As.errorCodes.rpc.transactionRejected, t),
      methodNotSupported: t => Ba(As.errorCodes.rpc.methodNotSupported, t),
      limitExceeded: t => Ba(As.errorCodes.rpc.limitExceeded, t)
    },
    provider: {
      userRejectedRequest: t => Kb(As.errorCodes.provider.userRejectedRequest, t),
      unauthorized: t => Kb(As.errorCodes.provider.unauthorized, t),
      unsupportedMethod: t => Kb(As.errorCodes.provider.unsupportedMethod, t),
      disconnected: t => Kb(As.errorCodes.provider.disconnected, t),
      chainDisconnected: t => Kb(As.errorCodes.provider.chainDisconnected, t),
      custom: t => {
        if (!t || typeof t != "object" || Array.isArray(t)) throw new Error("Ethereum Provider custom errors must provide single object argument.");
        const {
          code: e,
          message: r,
          data: n
        } = t;
        if (!r || typeof r != "string") throw new Error('"message" must be a nonempty string');
        return new pI.EthereumProviderError(e, r, n)
      }
    }
  };

  function Ba(t, e) {
    const [r, n] = $q(e);
    return new pI.EthereumRpcError(t, r || Pq.getMessageFromCode(t), n)
  }

  function Kb(t, e) {
    const [r, n] = $q(e);
    return new pI.EthereumProviderError(t, r || Pq.getMessageFromCode(t), n)
  }

  function $q(t) {
    if (t) {
      if (typeof t == "string") return [t];
      if (typeof t == "object" && !Array.isArray(t)) {
        const {
          message: e,
          data: r
        } = t;
        if (e && typeof e != "string") throw new Error("Must specify string message.");
        return [e || void 0, r]
      }
    }
    return []
  }(function (t) {
    Object.defineProperty(t, "__esModule", {
      value: !0
    }), t.getMessageFromCode = t.serializeError = t.EthereumProviderError = t.EthereumRpcError = t.ethErrors = t.errorCodes = void 0;
    const e = Yh;
    Object.defineProperty(t, "EthereumRpcError", {
      enumerable: !0,
      get: function () {
        return e.EthereumRpcError
      }
    }), Object.defineProperty(t, "EthereumProviderError", {
      enumerable: !0,
      get: function () {
        return e.EthereumProviderError
      }
    });
    const r = fI;
    Object.defineProperty(t, "serializeError", {
      enumerable: !0,
      get: function () {
        return r.serializeError
      }
    }), Object.defineProperty(t, "getMessageFromCode", {
      enumerable: !0,
      get: function () {
        return r.getMessageFromCode
      }
    });
    const n = A8;
    Object.defineProperty(t, "ethErrors", {
      enumerable: !0,
      get: function () {
        return n.ethErrors
      }
    });
    const i = Qh;
    Object.defineProperty(t, "errorCodes", {
      enumerable: !0,
      get: function () {
        return i.errorCodes
      }
    })
  })(Iq);
  var DTe = ot && ot.__importDefault || function (t) {
    return t && t.__esModule ? t : {
      default: t
    }
  };
  Object.defineProperty(qb, "__esModule", {
    value: !0
  }), qb.JsonRpcEngine = void 0;
  const LTe = DTe(uI),
    Ua = Iq;
  class vd extends LTe.default {
    constructor() {
      super(), this._middleware = []
    }
    push(e) {
      this._middleware.push(e)
    }
    handle(e, r) {
      if (r && typeof r != "function") throw new Error('"callback" must be a function if provided.');
      return Array.isArray(e) ? r ? this._handleBatch(e, r) : this._handleBatch(e) : r ? this._handle(e, r) : this._promiseHandle(e)
    }
    asMiddleware() {
      return async (e, r, n, i) => {
        try {
          const [s, o, a] = await vd._runAllMiddleware(e, r, this._middleware);
          return o ? (await vd._runReturnHandlers(a), i(s)) : n(async c => {
            try {
              await vd._runReturnHandlers(a)
            } catch (l) {
              return c(l)
            }
            return c()
          })
        } catch (s) {
          return i(s)
        }
      }
    }
    async _handleBatch(e, r) {
      try {
        const n = await Promise.all(e.map(this._promiseHandle.bind(this)));
        return r ? r(null, n) : n
      } catch (n) {
        if (r) return r(n);
        throw n
      }
    }
    _promiseHandle(e) {
      return new Promise(r => {
        this._handle(e, (n, i) => {
          r(i)
        })
      })
    }
    async _handle(e, r) {
      if (!e || Array.isArray(e) || typeof e != "object") {
        const o = new Ua.EthereumRpcError(Ua.errorCodes.rpc.invalidRequest, `Requests must be plain objects. Received: ${typeof e}`, {
          request: e
        });
        return r(o, {
          id: void 0,
          jsonrpc: "2.0",
          error: o
        })
      }
      if (typeof e.method != "string") {
        const o = new Ua.EthereumRpcError(Ua.errorCodes.rpc.invalidRequest, `Must specify a string method. Received: ${typeof e.method}`, {
          request: e
        });
        return r(o, {
          id: e.id,
          jsonrpc: "2.0",
          error: o
        })
      }
      const n = Object.assign({}, e),
        i = {
          id: n.id,
          jsonrpc: n.jsonrpc
        };
      let s = null;
      try {
        await this._processRequest(n, i)
      } catch (o) {
        s = o
      }
      return s && (delete i.result, i.error || (i.error = Ua.serializeError(s))), r(s, i)
    }
    async _processRequest(e, r) {
      const [n, i, s] = await vd._runAllMiddleware(e, r, this._middleware);
      if (vd._checkForCompletion(e, r, i), await vd._runReturnHandlers(s), n) throw n
    }
    static async _runAllMiddleware(e, r, n) {
      const i = [];
      let s = null,
        o = !1;
      for (const a of n)
        if ([s, o] = await vd._runMiddleware(e, r, a, i), o) break;
      return [s, o, i.reverse()]
    }
    static _runMiddleware(e, r, n, i) {
      return new Promise(s => {
        const o = c => {
            const l = c || r.error;
            l && (r.error = Ua.serializeError(l)), s([l, !0])
          },
          a = c => {
            r.error ? o(r.error) : (c && (typeof c != "function" && o(new Ua.EthereumRpcError(Ua.errorCodes.rpc.internal, `JsonRpcEngine: "next" return handlers must be functions. Received "${typeof c}" for request:
  ${gI(e)}`, {
              request: e
            })), i.push(c)), s([null, !1]))
          };
        try {
          n(e, r, a, o)
        } catch (c) {
          o(c)
        }
      })
    }
    static async _runReturnHandlers(e) {
      for (const r of e) await new Promise((n, i) => {
        r(s => s ? i(s) : n())
      })
    }
    static _checkForCompletion(e, r, n) {
      if (!("result" in r) && !("error" in r)) throw new Ua.EthereumRpcError(Ua.errorCodes.rpc.internal, `JsonRpcEngine: Response has no error or result for request:
  ${gI(e)}`, {
        request: e
      });
      if (!n) throw new Ua.EthereumRpcError(Ua.errorCodes.rpc.internal, `JsonRpcEngine: Nothing ended request:
  ${gI(e)}`, {
        request: e
      })
    }
  }
  qb.JsonRpcEngine = vd;

  function gI(t) {
    return JSON.stringify(t, null, 2)
  }
  var S8 = {};
  Object.defineProperty(S8, "__esModule", {
    value: !0
  }), S8.mergeMiddleware = void 0;
  const BTe = qb;

  function UTe(t) {
    const e = new BTe.JsonRpcEngine;
    return t.forEach(r => e.push(r)), e.asMiddleware()
  }
  S8.mergeMiddleware = UTe,
    function (t) {
      var e = ot && ot.__createBinding || (Object.create ? function (n, i, s, o) {
          o === void 0 && (o = s), Object.defineProperty(n, o, {
            enumerable: !0,
            get: function () {
              return i[s]
            }
          })
        } : function (n, i, s, o) {
          o === void 0 && (o = s), n[o] = i[s]
        }),
        r = ot && ot.__exportStar || function (n, i) {
          for (var s in n) s !== "default" && !Object.prototype.hasOwnProperty.call(i, s) && e(i, n, s)
        };
      Object.defineProperty(t, "__esModule", {
        value: !0
      }), r(_8, t), r(x8, t), r(C8, t), r(Hb, t), r(qb, t), r(S8, t)
    }(cI);
  var Oq = {},
    mI = {},
    wI = function (t, e) {
      return wI = Object.setPrototypeOf || {
        __proto__: []
      }
      instanceof Array && function (r, n) {
        r.__proto__ = n
      } || function (r, n) {
        for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (r[i] = n[i])
      }, wI(t, e)
    };

  function Dq(t, e) {
    if (typeof e != "function" && e !== null) throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
    wI(t, e);

    function r() {
      this.constructor = t
    }
    t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r)
  }
  var I8 = function () {
    return I8 = Object.assign || function (e) {
      for (var r, n = 1, i = arguments.length; n < i; n++) {
        r = arguments[n];
        for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && (e[s] = r[s])
      }
      return e
    }, I8.apply(this, arguments)
  };

  function Lq(t, e) {
    var r = {};
    for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
    if (t != null && typeof Object.getOwnPropertySymbols == "function")
      for (var i = 0, n = Object.getOwnPropertySymbols(t); i < n.length; i++) e.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[i]) && (r[n[i]] = t[n[i]]);
    return r
  }

  function Bq(t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  }

  function Uq(t, e) {
    return function (r, n) {
      e(r, n, t)
    }
  }

  function jq(t, e, r, n, i, s) {
    function o($) {
      if ($ !== void 0 && typeof $ != "function") throw new TypeError("Function expected");
      return $
    }
    for (var a = n.kind, c = a === "getter" ? "get" : a === "setter" ? "set" : "value", l = !e && t ? n.static ? t : t.prototype : null, h = e || (l ? Object.getOwnPropertyDescriptor(l, n.name) : {}), f, w = !1, b = r.length - 1; b >= 0; b--) {
      var C = {};
      for (var M in n) C[M] = M === "access" ? {} : n[M];
      for (var M in n.access) C.access[M] = n.access[M];
      C.addInitializer = function ($) {
        if (w) throw new TypeError("Cannot add initializers after decoration has completed");
        s.push(o($ || null))
      };
      var N = (0, r[b])(a === "accessor" ? {
        get: h.get,
        set: h.set
      } : h[c], C);
      if (a === "accessor") {
        if (N === void 0) continue;
        if (N === null || typeof N != "object") throw new TypeError("Object expected");
        (f = o(N.get)) && (h.get = f), (f = o(N.set)) && (h.set = f), (f = o(N.init)) && i.unshift(f)
      } else(f = o(N)) && (a === "field" ? i.unshift(f) : h[c] = f)
    }
    l && Object.defineProperty(l, n.name, h), w = !0
  }

  function Fq(t, e, r) {
    for (var n = arguments.length > 2, i = 0; i < e.length; i++) r = n ? e[i].call(t, r) : e[i].call(t);
    return n ? r : void 0
  }

  function Wq(t) {
    return typeof t == "symbol" ? t : "".concat(t)
  }

  function zq(t, e, r) {
    return typeof e == "symbol" && (e = e.description ? "[".concat(e.description, "]") : ""), Object.defineProperty(t, "name", {
      configurable: !0,
      value: r ? "".concat(r, " ", e) : e
    })
  }

  function Hq(t, e) {
    if (typeof Reflect == "object" && typeof Reflect.metadata == "function") return Reflect.metadata(t, e)
  }

  function qq(t, e, r, n) {
    function i(s) {
      return s instanceof r ? s : new r(function (o) {
        o(s)
      })
    }
    return new(r || (r = Promise))(function (s, o) {
      function a(h) {
        try {
          l(n.next(h))
        } catch (f) {
          o(f)
        }
      }

      function c(h) {
        try {
          l(n.throw(h))
        } catch (f) {
          o(f)
        }
      }

      function l(h) {
        h.done ? s(h.value) : i(h.value).then(a, c)
      }
      l((n = n.apply(t, e || [])).next())
    })
  }

  function Vq(t, e) {
    var r = {
        label: 0,
        sent: function () {
          if (s[0] & 1) throw s[1];
          return s[1]
        },
        trys: [],
        ops: []
      },
      n, i, s, 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 (h) {
        return c([l, h])
      }
    }

    function c(l) {
      if (n) throw new TypeError("Generator is already executing.");
      for (; o && (o = 0, l[0] && (r = 0)), r;) try {
        if (n = 1, i && (s = l[0] & 2 ? i.return : l[0] ? i.throw || ((s = i.return) && s.call(i), 0) : i.next) && !(s = s.call(i, l[1])).done) return s;
        switch (i = 0, s && (l = [l[0] & 2, s.value]), l[0]) {
          case 0:
          case 1:
            s = l;
            break;
          case 4:
            return r.label++, {
              value: l[1],
              done: !1
            };
          case 5:
            r.label++, i = l[1], l = [0];
            continue;
          case 7:
            l = r.ops.pop(), r.trys.pop();
            continue;
          default:
            if (s = r.trys, !(s = s.length > 0 && s[s.length - 1]) && (l[0] === 6 || l[0] === 2)) {
              r = 0;
              continue
            }
            if (l[0] === 3 && (!s || l[1] > s[0] && l[1] < s[3])) {
              r.label = l[1];
              break
            }
            if (l[0] === 6 && r.label < s[1]) {
              r.label = s[1], s = l;
              break
            }
            if (s && r.label < s[2]) {
              r.label = s[2], r.ops.push(l);
              break
            }
            s[2] && r.ops.pop(), r.trys.pop();
            continue
        }
        l = e.call(t, r)
      } catch (h) {
        l = [6, h], i = 0
      } finally {
        n = s = 0
      }
      if (l[0] & 5) throw l[1];
      return {
        value: l[0] ? l[1] : void 0,
        done: !0
      }
    }
  }
  var T8 = Object.create ? function (t, e, r, n) {
    n === void 0 && (n = r);
    var i = Object.getOwnPropertyDescriptor(e, r);
    (!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) && (i = {
      enumerable: !0,
      get: function () {
        return e[r]
      }
    }), Object.defineProperty(t, n, i)
  } : function (t, e, r, n) {
    n === void 0 && (n = r), t[n] = e[r]
  };

  function Kq(t, e) {
    for (var r in t) r !== "default" && !Object.prototype.hasOwnProperty.call(e, r) && T8(e, t, r)
  }

  function k8(t) {
    var e = typeof Symbol == "function" && Symbol.iterator,
      r = e && t[e],
      n = 0;
    if (r) return r.call(t);
    if (t && typeof t.length == "number") return {
      next: function () {
        return t && n >= t.length && (t = void 0), {
          value: t && t[n++],
          done: !t
        }
      }
    };
    throw new TypeError(e ? "Object is not iterable." : "Symbol.iterator is not defined.")
  }

  function vI(t, e) {
    var r = typeof Symbol == "function" && t[Symbol.iterator];
    if (!r) return t;
    var n = r.call(t),
      i, s = [],
      o;
    try {
      for (;
        (e === void 0 || e-- > 0) && !(i = n.next()).done;) s.push(i.value)
    } catch (a) {
      o = {
        error: a
      }
    } finally {
      try {
        i && !i.done && (r = n.return) && r.call(n)
      } finally {
        if (o) throw o.error
      }
    }
    return s
  }

  function Gq() {
    for (var t = [], e = 0; e < arguments.length; e++) t = t.concat(vI(arguments[e]));
    return t
  }

  function Zq() {
    for (var t = 0, e = 0, r = arguments.length; e < r; e++) t += arguments[e].length;
    for (var n = Array(t), i = 0, e = 0; e < r; e++)
      for (var s = arguments[e], o = 0, a = s.length; o < a; o++, i++) n[i] = s[o];
    return n
  }

  function Yq(t, e, r) {
    if (r || arguments.length === 2)
      for (var n = 0, i = e.length, s; n < i; n++)(s || !(n in e)) && (s || (s = Array.prototype.slice.call(e, 0, n)), s[n] = e[n]);
    return t.concat(s || Array.prototype.slice.call(e))
  }

  function _m(t) {
    return this instanceof _m ? (this.v = t, this) : new _m(t)
  }

  function Qq(t, e, r) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var n = r.apply(t, e || []),
      i, s = [];
    return i = Object.create((typeof AsyncIterator == "function" ? AsyncIterator : Object).prototype), a("next"), a("throw"), a("return", o), i[Symbol.asyncIterator] = function () {
      return this
    }, i;

    function o(b) {
      return function (C) {
        return Promise.resolve(C).then(b, f)
      }
    }

    function a(b, C) {
      n[b] && (i[b] = function (M) {
        return new Promise(function (N, $) {
          s.push([b, M, N, $]) > 1 || c(b, M)
        })
      }, C && (i[b] = C(i[b])))
    }

    function c(b, C) {
      try {
        l(n[b](C))
      } catch (M) {
        w(s[0][3], M)
      }
    }

    function l(b) {
      b.value instanceof _m ? Promise.resolve(b.value.v).then(h, f) : w(s[0][2], b)
    }

    function h(b) {
      c("next", b)
    }

    function f(b) {
      c("throw", b)
    }

    function w(b, C) {
      b(C), s.shift(), s.length && c(s[0][0], s[0][1])
    }
  }

  function Jq(t) {
    var e, r;
    return e = {}, n("next"), n("throw", function (i) {
      throw i
    }), n("return"), e[Symbol.iterator] = function () {
      return this
    }, e;

    function n(i, s) {
      e[i] = t[i] ? function (o) {
        return (r = !r) ? {
          value: _m(t[i](o)),
          done: !1
        } : s ? s(o) : o
      } : s
    }
  }

  function Xq(t) {
    if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
    var e = t[Symbol.asyncIterator],
      r;
    return e ? e.call(t) : (t = typeof k8 == "function" ? k8(t) : t[Symbol.iterator](), r = {}, n("next"), n("throw"), n("return"), r[Symbol.asyncIterator] = function () {
      return this
    }, r);

    function n(s) {
      r[s] = t[s] && function (o) {
        return new Promise(function (a, c) {
          o = t[s](o), i(a, c, o.done, o.value)
        })
      }
    }

    function i(s, o, a, c) {
      Promise.resolve(c).then(function (l) {
        s({
          value: l,
          done: a
        })
      }, o)
    }
  }

  function eV(t, e) {
    return Object.defineProperty ? Object.defineProperty(t, "raw", {
      value: e
    }) : t.raw = e, t
  }
  var jTe = Object.create ? function (t, e) {
      Object.defineProperty(t, "default", {
        enumerable: !0,
        value: e
      })
    } : function (t, e) {
      t.default = e
    },
    bI = function (t) {
      return bI = Object.getOwnPropertyNames || function (e) {
        var r = [];
        for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && (r[r.length] = n);
        return r
      }, bI(t)
    };

  function tV(t) {
    if (t && t.__esModule) return t;
    var e = {};
    if (t != null)
      for (var r = bI(t), n = 0; n < r.length; n++) r[n] !== "default" && T8(e, t, r[n]);
    return jTe(e, t), e
  }

  function rV(t) {
    return t && t.__esModule ? t : {
      default: t
    }
  }

  function nV(t, e, r, n) {
    if (r === "a" && !n) throw new TypeError("Private accessor was defined without a getter");
    if (typeof e == "function" ? t !== e || !n : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
    return r === "m" ? n : r === "a" ? n.call(t) : n ? n.value : e.get(t)
  }

  function iV(t, e, r, n, i) {
    if (n === "m") throw new TypeError("Private method is not writable");
    if (n === "a" && !i) throw new TypeError("Private accessor was defined without a setter");
    if (typeof e == "function" ? t !== e || !i : !e.has(t)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
    return n === "a" ? i.call(t, r) : i ? i.value = r : e.set(t, r), r
  }

  function sV(t, e) {
    if (e === null || typeof e != "object" && typeof e != "function") throw new TypeError("Cannot use 'in' operator on non-object");
    return typeof t == "function" ? e === t : t.has(e)
  }

  function oV(t, e, r) {
    if (e != null) {
      if (typeof e != "object" && typeof e != "function") throw new TypeError("Object expected.");
      var n, i;
      if (r) {
        if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
        n = e[Symbol.asyncDispose]
      }
      if (n === void 0) {
        if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
        n = e[Symbol.dispose], r && (i = n)
      }
      if (typeof n != "function") throw new TypeError("Object not disposable.");
      i && (n = function () {
        try {
          i.call(this)
        } catch (s) {
          return Promise.reject(s)
        }
      }), t.stack.push({
        value: e,
        dispose: n,
        async: r
      })
    } else r && t.stack.push({
      async: !0
    });
    return e
  }
  var FTe = typeof SuppressedError == "function" ? SuppressedError : function (t, e, r) {
    var n = new Error(r);
    return n.name = "SuppressedError", n.error = t, n.suppressed = e, n
  };

  function aV(t) {
    function e(s) {
      t.error = t.hasError ? new FTe(s, t.error, "An error was suppressed during disposal.") : s, t.hasError = !0
    }
    var r, n = 0;

    function i() {
      for (; r = t.stack.pop();) try {
        if (!r.async && n === 1) return n = 0, t.stack.push(r), Promise.resolve().then(i);
        if (r.dispose) {
          var s = r.dispose.call(r.value);
          if (r.async) return n |= 2, Promise.resolve(s).then(i, function (o) {
            return e(o), i()
          })
        } else n |= 1
      } catch (o) {
        e(o)
      }
      if (n === 1) return t.hasError ? Promise.reject(t.error) : Promise.resolve();
      if (t.hasError) throw t.error
    }
    return i()
  }

  function cV(t, e) {
    return typeof t == "string" && /^\.\.?\//.test(t) ? t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (r, n, i, s, o) {
      return n ? e ? ".jsx" : ".js" : i && (!s || !o) ? r : i + s + "." + o.toLowerCase() + "js"
    }) : t
  }
  const yI = bu(Object.freeze(Object.defineProperty({
    __proto__: null,
    __addDisposableResource: oV,
    get __assign() {
      return I8
    },
    __asyncDelegator: Jq,
    __asyncGenerator: Qq,
    __asyncValues: Xq,
    __await: _m,
    __awaiter: qq,
    __classPrivateFieldGet: nV,
    __classPrivateFieldIn: sV,
    __classPrivateFieldSet: iV,
    __createBinding: T8,
    __decorate: Bq,
    __disposeResources: aV,
    __esDecorate: jq,
    __exportStar: Kq,
    __extends: Dq,
    __generator: Vq,
    __importDefault: rV,
    __importStar: tV,
    __makeTemplateObject: eV,
    __metadata: Hq,
    __param: Uq,
    __propKey: Wq,
    __read: vI,
    __rest: Lq,
    __rewriteRelativeImportExtension: cV,
    __runInitializers: Fq,
    __setFunctionName: zq,
    __spread: Gq,
    __spreadArray: Yq,
    __spreadArrays: Zq,
    __values: k8,
    default: {
      __extends: Dq,
      __assign: I8,
      __rest: Lq,
      __decorate: Bq,
      __param: Uq,
      __esDecorate: jq,
      __runInitializers: Fq,
      __propKey: Wq,
      __setFunctionName: zq,
      __metadata: Hq,
      __awaiter: qq,
      __generator: Vq,
      __createBinding: T8,
      __exportStar: Kq,
      __values: k8,
      __read: vI,
      __spread: Gq,
      __spreadArrays: Zq,
      __spreadArray: Yq,
      __await: _m,
      __asyncGenerator: Qq,
      __asyncDelegator: Jq,
      __asyncValues: Xq,
      __makeTemplateObject: eV,
      __importStar: tV,
      __importDefault: rV,
      __classPrivateFieldGet: nV,
      __classPrivateFieldSet: iV,
      __classPrivateFieldIn: sV,
      __addDisposableResource: oV,
      __disposeResources: aV,
      __rewriteRelativeImportExtension: cV
    }
  }, Symbol.toStringTag, {
    value: "Module"
  })));
  var R8 = {};
  Object.defineProperty(R8, "__esModule", {
    value: !0
  });
  var lV = yI,
    WTe = function () {
      function t(e) {
        if (this._maxConcurrency = e, this._queue = [], e <= 0) throw new Error("semaphore must be initialized to a positive value");
        this._value = e
      }
      return t.prototype.acquire = function () {
        var e = this,
          r = this.isLocked(),
          n = new Promise(function (i) {
            return e._queue.push(i)
          });
        return r || this._dispatch(), n
      }, t.prototype.runExclusive = function (e) {
        return lV.__awaiter(this, void 0, void 0, function () {
          var r, n, i;
          return lV.__generator(this, function (s) {
            switch (s.label) {
              case 0:
                return [4, this.acquire()];
              case 1:
                r = s.sent(), n = r[0], i = r[1], s.label = 2;
              case 2:
                return s.trys.push([2, , 4, 5]), [4, e(n)];
              case 3:
                return [2, s.sent()];
              case 4:
                return i(), [7];
              case 5:
                return [2]
            }
          })
        })
      }, t.prototype.isLocked = function () {
        return this._value <= 0
      }, t.prototype.release = function () {
        if (this._maxConcurrency > 1) throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");
        if (this._currentReleaser) {
          var e = this._currentReleaser;
          this._currentReleaser = void 0, e()
        }
      }, t.prototype._dispatch = function () {
        var e = this,
          r = this._queue.shift();
        if (r) {
          var n = !1;
          this._currentReleaser = function () {
            n || (n = !0, e._value++, e._dispatch())
          }, r([this._value--, this._currentReleaser])
        }
      }, t
    }();
  R8.default = WTe, Object.defineProperty(mI, "__esModule", {
    value: !0
  });
  var uV = yI,
    zTe = R8,
    HTe = function () {
      function t() {
        this._semaphore = new zTe.default(1)
      }
      return t.prototype.acquire = function () {
        return uV.__awaiter(this, void 0, void 0, function () {
          var e, r;
          return uV.__generator(this, function (n) {
            switch (n.label) {
              case 0:
                return [4, this._semaphore.acquire()];
              case 1:
                return e = n.sent(), r = e[1], [2, r]
            }
          })
        })
      }, t.prototype.runExclusive = function (e) {
        return this._semaphore.runExclusive(function () {
          return e()
        })
      }, t.prototype.isLocked = function () {
        return this._semaphore.isLocked()
      }, t.prototype.release = function () {
        this._semaphore.release()
      }, t
    }();
  mI.default = HTe;
  var N8 = {};
  Object.defineProperty(N8, "__esModule", {
    value: !0
  }), N8.withTimeout = void 0;
  var M8 = yI;

  function qTe(t, e, r) {
    var n = this;
    return r === void 0 && (r = new Error("timeout")), {
      acquire: function () {
        return new Promise(function (i, s) {
          return M8.__awaiter(n, void 0, void 0, function () {
            var o, a, c;
            return M8.__generator(this, function (l) {
              switch (l.label) {
                case 0:
                  return o = !1, setTimeout(function () {
                    o = !0, s(r)
                  }, e), [4, t.acquire()];
                case 1:
                  return a = l.sent(), o ? (c = Array.isArray(a) ? a[1] : a, c()) : i(a), [2]
              }
            })
          })
        })
      },
      runExclusive: function (i) {
        return M8.__awaiter(this, void 0, void 0, function () {
          var s, o;
          return M8.__generator(this, function (a) {
            switch (a.label) {
              case 0:
                s = function () {}, a.label = 1;
              case 1:
                return a.trys.push([1, , 7, 8]), [4, this.acquire()];
              case 2:
                return o = a.sent(), Array.isArray(o) ? (s = o[1], [4, i(o[0])]) : [3, 4];
              case 3:
                return [2, a.sent()];
              case 4:
                return s = o, [4, i()];
              case 5:
                return [2, a.sent()];
              case 6:
                return [3, 8];
              case 7:
                return s(), [7];
              case 8:
                return [2]
            }
          })
        })
      },
      release: function () {
        t.release()
      },
      isLocked: function () {
        return t.isLocked()
      }
    }
  }
  N8.withTimeout = qTe,
    function (t) {
      Object.defineProperty(t, "__esModule", {
        value: !0
      }), t.withTimeout = t.Semaphore = t.Mutex = void 0;
      var e = mI;
      Object.defineProperty(t, "Mutex", {
        enumerable: !0,
        get: function () {
          return e.default
        }
      });
      var r = R8;
      Object.defineProperty(t, "Semaphore", {
        enumerable: !0,
        get: function () {
          return r.default
        }
      });
      var n = N8;
      Object.defineProperty(t, "withTimeout", {
        enumerable: !0,
        get: function () {
          return n.withTimeout
        }
      })
    }(Oq);
  var VTe = GTe,
    KTe = Object.prototype.hasOwnProperty;

  function GTe() {
    for (var t = {}, e = 0; e < arguments.length; e++) {
      var r = arguments[e];
      for (var n in r) KTe.call(r, n) && (t[n] = r[n])
    }
    return t
  }
  const ZTe = VTe,
    YTe = $S();
  var QTe = sr;

  function sr(t) {
    const e = this;
    e.currentProvider = t
  }
  sr.prototype.getBalance = Gb(2, "eth_getBalance"), sr.prototype.getCode = Gb(2, "eth_getCode"), sr.prototype.getTransactionCount = Gb(2, "eth_getTransactionCount"), sr.prototype.getStorageAt = Gb(3, "eth_getStorageAt"), sr.prototype.call = Gb(2, "eth_call"), sr.prototype.protocolVersion = Sr("eth_protocolVersion"), sr.prototype.syncing = Sr("eth_syncing"), sr.prototype.coinbase = Sr("eth_coinbase"), sr.prototype.mining = Sr("eth_mining"), sr.prototype.hashrate = Sr("eth_hashrate"), sr.prototype.gasPrice = Sr("eth_gasPrice"), sr.prototype.accounts = Sr("eth_accounts"), sr.prototype.blockNumber = Sr("eth_blockNumber"), sr.prototype.getBlockTransactionCountByHash = Sr("eth_getBlockTransactionCountByHash"), sr.prototype.getBlockTransactionCountByNumber = Sr("eth_getBlockTransactionCountByNumber"), sr.prototype.getUncleCountByBlockHash = Sr("eth_getUncleCountByBlockHash"), sr.prototype.getUncleCountByBlockNumber = Sr("eth_getUncleCountByBlockNumber"), sr.prototype.sign = Sr("eth_sign"), sr.prototype.sendTransaction = Sr("eth_sendTransaction"), sr.prototype.sendRawTransaction = Sr("eth_sendRawTransaction"), sr.prototype.estimateGas = Sr("eth_estimateGas"), sr.prototype.getBlockByHash = Sr("eth_getBlockByHash"), sr.prototype.getBlockByNumber = Sr("eth_getBlockByNumber"), sr.prototype.getTransactionByHash = Sr("eth_getTransactionByHash"), sr.prototype.getTransactionByBlockHashAndIndex = Sr("eth_getTransactionByBlockHashAndIndex"), sr.prototype.getTransactionByBlockNumberAndIndex = Sr("eth_getTransactionByBlockNumberAndIndex"), sr.prototype.getTransactionReceipt = Sr("eth_getTransactionReceipt"), sr.prototype.getUncleByBlockHashAndIndex = Sr("eth_getUncleByBlockHashAndIndex"), sr.prototype.getUncleByBlockNumberAndIndex = Sr("eth_getUncleByBlockNumberAndIndex"), sr.prototype.getCompilers = Sr("eth_getCompilers"), sr.prototype.compileLLL = Sr("eth_compileLLL"), sr.prototype.compileSolidity = Sr("eth_compileSolidity"), sr.prototype.compileSerpent = Sr("eth_compileSerpent"), sr.prototype.newFilter = Sr("eth_newFilter"), sr.prototype.newBlockFilter = Sr("eth_newBlockFilter"), sr.prototype.newPendingTransactionFilter = Sr("eth_newPendingTransactionFilter"), sr.prototype.uninstallFilter = Sr("eth_uninstallFilter"), sr.prototype.getFilterChanges = Sr("eth_getFilterChanges"), sr.prototype.getFilterLogs = Sr("eth_getFilterLogs"), sr.prototype.getLogs = Sr("eth_getLogs"), sr.prototype.getWork = Sr("eth_getWork"), sr.prototype.submitWork = Sr("eth_submitWork"), sr.prototype.submitHashrate = Sr("eth_submitHashrate"), sr.prototype.sendAsync = function (t, e) {
    this.currentProvider.sendAsync(JTe(t), function (n, i) {
      if (!n && i.error && (n = new Error("EthQuery - RPC Error - " + i.error.message)), n) return e(n);
      e(null, i.result)
    })
  };

  function Sr(t) {
    return function () {
      const e = this;
      var r = [].slice.call(arguments),
        n = r.pop();
      e.sendAsync({
        method: t,
        params: r
      }, n)
    }
  }

  function Gb(t, e) {
    return function () {
      const r = this;
      var n = [].slice.call(arguments),
        i = n.pop();
      n.length < t && n.push("latest"), r.sendAsync({
        method: e,
        params: n
      }, i)
    }
  }

  function JTe(t) {
    return ZTe({
      id: YTe(),
      jsonrpc: "2.0",
      params: []
    }, t)
  }
  const dV = (t, e, r, n) => function (...i) {
      const s = e.promiseModule;
      return new s((o, a) => {
        e.multiArgs ? i.push((...l) => {
          e.errorFirst ? l[0] ? a(l) : (l.shift(), o(l)) : o(l)
        }) : e.errorFirst ? i.push((l, h) => {
          l ? a(l) : o(h)
        }) : i.push(o), Reflect.apply(t, this === r ? n : this, i)
      })
    },
    hV = new WeakMap;
  var XTe = (t, e) => {
    e = {
      exclude: [/.+(?:Sync|Stream)$/],
      errorFirst: !0,
      promiseModule: Promise,
      ...e
    };
    const r = typeof t;
    if (!(t !== null && (r === "object" || r === "function"))) throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);
    const n = (o, a) => {
        let c = hV.get(o);
        if (c || (c = {}, hV.set(o, c)), a in c) return c[a];
        const l = C => typeof C == "string" || typeof a == "symbol" ? a === C : C.test(a),
          h = Reflect.getOwnPropertyDescriptor(o, a),
          f = h === void 0 || h.writable || h.configurable,
          b = (e.include ? e.include.some(l) : !e.exclude.some(l)) && f;
        return c[a] = b, b
      },
      i = new WeakMap,
      s = new Proxy(t, {
        apply(o, a, c) {
          const l = i.get(o);
          if (l) return Reflect.apply(l, a, c);
          const h = e.excludeMain ? o : dV(o, e, s, o);
          return i.set(o, h), Reflect.apply(h, a, c)
        },
        get(o, a) {
          const c = o[a];
          if (!n(o, a) || c === Function.prototype[a]) return c;
          const l = i.get(c);
          if (l) return l;
          if (typeof c == "function") {
            const h = dV(c, e, s, o);
            return i.set(c, h), h
          }
          return c
        }
      });
    return s
  };
  const eke = Db.default;
  var _I = class extends eke {
    constructor() {
      super(), this.updates = []
    }
    async initialize() {}
    async update() {
      throw new Error("BaseFilter - no update method specified")
    }
    addResults(e) {
      this.updates = this.updates.concat(e), e.forEach(r => this.emit("update", r))
    }
    addInitialResults(e) {}
    getChangesAndClear() {
      const e = this.updates;
      return this.updates = [], e
    }
  };
  const tke = _I;
  var rke = class extends tke {
      constructor() {
        super(), this.allResults = []
      }
      async update() {
        throw new Error("BaseFilterWithHistory - no update method specified")
      }
      addResults(e) {
        this.allResults = this.allResults.concat(e), super.addResults(e)
      }
      addInitialResults(e) {
        this.allResults = this.allResults.concat(e), super.addInitialResults(e)
      }
      getAllResults() {
        return this.allResults
      }
    },
    Zb = {
      minBlockRef: nke,
      maxBlockRef: ike,
      sortBlockRefs: xI,
      bnToHex: ske,
      blockRefIsNumber: oke,
      hexToInt: P8,
      incrementHexInt: ake,
      intToHex: fV,
      unsafeRandomBytes: cke
    };

  function nke(...t) {
    return xI(t)[0]
  }

  function ike(...t) {
    const e = xI(t);
    return e[e.length - 1]
  }

  function xI(t) {
    return t.sort((e, r) => e === "latest" || r === "earliest" ? 1 : r === "latest" || e === "earliest" ? -1 : P8(e) - P8(r))
  }

  function ske(t) {
    return "0x" + t.toString(16)
  }

  function oke(t) {
    return t && !["earliest", "latest", "pending"].includes(t)
  }

  function P8(t) {
    return t == null ? t : Number.parseInt(t, 16)
  }

  function ake(t) {
    if (t == null) return t;
    const e = P8(t);
    return fV(e + 1)
  }

  function fV(t) {
    if (t == null) return t;
    let e = t.toString(16);
    return e.length % 2 && (e = "0" + e), "0x" + e
  }

  function cke(t) {
    let e = "0x";
    for (let r = 0; r < t; r++) e += pV(), e += pV();
    return e
  }

  function pV() {
    return Math.floor(Math.random() * 16).toString(16)
  }
  const lke = QTe,
    uke = XTe,
    dke = rke,
    {
      bnToHex: zWe,
      hexToInt: $8,
      incrementHexInt: hke,
      minBlockRef: fke,
      blockRefIsNumber: pke
    } = Zb;
  var gke = class extends dke {
      constructor({
        provider: e,
        params: r
      }) {
        super(), this.type = "log", this.ethQuery = new lke(e), this.params = Object.assign({
          fromBlock: "latest",
          toBlock: "latest",
          address: void 0,
          topics: []
        }, r), this.params.address && (Array.isArray(this.params.address) || (this.params.address = [this.params.address]), this.params.address = this.params.address.map(n => n.toLowerCase()))
      }
      async initialize({
        currentBlock: e
      }) {
        let r = this.params.fromBlock;
        ["latest", "pending"].includes(r) && (r = e), r === "earliest" && (r = "0x0"), this.params.fromBlock = r;
        const n = fke(this.params.toBlock, e),
          i = Object.assign({}, this.params, {
            toBlock: n
          }),
          s = await this._fetchLogs(i);
        this.addInitialResults(s)
      }
      async update({
        oldBlock: e,
        newBlock: r
      }) {
        const n = r;
        let i;
        e ? i = hke(e) : i = r;
        const s = Object.assign({}, this.params, {
            fromBlock: i,
            toBlock: n
          }),
          a = (await this._fetchLogs(s)).filter(c => this.matchLog(c));
        this.addResults(a)
      }
      async _fetchLogs(e) {
        return await uke(n => this.ethQuery.getLogs(e, n))()
      }
      matchLog(e) {
        if ($8(this.params.fromBlock) >= $8(e.blockNumber) || pke(this.params.toBlock) && $8(this.params.toBlock) <= $8(e.blockNumber)) return !1;
        const r = e.address && e.address.toLowerCase();
        return this.params.address && r && !this.params.address.includes(r) ? !1 : this.params.topics.every((i, s) => {
          let o = e.topics[s];
          if (!o) return !1;
          o = o.toLowerCase();
          let a = Array.isArray(i) ? i : [i];
          return a.includes(null) ? !0 : (a = a.map(h => h.toLowerCase()), a.includes(o))
        })
      }
    },
    CI = mke;
  async function mke({
    provider: t,
    fromBlock: e,
    toBlock: r
  }) {
    e || (e = r);
    const n = gV(e),
      s = gV(r) - n + 1,
      o = Array(s).fill().map((c, l) => n + l).map(wke);
    let a = await Promise.all(o.map(c => bke(t, "eth_getBlockByNumber", [c, !1])));
    return a = a.filter(c => c !== null), a
  }

  function gV(t) {
    return t == null ? t : Number.parseInt(t, 16)
  }

  function wke(t) {
    return t == null ? t : "0x" + t.toString(16)
  }

  function vke(t, e) {
    return new Promise((r, n) => {
      t.sendAsync(e, (i, s) => {
        i ? n(i) : s.error ? n(s.error) : s.result ? r(s.result) : n(new Error("Result was empty"))
      })
    })
  }
  async function bke(t, e, r) {
    for (let n = 0; n < 3; n++) try {
      return await vke(t, {
        id: 1,
        jsonrpc: "2.0",
        method: e,
        params: r
      })
    } catch (i) {
      console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)
    }
    return null
  }
  const yke = _I,
    _ke = CI,
    {
      incrementHexInt: xke
    } = Zb;
  var Cke = class extends yke {
    constructor({
      provider: e,
      params: r
    }) {
      super(), this.type = "block", this.provider = e
    }
    async update({
      oldBlock: e,
      newBlock: r
    }) {
      const n = r,
        i = xke(e),
        o = (await _ke({
          provider: this.provider,
          fromBlock: i,
          toBlock: n
        })).map(a => a.hash);
      this.addResults(o)
    }
  };
  const Eke = _I,
    Ake = CI,
    {
      incrementHexInt: Ske
    } = Zb;
  var Ike = class extends Eke {
    constructor({
      provider: e
    }) {
      super(), this.type = "tx", this.provider = e
    }
    async update({
      oldBlock: e
    }) {
      const r = e,
        n = Ske(e),
        i = await Ake({
          provider: this.provider,
          fromBlock: n,
          toBlock: r
        }),
        s = [];
      for (const o of i) s.push(...o.transactions);
      this.addResults(s)
    }
  };
  const Tke = Oq.Mutex,
    {
      createAsyncMiddleware: kke,
      createScaffoldMiddleware: Rke
    } = cI,
    Nke = gke,
    Mke = Cke,
    Pke = Ike,
    {
      intToHex: mV,
      hexToInt: EI
    } = Zb;
  var $ke = Oke;

  function Oke({
    blockTracker: t,
    provider: e
  }) {
    let r = 0,
      n = {};
    const i = new Tke,
      s = Dke({
        mutex: i
      }),
      o = Rke({
        eth_newFilter: s(AI(c)),
        eth_newBlockFilter: s(AI(l)),
        eth_newPendingTransactionFilter: s(AI(h)),
        eth_uninstallFilter: s(O8(b)),
        eth_getFilterChanges: s(O8(f)),
        eth_getFilterLogs: s(O8(w))
      }),
      a = async ({
        oldBlock: k,
        newBlock: B
      }) => {
        if (n.length === 0) return;
        const F = await i.acquire();
        try {
          await Promise.all(xm(n).map(async D => {
            try {
              await D.update({
                oldBlock: k,
                newBlock: B
              })
            } catch (V) {
              console.error(V)
            }
          }))
        } catch (D) {
          console.error(D)
        }
        F()
      };
    return o.newLogFilter = c, o.newBlockFilter = l, o.newPendingTransactionFilter = h, o.uninstallFilter = b, o.getFilterChanges = f, o.getFilterLogs = w, o.destroy = () => {
      N()
    }, o;
    async function c(k) {
      const B = new Nke({
        provider: e,
        params: k
      });
      return await C(B), B
    }
    async function l() {
      const k = new Mke({
        provider: e
      });
      return await C(k), k
    }
    async function h() {
      const k = new Pke({
        provider: e
      });
      return await C(k), k
    }
    async function f(k) {
      const B = EI(k),
        F = n[B];
      if (!F) throw new Error(`No filter for index "${B}"`);
      return F.getChangesAndClear()
    }
    async function w(k) {
      const B = EI(k),
        F = n[B];
      if (!F) throw new Error(`No filter for index "${B}"`);
      let D = [];
      return F.type === "log" && (D = F.getAllResults()), D
    }
    async function b(k) {
      const B = EI(k),
        D = !!n[B];
      return D && await M(B), D
    }
    async function C(k) {
      const B = xm(n).length,
        F = await t.getLatestBlock();
      await k.initialize({
        currentBlock: F
      }), r++, n[r] = k, k.id = r, k.idHex = mV(r);
      const D = xm(n).length;
      return $({
        prevFilterCount: B,
        newFilterCount: D
      }), r
    }
    async function M(k) {
      const B = xm(n).length;
      delete n[k];
      const F = xm(n).length;
      $({
        prevFilterCount: B,
        newFilterCount: F
      })
    }
    async function N() {
      const k = xm(n).length;
      n = {}, $({
        prevFilterCount: k,
        newFilterCount: 0
      })
    }

    function $({
      prevFilterCount: k,
      newFilterCount: B
    }) {
      if (k === 0 && B > 0) {
        t.on("sync", a);
        return
      }
      if (k > 0 && B === 0) {
        t.removeListener("sync", a);
        return
      }
    }
  }

  function AI(t) {
    return O8(async (...e) => {
      const r = await t(...e);
      return mV(r.id)
    })
  }

  function O8(t) {
    return kke(async (e, r) => {
      const n = await t.apply(null, e.params);
      r.result = n
    })
  }

  function Dke({
    mutex: t
  }) {
    return e => async (r, n, i, s) => {
      (await t.acquire())(), e(r, n, i, s)
    }
  }

  function xm(t, e) {
    const r = [];
    for (let n in t) r.push(t[n]);
    return r
  }
  const Lke = Db.default,
    {
      createAsyncMiddleware: wV,
      createScaffoldMiddleware: Bke
    } = cI,
    Uke = $ke,
    {
      unsafeRandomBytes: jke,
      incrementHexInt: Fke
    } = Zb,
    Wke = CI;
  var zke = Hke;

  function Hke({
    blockTracker: t,
    provider: e
  }) {
    const r = {},
      n = Uke({
        blockTracker: t,
        provider: e
      });
    let i = !1;
    const s = new Lke,
      o = Bke({
        eth_subscribe: wV(a),
        eth_unsubscribe: wV(c)
      });
    return o.destroy = h, {
      events: s,
      middleware: o
    };
    async function a(f, w) {
      if (i) throw new Error("SubscriptionManager - attempting to use after destroying");
      const b = f.params[0],
        C = jke(16);
      let M;
      switch (b) {
        case "newHeads":
          M = N({
            subId: C
          });
          break;
        case "logs":
          const k = f.params[1],
            B = await n.newLogFilter(k);
          M = $({
            subId: C,
            filter: B
          });
          break;
        default:
          throw new Error(`SubscriptionManager - unsupported subscription type "${b}"`)
      }
      r[C] = M, w.result = C;
      return;

      function N({
        subId: k
      }) {
        const B = {
          type: b,
          destroy: async () => {
            t.removeListener("sync", B.update)
          },
          update: async ({
            oldBlock: F,
            newBlock: D
          }) => {
            const V = D,
              R = Fke(F);
            (await Wke({
              provider: e,
              fromBlock: R,
              toBlock: V
            })).map(qke).filter(Y => Y !== null).forEach(Y => {
              l(k, Y)
            })
          }
        };
        return t.on("sync", B.update), B
      }

      function $({
        subId: k,
        filter: B
      }) {
        return B.on("update", D => l(k, D)), {
          type: b,
          destroy: async () => await n.uninstallFilter(B.idHex)
        }
      }
    }
    async function c(f, w) {
      if (i) throw new Error("SubscriptionManager - attempting to use after destroying");
      const b = f.params[0],
        C = r[b];
      if (!C) {
        w.result = !1;
        return
      }
      delete r[b], await C.destroy(), w.result = !0
    }

    function l(f, w) {
      s.emit("notification", {
        jsonrpc: "2.0",
        method: "eth_subscription",
        params: {
          subscription: f,
          result: w
        }
      })
    }

    function h() {
      s.removeAllListeners();
      for (const f in r) r[f].destroy(), delete r[f];
      i = !0
    }
  }

  function qke(t) {
    return t == null ? null : {
      hash: t.hash,
      parentHash: t.parentHash,
      sha3Uncles: t.sha3Uncles,
      miner: t.miner,
      stateRoot: t.stateRoot,
      transactionsRoot: t.transactionsRoot,
      receiptsRoot: t.receiptsRoot,
      logsBloom: t.logsBloom,
      difficulty: t.difficulty,
      number: t.number,
      gasLimit: t.gasLimit,
      gasUsed: t.gasUsed,
      nonce: t.nonce,
      mixHash: t.mixHash,
      timestamp: t.timestamp,
      extraData: t.extraData
    }
  }
  Object.defineProperty(o8, "__esModule", {
    value: !0
  }), o8.SubscriptionManager = void 0;
  const Vke = cH,
    Kke = zke,
    vV = () => {};
  class Gke {
    constructor(e) {
      const r = new Vke.PollingBlockTracker({
          provider: e,
          pollingInterval: 15e3,
          setSkipCacheFlag: !0
        }),
        {
          events: n,
          middleware: i
        } = Kke({
          blockTracker: r,
          provider: e
        });
      this.events = n, this.subscriptionMiddleware = i
    }
    async handleRequest(e) {
      const r = {};
      return await this.subscriptionMiddleware(e, r, vV, vV), r
    }
    destroy() {
      this.subscriptionMiddleware.destroy()
    }
  }
  o8.SubscriptionManager = Gke;
  var bV = ot && ot.__importDefault || function (t) {
    return t && t.__esModule ? t : {
      default: t
    }
  };
  Object.defineProperty(Qg, "__esModule", {
    value: !0
  }), Qg.CoinbaseWalletProvider = void 0;
  const Zke = bV(E6),
    Yke = E9e,
    Hr = vb,
    xr = jt,
    Qke = xb,
    yV = Oa,
    D8 = Xg,
    Yo = Zg,
    SI = bV(REe),
    Yb = Jg,
    Jke = dm,
    Xke = o8,
    _V = "DefaultChainId",
    xV = "DefaultJsonRpcUrl";
  class eRe extends Yke.EventEmitter {
    constructor(e) {
      var r, n;
      super(), this._filterPolyfill = new Jke.FilterPolyfill(this), this._subscriptionManager = new Xke.SubscriptionManager(this), this._relay = null, this._addresses = [], this.hasMadeFirstChainChangedEmission = !1, this.setProviderInfo = this.setProviderInfo.bind(this), this.updateProviderInfo = this.updateProviderInfo.bind(this), this.getChainId = this.getChainId.bind(this), this.setAppInfo = this.setAppInfo.bind(this), this.enable = this.enable.bind(this), this.close = this.close.bind(this), this.send = this.send.bind(this), this.sendAsync = this.sendAsync.bind(this), this.request = this.request.bind(this), this._setAddresses = this._setAddresses.bind(this), this.scanQRCode = this.scanQRCode.bind(this), this.genericRequest = this.genericRequest.bind(this), this._chainIdFromOpts = e.chainId, this._jsonRpcUrlFromOpts = e.jsonRpcUrl, this._overrideIsMetaMask = e.overrideIsMetaMask, this._relayProvider = e.relayProvider, this._storage = e.storage, this._relayEventManager = e.relayEventManager, this.diagnostic = e.diagnosticLogger, this.reloadOnDisconnect = !0, this.isCoinbaseWallet = (r = e.overrideIsCoinbaseWallet) !== null && r !== void 0 ? r : !0, this.isCoinbaseBrowser = (n = e.overrideIsCoinbaseBrowser) !== null && n !== void 0 ? n : !1, this.qrUrl = e.qrUrl;
      const i = this.getChainId(),
        s = (0, xr.prepend0x)(i.toString(16));
      this.emit("connect", {
        chainIdStr: s
      });
      const o = this._storage.getItem(yV.LOCAL_STORAGE_ADDRESSES_KEY);
      if (o) {
        const a = o.split(" ");
        a[0] !== "" && (this._addresses = a.map(c => (0, xr.ensureAddressString)(c)), this.emit("accountsChanged", a))
      }
      this._subscriptionManager.events.on("notification", a => {
        this.emit("message", {
          type: a.method,
          data: a.params
        })
      }), this._isAuthorized() && this.initializeRelay(), window.addEventListener("message", a => {
        var c;
        if (!(a.origin !== location.origin || a.source !== window) && a.data.type === "walletLinkMessage" && a.data.data.action === "dappChainSwitched") {
          const l = a.data.data.chainId,
            h = (c = a.data.data.jsonRpcUrl) !== null && c !== void 0 ? c : this.jsonRpcUrl;
          this.updateProviderInfo(h, Number(l))
        }
      })
    }
    get selectedAddress() {
      return this._addresses[0] || void 0
    }
    get networkVersion() {
      return this.getChainId().toString(10)
    }
    get chainId() {
      return (0, xr.prepend0x)(this.getChainId().toString(16))
    }
    get isWalletLink() {
      return !0
    }
    get isMetaMask() {
      return this._overrideIsMetaMask
    }
    get host() {
      return this.jsonRpcUrl
    }
    get connected() {
      return !0
    }
    isConnected() {
      return !0
    }
    get jsonRpcUrl() {
      var e;
      return (e = this._storage.getItem(xV)) !== null && e !== void 0 ? e : this._jsonRpcUrlFromOpts
    }
    set jsonRpcUrl(e) {
      this._storage.setItem(xV, e)
    }
    disableReloadOnDisconnect() {
      this.reloadOnDisconnect = !1
    }
    setProviderInfo(e, r) {
      this.isCoinbaseBrowser || (this._chainIdFromOpts = r, this._jsonRpcUrlFromOpts = e), this.updateProviderInfo(this.jsonRpcUrl, this.getChainId())
    }
    updateProviderInfo(e, r) {
      this.jsonRpcUrl = e;
      const n = this.getChainId();
      this._storage.setItem(_V, r.toString(10)), ((0, xr.ensureIntNumber)(r) !== n || !this.hasMadeFirstChainChangedEmission) && (this.emit("chainChanged", this.getChainId()), this.hasMadeFirstChainChangedEmission = !0)
    }
    async watchAsset(e, r, n, i, s, o) {
      const c = await (await this.initializeRelay()).watchAsset(e, r, n, i, s, o?.toString()).promise;
      return (0, Yo.isErrorResponse)(c) ? !1 : !!c.result
    }
    async addEthereumChain(e, r, n, i, s, o) {
      var a, c;
      if ((0, xr.ensureIntNumber)(e) === this.getChainId()) return !1;
      const l = await this.initializeRelay(),
        h = l.inlineAddEthereumChain(e.toString());
      !this._isAuthorized() && !h && await l.requestEthereumAccounts().promise;
      const f = await l.addEthereumChain(e.toString(), r, s, n, i, o).promise;
      return (0, Yo.isErrorResponse)(f) ? !1 : (((a = f.result) === null || a === void 0 ? void 0 : a.isApproved) === !0 && this.updateProviderInfo(r[0], e), ((c = f.result) === null || c === void 0 ? void 0 : c.isApproved) === !0)
    }
    async switchEthereumChain(e) {
      const n = await (await this.initializeRelay()).switchEthereumChain(e.toString(10), this.selectedAddress || void 0).promise;
      if ((0, Yo.isErrorResponse)(n)) {
        if (!n.errorCode) return;
        throw n.errorCode === Hr.standardErrorCodes.provider.unsupportedChain ? Hr.standardErrors.provider.unsupportedChain() : Hr.standardErrors.provider.custom({
          message: n.errorMessage,
          code: n.errorCode
        })
      }
      const i = n.result;
      i.isApproved && i.rpcUrl.length > 0 && this.updateProviderInfo(i.rpcUrl, e)
    }
    setAppInfo(e, r) {
      this.initializeRelay().then(n => n.setAppInfo(e, r))
    }
    async enable() {
      var e;
      return (e = this.diagnostic) === null || e === void 0 || e.log(Yb.EVENTS.ETH_ACCOUNTS_STATE, {
        method: "provider::enable",
        addresses_length: this._addresses.length,
        sessionIdHash: this._relay ? D8.Session.hash(this._relay.session.id) : void 0
      }), this._isAuthorized() ? [...this._addresses] : await this.send("eth_requestAccounts")
    }
    async close() {
      (await this.initializeRelay()).resetAndReload()
    }
    send(e, r) {
      try {
        const n = this._send(e, r);
        if (n instanceof Promise) return n.catch(i => {
          throw (0, Hr.serializeError)(i, e)
        })
      } catch (n) {
        throw (0, Hr.serializeError)(n, e)
      }
    }
    _send(e, r) {
      if (typeof e == "string") {
        const i = e,
          s = Array.isArray(r) ? r : r !== void 0 ? [r] : [],
          o = {
            jsonrpc: "2.0",
            id: 0,
            method: i,
            params: s
          };
        return this._sendRequestAsync(o).then(a => a.result)
      }
      if (typeof r == "function") {
        const i = e,
          s = r;
        return this._sendAsync(i, s)
      }
      if (Array.isArray(e)) return e.map(s => this._sendRequest(s));
      const n = e;
      return this._sendRequest(n)
    }
    async sendAsync(e, r) {
      try {
        return this._sendAsync(e, r).catch(n => {
          throw (0, Hr.serializeError)(n, e)
        })
      } catch (n) {
        return Promise.reject((0, Hr.serializeError)(n, e))
      }
    }
    async _sendAsync(e, r) {
      if (typeof r != "function") throw new Error("callback is required");
      if (Array.isArray(e)) {
        const i = r;
        this._sendMultipleRequestsAsync(e).then(s => i(null, s)).catch(s => i(s, null));
        return
      }
      const n = r;
      return this._sendRequestAsync(e).then(i => n(null, i)).catch(i => n(i, null))
    }
    async request(e) {
      try {
        return this._request(e).catch(r => {
          throw (0, Hr.serializeError)(r, e.method)
        })
      } catch (r) {
        return Promise.reject((0, Hr.serializeError)(r, e.method))
      }
    }
    async _request(e) {
      if (!e || typeof e != "object" || Array.isArray(e)) throw Hr.standardErrors.rpc.invalidRequest({
        message: "Expected a single, non-array, object argument.",
        data: e
      });
      const {
        method: r,
        params: n
      } = e;
      if (typeof r != "string" || r.length === 0) throw Hr.standardErrors.rpc.invalidRequest({
        message: "'args.method' must be a non-empty string.",
        data: e
      });
      if (n !== void 0 && !Array.isArray(n) && (typeof n != "object" || n === null)) throw Hr.standardErrors.rpc.invalidRequest({
        message: "'args.params' must be an object or array if provided.",
        data: e
      });
      const i = n === void 0 ? [] : n,
        s = this._relayEventManager.makeRequestId();
      return (await this._sendRequestAsync({
        method: r,
        params: i,
        jsonrpc: "2.0",
        id: s
      })).result
    }
    async scanQRCode(e) {
      const n = await (await this.initializeRelay()).scanQRCode((0, xr.ensureRegExpString)(e)).promise;
      if ((0, Yo.isErrorResponse)(n)) throw (0, Hr.serializeError)(n.errorMessage, "scanQRCode");
      if (typeof n.result != "string") throw (0, Hr.serializeError)("result was not a string", "scanQRCode");
      return n.result
    }
    async genericRequest(e, r) {
      const i = await (await this.initializeRelay()).genericRequest(e, r).promise;
      if ((0, Yo.isErrorResponse)(i)) throw (0, Hr.serializeError)(i.errorMessage, "generic");
      if (typeof i.result != "string") throw (0, Hr.serializeError)("result was not a string", "generic");
      return i.result
    }
    async connectAndSignIn(e) {
      var r;
      (r = this.diagnostic) === null || r === void 0 || r.log(Yb.EVENTS.ETH_ACCOUNTS_STATE, {
        method: "provider::connectAndSignIn",
        sessionIdHash: this._relay ? D8.Session.hash(this._relay.session.id) : void 0
      });
      let n;
      try {
        const s = await this.initializeRelay();
        if (!(s instanceof Qke.MobileRelay)) throw new Error("connectAndSignIn is only supported on mobile");
        if (n = await s.connectAndSignIn(e).promise, (0, Yo.isErrorResponse)(n)) throw new Error(n.errorMessage)
      } catch (s) {
        throw typeof s.message == "string" && s.message.match(/(denied|rejected)/i) ? Hr.standardErrors.provider.userRejectedRequest("User denied account authorization") : s
      }
      if (!n.result) throw new Error("accounts received is empty");
      const {
        accounts: i
      } = n.result;
      return this._setAddresses(i), this.isCoinbaseBrowser || await this.switchEthereumChain(this.getChainId()), n.result
    }
    async selectProvider(e) {
      const n = await (await this.initializeRelay()).selectProvider(e).promise;
      if ((0, Yo.isErrorResponse)(n)) throw (0, Hr.serializeError)(n.errorMessage, "selectProvider");
      if (typeof n.result != "string") throw (0, Hr.serializeError)("result was not a string", "selectProvider");
      return n.result
    }
    supportsSubscriptions() {
      return !1
    }
    subscribe() {
      throw new Error("Subscriptions are not supported")
    }
    unsubscribe() {
      throw new Error("Subscriptions are not supported")
    }
    disconnect() {
      return !0
    }
    _sendRequest(e) {
      const r = {
          jsonrpc: "2.0",
          id: e.id
        },
        {
          method: n
        } = e;
      if (r.result = this._handleSynchronousMethods(e), r.result === void 0) throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);
      return r
    }
    _setAddresses(e, r) {
      if (!Array.isArray(e)) throw new Error("addresses is not an array");
      const n = e.map(i => (0, xr.ensureAddressString)(i));
      JSON.stringify(n) !== JSON.stringify(this._addresses) && (this._addresses = n, this.emit("accountsChanged", this._addresses), this._storage.setItem(yV.LOCAL_STORAGE_ADDRESSES_KEY, n.join(" ")))
    }
    _sendRequestAsync(e) {
      return new Promise((r, n) => {
        try {
          const i = this._handleSynchronousMethods(e);
          if (i !== void 0) return r({
            jsonrpc: "2.0",
            id: e.id,
            result: i
          });
          const s = this._handleAsynchronousFilterMethods(e);
          if (s !== void 0) {
            s.then(a => r(Object.assign(Object.assign({}, a), {
              id: e.id
            }))).catch(a => n(a));
            return
          }
          const o = this._handleSubscriptionMethods(e);
          if (o !== void 0) {
            o.then(a => r({
              jsonrpc: "2.0",
              id: e.id,
              result: a.result
            })).catch(a => n(a));
            return
          }
        } catch (i) {
          return n(i)
        }
        this._handleAsynchronousMethods(e).then(i => i && r(Object.assign(Object.assign({}, i), {
          id: e.id
        }))).catch(i => n(i))
      })
    }
    _sendMultipleRequestsAsync(e) {
      return Promise.all(e.map(r => this._sendRequestAsync(r)))
    }
    _handleSynchronousMethods(e) {
      const {
        method: r
      } = e, n = e.params || [];
      switch (r) {
        case "eth_accounts":
          return this._eth_accounts();
        case "eth_coinbase":
          return this._eth_coinbase();
        case "eth_uninstallFilter":
          return this._eth_uninstallFilter(n);
        case "net_version":
          return this._net_version();
        case "eth_chainId":
          return this._eth_chainId();
        default:
          return
      }
    }
    async _handleAsynchronousMethods(e) {
      const {
        method: r
      } = e, n = e.params || [];
      switch (r) {
        case "eth_requestAccounts":
          return this._eth_requestAccounts();
        case "eth_sign":
          return this._eth_sign(n);
        case "eth_ecRecover":
          return this._eth_ecRecover(n);
        case "personal_sign":
          return this._personal_sign(n);
        case "personal_ecRecover":
          return this._personal_ecRecover(n);
        case "eth_signTransaction":
          return this._eth_signTransaction(n);
        case "eth_sendRawTransaction":
          return this._eth_sendRawTransaction(n);
        case "eth_sendTransaction":
          return this._eth_sendTransaction(n);
        case "eth_signTypedData_v1":
          return this._eth_signTypedData_v1(n);
        case "eth_signTypedData_v2":
          return this._throwUnsupportedMethodError();
        case "eth_signTypedData_v3":
          return this._eth_signTypedData_v3(n);
        case "eth_signTypedData_v4":
        case "eth_signTypedData":
          return this._eth_signTypedData_v4(n);
        case "cbWallet_arbitrary":
          return this._cbwallet_arbitrary(n);
        case "wallet_addEthereumChain":
          return this._wallet_addEthereumChain(n);
        case "wallet_switchEthereumChain":
          return this._wallet_switchEthereumChain(n);
        case "wallet_watchAsset":
          return this._wallet_watchAsset(n)
      }
      return (await this.initializeRelay()).makeEthereumJSONRPCRequest(e, this.jsonRpcUrl).catch(s => {
        var o;
        throw (s.code === Hr.standardErrorCodes.rpc.methodNotFound || s.code === Hr.standardErrorCodes.rpc.methodNotSupported) && ((o = this.diagnostic) === null || o === void 0 || o.log(Yb.EVENTS.METHOD_NOT_IMPLEMENTED, {
          method: e.method,
          sessionIdHash: this._relay ? D8.Session.hash(this._relay.session.id) : void 0
        })), s
      })
    }
    _handleAsynchronousFilterMethods(e) {
      const {
        method: r
      } = e, n = e.params || [];
      switch (r) {
        case "eth_newFilter":
          return this._eth_newFilter(n);
        case "eth_newBlockFilter":
          return this._eth_newBlockFilter();
        case "eth_newPendingTransactionFilter":
          return this._eth_newPendingTransactionFilter();
        case "eth_getFilterChanges":
          return this._eth_getFilterChanges(n);
        case "eth_getFilterLogs":
          return this._eth_getFilterLogs(n)
      }
    }
    _handleSubscriptionMethods(e) {
      switch (e.method) {
        case "eth_subscribe":
        case "eth_unsubscribe":
          return this._subscriptionManager.handleRequest(e)
      }
    }
    _isKnownAddress(e) {
      try {
        const r = (0, xr.ensureAddressString)(e);
        return this._addresses.map(i => (0, xr.ensureAddressString)(i)).includes(r)
      } catch {}
      return !1
    }
    _ensureKnownAddress(e) {
      var r;
      if (!this._isKnownAddress(e)) throw (r = this.diagnostic) === null || r === void 0 || r.log(Yb.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED), new Error("Unknown Ethereum address")
    }
    _prepareTransactionParams(e) {
      const r = e.from ? (0, xr.ensureAddressString)(e.from) : this.selectedAddress;
      if (!r) throw new Error("Ethereum address is unavailable");
      this._ensureKnownAddress(r);
      const n = e.to ? (0, xr.ensureAddressString)(e.to) : null,
        i = e.value != null ? (0, xr.ensureBN)(e.value) : new Zke.default(0),
        s = e.data ? (0, xr.ensureBuffer)(e.data) : Buffer.alloc(0),
        o = e.nonce != null ? (0, xr.ensureIntNumber)(e.nonce) : null,
        a = e.gasPrice != null ? (0, xr.ensureBN)(e.gasPrice) : null,
        c = e.maxFeePerGas != null ? (0, xr.ensureBN)(e.maxFeePerGas) : null,
        l = e.maxPriorityFeePerGas != null ? (0, xr.ensureBN)(e.maxPriorityFeePerGas) : null,
        h = e.gas != null ? (0, xr.ensureBN)(e.gas) : null,
        f = e.chainId ? (0, xr.ensureIntNumber)(e.chainId) : this.getChainId();
      return {
        fromAddress: r,
        toAddress: n,
        weiValue: i,
        data: s,
        nonce: o,
        gasPriceInWei: a,
        maxFeePerGas: c,
        maxPriorityFeePerGas: l,
        gasLimit: h,
        chainId: f
      }
    }
    _isAuthorized() {
      return this._addresses.length > 0
    }
    _requireAuthorization() {
      if (!this._isAuthorized()) throw Hr.standardErrors.provider.unauthorized({})
    }
    _throwUnsupportedMethodError() {
      throw Hr.standardErrors.provider.unsupportedMethod({})
    }
    async _signEthereumMessage(e, r, n, i) {
      this._ensureKnownAddress(r);
      try {
        const o = await (await this.initializeRelay()).signEthereumMessage(e, r, n, i).promise;
        if ((0, Yo.isErrorResponse)(o)) throw new Error(o.errorMessage);
        return {
          jsonrpc: "2.0",
          id: 0,
          result: o.result
        }
      } catch (s) {
        throw typeof s.message == "string" && s.message.match(/(denied|rejected)/i) ? Hr.standardErrors.provider.userRejectedRequest("User denied message signature") : s
      }
    }
    async _ethereumAddressFromSignedMessage(e, r, n) {
      const s = await (await this.initializeRelay()).ethereumAddressFromSignedMessage(e, r, n).promise;
      if ((0, Yo.isErrorResponse)(s)) throw new Error(s.errorMessage);
      return {
        jsonrpc: "2.0",
        id: 0,
        result: s.result
      }
    }
    _eth_accounts() {
      return [...this._addresses]
    }
    _eth_coinbase() {
      return this.selectedAddress || null
    }
    _net_version() {
      return this.getChainId().toString(10)
    }
    _eth_chainId() {
      return (0, xr.hexStringFromIntNumber)(this.getChainId())
    }
    getChainId() {
      const e = this._storage.getItem(_V);
      if (!e) return (0, xr.ensureIntNumber)(this._chainIdFromOpts);
      const r = parseInt(e, 10);
      return (0, xr.ensureIntNumber)(r)
    }
    async _eth_requestAccounts() {
      var e;
      if ((e = this.diagnostic) === null || e === void 0 || e.log(Yb.EVENTS.ETH_ACCOUNTS_STATE, {
          method: "provider::_eth_requestAccounts",
          addresses_length: this._addresses.length,
          sessionIdHash: this._relay ? D8.Session.hash(this._relay.session.id) : void 0
        }), this._isAuthorized()) return Promise.resolve({
        jsonrpc: "2.0",
        id: 0,
        result: this._addresses
      });
      let r;
      try {
        if (r = await (await this.initializeRelay()).requestEthereumAccounts().promise, (0, Yo.isErrorResponse)(r)) throw new Error(r.errorMessage)
      } catch (n) {
        throw typeof n.message == "string" && n.message.match(/(denied|rejected)/i) ? Hr.standardErrors.provider.userRejectedRequest("User denied account authorization") : n
      }
      if (!r.result) throw new Error("accounts received is empty");
      return this._setAddresses(r.result), this.isCoinbaseBrowser || await this.switchEthereumChain(this.getChainId()), {
        jsonrpc: "2.0",
        id: 0,
        result: this._addresses
      }
    }
    _eth_sign(e) {
      this._requireAuthorization();
      const r = (0, xr.ensureAddressString)(e[0]),
        n = (0, xr.ensureBuffer)(e[1]);
      return this._signEthereumMessage(n, r, !1)
    }
    _eth_ecRecover(e) {
      const r = (0, xr.ensureBuffer)(e[0]),
        n = (0, xr.ensureBuffer)(e[1]);
      return this._ethereumAddressFromSignedMessage(r, n, !1)
    }
    _personal_sign(e) {
      this._requireAuthorization();
      const r = (0, xr.ensureBuffer)(e[0]),
        n = (0, xr.ensureAddressString)(e[1]);
      return this._signEthereumMessage(r, n, !0)
    }
    _personal_ecRecover(e) {
      const r = (0, xr.ensureBuffer)(e[0]),
        n = (0, xr.ensureBuffer)(e[1]);
      return this._ethereumAddressFromSignedMessage(r, n, !0)
    }
    async _eth_signTransaction(e) {
      this._requireAuthorization();
      const r = this._prepareTransactionParams(e[0] || {});
      try {
        const i = await (await this.initializeRelay()).signEthereumTransaction(r).promise;
        if ((0, Yo.isErrorResponse)(i)) throw new Error(i.errorMessage);
        return {
          jsonrpc: "2.0",
          id: 0,
          result: i.result
        }
      } catch (n) {
        throw typeof n.message == "string" && n.message.match(/(denied|rejected)/i) ? Hr.standardErrors.provider.userRejectedRequest("User denied transaction signature") : n
      }
    }
    async _eth_sendRawTransaction(e) {
      const r = (0, xr.ensureBuffer)(e[0]),
        i = await (await this.initializeRelay()).submitEthereumTransaction(r, this.getChainId()).promise;
      if ((0, Yo.isErrorResponse)(i)) throw new Error(i.errorMessage);
      return {
        jsonrpc: "2.0",
        id: 0,
        result: i.result
      }
    }
    async _eth_sendTransaction(e) {
      this._requireAuthorization();
      const r = this._prepareTransactionParams(e[0] || {});
      try {
        const i = await (await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise;
        if ((0, Yo.isErrorResponse)(i)) throw new Error(i.errorMessage);
        return {
          jsonrpc: "2.0",
          id: 0,
          result: i.result
        }
      } catch (n) {
        throw typeof n.message == "string" && n.message.match(/(denied|rejected)/i) ? Hr.standardErrors.provider.userRejectedRequest("User denied transaction signature") : n
      }
    }
    async _eth_signTypedData_v1(e) {
      this._requireAuthorization();
      const r = (0, xr.ensureParsedJSONObject)(e[0]),
        n = (0, xr.ensureAddressString)(e[1]);
      this._ensureKnownAddress(n);
      const i = SI.default.hashForSignTypedDataLegacy({
          data: r
        }),
        s = JSON.stringify(r, null, 2);
      return this._signEthereumMessage(i, n, !1, s)
    }
    async _eth_signTypedData_v3(e) {
      this._requireAuthorization();
      const r = (0, xr.ensureAddressString)(e[0]),
        n = (0, xr.ensureParsedJSONObject)(e[1]);
      this._ensureKnownAddress(r);
      const i = SI.default.hashForSignTypedData_v3({
          data: n
        }),
        s = JSON.stringify(n, null, 2);
      return this._signEthereumMessage(i, r, !1, s)
    }
    async _eth_signTypedData_v4(e) {
      this._requireAuthorization();
      const r = (0, xr.ensureAddressString)(e[0]),
        n = (0, xr.ensureParsedJSONObject)(e[1]);
      this._ensureKnownAddress(r);
      const i = SI.default.hashForSignTypedData_v4({
          data: n
        }),
        s = JSON.stringify(n, null, 2);
      return this._signEthereumMessage(i, r, !1, s)
    }
    async _cbwallet_arbitrary(e) {
      const r = e[0],
        n = e[1];
      if (typeof n != "string") throw new Error("parameter must be a string");
      if (typeof r != "object" || r === null) throw new Error("parameter must be an object");
      return {
        jsonrpc: "2.0",
        id: 0,
        result: await this.genericRequest(r, n)
      }
    }
    async _wallet_addEthereumChain(e) {
      var r, n, i, s;
      const o = e[0];
      if (((r = o.rpcUrls) === null || r === void 0 ? void 0 : r.length) === 0) return {
        jsonrpc: "2.0",
        id: 0,
        error: {
          code: 2,
          message: "please pass in at least 1 rpcUrl"
        }
      };
      if (!o.chainName || o.chainName.trim() === "") throw Hr.standardErrors.rpc.invalidParams("chainName is a required field");
      if (!o.nativeCurrency) throw Hr.standardErrors.rpc.invalidParams("nativeCurrency is a required field");
      const a = parseInt(o.chainId, 16);
      return await this.addEthereumChain(a, (n = o.rpcUrls) !== null && n !== void 0 ? n : [], (i = o.blockExplorerUrls) !== null && i !== void 0 ? i : [], o.chainName, (s = o.iconUrls) !== null && s !== void 0 ? s : [], o.nativeCurrency) ? {
        jsonrpc: "2.0",
        id: 0,
        result: null
      } : {
        jsonrpc: "2.0",
        id: 0,
        error: {
          code: 2,
          message: "unable to add ethereum chain"
        }
      }
    }
    async _wallet_switchEthereumChain(e) {
      const r = e[0];
      return await this.switchEthereumChain(parseInt(r.chainId, 16)), {
        jsonrpc: "2.0",
        id: 0,
        result: null
      }
    }
    async _wallet_watchAsset(e) {
      const r = Array.isArray(e) ? e[0] : e;
      if (!r.type) throw Hr.standardErrors.rpc.invalidParams("Type is required");
      if (r?.type !== "ERC20") throw Hr.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);
      if (!r?.options) throw Hr.standardErrors.rpc.invalidParams("Options are required");
      if (!r?.options.address) throw Hr.standardErrors.rpc.invalidParams("Address is required");
      const n = this.getChainId(),
        {
          address: i,
          symbol: s,
          image: o,
          decimals: a
        } = r.options;
      return {
        jsonrpc: "2.0",
        id: 0,
        result: await this.watchAsset(r.type, i, s, a, o, n)
      }
    }
    _eth_uninstallFilter(e) {
      const r = (0, xr.ensureHexString)(e[0]);
      return this._filterPolyfill.uninstallFilter(r)
    }
    async _eth_newFilter(e) {
      const r = e[0];
      return {
        jsonrpc: "2.0",
        id: 0,
        result: await this._filterPolyfill.newFilter(r)
      }
    }
    async _eth_newBlockFilter() {
      return {
        jsonrpc: "2.0",
        id: 0,
        result: await this._filterPolyfill.newBlockFilter()
      }
    }
    async _eth_newPendingTransactionFilter() {
      return {
        jsonrpc: "2.0",
        id: 0,
        result: await this._filterPolyfill.newPendingTransactionFilter()
      }
    }
    _eth_getFilterChanges(e) {
      const r = (0, xr.ensureHexString)(e[0]);
      return this._filterPolyfill.getFilterChanges(r)
    }
    _eth_getFilterLogs(e) {
      const r = (0, xr.ensureHexString)(e[0]);
      return this._filterPolyfill.getFilterLogs(r)
    }
    initializeRelay() {
      return this._relay ? Promise.resolve(this._relay) : this._relayProvider().then(e => (e.setAccountsCallback((r, n) => this._setAddresses(r, n)), e.setChainCallback((r, n) => {
        this.updateProviderInfo(n, parseInt(r, 10))
      }), e.setDappDefaultChainCallback(this._chainIdFromOpts), this._relay = e, e))
    }
  }
  Qg.CoinbaseWalletProvider = eRe;
  var L8 = {};
  Object.defineProperty(L8, "__esModule", {
    value: !0
  }), L8.RelayEventManager = void 0;
  const tRe = jt;
  class rRe {
    constructor() {
      this._nextRequestId = 0, this.callbacks = new Map
    }
    makeRequestId() {
      this._nextRequestId = (this._nextRequestId + 1) % 2147483647;
      const e = this._nextRequestId,
        r = (0, tRe.prepend0x)(e.toString(16));
      return this.callbacks.get(r) && this.callbacks.delete(r), e
    }
  }
  L8.RelayEventManager = rRe, Object.defineProperty(wb, "__esModule", {
    value: !0
  }), wb.CoinbaseWalletSDK = void 0;
  const nRe = x6,
    iRe = C6,
    CV = jt,
    sRe = k6,
    oRe = Qg,
    aRe = xb,
    cRe = Mb,
    lRe = L8,
    uRe = Tb,
    dRe = Cb,
    EV = Yg;
  class B8 {
    constructor(e) {
      var r, n, i;
      this._appName = "", this._appLogoUrl = null, this._relay = null, this._relayEventManager = null;
      const s = e.linkAPIUrl || iRe.LINK_API_URL;
      typeof e.overrideIsMetaMask > "u" ? this._overrideIsMetaMask = !1 : this._overrideIsMetaMask = e.overrideIsMetaMask, this._overrideIsCoinbaseWallet = (r = e.overrideIsCoinbaseWallet) !== null && r !== void 0 ? r : !0, this._overrideIsCoinbaseBrowser = (n = e.overrideIsCoinbaseBrowser) !== null && n !== void 0 ? n : !1, this._diagnosticLogger = e.diagnosticLogger, this._reloadOnDisconnect = (i = e.reloadOnDisconnect) !== null && i !== void 0 ? i : !0;
      const o = new URL(s),
        a = `${o.protocol}//${o.host}`;
      if (this._storage = new sRe.ScopedLocalStorage(`-walletlink:${a}`), this._storage.setItem("version", B8.VERSION), this.walletExtension || this.coinbaseBrowser) return;
      this._relayEventManager = new lRe.RelayEventManager;
      const c = (0, CV.isMobileWeb)(),
        l = e.uiConstructor || (f => c ? new cRe.MobileRelayUI(f) : new uRe.WalletLinkRelayUI(f)),
        h = {
          linkAPIUrl: s,
          version: EV.LIB_VERSION,
          darkMode: !!e.darkMode,
          headlessMode: !!e.headlessMode,
          uiConstructor: l,
          storage: this._storage,
          relayEventManager: this._relayEventManager,
          diagnosticLogger: this._diagnosticLogger,
          reloadOnDisconnect: this._reloadOnDisconnect,
          enableMobileWalletLink: e.enableMobileWalletLink
        };
      this._relay = c ? new aRe.MobileRelay(h) : new dRe.WalletLinkRelay(h), this.setAppInfo(e.appName, e.appLogoUrl), !e.headlessMode && this._relay.attachUI()
    }
    makeWeb3Provider(e = "", r = 1) {
      const n = this.walletExtension;
      if (n) return this.isCipherProvider(n) || n.setProviderInfo(e, r), this._reloadOnDisconnect === !1 && typeof n.disableReloadOnDisconnect == "function" && n.disableReloadOnDisconnect(), n;
      const i = this.coinbaseBrowser;
      if (i) return i;
      const s = this._relay;
      if (!s || !this._relayEventManager || !this._storage) throw new Error("Relay not initialized, should never happen");
      return e || s.setConnectDisabled(!0), new oRe.CoinbaseWalletProvider({
        relayProvider: () => Promise.resolve(s),
        relayEventManager: this._relayEventManager,
        storage: this._storage,
        jsonRpcUrl: e,
        chainId: r,
        qrUrl: this.getQrUrl(),
        diagnosticLogger: this._diagnosticLogger,
        overrideIsMetaMask: this._overrideIsMetaMask,
        overrideIsCoinbaseWallet: this._overrideIsCoinbaseWallet,
        overrideIsCoinbaseBrowser: this._overrideIsCoinbaseBrowser
      })
    }
    setAppInfo(e, r) {
      var n;
      this._appName = e || "DApp", this._appLogoUrl = r || (0, CV.getFavicon)();
      const i = this.walletExtension;
      i ? this.isCipherProvider(i) || i.setAppInfo(this._appName, this._appLogoUrl) : (n = this._relay) === null || n === void 0 || n.setAppInfo(this._appName, this._appLogoUrl)
    }
    disconnect() {
      var e;
      const r = this === null || this === void 0 ? void 0 : this.walletExtension;
      r ? r.close() : (e = this._relay) === null || e === void 0 || e.resetAndReload()
    }
    getQrUrl() {
      var e, r;
      return (r = (e = this._relay) === null || e === void 0 ? void 0 : e.getQRCodeUrl()) !== null && r !== void 0 ? r : null
    }
    getCoinbaseWalletLogo(e, r = 240) {
      return (0, nRe.walletLogo)(e, r)
    }
    get walletExtension() {
      var e;
      return (e = window.coinbaseWalletExtension) !== null && e !== void 0 ? e : window.walletLinkExtension
    }
    get coinbaseBrowser() {
      var e, r;
      try {
        const n = (e = window.ethereum) !== null && e !== void 0 ? e : (r = window.top) === null || r === void 0 ? void 0 : r.ethereum;
        return n && "isCoinbaseBrowser" in n && n.isCoinbaseBrowser ? n : void 0
      } catch {
        return
      }
    }
    isCipherProvider(e) {
      return typeof e.isCipher == "boolean" && e.isCipher
    }
  }
  wb.CoinbaseWalletSDK = B8, B8.VERSION = EV.LIB_VERSION,
    function (t) {
      Object.defineProperty(t, "__esModule", {
        value: !0
      }), t.CoinbaseWalletProvider = t.CoinbaseWalletSDK = void 0;
      const e = wb,
        r = Qg;
      var n = wb;
      Object.defineProperty(t, "CoinbaseWalletSDK", {
        enumerable: !0,
        get: function () {
          return n.CoinbaseWalletSDK
        }
      });
      var i = Qg;
      Object.defineProperty(t, "CoinbaseWalletProvider", {
        enumerable: !0,
        get: function () {
          return i.CoinbaseWalletProvider
        }
      }), t.default = e.CoinbaseWalletSDK, typeof window < "u" && (window.CoinbaseWalletSDK = e.CoinbaseWalletSDK, window.CoinbaseWalletProvider = r.CoinbaseWalletProvider, window.WalletLink = e.CoinbaseWalletSDK, window.WalletLinkProvider = r.CoinbaseWalletProvider)
    }(SW);
  const hRe = Object.freeze(Object.defineProperty({
      __proto__: null,
      default: Za(SW)
    }, Symbol.toStringTag, {
      value: "Module"
    })),
    AV = () => "9.1.0",
    fRe = t => t.toString(16).padStart(2, "0"),
    pRe = t => {
      const e = new Uint8Array(t / 2);
      return window.crypto.getRandomValues(e), Array.from(e, fRe).join("")
    },
    gRe = () => typeof window < "u" ? pRe(10) : new Date().getTime().toString(36);
  class Qb {}
  Qb.makeRequest = (t, e) => ({
    id: gRe(),
    method: t,
    params: e,
    env: {
      sdkVersion: AV()
    }
  }), Qb.makeResponse = (t, e, r) => ({
    id: t,
    success: !0,
    version: r,
    data: e
  }), Qb.makeErrorResponse = (t, e, r) => ({
    id: t,
    success: !1,
    error: e,
    version: r
  });
  var Qi;
  (function (t) {
    t.sendTransactions = "sendTransactions", t.rpcCall = "rpcCall", t.getChainInfo = "getChainInfo", t.getSafeInfo = "getSafeInfo", t.getTxBySafeTxHash = "getTxBySafeTxHash", t.getSafeBalances = "getSafeBalances", t.signMessage = "signMessage", t.signTypedMessage = "signTypedMessage", t.getEnvironmentInfo = "getEnvironmentInfo", t.getOffChainSignature = "getOffChainSignature", t.requestAddressBook = "requestAddressBook", t.wallet_getPermissions = "wallet_getPermissions", t.wallet_requestPermissions = "wallet_requestPermissions"
  })(Qi || (Qi = {}));
  var U8;
  (function (t) {
    t.requestAddressBook = "requestAddressBook"
  })(U8 || (U8 = {}));
  class mRe {
    constructor(e = null, r = !1) {
      this.allowedOrigins = null, this.callbacks = new Map, this.debugMode = !1, this.isServer = typeof window > "u", this.isValidMessage = ({
        origin: n,
        data: i,
        source: s
      }) => {
        const o = !i,
          a = !this.isServer && s === window.parent,
          c = typeof i.version < "u" && parseInt(i.version.split(".")[0]),
          l = typeof c == "number" && c >= 1;
        let h = !0;
        return Array.isArray(this.allowedOrigins) && (h = this.allowedOrigins.find(f => f.test(n)) !== void 0), !o && a && l && h
      }, this.logIncomingMessage = n => {
        console.info(`Safe Apps SDK v1: A message was received from origin ${n.origin}. `, n.data)
      }, this.onParentMessage = n => {
        this.isValidMessage(n) && (this.debugMode && this.logIncomingMessage(n), this.handleIncomingMessage(n.data))
      }, this.handleIncomingMessage = n => {
        const {
          id: i
        } = n, s = this.callbacks.get(i);
        s && (s(n), this.callbacks.delete(i))
      }, this.send = (n, i) => {
        const s = Qb.makeRequest(n, i);
        if (this.isServer) throw new Error("Window doesn't exist");
        return window.parent.postMessage(s, "*"), new Promise((o, a) => {
          this.callbacks.set(s.id, c => {
            if (!c.success) {
              a(new Error(c.error));
              return
            }
            o(c)
          })
        })
      }, this.allowedOrigins = e, this.debugMode = r, this.isServer || window.addEventListener("message", this.onParentMessage)
    }
  }
  const II = t => typeof t == "object" && t != null && "domain" in t && "types" in t && "message" in t;
  var wRe = {},
    cu = {},
    lu = {},
    TI = ot && ot.__awaiter || function (t, e, r, n) {
      function i(s) {
        return s instanceof r ? s : new r(function (o) {
          o(s)
        })
      }
      return new(r || (r = Promise))(function (s, o) {
        function a(h) {
          try {
            l(n.next(h))
          } catch (f) {
            o(f)
          }
        }

        function c(h) {
          try {
            l(n.throw(h))
          } catch (f) {
            o(f)
          }
        }

        function l(h) {
          h.done ? s(h.value) : i(h.value).then(a, c)
        }
        l((n = n.apply(t, e || [])).next())
      })
    };
  Object.defineProperty(lu, "__esModule", {
    value: !0
  }), lu.getData = lu.fetchData = lu.stringifyQuery = lu.insertParams = void 0;
  const vRe = t => typeof t == "object" && t !== null && "code" in t && "message" in t;

  function bRe(t, e, r) {
    return t.replace(new RegExp(`\\{${e}\\}`, "g"), r)
  }

  function yRe(t, e) {
    return e ? Object.keys(e).reduce((r, n) => bRe(r, n, String(e[n])), t) : t
  }
  lu.insertParams = yRe;

  function _Re(t) {
    if (!t) return "";
    const e = new URLSearchParams;
    Object.keys(t).forEach(n => {
      t[n] != null && e.append(n, String(t[n]))
    });
    const r = e.toString();
    return r ? `?${r}` : ""
  }
  lu.stringifyQuery = _Re;

  function SV(t) {
    return TI(this, void 0, void 0, function* () {
      let e;
      try {
        e = yield t.json()
      } catch {
        e = {}
      }
      if (!t.ok) {
        const r = vRe(e) ? `CGW error - ${e.code}: ${e.message}` : `CGW error - status ${t.statusText}`;
        throw new Error(r)
      }
      return e
    })
  }

  function xRe(t, e, r, n, i) {
    return TI(this, void 0, void 0, function* () {
      const s = Object.assign({
          "Content-Type": "application/json"
        }, n),
        o = {
          method: e ?? "POST",
          headers: s
        };
      i && (o.credentials = i), r != null && (o.body = typeof r == "string" ? r : JSON.stringify(r));
      const a = yield fetch(t, o);
      return SV(a)
    })
  }
  lu.fetchData = xRe;

  function CRe(t, e, r) {
    return TI(this, void 0, void 0, function* () {
      const n = {
        method: "GET"
      };
      e && (n.headers = Object.assign(Object.assign({}, e), {
        "Content-Type": "application/json"
      })), r && (n.credentials = r);
      const i = yield fetch(t, n);
      return SV(i)
    })
  }
  lu.getData = CRe, Object.defineProperty(cu, "__esModule", {
    value: !0
  }), cu.getEndpoint = cu.deleteEndpoint = cu.putEndpoint = cu.postEndpoint = void 0;
  const wp = lu;

  function j8(t, e, r, n) {
    const i = (0, wp.insertParams)(e, r),
      s = (0, wp.stringifyQuery)(n);
    return `${t}${i}${s}`
  }

  function ERe(t, e, r) {
    const n = j8(t, e, r?.path, r?.query);
    return (0, wp.fetchData)(n, "POST", r?.body, r?.headers, r?.credentials)
  }
  cu.postEndpoint = ERe;

  function ARe(t, e, r) {
    const n = j8(t, e, r?.path, r?.query);
    return (0, wp.fetchData)(n, "PUT", r?.body, r?.headers, r?.credentials)
  }
  cu.putEndpoint = ARe;

  function SRe(t, e, r) {
    const n = j8(t, e, r?.path, r?.query);
    return (0, wp.fetchData)(n, "DELETE", r?.body, r?.headers, r?.credentials)
  }
  cu.deleteEndpoint = SRe;

  function IRe(t, e, r, n) {
    if (n) return (0, wp.getData)(n, void 0, r?.credentials);
    const i = j8(t, e, r?.path, r?.query);
    return (0, wp.getData)(i, r?.headers, r?.credentials)
  }
  cu.getEndpoint = IRe;
  var F8 = {};
  Object.defineProperty(F8, "__esModule", {
    value: !0
  }), F8.DEFAULT_BASE_URL = void 0, F8.DEFAULT_BASE_URL = "https://safe-client.safe.global";
  var IV = {};
  (function (t) {
    Object.defineProperty(t, "__esModule", {
        value: !0
      }), t.ImplementationVersionState = void 0,
      function (e) {
        e.UP_TO_DATE = "UP_TO_DATE", e.OUTDATED = "OUTDATED", e.UNKNOWN = "UNKNOWN"
      }(t.ImplementationVersionState || (t.ImplementationVersionState = {}))
  })(IV);
  var TV = {};
  (function (t) {
    Object.defineProperty(t, "__esModule", {
        value: !0
      }), t.SafeAppSocialPlatforms = t.SafeAppFeatures = t.SafeAppAccessPolicyTypes = void 0,
      function (e) {
        e.NoRestrictions = "NO_RESTRICTIONS", e.DomainAllowlist = "DOMAIN_ALLOWLIST"
      }(t.SafeAppAccessPolicyTypes || (t.SafeAppAccessPolicyTypes = {})),
      function (e) {
        e.BATCHED_TRANSACTIONS = "BATCHED_TRANSACTIONS"
      }(t.SafeAppFeatures || (t.SafeAppFeatures = {})),
      function (e) {
        e.TWITTER = "TWITTER", e.GITHUB = "GITHUB", e.DISCORD = "DISCORD"
      }(t.SafeAppSocialPlatforms || (t.SafeAppSocialPlatforms = {}))
  })(TV);
  var kV = {};
  (function (t) {
    Object.defineProperty(t, "__esModule", {
        value: !0
      }), t.LabelValue = t.StartTimeValue = t.DurationType = t.DetailedExecutionInfoType = t.TransactionListItemType = t.ConflictType = t.TransactionInfoType = t.SettingsInfoType = t.TransactionTokenType = t.TransferDirection = t.TransactionStatus = t.Operation = void 0,
      function (e) {
        e[e.CALL = 0] = "CALL", e[e.DELEGATE = 1] = "DELEGATE"
      }(t.Operation || (t.Operation = {})),
      function (e) {
        e.AWAITING_CONFIRMATIONS = "AWAITING_CONFIRMATIONS", e.AWAITING_EXECUTION = "AWAITING_EXECUTION", e.CANCELLED = "CANCELLED", e.FAILED = "FAILED", e.SUCCESS = "SUCCESS"
      }(t.TransactionStatus || (t.TransactionStatus = {})),
      function (e) {
        e.INCOMING = "INCOMING", e.OUTGOING = "OUTGOING", e.UNKNOWN = "UNKNOWN"
      }(t.TransferDirection || (t.TransferDirection = {})),
      function (e) {
        e.ERC20 = "ERC20", e.ERC721 = "ERC721", e.NATIVE_COIN = "NATIVE_COIN"
      }(t.TransactionTokenType || (t.TransactionTokenType = {})),
      function (e) {
        e.SET_FALLBACK_HANDLER = "SET_FALLBACK_HANDLER", e.ADD_OWNER = "ADD_OWNER", e.REMOVE_OWNER = "REMOVE_OWNER", e.SWAP_OWNER = "SWAP_OWNER", e.CHANGE_THRESHOLD = "CHANGE_THRESHOLD", e.CHANGE_IMPLEMENTATION = "CHANGE_IMPLEMENTATION", e.ENABLE_MODULE = "ENABLE_MODULE", e.DISABLE_MODULE = "DISABLE_MODULE", e.SET_GUARD = "SET_GUARD", e.DELETE_GUARD = "DELETE_GUARD"
      }(t.SettingsInfoType || (t.SettingsInfoType = {})),
      function (e) {
        e.TRANSFER = "Transfer", e.SETTINGS_CHANGE = "SettingsChange", e.CUSTOM = "Custom", e.CREATION = "Creation", e.SWAP_ORDER = "SwapOrder", e.TWAP_ORDER = "TwapOrder", e.SWAP_TRANSFER = "SwapTransfer"
      }(t.TransactionInfoType || (t.TransactionInfoType = {})),
      function (e) {
        e.NONE = "None", e.HAS_NEXT = "HasNext", e.END = "End"
      }(t.ConflictType || (t.ConflictType = {})),
      function (e) {
        e.TRANSACTION = "TRANSACTION", e.LABEL = "LABEL", e.CONFLICT_HEADER = "CONFLICT_HEADER", e.DATE_LABEL = "DATE_LABEL"
      }(t.TransactionListItemType || (t.TransactionListItemType = {})),
      function (e) {
        e.MULTISIG = "MULTISIG", e.MODULE = "MODULE"
      }(t.DetailedExecutionInfoType || (t.DetailedExecutionInfoType = {})),
      function (e) {
        e.AUTO = "AUTO", e.LIMIT_DURATION = "LIMIT_DURATION"
      }(t.DurationType || (t.DurationType = {})),
      function (e) {
        e.AT_MINING_TIME = "AT_MINING_TIME", e.AT_EPOCH = "AT_EPOCH"
      }(t.StartTimeValue || (t.StartTimeValue = {})),
      function (e) {
        e.Queued = "Queued", e.Next = "Next"
      }(t.LabelValue || (t.LabelValue = {}))
  })(kV);
  var RV = {};
  (function (t) {
    Object.defineProperty(t, "__esModule", {
        value: !0
      }), t.FEATURES = t.GAS_PRICE_TYPE = t.RPC_AUTHENTICATION = void 0,
      function (e) {
        e.API_KEY_PATH = "API_KEY_PATH", e.NO_AUTHENTICATION = "NO_AUTHENTICATION", e.UNKNOWN = "UNKNOWN"
      }(t.RPC_AUTHENTICATION || (t.RPC_AUTHENTICATION = {})),
      function (e) {
        e.ORACLE = "ORACLE", e.FIXED = "FIXED", e.FIXED_1559 = "FIXED1559", e.UNKNOWN = "UNKNOWN"
      }(t.GAS_PRICE_TYPE || (t.GAS_PRICE_TYPE = {})),
      function (e) {
        e.ERC721 = "ERC721", e.SAFE_APPS = "SAFE_APPS", e.CONTRACT_INTERACTION = "CONTRACT_INTERACTION", e.DOMAIN_LOOKUP = "DOMAIN_LOOKUP", e.SPENDING_LIMIT = "SPENDING_LIMIT", e.EIP1559 = "EIP1559", e.SAFE_TX_GAS_OPTIONAL = "SAFE_TX_GAS_OPTIONAL", e.TX_SIMULATION = "TX_SIMULATION", e.EIP1271 = "EIP1271"
      }(t.FEATURES || (t.FEATURES = {}))
  })(RV);
  var NV = {};
  (function (t) {
    Object.defineProperty(t, "__esModule", {
        value: !0
      }), t.TokenType = void 0,
      function (e) {
        e.ERC20 = "ERC20", e.ERC721 = "ERC721", e.NATIVE_TOKEN = "NATIVE_TOKEN"
      }(t.TokenType || (t.TokenType = {}))
  })(NV);
  var MV = {};
  Object.defineProperty(MV, "__esModule", {
    value: !0
  });
  var PV = {};
  (function (t) {
    Object.defineProperty(t, "__esModule", {
        value: !0
      }), t.ConfirmationViewTypes = void 0,
      function (e) {
        e.COW_SWAP_ORDER = "COW_SWAP_ORDER", e.COW_SWAP_TWAP_ORDER = "COW_SWAP_TWAP_ORDER"
      }(t.ConfirmationViewTypes || (t.ConfirmationViewTypes = {}))
  })(PV);
  var $V = {};
  (function (t) {
    Object.defineProperty(t, "__esModule", {
        value: !0
      }), t.SafeMessageStatus = t.SafeMessageListItemType = void 0,
      function (e) {
        e.DATE_LABEL = "DATE_LABEL", e.MESSAGE = "MESSAGE"
      }(t.SafeMessageListItemType || (t.SafeMessageListItemType = {})),
      function (e) {
        e.NEEDS_CONFIRMATION = "NEEDS_CONFIRMATION", e.CONFIRMED = "CONFIRMED"
      }(t.SafeMessageStatus || (t.SafeMessageStatus = {}))
  })($V);
  var OV = {};
  (function (t) {
    Object.defineProperty(t, "__esModule", {
        value: !0
      }), t.DeviceType = void 0,
      function (e) {
        e.ANDROID = "ANDROID", e.IOS = "IOS", e.WEB = "WEB"
      }(t.DeviceType || (t.DeviceType = {}))
  })(OV);
  var DV = {};
  Object.defineProperty(DV, "__esModule", {
      value: !0
    }),
    function (t) {
      var e = ot && ot.__createBinding || (Object.create ? function (we, xe, Ie, Pe) {
          Pe === void 0 && (Pe = Ie);
          var J = Object.getOwnPropertyDescriptor(xe, Ie);
          (!J || ("get" in J ? !xe.__esModule : J.writable || J.configurable)) && (J = {
            enumerable: !0,
            get: function () {
              return xe[Ie]
            }
          }), Object.defineProperty(we, Pe, J)
        } : function (we, xe, Ie, Pe) {
          Pe === void 0 && (Pe = Ie), we[Pe] = xe[Ie]
        }),
        r = ot && ot.__exportStar || function (we, xe) {
          for (var Ie in we) Ie !== "default" && !Object.prototype.hasOwnProperty.call(xe, Ie) && e(xe, we, Ie)
        };
      Object.defineProperty(t, "__esModule", {
        value: !0
      }), t.deleteAccount = t.getAccount = t.createAccount = t.verifyAuth = t.getAuthNonce = t.getContract = t.getSafeOverviews = t.unsubscribeAll = t.unsubscribeSingle = t.registerRecoveryModule = t.deleteRegisteredEmail = t.getRegisteredEmail = t.verifyEmail = t.resendEmailVerificationCode = t.changeEmail = t.registerEmail = t.unregisterDevice = t.unregisterSafe = t.registerDevice = t.getDelegates = t.confirmSafeMessage = t.proposeSafeMessage = t.getSafeMessage = t.getSafeMessages = t.getDecodedData = t.getMasterCopies = t.getSafeApps = t.getChainConfig = t.getChainsConfig = t.getConfirmationView = t.proposeTransaction = t.getNonces = t.postSafeGasEstimation = t.deleteTransaction = t.getTransactionDetails = t.getTransactionQueue = t.getTransactionHistory = t.getCollectiblesPage = t.getCollectibles = t.getAllOwnedSafes = t.getOwnedSafes = t.getFiatCurrencies = t.getBalances = t.getMultisigTransactions = t.getModuleTransactions = t.getIncomingTransfers = t.getSafeInfo = t.getRelayCount = t.relayTransaction = t.setBaseUrl = void 0, t.putAccountDataSettings = t.getAccountDataSettings = t.getAccountDataTypes = void 0;
      const n = cu,
        i = F8;
      r(IV, t), r(TV, t), r(kV, t), r(RV, t), r(NV, t), r(MV, t), r(PV, t), r($V, t), r(OV, t), r(DV, t);
      let s = i.DEFAULT_BASE_URL;
      const o = we => {
        s = we
      };
      t.setBaseUrl = o;

      function a(we, xe) {
        return (0, n.postEndpoint)(s, "/v1/chains/{chainId}/relay", {
          path: {
            chainId: we
          },
          body: xe
        })
      }
      t.relayTransaction = a;

      function c(we, xe) {
        return (0, n.getEndpoint)(s, "/v1/chains/{chainId}/relay/{address}", {
          path: {
            chainId: we,
            address: xe
          }
        })
      }
      t.getRelayCount = c;

      function l(we, xe) {
        return (0, n.getEndpoint)(s, "/v1/chains/{chainId}/safes/{address}", {
          path: {
            chainId: we,
            address: xe
          }
        })
      }
      t.getSafeInfo = l;

      function h(we, xe, Ie, Pe) {
        return (0, n.getEndpoint)(s, "/v1/chains/{chainId}/safes/{address}/incoming-transfers/", {
          path: {
            chainId: we,
            address: xe
          },
          query: Ie
        }, Pe)
      }
      t.getIncomingTransfers = h;

      function f(we, xe, Ie, Pe) {
        return (0, n.getEndpoint)(s, "/v1/chains/{chainId}/safes/{address}/module-transactions/", {
          path: {
            chainId: we,
            address: xe
          },
          query: Ie
        }, Pe)
      }
      t.getModuleTransactions = f;

      function w(we, xe, Ie, Pe) {
        return (0, n.getEndpoint)(s, "/v1/chains/{chainId}/safes/{address}/multisig-transactions/", {
          path: {
            chainId: we,
            address: xe
          },
          query: Ie
        }, Pe)
      }
      t.getMultisigTransactions = w;

      function b(we, xe, Ie = "usd", Pe = {}) {
        return (0, n.getEndpoint)(s, "/v1/chains/{chainId}/safes/{address}/balances/{currency}", {
          path: {
            chainId: we,
            address: xe,
            currency: Ie
          },
          query: Pe
        })
      }
      t.getBalances = b;

      function C() {
        return (0, n.getEndpoint)(s, "/v1/balances/supported-fiat-codes")
      }
      t.getFiatCurrencies = C;

      function M(we, xe) {
        return (0, n.getEndpoint)(s, "/v1/chains/{chainId}/owners/{address}/safes", {
          path: {
            chainId: we,
            address: xe
          }
        })
      }
      t.getOwnedSafes = M;

      function N(we) {
        return (0, n.getEndpoint)(s, "/v1/owners/{address}/safes", {
          path: {
            address: we
          }
        })
      }
      t.getAllOwnedSafes = N;

      function $(we, xe, Ie = {}) {
        return (0, n.getEndpoint)(s, "/v1/chains/{chainId}/safes/{address}/collectibles", {
          path: {
            chainId: we,
            address: xe
          },
          query: Ie
        })
      }
      t.getCollectibles = $;

      function k(we, xe, Ie = {}, Pe) {
        return (0, n.getEndpoint)(s, "/v2/chains/{chainId}/safes/{address}/collectibles", {
          path: {
            chainId: we,
            address: xe
          },
          query: Ie
        }, Pe)
      }
      t.getCollectiblesPage = k;

      function B(we, xe, Ie = {}, Pe) {
        return (0, n.getEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/transactions/history", {
          path: {
            chainId: we,
            safe_address: xe
          },
          query: Ie
        }, Pe)
      }
      t.getTransactionHistory = B;

      function F(we, xe, Ie = {}, Pe) {
        return (0, n.getEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/transactions/queued", {
          path: {
            chainId: we,
            safe_address: xe
          },
          query: Ie
        }, Pe)
      }
      t.getTransactionQueue = F;

      function D(we, xe) {
        return (0, n.getEndpoint)(s, "/v1/chains/{chainId}/transactions/{transactionId}", {
          path: {
            chainId: we,
            transactionId: xe
          }
        })
      }
      t.getTransactionDetails = D;

      function V(we, xe, Ie) {
        return (0, n.deleteEndpoint)(s, "/v1/chains/{chainId}/transactions/{safeTxHash}", {
          path: {
            chainId: we,
            safeTxHash: xe
          },
          body: {
            signature: Ie
          }
        })
      }
      t.deleteTransaction = V;

      function R(we, xe, Ie) {
        return (0, n.postEndpoint)(s, "/v2/chains/{chainId}/safes/{safe_address}/multisig-transactions/estimations", {
          path: {
            chainId: we,
            safe_address: xe
          },
          body: Ie
        })
      }
      t.postSafeGasEstimation = R;

      function P(we, xe) {
        return (0, n.getEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/nonces", {
          path: {
            chainId: we,
            safe_address: xe
          }
        })
      }
      t.getNonces = P;

      function j(we, xe, Ie) {
        return (0, n.postEndpoint)(s, "/v1/chains/{chainId}/transactions/{safe_address}/propose", {
          path: {
            chainId: we,
            safe_address: xe
          },
          body: Ie
        })
      }
      t.proposeTransaction = j;

      function Y(we, xe, Ie, Pe) {
        return (0, n.postEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/views/transaction-confirmation", {
          path: {
            chainId: we,
            safe_address: xe
          },
          body: {
            data: Ie,
            to: Pe
          }
        })
      }
      t.getConfirmationView = Y;

      function U(we) {
        return (0, n.getEndpoint)(s, "/v1/chains", {
          query: we
        })
      }
      t.getChainsConfig = U;

      function I(we) {
        return (0, n.getEndpoint)(s, "/v1/chains/{chainId}", {
          path: {
            chainId: we
          }
        })
      }
      t.getChainConfig = I;

      function g(we, xe = {}) {
        return (0, n.getEndpoint)(s, "/v1/chains/{chainId}/safe-apps", {
          path: {
            chainId: we
          },
          query: xe
        })
      }
      t.getSafeApps = g;

      function u(we) {
        return (0, n.getEndpoint)(s, "/v1/chains/{chainId}/about/master-copies", {
          path: {
            chainId: we
          }
        })
      }
      t.getMasterCopies = u;

      function p(we, xe, Ie) {
        return (0, n.postEndpoint)(s, "/v1/chains/{chainId}/data-decoder", {
          path: {
            chainId: we
          },
          body: {
            data: xe,
            to: Ie
          }
        })
      }
      t.getDecodedData = p;

      function v(we, xe, Ie) {
        return (0, n.getEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/messages", {
          path: {
            chainId: we,
            safe_address: xe
          },
          query: {}
        }, Ie)
      }
      t.getSafeMessages = v;

      function x(we, xe) {
        return (0, n.getEndpoint)(s, "/v1/chains/{chainId}/messages/{message_hash}", {
          path: {
            chainId: we,
            message_hash: xe
          }
        })
      }
      t.getSafeMessage = x;

      function E(we, xe, Ie) {
        return (0, n.postEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/messages", {
          path: {
            chainId: we,
            safe_address: xe
          },
          body: Ie
        })
      }
      t.proposeSafeMessage = E;

      function S(we, xe, Ie) {
        return (0, n.postEndpoint)(s, "/v1/chains/{chainId}/messages/{message_hash}/signatures", {
          path: {
            chainId: we,
            message_hash: xe
          },
          body: Ie
        })
      }
      t.confirmSafeMessage = S;

      function _(we, xe = {}) {
        return (0, n.getEndpoint)(s, "/v2/chains/{chainId}/delegates", {
          path: {
            chainId: we
          },
          query: xe
        })
      }
      t.getDelegates = _;

      function y(we) {
        return (0, n.postEndpoint)(s, "/v1/register/notifications", {
          body: we
        })
      }
      t.registerDevice = y;

      function A(we, xe, Ie) {
        return (0, n.deleteEndpoint)(s, "/v1/chains/{chainId}/notifications/devices/{uuid}/safes/{safe_address}", {
          path: {
            chainId: we,
            safe_address: xe,
            uuid: Ie
          }
        })
      }
      t.unregisterSafe = A;

      function G(we, xe) {
        return (0, n.deleteEndpoint)(s, "/v1/chains/{chainId}/notifications/devices/{uuid}", {
          path: {
            chainId: we,
            uuid: xe
          }
        })
      }
      t.unregisterDevice = G;

      function ce(we, xe, Ie, Pe) {
        return (0, n.postEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/emails", {
          path: {
            chainId: we,
            safe_address: xe
          },
          body: Ie,
          headers: Pe
        })
      }
      t.registerEmail = ce;

      function W(we, xe, Ie, Pe, J) {
        return (0, n.putEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}", {
          path: {
            chainId: we,
            safe_address: xe,
            signer: Ie
          },
          body: Pe,
          headers: J
        })
      }
      t.changeEmail = W;

      function X(we, xe, Ie) {
        return (0, n.postEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}/verify-resend", {
          path: {
            chainId: we,
            safe_address: xe,
            signer: Ie
          },
          body: ""
        })
      }
      t.resendEmailVerificationCode = X;

      function Z(we, xe, Ie, Pe) {
        return (0, n.putEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}/verify", {
          path: {
            chainId: we,
            safe_address: xe,
            signer: Ie
          },
          body: Pe
        })
      }
      t.verifyEmail = Z;

      function ee(we, xe, Ie, Pe) {
        return (0, n.getEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}", {
          path: {
            chainId: we,
            safe_address: xe,
            signer: Ie
          },
          headers: Pe
        })
      }
      t.getRegisteredEmail = ee;

      function ne(we, xe, Ie, Pe) {
        return (0, n.deleteEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/emails/{signer}", {
          path: {
            chainId: we,
            safe_address: xe,
            signer: Ie
          },
          headers: Pe
        })
      }
      t.deleteRegisteredEmail = ne;

      function O(we, xe, Ie) {
        return (0, n.postEndpoint)(s, "/v1/chains/{chainId}/safes/{safe_address}/recovery", {
          path: {
            chainId: we,
            safe_address: xe
          },
          body: Ie
        })
      }
      t.registerRecoveryModule = O;

      function H(we) {
        return (0, n.deleteEndpoint)(s, "/v1/subscriptions", {
          query: we
        })
      }
      t.unsubscribeSingle = H;

      function Q(we) {
        return (0, n.deleteEndpoint)(s, "/v1/subscriptions/all", {
          query: we
        })
      }
      t.unsubscribeAll = Q;

      function de(we, xe) {
        return (0, n.getEndpoint)(s, "/v1/safes", {
          query: Object.assign(Object.assign({}, xe), {
            safes: we.join(",")
          })
        })
      }
      t.getSafeOverviews = de;

      function ge(we, xe) {
        return (0, n.getEndpoint)(s, "/v1/chains/{chainId}/contracts/{contractAddress}", {
          path: {
            chainId: we,
            contractAddress: xe
          }
        })
      }
      t.getContract = ge;

      function Te() {
        return (0, n.getEndpoint)(s, "/v1/auth/nonce", {
          credentials: "include"
        })
      }
      t.getAuthNonce = Te;

      function Oe(we) {
        return (0, n.postEndpoint)(s, "/v1/auth/verify", {
          body: we,
          credentials: "include"
        })
      }
      t.verifyAuth = Oe;

      function De(we) {
        return (0, n.postEndpoint)(s, "/v1/accounts", {
          body: we,
          credentials: "include"
        })
      }
      t.createAccount = De;

      function et(we) {
        return (0, n.getEndpoint)(s, "/v1/accounts/{address}", {
          path: {
            address: we
          },
          credentials: "include"
        })
      }
      t.getAccount = et;

      function rt(we) {
        return (0, n.deleteEndpoint)(s, "/v1/accounts/{address}", {
          path: {
            address: we
          },
          credentials: "include"
        })
      }
      t.deleteAccount = rt;

      function Ze() {
        return (0, n.getEndpoint)(s, "/v1/accounts/data-types")
      }
      t.getAccountDataTypes = Ze;

      function qe(we) {
        return (0, n.getEndpoint)(s, "/v1/accounts/{address}/data-settings", {
          path: {
            address: we
          },
          credentials: "include"
        })
      }
      t.getAccountDataSettings = qe;

      function He(we, xe) {
        return (0, n.putEndpoint)(s, "/v1/accounts/{address}/data-settings", {
          path: {
            address: we
          },
          body: xe,
          credentials: "include"
        })
      }
      t.putAccountDataSettings = He
    }(wRe);
  class TRe {
    constructor(e) {
      this.communicator = e
    }
    async getBySafeTxHash(e) {
      if (!e) throw new Error("Invalid safeTxHash");
      return (await this.communicator.send(Qi.getTxBySafeTxHash, {
        safeTxHash: e
      })).data
    }
    async signMessage(e) {
      const r = {
        message: e
      };
      return (await this.communicator.send(Qi.signMessage, r)).data
    }
    async signTypedMessage(e) {
      if (!II(e)) throw new Error("Invalid typed data");
      return (await this.communicator.send(Qi.signTypedMessage, {
        typedData: e
      })).data
    }
    async send({
      txs: e,
      params: r
    }) {
      if (!e || !e.length) throw new Error("No transactions were passed");
      const n = {
        txs: e,
        params: r
      };
      return (await this.communicator.send(Qi.sendTransactions, n)).data
    }
  }
  const Ss = {
      eth_call: "eth_call",
      eth_gasPrice: "eth_gasPrice",
      eth_getLogs: "eth_getLogs",
      eth_getBalance: "eth_getBalance",
      eth_getCode: "eth_getCode",
      eth_getBlockByHash: "eth_getBlockByHash",
      eth_getBlockByNumber: "eth_getBlockByNumber",
      eth_getStorageAt: "eth_getStorageAt",
      eth_getTransactionByHash: "eth_getTransactionByHash",
      eth_getTransactionReceipt: "eth_getTransactionReceipt",
      eth_getTransactionCount: "eth_getTransactionCount",
      eth_estimateGas: "eth_estimateGas",
      safe_setSettings: "safe_setSettings"
    },
    bd = {
      defaultBlockParam: (t = "latest") => t,
      returnFullTxObjectParam: (t = !1) => t,
      blockNumberToHex: t => Number.isInteger(t) ? `0x${t.toString(16)}` : t
    };
  class kRe {
    constructor(e) {
      this.communicator = e, this.call = this.buildRequest({
        call: Ss.eth_call,
        formatters: [null, bd.defaultBlockParam]
      }), this.getBalance = this.buildRequest({
        call: Ss.eth_getBalance,
        formatters: [null, bd.defaultBlockParam]
      }), this.getCode = this.buildRequest({
        call: Ss.eth_getCode,
        formatters: [null, bd.defaultBlockParam]
      }), this.getStorageAt = this.buildRequest({
        call: Ss.eth_getStorageAt,
        formatters: [null, bd.blockNumberToHex, bd.defaultBlockParam]
      }), this.getPastLogs = this.buildRequest({
        call: Ss.eth_getLogs
      }), this.getBlockByHash = this.buildRequest({
        call: Ss.eth_getBlockByHash,
        formatters: [null, bd.returnFullTxObjectParam]
      }), this.getBlockByNumber = this.buildRequest({
        call: Ss.eth_getBlockByNumber,
        formatters: [bd.blockNumberToHex, bd.returnFullTxObjectParam]
      }), this.getTransactionByHash = this.buildRequest({
        call: Ss.eth_getTransactionByHash
      }), this.getTransactionReceipt = this.buildRequest({
        call: Ss.eth_getTransactionReceipt
      }), this.getTransactionCount = this.buildRequest({
        call: Ss.eth_getTransactionCount,
        formatters: [null, bd.defaultBlockParam]
      }), this.getGasPrice = this.buildRequest({
        call: Ss.eth_gasPrice
      }), this.getEstimateGas = r => this.buildRequest({
        call: Ss.eth_estimateGas
      })([r]), this.setSafeSettings = this.buildRequest({
        call: Ss.safe_setSettings
      })
    }
    buildRequest(e) {
      const {
        call: r,
        formatters: n
      } = e;
      return async i => {
        n && Array.isArray(i) && n.forEach((a, c) => {
          a && (i[c] = a(i[c]))
        });
        const s = {
          call: r,
          params: i || []
        };
        return (await this.communicator.send(Qi.rpcCall, s)).data
      }
    }
  }
  const RRe = "0x1626ba7e",
    NRe = "0x20c13b0b",
    kI = 4001;
  class Jb extends Error {
    constructor(e, r, n) {
      super(e), this.code = r, this.data = n, Object.setPrototypeOf(this, Jb.prototype)
    }
  }
  class LV {
    constructor(e) {
      this.communicator = e
    }
    async getPermissions() {
      return (await this.communicator.send(Qi.wallet_getPermissions, void 0)).data
    }
    async requestPermissions(e) {
      if (!this.isPermissionRequestValid(e)) throw new Jb("Permissions request is invalid", kI);
      try {
        return (await this.communicator.send(Qi.wallet_requestPermissions, e)).data
      } catch {
        throw new Jb("Permissions rejected", kI)
      }
    }
    isPermissionRequestValid(e) {
      return e.every(r => typeof r == "object" ? Object.keys(r).every(n => !!Object.values(U8).includes(n)) : !1)
    }
  }
  const BV = (t, e) => e.some(r => r.parentCapability === t),
    MRe = () => (t, e, r) => {
      const n = r.value;
      return r.value = async function () {
        const i = new LV(this.communicator);
        let s = await i.getPermissions();
        if (BV(e, s) || (s = await i.requestPermissions([{
            [e]: {}
          }])), !BV(e, s)) throw new Jb("Permissions rejected", kI);
        return n.apply(this)
      }, r
    };
  var PRe = function (t, e, r, n) {
    var i = arguments.length,
      s = i < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, r) : n,
      o;
    if (typeof Reflect == "object" && typeof Reflect.decorate == "function") s = Reflect.decorate(t, e, r, n);
    else
      for (var a = t.length - 1; a >= 0; a--)(o = t[a]) && (s = (i < 3 ? o(s) : i > 3 ? o(e, r, s) : o(e, r)) || s);
    return i > 3 && s && Object.defineProperty(e, r, s), s
  };
  class UV {
    constructor(e) {
      this.communicator = e
    }
    async getChainInfo() {
      return (await this.communicator.send(Qi.getChainInfo, void 0)).data
    }
    async getInfo() {
      return (await this.communicator.send(Qi.getSafeInfo, void 0)).data
    }
    async experimental_getBalances({
      currency: e = "usd"
    } = {}) {
      return (await this.communicator.send(Qi.getSafeBalances, {
        currency: e
      })).data
    }
    async check1271Signature(e, r = "0x") {
      const n = await this.getInfo(),
        i = Cu({
          abi: [{
            constant: !1,
            inputs: [{
              name: "_dataHash",
              type: "bytes32"
            }, {
              name: "_signature",
              type: "bytes"
            }],
            name: "isValidSignature",
            outputs: [{
              name: "",
              type: "bytes4"
            }],
            payable: !1,
            stateMutability: "nonpayable",
            type: "function"
          }],
          functionName: "isValidSignature",
          args: [e, r]
        }),
        s = {
          call: Ss.eth_call,
          params: [{
            to: n.safeAddress,
            data: i
          }, "latest"]
        };
      try {
        return (await this.communicator.send(Qi.rpcCall, s)).data.slice(0, 10).toLowerCase() === RRe
      } catch {
        return !1
      }
    }
    async check1271SignatureBytes(e, r = "0x") {
      const n = await this.getInfo(),
        i = Cu({
          abi: [{
            constant: !1,
            inputs: [{
              name: "_data",
              type: "bytes"
            }, {
              name: "_signature",
              type: "bytes"
            }],
            name: "isValidSignature",
            outputs: [{
              name: "",
              type: "bytes4"
            }],
            payable: !1,
            stateMutability: "nonpayable",
            type: "function"
          }],
          functionName: "isValidSignature",
          args: [e, r]
        }),
        s = {
          call: Ss.eth_call,
          params: [{
            to: n.safeAddress,
            data: i
          }, "latest"]
        };
      try {
        return (await this.communicator.send(Qi.rpcCall, s)).data.slice(0, 10).toLowerCase() === NRe
      } catch {
        return !1
      }
    }
    calculateMessageHash(e) {
      return kee(e)
    }
    calculateTypedMessageHash(e) {
      const r = typeof e.domain.chainId == "object" ? e.domain.chainId.toNumber() : Number(e.domain.chainId);
      let n = e.primaryType;
      if (!n) {
        const i = Object.values(e.types),
          s = Object.keys(e.types).filter(o => i.every(a => a.every(({
            type: c
          }) => c.replace("[", "").replace("]", "") !== o)));
        if (s.length === 0 || s.length > 1) throw new Error("Please specify primaryType");
        n = s[0]
      }
      return yee({
        message: e.message,
        domain: {
          ...e.domain,
          chainId: r,
          verifyingContract: e.domain.verifyingContract,
          salt: e.domain.salt
        },
        types: e.types,
        primaryType: n
      })
    }
    async getOffChainSignature(e) {
      return (await this.communicator.send(Qi.getOffChainSignature, e)).data
    }
    async isMessageSigned(e, r = "0x") {
      let n;
      if (typeof e == "string" && (n = async () => {
          const i = this.calculateMessageHash(e);
          return await this.isMessageHashSigned(i, r)
        }), II(e) && (n = async () => {
          const i = this.calculateTypedMessageHash(e);
          return await this.isMessageHashSigned(i, r)
        }), n) return await n();
      throw new Error("Invalid message type")
    }
    async isMessageHashSigned(e, r = "0x") {
      const n = [this.check1271Signature.bind(this), this.check1271SignatureBytes.bind(this)];
      for (const i of n)
        if (await i(e, r)) return !0;
      return !1
    }
    async getEnvironmentInfo() {
      return (await this.communicator.send(Qi.getEnvironmentInfo, void 0)).data
    }
    async requestAddressBook() {
      return (await this.communicator.send(Qi.requestAddressBook, void 0)).data
    }
  }
  PRe([MRe()], UV.prototype, "requestAddressBook", null);
  class $Re {
    constructor(e = {}) {
      const {
        allowedDomains: r = null,
        debug: n = !1
      } = e;
      this.communicator = new mRe(r, n), this.eth = new kRe(this.communicator), this.txs = new TRe(this.communicator), this.safe = new UV(this.communicator), this.wallet = new LV(this.communicator)
    }
  }
  const ORe = Object.freeze(Object.defineProperty({
    __proto__: null,
    MessageFormatter: Qb,
    get Methods() {
      return Qi
    },
    RPC_CALLS: Ss,
    get RestrictedMethods() {
      return U8
    },
    default: $Re,
    getSDKVersion: AV,
    isObjectEIP712TypedData: II
  }, Symbol.toStringTag, {
    value: "Module"
  }));
  var RI = {},
    W8 = {},
    z8 = {};
  Object.defineProperty(z8, "__esModule", {
    value: !0
  }), z8.getLowerCase = void 0;

  function DRe(t) {
    return t && t.toLowerCase()
  }
  z8.getLowerCase = DRe, Object.defineProperty(W8, "__esModule", {
    value: !0
  }), W8.SafeAppProvider = void 0;
  const LRe = Fi,
    H8 = z8;
  class BRe extends LRe.EventEmitter {
    constructor(e, r) {
      super(), this.submittedTxs = new Map, this.safe = e, this.sdk = r
    }
    async connect() {
      this.emit("connect", {
        chainId: this.chainId
      })
    }
    async disconnect() {}
    get chainId() {
      return this.safe.chainId
    }
    async request(e) {
      const {
        method: r,
        params: n = []
      } = e;
      switch (r) {
        case "eth_accounts":
          return [this.safe.safeAddress];
        case "net_version":
        case "eth_chainId":
          return `0x${this.chainId.toString(16)}`;
        case "personal_sign": {
          const [c, l] = n;
          if (this.safe.safeAddress.toLowerCase() !== l.toLowerCase()) throw new Error("The address or message hash is invalid");
          const h = await this.sdk.txs.signMessage(c);
          return ("signature" in h ? h.signature : void 0) || "0x"
        }
        case "eth_sign": {
          const [c, l] = n;
          if (this.safe.safeAddress.toLowerCase() !== c.toLowerCase() || !l.startsWith("0x")) throw new Error("The address or message hash is invalid");
          const h = await this.sdk.txs.signMessage(l);
          return ("signature" in h ? h.signature : void 0) || "0x"
        }
        case "eth_signTypedData":
        case "eth_signTypedData_v4": {
          const [c, l] = n, h = typeof l == "string" ? JSON.parse(l) : l;
          if (this.safe.safeAddress.toLowerCase() !== c.toLowerCase()) throw new Error("The address is invalid");
          const f = await this.sdk.txs.signTypedMessage(h);
          return ("signature" in f ? f.signature : void 0) || "0x"
        }
        case "eth_sendTransaction":
          const i = {
            ...n[0],
            value: n[0].value || "0",
            data: n[0].data || "0x"
          };
          typeof i.gas == "string" && i.gas.startsWith("0x") && (i.gas = parseInt(i.gas, 16));
          const s = await this.sdk.txs.send({
            txs: [i],
            params: {
              safeTxGas: i.gas
            }
          });
          return this.submittedTxs.set(s.safeTxHash, {
            from: this.safe.safeAddress,
            hash: s.safeTxHash,
            gas: 0,
            gasPrice: "0x00",
            nonce: 0,
            input: i.data,
            value: i.value,
            to: i.to,
            blockHash: null,
            blockNumber: null,
            transactionIndex: null
          }), s.safeTxHash;
        case "eth_blockNumber":
          return (await this.sdk.eth.getBlockByNumber(["latest"])).number;
        case "eth_getBalance":
          return this.sdk.eth.getBalance([(0, H8.getLowerCase)(n[0]), n[1]]);
        case "eth_getCode":
          return this.sdk.eth.getCode([(0, H8.getLowerCase)(n[0]), n[1]]);
        case "eth_getTransactionCount":
          return this.sdk.eth.getTransactionCount([(0, H8.getLowerCase)(n[0]), n[1]]);
        case "eth_getStorageAt":
          return this.sdk.eth.getStorageAt([(0, H8.getLowerCase)(n[0]), n[1], n[2]]);
        case "eth_getBlockByNumber":
          return this.sdk.eth.getBlockByNumber([n[0], n[1]]);
        case "eth_getBlockByHash":
          return this.sdk.eth.getBlockByHash([n[0], n[1]]);
        case "eth_getTransactionByHash":
          let a = n[0];
          try {
            a = (await this.sdk.txs.getBySafeTxHash(a)).txHash || a
          } catch {}
          return this.submittedTxs.has(a) ? this.submittedTxs.get(a) : this.sdk.eth.getTransactionByHash([a]).then(c => (c && (c.hash = n[0]), c));
        case "eth_getTransactionReceipt": {
          let c = n[0];
          try {
            c = (await this.sdk.txs.getBySafeTxHash(c)).txHash || c
          } catch {}
          return this.sdk.eth.getTransactionReceipt([c]).then(l => (l && (l.transactionHash = n[0]), l))
        }
        case "eth_estimateGas":
          return this.sdk.eth.getEstimateGas(n[0]);
        case "eth_call":
          return this.sdk.eth.call([n[0], n[1]]);
        case "eth_getLogs":
          return this.sdk.eth.getPastLogs([n[0]]);
        case "eth_gasPrice":
          return this.sdk.eth.getGasPrice();
        case "wallet_getPermissions":
          return this.sdk.wallet.getPermissions();
        case "wallet_requestPermissions":
          return this.sdk.wallet.requestPermissions(n[0]);
        case "safe_setSettings":
          return this.sdk.eth.setSafeSettings([n[0]]);
        default:
          throw Error(`"${e.method}" not implemented`)
      }
    }
    send(e, r) {
      e || r("Undefined request"), this.request(e).then(n => r(null, {
        jsonrpc: "2.0",
        id: e.id,
        result: n
      })).catch(n => r(n, null))
    }
  }
  W8.SafeAppProvider = BRe,
    function (t) {
      Object.defineProperty(t, "__esModule", {
        value: !0
      }), t.SafeAppProvider = void 0;
      var e = W8;
      Object.defineProperty(t, "SafeAppProvider", {
        enumerable: !0,
        get: function () {
          return e.SafeAppProvider
        }
      })
    }(RI);
  const URe = P3({
      __proto__: null,
      default: Za(RI)
    }, [RI]),
    jRe = "wc",
    FRe = "ethereum_provider",
    WRe = `${jRe}@2:${FRe}:`,
    zRe = "https://rpc.walletconnect.org/v1/",
    q8 = ["eth_sendTransaction", "personal_sign"],
    jV = ["eth_accounts", "eth_requestAccounts", "eth_sendRawTransaction", "eth_sign", "eth_signTransaction", "eth_signTypedData", "eth_signTypedData_v3", "eth_signTypedData_v4", "eth_sendTransaction", "personal_sign", "wallet_switchEthereumChain", "wallet_addEthereumChain", "wallet_getPermissions", "wallet_requestPermissions", "wallet_registerOnboarding", "wallet_watchAsset", "wallet_scanQRCode", "wallet_sendCalls", "wallet_getCapabilities", "wallet_getCallsStatus", "wallet_showCallsStatus"],
    V8 = ["chainChanged", "accountsChanged"],
    FV = ["chainChanged", "accountsChanged", "message", "disconnect", "connect"];
  var HRe = Object.defineProperty,
    qRe = Object.defineProperties,
    VRe = Object.getOwnPropertyDescriptors,
    WV = Object.getOwnPropertySymbols,
    KRe = Object.prototype.hasOwnProperty,
    GRe = Object.prototype.propertyIsEnumerable,
    zV = (t, e, r) => e in t ? HRe(t, e, {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: r
    }) : t[e] = r,
    Cm = (t, e) => {
      for (var r in e || (e = {})) KRe.call(e, r) && zV(t, r, e[r]);
      if (WV)
        for (var r of WV(e)) GRe.call(e, r) && zV(t, r, e[r]);
      return t
    },
    NI = (t, e) => qRe(t, VRe(e));

  function K8(t) {
    return Number(t[0].split(":")[1])
  }

  function G8(t) {
    return `0x${t.toString(16)}`
  }

  function ZRe(t) {
    const {
      chains: e,
      optionalChains: r,
      methods: n,
      optionalMethods: i,
      events: s,
      optionalEvents: o,
      rpcMap: a
    } = t;
    if (!Ol(e)) throw new Error("Invalid chains");
    const c = {
        chains: e,
        methods: n || q8,
        events: s || V8,
        rpcMap: Cm({}, e.length ? {
          [K8(e)]: a[K8(e)]
        } : {})
      },
      l = s?.filter(b => !V8.includes(b)),
      h = n?.filter(b => !q8.includes(b));
    if (!r && !o && !i && !(l != null && l.length) && !(h != null && h.length)) return {
      required: e.length ? c : void 0
    };
    const f = l?.length && h?.length || !r,
      w = {
        chains: [...new Set(f ? c.chains.concat(r || []) : r)],
        methods: [...new Set(c.methods.concat(i != null && i.length ? i : jV))],
        events: [...new Set(c.events.concat(o != null && o.length ? o : FV))],
        rpcMap: a
      };
    return {
      required: e.length ? c : void 0,
      optional: r.length ? w : void 0
    }
  }
  let HV = class JZ {
    constructor() {
      this.events = new Fi.EventEmitter, this.namespace = "eip155", this.accounts = [], this.chainId = 1, this.STORAGE_KEY = WRe, this.on = (e, r) => (this.events.on(e, r), this), this.once = (e, r) => (this.events.once(e, r), this), this.removeListener = (e, r) => (this.events.removeListener(e, r), this), this.off = (e, r) => (this.events.off(e, r), this), this.parseAccount = e => this.isCompatibleChainId(e) ? this.parseAccountId(e).address : e, this.signer = {}, this.rpc = {}
    }
    static async init(e) {
      const r = new JZ;
      return await r.initialize(e), r
    }
    async request(e, r) {
      return await this.signer.request(e, this.formatChainId(this.chainId), r)
    }
    sendAsync(e, r, n) {
      this.signer.sendAsync(e, r, this.formatChainId(this.chainId), n)
    }
    get connected() {
      return this.signer.client ? this.signer.client.core.relayer.connected : !1
    }
    get connecting() {
      return this.signer.client ? this.signer.client.core.relayer.connecting : !1
    }
    async enable() {
      return this.session || await this.connect(), await this.request({
        method: "eth_requestAccounts"
      })
    }
    async connect(e) {
      if (!this.signer.client) throw new Error("Provider not initialized. Call init() first");
      this.loadConnectOpts(e);
      const {
        required: r,
        optional: n
      } = ZRe(this.rpc);
      try {
        const i = await new Promise(async (o, a) => {
          var c;
          this.rpc.showQrModal && ((c = this.modal) == null || c.subscribeModal(l => {
            !l.open && !this.signer.session && (this.signer.abortPairingAttempt(), a(new Error("Connection request reset. Please try again.")))
          })), await this.signer.connect(NI(Cm({
            namespaces: Cm({}, r && {
              [this.namespace]: r
            })
          }, n && {
            optionalNamespaces: {
              [this.namespace]: n
            }
          }), {
            pairingTopic: e?.pairingTopic
          })).then(l => {
            o(l)
          }).catch(l => {
            a(new Error(l.message))
          })
        });
        if (!i) return;
        const s = dD(i.namespaces, [this.namespace]);
        this.setChainIds(this.rpc.chains.length ? this.rpc.chains : s), this.setAccounts(s), this.events.emit("connect", {
          chainId: G8(this.chainId)
        })
      } catch (i) {
        throw this.signer.logger.error(i), i
      } finally {
        this.modal && this.modal.closeModal()
      }
    }
    async authenticate(e, r) {
      if (!this.signer.client) throw new Error("Provider not initialized. Call init() first");
      this.loadConnectOpts({
        chains: e?.chains
      });
      try {
        const n = await new Promise(async (s, o) => {
            var a;
            this.rpc.showQrModal && ((a = this.modal) == null || a.subscribeModal(c => {
              !c.open && !this.signer.session && (this.signer.abortPairingAttempt(), o(new Error("Connection request reset. Please try again.")))
            })), await this.signer.authenticate(NI(Cm({}, e), {
              chains: this.rpc.chains
            }), r).then(c => {
              s(c)
            }).catch(c => {
              o(new Error(c.message))
            })
          }),
          i = n.session;
        if (i) {
          const s = dD(i.namespaces, [this.namespace]);
          this.setChainIds(this.rpc.chains.length ? this.rpc.chains : s), this.setAccounts(s), this.events.emit("connect", {
            chainId: G8(this.chainId)
          })
        }
        return n
      } catch (n) {
        throw this.signer.logger.error(n), n
      } finally {
        this.modal && this.modal.closeModal()
      }
    }
    async disconnect() {
      this.session && await this.signer.disconnect(), this.reset()
    }
    get isWalletConnect() {
      return !0
    }
    get session() {
      return this.signer.session
    }
    registerEventListeners() {
      this.signer.on("session_event", e => {
        const {
          params: r
        } = e, {
          event: n
        } = r;
        n.name === "accountsChanged" ? (this.accounts = this.parseAccounts(n.data), this.events.emit("accountsChanged", this.accounts)) : n.name === "chainChanged" ? this.setChainId(this.formatChainId(n.data)) : this.events.emit(n.name, n.data), this.events.emit("session_event", e)
      }), this.signer.on("chainChanged", e => {
        const r = parseInt(e);
        this.chainId = r, this.events.emit("chainChanged", G8(this.chainId)), this.persist()
      }), this.signer.on("session_update", e => {
        this.events.emit("session_update", e)
      }), this.signer.on("session_delete", e => {
        this.reset(), this.events.emit("session_delete", e), this.events.emit("disconnect", NI(Cm({}, nn("USER_DISCONNECTED")), {
          data: e.topic,
          name: "USER_DISCONNECTED"
        }))
      }), this.signer.on("display_uri", e => {
        var r, n;
        this.rpc.showQrModal && ((r = this.modal) == null || r.closeModal(), (n = this.modal) == null || n.openModal({
          uri: e
        })), this.events.emit("display_uri", e)
      })
    }
    switchEthereumChain(e) {
      this.request({
        method: "wallet_switchEthereumChain",
        params: [{
          chainId: e.toString(16)
        }]
      })
    }
    isCompatibleChainId(e) {
      return typeof e == "string" ? e.startsWith(`${this.namespace}:`) : !1
    }
    formatChainId(e) {
      return `${this.namespace}:${e}`
    }
    parseChainId(e) {
      return Number(e.split(":")[1])
    }
    setChainIds(e) {
      const r = e.filter(n => this.isCompatibleChainId(n)).map(n => this.parseChainId(n));
      r.length && (this.chainId = r[0], this.events.emit("chainChanged", G8(this.chainId)), this.persist())
    }
    setChainId(e) {
      if (this.isCompatibleChainId(e)) {
        const r = this.parseChainId(e);
        this.chainId = r, this.switchEthereumChain(r)
      }
    }
    parseAccountId(e) {
      const [r, n, i] = e.split(":");
      return {
        chainId: `${r}:${n}`,
        address: i
      }
    }
    setAccounts(e) {
      this.accounts = e.filter(r => this.parseChainId(this.parseAccountId(r).chainId) === this.chainId).map(r => this.parseAccountId(r).address), this.events.emit("accountsChanged", this.accounts)
    }
    getRpcConfig(e) {
      var r, n;
      const i = (r = e?.chains) != null ? r : [],
        s = (n = e?.optionalChains) != null ? n : [],
        o = i.concat(s);
      if (!o.length) throw new Error("No chains specified in either `chains` or `optionalChains`");
      const a = i.length ? e?.methods || q8 : [],
        c = i.length ? e?.events || V8 : [],
        l = e?.optionalMethods || [],
        h = e?.optionalEvents || [],
        f = e?.rpcMap || this.buildRpcMap(o, e.projectId),
        w = e?.qrModalOptions || void 0;
      return {
        chains: i?.map(b => this.formatChainId(b)),
        optionalChains: s.map(b => this.formatChainId(b)),
        methods: a,
        events: c,
        optionalMethods: l,
        optionalEvents: h,
        rpcMap: f,
        showQrModal: !!(e != null && e.showQrModal),
        qrModalOptions: w,
        projectId: e.projectId,
        metadata: e.metadata
      }
    }
    buildRpcMap(e, r) {
      const n = {};
      return e.forEach(i => {
        n[i] = this.getRpcUrl(i, r)
      }), n
    }
    async initialize(e) {
      if (this.rpc = this.getRpcConfig(e), this.chainId = this.rpc.chains.length ? K8(this.rpc.chains) : K8(this.rpc.optionalChains), this.signer = await G5e.init({
          projectId: this.rpc.projectId,
          metadata: this.rpc.metadata,
          disableProviderPing: e.disableProviderPing,
          relayUrl: e.relayUrl,
          storageOptions: e.storageOptions,
          customStoragePrefix: e.customStoragePrefix,
          telemetryEnabled: e.telemetryEnabled
        }), this.registerEventListeners(), await this.loadPersistedSession(), this.rpc.showQrModal) {
        let r;
        try {
          const {
            WalletConnectModal: n
          } = await pi(() => Promise.resolve().then(() => hNe), void 0);
          r = n
        } catch {
          throw new Error("To use QR modal, please install @walletconnect/modal package")
        }
        if (r) try {
          this.modal = new r(Cm({
            projectId: this.rpc.projectId
          }, this.rpc.qrModalOptions))
        } catch (n) {
          throw this.signer.logger.error(n), new Error("Could not generate WalletConnectModal Instance")
        }
      }
    }
    loadConnectOpts(e) {
      if (!e) return;
      const {
        chains: r,
        optionalChains: n,
        rpcMap: i
      } = e;
      r && Ol(r) && (this.rpc.chains = r.map(s => this.formatChainId(s)), r.forEach(s => {
        this.rpc.rpcMap[s] = i?.[s] || this.getRpcUrl(s)
      })), n && Ol(n) && (this.rpc.optionalChains = [], this.rpc.optionalChains = n?.map(s => this.formatChainId(s)), n.forEach(s => {
        this.rpc.rpcMap[s] = i?.[s] || this.getRpcUrl(s)
      }))
    }
    getRpcUrl(e, r) {
      var n;
      return ((n = this.rpc.rpcMap) == null ? void 0 : n[e]) || `${zRe}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`
    }
    async loadPersistedSession() {
      if (this.session) try {
        const e = await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),
          r = this.session.namespaces[`${this.namespace}:${e}`] ? this.session.namespaces[`${this.namespace}:${e}`] : this.session.namespaces[this.namespace];
        this.setChainIds(e ? [this.formatChainId(e)] : r?.accounts), this.setAccounts(r?.accounts)
      } catch (e) {
        this.signer.logger.error("Failed to load persisted session, clearing state..."), this.signer.logger.error(e), await this.disconnect().catch(r => this.signer.logger.warn(r))
      }
    }
    reset() {
      this.chainId = 1, this.accounts = []
    }
    persist() {
      this.session && this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`, this.chainId)
    }
    parseAccounts(e) {
      return typeof e == "string" || e instanceof String ? [this.parseAccount(e)] : e.map(r => this.parseAccount(r))
    }
  };
  const YRe = Object.freeze(Object.defineProperty({
      __proto__: null,
      EthereumProvider: HV,
      OPTIONAL_EVENTS: FV,
      OPTIONAL_METHODS: jV,
      REQUIRED_EVENTS: V8,
      REQUIRED_METHODS: q8,
      default: HV
    }, Symbol.toStringTag, {
      value: "Module"
    })),
    Ji = jr({
      history: ["ConnectWallet"],
      view: "ConnectWallet",
      data: void 0
    }),
    zn = {
      state: Ji,
      subscribe(t) {
        return Rn(Ji, () => t(Ji))
      },
      push(t, e) {
        t !== Ji.view && (Ji.view = t, e && (Ji.data = e), Ji.history.push(t))
      },
      reset(t) {
        Ji.view = t, Ji.history = [t]
      },
      replace(t) {
        Ji.history.length > 1 && (Ji.history[Ji.history.length - 1] = t, Ji.view = t)
      },
      goBack() {
        if (Ji.history.length > 1) {
          Ji.history.pop();
          const [t] = Ji.history.slice(-1);
          Ji.view = t
        }
      },
      setData(t) {
        Ji.data = t
      }
    },
    Dt = {
      WALLETCONNECT_DEEPLINK_CHOICE: "WALLETCONNECT_DEEPLINK_CHOICE",
      WCM_VERSION: "WCM_VERSION",
      RECOMMENDED_WALLET_AMOUNT: 9,
      isMobile() {
        return typeof window < "u" ? !!(window.matchMedia("(pointer:coarse)").matches || /Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)) : !1
      },
      isAndroid() {
        return Dt.isMobile() && navigator.userAgent.toLowerCase().includes("android")
      },
      isIos() {
        const t = navigator.userAgent.toLowerCase();
        return Dt.isMobile() && (t.includes("iphone") || t.includes("ipad"))
      },
      isHttpUrl(t) {
        return t.startsWith("http://") || t.startsWith("https://")
      },
      isArray(t) {
        return Array.isArray(t) && t.length > 0
      },
      isTelegram() {
        return typeof window < "u" && (!!window.TelegramWebviewProxy || !!window.Telegram || !!window.TelegramWebviewProxyProto)
      },
      formatNativeUrl(t, e, r) {
        if (Dt.isHttpUrl(t)) return this.formatUniversalUrl(t, e, r);
        let n = t;
        n.includes("://") || (n = t.replaceAll("/", "").replaceAll(":", ""), n = `${n}://`), n.endsWith("/") || (n = `${n}/`), this.setWalletConnectDeepLink(n, r);
        const i = encodeURIComponent(e);
        return `${n}wc?uri=${i}`
      },
      formatUniversalUrl(t, e, r) {
        if (!Dt.isHttpUrl(t)) return this.formatNativeUrl(t, e, r);
        let n = t;
        if (n.startsWith("https://t.me")) {
          const s = Buffer.from(e).toString("base64").replace(/[=]/g, "");
          n.endsWith("/") && (n = n.slice(0, -1)), this.setWalletConnectDeepLink(n, r);
          const o = new URL(n);
          return o.searchParams.set("startapp", s), o.toString()
        }
        n.endsWith("/") || (n = `${n}/`), this.setWalletConnectDeepLink(n, r);
        const i = encodeURIComponent(e);
        return `${n}wc?uri=${i}`
      },
      async wait(t) {
        return new Promise(e => {
          setTimeout(e, t)
        })
      },
      openHref(t, e) {
        const r = this.isTelegram() ? "_blank" : e;
        window.open(t, r, "noreferrer noopener")
      },
      setWalletConnectDeepLink(t, e) {
        try {
          localStorage.setItem(Dt.WALLETCONNECT_DEEPLINK_CHOICE, JSON.stringify({
            href: t,
            name: e
          }))
        } catch {
          console.info("Unable to set WalletConnect deep link")
        }
      },
      setWalletConnectAndroidDeepLink(t) {
        try {
          const [e] = t.split("?");
          localStorage.setItem(Dt.WALLETCONNECT_DEEPLINK_CHOICE, JSON.stringify({
            href: e,
            name: "Android"
          }))
        } catch {
          console.info("Unable to set WalletConnect android deep link")
        }
      },
      removeWalletConnectDeepLink() {
        try {
          localStorage.removeItem(Dt.WALLETCONNECT_DEEPLINK_CHOICE)
        } catch {
          console.info("Unable to remove WalletConnect deep link")
        }
      },
      setModalVersionInStorage() {
        try {
          typeof localStorage < "u" && localStorage.setItem(Dt.WCM_VERSION, "2.7.0")
        } catch {
          console.info("Unable to set Web3Modal version in storage")
        }
      },
      getWalletRouterData() {
        var t;
        const e = (t = zn.state.data) == null ? void 0 : t.Wallet;
        if (!e) throw new Error('Missing "Wallet" view data');
        return e
      }
    },
    QRe = typeof location < "u" && (location.hostname.includes("localhost") || location.protocol.includes("https")),
    Is = jr({
      enabled: QRe,
      userSessionId: "",
      events: [],
      connectedWalletId: void 0
    }),
    qV = {
      state: Is,
      subscribe(t) {
        return Rn(Is.events, () => t(fy(Is.events[Is.events.length - 1])))
      },
      initialize() {
        Is.enabled && typeof (crypto == null ? void 0 : crypto.randomUUID) < "u" && (Is.userSessionId = crypto.randomUUID())
      },
      setConnectedWalletId(t) {
        Is.connectedWalletId = t
      },
      click(t) {
        if (Is.enabled) {
          const e = {
            type: "CLICK",
            name: t.name,
            userSessionId: Is.userSessionId,
            timestamp: Date.now(),
            data: t
          };
          Is.events.push(e)
        }
      },
      track(t) {
        if (Is.enabled) {
          const e = {
            type: "TRACK",
            name: t.name,
            userSessionId: Is.userSessionId,
            timestamp: Date.now(),
            data: t
          };
          Is.events.push(e)
        }
      },
      view(t) {
        if (Is.enabled) {
          const e = {
            type: "VIEW",
            name: t.name,
            userSessionId: Is.userSessionId,
            timestamp: Date.now(),
            data: t
          };
          Is.events.push(e)
        }
      }
    },
    uu = jr({
      chains: void 0,
      walletConnectUri: void 0,
      isAuth: !1,
      isCustomDesktop: !1,
      isCustomMobile: !1,
      isDataLoaded: !1,
      isUiLoaded: !1
    }),
    li = {
      state: uu,
      subscribe(t) {
        return Rn(uu, () => t(uu))
      },
      setChains(t) {
        uu.chains = t
      },
      setWalletConnectUri(t) {
        uu.walletConnectUri = t
      },
      setIsCustomDesktop(t) {
        uu.isCustomDesktop = t
      },
      setIsCustomMobile(t) {
        uu.isCustomMobile = t
      },
      setIsDataLoaded(t) {
        uu.isDataLoaded = t
      },
      setIsUiLoaded(t) {
        uu.isUiLoaded = t
      },
      setIsAuth(t) {
        uu.isAuth = t
      }
    },
    Z8 = jr({
      projectId: "",
      mobileWallets: void 0,
      desktopWallets: void 0,
      walletImages: void 0,
      chains: void 0,
      enableAuthMode: !1,
      enableExplorer: !0,
      explorerExcludedWalletIds: void 0,
      explorerRecommendedWalletIds: void 0,
      termsOfServiceUrl: void 0,
      privacyPolicyUrl: void 0
    }),
    Qo = {
      state: Z8,
      subscribe(t) {
        return Rn(Z8, () => t(Z8))
      },
      setConfig(t) {
        var e, r;
        qV.initialize(), li.setChains(t.chains), li.setIsAuth(!!t.enableAuthMode), li.setIsCustomMobile(!!((e = t.mobileWallets) != null && e.length)), li.setIsCustomDesktop(!!((r = t.desktopWallets) != null && r.length)), Dt.setModalVersionInStorage(), Object.assign(Z8, t)
      }
    };
  var JRe = Object.defineProperty,
    VV = Object.getOwnPropertySymbols,
    XRe = Object.prototype.hasOwnProperty,
    eNe = Object.prototype.propertyIsEnumerable,
    KV = (t, e, r) => e in t ? JRe(t, e, {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: r
    }) : t[e] = r,
    tNe = (t, e) => {
      for (var r in e || (e = {})) XRe.call(e, r) && KV(t, r, e[r]);
      if (VV)
        for (var r of VV(e)) eNe.call(e, r) && KV(t, r, e[r]);
      return t
    };
  const MI = "https://explorer-api.walletconnect.com",
    PI = "wcm",
    $I = "js-2.7.0";
  async function Y8(t, e) {
    const r = tNe({
        sdkType: PI,
        sdkVersion: $I
      }, e),
      n = new URL(t, MI);
    return n.searchParams.append("projectId", Qo.state.projectId), Object.entries(r).forEach(([s, o]) => {
      o && n.searchParams.append(s, String(o))
    }), (await fetch(n)).json()
  }
  const vp = {
    async getDesktopListings(t) {
      return Y8("/w3m/v1/getDesktopListings", t)
    },
    async getMobileListings(t) {
      return Y8("/w3m/v1/getMobileListings", t)
    },
    async getInjectedListings(t) {
      return Y8("/w3m/v1/getInjectedListings", t)
    },
    async getAllListings(t) {
      return Y8("/w3m/v1/getAllListings", t)
    },
    getWalletImageUrl(t) {
      return `${MI}/w3m/v1/getWalletImage/${t}?projectId=${Qo.state.projectId}&sdkType=${PI}&sdkVersion=${$I}`
    },
    getAssetImageUrl(t) {
      return `${MI}/w3m/v1/getAssetImage/${t}?projectId=${Qo.state.projectId}&sdkType=${PI}&sdkVersion=${$I}`
    }
  };
  var rNe = Object.defineProperty,
    GV = Object.getOwnPropertySymbols,
    nNe = Object.prototype.hasOwnProperty,
    iNe = Object.prototype.propertyIsEnumerable,
    ZV = (t, e, r) => e in t ? rNe(t, e, {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: r
    }) : t[e] = r,
    sNe = (t, e) => {
      for (var r in e || (e = {})) nNe.call(e, r) && ZV(t, r, e[r]);
      if (GV)
        for (var r of GV(e)) iNe.call(e, r) && ZV(t, r, e[r]);
      return t
    };
  const YV = Dt.isMobile(),
    du = jr({
      wallets: {
        listings: [],
        total: 0,
        page: 1
      },
      search: {
        listings: [],
        total: 0,
        page: 1
      },
      recomendedWallets: []
    }),
    Co = {
      state: du,
      async getRecomendedWallets() {
        const {
          explorerRecommendedWalletIds: t,
          explorerExcludedWalletIds: e
        } = Qo.state;
        if (t === "NONE" || e === "ALL" && !t) return du.recomendedWallets;
        if (Dt.isArray(t)) {
          const n = {
              recommendedIds: t.join(",")
            },
            {
              listings: i
            } = await vp.getAllListings(n),
            s = Object.values(i);
          s.sort((o, a) => {
            const c = t.indexOf(o.id),
              l = t.indexOf(a.id);
            return c - l
          }), du.recomendedWallets = s
        } else {
          const {
            chains: r,
            isAuth: n
          } = li.state, i = r?.join(","), s = Dt.isArray(e), o = {
            page: 1,
            sdks: n ? "auth_v1" : void 0,
            entries: Dt.RECOMMENDED_WALLET_AMOUNT,
            chains: i,
            version: 2,
            excludedIds: s ? e.join(",") : void 0
          }, {
            listings: a
          } = YV ? await vp.getMobileListings(o) : await vp.getDesktopListings(o);
          du.recomendedWallets = Object.values(a)
        }
        return du.recomendedWallets
      },
      async getWallets(t) {
        const e = sNe({}, t),
          {
            explorerRecommendedWalletIds: r,
            explorerExcludedWalletIds: n
          } = Qo.state,
          {
            recomendedWallets: i
          } = du;
        if (n === "ALL") return du.wallets;
        i.length ? e.excludedIds = i.map(f => f.id).join(",") : Dt.isArray(r) && (e.excludedIds = r.join(",")), Dt.isArray(n) && (e.excludedIds = [e.excludedIds, n].filter(Boolean).join(",")), li.state.isAuth && (e.sdks = "auth_v1");
        const {
          page: s,
          search: o
        } = t, {
          listings: a,
          total: c
        } = YV ? await vp.getMobileListings(e) : await vp.getDesktopListings(e), l = Object.values(a), h = o ? "search" : "wallets";
        return du[h] = {
          listings: [...du[h].listings, ...l],
          total: c,
          page: s ?? 1
        }, {
          listings: l,
          total: c
        }
      },
      getWalletImageUrl(t) {
        return vp.getWalletImageUrl(t)
      },
      getAssetImageUrl(t) {
        return vp.getAssetImageUrl(t)
      },
      resetSearch() {
        du.search = {
          listings: [],
          total: 0,
          page: 1
        }
      }
    },
    Em = jr({
      open: !1
    }),
    bp = {
      state: Em,
      subscribe(t) {
        return Rn(Em, () => t(Em))
      },
      async open(t) {
        return new Promise(e => {
          const {
            isUiLoaded: r,
            isDataLoaded: n
          } = li.state;
          if (Dt.removeWalletConnectDeepLink(), li.setWalletConnectUri(t?.uri), li.setChains(t?.chains), zn.reset("ConnectWallet"), r && n) Em.open = !0, e();
          else {
            const i = setInterval(() => {
              const s = li.state;
              s.isUiLoaded && s.isDataLoaded && (clearInterval(i), Em.open = !0, e())
            }, 200)
          }
        })
      },
      close() {
        Em.open = !1
      }
    };
  var oNe = Object.defineProperty,
    QV = Object.getOwnPropertySymbols,
    aNe = Object.prototype.hasOwnProperty,
    cNe = Object.prototype.propertyIsEnumerable,
    JV = (t, e, r) => e in t ? oNe(t, e, {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: r
    }) : t[e] = r,
    lNe = (t, e) => {
      for (var r in e || (e = {})) aNe.call(e, r) && JV(t, r, e[r]);
      if (QV)
        for (var r of QV(e)) cNe.call(e, r) && JV(t, r, e[r]);
      return t
    };

  function uNe() {
    return typeof matchMedia < "u" && matchMedia("(prefers-color-scheme: dark)").matches
  }
  const Xb = jr({
      themeMode: uNe() ? "dark" : "light"
    }),
    Jh = {
      state: Xb,
      subscribe(t) {
        return Rn(Xb, () => t(Xb))
      },
      setThemeConfig(t) {
        const {
          themeMode: e,
          themeVariables: r
        } = t;
        e && (Xb.themeMode = e), r && (Xb.themeVariables = lNe({}, r))
      }
    },
    yp = jr({
      open: !1,
      message: "",
      variant: "success"
    }),
    Xh = {
      state: yp,
      subscribe(t) {
        return Rn(yp, () => t(yp))
      },
      openToast(t, e) {
        yp.open = !0, yp.message = t, yp.variant = e
      },
      closeToast() {
        yp.open = !1
      }
    };
  class dNe {
    constructor(e) {
      this.openModal = bp.open, this.closeModal = bp.close, this.subscribeModal = bp.subscribe, this.setTheme = Jh.setThemeConfig, Jh.setThemeConfig(e), Qo.setConfig(e), this.initUi()
    }
    async initUi() {
      if (typeof window < "u") {
        await pi(() => Promise.resolve().then(() => R$e), void 0);
        const e = document.createElement("wim-modal");
        document.body.insertAdjacentElement("beforeend", e), li.setIsUiLoaded(!0)
      }
    }
  }
  const hNe = Object.freeze(Object.defineProperty({
    __proto__: null,
    WalletConnectModal: dNe
  }, Symbol.toStringTag, {
    value: "Module"
  }));
  /**
   * @license
   * Copyright 2019 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  const Q8 = window,
    OI = Q8.ShadowRoot && (Q8.ShadyCSS === void 0 || Q8.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype,
    DI = Symbol(),
    XV = new WeakMap;
  let eK = class {
    constructor(e, r, n) {
      if (this._$cssResult$ = !0, n !== DI) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
      this.cssText = e, this.t = r
    }
    get styleSheet() {
      let e = this.o;
      const r = this.t;
      if (OI && e === void 0) {
        const n = r !== void 0 && r.length === 1;
        n && (e = XV.get(r)), e === void 0 && ((this.o = e = new CSSStyleSheet).replaceSync(this.cssText), n && XV.set(r, e))
      }
      return e
    }
    toString() {
      return this.cssText
    }
  };
  const fNe = t => new eK(typeof t == "string" ? t : t + "", void 0, DI),
    Zr = (t, ...e) => {
      const r = t.length === 1 ? t[0] : e.reduce((n, i, s) => n + (o => {
        if (o._$cssResult$ === !0) return o.cssText;
        if (typeof o == "number") return o;
        throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")
      })(i) + t[s + 1], t[0]);
      return new eK(r, t, DI)
    },
    pNe = (t, e) => {
      OI ? t.adoptedStyleSheets = e.map(r => r instanceof CSSStyleSheet ? r : r.styleSheet) : e.forEach(r => {
        const n = document.createElement("style"),
          i = Q8.litNonce;
        i !== void 0 && n.setAttribute("nonce", i), n.textContent = r.cssText, t.appendChild(n)
      })
    },
    tK = OI ? t => t : t => t instanceof CSSStyleSheet ? (e => {
      let r = "";
      for (const n of e.cssRules) r += n.cssText;
      return fNe(r)
    })(t) : t;
  /**
   * @license
   * Copyright 2017 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  var LI;
  const J8 = window,
    rK = J8.trustedTypes,
    gNe = rK ? rK.emptyScript : "",
    nK = J8.reactiveElementPolyfillSupport,
    BI = {
      toAttribute(t, e) {
        switch (e) {
          case Boolean:
            t = t ? gNe : null;
            break;
          case Object:
          case Array:
            t = t == null ? t : JSON.stringify(t)
        }
        return t
      },
      fromAttribute(t, e) {
        let r = t;
        switch (e) {
          case Boolean:
            r = t !== null;
            break;
          case Number:
            r = t === null ? null : Number(t);
            break;
          case Object:
          case Array:
            try {
              r = JSON.parse(t)
            } catch {
              r = null
            }
        }
        return r
      }
    },
    iK = (t, e) => e !== t && (e == e || t == t),
    UI = {
      attribute: !0,
      type: String,
      converter: BI,
      reflect: !1,
      hasChanged: iK
    },
    jI = "finalized";
  let Am = class extends HTMLElement {
    constructor() {
      super(), this._$Ei = new Map, this.isUpdatePending = !1, this.hasUpdated = !1, this._$El = null, this._$Eu()
    }
    static addInitializer(e) {
      var r;
      this.finalize(), ((r = this.h) !== null && r !== void 0 ? r : this.h = []).push(e)
    }
    static get observedAttributes() {
      this.finalize();
      const e = [];
      return this.elementProperties.forEach((r, n) => {
        const i = this._$Ep(n, r);
        i !== void 0 && (this._$Ev.set(i, n), e.push(i))
      }), e
    }
    static createProperty(e, r = UI) {
      if (r.state && (r.attribute = !1), this.finalize(), this.elementProperties.set(e, r), !r.noAccessor && !this.prototype.hasOwnProperty(e)) {
        const n = typeof e == "symbol" ? Symbol() : "__" + e,
          i = this.getPropertyDescriptor(e, n, r);
        i !== void 0 && Object.defineProperty(this.prototype, e, i)
      }
    }
    static getPropertyDescriptor(e, r, n) {
      return {
        get() {
          return this[r]
        },
        set(i) {
          const s = this[e];
          this[r] = i, this.requestUpdate(e, s, n)
        },
        configurable: !0,
        enumerable: !0
      }
    }
    static getPropertyOptions(e) {
      return this.elementProperties.get(e) || UI
    }
    static finalize() {
      if (this.hasOwnProperty(jI)) return !1;
      this[jI] = !0;
      const e = Object.getPrototypeOf(this);
      if (e.finalize(), e.h !== void 0 && (this.h = [...e.h]), this.elementProperties = new Map(e.elementProperties), this._$Ev = new Map, this.hasOwnProperty("properties")) {
        const r = this.properties,
          n = [...Object.getOwnPropertyNames(r), ...Object.getOwnPropertySymbols(r)];
        for (const i of n) this.createProperty(i, r[i])
      }
      return this.elementStyles = this.finalizeStyles(this.styles), !0
    }
    static finalizeStyles(e) {
      const r = [];
      if (Array.isArray(e)) {
        const n = new Set(e.flat(1 / 0).reverse());
        for (const i of n) r.unshift(tK(i))
      } else e !== void 0 && r.push(tK(e));
      return r
    }
    static _$Ep(e, r) {
      const n = r.attribute;
      return n === !1 ? void 0 : typeof n == "string" ? n : typeof e == "string" ? e.toLowerCase() : void 0
    }
    _$Eu() {
      var e;
      this._$E_ = new Promise(r => this.enableUpdating = r), this._$AL = new Map, this._$Eg(), this.requestUpdate(), (e = this.constructor.h) === null || e === void 0 || e.forEach(r => r(this))
    }
    addController(e) {
      var r, n;
      ((r = this._$ES) !== null && r !== void 0 ? r : this._$ES = []).push(e), this.renderRoot !== void 0 && this.isConnected && ((n = e.hostConnected) === null || n === void 0 || n.call(e))
    }
    removeController(e) {
      var r;
      (r = this._$ES) === null || r === void 0 || r.splice(this._$ES.indexOf(e) >>> 0, 1)
    }
    _$Eg() {
      this.constructor.elementProperties.forEach((e, r) => {
        this.hasOwnProperty(r) && (this._$Ei.set(r, this[r]), delete this[r])
      })
    }
    createRenderRoot() {
      var e;
      const r = (e = this.shadowRoot) !== null && e !== void 0 ? e : this.attachShadow(this.constructor.shadowRootOptions);
      return pNe(r, this.constructor.elementStyles), r
    }
    connectedCallback() {
      var e;
      this.renderRoot === void 0 && (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (e = this._$ES) === null || e === void 0 || e.forEach(r => {
        var n;
        return (n = r.hostConnected) === null || n === void 0 ? void 0 : n.call(r)
      })
    }
    enableUpdating(e) {}
    disconnectedCallback() {
      var e;
      (e = this._$ES) === null || e === void 0 || e.forEach(r => {
        var n;
        return (n = r.hostDisconnected) === null || n === void 0 ? void 0 : n.call(r)
      })
    }
    attributeChangedCallback(e, r, n) {
      this._$AK(e, n)
    }
    _$EO(e, r, n = UI) {
      var i;
      const s = this.constructor._$Ep(e, n);
      if (s !== void 0 && n.reflect === !0) {
        const o = (((i = n.converter) === null || i === void 0 ? void 0 : i.toAttribute) !== void 0 ? n.converter : BI).toAttribute(r, n.type);
        this._$El = e, o == null ? this.removeAttribute(s) : this.setAttribute(s, o), this._$El = null
      }
    }
    _$AK(e, r) {
      var n;
      const i = this.constructor,
        s = i._$Ev.get(e);
      if (s !== void 0 && this._$El !== s) {
        const o = i.getPropertyOptions(s),
          a = typeof o.converter == "function" ? {
            fromAttribute: o.converter
          } : ((n = o.converter) === null || n === void 0 ? void 0 : n.fromAttribute) !== void 0 ? o.converter : BI;
        this._$El = s, this[s] = a.fromAttribute(r, o.type), this._$El = null
      }
    }
    requestUpdate(e, r, n) {
      let i = !0;
      e !== void 0 && (((n = n || this.constructor.getPropertyOptions(e)).hasChanged || iK)(this[e], r) ? (this._$AL.has(e) || this._$AL.set(e, r), n.reflect === !0 && this._$El !== e && (this._$EC === void 0 && (this._$EC = new Map), this._$EC.set(e, n))) : i = !1), !this.isUpdatePending && i && (this._$E_ = this._$Ej())
    }
    async _$Ej() {
      this.isUpdatePending = !0;
      try {
        await this._$E_
      } catch (r) {
        Promise.reject(r)
      }
      const e = this.scheduleUpdate();
      return e != null && await e, !this.isUpdatePending
    }
    scheduleUpdate() {
      return this.performUpdate()
    }
    performUpdate() {
      var e;
      if (!this.isUpdatePending) return;
      this.hasUpdated, this._$Ei && (this._$Ei.forEach((i, s) => this[s] = i), this._$Ei = void 0);
      let r = !1;
      const n = this._$AL;
      try {
        r = this.shouldUpdate(n), r ? (this.willUpdate(n), (e = this._$ES) === null || e === void 0 || e.forEach(i => {
          var s;
          return (s = i.hostUpdate) === null || s === void 0 ? void 0 : s.call(i)
        }), this.update(n)) : this._$Ek()
      } catch (i) {
        throw r = !1, this._$Ek(), i
      }
      r && this._$AE(n)
    }
    willUpdate(e) {}
    _$AE(e) {
      var r;
      (r = this._$ES) === null || r === void 0 || r.forEach(n => {
        var i;
        return (i = n.hostUpdated) === null || i === void 0 ? void 0 : i.call(n)
      }), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(e)), this.updated(e)
    }
    _$Ek() {
      this._$AL = new Map, this.isUpdatePending = !1
    }
    get updateComplete() {
      return this.getUpdateComplete()
    }
    getUpdateComplete() {
      return this._$E_
    }
    shouldUpdate(e) {
      return !0
    }
    update(e) {
      this._$EC !== void 0 && (this._$EC.forEach((r, n) => this._$EO(n, this[n], r)), this._$EC = void 0), this._$Ek()
    }
    updated(e) {}
    firstUpdated(e) {}
  };
  Am[jI] = !0, Am.elementProperties = new Map, Am.elementStyles = [], Am.shadowRootOptions = {
    mode: "open"
  }, nK?.({
    ReactiveElement: Am
  }), ((LI = J8.reactiveElementVersions) !== null && LI !== void 0 ? LI : J8.reactiveElementVersions = []).push("1.6.3");
  /**
   * @license
   * Copyright 2017 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  var FI;
  const X8 = window,
    Sm = X8.trustedTypes,
    sK = Sm ? Sm.createPolicy("lit-html", {
      createHTML: t => t
    }) : void 0,
    WI = "$lit$",
    ef = `lit$${(Math.random()+"").slice(9)}$`,
    oK = "?" + ef,
    mNe = `<${oK}>`,
    _p = document,
    e3 = () => _p.createComment(""),
    t3 = t => t === null || typeof t != "object" && typeof t != "function",
    aK = Array.isArray,
    wNe = t => aK(t) || typeof t?.[Symbol.iterator] == "function",
    zI = `[ 	
  \f\r]`,
    r3 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,
    cK = /-->/g,
    lK = />/g,
    xp = RegExp(`>|${zI}(?:([^\\s"'>=/]+)(${zI}*=${zI}*(?:[^ 	
  \f\r"'\`<>=]|("|')|))|$)`, "g"),
    uK = /'/g,
    dK = /"/g,
    hK = /^(?:script|style|textarea|title)$/i,
    fK = t => (e, ...r) => ({
      _$litType$: t,
      strings: e,
      values: r
    }),
    dt = fK(1),
    Yn = fK(2),
    Cp = Symbol.for("lit-noChange"),
    Si = Symbol.for("lit-nothing"),
    pK = new WeakMap,
    Ep = _p.createTreeWalker(_p, 129, null, !1);

  function gK(t, e) {
    if (!Array.isArray(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
    return sK !== void 0 ? sK.createHTML(e) : e
  }
  const vNe = (t, e) => {
    const r = t.length - 1,
      n = [];
    let i, s = e === 2 ? "<svg>" : "",
      o = r3;
    for (let a = 0; a < r; a++) {
      const c = t[a];
      let l, h, f = -1,
        w = 0;
      for (; w < c.length && (o.lastIndex = w, h = o.exec(c), h !== null);) w = o.lastIndex, o === r3 ? h[1] === "!--" ? o = cK : h[1] !== void 0 ? o = lK : h[2] !== void 0 ? (hK.test(h[2]) && (i = RegExp("</" + h[2], "g")), o = xp) : h[3] !== void 0 && (o = xp) : o === xp ? h[0] === ">" ? (o = i ?? r3, f = -1) : h[1] === void 0 ? f = -2 : (f = o.lastIndex - h[2].length, l = h[1], o = h[3] === void 0 ? xp : h[3] === '"' ? dK : uK) : o === dK || o === uK ? o = xp : o === cK || o === lK ? o = r3 : (o = xp, i = void 0);
      const b = o === xp && t[a + 1].startsWith("/>") ? " " : "";
      s += o === r3 ? c + mNe : f >= 0 ? (n.push(l), c.slice(0, f) + WI + c.slice(f) + ef + b) : c + ef + (f === -2 ? (n.push(void 0), a) : b)
    }
    return [gK(t, s + (t[r] || "<?>") + (e === 2 ? "</svg>" : "")), n]
  };
  class n3 {
    constructor({
      strings: e,
      _$litType$: r
    }, n) {
      let i;
      this.parts = [];
      let s = 0,
        o = 0;
      const a = e.length - 1,
        c = this.parts,
        [l, h] = vNe(e, r);
      if (this.el = n3.createElement(l, n), Ep.currentNode = this.el.content, r === 2) {
        const f = this.el.content,
          w = f.firstChild;
        w.remove(), f.append(...w.childNodes)
      }
      for (;
        (i = Ep.nextNode()) !== null && c.length < a;) {
        if (i.nodeType === 1) {
          if (i.hasAttributes()) {
            const f = [];
            for (const w of i.getAttributeNames())
              if (w.endsWith(WI) || w.startsWith(ef)) {
                const b = h[o++];
                if (f.push(w), b !== void 0) {
                  const C = i.getAttribute(b.toLowerCase() + WI).split(ef),
                    M = /([.?@])?(.*)/.exec(b);
                  c.push({
                    type: 1,
                    index: s,
                    name: M[2],
                    strings: C,
                    ctor: M[1] === "." ? yNe : M[1] === "?" ? xNe : M[1] === "@" ? CNe : e_
                  })
                } else c.push({
                  type: 6,
                  index: s
                })
              } for (const w of f) i.removeAttribute(w)
          }
          if (hK.test(i.tagName)) {
            const f = i.textContent.split(ef),
              w = f.length - 1;
            if (w > 0) {
              i.textContent = Sm ? Sm.emptyScript : "";
              for (let b = 0; b < w; b++) i.append(f[b], e3()), Ep.nextNode(), c.push({
                type: 2,
                index: ++s
              });
              i.append(f[w], e3())
            }
          }
        } else if (i.nodeType === 8)
          if (i.data === oK) c.push({
            type: 2,
            index: s
          });
          else {
            let f = -1;
            for (;
              (f = i.data.indexOf(ef, f + 1)) !== -1;) c.push({
              type: 7,
              index: s
            }), f += ef.length - 1
          } s++
      }
    }
    static createElement(e, r) {
      const n = _p.createElement("template");
      return n.innerHTML = e, n
    }
  }

  function Im(t, e, r = t, n) {
    var i, s, o, a;
    if (e === Cp) return e;
    let c = n !== void 0 ? (i = r._$Co) === null || i === void 0 ? void 0 : i[n] : r._$Cl;
    const l = t3(e) ? void 0 : e._$litDirective$;
    return c?.constructor !== l && ((s = c?._$AO) === null || s === void 0 || s.call(c, !1), l === void 0 ? c = void 0 : (c = new l(t), c._$AT(t, r, n)), n !== void 0 ? ((o = (a = r)._$Co) !== null && o !== void 0 ? o : a._$Co = [])[n] = c : r._$Cl = c), c !== void 0 && (e = Im(t, c._$AS(t, e.values), c, n)), e
  }
  class bNe {
    constructor(e, r) {
      this._$AV = [], this._$AN = void 0, this._$AD = e, this._$AM = r
    }
    get parentNode() {
      return this._$AM.parentNode
    }
    get _$AU() {
      return this._$AM._$AU
    }
    u(e) {
      var r;
      const {
        el: {
          content: n
        },
        parts: i
      } = this._$AD, s = ((r = e?.creationScope) !== null && r !== void 0 ? r : _p).importNode(n, !0);
      Ep.currentNode = s;
      let o = Ep.nextNode(),
        a = 0,
        c = 0,
        l = i[0];
      for (; l !== void 0;) {
        if (a === l.index) {
          let h;
          l.type === 2 ? h = new i3(o, o.nextSibling, this, e) : l.type === 1 ? h = new l.ctor(o, l.name, l.strings, this, e) : l.type === 6 && (h = new ENe(o, this, e)), this._$AV.push(h), l = i[++c]
        }
        a !== l?.index && (o = Ep.nextNode(), a++)
      }
      return Ep.currentNode = _p, s
    }
    v(e) {
      let r = 0;
      for (const n of this._$AV) n !== void 0 && (n.strings !== void 0 ? (n._$AI(e, n, r), r += n.strings.length - 2) : n._$AI(e[r])), r++
    }
  }
  class i3 {
    constructor(e, r, n, i) {
      var s;
      this.type = 2, this._$AH = Si, this._$AN = void 0, this._$AA = e, this._$AB = r, this._$AM = n, this.options = i, this._$Cp = (s = i?.isConnected) === null || s === void 0 || s
    }
    get _$AU() {
      var e, r;
      return (r = (e = this._$AM) === null || e === void 0 ? void 0 : e._$AU) !== null && r !== void 0 ? r : this._$Cp
    }
    get parentNode() {
      let e = this._$AA.parentNode;
      const r = this._$AM;
      return r !== void 0 && e?.nodeType === 11 && (e = r.parentNode), e
    }
    get startNode() {
      return this._$AA
    }
    get endNode() {
      return this._$AB
    }
    _$AI(e, r = this) {
      e = Im(this, e, r), t3(e) ? e === Si || e == null || e === "" ? (this._$AH !== Si && this._$AR(), this._$AH = Si) : e !== this._$AH && e !== Cp && this._(e) : e._$litType$ !== void 0 ? this.g(e) : e.nodeType !== void 0 ? this.$(e) : wNe(e) ? this.T(e) : this._(e)
    }
    k(e) {
      return this._$AA.parentNode.insertBefore(e, this._$AB)
    }
    $(e) {
      this._$AH !== e && (this._$AR(), this._$AH = this.k(e))
    }
    _(e) {
      this._$AH !== Si && t3(this._$AH) ? this._$AA.nextSibling.data = e : this.$(_p.createTextNode(e)), this._$AH = e
    }
    g(e) {
      var r;
      const {
        values: n,
        _$litType$: i
      } = e, s = typeof i == "number" ? this._$AC(e) : (i.el === void 0 && (i.el = n3.createElement(gK(i.h, i.h[0]), this.options)), i);
      if (((r = this._$AH) === null || r === void 0 ? void 0 : r._$AD) === s) this._$AH.v(n);
      else {
        const o = new bNe(s, this),
          a = o.u(this.options);
        o.v(n), this.$(a), this._$AH = o
      }
    }
    _$AC(e) {
      let r = pK.get(e.strings);
      return r === void 0 && pK.set(e.strings, r = new n3(e)), r
    }
    T(e) {
      aK(this._$AH) || (this._$AH = [], this._$AR());
      const r = this._$AH;
      let n, i = 0;
      for (const s of e) i === r.length ? r.push(n = new i3(this.k(e3()), this.k(e3()), this, this.options)) : n = r[i], n._$AI(s), i++;
      i < r.length && (this._$AR(n && n._$AB.nextSibling, i), r.length = i)
    }
    _$AR(e = this._$AA.nextSibling, r) {
      var n;
      for ((n = this._$AP) === null || n === void 0 || n.call(this, !1, !0, r); e && e !== this._$AB;) {
        const i = e.nextSibling;
        e.remove(), e = i
      }
    }
    setConnected(e) {
      var r;
      this._$AM === void 0 && (this._$Cp = e, (r = this._$AP) === null || r === void 0 || r.call(this, e))
    }
  }
  class e_ {
    constructor(e, r, n, i, s) {
      this.type = 1, this._$AH = Si, this._$AN = void 0, this.element = e, this.name = r, this._$AM = i, this.options = s, n.length > 2 || n[0] !== "" || n[1] !== "" ? (this._$AH = Array(n.length - 1).fill(new String), this.strings = n) : this._$AH = Si
    }
    get tagName() {
      return this.element.tagName
    }
    get _$AU() {
      return this._$AM._$AU
    }
    _$AI(e, r = this, n, i) {
      const s = this.strings;
      let o = !1;
      if (s === void 0) e = Im(this, e, r, 0), o = !t3(e) || e !== this._$AH && e !== Cp, o && (this._$AH = e);
      else {
        const a = e;
        let c, l;
        for (e = s[0], c = 0; c < s.length - 1; c++) l = Im(this, a[n + c], r, c), l === Cp && (l = this._$AH[c]), o || (o = !t3(l) || l !== this._$AH[c]), l === Si ? e = Si : e !== Si && (e += (l ?? "") + s[c + 1]), this._$AH[c] = l
      }
      o && !i && this.j(e)
    }
    j(e) {
      e === Si ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, e ?? "")
    }
  }
  class yNe extends e_ {
    constructor() {
      super(...arguments), this.type = 3
    }
    j(e) {
      this.element[this.name] = e === Si ? void 0 : e
    }
  }
  const _Ne = Sm ? Sm.emptyScript : "";
  class xNe extends e_ {
    constructor() {
      super(...arguments), this.type = 4
    }
    j(e) {
      e && e !== Si ? this.element.setAttribute(this.name, _Ne) : this.element.removeAttribute(this.name)
    }
  }
  class CNe extends e_ {
    constructor(e, r, n, i, s) {
      super(e, r, n, i, s), this.type = 5
    }
    _$AI(e, r = this) {
      var n;
      if ((e = (n = Im(this, e, r, 0)) !== null && n !== void 0 ? n : Si) === Cp) return;
      const i = this._$AH,
        s = e === Si && i !== Si || e.capture !== i.capture || e.once !== i.once || e.passive !== i.passive,
        o = e !== Si && (i === Si || s);
      s && this.element.removeEventListener(this.name, this, i), o && this.element.addEventListener(this.name, this, e), this._$AH = e
    }
    handleEvent(e) {
      var r, n;
      typeof this._$AH == "function" ? this._$AH.call((n = (r = this.options) === null || r === void 0 ? void 0 : r.host) !== null && n !== void 0 ? n : this.element, e) : this._$AH.handleEvent(e)
    }
  }
  class ENe {
    constructor(e, r, n) {
      this.element = e, this.type = 6, this._$AN = void 0, this._$AM = r, this.options = n
    }
    get _$AU() {
      return this._$AM._$AU
    }
    _$AI(e) {
      Im(this, e)
    }
  }
  const mK = X8.litHtmlPolyfillSupport;
  mK?.(n3, i3), ((FI = X8.litHtmlVersions) !== null && FI !== void 0 ? FI : X8.litHtmlVersions = []).push("2.8.0");
  const ANe = (t, e, r) => {
    var n, i;
    const s = (n = r?.renderBefore) !== null && n !== void 0 ? n : e;
    let o = s._$litPart$;
    if (o === void 0) {
      const a = (i = r?.renderBefore) !== null && i !== void 0 ? i : null;
      s._$litPart$ = o = new i3(e.insertBefore(e3(), a), a, void 0, r ?? {})
    }
    return o._$AI(t), o
  };
  /**
   * @license
   * Copyright 2017 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  var HI, qI;
  class Ir extends Am {
    constructor() {
      super(...arguments), this.renderOptions = {
        host: this
      }, this._$Do = void 0
    }
    createRenderRoot() {
      var e, r;
      const n = super.createRenderRoot();
      return (e = (r = this.renderOptions).renderBefore) !== null && e !== void 0 || (r.renderBefore = n.firstChild), n
    }
    update(e) {
      const r = this.render();
      this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(e), this._$Do = ANe(r, this.renderRoot, this.renderOptions)
    }
    connectedCallback() {
      var e;
      super.connectedCallback(), (e = this._$Do) === null || e === void 0 || e.setConnected(!0)
    }
    disconnectedCallback() {
      var e;
      super.disconnectedCallback(), (e = this._$Do) === null || e === void 0 || e.setConnected(!1)
    }
    render() {
      return Cp
    }
  }
  Ir.finalized = !0, Ir._$litElement$ = !0, (HI = globalThis.litElementHydrateSupport) === null || HI === void 0 || HI.call(globalThis, {
    LitElement: Ir
  });
  const wK = globalThis.litElementPolyfillSupport;
  wK?.({
    LitElement: Ir
  }), ((qI = globalThis.litElementVersions) !== null && qI !== void 0 ? qI : globalThis.litElementVersions = []).push("3.3.3");
  /**
   * @license
   * Copyright 2017 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  const Ur = t => e => typeof e == "function" ? ((r, n) => (customElements.define(r, n), n))(t, e) : ((r, n) => {
    const {
      kind: i,
      elements: s
    } = n;
    return {
      kind: i,
      elements: s,
      finisher(o) {
        customElements.define(r, o)
      }
    }
  })(t, e);
  /**
   * @license
   * Copyright 2017 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  const SNe = (t, e) => e.kind === "method" && e.descriptor && !("value" in e.descriptor) ? {
      ...e,
      finisher(r) {
        r.createProperty(e.key, t)
      }
    } : {
      kind: "field",
      key: Symbol(),
      placement: "own",
      descriptor: {},
      originalKey: e.key,
      initializer() {
        typeof e.initializer == "function" && (this[e.key] = e.initializer.call(this))
      },
      finisher(r) {
        r.createProperty(e.key, t)
      }
    },
    INe = (t, e, r) => {
      e.constructor.createProperty(r, t)
    };

  function vr(t) {
    return (e, r) => r !== void 0 ? INe(t, e, r) : SNe(t, e)
  }
  /**
   * @license
   * Copyright 2017 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  function Eo(t) {
    return vr({
      ...t,
      state: !0
    })
  }
  /**
   * @license
   * Copyright 2021 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  var VI;
  ((VI = window.HTMLSlotElement) === null || VI === void 0 ? void 0 : VI.prototype.assignedElements) != null;
  /**
   * @license
   * Copyright 2017 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  const TNe = {
      ATTRIBUTE: 1,
      CHILD: 2,
      PROPERTY: 3,
      BOOLEAN_ATTRIBUTE: 4,
      EVENT: 5,
      ELEMENT: 6
    },
    kNe = t => (...e) => ({
      _$litDirective$: t,
      values: e
    });
  class RNe {
    constructor(e) {}
    get _$AU() {
      return this._$AM._$AU
    }
    _$AT(e, r, n) {
      this._$Ct = e, this._$AM = r, this._$Ci = n
    }
    _$AS(e, r) {
      return this.update(e, r)
    }
    update(e, r) {
      return this.render(...r)
    }
  }
  /**
   * @license
   * Copyright 2018 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  const yd = kNe(class extends RNe {
    constructor(t) {
      var e;
      if (super(t), t.type !== TNe.ATTRIBUTE || t.name !== "class" || ((e = t.strings) === null || e === void 0 ? void 0 : e.length) > 2) throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")
    }
    render(t) {
      return " " + Object.keys(t).filter(e => t[e]).join(" ") + " "
    }
    update(t, [e]) {
      var r, n;
      if (this.it === void 0) {
        this.it = new Set, t.strings !== void 0 && (this.nt = new Set(t.strings.join(" ").split(/\s/).filter(s => s !== "")));
        for (const s in e) e[s] && !(!((r = this.nt) === null || r === void 0) && r.has(s)) && this.it.add(s);
        return this.render(e)
      }
      const i = t.element.classList;
      this.it.forEach(s => {
        s in e || (i.remove(s), this.it.delete(s))
      });
      for (const s in e) {
        const o = !!e[s];
        o === this.it.has(s) || !((n = this.nt) === null || n === void 0) && n.has(s) || (o ? (i.add(s), this.it.add(s)) : (i.remove(s), this.it.delete(s)))
      }
      return Cp
    }
  });

  function NNe(t, e) {
    t.indexOf(e) === -1 && t.push(e)
  }
  const vK = (t, e, r) => Math.min(Math.max(r, t), e),
    ja = {
      duration: .3,
      delay: 0,
      endDelay: 0,
      repeat: 0,
      easing: "ease"
    },
    t_ = t => typeof t == "number",
    Tm = t => Array.isArray(t) && !t_(t[0]),
    MNe = (t, e, r) => {
      const n = e - t;
      return ((r - t) % n + n) % n + t
    };

  function PNe(t, e) {
    return Tm(t) ? t[MNe(0, t.length, e)] : t
  }
  const bK = (t, e, r) => -r * t + r * e + t,
    yK = () => {},
    tf = t => t,
    KI = (t, e, r) => e - t === 0 ? 1 : (r - t) / (e - t);

  function _K(t, e) {
    const r = t[t.length - 1];
    for (let n = 1; n <= e; n++) {
      const i = KI(0, e, n);
      t.push(bK(r, 1, i))
    }
  }

  function $Ne(t) {
    const e = [0];
    return _K(e, t - 1), e
  }

  function ONe(t, e = $Ne(t.length), r = tf) {
    const n = t.length,
      i = n - e.length;
    return i > 0 && _K(e, i), s => {
      let o = 0;
      for (; o < n - 2 && !(s < e[o + 1]); o++);
      let a = vK(0, 1, KI(e[o], e[o + 1], s));
      return a = PNe(r, o)(a), bK(t[o], t[o + 1], a)
    }
  }
  const xK = t => Array.isArray(t) && t_(t[0]),
    GI = t => typeof t == "object" && !!t.createAnimation,
    km = t => typeof t == "function",
    DNe = t => typeof t == "string",
    s3 = {
      ms: t => t * 1e3,
      s: t => t / 1e3
    },
    CK = (t, e, r) => (((1 - 3 * r + 3 * e) * t + (3 * r - 6 * e)) * t + 3 * e) * t,
    LNe = 1e-7,
    BNe = 12;

  function UNe(t, e, r, n, i) {
    let s, o, a = 0;
    do o = e + (r - e) / 2, s = CK(o, n, i) - t, s > 0 ? r = o : e = o; while (Math.abs(s) > LNe && ++a < BNe);
    return o
  }

  function o3(t, e, r, n) {
    if (t === e && r === n) return tf;
    const i = s => UNe(s, 0, 1, t, r);
    return s => s === 0 || s === 1 ? s : CK(i(s), e, n)
  }
  const jNe = (t, e = "end") => r => {
      r = e === "end" ? Math.min(r, .999) : Math.max(r, .001);
      const n = r * t,
        i = e === "end" ? Math.floor(n) : Math.ceil(n);
      return vK(0, 1, i / t)
    },
    FNe = {
      ease: o3(.25, .1, .25, 1),
      "ease-in": o3(.42, 0, 1, 1),
      "ease-in-out": o3(.42, 0, .58, 1),
      "ease-out": o3(0, 0, .58, 1)
    },
    WNe = /\((.*?)\)/;

  function EK(t) {
    if (km(t)) return t;
    if (xK(t)) return o3(...t);
    const e = FNe[t];
    if (e) return e;
    if (t.startsWith("steps")) {
      const r = WNe.exec(t);
      if (r) {
        const n = r[1].split(",");
        return jNe(parseFloat(n[0]), n[1].trim())
      }
    }
    return tf
  }
  class AK {
    constructor(e, r = [0, 1], {
      easing: n,
      duration: i = ja.duration,
      delay: s = ja.delay,
      endDelay: o = ja.endDelay,
      repeat: a = ja.repeat,
      offset: c,
      direction: l = "normal",
      autoplay: h = !0
    } = {}) {
      if (this.startTime = null, this.rate = 1, this.t = 0, this.cancelTimestamp = null, this.easing = tf, this.duration = 0, this.totalDuration = 0, this.repeat = 0, this.playState = "idle", this.finished = new Promise((w, b) => {
          this.resolve = w, this.reject = b
        }), n = n || ja.easing, GI(n)) {
        const w = n.createAnimation(r);
        n = w.easing, r = w.keyframes || r, i = w.duration || i
      }
      this.repeat = a, this.easing = Tm(n) ? tf : EK(n), this.updateDuration(i);
      const f = ONe(r, c, Tm(n) ? n.map(EK) : tf);
      this.tick = w => {
        var b;
        s = s;
        let C = 0;
        this.pauseTime !== void 0 ? C = this.pauseTime : C = (w - this.startTime) * this.rate, this.t = C, C /= 1e3, C = Math.max(C - s, 0), this.playState === "finished" && this.pauseTime === void 0 && (C = this.totalDuration);
        const M = C / this.duration;
        let N = Math.floor(M),
          $ = M % 1;
        !$ && M >= 1 && ($ = 1), $ === 1 && N--;
        const k = N % 2;
        (l === "reverse" || l === "alternate" && k || l === "alternate-reverse" && !k) && ($ = 1 - $);
        const B = C >= this.totalDuration ? 1 : Math.min($, 1),
          F = f(this.easing(B));
        e(F), this.pauseTime === void 0 && (this.playState === "finished" || C >= this.totalDuration + o) ? (this.playState = "finished", (b = this.resolve) === null || b === void 0 || b.call(this, F)) : this.playState !== "idle" && (this.frameRequestId = requestAnimationFrame(this.tick))
      }, h && this.play()
    }
    play() {
      const e = performance.now();
      this.playState = "running", this.pauseTime !== void 0 ? this.startTime = e - this.pauseTime : this.startTime || (this.startTime = e), this.cancelTimestamp = this.startTime, this.pauseTime = void 0, this.frameRequestId = requestAnimationFrame(this.tick)
    }
    pause() {
      this.playState = "paused", this.pauseTime = this.t
    }
    finish() {
      this.playState = "finished", this.tick(0)
    }
    stop() {
      var e;
      this.playState = "idle", this.frameRequestId !== void 0 && cancelAnimationFrame(this.frameRequestId), (e = this.reject) === null || e === void 0 || e.call(this, !1)
    }
    cancel() {
      this.stop(), this.tick(this.cancelTimestamp)
    }
    reverse() {
      this.rate *= -1
    }
    commitStyles() {}
    updateDuration(e) {
      this.duration = e, this.totalDuration = e * (this.repeat + 1)
    }
    get currentTime() {
      return this.t
    }
    set currentTime(e) {
      this.pauseTime !== void 0 || this.rate === 0 ? this.pauseTime = e : this.startTime = performance.now() - e / this.rate
    }
    get playbackRate() {
      return this.rate
    }
    set playbackRate(e) {
      this.rate = e
    }
  }
  class zNe {
    setAnimation(e) {
      this.animation = e, e?.finished.then(() => this.clearAnimation()).catch(() => {})
    }
    clearAnimation() {
      this.animation = this.generator = void 0
    }
  }
  const ZI = new WeakMap;

  function SK(t) {
    return ZI.has(t) || ZI.set(t, {
      transforms: [],
      values: new Map
    }), ZI.get(t)
  }

  function HNe(t, e) {
    return t.has(e) || t.set(e, new zNe), t.get(e)
  }
  const qNe = ["", "X", "Y", "Z"],
    VNe = ["translate", "scale", "rotate", "skew"],
    r_ = {
      x: "translateX",
      y: "translateY",
      z: "translateZ"
    },
    IK = {
      syntax: "<angle>",
      initialValue: "0deg",
      toDefaultUnit: t => t + "deg"
    },
    KNe = {
      translate: {
        syntax: "<length-percentage>",
        initialValue: "0px",
        toDefaultUnit: t => t + "px"
      },
      rotate: IK,
      scale: {
        syntax: "<number>",
        initialValue: 1,
        toDefaultUnit: tf
      },
      skew: IK
    },
    a3 = new Map,
    YI = t => `--motion-${t}`,
    n_ = ["x", "y", "z"];
  VNe.forEach(t => {
    qNe.forEach(e => {
      n_.push(t + e), a3.set(YI(t + e), KNe[t])
    })
  });
  const GNe = (t, e) => n_.indexOf(t) - n_.indexOf(e),
    ZNe = new Set(n_),
    TK = t => ZNe.has(t),
    YNe = (t, e) => {
      r_[e] && (e = r_[e]);
      const {
        transforms: r
      } = SK(t);
      NNe(r, e), t.style.transform = QNe(r)
    },
    QNe = t => t.sort(GNe).reduce(JNe, "").trim(),
    JNe = (t, e) => `${t} ${e}(var(${YI(e)}))`,
    QI = t => t.startsWith("--"),
    kK = new Set;

  function XNe(t) {
    if (!kK.has(t)) {
      kK.add(t);
      try {
        const {
          syntax: e,
          initialValue: r
        } = a3.has(t) ? a3.get(t) : {};
        CSS.registerProperty({
          name: t,
          inherits: !1,
          syntax: e,
          initialValue: r
        })
      } catch {}
    }
  }
  const JI = (t, e) => document.createElement("div").animate(t, e),
    RK = {
      cssRegisterProperty: () => typeof CSS < "u" && Object.hasOwnProperty.call(CSS, "registerProperty"),
      waapi: () => Object.hasOwnProperty.call(Element.prototype, "animate"),
      partialKeyframes: () => {
        try {
          JI({
            opacity: [1]
          })
        } catch {
          return !1
        }
        return !0
      },
      finished: () => !!JI({
        opacity: [0, 1]
      }, {
        duration: .001
      }).finished,
      linearEasing: () => {
        try {
          JI({
            opacity: 0
          }, {
            easing: "linear(0, 1)"
          })
        } catch {
          return !1
        }
        return !0
      }
    },
    XI = {},
    Rm = {};
  for (const t in RK) Rm[t] = () => (XI[t] === void 0 && (XI[t] = RK[t]()), XI[t]);
  const eMe = .015,
    tMe = (t, e) => {
      let r = "";
      const n = Math.round(e / eMe);
      for (let i = 0; i < n; i++) r += t(KI(0, n - 1, i)) + ", ";
      return r.substring(0, r.length - 2)
    },
    NK = (t, e) => km(t) ? Rm.linearEasing() ? `linear(${tMe(t,e)})` : ja.easing : xK(t) ? rMe(t) : t,
    rMe = ([t, e, r, n]) => `cubic-bezier(${t}, ${e}, ${r}, ${n})`;

  function nMe(t, e) {
    for (let r = 0; r < t.length; r++) t[r] === null && (t[r] = r ? t[r - 1] : e());
    return t
  }
  const iMe = t => Array.isArray(t) ? t : [t];

  function eT(t) {
    return r_[t] && (t = r_[t]), TK(t) ? YI(t) : t
  }
  const i_ = {
    get: (t, e) => {
      e = eT(e);
      let r = QI(e) ? t.style.getPropertyValue(e) : getComputedStyle(t)[e];
      if (!r && r !== 0) {
        const n = a3.get(e);
        n && (r = n.initialValue)
      }
      return r
    },
    set: (t, e, r) => {
      e = eT(e), QI(e) ? t.style.setProperty(e, r) : t.style[e] = r
    }
  };

  function MK(t, e = !0) {
    if (!(!t || t.playState === "finished")) try {
      t.stop ? t.stop() : (e && t.commitStyles(), t.cancel())
    } catch {}
  }

  function sMe(t, e) {
    var r;
    let n = e?.toDefaultUnit || tf;
    const i = t[t.length - 1];
    if (DNe(i)) {
      const s = ((r = i.match(/(-?[\d.]+)([a-z%]*)/)) === null || r === void 0 ? void 0 : r[2]) || "";
      s && (n = o => o + s)
    }
    return n
  }

  function oMe() {
    return window.__MOTION_DEV_TOOLS_RECORD
  }

  function aMe(t, e, r, n = {}, i) {
    const s = oMe(),
      o = n.record !== !1 && s;
    let a, {
      duration: c = ja.duration,
      delay: l = ja.delay,
      endDelay: h = ja.endDelay,
      repeat: f = ja.repeat,
      easing: w = ja.easing,
      persist: b = !1,
      direction: C,
      offset: M,
      allowWebkitAcceleration: N = !1,
      autoplay: $ = !0
    } = n;
    const k = SK(t),
      B = TK(e);
    let F = Rm.waapi();
    B && YNe(t, e);
    const D = eT(e),
      V = HNe(k.values, D),
      R = a3.get(D);
    return MK(V.animation, !(GI(w) && V.generator) && n.record !== !1), () => {
      const P = () => {
        var U, I;
        return (I = (U = i_.get(t, D)) !== null && U !== void 0 ? U : R?.initialValue) !== null && I !== void 0 ? I : 0
      };
      let j = nMe(iMe(r), P);
      const Y = sMe(j, R);
      if (GI(w)) {
        const U = w.createAnimation(j, e !== "opacity", P, D, V);
        w = U.easing, j = U.keyframes || j, c = U.duration || c
      }
      if (QI(D) && (Rm.cssRegisterProperty() ? XNe(D) : F = !1), B && !Rm.linearEasing() && (km(w) || Tm(w) && w.some(km)) && (F = !1), F) {
        R && (j = j.map(g => t_(g) ? R.toDefaultUnit(g) : g)), j.length === 1 && (!Rm.partialKeyframes() || o) && j.unshift(P());
        const U = {
          delay: s3.ms(l),
          duration: s3.ms(c),
          endDelay: s3.ms(h),
          easing: Tm(w) ? void 0 : NK(w, c),
          direction: C,
          iterations: f + 1,
          fill: "both"
        };
        a = t.animate({
          [D]: j,
          offset: M,
          easing: Tm(w) ? w.map(g => NK(g, c)) : void 0
        }, U), a.finished || (a.finished = new Promise((g, u) => {
          a.onfinish = g, a.oncancel = u
        }));
        const I = j[j.length - 1];
        a.finished.then(() => {
          b || (i_.set(t, D, I), a.cancel())
        }).catch(yK), N || (a.playbackRate = 1.000001)
      } else if (i && B) j = j.map(U => typeof U == "string" ? parseFloat(U) : U), j.length === 1 && j.unshift(parseFloat(P())), a = new i(U => {
        i_.set(t, D, Y ? Y(U) : U)
      }, j, Object.assign(Object.assign({}, n), {
        duration: c,
        easing: w
      }));
      else {
        const U = j[j.length - 1];
        i_.set(t, D, R && t_(U) ? R.toDefaultUnit(U) : U)
      }
      return o && s(t, e, j, {
        duration: c,
        delay: l,
        easing: w,
        repeat: f,
        offset: M
      }, "motion-one"), V.setAnimation(a), a && !$ && a.pause(), a
    }
  }
  const cMe = (t, e) => t[e] ? Object.assign(Object.assign({}, t), t[e]) : Object.assign({}, t);

  function lMe(t, e) {
    return typeof t == "string" ? t = document.querySelectorAll(t) : t instanceof Element && (t = [t]), Array.from(t || [])
  }
  const uMe = t => t(),
    PK = (t, e, r = ja.duration) => new Proxy({
      animations: t.map(uMe).filter(Boolean),
      duration: r,
      options: e
    }, hMe),
    dMe = t => t.animations[0],
    hMe = {
      get: (t, e) => {
        const r = dMe(t);
        switch (e) {
          case "duration":
            return t.duration;
          case "currentTime":
            return s3.s(r?.[e] || 0);
          case "playbackRate":
          case "playState":
            return r?.[e];
          case "finished":
            return t.finished || (t.finished = Promise.all(t.animations.map(fMe)).catch(yK)), t.finished;
          case "stop":
            return () => {
              t.animations.forEach(n => MK(n))
            };
          case "forEachNative":
            return n => {
              t.animations.forEach(i => n(i, t))
            };
          default:
            return typeof r?.[e] > "u" ? void 0 : () => t.animations.forEach(n => n[e]())
        }
      },
      set: (t, e, r) => {
        switch (e) {
          case "currentTime":
            r = s3.ms(r);
          case "playbackRate":
            for (let n = 0; n < t.animations.length; n++) t.animations[n][e] = r;
            return !0
        }
        return !1
      }
    },
    fMe = t => t.finished;

  function pMe(t, e, r) {
    return km(t) ? t(e, r) : t
  }

  function gMe(t) {
    return function (r, n, i = {}) {
      r = lMe(r);
      const s = r.length,
        o = [];
      for (let a = 0; a < s; a++) {
        const c = r[a];
        for (const l in n) {
          const h = cMe(i, l);
          h.delay = pMe(h.delay, a, s);
          const f = aMe(c, l, n[l], h, t);
          o.push(f)
        }
      }
      return PK(o, i, i.duration)
    }
  }
  const mMe = gMe(AK);

  function wMe(t, e = {}) {
    return PK([() => {
      const r = new AK(t, [0, 1], e);
      return r.finished.catch(() => {}), r
    }], e, e.duration)
  }

  function Ap(t, e, r) {
    return (km(t) ? wMe : mMe)(t, e, r)
  }
  /**
   * @license
   * Copyright 2018 Google LLC
   * SPDX-License-Identifier: BSD-3-Clause
   */
  const qs = t => t ?? Si;
  var vMe = Object.defineProperty,
    $K = Object.getOwnPropertySymbols,
    bMe = Object.prototype.hasOwnProperty,
    yMe = Object.prototype.propertyIsEnumerable,
    OK = (t, e, r) => e in t ? vMe(t, e, {
      enumerable: !0,
      configurable: !0,
      writable: !0,
      value: r
    }) : t[e] = r,
    tT = (t, e) => {
      for (var r in e || (e = {})) bMe.call(e, r) && OK(t, r, e[r]);
      if ($K)
        for (var r of $K(e)) yMe.call(e, r) && OK(t, r, e[r]);
      return t
    };

  function _Me() {
    var t;
    const e = (t = Jh.state.themeMode) != null ? t : "dark",
      n = {
        light: {
          foreground: {
            1: "rgb(20,20,20)",
            2: "rgb(121,134,134)",
            3: "rgb(158,169,169)"
          },
          background: {
            1: "rgb(255,255,255)",
            2: "rgb(241,243,243)",
            3: "rgb(228,231,231)"
          },
          overlay: "rgba(0,0,0,0.1)"
        },
        dark: {
          foreground: {
            1: "rgb(228,231,231)",
            2: "rgb(148,158,158)",
            3: "rgb(110,119,119)"
          },
          background: {
            1: "rgb(20,20,20)",
            2: "rgb(39,42,42)",
            3: "rgb(59,64,64)"
          },
          overlay: "rgba(255,255,255,0.1)"
        }
      } [e];
    return {
      "--wim-color-fg-1": n.foreground[1],
      "--wim-color-fg-2": n.foreground[2],
      "--wim-color-fg-3": n.foreground[3],
      "--wim-color-bg-1": n.background[1],
      "--wim-color-bg-2": n.background[2],
      "--wim-color-bg-3": n.background[3],
      "--wim-color-overlay": n.overlay
    }
  }

  function DK() {
    return {
      "--wim-accent-color": "#3396FF",
      "--wim-accent-fill-color": "#FFFFFF",
      "--wim-z-index": "89",
      "--wim-background-color": "#3396FF",
      "--wim-background-border-radius": "8px",
      "--wim-container-border-radius": "30px",
      "--wim-wallet-icon-border-radius": "15px",
      "--wim-wallet-icon-large-border-radius": "30px",
      "--wim-wallet-icon-small-border-radius": "7px",
      "--wim-input-border-radius": "28px",
      "--wim-button-border-radius": "10px",
      "--wim-notification-border-radius": "36px",
      "--wim-secondary-button-border-radius": "28px",
      "--wim-icon-button-border-radius": "50%",
      "--wim-button-hover-highlight-border-radius": "10px",
      "--wim-text-big-bold-size": "20px",
      "--wim-text-big-bold-weight": "600",
      "--wim-text-big-bold-line-height": "24px",
      "--wim-text-big-bold-letter-spacing": "-0.03em",
      "--wim-text-big-bold-text-transform": "none",
      "--wim-text-xsmall-bold-size": "10px",
      "--wim-text-xsmall-bold-weight": "700",
      "--wim-text-xsmall-bold-line-height": "12px",
      "--wim-text-xsmall-bold-letter-spacing": "0.02em",
      "--wim-text-xsmall-bold-text-transform": "uppercase",
      "--wim-text-xsmall-regular-size": "12px",
      "--wim-text-xsmall-regular-weight": "600",
      "--wim-text-xsmall-regular-line-height": "14px",
      "--wim-text-xsmall-regular-letter-spacing": "-0.03em",
      "--wim-text-xsmall-regular-text-transform": "none",
      "--wim-text-small-thin-size": "14px",
      "--wim-text-small-thin-weight": "500",
      "--wim-text-small-thin-line-height": "16px",
      "--wim-text-small-thin-letter-spacing": "-0.03em",
      "--wim-text-small-thin-text-transform": "none",
      "--wim-text-small-regular-size": "14px",
      "--wim-text-small-regular-weight": "600",
      "--wim-text-small-regular-line-height": "16px",
      "--wim-text-small-regular-letter-spacing": "-0.03em",
      "--wim-text-small-regular-text-transform": "none",
      "--wim-text-medium-regular-size": "16px",
      "--wim-text-medium-regular-weight": "600",
      "--wim-text-medium-regular-line-height": "20px",
      "--wim-text-medium-regular-letter-spacing": "-0.03em",
      "--wim-text-medium-regular-text-transform": "none",
      "--wim-font-family": "-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif",
      "--wim-font-feature-settings": "'tnum' on, 'lnum' on, 'case' on",
      "--wim-success-color": "rgb(38,181,98)",
      "--wim-error-color": "rgb(242, 90, 103)",
      "--wim-overlay-background-color": "rgba(0, 0, 0, 0.3)",
      "--wim-overlay-backdrop-filter": "none"
    }
  }
  const Dr = {
      getPreset(t) {
        return DK()[t]
      },
      setTheme() {
        const t = document.querySelector(":root"),
          {
            themeVariables: e
          } = Jh.state;
        if (t) {
          const r = tT(tT(tT({}, _Me()), DK()), e);
          Object.entries(r).forEach(([n, i]) => t.style.setProperty(n, i))
        }
      },
      globalCss: Zr`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button wim-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wim-accent-fill-color);background:var(--wim-accent-color)}`
    },
    xMe = Zr`button{border-radius:var(--wim-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wim-accent-color)}button path{fill:var(--wim-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wim-color-overlay)}button:disabled::after{background-color:transparent}.wim-icon-left svg{margin-right:5px}.wim-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wim-color-overlay)}.wim-ghost,.wim-ghost:active::after,.wim-outline{background-color:transparent}.wim-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wim-color-overlay)}.wim-ghost:hover::after{background-color:transparent}.wim-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wim-color-bg-3);pointer-events:none}.wim-ghost::after{border-color:transparent}.wim-ghost path{fill:var(--wim-color-fg-2)}.wim-outline path{fill:var(--wim-accent-color)}.wim-outline:disabled{background-color:transparent;opacity:.5}`;
  var CMe = Object.defineProperty,
    EMe = Object.getOwnPropertyDescriptor,
    Nm = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? EMe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && CMe(e, r, i), i
    };
  let rf = class extends Ir {
    constructor() {
      super(...arguments), this.disabled = !1, this.iconLeft = void 0, this.iconRight = void 0, this.onClick = () => null, this.variant = "default"
    }
    render() {
      const t = {
        "wim-icon-left": this.iconLeft !== void 0,
        "wim-icon-right": this.iconRight !== void 0,
        "wim-ghost": this.variant === "ghost",
        "wim-outline": this.variant === "outline"
      };
      let e = "inverse";
      return this.variant === "ghost" && (e = "secondary"), this.variant === "outline" && (e = "accent"), dt`<button class="${yd(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<wim-text variant="small-regular" color="${e}"><slot></slot></wim-text>${this.iconRight}</button>`
    }
  };
  rf.styles = [Dr.globalCss, xMe], Nm([vr({
    type: Boolean
  })], rf.prototype, "disabled", 2), Nm([vr()], rf.prototype, "iconLeft", 2), Nm([vr()], rf.prototype, "iconRight", 2), Nm([vr()], rf.prototype, "onClick", 2), Nm([vr()], rf.prototype, "variant", 2), rf = Nm([Ur("wim-button")], rf);
  const AMe = Zr`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wim-button-border-radius);color:var(--wim-accent-fill-color);background-color:var(--wim-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--wim-color-overlay)}button:active::after{background-color:var(--wim-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wim-color-bg-3);color:var(--wim-color-fg-3)}.wim-secondary{color:var(--wim-accent-color);background-color:transparent}.wim-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wim-color-overlay)}}`;
  var SMe = Object.defineProperty,
    IMe = Object.getOwnPropertyDescriptor,
    rT = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? IMe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && SMe(e, r, i), i
    };
  let c3 = class extends Ir {
    constructor() {
      super(...arguments), this.disabled = !1, this.variant = "primary"
    }
    render() {
      const t = {
        "wim-secondary": this.variant === "secondary"
      };
      return dt`<button ?disabled="${this.disabled}" class="${yd(t)}"><slot></slot></button>`
    }
  };
  c3.styles = [Dr.globalCss, AMe], rT([vr({
    type: Boolean
  })], c3.prototype, "disabled", 2), rT([vr()], c3.prototype, "variant", 2), c3 = rT([Ur("wim-button-big")], c3);
  const TMe = Zr`:host{background-color:var(--wim-color-bg-2);border-top:1px solid var(--wim-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;
  var kMe = Object.defineProperty,
    RMe = Object.getOwnPropertyDescriptor,
    NMe = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? RMe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && kMe(e, r, i), i
    };
  let nT = class extends Ir {
    render() {
      return dt`<div><slot></slot></div>`
    }
  };
  nT.styles = [Dr.globalCss, TMe], nT = NMe([Ur("wim-info-footer")], nT);
  const en = {
      CROSS_ICON: Yn`<svg width="12" height="12" viewBox="0 0 12 12"><path d="M9.94 11A.75.75 0 1 0 11 9.94L7.414 6.353a.5.5 0 0 1 0-.708L11 2.061A.75.75 0 1 0 9.94 1L6.353 4.586a.5.5 0 0 1-.708 0L2.061 1A.75.75 0 0 0 1 2.06l3.586 3.586a.5.5 0 0 1 0 .708L1 9.939A.75.75 0 1 0 2.06 11l3.586-3.586a.5.5 0 0 1 .708 0L9.939 11Z" fill="#fff"/></svg>`,
      WALLET_CONNECT_LOGO: Yn`<svg width="178" height="29" viewBox="0 0 178 29" id="wim-wc-logo"><path d="M10.683 7.926c5.284-5.17 13.85-5.17 19.134 0l.636.623a.652.652 0 0 1 0 .936l-2.176 2.129a.343.343 0 0 1-.478 0l-.875-.857c-3.686-3.607-9.662-3.607-13.348 0l-.937.918a.343.343 0 0 1-.479 0l-2.175-2.13a.652.652 0 0 1 0-.936l.698-.683Zm23.633 4.403 1.935 1.895a.652.652 0 0 1 0 .936l-8.73 8.543a.687.687 0 0 1-.956 0L20.37 17.64a.172.172 0 0 0-.239 0l-6.195 6.063a.687.687 0 0 1-.957 0l-8.73-8.543a.652.652 0 0 1 0-.936l1.936-1.895a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .239 0l6.195-6.064a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .24 0l6.195-6.064a.687.687 0 0 1 .956 0ZM48.093 20.948l2.338-9.355c.139-.515.258-1.07.416-1.942.12.872.258 1.427.357 1.942l2.022 9.355h4.181l3.528-13.874h-3.21l-1.943 8.523a24.825 24.825 0 0 0-.456 2.457c-.158-.931-.317-1.625-.495-2.438l-1.883-8.542h-4.201l-2.042 8.542a41.204 41.204 0 0 0-.475 2.438 41.208 41.208 0 0 0-.476-2.438l-1.903-8.542h-3.349l3.508 13.874h4.083ZM63.33 21.304c1.585 0 2.596-.654 3.11-1.605-.059.297-.078.595-.078.892v.357h2.655V15.22c0-2.735-1.248-4.32-4.3-4.32-2.636 0-4.36 1.466-4.52 3.487h2.914c.1-.891.734-1.426 1.705-1.426.911 0 1.407.515 1.407 1.11 0 .435-.258.693-1.03.792l-1.388.159c-2.061.257-3.825 1.01-3.825 3.19 0 1.982 1.645 3.092 3.35 3.092Zm.891-2.041c-.773 0-1.348-.436-1.348-1.19 0-.733.655-1.09 1.645-1.268l.674-.119c.575-.118.892-.218 1.09-.396v.912c0 1.228-.892 2.06-2.06 2.06ZM70.398 7.074v13.874h2.874V7.074h-2.874ZM74.934 7.074v13.874h2.874V7.074h-2.874ZM84.08 21.304c2.735 0 4.5-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922H81.92ZM94.92 21.146c.633 0 1.248-.1 1.525-.179v-2.18c-.218.04-.475.06-.693.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.338v-2.24h-2.338V7.788H91.47v3.448H89.37v2.24h2.1v4.201c0 2.3 1.15 3.469 3.45 3.469ZM104.62 21.304c3.924 0 6.302-2.299 6.599-5.608h-3.111c-.238 1.803-1.506 3.032-3.369 3.032-2.2 0-3.746-1.784-3.746-4.796 0-2.953 1.605-4.638 3.805-4.638 1.883 0 2.953 1.15 3.171 2.834h3.191c-.317-3.448-2.854-5.41-6.342-5.41-3.984 0-7.036 2.695-7.036 7.214 0 4.677 2.676 7.372 6.838 7.372ZM117.449 21.304c2.993 0 5.114-1.882 5.114-5.172 0-3.23-2.121-5.233-5.114-5.233-2.972 0-5.093 2.002-5.093 5.233 0 3.29 2.101 5.172 5.093 5.172Zm0-2.22c-1.327 0-2.18-1.09-2.18-2.952 0-1.903.892-2.973 2.18-2.973 1.308 0 2.2 1.07 2.2 2.973 0 1.862-.872 2.953-2.2 2.953ZM126.569 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.229-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM137.464 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.228-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM149.949 21.304c2.735 0 4.499-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922h-3.984ZM160.876 21.304c3.013 0 4.658-1.645 4.975-4.201h-2.874c-.099 1.07-.713 1.982-2.001 1.982-1.309 0-2.2-1.21-2.2-2.993 0-1.942 1.03-2.933 2.259-2.933 1.209 0 1.803.872 1.883 1.882h2.873c-.218-2.358-1.823-4.142-4.776-4.142-2.874 0-5.153 1.903-5.153 5.193 0 3.25 1.923 5.212 5.014 5.212ZM172.067 21.146c.634 0 1.248-.1 1.526-.179v-2.18c-.218.04-.476.06-.694.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.339v-2.24h-2.339V7.788h-2.854v3.448h-2.1v2.24h2.1v4.201c0 2.3 1.15 3.469 3.449 3.469Z" fill="#fff"/></svg>`,
      WALLET_CONNECT_ICON: Yn`<svg width="28" height="20" viewBox="0 0 28 20"><g clip-path="url(#a)"><path d="M7.386 6.482c3.653-3.576 9.575-3.576 13.228 0l.44.43a.451.451 0 0 1 0 .648L19.55 9.033a.237.237 0 0 1-.33 0l-.606-.592c-2.548-2.496-6.68-2.496-9.228 0l-.648.634a.237.237 0 0 1-.33 0L6.902 7.602a.451.451 0 0 1 0-.647l.483-.473Zm16.338 3.046 1.339 1.31a.451.451 0 0 1 0 .648l-6.035 5.909a.475.475 0 0 1-.662 0L14.083 13.2a.119.119 0 0 0-.166 0l-4.283 4.194a.475.475 0 0 1-.662 0l-6.035-5.91a.451.451 0 0 1 0-.647l1.338-1.31a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0Z" fill="#000000"/></g><defs><clipPath id="a"><path fill="#ffffff" d="M0 0h28v20H0z"/></clipPath></defs></svg>`,
      WALLET_CONNECT_ICON_COLORED: Yn`<svg width="96" height="96" fill="none"><path fill="#fff" d="M25.322 33.597c12.525-12.263 32.83-12.263 45.355 0l1.507 1.476a1.547 1.547 0 0 1 0 2.22l-5.156 5.048a.814.814 0 0 1-1.134 0l-2.074-2.03c-8.737-8.555-22.903-8.555-31.64 0l-2.222 2.175a.814.814 0 0 1-1.134 0l-5.156-5.049a1.547 1.547 0 0 1 0-2.22l1.654-1.62Zm56.019 10.44 4.589 4.494a1.547 1.547 0 0 1 0 2.22l-20.693 20.26a1.628 1.628 0 0 1-2.267 0L48.283 56.632a.407.407 0 0 0-.567 0L33.03 71.012a1.628 1.628 0 0 1-2.268 0L10.07 50.75a1.547 1.547 0 0 1 0-2.22l4.59-4.494a1.628 1.628 0 0 1 2.267 0l14.687 14.38c.156.153.41.153.567 0l14.685-14.38a1.628 1.628 0 0 1 2.268 0l14.687 14.38c.156.153.41.153.567 0l14.686-14.38a1.628 1.628 0 0 1 2.268 0Z"/><path stroke="#000" d="M25.672 33.954c12.33-12.072 32.325-12.072 44.655 0l1.508 1.476a1.047 1.047 0 0 1 0 1.506l-5.157 5.048a.314.314 0 0 1-.434 0l-2.074-2.03c-8.932-8.746-23.409-8.746-32.34 0l-2.222 2.174a.314.314 0 0 1-.434 0l-5.157-5.048a1.047 1.047 0 0 1 0-1.506l1.655-1.62Zm55.319 10.44 4.59 4.494a1.047 1.047 0 0 1 0 1.506l-20.694 20.26a1.128 1.128 0 0 1-1.568 0l-14.686-14.38a.907.907 0 0 0-1.267 0L32.68 70.655a1.128 1.128 0 0 1-1.568 0L10.42 50.394a1.047 1.047 0 0 1 0-1.506l4.59-4.493a1.128 1.128 0 0 1 1.567 0l14.687 14.379a.907.907 0 0 0 1.266 0l-.35-.357.35.357 14.686-14.38a1.128 1.128 0 0 1 1.568 0l14.687 14.38a.907.907 0 0 0 1.267 0l14.686-14.38a1.128 1.128 0 0 1 1.568 0Z"/></svg>`,
      BACK_ICON: Yn`<svg width="10" height="18" viewBox="0 0 10 18"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.735.179a.75.75 0 0 1 .087 1.057L2.92 8.192a1.25 1.25 0 0 0 0 1.617l5.902 6.956a.75.75 0 1 1-1.144.97L1.776 10.78a2.75 2.75 0 0 1 0-3.559L7.678.265A.75.75 0 0 1 8.735.18Z" fill="#fff"/></svg>`,
      COPY_ICON: Yn`<svg width="24" height="24" fill="none"><path fill="#fff" fill-rule="evenodd" d="M7.01 7.01c.03-1.545.138-2.5.535-3.28A5 5 0 0 1 9.73 1.545C10.8 1 12.2 1 15 1c2.8 0 4.2 0 5.27.545a5 5 0 0 1 2.185 2.185C23 4.8 23 6.2 23 9c0 2.8 0 4.2-.545 5.27a5 5 0 0 1-2.185 2.185c-.78.397-1.735.505-3.28.534l-.001.01c-.03 1.54-.138 2.493-.534 3.27a5 5 0 0 1-2.185 2.186C13.2 23 11.8 23 9 23c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C1 19.2 1 17.8 1 15c0-2.8 0-4.2.545-5.27A5 5 0 0 1 3.73 7.545C4.508 7.149 5.46 7.04 7 7.01h.01ZM15 15.5c-1.425 0-2.403-.001-3.162-.063-.74-.06-1.139-.172-1.427-.319a3.5 3.5 0 0 1-1.53-1.529c-.146-.288-.257-.686-.318-1.427C8.501 11.403 8.5 10.425 8.5 9c0-1.425.001-2.403.063-3.162.06-.74.172-1.139.318-1.427a3.5 3.5 0 0 1 1.53-1.53c.288-.146.686-.257 1.427-.318.759-.062 1.737-.063 3.162-.063 1.425 0 2.403.001 3.162.063.74.06 1.139.172 1.427.318a3.5 3.5 0 0 1 1.53 1.53c.146.288.257.686.318 1.427.062.759.063 1.737.063 3.162 0 1.425-.001 2.403-.063 3.162-.06.74-.172 1.139-.319 1.427a3.5 3.5 0 0 1-1.529 1.53c-.288.146-.686.257-1.427.318-.759.062-1.737.063-3.162.063ZM7 8.511c-.444.009-.825.025-1.162.052-.74.06-1.139.172-1.427.318a3.5 3.5 0 0 0-1.53 1.53c-.146.288-.257.686-.318 1.427-.062.759-.063 1.737-.063 3.162 0 1.425.001 2.403.063 3.162.06.74.172 1.139.318 1.427a3.5 3.5 0 0 0 1.53 1.53c.288.146.686.257 1.427.318.759.062 1.737.063 3.162.063 1.425 0 2.403-.001 3.162-.063.74-.06 1.139-.172 1.427-.319a3.5 3.5 0 0 0 1.53-1.53c.146-.287.257-.685.318-1.426.027-.337.043-.718.052-1.162H15c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C7 13.2 7 11.8 7 9v-.489Z" clip-rule="evenodd"/></svg>`,
      RETRY_ICON: Yn`<svg width="15" height="16" viewBox="0 0 15 16"><path d="M6.464 2.03A.75.75 0 0 0 5.403.97L2.08 4.293a1 1 0 0 0 0 1.414L5.403 9.03a.75.75 0 0 0 1.06-1.06L4.672 6.177a.25.25 0 0 1 .177-.427h2.085a4 4 0 1 1-3.93 4.746c-.077-.407-.405-.746-.82-.746-.414 0-.755.338-.7.748a5.501 5.501 0 1 0 5.45-6.248H4.848a.25.25 0 0 1-.177-.427L6.464 2.03Z" fill="#fff"/></svg>`,
      DESKTOP_ICON: Yn`<svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 5.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C2.204 1 3.13 1 4.98 1h6.04c1.85 0 2.775 0 3.466.394a3 3 0 0 1 1.12 1.12C16 3.204 16 4.13 16 5.98v1.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C13.796 12 12.87 12 11.02 12H4.98c-1.85 0-2.775 0-3.466-.394a3 3 0 0 1-1.12-1.12C0 9.796 0 8.87 0 7.02V5.98ZM4.98 2.5h6.04c.953 0 1.568.001 2.034.043.446.04.608.108.69.154a1.5 1.5 0 0 1 .559.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033v1.04c0 .952-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.046-.243.114-.69.154-.466.042-1.08.043-2.033.043H4.98c-.952 0-1.568-.001-2.034-.043-.446-.04-.608-.108-.69-.154a1.5 1.5 0 0 1-.559-.56c-.046-.08-.114-.243-.154-.69-.042-.465-.043-1.08-.043-2.033V5.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.046.243-.114.69-.154.465-.042 1.08-.043 2.033-.043Z" fill="#fff"/><path d="M4 14.25a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,
      MOBILE_ICON: Yn`<svg width="16" height="16" viewBox="0 0 16 16"><path d="M6.75 5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 4.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C5.204 0 6.136 0 8 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C13 2.204 13 3.13 13 4.98v6.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C10.796 16 9.864 16 8 16s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C3 13.796 3 12.87 3 11.02V4.98Zm8.5 0v6.04c0 .953-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.046-.08-.114-.243-.154-.69-.042-.466-.043-1.08-.043-2.033V4.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.045.243-.113.693-.154C6.42 1.501 7.041 1.5 8 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033Z" fill="#fff"/></svg>`,
      ARROW_DOWN_ICON: Yn`<svg width="14" height="14" viewBox="0 0 14 14"><path d="M2.28 7.47a.75.75 0 0 0-1.06 1.06l5.25 5.25a.75.75 0 0 0 1.06 0l5.25-5.25a.75.75 0 0 0-1.06-1.06l-3.544 3.543a.25.25 0 0 1-.426-.177V.75a.75.75 0 0 0-1.5 0v10.086a.25.25 0 0 1-.427.176L2.28 7.47Z" fill="#fff"/></svg>`,
      ARROW_UP_RIGHT_ICON: Yn`<svg width="15" height="14" fill="none"><path d="M4.5 1.75A.75.75 0 0 1 5.25 1H12a1.5 1.5 0 0 1 1.5 1.5v6.75a.75.75 0 0 1-1.5 0V4.164a.25.25 0 0 0-.427-.176L4.061 11.5A.75.75 0 0 1 3 10.44l7.513-7.513a.25.25 0 0 0-.177-.427H5.25a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,
      ARROW_RIGHT_ICON: Yn`<svg width="6" height="14" viewBox="0 0 6 14"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.181 1.099a.75.75 0 0 1 1.024.279l2.433 4.258a2.75 2.75 0 0 1 0 2.729l-2.433 4.257a.75.75 0 1 1-1.303-.744L4.335 7.62a1.25 1.25 0 0 0 0-1.24L1.902 2.122a.75.75 0 0 1 .28-1.023Z" fill="#fff"/></svg>`,
      QRCODE_ICON: Yn`<svg width="25" height="24" viewBox="0 0 25 24"><path d="M23.748 9a.748.748 0 0 0 .748-.752c-.018-2.596-.128-4.07-.784-5.22a6 6 0 0 0-2.24-2.24c-1.15-.656-2.624-.766-5.22-.784a.748.748 0 0 0-.752.748c0 .414.335.749.748.752 1.015.007 1.82.028 2.494.088.995.09 1.561.256 1.988.5.7.398 1.28.978 1.679 1.678.243.427.41.993.498 1.988.061.675.082 1.479.09 2.493a.753.753 0 0 0 .75.749ZM3.527.788C4.677.132 6.152.022 8.747.004A.748.748 0 0 1 9.5.752a.753.753 0 0 1-.749.752c-1.014.007-1.818.028-2.493.088-.995.09-1.561.256-1.988.5-.7.398-1.28.978-1.679 1.678-.243.427-.41.993-.499 1.988-.06.675-.081 1.479-.088 2.493A.753.753 0 0 1 1.252 9a.748.748 0 0 1-.748-.752c.018-2.596.128-4.07.784-5.22a6 6 0 0 1 2.24-2.24ZM1.252 15a.748.748 0 0 0-.748.752c.018 2.596.128 4.07.784 5.22a6 6 0 0 0 2.24 2.24c1.15.656 2.624.766 5.22.784a.748.748 0 0 0 .752-.748.753.753 0 0 0-.749-.752c-1.014-.007-1.818-.028-2.493-.089-.995-.089-1.561-.255-1.988-.498a4.5 4.5 0 0 1-1.679-1.68c-.243-.426-.41-.992-.499-1.987-.06-.675-.081-1.479-.088-2.493A.753.753 0 0 0 1.252 15ZM22.996 15.749a.753.753 0 0 1 .752-.749c.415 0 .751.338.748.752-.018 2.596-.128 4.07-.784 5.22a6 6 0 0 1-2.24 2.24c-1.15.656-2.624.766-5.22.784a.748.748 0 0 1-.752-.748c0-.414.335-.749.748-.752 1.015-.007 1.82-.028 2.494-.089.995-.089 1.561-.255 1.988-.498a4.5 4.5 0 0 0 1.679-1.68c.243-.426.41-.992.498-1.987.061-.675.082-1.479.09-2.493Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7 4a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 11h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 4H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1ZM13.5 6.5A2.5 2.5 0 0 1 16 4h2a2.5 2.5 0 0 1 2.5 2.5v2A2.5 2.5 0 0 1 18 11h-2a2.5 2.5 0 0 1-2.5-2.5v-2Zm2.5-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1ZM7 13a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 20h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 13H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1Z" fill="#fff"/><path d="M13.5 15.5c0-.465 0-.697.038-.89a2 2 0 0 1 1.572-1.572C15.303 13 15.535 13 16 13v2.5h-2.5ZM18 13c.465 0 .697 0 .89.038a2 2 0 0 1 1.572 1.572c.038.193.038.425.038.89H18V13ZM18 17.5h2.5c0 .465 0 .697-.038.89a2 2 0 0 1-1.572 1.572C18.697 20 18.465 20 18 20v-2.5ZM13.5 17.5H16V20c-.465 0-.697 0-.89-.038a2 2 0 0 1-1.572-1.572c-.038-.193-.038-.425-.038-.89Z" fill="#fff"/></svg>`,
      SCAN_ICON: Yn`<svg width="16" height="16" fill="none"><path fill="#fff" d="M10 15.216c0 .422.347.763.768.74 1.202-.064 2.025-.222 2.71-.613a5.001 5.001 0 0 0 1.865-1.866c.39-.684.549-1.507.613-2.709a.735.735 0 0 0-.74-.768.768.768 0 0 0-.76.732c-.009.157-.02.306-.032.447-.073.812-.206 1.244-.384 1.555-.31.545-.761.996-1.306 1.306-.311.178-.743.311-1.555.384-.141.013-.29.023-.447.032a.768.768 0 0 0-.732.76ZM10 .784c0 .407.325.737.732.76.157.009.306.02.447.032.812.073 1.244.206 1.555.384a3.5 3.5 0 0 1 1.306 1.306c.178.311.311.743.384 1.555.013.142.023.29.032.447a.768.768 0 0 0 .76.732.734.734 0 0 0 .74-.768c-.064-1.202-.222-2.025-.613-2.71A5 5 0 0 0 13.477.658c-.684-.39-1.507-.549-2.709-.613a.735.735 0 0 0-.768.74ZM5.232.044A.735.735 0 0 1 6 .784a.768.768 0 0 1-.732.76c-.157.009-.305.02-.447.032-.812.073-1.244.206-1.555.384A3.5 3.5 0 0 0 1.96 3.266c-.178.311-.311.743-.384 1.555-.013.142-.023.29-.032.447A.768.768 0 0 1 .784 6a.735.735 0 0 1-.74-.768c.064-1.202.222-2.025.613-2.71A5 5 0 0 1 2.523.658C3.207.267 4.03.108 5.233.044ZM5.268 14.456a.768.768 0 0 1 .732.76.734.734 0 0 1-.768.74c-1.202-.064-2.025-.222-2.71-.613a5 5 0 0 1-1.865-1.866c-.39-.684-.549-1.507-.613-2.709A.735.735 0 0 1 .784 10c.407 0 .737.325.76.732.009.157.02.306.032.447.073.812.206 1.244.384 1.555a3.5 3.5 0 0 0 1.306 1.306c.311.178.743.311 1.555.384.142.013.29.023.447.032Z"/></svg>`,
      CHECKMARK_ICON: Yn`<svg width="13" height="12" viewBox="0 0 13 12"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.155.132a.75.75 0 0 1 .232 1.035L5.821 11.535a1 1 0 0 1-1.626.09L.665 7.21a.75.75 0 1 1 1.17-.937L4.71 9.867a.25.25 0 0 0 .406-.023L11.12.364a.75.75 0 0 1 1.035-.232Z" fill="#fff"/></svg>`,
      SEARCH_ICON: Yn`<svg width="20" height="21"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.432 13.992c-.354-.353-.91-.382-1.35-.146a5.5 5.5 0 1 1 2.265-2.265c-.237.441-.208.997.145 1.35l3.296 3.296a.75.75 0 1 1-1.06 1.061l-3.296-3.296Zm.06-5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z" fill="#949E9E"/></svg>`,
      WALLET_PLACEHOLDER: Yn`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#q)"><path id="wallet-placeholder-fill" fill="#fff" d="M0 24.9c0-9.251 0-13.877 1.97-17.332a15 15 0 0 1 5.598-5.597C11.023 0 15.648 0 24.9 0h10.2c9.252 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.023 60 15.648 60 24.9v10.2c0 9.252 0 13.877-1.97 17.332a15.001 15.001 0 0 1-5.598 5.597C48.977 60 44.352 60 35.1 60H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.352 0 35.1V24.9Z"/><path id="wallet-placeholder-dash" stroke="#000" stroke-dasharray="4 4" stroke-width="1.5" d="M.04 41.708a231.598 231.598 0 0 1-.039-4.403l.75-.001L.75 35.1v-2.55H0v-5.1h.75V24.9l.001-2.204h-.75c.003-1.617.011-3.077.039-4.404l.75.016c.034-1.65.099-3.08.218-4.343l-.746-.07c.158-1.678.412-3.083.82-4.316l.713.236c.224-.679.497-1.296.827-1.875a14.25 14.25 0 0 1 1.05-1.585L3.076 5.9A15 15 0 0 1 5.9 3.076l.455.596a14.25 14.25 0 0 1 1.585-1.05c.579-.33 1.196-.603 1.875-.827l-.236-.712C10.812.674 12.217.42 13.895.262l.07.746C15.23.89 16.66.824 18.308.79l-.016-.75C19.62.012 21.08.004 22.695.001l.001.75L24.9.75h2.55V0h5.1v.75h2.55l2.204.001v-.75c1.617.003 3.077.011 4.404.039l-.016.75c1.65.034 3.08.099 4.343.218l.07-.746c1.678.158 3.083.412 4.316.82l-.236.713c.679.224 1.296.497 1.875.827a14.24 14.24 0 0 1 1.585 1.05l.455-.596A14.999 14.999 0 0 1 56.924 5.9l-.596.455c.384.502.735 1.032 1.05 1.585.33.579.602 1.196.827 1.875l.712-.236c.409 1.233.663 2.638.822 4.316l-.747.07c.119 1.264.184 2.694.218 4.343l.75-.016c.028 1.327.036 2.787.039 4.403l-.75.001.001 2.204v2.55H60v5.1h-.75v2.55l-.001 2.204h.75a231.431 231.431 0 0 1-.039 4.404l-.75-.016c-.034 1.65-.099 3.08-.218 4.343l.747.07c-.159 1.678-.413 3.083-.822 4.316l-.712-.236a10.255 10.255 0 0 1-.827 1.875 14.242 14.242 0 0 1-1.05 1.585l.596.455a14.997 14.997 0 0 1-2.824 2.824l-.455-.596c-.502.384-1.032.735-1.585 1.05-.579.33-1.196.602-1.875.827l.236.712c-1.233.409-2.638.663-4.316.822l-.07-.747c-1.264.119-2.694.184-4.343.218l.016.75c-1.327.028-2.787.036-4.403.039l-.001-.75-2.204.001h-2.55V60h-5.1v-.75H24.9l-2.204-.001v.75a231.431 231.431 0 0 1-4.404-.039l.016-.75c-1.65-.034-3.08-.099-4.343-.218l-.07.747c-1.678-.159-3.083-.413-4.316-.822l.236-.712a10.258 10.258 0 0 1-1.875-.827 14.252 14.252 0 0 1-1.585-1.05l-.455.596A14.999 14.999 0 0 1 3.076 54.1l.596-.455a14.24 14.24 0 0 1-1.05-1.585 10.259 10.259 0 0 1-.827-1.875l-.712.236C.674 49.188.42 47.783.262 46.105l.746-.07C.89 44.77.824 43.34.79 41.692l-.75.016Z"/><path fill="#fff" fill-rule="evenodd" d="M35.643 32.145c-.297-.743-.445-1.114-.401-1.275a.42.42 0 0 1 .182-.27c.134-.1.463-.1 1.123-.1.742 0 1.499.046 2.236-.05a6 6 0 0 0 5.166-5.166c.051-.39.051-.855.051-1.784 0-.928 0-1.393-.051-1.783a6 6 0 0 0-5.166-5.165c-.39-.052-.854-.052-1.783-.052h-7.72c-4.934 0-7.401 0-9.244 1.051a8 8 0 0 0-2.985 2.986C16.057 22.28 16.003 24.58 16 29 15.998 31.075 16 33.15 16 35.224A7.778 7.778 0 0 0 23.778 43H28.5c1.394 0 2.09 0 2.67-.116a6 6 0 0 0 4.715-4.714c.115-.58.115-1.301.115-2.744 0-1.31 0-1.964-.114-2.49a4.998 4.998 0 0 0-.243-.792Z" clip-rule="evenodd"/><path fill="#9EA9A9" fill-rule="evenodd" d="M37 18h-7.72c-2.494 0-4.266.002-5.647.126-1.361.122-2.197.354-2.854.728a6.5 6.5 0 0 0-2.425 2.426c-.375.657-.607 1.492-.729 2.853-.11 1.233-.123 2.777-.125 4.867 0 .7 0 1.05.097 1.181.096.13.182.181.343.2.163.02.518-.18 1.229-.581a6.195 6.195 0 0 1 3.053-.8H37c.977 0 1.32-.003 1.587-.038a4.5 4.5 0 0 0 3.874-3.874c.036-.268.039-.611.039-1.588 0-.976-.003-1.319-.038-1.587a4.5 4.5 0 0 0-3.875-3.874C38.32 18.004 37.977 18 37 18Zm-7.364 12.5h-7.414a4.722 4.722 0 0 0-4.722 4.723 6.278 6.278 0 0 0 6.278 6.278H28.5c1.466 0 1.98-.008 2.378-.087a4.5 4.5 0 0 0 3.535-3.536c.08-.397.087-.933.087-2.451 0-1.391-.009-1.843-.08-2.17a3.5 3.5 0 0 0-2.676-2.676c-.328-.072-.762-.08-2.108-.08Z" clip-rule="evenodd"/></g><defs><clipPath id="q"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,
      GLOBE_ICON: Yn`<svg width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="#fff" fill-rule="evenodd" d="M15.5 8a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Zm-2.113.75c.301 0 .535.264.47.558a6.01 6.01 0 0 1-2.867 3.896c-.203.116-.42-.103-.334-.32.409-1.018.691-2.274.797-3.657a.512.512 0 0 1 .507-.477h1.427Zm.47-2.058c.065.294-.169.558-.47.558H11.96a.512.512 0 0 1-.507-.477c-.106-1.383-.389-2.638-.797-3.656-.087-.217.13-.437.333-.32a6.01 6.01 0 0 1 2.868 3.895Zm-4.402.558c.286 0 .515-.24.49-.525-.121-1.361-.429-2.534-.83-3.393-.279-.6-.549-.93-.753-1.112a.535.535 0 0 0-.724 0c-.204.182-.474.513-.754 1.112-.4.859-.708 2.032-.828 3.393a.486.486 0 0 0 .49.525h2.909Zm-5.415 0c.267 0 .486-.21.507-.477.106-1.383.389-2.638.797-3.656.087-.217-.13-.437-.333-.32a6.01 6.01 0 0 0-2.868 3.895c-.065.294.169.558.47.558H4.04ZM2.143 9.308c-.065-.294.169-.558.47-.558H4.04c.267 0 .486.21.507.477.106 1.383.389 2.639.797 3.657.087.217-.13.436-.333.32a6.01 6.01 0 0 1-2.868-3.896Zm3.913-.033a.486.486 0 0 1 .49-.525h2.909c.286 0 .515.24.49.525-.121 1.361-.428 2.535-.83 3.394-.279.6-.549.93-.753 1.112a.535.535 0 0 1-.724 0c-.204-.182-.474-.513-.754-1.112-.4-.859-.708-2.033-.828-3.394Z" clip-rule="evenodd"/></svg>`
    },
    MMe = Zr`.wim-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--wim-background-border-radius) * .9);background-color:var(--wim-background-color);background-position:center;background-size:cover}.wim-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wim-toolbar img,.wim-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wim-wc-logo path{fill:var(--wim-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wim-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wim-color-bg-1);box-shadow:0 0 0 1px var(--wim-color-overlay)}button:active{background-color:var(--wim-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wim-color-fg-1)}.wim-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wim-color-bg-2)}}`;
  var PMe = Object.defineProperty,
    $Me = Object.getOwnPropertyDescriptor,
    OMe = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? $Me(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && PMe(e, r, i), i
    };
  let iT = class extends Ir {
    render() {
      return dt`<div class="wim-toolbar-placeholder"></div><div class="wim-toolbar">${en.WALLET_CONNECT_LOGO} <button @click="${bp.close}">${en.CROSS_ICON}</button></div>`
    }
  };
  iT.styles = [Dr.globalCss, MMe], iT = OMe([Ur("wim-modal-backcard")], iT);
  const DMe = Zr`main{padding:20px;padding-top:0;width:100%}`;
  var LMe = Object.defineProperty,
    BMe = Object.getOwnPropertyDescriptor,
    UMe = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? BMe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && LMe(e, r, i), i
    };
  let sT = class extends Ir {
    render() {
      return dt`<main><slot></slot></main>`
    }
  };
  sT.styles = [Dr.globalCss, DMe], sT = UMe([Ur("wim-modal-content")], sT);
  const jMe = Zr`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wim-color-bg-2)}`;
  var FMe = Object.defineProperty,
    WMe = Object.getOwnPropertyDescriptor,
    zMe = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? WMe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && FMe(e, r, i), i
    };
  let oT = class extends Ir {
    render() {
      return dt`<footer><slot></slot></footer>`
    }
  };
  oT.styles = [Dr.globalCss, jMe], oT = zMe([Ur("wim-modal-footer")], oT);
  const HMe = Zr`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wim-border{border-bottom:1px solid var(--wim-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wim-back-btn{position:absolute;left:0}.wim-action-btn{position:absolute;right:0}path{fill:var(--wim-accent-color)}`;
  var qMe = Object.defineProperty,
    VMe = Object.getOwnPropertyDescriptor,
    l3 = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? VMe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && qMe(e, r, i), i
    };
  let Sp = class extends Ir {
    constructor() {
      super(...arguments), this.title = "", this.onAction = void 0, this.actionIcon = void 0, this.border = !1
    }
    backBtnTemplate() {
      return dt`<button class="wim-back-btn" @click="${zn.goBack}">${en.BACK_ICON}</button>`
    }
    actionBtnTemplate() {
      return dt`<button class="wim-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`
    }
    render() {
      const t = {
          "wim-border": this.border
        },
        e = zn.state.history.length > 1,
        r = this.title ? dt`<wim-text variant="big-bold">${this.title}</wim-text>` : dt`<slot></slot>`;
      return dt`<header class="${yd(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`
    }
  };
  Sp.styles = [Dr.globalCss, HMe], l3([vr()], Sp.prototype, "title", 2), l3([vr()], Sp.prototype, "onAction", 2), l3([vr()], Sp.prototype, "actionIcon", 2), l3([vr({
    type: Boolean
  })], Sp.prototype, "border", 2), Sp = l3([Ur("wim-modal-header")], Sp);
  const ar = {
      MOBILE_BREAKPOINT: 600,
      WCM_RECENT_WALLET_DATA: "WCM_RECENT_WALLET_DATA",
      EXPLORER_WALLET_URL: "https://explorer.walletconnect.com/?type=wallet",
      getShadowRootElement(t, e) {
        const r = t.renderRoot.querySelector(e);
        if (!r) throw new Error(`${e} not found`);
        return r
      },
      getWalletIcon({
        id: t,
        image_id: e
      }) {
        const {
          walletImages: r
        } = Qo.state;
        return r?.[t] ? r[t] : e ? Co.getWalletImageUrl(e) : ""
      },
      getWalletName(t, e = !1) {
        return e && t.length > 8 ? `${t.substring(0,8)}..` : t
      },
      isMobileAnimation() {
        return window.innerWidth <= ar.MOBILE_BREAKPOINT
      },
      async preloadImage(t) {
        const e = new Promise((r, n) => {
          const i = new Image;
          i.onload = r, i.onerror = n, i.crossOrigin = "anonymous", i.src = t
        });
        return Promise.race([e, Dt.wait(3e3)])
      },
      getErrorMessage(t) {
        return t instanceof Error ? t.message : "Unknown Error"
      },
      debounce(t, e = 500) {
        let r;
        return (...n) => {
          function i() {
            t(...n)
          }
          r && clearTimeout(r), r = setTimeout(i, e)
        }
      },
      handleMobileLinking(t, e = "_self") {
        const {
          walletConnectUri: r
        } = li.state, {
          mobile: n,
          name: i
        } = t, s = n?.native, o = n?.universal;
        ar.setRecentWallet(t);

        function a(c) {
          if (s) {
            const l = Dt.formatNativeUrl(s, c, i);
            Dt.openHref(l, e)
          } else if (o) {
            const l = Dt.formatUniversalUrl(o, c, i);
            Dt.openHref(l, e)
          }
        }
        r && a(r)
      },
      handleAndroidLinking() {
        const {
          walletConnectUri: t
        } = li.state;
        t && (Dt.setWalletConnectAndroidDeepLink(t), Dt.openHref(t, Dt.isTelegram() ? "_blank" : "_self"))
      },
      async handleUriCopy() {
        const {
          walletConnectUri: t
        } = li.state;
        if (t) try {
          await navigator.clipboard.writeText(t), Xh.openToast("Link copied", "success")
        } catch {
          Xh.openToast("Failed to copy", "error")
        }
      },
      getCustomImageUrls() {
        const {
          walletImages: t
        } = Qo.state, e = Object.values(t ?? {});
        return Object.values(e)
      },
      truncate(t, e = 8) {
        return t.length <= e ? t : `${t.substring(0,4)}...${t.substring(t.length-4)}`
      },
      setRecentWallet(t) {
        try {
          localStorage.setItem(ar.WCM_RECENT_WALLET_DATA, JSON.stringify(t))
        } catch {
          console.info("Unable to set recent wallet")
        }
      },
      getRecentWallet() {
        try {
          const t = localStorage.getItem(ar.WCM_RECENT_WALLET_DATA);
          return t ? JSON.parse(t) : void 0
        } catch {
          console.info("Unable to get recent wallet")
        }
      },
      caseSafeIncludes(t, e) {
        return t.toUpperCase().includes(e.toUpperCase())
      },
      openWalletExplorerUrl() {
        Dt.openHref(ar.EXPLORER_WALLET_URL, "_blank")
      },
      getCachedRouterWalletPlatforms() {
        const {
          desktop: t,
          mobile: e
        } = Dt.getWalletRouterData(), r = !!t?.native, n = !!t?.universal, i = !!e?.native || !!e?.universal;
        return {
          isDesktop: r,
          isMobile: i,
          isWeb: n
        }
      },
      goToConnectingView(t) {
        zn.setData({
          Wallet: t
        });
        const e = Dt.isMobile(),
          {
            isDesktop: r,
            isWeb: n,
            isMobile: i
          } = ar.getCachedRouterWalletPlatforms();
        e ? i ? (zn.push("MobileConnecting"), !Dt.isAndroid() && Dt.isTelegram() && this.handleMobileLinking(t, "_blank")) : n ? zn.push("WebConnecting") : zn.push("InstallWallet") : r ? zn.push("DesktopConnecting") : n ? zn.push("WebConnecting") : i ? zn.push("MobileQrcodeConnecting") : zn.push("InstallWallet")
      }
    },
    KMe = Zr`.wim-router{overflow:hidden;will-change:transform}.wim-content{display:flex;flex-direction:column}`;
  var GMe = Object.defineProperty,
    ZMe = Object.getOwnPropertyDescriptor,
    aT = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? ZMe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && GMe(e, r, i), i
    };
  let u3 = class extends Ir {
    constructor() {
      super(), this.view = zn.state.view, this.prevView = zn.state.view, this.unsubscribe = void 0, this.oldHeight = "0px", this.resizeObserver = void 0, this.unsubscribe = zn.subscribe(t => {
        this.view !== t.view && this.onChangeRoute()
      })
    }
    firstUpdated() {
      this.resizeObserver = new ResizeObserver(([t]) => {
        const e = `${t.contentRect.height}px`;
        this.oldHeight !== "0px" && Ap(this.routerEl, {
          height: [this.oldHeight, e]
        }, {
          duration: .2
        }), this.oldHeight = e
      }), this.resizeObserver.observe(this.contentEl)
    }
    disconnectedCallback() {
      var t, e;
      (t = this.unsubscribe) == null || t.call(this), (e = this.resizeObserver) == null || e.disconnect()
    }
    get routerEl() {
      return ar.getShadowRootElement(this, ".wim-router")
    }
    get contentEl() {
      return ar.getShadowRootElement(this, ".wim-content")
    }
    viewTemplate() {
      switch (this.view) {
        case "ConnectWallet":
          return dt`<wim-connect-wallet-view></wim-connect-wallet-view>`;
        case "DesktopConnecting":
          return dt`<wim-desktop-connecting-view></wim-desktop-connecting-view>`;
        case "MobileConnecting":
          return dt`<wim-mobile-connecting-view></wim-mobile-connecting-view>`;
        case "WebConnecting":
          return dt`<wim-web-connecting-view></wim-web-connecting-view>`;
        case "MobileQrcodeConnecting":
          return dt`<wim-mobile-qr-connecting-view></wim-mobile-qr-connecting-view>`;
        case "WalletExplorer":
          return dt`<wim-wallet-explorer-view></wim-wallet-explorer-view>`;
        case "Qrcode":
          return dt`<wim-qrcode-view></wim-qrcode-view>`;
        case "InstallWallet":
          return dt`<wim-install-wallet-view></wim-install-wallet-view>`;
        default:
          return dt`<div>Not Found</div>`
      }
    }
    async onChangeRoute() {
      await Ap(this.routerEl, {
        opacity: [1, 0],
        scale: [1, 1.02]
      }, {
        duration: .15,
        delay: .1
      }).finished, this.view = zn.state.view, Ap(this.routerEl, {
        opacity: [0, 1],
        scale: [.99, 1]
      }, {
        duration: .37,
        delay: .05
      })
    }
    render() {
      return dt`<div class="wim-router"><div class="wim-content">${this.viewTemplate()}</div></div>`
    }
  };
  u3.styles = [Dr.globalCss, KMe], aT([Eo()], u3.prototype, "view", 2), aT([Eo()], u3.prototype, "prevView", 2), u3 = aT([Ur("wim-modal-router")], u3);
  const YMe = Zr`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--wim-notification-border-radius);border:1px solid var(--wim-color-overlay);background-color:var(--wim-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wim-color-bg-3)}}.wim-success path{fill:var(--wim-accent-color)}.wim-error path{fill:var(--wim-error-color)}`;
  var QMe = Object.defineProperty,
    JMe = Object.getOwnPropertyDescriptor,
    LK = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? JMe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && QMe(e, r, i), i
    };
  let s_ = class extends Ir {
    constructor() {
      super(), this.open = !1, this.unsubscribe = void 0, this.timeout = void 0, this.unsubscribe = Xh.subscribe(t => {
        t.open ? (this.open = !0, this.timeout = setTimeout(() => Xh.closeToast(), 2200)) : (this.open = !1, clearTimeout(this.timeout))
      })
    }
    disconnectedCallback() {
      var t;
      (t = this.unsubscribe) == null || t.call(this), clearTimeout(this.timeout), Xh.closeToast()
    }
    render() {
      const {
        message: t,
        variant: e
      } = Xh.state, r = {
        "wim-success": e === "success",
        "wim-error": e === "error"
      };
      return this.open ? dt`<div class="${yd(r)}">${e==="success"?en.CHECKMARK_ICON:null} ${e==="error"?en.CROSS_ICON:null}<wim-text variant="small-regular">${t}</wim-text></div>` : null
    }
  };
  s_.styles = [Dr.globalCss, YMe], LK([Eo()], s_.prototype, "open", 2), s_ = LK([Ur("wim-modal-toast")], s_);
  const XMe = .1,
    BK = 2.5,
    _d = 7;

  function cT(t, e, r) {
    return t === e ? !1 : (t - e < 0 ? e - t : t - e) <= r + XMe
  }

  function ePe(t, e) {
    const r = Array.prototype.slice.call(O1.create(t, {
        errorCorrectionLevel: e
      }).modules.data, 0),
      n = Math.sqrt(r.length);
    return r.reduce((i, s, o) => (o % n === 0 ? i.push([s]) : i[i.length - 1].push(s)) && i, [])
  }
  const tPe = {
      generate(t, e, r) {
        const n = "#141414",
          i = "#ffffff",
          s = [],
          o = ePe(t, "Q"),
          a = e / o.length,
          c = [{
            x: 0,
            y: 0
          }, {
            x: 1,
            y: 0
          }, {
            x: 0,
            y: 1
          }];
        c.forEach(({
          x: C,
          y: M
        }) => {
          const N = (o.length - _d) * a * C,
            $ = (o.length - _d) * a * M,
            k = .45;
          for (let B = 0; B < c.length; B += 1) {
            const F = a * (_d - B * 2);
            s.push(Yn`<rect fill="${B%2===0?n:i}" height="${F}" rx="${F*k}" ry="${F*k}" width="${F}" x="${N+a*B}" y="${$+a*B}">`)
          }
        });
        const l = Math.floor((r + 25) / a),
          h = o.length / 2 - l / 2,
          f = o.length / 2 + l / 2 - 1,
          w = [];
        o.forEach((C, M) => {
          C.forEach((N, $) => {
            if (o[M][$] && !(M < _d && $ < _d || M > o.length - (_d + 1) && $ < _d || M < _d && $ > o.length - (_d + 1)) && !(M > h && M < f && $ > h && $ < f)) {
              const k = M * a + a / 2,
                B = $ * a + a / 2;
              w.push([k, B])
            }
          })
        });
        const b = {};
        return w.forEach(([C, M]) => {
          b[C] ? b[C].push(M) : b[C] = [M]
        }), Object.entries(b).map(([C, M]) => {
          const N = M.filter($ => M.every(k => !cT($, k, a)));
          return [Number(C), N]
        }).forEach(([C, M]) => {
          M.forEach(N => {
            s.push(Yn`<circle cx="${C}" cy="${N}" fill="${n}" r="${a/BK}">`)
          })
        }), Object.entries(b).filter(([C, M]) => M.length > 1).map(([C, M]) => {
          const N = M.filter($ => M.some(k => cT($, k, a)));
          return [Number(C), N]
        }).map(([C, M]) => {
          M.sort(($, k) => $ < k ? -1 : 1);
          const N = [];
          for (const $ of M) {
            const k = N.find(B => B.some(F => cT($, F, a)));
            k ? k.push($) : N.push([$])
          }
          return [C, N.map($ => [$[0], $[$.length - 1]])]
        }).forEach(([C, M]) => {
          M.forEach(([N, $]) => {
            s.push(Yn`<line x1="${C}" x2="${C}" y1="${N}" y2="${$}" stroke="${n}" stroke-width="${a/(BK/2)}" stroke-linecap="round">`)
          })
        }), s
      }
    },
    rPe = Zr`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wim-dark{background-color:#fff;border-radius:var(--wim-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wim-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wim-wallet-image{transform:translateY(-50%) translateX(-50%)}wim-wallet-image{width:25%;height:25%;border-radius:var(--wim-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wim-accent-color)}svg:first-child path:last-child{stroke:var(--wim-color-overlay)}`;
  var nPe = Object.defineProperty,
    iPe = Object.getOwnPropertyDescriptor,
    Mm = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? iPe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && nPe(e, r, i), i
    };
  let xd = class extends Ir {
    constructor() {
      super(...arguments), this.uri = "", this.size = 0, this.imageId = void 0, this.walletId = void 0, this.imageUrl = void 0
    }
    svgTemplate() {
      const e = Jh.state.themeMode === "light" ? this.size : this.size - 18 * 2;
      return Yn`<svg height="${e}" width="${e}">${tPe.generate(this.uri,e,e/4)}</svg>`
    }
    render() {
      const t = {
        "wim-dark": Jh.state.themeMode === "dark"
      };
      return dt`<div style="${`width: ${this.size}px`}" class="${yd(t)}">${this.walletId||this.imageUrl?dt`<wim-wallet-image walletId="${qs(this.walletId)}" imageId="${qs(this.imageId)}" imageUrl="${qs(this.imageUrl)}"></wim-wallet-image>`:en.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`
    }
  };
  xd.styles = [Dr.globalCss, rPe], Mm([vr()], xd.prototype, "uri", 2), Mm([vr({
    type: Number
  })], xd.prototype, "size", 2), Mm([vr()], xd.prototype, "imageId", 2), Mm([vr()], xd.prototype, "walletId", 2), Mm([vr()], xd.prototype, "imageUrl", 2), xd = Mm([Ur("wim-qrcode")], xd);
  const sPe = Zr`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wim-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--wim-color-fg-1);background-color:var(--wim-color-bg-3);box-shadow:inset 0 0 0 1px var(--wim-color-overlay);caret-color:var(--wim-accent-color)}input::placeholder{color:var(--wim-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--wim-accent-color)}path{fill:var(--wim-color-fg-2)}`;
  var oPe = Object.defineProperty,
    aPe = Object.getOwnPropertyDescriptor,
    UK = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? aPe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && oPe(e, r, i), i
    };
  let o_ = class extends Ir {
    constructor() {
      super(...arguments), this.onChange = () => null
    }
    render() {
      return dt`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${en.SEARCH_ICON}`
    }
  };
  o_.styles = [Dr.globalCss, sPe], UK([vr()], o_.prototype, "onChange", 2), o_ = UK([Ur("wim-search-input")], o_);
  const cPe = Zr`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--wim-accent-color)}`;
  var lPe = Object.defineProperty,
    uPe = Object.getOwnPropertyDescriptor,
    dPe = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? uPe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && lPe(e, r, i), i
    };
  let lT = class extends Ir {
    render() {
      return dt`<svg viewBox="0 0 50 50" width="24" height="24"><circle cx="25" cy="25" r="20" fill="none" stroke-width="4" stroke="#fff"/></svg>`
    }
  };
  lT.styles = [Dr.globalCss, cPe], lT = dPe([Ur("wim-spinner")], lT);
  const hPe = Zr`span{font-style:normal;font-family:var(--wim-font-family);font-feature-settings:var(--wim-font-feature-settings)}.wim-xsmall-bold{font-family:var(--wim-text-xsmall-bold-font-family);font-weight:var(--wim-text-xsmall-bold-weight);font-size:var(--wim-text-xsmall-bold-size);line-height:var(--wim-text-xsmall-bold-line-height);letter-spacing:var(--wim-text-xsmall-bold-letter-spacing);text-transform:var(--wim-text-xsmall-bold-text-transform)}.wim-xsmall-regular{font-family:var(--wim-text-xsmall-regular-font-family);font-weight:var(--wim-text-xsmall-regular-weight);font-size:var(--wim-text-xsmall-regular-size);line-height:var(--wim-text-xsmall-regular-line-height);letter-spacing:var(--wim-text-xsmall-regular-letter-spacing);text-transform:var(--wim-text-xsmall-regular-text-transform)}.wim-small-thin{font-family:var(--wim-text-small-thin-font-family);font-weight:var(--wim-text-small-thin-weight);font-size:var(--wim-text-small-thin-size);line-height:var(--wim-text-small-thin-line-height);letter-spacing:var(--wim-text-small-thin-letter-spacing);text-transform:var(--wim-text-small-thin-text-transform)}.wim-small-regular{font-family:var(--wim-text-small-regular-font-family);font-weight:var(--wim-text-small-regular-weight);font-size:var(--wim-text-small-regular-size);line-height:var(--wim-text-small-regular-line-height);letter-spacing:var(--wim-text-small-regular-letter-spacing);text-transform:var(--wim-text-small-regular-text-transform)}.wim-medium-regular{font-family:var(--wim-text-medium-regular-font-family);font-weight:var(--wim-text-medium-regular-weight);font-size:var(--wim-text-medium-regular-size);line-height:var(--wim-text-medium-regular-line-height);letter-spacing:var(--wim-text-medium-regular-letter-spacing);text-transform:var(--wim-text-medium-regular-text-transform)}.wim-big-bold{font-family:var(--wim-text-big-bold-font-family);font-weight:var(--wim-text-big-bold-weight);font-size:var(--wim-text-big-bold-size);line-height:var(--wim-text-big-bold-line-height);letter-spacing:var(--wim-text-big-bold-letter-spacing);text-transform:var(--wim-text-big-bold-text-transform)}:host(*){color:var(--wim-color-fg-1)}.wim-color-primary{color:var(--wim-color-fg-1)}.wim-color-secondary{color:var(--wim-color-fg-2)}.wim-color-tertiary{color:var(--wim-color-fg-3)}.wim-color-inverse{color:var(--wim-accent-fill-color)}.wim-color-accnt{color:var(--wim-accent-color)}.wim-color-error{color:var(--wim-error-color)}`;
  var fPe = Object.defineProperty,
    pPe = Object.getOwnPropertyDescriptor,
    uT = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? pPe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && fPe(e, r, i), i
    };
  let d3 = class extends Ir {
    constructor() {
      super(...arguments), this.variant = "medium-regular", this.color = "primary"
    }
    render() {
      const t = {
        "wim-big-bold": this.variant === "big-bold",
        "wim-medium-regular": this.variant === "medium-regular",
        "wim-small-regular": this.variant === "small-regular",
        "wim-small-thin": this.variant === "small-thin",
        "wim-xsmall-regular": this.variant === "xsmall-regular",
        "wim-xsmall-bold": this.variant === "xsmall-bold",
        "wim-color-primary": this.color === "primary",
        "wim-color-secondary": this.color === "secondary",
        "wim-color-tertiary": this.color === "tertiary",
        "wim-color-inverse": this.color === "inverse",
        "wim-color-accnt": this.color === "accent",
        "wim-color-error": this.color === "error"
      };
      return dt`<span><slot class="${yd(t)}"></slot></span>`
    }
  };
  d3.styles = [Dr.globalCss, hPe], uT([vr()], d3.prototype, "variant", 2), uT([vr()], d3.prototype, "color", 2), d3 = uT([Ur("wim-text")], d3);
  const gPe = Zr`button{width:100%;height:100%;border-radius:var(--wim-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wim-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wim-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wim-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wim-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wim-wallet-icon-border-radius);margin-bottom:5px}.wim-sublabel{margin-top:2px}`;
  var mPe = Object.defineProperty,
    wPe = Object.getOwnPropertyDescriptor,
    nf = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? wPe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && mPe(e, r, i), i
    };
  let hu = class extends Ir {
    constructor() {
      super(...arguments), this.onClick = () => null, this.name = "", this.walletId = "", this.label = void 0, this.imageId = void 0, this.installed = !1, this.recent = !1
    }
    sublabelTemplate() {
      return this.recent ? dt`<wim-text class="wim-sublabel" variant="xsmall-bold" color="tertiary">RECENT</wim-text>` : this.installed ? dt`<wim-text class="wim-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</wim-text>` : null
    }
    handleClick() {
      qV.click({
        name: "WALLET_BUTTON",
        walletId: this.walletId
      }), this.onClick()
    }
    render() {
      var t;
      return dt`<button @click="${this.handleClick.bind(this)}"><div><wim-wallet-image walletId="${this.walletId}" imageId="${qs(this.imageId)}"></wim-wallet-image><wim-text variant="xsmall-regular">${(t=this.label)!=null?t:ar.getWalletName(this.name,!0)}</wim-text>${this.sublabelTemplate()}</div></button>`
    }
  };
  hu.styles = [Dr.globalCss, gPe], nf([vr()], hu.prototype, "onClick", 2), nf([vr()], hu.prototype, "name", 2), nf([vr()], hu.prototype, "walletId", 2), nf([vr()], hu.prototype, "label", 2), nf([vr()], hu.prototype, "imageId", 2), nf([vr({
    type: Boolean
  })], hu.prototype, "installed", 2), nf([vr({
    type: Boolean
  })], hu.prototype, "recent", 2), hu = nf([Ur("wim-wallet-button")], hu);
  const vPe = Zr`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wim-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--wim-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wim-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wim-color-overlay)}`;
  var bPe = Object.defineProperty,
    yPe = Object.getOwnPropertyDescriptor,
    a_ = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? yPe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && bPe(e, r, i), i
    };
  let Pm = class extends Ir {
    constructor() {
      super(...arguments), this.walletId = "", this.imageId = void 0, this.imageUrl = void 0
    }
    render() {
      var t;
      const e = (t = this.imageUrl) != null && t.length ? this.imageUrl : ar.getWalletIcon({
        id: this.walletId,
        image_id: this.imageId
      });
      return dt`${e.length?dt`<div><img crossorigin="anonymous" src="${e}" alt="${this.id}"></div>`:en.WALLET_PLACEHOLDER}`
    }
  };
  Pm.styles = [Dr.globalCss, vPe], a_([vr()], Pm.prototype, "walletId", 2), a_([vr()], Pm.prototype, "imageId", 2), a_([vr()], Pm.prototype, "imageUrl", 2), Pm = a_([Ur("wim-wallet-image")], Pm);
  var _Pe = Object.defineProperty,
    xPe = Object.getOwnPropertyDescriptor,
    jK = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? xPe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && _Pe(e, r, i), i
    };
  let dT = class extends Ir {
    constructor() {
      super(), this.preload = !0, this.preloadData()
    }
    async loadImages(t) {
      try {
        t?.length && await Promise.all(t.map(async e => ar.preloadImage(e)))
      } catch {
        console.info("Unsuccessful attempt at preloading some images", t)
      }
    }
    async preloadListings() {
      if (Qo.state.enableExplorer) {
        await Co.getRecomendedWallets(), li.setIsDataLoaded(!0);
        const {
          recomendedWallets: t
        } = Co.state, e = t.map(r => ar.getWalletIcon(r));
        await this.loadImages(e)
      } else li.setIsDataLoaded(!0)
    }
    async preloadCustomImages() {
      const t = ar.getCustomImageUrls();
      await this.loadImages(t)
    }
    async preloadData() {
      try {
        this.preload && (this.preload = !1, await Promise.all([this.preloadListings(), this.preloadCustomImages()]))
      } catch (t) {
        console.error(t), Xh.openToast("Failed preloading", "error")
      }
    }
  };
  jK([Eo()], dT.prototype, "preload", 2), dT = jK([Ur("wim-explorer-context")], dT);
  var CPe = Object.defineProperty,
    EPe = Object.getOwnPropertyDescriptor,
    APe = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? EPe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && CPe(e, r, i), i
    };
  let FK = class extends Ir {
    constructor() {
      super(), this.unsubscribeTheme = void 0, Dr.setTheme(), this.unsubscribeTheme = Jh.subscribe(Dr.setTheme)
    }
    disconnectedCallback() {
      var t;
      (t = this.unsubscribeTheme) == null || t.call(this)
    }
  };
  FK = APe([Ur("wim-theme-context")], FK);
  const SPe = Zr`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wim-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wim-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wim-track svg{margin:0 5px}wim-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wim-wallet-icon-border-radius)}.wim-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wim-title{display:flex;align-items:center;margin-bottom:10px}.wim-title svg{margin-right:6px}.wim-title path{fill:var(--wim-accent-color)}wim-modal-footer .wim-title{padding:0 10px}wim-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wim-color-bg-1))}wim-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wim-info-footer wim-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wim-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wim-color-overlay)}`;
  var IPe = Object.defineProperty,
    TPe = Object.getOwnPropertyDescriptor,
    kPe = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? TPe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && IPe(e, r, i), i
    };
  let hT = class extends Ir {
    onGoToQrcode() {
      zn.push("Qrcode")
    }
    render() {
      const {
        recomendedWallets: t
      } = Co.state, e = [...t, ...t], r = Dt.RECOMMENDED_WALLET_AMOUNT * 2;
      return dt`<wim-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${en.QRCODE_ICON}"></wim-modal-header><wim-modal-content><div class="wim-title">${en.MOBILE_ICON}<wim-text variant="small-regular" color="accent">WalletConnect</wim-text></div><div class="wim-slider"><div class="wim-track">${[...Array(r)].map((n,i)=>{const s=e[i%e.length];return s?dt`<wim-wallet-image walletId="${s.id}" imageId="${s.image_id}"></wim-wallet-image>`:en.WALLET_PLACEHOLDER})}</div><wim-button-big @click="${ar.handleAndroidLinking}"><wim-text variant="medium-regular" color="inverse">Select Wallet</wim-text></wim-button-big></div></wim-modal-content><wim-info-footer><wim-text color="secondary" variant="small-thin">Choose WalletConnect to see supported apps on your device</wim-text></wim-info-footer>`
    }
  };
  hT.styles = [Dr.globalCss, SPe], hT = kPe([Ur("wim-android-wallet-selection")], hT);
  const RPe = Zr`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--wim-accent-color);animation:loading 1s linear infinite}wim-wallet-image{border-radius:var(--wim-wallet-icon-large-border-radius);width:90px;height:90px}wim-text{margin-bottom:40px}.wim-error svg{stroke:var(--wim-error-color)}.wim-error use{display:none}.wim-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wim-stale svg,.wim-stale use{display:none}`;
  var NPe = Object.defineProperty,
    MPe = Object.getOwnPropertyDescriptor,
    $m = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? MPe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && NPe(e, r, i), i
    };
  let sf = class extends Ir {
    constructor() {
      super(...arguments), this.walletId = void 0, this.imageId = void 0, this.isError = !1, this.isStale = !1, this.label = ""
    }
    svgLoaderTemplate() {
      var t, e;
      const s = (e = (t = Jh.state.themeVariables) == null ? void 0 : t["--wim-wallet-icon-large-border-radius"]) != null ? e : Dr.getPreset("--wim-wallet-icon-large-border-radius");
      let o = 0;
      s.includes("%") ? o = 88 / 100 * parseInt(s, 10) : o = parseInt(s, 10), o *= 1.17;
      const a = 317 - o * 1.57,
        c = 425 - o * 1.8;
      return dt`<svg viewBox="0 0 110 110" width="110" height="110"><rect id="wim-loader" x="2" y="2" width="106" height="106" rx="${o}"/><use xlink:href="#wim-loader" stroke-dasharray="106 ${a}" stroke-dashoffset="${c}"></use></svg>`
    }
    render() {
      const t = {
        "wim-error": this.isError,
        "wim-stale": this.isStale
      };
      return dt`<div class="${yd(t)}">${this.svgLoaderTemplate()}<wim-wallet-image walletId="${qs(this.walletId)}" imageId="${qs(this.imageId)}"></wim-wallet-image></div><wim-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Connection declined":this.label}</wim-text>`
    }
  };
  sf.styles = [Dr.globalCss, RPe], $m([vr()], sf.prototype, "walletId", 2), $m([vr()], sf.prototype, "imageId", 2), $m([vr({
    type: Boolean
  })], sf.prototype, "isError", 2), $m([vr({
    type: Boolean
  })], sf.prototype, "isStale", 2), $m([vr()], sf.prototype, "label", 2), sf = $m([Ur("wim-connector-waiting")], sf);
  const Om = {
      manualWallets() {
        var t, e;
        const {
          mobileWallets: r,
          desktopWallets: n
        } = Qo.state, i = (t = Om.recentWallet()) == null ? void 0 : t.id, s = Dt.isMobile() ? r : n, o = s?.filter(a => i !== a.id);
        return (e = Dt.isMobile() ? o?.map(({
          id: a,
          name: c,
          links: l
        }) => ({
          id: a,
          name: c,
          mobile: l,
          links: l
        })) : o?.map(({
          id: a,
          name: c,
          links: l
        }) => ({
          id: a,
          name: c,
          desktop: l,
          links: l
        }))) != null ? e : []
      },
      recentWallet() {
        return ar.getRecentWallet()
      },
      recomendedWallets(t = !1) {
        var e;
        const r = t || (e = Om.recentWallet()) == null ? void 0 : e.id,
          {
            recomendedWallets: n
          } = Co.state;
        return n.filter(s => r !== s.id)
      }
    },
    of = {
      onConnecting(t) {
        ar.goToConnectingView(t)
      },
      manualWalletsTemplate() {
        return Om.manualWallets().map(e => dt`<wim-wallet-button walletId="${e.id}" name="${e.name}" .onClick="${()=>this.onConnecting(e)}"></wim-wallet-button>`)
      },
      recomendedWalletsTemplate(t = !1) {
        return Om.recomendedWallets(t).map(r => dt`<wim-wallet-button name="${r.name}" walletId="${r.id}" imageId="${r.image_id}" .onClick="${()=>this.onConnecting(r)}"></wim-wallet-button>`)
      },
      recentWalletTemplate() {
        const t = Om.recentWallet();
        if (t) return dt`<wim-wallet-button name="${t.name}" walletId="${t.id}" imageId="${qs(t.image_id)}" .recent="${!0}" .onClick="${()=>this.onConnecting(t)}"></wim-wallet-button>`
      }
    },
    PPe = Zr`.wim-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wim-desktop-title,.wim-mobile-title{display:flex;align-items:center}.wim-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wim-desktop-title{margin-bottom:10px;padding:0 10px}.wim-subtitle{display:flex;align-items:center}.wim-subtitle:last-child path{fill:var(--wim-color-fg-3)}.wim-desktop-title svg,.wim-mobile-title svg{margin-right:6px}.wim-desktop-title path,.wim-mobile-title path{fill:var(--wim-accent-color)}`;
  var $Pe = Object.defineProperty,
    OPe = Object.getOwnPropertyDescriptor,
    DPe = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? OPe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && $Pe(e, r, i), i
    };
  let fT = class extends Ir {
    render() {
      const {
        explorerExcludedWalletIds: t,
        enableExplorer: e
      } = Qo.state, r = t !== "ALL" && e, n = of.manualWalletsTemplate(), i = of.recomendedWalletsTemplate();
      let o = [of.recentWalletTemplate(), ...n, ...i];
      o = o.filter(Boolean);
      const a = o.length > 4 || r;
      let c = [];
      a ? c = o.slice(0, 3) : c = o;
      const l = !!c.length;
      return dt`<wim-modal-header .border="${!0}" title="Connect your wallet" .onAction="${ar.handleUriCopy}" .actionIcon="${en.COPY_ICON}"></wim-modal-header><wim-modal-content><div class="wim-mobile-title"><div class="wim-subtitle">${en.MOBILE_ICON}<wim-text variant="small-regular" color="accent">Mobile</wim-text></div><div class="wim-subtitle">${en.SCAN_ICON}<wim-text variant="small-regular" color="secondary">Scan with your wallet</wim-text></div></div><wim-walletconnect-qr></wim-walletconnect-qr></wim-modal-content>${l?dt`<wim-modal-footer><div class="wim-desktop-title">${en.DESKTOP_ICON}<wim-text variant="small-regular" color="accent">Desktop</wim-text></div><div class="wim-grid">${c} ${a?dt`<wim-view-all-wallets-button></wim-view-all-wallets-button>`:null}</div></wim-modal-footer>`:null}`
    }
  };
  fT.styles = [Dr.globalCss, PPe], fT = DPe([Ur("wim-desktop-wallet-selection")], fT);
  const LPe = Zr`div{background-color:var(--wim-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wim-color-bg-3);text-align:center}a{color:var(--wim-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;
  var BPe = Object.defineProperty,
    UPe = Object.getOwnPropertyDescriptor,
    jPe = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? UPe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && BPe(e, r, i), i
    };
  let pT = class extends Ir {
    render() {
      const {
        termsOfServiceUrl: t,
        privacyPolicyUrl: e
      } = Qo.state;
      return t ?? e ? dt`<div><wim-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's ${t?dt`<a href="${t}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${t&&e?"and":null} ${e?dt`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</wim-text></div>` : null
    }
  };
  pT.styles = [Dr.globalCss, LPe], pT = jPe([Ur("wim-legal-notice")], pT);
  const FPe = Zr`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;
  var WPe = Object.defineProperty,
    zPe = Object.getOwnPropertyDescriptor,
    HPe = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? zPe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && WPe(e, r, i), i
    };
  let gT = class extends Ir {
    onQrcode() {
      zn.push("Qrcode")
    }
    render() {
      const {
        explorerExcludedWalletIds: t,
        enableExplorer: e
      } = Qo.state, r = t !== "ALL" && e, n = of.manualWalletsTemplate(), i = of.recomendedWalletsTemplate();
      let o = [of.recentWalletTemplate(), ...n, ...i];
      o = o.filter(Boolean);
      const a = o.length > 8 || r;
      let c = [];
      a ? c = o.slice(0, 7) : c = o;
      const l = !!c.length;
      return dt`<wim-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${en.QRCODE_ICON}"></wim-modal-header>${l?dt`<wim-modal-content><div>${c} ${a?dt`<wim-view-all-wallets-button></wim-view-all-wallets-button>`:null}</div></wim-modal-content>`:null}`
    }
  };
  gT.styles = [Dr.globalCss, FPe], gT = HPe([Ur("wim-mobile-wallet-selection")], gT);
  const qPe = Zr`:host{all:initial}.wim-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wim-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wim-overlay-background-color);backdrop-filter:var(--wim-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wim-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wim-active{pointer-events:auto}.wim-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wim-background-border-radius) var(--wim-background-border-radius) var(--wim-container-border-radius) var(--wim-container-border-radius);border:1px solid var(--wim-color-overlay);overflow:hidden}.wim-card{width:100%;position:relative;border-radius:var(--wim-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--wim-color-overlay);background-color:var(--wim-color-bg-1);color:var(--wim-color-fg-1)}@media(max-width:600px){.wim-container{max-width:440px;border-radius:var(--wim-background-border-radius) var(--wim-background-border-radius) 0 0}.wim-card{border-radius:var(--wim-container-border-radius) var(--wim-container-border-radius) 0 0}.wim-overlay{align-items:flex-end}}@media(max-width:440px){.wim-container{border:0}}`;
  var VPe = Object.defineProperty,
    KPe = Object.getOwnPropertyDescriptor,
    mT = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? KPe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && VPe(e, r, i), i
    };
  let Dm = class extends Ir {
    constructor() {
      super(), this.open = !1, this.active = !1, this.unsubscribeModal = void 0, this.abortController = void 0, this.unsubscribeModal = bp.subscribe(t => {
        t.open ? this.onOpenModalEvent() : this.onCloseModalEvent()
      })
    }
    disconnectedCallback() {
      var t;
      (t = this.unsubscribeModal) == null || t.call(this)
    }
    get overlayEl() {
      return ar.getShadowRootElement(this, ".wim-overlay")
    }
    get containerEl() {
      return ar.getShadowRootElement(this, ".wim-container")
    }
    toggleBodyScroll(t) {
      if (document.querySelector("body"))
        if (t) {
          const r = document.getElementById("wim-styles");
          r?.remove()
        } else document.head.insertAdjacentHTML("beforeend", '<style id="wim-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>')
    }
    onCloseModal(t) {
      t.target === t.currentTarget && bp.close()
    }
    onOpenModalEvent() {
      this.toggleBodyScroll(!1), this.addKeyboardEvents(), this.open = !0, setTimeout(async () => {
        const t = ar.isMobileAnimation() ? {
            y: ["50vh", "0vh"]
          } : {
            scale: [.98, 1]
          },
          e = .1,
          r = .2;
        await Promise.all([Ap(this.overlayEl, {
          opacity: [0, 1]
        }, {
          delay: e,
          duration: r
        }).finished, Ap(this.containerEl, t, {
          delay: e,
          duration: r
        }).finished]), this.active = !0
      }, 0)
    }
    async onCloseModalEvent() {
      this.toggleBodyScroll(!0), this.removeKeyboardEvents();
      const t = ar.isMobileAnimation() ? {
          y: ["0vh", "50vh"]
        } : {
          scale: [1, .98]
        },
        e = .2;
      await Promise.all([Ap(this.overlayEl, {
        opacity: [1, 0]
      }, {
        duration: e
      }).finished, Ap(this.containerEl, t, {
        duration: e
      }).finished]), this.containerEl.removeAttribute("style"), this.active = !1, this.open = !1
    }
    addKeyboardEvents() {
      this.abortController = new AbortController, window.addEventListener("keydown", t => {
        var e;
        t.key === "Escape" ? bp.close() : t.key === "Tab" && ((e = t.target) != null && e.tagName.includes("wim-") || this.containerEl.focus())
      }, this.abortController), this.containerEl.focus()
    }
    removeKeyboardEvents() {
      var t;
      (t = this.abortController) == null || t.abort(), this.abortController = void 0
    }
    render() {
      const t = {
        "wim-overlay": !0,
        "wim-active": this.active
      };
      return dt`<wim-explorer-context></wim-explorer-context><wim-theme-context></wim-theme-context><div id="wim-modal" class="${yd(t)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="wim-container" tabindex="0">${this.open?dt`<wim-modal-backcard></wim-modal-backcard><div class="wim-card"><wim-modal-router></wim-modal-router><wim-modal-toast></wim-modal-toast></div>`:null}</div></div>`
    }
  };
  Dm.styles = [Dr.globalCss, qPe], mT([Eo()], Dm.prototype, "open", 2), mT([Eo()], Dm.prototype, "active", 2), Dm = mT([Ur("wim-modal")], Dm);
  const GPe = Zr`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wim-button{margin:0 5px}`;
  var ZPe = Object.defineProperty,
    YPe = Object.getOwnPropertyDescriptor,
    h3 = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? YPe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && ZPe(e, r, i), i
    };
  let Ip = class extends Ir {
    constructor() {
      super(...arguments), this.isMobile = !1, this.isDesktop = !1, this.isWeb = !1, this.isRetry = !1
    }
    onMobile() {
      Dt.isMobile() ? zn.replace("MobileConnecting") : zn.replace("MobileQrcodeConnecting")
    }
    onDesktop() {
      zn.replace("DesktopConnecting")
    }
    onWeb() {
      zn.replace("WebConnecting")
    }
    render() {
      return dt`<div>${this.isRetry?dt`<slot></slot>`:null} ${this.isMobile?dt`<wim-button .onClick="${this.onMobile}" .iconLeft="${en.MOBILE_ICON}" variant="outline">Mobile</wim-button>`:null} ${this.isDesktop?dt`<wim-button .onClick="${this.onDesktop}" .iconLeft="${en.DESKTOP_ICON}" variant="outline">Desktop</wim-button>`:null} ${this.isWeb?dt`<wim-button .onClick="${this.onWeb}" .iconLeft="${en.GLOBE_ICON}" variant="outline">Web</wim-button>`:null}</div>`
    }
  };
  Ip.styles = [Dr.globalCss, GPe], h3([vr({
    type: Boolean
  })], Ip.prototype, "isMobile", 2), h3([vr({
    type: Boolean
  })], Ip.prototype, "isDesktop", 2), h3([vr({
    type: Boolean
  })], Ip.prototype, "isWeb", 2), h3([vr({
    type: Boolean
  })], Ip.prototype, "isRetry", 2), Ip = h3([Ur("wim-platform-selection")], Ip);
  const QPe = Zr`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wim-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wim-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wim-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wim-color-bg-2);box-shadow:inset 0 0 0 1px var(--wim-color-overlay)}button:active{background-color:var(--wim-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wim-color-overlay)}}.wim-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wim-wallet-icon-border-radius)/ 2);border:1px solid var(--wim-color-overlay)}.wim-icons svg{width:21px;height:21px}.wim-icons img:nth-child(1),.wim-icons img:nth-child(2),.wim-icons svg:nth-child(1),.wim-icons svg:nth-child(2){margin-bottom:4px}wim-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wim-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wim-color-overlay)}`;
  var JPe = Object.defineProperty,
    XPe = Object.getOwnPropertyDescriptor,
    e$e = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? XPe(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && JPe(e, r, i), i
    };
  let wT = class extends Ir {
    onClick() {
      zn.push("WalletExplorer")
    }
    render() {
      const {
        recomendedWallets: t
      } = Co.state, e = Om.manualWallets(), r = [...t, ...e].reverse().slice(0, 4);
      return dt`<button @click="${this.onClick}"><div class="wim-icons">${r.map(n=>{const i=ar.getWalletIcon(n);if(i)return dt`<img crossorigin="anonymous" src="${i}">`;const s=ar.getWalletIcon({id:n.id});return s?dt` < img crossorigin = "anonymous"
      src = "${s}" > `:en.WALLET_PLACEHOLDER})} ${[...Array(4-r.length)].map(()=>en.WALLET_PLACEHOLDER)}</div><wim-text variant="xsmall-regular">View All</wim-text></button>`
    }
  };
  wT.styles = [Dr.globalCss, QPe], wT = e$e([Ur("wim-view-all-wallets-button")], wT);
  const t$e = Zr`.wim-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;
  var r$e = Object.defineProperty,
    n$e = Object.getOwnPropertyDescriptor,
    c_ = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? n$e(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && r$e(e, r, i), i
    };
  let Lm = class extends Ir {
    constructor() {
      super(), this.walletId = "", this.imageId = "", this.uri = "", setTimeout(() => {
        const {
          walletConnectUri: t
        } = li.state;
        this.uri = t
      }, 0)
    }
    get overlayEl() {
      return ar.getShadowRootElement(this, ".wim-qr-container")
    }
    render() {
      return dt`<div class="wim-qr-container">${this.uri?dt`<wim-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}" walletId="${qs(this.walletId)}" imageId="${qs(this.imageId)}"></wim-qrcode>`:dt`<wim-spinner></wim-spinner>`}</div>`
    }
  };
  Lm.styles = [Dr.globalCss, t$e], c_([vr()], Lm.prototype, "walletId", 2), c_([vr()], Lm.prototype, "imageId", 2), c_([Eo()], Lm.prototype, "uri", 2), Lm = c_([Ur("wim-walletconnect-qr")], Lm);
  var i$e = Object.defineProperty,
    s$e = Object.getOwnPropertyDescriptor,
    o$e = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? s$e(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && i$e(e, r, i), i
    };
  let vT = class extends Ir {
    viewTemplate() {
      return Dt.isAndroid() && !Dt.isTelegram() ? dt`<wim-android-wallet-selection></wim-android-wallet-selection>` : Dt.isMobile() ? dt`<wim-mobile-wallet-selection></wim-mobile-wallet-selection>` : dt`<wim-desktop-wallet-selection></wim-desktop-wallet-selection>`
    }
    render() {
      return dt`${this.viewTemplate()}<wim-legal-notice></wim-legal-notice>`
    }
  };
  vT.styles = [Dr.globalCss], vT = o$e([Ur("wim-connect-wallet-view")], vT);
  const a$e = Zr`wim-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wim-text{text-align:center}`;
  var c$e = Object.defineProperty,
    l$e = Object.getOwnPropertyDescriptor,
    WK = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? l$e(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && c$e(e, r, i), i
    };
  let l_ = class extends Ir {
    constructor() {
      super(), this.isError = !1, this.openDesktopApp()
    }
    onFormatAndRedirect(t) {
      const {
        desktop: e,
        name: r
      } = Dt.getWalletRouterData(), n = e?.native, i = e?.universal;
      if (n) {
        const s = Dt.formatNativeUrl(n, t, r);
        Dt.openHref(s, "_self")
      } else if (i) {
        const s = Dt.formatUniversalUrl(i, t, r);
        Dt.openHref(s, "_blank")
      }
    }
    openDesktopApp() {
      const {
        walletConnectUri: t
      } = li.state, e = Dt.getWalletRouterData();
      ar.setRecentWallet(e), t && this.onFormatAndRedirect(t)
    }
    render() {
      const {
        name: t,
        id: e,
        image_id: r
      } = Dt.getWalletRouterData(), {
        isMobile: n,
        isWeb: i
      } = ar.getCachedRouterWalletPlatforms();
      return dt`<wim-modal-header title="${t}" .onAction="${ar.handleUriCopy}" .actionIcon="${en.COPY_ICON}"></wim-modal-header><wim-modal-content><wim-connector-waiting walletId="${e}" imageId="${qs(r)}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></wim-connector-waiting></wim-modal-content><wim-info-footer><wim-text color="secondary" variant="small-thin">${`Connection can continue loading if ${t} is not installed on your device`}</wim-text><wim-platform-selection .isMobile="${n}" .isWeb="${i}" .isRetry="${!0}"><wim-button .onClick="${this.openDesktopApp.bind(this)}" .iconRight="${en.RETRY_ICON}">Retry</wim-button></wim-platform-selection></wim-info-footer>`
    }
  };
  l_.styles = [Dr.globalCss, a$e], WK([Eo()], l_.prototype, "isError", 2), l_ = WK([Ur("wim-desktop-connecting-view")], l_);
  const u$e = Zr`wim-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wim-text{text-align:center}wim-button{margin-top:15px}`;
  var d$e = Object.defineProperty,
    h$e = Object.getOwnPropertyDescriptor,
    f$e = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? h$e(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && d$e(e, r, i), i
    };
  let bT = class extends Ir {
    onInstall(t) {
      t && Dt.openHref(t, "_blank")
    }
    render() {
      const {
        name: t,
        id: e,
        image_id: r,
        homepage: n
      } = Dt.getWalletRouterData();
      return dt`<wim-modal-header title="${t}"></wim-modal-header><wim-modal-content><wim-connector-waiting walletId="${e}" imageId="${qs(r)}" label="Not Detected" .isStale="${!0}"></wim-connector-waiting></wim-modal-content><wim-info-footer><wim-text color="secondary" variant="small-thin">${`Download ${t} to continue. If multiple browser extensions are installed, disable non ${t} ones and try again`}</wim-text><wim-button .onClick="${()=>this.onInstall(n)}" .iconLeft="${en.ARROW_DOWN_ICON}">Download</wim-button></wim-info-footer>`
    }
  };
  bT.styles = [Dr.globalCss, u$e], bT = f$e([Ur("wim-install-wallet-view")], bT);
  const p$e = Zr`wim-wallet-image{border-radius:var(--wim-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wim-info-footer{display:flex;width:100%}.wim-app-store{justify-content:space-between}.wim-app-store wim-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wim-wallet-icon-small-border-radius)}.wim-app-store div{display:flex;align-items:center}.wim-app-store wim-button{margin-right:-10px}.wim-note{flex-direction:column;align-items:center;padding:5px 0}.wim-note wim-text{text-align:center}wim-platform-selection{margin-top:-15px}.wim-note wim-text{margin-top:15px}.wim-note wim-text span{color:var(--wim-accent-color)}`;
  var g$e = Object.defineProperty,
    m$e = Object.getOwnPropertyDescriptor,
    zK = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? m$e(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && g$e(e, r, i), i
    };
  let u_ = class extends Ir {
    constructor() {
      super(), this.isError = !1, this.openMobileApp()
    }
    onFormatAndRedirect(t, e = !1) {
      const {
        mobile: r,
        name: n
      } = Dt.getWalletRouterData(), i = r?.native, s = r?.universal, o = Dt.isTelegram() ? "_blank" : "_self";
      if (t = Dt.isTelegram() && Dt.isAndroid() ? encodeURIComponent(t) : t, i && !e) {
        const a = Dt.formatNativeUrl(i, t, n);
        Dt.openHref(a, o)
      } else if (s) {
        const a = Dt.formatUniversalUrl(s, t, n);
        Dt.openHref(a, o)
      }
    }
    openMobileApp(t = !1) {
      const {
        walletConnectUri: e
      } = li.state, r = Dt.getWalletRouterData();
      e && this.onFormatAndRedirect(e, t), ar.setRecentWallet(r)
    }
    onGoToAppStore(t) {
      t && Dt.openHref(t, "_blank")
    }
    render() {
      const {
        name: t,
        id: e,
        image_id: r,
        app: n,
        mobile: i
      } = Dt.getWalletRouterData(), {
        isWeb: s
      } = ar.getCachedRouterWalletPlatforms(), o = n?.ios, a = i?.universal;
      return dt`<wim-modal-header title="${t}"></wim-modal-header><wim-modal-content><wim-connector-waiting walletId="${e}" imageId="${qs(r)}" label="Tap 'Open' to continue…" .isError="${this.isError}"></wim-connector-waiting></wim-modal-content><wim-info-footer class="wim-note"><wim-platform-selection .isWeb="${s}" .isRetry="${!0}"><wim-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${en.RETRY_ICON}">Retry</wim-button></wim-platform-selection>${a?dt`<wim-text color="secondary" variant="small-thin">Still doesn't work? <span tabindex="0" @click="${()=>this.openMobileApp(!0)}">Try this alternate link</span></wim-text>`:null}</wim-info-footer><wim-info-footer class="wim-app-store"><div><wim-wallet-image walletId="${e}" imageId="${qs(r)}"></wim-wallet-image><wim-text>${`Get ${t}`}</wim-text></div><wim-button .iconRight="${en.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(o)}" variant="ghost">App Store</wim-button></wim-info-footer>`
    }
  };
  u_.styles = [Dr.globalCss, p$e], zK([Eo()], u_.prototype, "isError", 2), u_ = zK([Ur("wim-mobile-connecting-view")], u_);
  const w$e = Zr`wim-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wim-text{text-align:center}`;
  var v$e = Object.defineProperty,
    b$e = Object.getOwnPropertyDescriptor,
    y$e = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? b$e(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && v$e(e, r, i), i
    };
  let yT = class extends Ir {
    render() {
      const {
        name: t,
        id: e,
        image_id: r
      } = Dt.getWalletRouterData(), {
        isDesktop: n,
        isWeb: i
      } = ar.getCachedRouterWalletPlatforms();
      return dt`<wim-modal-header title="${t}" .onAction="${ar.handleUriCopy}" .actionIcon="${en.COPY_ICON}"></wim-modal-header><wim-modal-content><wim-walletconnect-qr walletId="${e}" imageId="${qs(r)}"></wim-walletconnect-qr></wim-modal-content><wim-info-footer><wim-text color="secondary" variant="small-thin">${`Scan this QR Code with your phone's camera or inside ${t} app`}</wim-text><wim-platform-selection .isDesktop="${n}" .isWeb="${i}"></wim-platform-selection></wim-info-footer>`
    }
  };
  yT.styles = [Dr.globalCss, w$e], yT = y$e([Ur("wim-mobile-qr-connecting-view")], yT);
  var _$e = Object.defineProperty,
    x$e = Object.getOwnPropertyDescriptor,
    C$e = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? x$e(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && _$e(e, r, i), i
    };
  let _T = class extends Ir {
    render() {
      return dt`<wim-modal-header title="Scan the code" .onAction="${ar.handleUriCopy}" .actionIcon="${en.COPY_ICON}"></wim-modal-header><wim-modal-content><wim-walletconnect-qr></wim-walletconnect-qr></wim-modal-content>`
    }
  };
  _T.styles = [Dr.globalCss], _T = C$e([Ur("wim-qrcode-view")], _T);
  const E$e = Zr`wim-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wim-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wim-modal-content::after,wim-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wim-modal-content::before{box-shadow:0 -1px 0 0 var(--wim-color-bg-1);background:linear-gradient(var(--wim-color-bg-1),rgba(255,255,255,0))}wim-modal-content::after{box-shadow:0 1px 0 0 var(--wim-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wim-color-bg-1));top:calc(100% - 20px)}wim-modal-content::-webkit-scrollbar{display:none}.wim-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wim-empty,.wim-loading{display:flex}.wim-loading .wim-placeholder-block{height:100%}.wim-end-reached .wim-placeholder-block{height:0;opacity:0}.wim-empty .wim-placeholder-block{opacity:1;height:100%}wim-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;
  var A$e = Object.defineProperty,
    S$e = Object.getOwnPropertyDescriptor,
    f3 = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? S$e(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && A$e(e, r, i), i
    };
  const xT = 40;
  let Tp = class extends Ir {
    constructor() {
      super(...arguments), this.loading = !Co.state.wallets.listings.length, this.firstFetch = !Co.state.wallets.listings.length, this.search = "", this.endReached = !1, this.intersectionObserver = void 0, this.searchDebounce = ar.debounce(t => {
        t.length >= 1 ? (this.firstFetch = !0, this.endReached = !1, this.search = t, Co.resetSearch(), this.fetchWallets()) : this.search && (this.search = "", this.endReached = this.isLastPage(), Co.resetSearch())
      })
    }
    firstUpdated() {
      this.createPaginationObserver()
    }
    disconnectedCallback() {
      var t;
      (t = this.intersectionObserver) == null || t.disconnect()
    }
    get placeholderEl() {
      return ar.getShadowRootElement(this, ".wim-placeholder-block")
    }
    createPaginationObserver() {
      this.intersectionObserver = new IntersectionObserver(([t]) => {
        t.isIntersecting && !(this.search && this.firstFetch) && this.fetchWallets()
      }), this.intersectionObserver.observe(this.placeholderEl)
    }
    isLastPage() {
      const {
        wallets: t,
        search: e
      } = Co.state, {
        listings: r,
        total: n
      } = this.search ? e : t;
      return n <= xT || r.length >= n
    }
    async fetchWallets() {
      var t;
      const {
        wallets: e,
        search: r
      } = Co.state, {
        listings: n,
        total: i,
        page: s
      } = this.search ? r : e;
      if (!this.endReached && (this.firstFetch || i > xT && n.length < i)) try {
        this.loading = !0;
        const o = (t = li.state.chains) == null ? void 0 : t.join(","),
          {
            listings: a
          } = await Co.getWallets({
            page: this.firstFetch ? 1 : s + 1,
            entries: xT,
            search: this.search,
            version: 2,
            chains: o
          }),
          c = a.map(l => ar.getWalletIcon(l));
        await Promise.all([...c.map(async l => ar.preloadImage(l)), Dt.wait(300)]), this.endReached = this.isLastPage()
      } catch (o) {
        console.error(o), Xh.openToast(ar.getErrorMessage(o), "error")
      } finally {
        this.loading = !1, this.firstFetch = !1
      }
    }
    onConnect(t) {
      Dt.isAndroid() ? ar.handleMobileLinking(t) : ar.goToConnectingView(t)
    }
    onSearchChange(t) {
      const {
        value: e
      } = t.target;
      this.searchDebounce(e)
    }
    render() {
      const {
        wallets: t,
        search: e
      } = Co.state, {
        listings: r
      } = this.search ? e : t, n = this.loading && !r.length, i = this.search.length >= 3;
      let s = of.manualWalletsTemplate(),
        o = of.recomendedWalletsTemplate(!0);
      i && (s = s.filter(({
        values: l
      }) => ar.caseSafeIncludes(l[0], this.search)), o = o.filter(({
        values: l
      }) => ar.caseSafeIncludes(l[0], this.search)));
      const a = !this.loading && !r.length && !o.length,
        c = {
          "wim-loading": n,
          "wim-end-reached": this.endReached || !this.loading,
          "wim-empty": a
        };
      return dt`<wim-modal-header><wim-search-input .onChange="${this.onSearchChange.bind(this)}"></wim-search-input></wim-modal-header><wim-modal-content class="${yd(c)}"><div class="wim-grid">${n?null:s} ${n?null:o} ${n?null:r.map(l=>dt`${l?dt`<wim-wallet-button imageId="${l.image_id}" name="${l.name}" walletId="${l.id}" .onClick="${()=>this.onConnect(l)}"></wim-wallet-button>`:null}`)}</div><div class="wim-placeholder-block">${a?dt`<wim-text variant="big-bold" color="secondary">No results found</wim-text>`:null} ${!a&&this.loading?dt`<wim-spinner></wim-spinner>`:null}</div></wim-modal-content>`
    }
  };
  Tp.styles = [Dr.globalCss, E$e], f3([Eo()], Tp.prototype, "loading", 2), f3([Eo()], Tp.prototype, "firstFetch", 2), f3([Eo()], Tp.prototype, "search", 2), f3([Eo()], Tp.prototype, "endReached", 2), Tp = f3([Ur("wim-wallet-explorer-view")], Tp);
  const I$e = Zr`wim-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wim-text{text-align:center}`;
  var T$e = Object.defineProperty,
    k$e = Object.getOwnPropertyDescriptor,
    HK = (t, e, r, n) => {
      for (var i = n > 1 ? void 0 : n ? k$e(e, r) : e, s = t.length - 1, o; s >= 0; s--)(o = t[s]) && (i = (n ? o(e, r, i) : o(i)) || i);
      return n && i && T$e(e, r, i), i
    };
  let d_ = class extends Ir {
    constructor() {
      super(), this.isError = !1, this.openWebWallet()
    }
    onFormatAndRedirect(t) {
      const {
        desktop: e,
        name: r
      } = Dt.getWalletRouterData(), n = e?.universal;
      if (n) {
        const i = Dt.formatUniversalUrl(n, t, r);
        Dt.openHref(i, "_blank")
      }
    }
    openWebWallet() {
      const {
        walletConnectUri: t
      } = li.state, e = Dt.getWalletRouterData();
      ar.setRecentWallet(e), t && this.onFormatAndRedirect(t)
    }
    render() {
      const {
        name: t,
        id: e,
        image_id: r
      } = Dt.getWalletRouterData(), {
        isMobile: n,
        isDesktop: i
      } = ar.getCachedRouterWalletPlatforms(), s = Dt.isMobile();
      return dt`<wim-modal-header title="${t}" .onAction="${ar.handleUriCopy}" .actionIcon="${en.COPY_ICON}"></wim-modal-header><wim-modal-content><wim-connector-waiting walletId="${e}" imageId="${qs(r)}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></wim-connector-waiting></wim-modal-content><wim-info-footer><wim-text color="secondary" variant="small-thin">${`${t} web app has opened in a new tab. Go there, accept the connection, and come back`}</wim-text><wim-platform-selection .isMobile="${n}" .isDesktop="${s?!1:i}" .isRetry="${!0}"><wim-button .onClick="${this.openWebWallet.bind(this)}" .iconRight="${en.RETRY_ICON}">Retry</wim-button></wim-platform-selection></wim-info-footer>`
    }
  };
  d_.styles = [Dr.globalCss, I$e], HK([Eo()], d_.prototype, "isError", 2), d_ = HK([Ur("wim-web-connecting-view")], d_);
  const R$e = Object.freeze(Object.defineProperty({
    __proto__: null,
    get WcmModal() {
      return Dm
    },
    get WcmQrCode() {
      return xd
    }
  }, Symbol.toStringTag, {
    value: "Module"
  }))
});